Skip to content

fix(precompiles): Fix B20 Factory Address#2892

Merged
refcell merged 1 commit into
mainfrom
rf/fix-b20-factory-addr
May 23, 2026
Merged

fix(precompiles): Fix B20 Factory Address#2892
refcell merged 1 commit into
mainfrom
rf/fix-b20-factory-addr

Conversation

@refcell
Copy link
Copy Markdown
Contributor

@refcell refcell commented May 23, 2026

Summary

This fixes the B20 factory singleton address constant to use the canonical B20F precompile address. The change keeps factory storage aligned with the intended precompile address and avoids encoding the factory marker byte in the wrong position.

@refcell refcell added bug Flag: Something isn't working execution Area: execution labels May 23, 2026
@refcell refcell self-assigned this May 23, 2026
@cb-heimdall
Copy link
Copy Markdown
Collaborator

cb-heimdall commented May 23, 2026

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@refcell refcell requested a review from eric-ships May 23, 2026 01:39
@refcell refcell marked this pull request as ready for review May 23, 2026 01:39
@refcell refcell enabled auto-merge May 23, 2026 01:40
@refcell refcell force-pushed the rf/fix-b20-factory-addr branch from b6c806a to 38647e2 Compare May 23, 2026 01:43
Comment thread crates/common/precompiles/src/b20_factory/storage.rs
@refcell refcell marked this pull request as draft May 23, 2026 01:43
auto-merge was automatically disabled May 23, 2026 01:43

Pull request was converted to draft

@refcell refcell marked this pull request as ready for review May 23, 2026 01:45
@refcell refcell enabled auto-merge May 23, 2026 01:45
@github-actions
Copy link
Copy Markdown
Contributor

Review Summary

No issues found. The address fix is correct — the old constant 0xb20f...000f had the factory marker byte in the wrong position (byte 19 instead of being part of the B20F prefix). The new address 0xB20F000000000000000000000000000000000000 properly places the prefix in bytes 0–1 with zeros in the remaining bytes.

Both the Rust constant and the devnet shell script are updated consistently, and the new pinning test guards against future regressions.

@refcell refcell added this pull request to the merge queue May 23, 2026
Merged via the queue into main with commit 92abf0a May 23, 2026
22 of 23 checks passed
@refcell refcell deleted the rf/fix-b20-factory-addr branch May 23, 2026 02:30
haardikk21 pushed a commit to base/base-anvil that referenced this pull request May 23, 2026
…t fix

