Skip to content

fix(ui): include in-block request count in EIP-8282 queue fee calculation - #840

Merged
barnabasbusa merged 2 commits into
masterfrom
claude/dora-queue-fee-bug-fhev4k
Aug 20, 2026
Merged

fix(ui): include in-block request count in EIP-8282 queue fee calculation#840
barnabasbusa merged 2 commits into
masterfrom
claude/dora-queue-fee-bug-fhev4k

Conversation

@barnabasbusa

Copy link
Copy Markdown
Collaborator

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:

excess (slot 0) + max(0, current_block_count (slot 1) - TARGET_PER_BLOCK)

with TARGET_PER_BLOCK = 8 for the builder deposit contract and 2 for 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's callvalue - fee >= stake_wei check 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 slot 0x01 (requests added in the current block) alongside slot 0x00, exposed as blockCount.
  • BuilderDepositsTable / BuilderExitReview: fold max(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 build in ui-package compiles cleanly (only pre-existing warnings).
  • Verified the fee formula against the sys-asm assembly: with the reported on-chain state the corrected computation reproduces the contract getter's 48 wei.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UEDNv2UuHsNxitpTUGZf55


Generated by Claude Code

…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
@redpandabot

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.

@redpandabot redpandabot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

@barnabasbusa
barnabasbusa merged commit 4c6c10f into master Aug 20, 2026
5 checks passed
@barnabasbusa
barnabasbusa deleted the claude/dora-queue-fee-bug-fhev4k branch August 20, 2026 12:49
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