Skip to content

feat(anvil): add Base proof devnet L1 APIs - #67

Merged
PelleKrab merged 4 commits into
fix/cargo-deny-stale-advisoryfrom
feat/prover-single-l1
Aug 12, 2026
Merged

feat(anvil): add Base proof devnet L1 APIs#67
PelleKrab merged 4 commits into
fix/cargo-deny-stale-advisoryfrom
feat/prover-single-l1

Conversation

@PelleKrab

@PelleKrab PelleKrab commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Motivation

Base's prover stack needs three things from Anvil when it serves as the single devnet L1:

  • debug_getRawHeader — canonical RLP-encoded L1 headers for witness construction
  • debug_getRawReceipts — canonical EIP-2718 receipt bytes for witness construction
  • GET /eth/v1/config/specSECONDS_PER_SLOT so Base's Beacon client can map L1 execution timestamps to Beacon slots when retrieving blob sidecars from the same Anvil instance

Solution

The debug endpoints landed upstream after this fork's divergence point, so this PR includes them as verbatim upstream cherry-picks (original authorship preserved, -x annotated):

The only fork-specific commit is the Beacon spec endpoint: add GET /eth/v1/config/spec and return the positive interval-mining duration as the Beacon-compatible SECONDS_PER_SLOT string. Return an internal error when interval mining is unavailable or disabled.

This supersedes the hand-written implementations previously proposed in #60, #61, and #62, shrinking the fork's maintained surface to the spec endpoint alone; the debug endpoints will merge cleanly on the next upstream sync.

Note one semantics change relative to the superseded implementations: the debug endpoints return a BlockNotFound JSON-RPC error for unknown blocks instead of null, matching upstream.

Stack

  1. fix(deps): update ruint security advisory #63 — cargo-deny security prerequisite
  2. this PR — upstream debug endpoint cherry-picks + Beacon /eth/v1/config/spec

Testing

  • cargo test -p anvil-core --lib
  • cargo test -p anvil --test it beacon_api -- --nocapture
  • cargo test -p anvil --test it -- can_get_raw
  • cargo fmt --all -- --check
  • git diff --check

PR Checklist

  • Added Tests — upstream serde + integration tests for the debug endpoints, beacon_api test for the spec endpoint
  • Added Documentation — N/A: this repo has no RPC endpoint docs surface; endpoints are documented via doc comments (the debug endpoints are covered by the upstream Foundry book)
  • Breaking changes — none; additive endpoints only

mattsse and others added 4 commits August 11, 2026 17:16
* feat(anvil): support debug raw receipts

* feat(anvil): serve pre-fork blocks in debug_getRawReceipts

---------

Co-authored-by: grandizzy <38490174+grandizzy@users.noreply.github.com>
(cherry picked from commit c96f35cfe88a0ef01cbeb56cfda747a514114fd3)
Amp-Thread-ID: https://ampcode.com/threads/T-019ff2a8-b426-7769-88bf-e3052db3b51e
Co-authored-by: Amp <amp@ampcode.com>
(cherry picked from commit 13f46acdff02263cb7164410d306e6eca4ec19c0)
(cherry picked from commit 2f18e89f6321dc8df7c1e0dc312bafc34a397249)
Expose SECONDS_PER_SLOT so Base clients can map execution timestamps to Beacon slots.

Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019ff1b0-c07c-77f3-816c-5da33175c7a4
(cherry picked from commit 3877a2c)
@PelleKrab
PelleKrab force-pushed the feat/prover-single-l1 branch from ac24945 to b8f48ba Compare August 12, 2026 00:17
@PelleKrab
PelleKrab marked this pull request as ready for review August 12, 2026 01:16
@PelleKrab
PelleKrab merged commit 4b88bd5 into base-anvil-fork Aug 12, 2026
20 checks passed
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