Skip to content

Update EIP-8141: assembled canonical paymaster reference bytecode - #7

Draft
Marchhill wants to merge 15 commits into
stage2-upstream-basefrom
stage2-upstream
Draft

Update EIP-8141: assembled canonical paymaster reference bytecode#7
Marchhill wants to merge 15 commits into
stage2-upstream-basefrom
stage2-upstream

Conversation

@Marchhill

@Marchhill Marchhill commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Completes the canonical paymaster implementation with its assembled reference runtime, code hash, and annotated assembly. Continues ethereum#12012.

  • Runtime bytecode (355 bytes) implementing the section's pseudocode: dispatch, payment validation, deposit, and the four timelocked admin operations (withdrawal/rotation initiate, cancel, finalize).
  • Per-fork recognition anchor: keccak256 code hash 0xda42f0d11838c4c0c3129b8b8e93e9718127ad6b315e517e1088125707c4d45c.
  • Annotated assembly in assets/eip-8141/; the annotated listing itself is the reproducible source and assembles byte-for-byte to the runtime bytecode and code hash.
  • Removed the superseded Solidity reference assets/eip-8141/CanonicalPaymaster.sol (old 12h-delay, secp256k1-only, withdraw-to-arbitrary-recipient design with no rotation), which this PR's assembled paymaster supersedes.
  • Gas note made schedule-agnostic (validation is dominated by one cold SLOAD, so a canonical pay frame needs a gas_limit of at most 15,000).

Assembled from the normative pseudocode and validated against a reference implementation's test suite: payment authorization, deposit, withdrawal/rotation timelocks, admin authorization via both the caller and signature routes, reentrancy safety, and the CALL-failure path.

svlachakis and others added 15 commits July 29, 2026 19:26
…measured gas

Insert the assembled 355-byte runtime bytecode and its per-fork keccak256
code hash into the canonical paymaster section, replace the ~2,150 gas
estimate with the measured validation-path cost, and add the reference
artifacts asset file.
Present the reference contract as annotated EVM assembly (mnemonics, labels,
per-block comments) alongside the compiled bytecode and code hash, matching the
house style of the system-contract EIPs. The listing assembles byte-for-byte to
the pinned runtime bytecode and hash.
…prose

Describe the validation-path cost structurally (dispatch, three SIGPARAM reads,
memory-only APPROVE, one cold SLOAD) rather than quoting a fork-specific gas
figure, since the deployment fork is undetermined. Tighten the assets pointer
and reproducibility note.
Remove the superseded assets/eip-8141/CanonicalPaymaster.sol (old 12h-delay,
secp256k1-only, arbitrary-recipient withdrawal design with no rotation), which
the assembled canonical paymaster in this PR supersedes.

Introduce 15,000 as the recommended pay-frame gas_limit bound rather than
referencing it as if defined elsewhere. Correct the admin-path claim that both
finalize paths clear pending state before acting (rotation writes slot 0 before
clearing, and has no external call to observe ordering). Harmonize two
remaining "code match" phrasings to the runtime-code-hash-of-the-active-fork
wording. Reword the assets closing line to point at the annotated listing as
the reproducible source instead of a non-checked-in assembler.
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.

2 participants