Skip to content

feat(networks): select Base upgrade at runtime via --base <upgrade> - #71

Open
rayyan224 wants to merge 1 commit into
base-anvil-forkfrom
rayyanalam/bop-584-base-anvil-add-base-fork-runtime-flag-to-select-baseupgrade
Open

feat(networks): select Base upgrade at runtime via --base <upgrade>#71
rayyan224 wants to merge 1 commit into
base-anvil-forkfrom
rayyanalam/bop-584-base-anvil-add-base-fork-runtime-flag-to-select-baseupgrade

Conversation

@rayyan224

Copy link
Copy Markdown
Contributor

Motivation

Per "P/PS: Precompile Testing Across Hardforks" (decided, Aug 20 2026): CI today pins one immutable base-anvil revision per hardfork so base-std's frozen test suite for that hardfork runs against the matching precompile implementation. When base bumps a shared dependency (e.g. Alloy/reth), those old pinned base-anvil revisions 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-anvil revision can test the latest base precompile implementation against every frozen base-std hardfork suite.

Solution

  • Replaces NetworkConfigs::base: bool with base: Option<BaseUpgrade>. Bare --base keeps today's default upgrade (Cobalt, via a new DEFAULT_BASE_UPGRADE constant); --base <upgrade> (e.g. --base beryl) pins a specific historical upgrade. Uses the existing num_args(0..=1) + default_missing_value pattern already in this codebase (--mnemonic-random).
  • inject_precompiles now installs the selected upgrade instead of the previous BaseUpgrade::Cobalt hardcode.
  • 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.
  • Added a custom serde shim (base_flag) so foundry.toml's existing base = true/base = false keeps working unchanged, while also accepting base = "beryl".
  • BaseUpgrade is now re-exported from foundry-evm-networks for downstream consumers/tests.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Co-Authored-By: Claude noreply@anthropic.com

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>
@linear

linear Bot commented Aug 24, 2026

Copy link
Copy Markdown

BOP-584

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.

1 participant