Repository navigation
fix(fees): price receipt floor with wrapper and terminal reserve - #223
Merged
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
Read FeeManager receiptWrapperBytes and quote propose-receipt gas with the effective gasPrice. Plain eth_call can expose tx.gasprice=0, which makes the Nitro rollup gas model revert. Avoid the zero-price messageFeeParamsBudgetFloor view and use the configured receipt wrapper plus Consensus #1692 terminal reserve. Recognize chain-derived pricing even when its plain-call quote is zero. Mirror the same floor in Studio when its RPC omits the authoritative value. Validation: 202 Vitest tests and typecheck, production build, changed-file ESLint, and diff whitespace check.
MuncleUscles
force-pushed
the
fix/receipt-fee-floor-v2
branch
from
September 28, 2026 10:01
ac5ee56 to
9a231ae
Compare
kirilaa
self-requested a review
September 28, 2026 16:17
kirilaa
approved these changes
Sep 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Delivery context
Depends-On: genlayerlabs/genlayer-consensus#1692
This follows the SDK fee quote work in #214. The related qualification is genlayer-e2e #796. The paired Studio admission-floor correction is genlayer-studio #1783; these changes are qualified together through #796.
Problem and outcome
The deployed-chain fee policy fallback used a fixed 512-byte receipt when
messageFeeParamsBudgetFloor()underquoted undereth_call. Consensus #1692 reserves the configured receipt wrapper plus 64 bytes of terminal output. On Nitro, a plaineth_callwith zerotx.gaspricecan also make both the floor view and receipt-gas view revert withInvalidRollupGasPrice. A zero chain-derived quote can incorrectly hide receipt pricing when other fees are zero.The SDK now reads
receiptWrapperBytesanduseChainDerivedReceiptPrice, then calls FeeManager's gas estimate forreceiptWrapperBytes + 64with the effective receipt gas price set in theeth_callcontext. This respects live governance and Nitro tariff parameters without relying on a zero-price floor view. When Studio does not exposemessageFeeParamsBudgetFloor, the SDK computes the same wrapper-plus-reserve floor from Studio's policy. An exposed Studio floor remains authoritative.Implementation and validation
eth_callfor the gas estimate.npm test -- --run: 202 tests passed, no type errors.npm run build: ESM, CJS, and declarations passed.git diff --check: passed.Risk and rollback
The deployed policy quote adds a priced FeeManager
eth_callwhen receipt pricing is enabled. It requires the RPC to honor the transactiongasPricefield; viem'spublicClient.callforwards that field. The required selectors are present in the v0.6 FeeManager. Reverting this commit restores the prior fallback behavior.Checks
Reviewing tips
Review
readCurrentFeePolicyandextractStudioFeePolicyinsrc/contracts/actions.ts, then the fee policy cases intests/contracts-actions.test.ts.User facing release notes
Fee estimates near the minimum execution budget now account for the configured receipt wrapper and Consensus terminal-output reserve.