Skip to content

Commit f539df9

Browse files
stephancillOpenCode
andcommitted
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 <opencode-noreply@coinbase.com>
1 parent f4370bc commit f539df9

3 files changed

Lines changed: 24 additions & 10 deletions

File tree

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/evm/networks/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ alloy-primitives = { workspace = true, features = [
2929
# github.com/base/base; bump via ./script/bump-base.sh. To iterate against a
3030
# local base/base checkout instead, uncomment the [patch] block at the bottom
3131
# of the workspace root Cargo.toml.
32-
base-common-precompiles = { git = "https://github.com/base/base.git", rev = "401ffe4d60f3d0e9c34168c865521a3b186339df" }
33-
base-common-chains = { git = "https://github.com/base/base.git", rev = "401ffe4d60f3d0e9c34168c865521a3b186339df" }
32+
base-common-precompiles = { git = "https://github.com/base/base.git", rev = "cc8ee3860973c6a98823c63324e95ad9daf63e1b" }
33+
base-common-chains = { git = "https://github.com/base/base.git", rev = "cc8ee3860973c6a98823c63324e95ad9daf63e1b" }
3434

3535
revm = { workspace = true, features = [
3636
"std",

crates/evm/networks/src/lib.rs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ use alloy_primitives::{Address, U256, address, keccak256, map::AddressHashMap};
1616
use base_common_chains::BaseUpgrade;
1717
use base_common_precompiles::{
1818
ActivationFeature, ActivationRegistry, ActivationRegistryStorage, B20Factory,
19-
B20FactoryStorage, BerylLookup, PolicyRegistryPrecompile, PolicyRegistryStorage,
19+
B20FactoryStorage, BerylLookup, NoopPrecompileCallObserver, PolicyRegistryPrecompile,
20+
PolicyRegistryStorage,
2021
};
2122
use clap::Parser;
2223
use serde::{Deserialize, Serialize};
@@ -165,10 +166,23 @@ impl NetworkConfigs {
165166
// upgrade so each B-20 token resolves its logic version per-call
166167
// (e.g. Stablecoin V1 at Beryl). Pinned to Beryl until `--base-fork`
167168
// (BOP-428) makes the fork selectable at runtime.
169+
//
170+
// The factory/policy singletons use `install_with_observer` with a
171+
// no-op observer, matching provider.rs; base/base dropped the plain
172+
// `install` shims in favour of the observed variants. Metrics
173+
// observation is scoped to the B-20 token call path, which anvil
174+
// does not wire up, so a no-op observer is correct here.
168175
let admin = Some(self.base_activation_admin());
169-
B20Factory::install(precompiles);
176+
B20Factory::install_with_observer(
177+
precompiles,
178+
BaseUpgrade::Beryl,
179+
NoopPrecompileCallObserver,
180+
);
170181
BerylLookup::install(precompiles, BaseUpgrade::Beryl);
171-
PolicyRegistryPrecompile::install(precompiles);
182+
PolicyRegistryPrecompile::install_with_observer(
183+
precompiles,
184+
NoopPrecompileCallObserver,
185+
);
172186
ActivationRegistry::install(precompiles, admin);
173187
}
174188
}

0 commit comments

Comments
 (0)