Skip to content

test(fees): pin appealed-child quote and funding-mode costs - #46

Closed
MuncleUscles wants to merge 3 commits into
genlayerlabs:pr/v0.3/feat/message-fee-allocationsfrom
MuncleUscles:test/appeal-profit-message-quote
Closed

MuncleUscles wants to merge 3 commits into
genlayerlabs:pr/v0.3/feat/message-fee-allocationsfrom
MuncleUscles:test/appeal-profit-message-quote

Conversation

@MuncleUscles

@MuncleUscles MuncleUscles commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Delivery context

Depends-On: genlayerlabs/genlayer-consensus#1692

Draft regression handoff stacked directly on genvm-executor #45 (pr/v0.3/feat/message-fee-allocations, 624aecf98). That executor PR mirrors genvm-manager #45; this test uses their matching interfaces. The chain-side numerical and allocation-admission oracle is in consensus #1717, and the separate Node post-clamp safety witness is node #2024.

Problem and outcome

The executor currently pinned by Node #2017 quotes 8,788 for an internal child with three appeal rounds, while consensus #1692 requires 18,238. The missing 9,450 is the successful-appeal profit reserve. Executor #45 adds that reserve. This handoff locks the corrected 18,238 quote and a 529 no-appeal control using the actual fee configuration and allocation matching path. It also tests the charged amount at on-acceptance emission for two funding modes. It adds no production code.

This is the per-emission child primary quote, including the child's own appeal costs. It must not be multiplied again by the child's appeals or by the emitting parent's appeals on every receipt. The new useBalance control emits two fresh accepted children from an exact-fit contract balance: each charges one 18,238 quote plus its value, a third fails, and the sender message-fee pool is untouched. The dynamic/open-bucket control emits two fresh accepted children: each consumes 18,238 plus a declared 50 descendant budget from the sender pool, and a third fails without an extra debit. These controls are two new occurrences within one execution, not an appeal replay. Consensus #1744 now implements the allocation rule recursively: the parent applies only its own (parent appeals + 1) acceptance factor to the child's complete budget. The child applies its own appeal factor to its descendants inside that budget. A parent-times-child product for grandchild capacity emerges from those two levels, rather than from an extra fee multiplier in GenVM.

The fresh-generation policy in consensus #1743 changes the appeal case: re-emitting the same message after a successful appeal is a new chargeable effect. GenVM's preflight must check the current contract balance for that fresh emission; it should not compensate for a child delivered in an earlier generation. The old free-replay handoffs Node #2049 and #2054 are closed. Node #2115 passes the remaining allocation input, and Node #2116 waits for pre-proposal settlement; these green GenVM tests cover per-emission cost in both funding modes.

Implementation and validation

  • cargo test --test message_fee_appeal_profit_quote passed both cases on executor fix(fees): flatten allocation inputs and correct executor funding 🐛 #45 with matching manager fix(fees): flatten allocation inputs and correct executor funding 🐛 #45 interfaces. The same appealed-child witness measured 8,788 at the old e813da59 executor pin; the no-appeal control was 529 there too.
  • All 84 SDK tests passed, including the two new on-acceptance funding-mode cases. A full library run had four unrelated Unix-listener bind failures under the sandbox; the remaining 148 tests passed.
  • Consensus #1717's Hardhat oracle passed a real FeeManager.minMessagePrimaryFees quote of 18,238 and an addTransaction that admits a 72,952 pinned allocation for the zero-appeal parent.
  • cargo fmt --check and git diff --check passed. Node #2017 still pins the old manager/executor pair; a composed GenVM → Node → consensus E2E after pin adoption remains outstanding.

Incremental follow-up

Fork PR #1 stacks on this exact head and covers the recursively reserved acceptance/finalization grandchild budget over the parent's appeal horizon. The base branch for this PR lives on the fork, so the incremental diff is reviewed there until this parent lands.

On executor PR genlayerlabs#45 with the matching manager genlayerlabs#45 interfaces, run the shipped message-fee expression against consensus #1692 inputs. The no-appeal child quotes 529 and the three-appeal child quotes 18,238, including the successful-appeal profit reserve missing from Node current e813da5 executor pin.
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

Exercise the production fee schedule through useBalance and uncapped sender allocations. Two fresh emissions consume one child primary quote each; the open allocation also reserves its descendant budget per emission. A third emission fails at the exact contract balance or sender-pool limit without another debit.

Validation: cargo test --lib wasi::genlayer_sdk::tests::; cargo test --test message_fee_appeal_profit_quote; rustfmt --check on the changed file; git diff --check.
@MuncleUscles MuncleUscles changed the title test(fees): lock appealed-child quote parity test(fees): pin appealed-child quote and funding-mode costs Sep 26, 2026
@kp2pml30
kp2pml30 deleted the branch genlayerlabs:pr/v0.3/feat/message-fee-allocations September 30, 2026 01:41
@kp2pml30 kp2pml30 closed this Sep 30, 2026
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.

2 participants