feat(networks): select Base upgrade at runtime via --base <upgrade> - #71
Open
rayyan224 wants to merge 1 commit into
Conversation
Replaces the `base: bool` flag with `base: Option<BaseUpgrade>` so bare `--base` keeps today's default (Cobalt) while `--base <upgrade>` (e.g. `--base beryl`) pins a specific historical Base upgrade. Lets one current base-anvil revision test the latest base precompile implementation against every frozen base-std hardfork suite, instead of pinning (and backporting dependency bumps to) a separate base-anvil release per hardfork. `foundry.toml`'s existing `base = true`/`base = false` keeps working via a custom serde shim that also accepts `base = "beryl"`. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Per "P/PS: Precompile Testing Across Hardforks" (decided, Aug 20 2026): CI today pins one immutable
base-anvilrevision per hardfork sobase-std's frozen test suite for that hardfork runs against the matching precompile implementation. Whenbasebumps a shared dependency (e.g. Alloy/reth), those old pinnedbase-anvilrevisions can stop compiling even though nothing about precompile behavior changed — the current fix is to backport the dependency bump to every affected historical release, which gets more fragile as releases accumulate.BOP-584 tracks closing this gap by making the Base upgrade selectable at runtime instead of hardcoded, so one current
base-anvilrevision can test the latestbaseprecompile implementation against every frozenbase-stdhardfork suite.Solution
NetworkConfigs::base: boolwithbase: Option<BaseUpgrade>. Bare--basekeeps today's default upgrade (Cobalt, via a newDEFAULT_BASE_UPGRADEconstant);--base <upgrade>(e.g.--base beryl) pins a specific historical upgrade. Uses the existingnum_args(0..=1)+default_missing_valuepattern already in this codebase (--mnemonic-random).inject_precompilesnow installs the selected upgrade instead of the previousBaseUpgrade::Cobalthardcode.with_chain_id's auto-enable for known Base chain ids (8453/84532/84538453) now preserves an explicit--base <upgrade>selection instead of clobbering it.base_flag) sofoundry.toml's existingbase = true/base = falsekeeps working unchanged, while also acceptingbase = "beryl".BaseUpgradeis now re-exported fromfoundry-evm-networksfor downstream consumers/tests.PR Checklist
Co-Authored-By: Claude noreply@anthropic.com