fix(fees): treat zero-budget chain allocations as absent 🐛 - #54
Conversation
- Match consensus allocation resolution in the v0.3 executor: an entry with a concrete recipient and a zero budget no longer matches, so a zero-budget exact key falls through to the per-recipient `call_key` wildcard and a zero-budget wildcard to no allocation - Describe the rule in the fee impl-spec and the manager API schema
GenVM PR actionsTick a box to run it (the box unticks itself when handled). Actions only run while the PR has the
Commands
|
Linked executor PR(s)executor: genlayerlabs/genvm-executor#47 (v0.3) |
|
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 configurationConfiguration used: Repository: genlayerlabs/genvm-manager/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughFee allocation documentation now distinguishes concrete chain entries from synthetic recipient wildcards and describes how zero budgets affect matching. The budget field descriptions were updated, and the v0.3.x executor submodule reference changed. ChangesFee allocation matching
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is established. The updated contract consistently describes zero-budget fallback while preserving local-exhaustion precedence; merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change narrowly aligns zero-budget allocation matching with chain behavior. The documented rules preserve recipient restrictions, local-exhaustion checks, and receipt charging. No new security bypass was established, but the changed execution code and its failure-recovery behavior could not be fully verified. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings
🧪 Generate unit tests (beta)
🛠️ Fix failing CI checks 💡
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. Comment |
|
/genvm-run-tests |
|
👀 Full tests are running for |
|
/run-e2e all |
|
E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally. |
|
/merge |
|
The request is recorded and waiting for processing. Follow the E2E and merge checks for progress. Do not post a duplicate command. |
Problem and outcome
Consensus resolves only allocation keys with a nonzero stored budget:
resolveAllocationKeytakes the exact key ifbudget > 0, else thecallKeywildcard ifbudget > 0, else revertsMessageNoMatchingAllocation_tryReserveOnKeyskipsbudget == 0keys, and falls back to the legacy unallocated path when both keys are zeroThe v0.3 executor matched zero-budget entries and failed their budget check instead, so it rejected messages the chain would fund from the wildcard or accept as unallocated. Now an entry with a concrete recipient and a zero budget is absent. Synthetic recipient wildcards (
recipient: None, executor-only) keep matching at any budget. A key used up by the execution's own emissions still never spillsNon-goal: v0.2.x keeps the old matching
Implementation and validation
allocation_match_prioritydrops zero-budget chain entries, so the internal resolver and external candidate list both see them as absent04-fees.rst,manager-api.yamland theMessageAllocationNode::budgetdoc describe stored chain budgets; the old "optionally reduced by prior consumption" allowance is gone, since a host lowering a budget to 0 would now turn exhausted into absent. genlayer-node already passes stored budgetscargo test --lib genlayer_sdk: 87 passedSummary by CodeRabbit
nullbudgets are uncapped and that allocations absent on-chain should be omitted.