Skip to content

fix(fees): add exact quote and decision parity - #214

Open
MuncleUscles wants to merge 7 commits into
v2-devfrom
fix/v06-fee-appeal-parity
Open

fix(fees): add exact quote and decision parity#214
MuncleUscles wants to merge 7 commits into
v2-devfrom
fix/v06-fee-appeal-parity

Conversation

@MuncleUscles

@MuncleUscles MuncleUscles commented Aug 31, 2026

Copy link
Copy Markdown
Member

Delivery context

Depends-On: genlayerlabs/genlayer-consensus#1526

Base #212 is merged; this PR is restacked directly on v2-dev at d7d32627e036cf57600558a099bb589ccc5c8d2a.
Cross-stack qualification is carried by genlayerlabs/genlayer-e2e#756 against genlayerlabs/genlayer-studio#1748.

Problem and outcome

Build the exact fee-quote and Studio decision-binding layer on the already-landed resolution-kernel SDK surface.

This layer mirrors Consensus deposit quoting, binds Studio lifecycle actions to the active decision, encodes the complete internal-message fee tuple, and treats Studio writes/lifecycle calls as mined EVM envelopes. It now waits for the receipt on every backend and surfaces Studio's additive revert reason instead of returning rejected writes or top-ups as successful submissions. Ordinary top-ups use the schedule-free Consensus delta shape (appealRounds: 0, rotations: []), while an explicit complete schedule remains available only for first-time fee initialization. Studio receipt lookup also receives a bounded 60-second indexing window beyond viem's insufficient default retry budget. Triggered-child discovery now follows the parent decision receipt and accepts InternalMessageProcessed from the actual MessagePayments emitter instead of incorrectly requiring ConsensusMain.

Implementation and validation

  • Six commits on v2-dev: exact deposit quoting, decision-bound Studio lifecycle actions, the complete eight-field Consensus internal-message fee tuple including all price caps, mined-envelope failure handling, schedule-free ordinary top-ups, and cross-contract child-message event discovery.
  • Full Vitest suite: 184 tests passed.
  • Type declarations and CJS/ESM builds pass.
  • ESLint on the changed implementation and regression tests passes.
  • Current head: 98d59cffce30895644c4901710494f8f375ad248 (synthetic merge ef2015c1c633604328e1445c60398d55f081ff89).
  • Stack-relative diff and working tree checks are clean.

Risk and rollback

This layer belongs to the fee/Studio parity train with Consensus #1526. The receipt wait is intentionally stricter: a mined status-0 envelope is an error on Studio just as it is on deployed Consensus. Older Studio versions without additive revertReason remain compatible and produce a generic revert error. Rollback is this fee layer; #212 is already landed.

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown

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: Team

Run ID: 08e98b83-1e27-481a-b878-f0ff7bfa24dc

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.

Use Studio's lifecycle and appeal-charge RPCs to bind appeal, combined top-up/appeal, and finalization to the active decision. Keep Studio ABI exports aligned with the v0.6 consensus surface and cover quoting and guarded selectors.
@MuncleUscles
MuncleUscles force-pushed the fix/v06-fee-appeal-parity branch from c878429 to b9a7bb2 Compare August 31, 2026 22:40
@MuncleUscles
MuncleUscles changed the base branch from fix/consensus-train-surface to v2-dev August 31, 2026 22:40
Verify that canAppeal reads the active decision from the separately configured Appeals contract at the lifecycle snapshot. This catches local-chain interface drift before cross-stack E2E.
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