Skip to content

feat(l1): charge EIP-8141 arbitrary frame signatures their own gas - #7045

Closed
AnkushinDaniil wants to merge 1 commit into
lambdaclass:frames-devnet-0from
AnkushinDaniil:daniil/eip8141-arbitrary-frame-gas
Closed

feat(l1): charge EIP-8141 arbitrary frame signatures their own gas#7045
AnkushinDaniil wants to merge 1 commit into
lambdaclass:frames-devnet-0from
AnkushinDaniil:daniil/eip8141-arbitrary-frame-gas

Conversation

@AnkushinDaniil

@AnkushinDaniil AnkushinDaniil commented Jul 28, 2026

Copy link
Copy Markdown

Problem

The EIP-8141 signature scheme table assigns a verification gas cost to every scheme, including ARBITRARY:

scheme byte scheme verification gas
0x0 ARBITRARY 100
0x1 SECP256K1 2800
0x2 P256 6700

FrameTransaction::signature_verification_cost charged 0 for ARBITRARY entries (it was written against an older spec snapshot that predates the 100-gas entry). That under-charges total_gas_limit by 100 per ARBITRARY signature and also under-counts the validation-prefix verify-gas budget, so the MAX_VERIFY_GAS boundary sits 100 gas away from where a conformant client puts it.

Change

  • Charge 100 gas per ARBITRARY signature in signature_verification_cost.
  • Tests: total_gas_limit differs by exactly 2800 - 100 between an otherwise-identical SECP256K1 and ARBITRARY transaction (with an RLP-shape guard so the comparison isolates verification cost), and the prefix verify-gas budget flips from valid to VerifyGasBudgetExceeded exactly at the 100-gas boundary.

Evidence

Commands run on this branch:

cargo check -p ethrex-common                                # pass
cargo check -p ethrex-levm                                  # pass
cargo test -p ethrex-common transaction::tests
# 69 passed; 0 failed; 74 filtered out
cargo test -p ethrex-test --test ethrex_tests levm::eip8141_tests
# 75 passed; 0 failed; 751 filtered out
cargo fmt --all -- --check                                  # pass
git diff --check                                            # pass

Stack

Targets frames-devnet-0. Part of a series of independent EIP-8141 fixes, one PR per logical change, each standing alone against the same base. Siblings: #7040 (canonical low-s), #7043 (recovery id at ecrecover boundary), #7044 (intrinsic gas over payload bytes), #7046 (frame gas refunds), #7047 (frame receipt storage encoding), #7048 (skipped-frame status 2), #7049 (EIP-7623 calldata floor).

Consensus risk / limits

Consensus-affecting: it raises total_gas_limit (and the verify-gas budget accounting) for any frame transaction carrying ARBITRARY signatures. Covered by unit tests only; no cross-client conformance fixture yet.

@AnkushinDaniil
AnkushinDaniil force-pushed the daniil/eip8141-arbitrary-frame-gas branch from ae1609d to dc905f1 Compare July 29, 2026 06:12
@AnkushinDaniil AnkushinDaniil changed the title feat(common): EIP-8141 arbitrary frame gas handling feat(l1): charge EIP-8141 arbitrary frame signatures their own gas Jul 29, 2026
@edg-l edg-l added the hegota label Jul 29, 2026
@edg-l

edg-l commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Superseded by #7004: signature_verification_cost on main already charges FRAME_SIG_SCHEME_ARBITRARY => 100, and main covers the scheme gas table in its own tests. Closing as fixed; thanks.

@edg-l edg-l closed this Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants