From f539df90057df1f3596510c39bcd868b5efa1593 Mon Sep 17 00:00:00 2001 From: Stephan Cilliers Date: Thu, 16 Jul 2026 20:46:34 +0200 Subject: [PATCH] fix: use install_with_observer for B20Factory/PolicyRegistry base/base dropped the plain install() shims for B20Factory and PolicyRegistryPrecompile in favour of the observed variants (only install_with_observer remains). Our inject_precompiles still called the removed B20Factory::install / PolicyRegistryPrecompile::install, so the patched base-anvil build failed with E0599 on base/base's fork-test CI. Switch both to install_with_observer with a no-op observer (metrics are scoped to the B-20 token call path, which anvil doesn't wire up), matching provider.rs. B20Factory::install_with_observer also takes the BaseUpgrade, so thread Beryl through like the lookup. Bump the base/base pin to current main (cc8ee38) so this compiles against the observer-only API. Co-authored-by: OpenCode --- Cargo.lock | 10 +++++----- crates/evm/networks/Cargo.toml | 4 ++-- crates/evm/networks/src/lib.rs | 20 +++++++++++++++++--- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 94bece446..25fdf6f27 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2163,7 +2163,7 @@ dependencies = [ [[package]] name = "base-common-chains" version = "0.0.0" -source = "git+https://github.com/base/base.git?rev=401ffe4d60f3d0e9c34168c865521a3b186339df#401ffe4d60f3d0e9c34168c865521a3b186339df" +source = "git+https://github.com/base/base.git?rev=cc8ee3860973c6a98823c63324e95ad9daf63e1b#cc8ee3860973c6a98823c63324e95ad9daf63e1b" dependencies = [ "alloy-chains", "alloy-eips 2.0.5", @@ -2179,7 +2179,7 @@ dependencies = [ [[package]] name = "base-common-genesis" version = "0.0.0" -source = "git+https://github.com/base/base.git?rev=401ffe4d60f3d0e9c34168c865521a3b186339df#401ffe4d60f3d0e9c34168c865521a3b186339df" +source = "git+https://github.com/base/base.git?rev=cc8ee3860973c6a98823c63324e95ad9daf63e1b#cc8ee3860973c6a98823c63324e95ad9daf63e1b" dependencies = [ "alloy-chains", "alloy-consensus", @@ -2197,7 +2197,7 @@ dependencies = [ [[package]] name = "base-common-precompiles" version = "0.0.0" -source = "git+https://github.com/base/base.git?rev=401ffe4d60f3d0e9c34168c865521a3b186339df#401ffe4d60f3d0e9c34168c865521a3b186339df" +source = "git+https://github.com/base/base.git?rev=cc8ee3860973c6a98823c63324e95ad9daf63e1b#cc8ee3860973c6a98823c63324e95ad9daf63e1b" dependencies = [ "alloy-evm", "alloy-primitives", @@ -2212,7 +2212,7 @@ dependencies = [ [[package]] name = "base-precompile-macros" version = "0.0.0" -source = "git+https://github.com/base/base.git?rev=401ffe4d60f3d0e9c34168c865521a3b186339df#401ffe4d60f3d0e9c34168c865521a3b186339df" +source = "git+https://github.com/base/base.git?rev=cc8ee3860973c6a98823c63324e95ad9daf63e1b#cc8ee3860973c6a98823c63324e95ad9daf63e1b" dependencies = [ "alloy-primitives", "proc-macro2", @@ -2223,7 +2223,7 @@ dependencies = [ [[package]] name = "base-precompile-storage" version = "0.0.0" -source = "git+https://github.com/base/base.git?rev=401ffe4d60f3d0e9c34168c865521a3b186339df#401ffe4d60f3d0e9c34168c865521a3b186339df" +source = "git+https://github.com/base/base.git?rev=cc8ee3860973c6a98823c63324e95ad9daf63e1b#cc8ee3860973c6a98823c63324e95ad9daf63e1b" dependencies = [ "alloy-evm", "alloy-primitives", diff --git a/crates/evm/networks/Cargo.toml b/crates/evm/networks/Cargo.toml index 313499dd4..909efa30c 100644 --- a/crates/evm/networks/Cargo.toml +++ b/crates/evm/networks/Cargo.toml @@ -29,8 +29,8 @@ alloy-primitives = { workspace = true, features = [ # github.com/base/base; bump via ./script/bump-base.sh. To iterate against a # local base/base checkout instead, uncomment the [patch] block at the bottom # of the workspace root Cargo.toml. -base-common-precompiles = { git = "https://github.com/base/base.git", rev = "401ffe4d60f3d0e9c34168c865521a3b186339df" } -base-common-chains = { git = "https://github.com/base/base.git", rev = "401ffe4d60f3d0e9c34168c865521a3b186339df" } +base-common-precompiles = { git = "https://github.com/base/base.git", rev = "cc8ee3860973c6a98823c63324e95ad9daf63e1b" } +base-common-chains = { git = "https://github.com/base/base.git", rev = "cc8ee3860973c6a98823c63324e95ad9daf63e1b" } revm = { workspace = true, features = [ "std", diff --git a/crates/evm/networks/src/lib.rs b/crates/evm/networks/src/lib.rs index 7b1f0e89e..356043323 100644 --- a/crates/evm/networks/src/lib.rs +++ b/crates/evm/networks/src/lib.rs @@ -16,7 +16,8 @@ use alloy_primitives::{Address, U256, address, keccak256, map::AddressHashMap}; use base_common_chains::BaseUpgrade; use base_common_precompiles::{ ActivationFeature, ActivationRegistry, ActivationRegistryStorage, B20Factory, - B20FactoryStorage, BerylLookup, PolicyRegistryPrecompile, PolicyRegistryStorage, + B20FactoryStorage, BerylLookup, NoopPrecompileCallObserver, PolicyRegistryPrecompile, + PolicyRegistryStorage, }; use clap::Parser; use serde::{Deserialize, Serialize}; @@ -165,10 +166,23 @@ impl NetworkConfigs { // upgrade so each B-20 token resolves its logic version per-call // (e.g. Stablecoin V1 at Beryl). Pinned to Beryl until `--base-fork` // (BOP-428) makes the fork selectable at runtime. + // + // The factory/policy singletons use `install_with_observer` with a + // no-op observer, matching provider.rs; base/base dropped the plain + // `install` shims in favour of the observed variants. Metrics + // observation is scoped to the B-20 token call path, which anvil + // does not wire up, so a no-op observer is correct here. let admin = Some(self.base_activation_admin()); - B20Factory::install(precompiles); + B20Factory::install_with_observer( + precompiles, + BaseUpgrade::Beryl, + NoopPrecompileCallObserver, + ); BerylLookup::install(precompiles, BaseUpgrade::Beryl); - PolicyRegistryPrecompile::install(precompiles); + PolicyRegistryPrecompile::install_with_observer( + precompiles, + NoopPrecompileCallObserver, + ); ActivationRegistry::install(precompiles, admin); } }