base / base/base-anvil

Upstream Base Anvil fork changes into Foundry using Tempo-style precompile integration

Open
#18 1 comment 4 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
14
Forks
17
Avg merge
1d 16h
Merged PRs (30d)
6

Description

### Component

Other (please describe)

### Describe the feature you would like

Noticed this fork carries Base-specific Anvil changes that could likely live upstream instead of requiring a long-lived fork (since Base precompiles are inspired by Tempo's.).

A likely upstream shape:

- Add a Base network mode using Foundry’s `NetworkVariant` / `--network ` path.
- Auto-enable for Base chain IDs like `8453` and `84532`.
- Install Base precompiles from `NetworkConfigs::inject_precompiles`: `B20Factory`, B-20 prefix dispatch, `PolicyRegistryPrecompile`, and `ActivationRegistry`.
- Add trace labels and `precompiles()` entries for Base precompile addresses.
- Warm singleton Base precompile addresses with sentinel bytecode so Solidity wrappers that check `extcodesize(target) > 0` work.
- Allow `vm.load` on precompile addresses if stateful precompile storage inspection is needed, while keeping mutation guards like `vm.etch` / `vm.store`.

The main upstream concern is dependency stability. We would not want Foundry tightly coupled to internal `base/base` APIs such as `B20Factory`, `PolicyRegistryPrecompile`, `ActivationRegistry`, `B20Variant`, or `BaseUpgrade`.

A cleaner path would be for Base to expose a small, versioned Foundry-facing integration surface, for example:

- `install_base_precompiles(precompiles, config)`
- exported precompile address constants
- exported trace labels
- a stable config type for ActivationRegistry/admin behavior

Then Foundry could depend on a narrow stable API, possibly behind an optional `base` feature, instead of tracking Base internals.

Would the Base team be open to shaping this fork into an upstream Foundry PR around that integration boundary?

Thank you

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing Foundry’s NetworkVariant and NetworkConfigs::inject_precompiles paths, then review the named Base precompiles and the precompiles() and trace-label integration points. Define the narrow, stable Base-facing API before attempting an upstream PR. Done means Base precompiles, address handling, tracing, warming, and permitted vm.load behavior integrate without coupling Foundry to Base internals.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
blockchain, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.