From d5c88cb93b2b863c4c2d4fcc747a76cb17f190b3 Mon Sep 17 00:00:00 2001 From: Rayyan Alam Date: Wed, 2 Sep 2026 15:08:25 -0400 Subject: [PATCH 1/2] feat(fork): select Base upgrade via BASE_UPGRADE env (#215) The fork harness hardcoded a bare `--base`, always registering base-anvil's default upgrade. Read an optional BASE_UPGRADE env var and forward it as `--base ` so a single current base-anvil revision can be tested against each frozen historical suite. Unset preserves today's behavior. Co-authored-by: Claude --- script/fork/README.md | 1 + script/fork/__main__.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/script/fork/README.md b/script/fork/README.md index cb1eed0..373d8fd 100644 --- a/script/fork/README.md +++ b/script/fork/README.md @@ -54,6 +54,7 @@ PYTHONPATH=script script/smoke/.venv/bin/python -m fork --match-test test_transf | `PORT` | `8546` | local RPC port for anvil | | `ACTIVATION_ADMIN` | `0x9965…A4dc` | address authorized to activate features | | `ANVIL_LOG` | `/tmp/anvil.log` | anvil stdout/stderr log path | +| `BASE_UPGRADE` | _(none)_ | historical Base upgrade to register (e.g. `beryl`, `cobalt`), forwarded as `--base `; unset uses anvil's default upgrade (bare `--base`) | | `SKIP_ACTIVATE` | _(none)_ | comma-separated feature names or `0x` ids to leave un-activated (exercises the inactive-feature dispatch path); matched case-insensitively | ## Exit codes diff --git a/script/fork/__main__.py b/script/fork/__main__.py index e5cd174..8b15a75 100644 --- a/script/fork/__main__.py +++ b/script/fork/__main__.py @@ -118,11 +118,18 @@ def assert_port_free(port: int) -> None: @contextmanager -def anvil_running(anvil: Path, port: int, admin: str, log_path: Path) -> Iterator[Web3]: - """Launch anvil --base, yield a Web3 once the RPC is live, and tear it down on exit (any outcome).""" +def anvil_running( + anvil: Path, port: int, admin: str, log_path: Path, base_upgrade: str | None = None +) -> Iterator[Web3]: + """Launch anvil --base, yield a Web3 once the RPC is live, and tear it down on exit (any outcome). + + A bare --base registers anvil's default upgrade; passing base_upgrade forwards + --base to select a specific historical upgrade instead. + """ + base_flag = ["--base"] if not base_upgrade else ["--base", base_upgrade] with open(log_path, "w") as logf: proc = subprocess.Popen( - [str(anvil), "--base", "--base-activation-admin", admin, "--port", str(port)], + [str(anvil), *base_flag, "--base-activation-admin", admin, "--port", str(port)], stdout=logf, stderr=subprocess.STDOUT, ) @@ -199,6 +206,7 @@ def main(forge_args: list[str]) -> int: os.environ.get("ACTIVATION_ADMIN", "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc") ) log_path = Path(os.environ.get("ANVIL_LOG", "/tmp/anvil.log")) + base_upgrade = os.environ.get("BASE_UPGRADE") or None # empty string == unset skip = skip_set() anvil, forge = discover_binaries() @@ -209,10 +217,11 @@ def main(forge_args: list[str]) -> int: log(f"port: {port}") log(f"activation admin: {admin}") log(f"log file: {log_path}") + log(f"base upgrade: {base_upgrade or ''}") log(f"skip-activate: {os.environ.get('SKIP_ACTIVATE') or ''}") log("starting anvil…") - with anvil_running(anvil, port, admin, log_path) as w3: + with anvil_running(anvil, port, admin, log_path, base_upgrade) as w3: reconcile_feature_state(w3, admin, skip) rpc_url = f"http://localhost:{port}" From 66008b966a5595e3ec49959e5a5454f2789b1af2 Mon Sep 17 00:00:00 2001 From: Rayyan Alam Date: Wed, 2 Sep 2026 17:19:29 -0400 Subject: [PATCH 2/2] fix(fork): pin fork profile to base = "beryl" for Beryl harness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new base-anvil's default upgrade is Cobalt, so `base = true` in the fork profile resolves to Cobalt — forge's local precompile dispatcher ran V2 even when the test suite targeted Beryl behavior. Pinning to "beryl" makes forge install V1 dispatch, matching the frozen test expectations in the v1.0.0 snapshot. Co-Authored-By: Claude Sonnet 4.6 (1M context) --- foundry.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/foundry.toml b/foundry.toml index 8616dcb..f318657 100644 --- a/foundry.toml +++ b/foundry.toml @@ -45,7 +45,7 @@ vibenet = "https://rpc.vibes.base.org/" runs = 10 [profile.fork] -base = true +base = "beryl" [fmt] line_length = 120