Skip to content

fix: use install_with_observer for B20Factory/PolicyRegistry precompiles#53

Open
stephancill wants to merge 1 commit into
base-anvil-forkfrom
stephancilliers/anvil-install-observer
Open

fix: use install_with_observer for B20Factory/PolicyRegistry precompiles#53
stephancill wants to merge 1 commit into
base-anvil-forkfrom
stephancilliers/anvil-install-observer

Conversation

@stephancill

Copy link
Copy Markdown
Contributor

Motivation

base/base's fork-test CI (base-std-fork-tests.yml) patches the local precompile crates into the pinned base-anvil and rebuilds anvil/forge. It now fails to compile on every base/base PR:

error[E0599]: no function or associated item named `install` found for struct `B20Factory`
error: could not compile `foundry-evm-networks`

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.

Solution

  • Switch both to install_with_observer with a NoopPrecompileCallObserver, matching provider.rs. Observation is scoped to the B-20 token call path (which anvil doesn't wire up), so a no-op observer is correct.
  • B20Factory::install_with_observer(precompiles, upgrade, observer) also takes a BaseUpgrade, so thread Beryl through like the lookup (ActivationRegistry::install and BerylLookup::install are unchanged and kept).
  • Bump the base/base pin 401ffe4d → cc8ee38 (current main) so this crate compiles against the observer-only API.

Verified: cargo check -p foundry-evm-networks compiles clean against main.

Context

Follows #50 (which threaded BaseUpgrade into the B-20 lookup). This is the same class of base/base API drift; addresses the newer removal of the plain install shims.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

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