Skip to content

fix(fees): treat zero-budget chain allocations as absent 🐛 - #47

Merged
kp2pml30 merged 1 commit into
v0.3-devfrom
pr/v0.3/fix/zero-budget-allocation-keys
Oct 1, 2026
Merged

kp2pml30 merged 1 commit into
v0.3-devfrom
pr/v0.3/fix/zero-budget-allocation-keys

Conversation

@kp2pml30

@kp2pml30 kp2pml30 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Auto-opened executor mirror of genlayerlabs/genvm-manager#54.

Carries the executor-side work for that manager PR. The manager branch update fast-forwards v0.3-dev to its pinned commit after landing.

Summary by CodeRabbit

  • Bug Fixes
    • Recipient-specific allocations with an explicitly zero budget are no longer selected, allowing a matching wildcard allocation to be used instead.
    • Positive-budget allocations continue to be consumed before being treated as exhausted. Zero-budget internal wildcard allocations remain matchable.

- Consensus resolves only allocation keys with a nonzero stored budget, so a zero-budget exact key now falls through to the per-recipient `call_key` wildcard, and a zero-budget wildcard to no allocation, instead of trapping on its budget
- Synthetic recipient wildcards keep matching regardless of budget; keys exhausted by the execution's own emissions still never spill
- Cover both internal emission paths end to end, the external unallocated fallback, phase interaction and the synthetic wildcard
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: genlayerlabs/genvm-executor/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 14205920-8f74-42c3-92ec-9581e0a4a772

📥 Commits

Reviewing files that changed from the base of the PR and between 16b8173 and f7f95a3.

📒 Files selected for processing (2)
  • executor/src/wasi/genlayer_sdk/message.rs
  • executor/src/wasi/genlayer_sdk/tests.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The allocation matching function now skips recipient-specific allocations with explicitly zero budgets. Tests cover internal and external matching, wildcard selection, budget consumption, and exhaustion.

Changes

Allocation matching

Layer / File(s) Summary
Matching rules
executor/src/wasi/genlayer_sdk/message.rs, executor/src/wasi/genlayer_sdk/tests.rs
The matching function excludes recipient-specific allocations with explicit zero budgets. Tests cover internal matching and external candidates, including wildcard and synthetic allocations.
Emission and budget checks
executor/src/wasi/genlayer_sdk/tests.rs
Internal and external emission tests cover wildcard selection, budget consumption, and errors when allocations are unavailable or exhausted.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to f7f95

Zero-budget chain-key allocations are now treated as absent, so matching falls through to a wildcard or yields no allocation. Tests cover the intended cases and no merge-blocking risk was identified.

Architecture Summary

Architecture risk: 🔵 Low · up to f7f95

The change affects 1 system.

Changed systems: executor

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — executor (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in executor/src/wasi/genlayer_sdk/message.rs: allocation_match_priority now returns no match for a node with a recipient and an explicitly zero budget; previously, that node proceeded to recipient and call-key priority matching.
  • observed — Modified behavior in executor/src/wasi/genlayer_sdk/tests.rs: Renames the test to specify that zero-budget chain-key allocations are skipped.
  • observed — Modified behavior in executor/src/wasi/genlayer_sdk/tests.rs: Replaces the expectation that a zero-budget exact internal allocation matches with checks that it is skipped for a positive-budget wildcard, and that resolution returns no match when both allocations have zero budgets.
  • observed — Modified behavior in executor/src/wasi/genlayer_sdk/tests.rs: Adds a test setup with a zero-budget exact allocation whose phase differs from the requested phase; the test checks that it does not block the wildcard.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: zero-budget chain allocations are treated as absent. This matches the implementation and test updates.
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.

Warning

Some tools did not complete. Review the errors below.

🔧 Clippy (1.98.1)

Clippy execution failed


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kp2pml30
kp2pml30 merged commit f7f95a3 into v0.3-dev Oct 1, 2026
1 check passed
@kp2pml30
kp2pml30 deleted the pr/v0.3/fix/zero-budget-allocation-keys branch October 1, 2026 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant