feat: Base Foundry - #16224
feat: Base Foundry#16224lukasrosario wants to merge 28 commits into
Conversation
✅ Changelog foundThe deterministic check will validate the changed entry. |
mablr
left a comment
There was a problem hiding this comment.
Hi @lukasrosario 👋
It already looks pretty good overall.
We are currently doing some post Monad clean-ups to fix several design footguns, ideally by the end of the week, only after we will able to start deep reviewing process.
The 2 main requirements we want to strongly enforce for external chains:
- complete/robust feature gating, no logic, structure, or anything else should leak
FoundryEvmNetwork/FoundryEvmFactory/NestedEvmsurface must stay as pre-#15343, no chain-specific methods or types will be accepted except if very very well justified/documented and contained. Specific custom evm logic must go behindFoundryContextExt.
Some merge conflicts may appear due to clean-ups, I'll notice you when stabilized. In the meantime please check the 2 requirements above are properly enforced.
|
thanks @mablr ! did another pass & pushed up a few changes, should be abiding by both requirements now. lmk when cleanup is done & will rebase |
|
Nice! After internal discussion, we will certainly ship this integration in several steps by cherry-pick from current PR. This will reduce round-trips. |
|
@mablr sounds good let me know if you need me to assist with anything. will leave the PR as is for now |
we'll come back to this next week |
|
@stevencartavia thank you, i'll rebase now |
fa31e05 to
99381b7
Compare
|
@stevencartavia @figtracer @mablr just rebased, should be good now. lmk anything else |
c8e73ac to
399ef8d
Compare
|
looks like some new conflicts, rebasing again now |
cd8fffe to
c988b70
Compare
|
on it |
Skip network discovery in curl mode and allow RPC commands without a compiled local EVM. Honor configured networks during DA estimation and reject unsupported Base blob options before transaction construction. Add regression coverage for curl output, network precedence, feature combinations, blob rejection, and transaction encoding. Repair the Base-disabled call test to use the current network API.
|
@mablr looks like reth doesn't yet have a release on 43, i think we'd need to wait for that on the base/base side |
Pin Base dependencies to the Foundry fork at 2aa8bc46e6b4272ef3bf0905e1a5660ee2525e72 and allow its source in deny.toml. Remove the obsolete revm 42 dependency graph while preserving unrelated lockfile resolutions. AI-assisted dependency update.
|
Moved to our own fork https://github.com/foundry-rs/base/tree/mablr/revm-43 |
Accept serializable receipt logs to preserve Base timestamp fields. Move EIP-8130 transaction and RPC gates to Zenith while retaining Cobalt precompile activation, and map Denim and Zenith to Osaka. Update regression coverage and the Base changelog entry. AI-assisted.
Import Base types directly where names are unambiguous and replace qualified Base references with feature-gated imports. Retain aliases for name collisions.
Expose the selected network type through the provider dispatch macro so raw header encoding can select the consensus header inline. AI-assisted.
Inline activation-admin resolution and sentinel planting, and accept BaseUpgrade directly in the shared sentinel selector. Focus adapter tests on constructor behavior and halt conversion. AI-assisted.
Adopt the shared transaction network resolver from foundry-rs#16790 for Base dispatch. Report Base hardfork metadata through the concrete execution spec and resolve active trace labels using foundry-rs#16789's shared path. Preserve Base-only feature gates and extend focused regression coverage. AI-assisted
|
@mablr what's the plan for this going forward? will you all continue to maintain that fork and bump deps accordingly before we pull them into base/base? |
Disambiguate Base and Tempo request fields while preserving existing routing for ambiguous untyped requests. Project EIP-8130 transactions into simulation requests, reuse supplied encoded bytes, and preserve phase statuses through RPC receipt conversions and JSON roundtrips. Share deposit helpers between Base and Optimism and rationalize regression coverage across feature configurations.
|
@lukasrosario Not so far, I'd like to extract a minimal shippable scope from here (1 or 2 smaller PRs) today (current PR stays the working branch). Basically if we leave anvil behind for next week, it's 90% ready. Pushing hard on the review, I'll tag you once minimal scope PR(s) are open. |
|
It's fine for us to maintain a lean fork https://github.com/foundry-rs/base until your reth is fully bumped (it's even better for our supply chain sec tbh). Ofc it would help us a lot if u maintain base/base frequently (revm/alloy bumps right after releases) |
Retain Base EIP-8130 admission checks alongside upstream Tempo pool validation. Use genesis configuration for the Zenith nonce-manager transition, since ChainUpgrades excludes Zenith, and mark ambiguous Base simulation fixtures with their explicit transaction type.
|
makes sense, thanks |
|
@lukasrosario I've just opened #16809, which lands all what I reviewed/approved (basically everything except Anvil). Once merged, I'll rebase current PR and rescope it to land Anvil. |
|
cool sgtm, thanks! |
Motivation
Add support for Base precompiles + EVM following the precedent set by Monad support (#15343), building on shared native-network abstractions that landed with it.
Solution
Adds a non-default
basefeature providingBaseEvmNetworkandBaseEvmFactoryon top of Base's ownbase-common-evmandBasePrecompiles, so execution semantics come from Base rather than a reimplementation in Foundry, and routes Base through Forge, Cast, Script, Chisel, Verify, and Anvil without any Ethereum or generic OP fallback.Highlights:
payer,metadata, andphaseStatuses, txpool lane replacement, expiry, payer reservations and replay protection, tracing, and lifecycle operations.transferorbalanceOfcould change how ordinary token traces decode on other networks. A test pins that exclusion.extcodesizecheck, which a code-less precompile fails in the caller. Base's0xEFEIP-3541 sentinel is planted on the installed precompiles in both Anvil genesis and the executor, matching what Base's own tests expect a harness to do.base.ymlmirroringmonad.yml, wired intoci.ymlas a required check, plus a Base+Optimism build and an explicitbase_replayrun because--libskips that target.Changes beyond the
basefeatureFour parts of this PR affect builds that don't enable
base:--hardforkonEvmArgs(crates/cli/src/opts/evm.rs) is a new shared flag forforge,cast,chisel, andscript. It surfaces the existingConfig::hardforkkey, which previously could only be set infoundry.toml. Namespaced values such asbase:Berylormonad:MonadNinego through the existingFoundryHardforkparser.cast txandcast block --raw. Both now resolve the network family rather than requiring an explicit--network, so Base deposit and EIP-8130 transactions decode by default. When neither--networknor a configured chain identifies the network, this costs oneeth_chainIdrequest; previously both defaulted to Ethereum with no round trip. Resolution now also reports a family that isn't compiled into the binary as an error, so these commands agree withcast call._catch-all Monad relied on, so both sites carry explicitNetworkVariant::Monadarms that use the Ethereum-typed provider. Behavior for Monad is unchanged.basefeature (.github/workflows/release.yml), matching howmonadandoptimismship.PR Checklist