fix(ui): include in-block request count in EIP-8282 queue fee calculation - #840
Merged
Conversation
…tion The builder deposit and builder exit system contracts (EIP-8282) charge request fees per write path, unlike EIP-7002/7251 where the fee is fixed within a block. Their user subroutine computes the fee numerator as excess (slot 0) plus the requests already added in the current block (slot 1) beyond TARGET_PER_BLOCK (8 for deposits, 2 for exits). The submit forms only read slot 0, so during bursts of requests the displayed fee was far below the fee the contract actually charged (e.g. 1 wei shown vs 48 wei required), making the submitted msg.value fall short of fee + stake and the transaction revert. Read the in-block count from slot 1 as well and fold it into the fee numerator, matching the contract logic. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UEDNv2UuHsNxitpTUGZf55
This comment has been minimized.
This comment has been minimized.
…rstated fee A failed 0x01 storage read previously degraded blockCount to 0n and cached it, quietly reinstating the understated EIP-8282 fee quote. Treat it as an error so consumers (which gate on queueData.error) don't quote a stale fee.
There was a problem hiding this comment.
Fix makes the EIP-8282 builder deposit/exit queue fee quotes include slot-1 (current-block request count) beyond TARGET_PER_BLOCK, and surfaces slot-1 read failures instead of silently understating the fee. Verified against the cited sys-asm reference: slot layout (excess=0, count=1), TARGET_PER_BLOCK (8 deposit / 2 exit), and the fake-exponential factor/denominator all match, and reproduced fee(66)=48 wei vs fee(1)=1 wei, so the corrected formula matches the contract's getter.
Reviewed 3 changed file(s) @ 0b0d1527 — no blocking issues found.
"All non-trivial abstractions, to some degree, are leaky." — Joel Spolsky
pk910
approved these changes
Aug 20, 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.
Problem
Builder deposit transactions submitted via the "Submit builder deposits" page reverted: Dora showed a queue fee of 1 wei while the contract's fee getter (empty-calldata call) returned 48 wei.
The builder deposit and builder exit system contracts (EIP-8282) charge request fees per write path, unlike EIP-7002/7251 where the fee only changes at end-of-block. Per the sys-asm reference implementation, the user subroutine computes the fee numerator as:
with
TARGET_PER_BLOCK = 8for the builder deposit contract and2for the builder exit contract.The submit forms only read storage slot 0, so during a burst of requests the displayed fee was far below what the contract actually charged (a fee numerator of 66 yields exactly the observed 48 wei, while slot 0 alone yielded 1 wei). The transaction's
msg.value(stake + understated fee) then failed the contract'scallvalue - fee >= stake_weicheck and reverted.The EIP-7002 withdrawal and EIP-7251 consolidation forms are unaffected — those contracts compute the user fee from the excess slot only.
Fix
useQueueDataCache: additionally read storage slot0x01(requests added in the current block) alongside slot0x00, exposed asblockCount.BuilderDepositsTable/BuilderExitReview: foldmax(0, blockCount - TARGET_PER_BLOCK)into the fee numerator before running the fake-exponential, matching the contract's user-path logic. The "add extra fee" headroom is applied on top of the corrected numerator.Testing
npm run buildinui-packagecompiles cleanly (only pre-existing warnings).🤖 Generated with Claude Code
https://claude.ai/code/session_01UEDNv2UuHsNxitpTUGZf55
Generated by Claude Code