Original pin (c0ebd548d, 'align base-std precompile parity') lived on an
off-main branch and was missing every fix landed since 2026-05-22 12:24,
including:

  - b20 factory address moved back to 0xB20F..0000 to match base-std
    fixtures (base/base#2892)
  - security share ratio sentinel alignment (#2889)
  - REDEEM_SENDER_POLICY default = ALWAYS_BLOCK_ID (#2887)
  - METADATA_ROLE required for updateContractURI (#2878)
  - assorted policy / activation precompile fixes

This PR bumps to 2f27f588ec75e79b7868524b888947965237b49e, which sits on
top of base/base#2895 ('seed policy builtins independently of bytecode
init'). The latter fix is required because base-anvil pre-warms the
three singleton precompile addresses with sentinel bytecode so Solidity
high-level wrappers pass the EXTCODESIZE check; this pre-warm also
trips the upstream lazy-init gate (is_initialized = 'has code'),
causing PolicyRegistry's ALWAYS_ALLOW_ID / ALWAYS_BLOCK_ID slots to
stay empty and next_counter to start at 0.

End-to-end verification against base-std fork tests:

  - before: 116 / 233 pass (stale rev)
  - after rev bump only:  437 / 465
  - after rev bump + #2895: 450 / 463

The remaining 13 failures are unrelated upstream issues (EIP712 fields
bitfield, updateName metadata propagation, AccessControl caller
attribution) tracked separately.

TODO: re-pin to base/base main once #2895 lands and is included in
the trunk SHA.
haardikk21 added a commit to base/base-anvil that referenced this pull request May 23, 2026
* fix(deps): bump reth v2 stack

* ci: fix dependency deny checks

* fix: add Default fallback to Header / VyperConfig test literals

The alloy 2.0.5 and foundry-config bumps added new fields to Header and
VyperConfig respectively. The library/binary builds were unaffected,
but five test-target struct literals broke compilation under
'cargo check --all-targets'. Add '..Default::default()' so future
upstream field additions don't break the test build again.

* chore(precompiles): bump base/base rev to current main + builtins-init fix

Original pin (c0ebd548d, 'align base-std precompile parity') lived on an
off-main branch and was missing every fix landed since 2026-05-22 12:24,
including:

  - b20 factory address moved back to 0xB20F..0000 to match base-std
    fixtures (base/base#2892)
  - security share ratio sentinel alignment (#2889)
  - REDEEM_SENDER_POLICY default = ALWAYS_BLOCK_ID (#2887)
  - METADATA_ROLE required for updateContractURI (#2878)
  - assorted policy / activation precompile fixes

This PR bumps to 2f27f588ec75e79b7868524b888947965237b49e, which sits on
top of base/base#2895 ('seed policy builtins independently of bytecode
init'). The latter fix is required because base-anvil pre-warms the
three singleton precompile addresses with sentinel bytecode so Solidity
high-level wrappers pass the EXTCODESIZE check; this pre-warm also
trips the upstream lazy-init gate (is_initialized = 'has code'),
causing PolicyRegistry's ALWAYS_ALLOW_ID / ALWAYS_BLOCK_ID slots to
stay empty and next_counter to start at 0.

End-to-end verification against base-std fork tests:

  - before: 116 / 233 pass (stale rev)
  - after rev bump only:  437 / 465
  - after rev bump + #2895: 450 / 463

The remaining 13 failures are unrelated upstream issues (EIP712 fields
bitfield, updateName metadata propagation, AccessControl caller
attribution) tracked separately.

TODO: re-pin to base/base main once #2895 lands and is included in
the trunk SHA.

* chore(deps): bump rand 0.8.5 -> 0.8.6 for RUSTSEC-2026-0097

Resolves cargo deny advisories failure caused by unsound aliased
mutable references in rand v0.8.5 when log + thread_rng features
are active.

* ci: switch from depot.dev runners to GitHub-hosted standard runners

The repo was forked from foundry which uses custom depot.dev runners
(depot-ubuntu-latest, depot-ubuntu-22.04-16, depot-windows-latest-16,
foundry-runner, macos-*-large, etc.) that don't exist in the base
GitHub org and never trigger CI jobs on the fork.

Runner mapping:
  depot-ubuntu-latest / -16          -> ubuntu-latest
  depot-ubuntu-latest-arm-16         -> ubuntu-24.04-arm
  depot-ubuntu-22.04-16              -> ubuntu-22.04
  depot-ubuntu-22.04-arm-16          -> ubuntu-22.04-arm
  depot-macos-latest / macos-*-large -> macos-latest / macos-13
  depot-windows-latest-16            -> windows-latest
  foundry-runner                     -> ubuntu-latest

docker-publish: replaced depot/setup-action + depot/build-push-action
with standard docker/setup-qemu-action + docker/setup-buildx-action +
docker/build-push-action (multi-arch via QEMU instead of depot infra).

release: dropped 'contains(matrix.runner, "depot")' conditional gating
sccache so it runs unconditionally now that the matrix has no depot
labels.

* chore(precompiles): bump base/base rev to tip of main (77b26157f)

Picks up #2895 (policy builtins init fix - now merged) plus #2860,
#2893, #2894. Fork-test suite holds at 450/465 passing; remaining 13
failures are tracked upstream (EIP712 fields=0x0c vs 0x0f, updateName
metadata, ActivationRegistry deactivate, B20Security recursion +
factory bootstrap).

* chore(precompiles): bump base/base rev to tip of main (a4b689fda)

Picks up #2859 'Align Base Std Precompile Parity' (squash of 8804a1282)
which fixes most B20Security / B20Factory / Policy parity issues with
the base-std fixtures. Fork-test suite holds at 450/465 passing -
remaining 13 failures all stem from the unmerged permittable.rs EIP-712
fields=0x0c -> 0x0f canonical-domain change tracked separately.

---------

Co-authored-by: haardikk21 <haardik@base.org>
Co-authored-by: Haardik H <haardik.haardik@coinbase.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Flag: Something isn't working execution Area: execution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants