Skip to content

fix(fees): reserve parent appeal capacity in Studio message allocations - #1784

Open
MuncleUscles wants to merge 1 commit into
genvm/fee-allocation-inputsfrom
fix/studio-parent-appeal-gas-260929
Open

MuncleUscles wants to merge 1 commit into
genvm/fee-allocation-inputsfrom
fix/studio-parent-appeal-gas-260929

Conversation

@MuncleUscles

@MuncleUscles MuncleUscles commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Problem and outcome

Studio validated on-acceptance internal message allocations using the child's appeal count and multiplied only its primary fee. Consensus requires (child primary fee + direct child allocation budgets) × (emitting parent's prepaid appeals + 1). Root allocations use the transaction's appeal schedule; nested allocations use their immediate parent's fee params. On-finalization uses one copy.

For a parent with three prepaid appeals, a child primary of 180 and direct child budget of 180, Studio previously accepted 360; consensus requires 1,440. The same mistake could also reject a valid allocation when only the child had appeals.

This PR aligns admission with the parent-based rule. Simulation discovery reserves each observed on-acceptance occurrence across the parent's prepaid appeal opportunities. An automatically inferred declaredBudget remains the cost of one child emission (primary plus direct children), so a single occurrence does not consume the whole lifecycle allocation.

Delivery context

Stacked on Studio #1774, the flat GenVM allocation-input change.

Depends-On: genlayerlabs/genlayer-consensus#1749

Consensus #1744 introduced the contract rule; consensus #1777 corrects its separate off-chain helper. Related Node #2019 carries the flat GenVM input adapter and already depends on Studio #1774. Node #2148 carries the newer remaining-allowance and fee-preparation work. Compose the exact Node and consensus candidate heads for release qualification; the flat-input Node PR's current targeted E2E still used an older consensus pin.

Implementation and validation

  • Pass the root's prepaid appeal count from transaction submission and child creation into allocation validation; use each nested emitting parent's committed fee params.
  • Multiply both the child primary fee and direct child budgets for on-acceptance capacity; keep finalization at one copy.
  • Correct discovery and per-occurrence funding so suggested allocations and emitted messages follow the same rule.
  • Cover 360 and 1,439 rejection versus the 1,440 boundary, opposite parent/child appeal counts, nested parents, finalization, discovery, and child-accounting admission.
  • Studio unit suite: 1,648 passed. Changed-file pre-commit hooks and git diff --check pass. Full cross-repository E2E has not run on this commit.

The separate allocation envelope/EQ-cap parity gaps and the beyond-prepaid bond-funded appeal policy in consensus #1717 are outside this gas change.

Price each on-acceptance internal allocation using its emitting parent’s prepaid appeal horizon and multiply the complete child requirement, including direct child budgets. Carry the root appeal count from the transaction or child fee distribution.

Fund every discovered acceptance emission opportunity while keeping an inferred per-message declared budget to one child primary plus its direct subtree. Cover the 360/1440 boundary, nested parents, finalization, discovery, and child accounting.
@MuncleUscles MuncleUscles self-assigned this Sep 29, 2026
@coderabbitai

coderabbitai Bot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: d892bf3a-a678-4452-8d1a-bf7ad8f7f7a8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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