feat: Base Foundry - #16224
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
|
hey @figtracer @stevencartavia @mablr , any update i can take back to our team? i've been keeping the PR up to date, hoping to bring back an estimate of when we can expect this to get in 🙏 |
c988b70 to
fe3411a
Compare
|
Hi @lukasrosario, I need to spend a bit more time than expected on the post-Monad integration clean-up. Thanks for updates you've made so far, no need more work for now as new conflicts may appear anyway, I'll get back to you with updates ASAP. |
|
thank you |
Adapt Base to unified nested constructors and preserve native factory context. Reconcile Cast and Forge dispatch with the current command structure, relocate Base CLI coverage, and adapt Anvil request parsing tests and simulation cache access.
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