Skip to content

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

Open
MuncleUscles wants to merge 5 commits into
v0.123-devfrom
fix/studio-parent-appeal-gas-260929
Open

MuncleUscles wants to merge 5 commits into
v0.123-devfrom
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

Targets v0.123-dev. It was stacked on Studio #1774 (flat GenVM allocation inputs), which landed as 10e7b465; this branch now merges v0.123-dev and its diff is only the parent-appeal change. #1785 already applies the parent-based rule to balance-funded descendant grants and skips general allocation validation for them; this PR covers the user-supplied allocation, declaredBudget and discovery paths.

No cross-repository dependency: consensus #1744, #1749 and #1777 are already in consensus v0.6-dev (train squash e8c022b9), the v0.6 track baseline.

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 on the refreshed branch (over v0.123-dev@c489e7c2): 1,680 passed, 7 skipped (base: 1,672). 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.

kp2pml30 and others added 3 commits September 29, 2026 21:25
Re-vendor the fee allocation types and replace recursive children with
checked direct-child budgets and host-encoded FlatArrays subtrees.
Preserve committed fee bytes, ordering, roots and original allowances.

Pin GenVM v0.6.0-rc7, the release cut from the fee-allocation branch.
GenVM v0.6.0-rc7 ships executor v0.3.0-rc9; the missing v0.3.0-rc7 directory left the pinned deploy stuck in PROPOSING
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
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 62f7b406-d317-4cdc-98be-c81818eb86e6

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

The stack parent #1774 landed on v0.123-dev as squash 10e7b46, so its two
commits are taken as-is from dev. The one conflict with #1785 in
create_child_fee_accounting keeps #1785's grant guard and adds
root_appeal_rounds to the guarded validate_message_allocations call.
@danieljrc888
danieljrc888 changed the base branch from genvm/fee-allocation-inputs to v0.123-dev October 21, 2026 15:34
@danieljrc888

Copy link
Copy Markdown
Contributor

/run-e2e all

Frozen landing cut: #1784 alone, head 9d41782693e8386b7a11a592e9424311f345a6d2 over v0.123-dev@9e907cd27c5aa8cd6954508e714ed4d0170e3604; no cross-repository dependency (consensus #1749/#1777 are already in the v0.6-dev baseline). Full component and stack coverage (no stack selector). Native CI is green. Merge is authorized once this E2E is green.

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

E2E status was updated. Follow the current E2E and merge checks on this PR. Detailed diagnostics are available internally.

@danieljrc888 danieljrc888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed for v0.123: matches the consensus v0.6-dev allocation rule; unit suite and full E2E green on 9d41782.

@danieljrc888

Copy link
Copy Markdown
Contributor

/merge-train

@ci-core-e2e-runner

Copy link
Copy Markdown
Contributor

The request is recorded and waiting for processing. Follow the E2E and merge checks for progress. Do not post a duplicate command.

danieljrc888 added a commit that referenced this pull request Oct 23, 2026
The response-format block lives in a plain (non f-) string, so the
doubled braces reached the LLM literally. A real model follows the
template and answers `{{...}}`, which json.loads rejects. This made
test_llm_erc20 fail whenever the mock did not apply and the call fell
through to the real provider (CI runs on #1784, 2026-09-10).

Co-authored-by: Claude <noreply@anthropic.com>

@danieljrc888 danieljrc888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving to re-run review CI on the current base (includes #1798, which fixes the double-brace prompt behind the test_llm_erc20 failure).

@danieljrc888 danieljrc888 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-approving after merging v0.123-dev (includes #1798) to run review CI on the current base.

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.

3 participants