Skip to content

fix(anvil): use fee manager as Tempo fork coinbase#14964

Merged
mablr merged 13 commits into
foundry-rs:masterfrom
BROCCOLO1D:fix/tempo-fork-coinbase
Jun 11, 2026
Merged

fix(anvil): use fee manager as Tempo fork coinbase#14964
mablr merged 13 commits into
foundry-rs:masterfrom
BROCCOLO1D:fix/tempo-fork-coinbase

Conversation

@BROCCOLO1D

@BROCCOLO1D BROCCOLO1D commented May 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Defaults Anvil Tempo forks to the Tempo fee manager address as block.coinbase/beneficiary when no genesis coinbase is supplied.
  • Applies the same default when anvil_reset starts forking from a non-forked Tempo node.
  • Keeps explicit genesis coinbase configuration unchanged.

Why

Tempo mainnet maps the zero-address validator token to a DONOTUSE sentinel. In fork mode, Anvil previously inherited the default zero beneficiary, so state-changing transactions could hit Tempo fee collection failures and then appear as missing receipts indefinitely. Tempo node-side simulation already uses the fee-manager sentinel to fall back to PathUSD.

Changes

  • Centralized the Tempo fork beneficiary default in NodeConfig.
  • Applied the default during Tempo fork startup and during anvil_reset when it initializes a fork from a non-forked node.
  • Added regression coverage for both startup forks and reset-to-fork flows.

Validation

  • git diff --check
  • cargo fmt --check
  • cargo test -p anvil --test it tempo::test_tempo

Scope

Small Anvil Tempo fork/default-beneficiary behavior only; does not alter non-Tempo forks, standalone Tempo nodes, or explicit genesis coinbase settings.

Closes #14866

@figtracer figtracer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two findings.

Comment thread crates/anvil/tests/it/tempo.rs
Comment thread crates/anvil/src/config.rs Outdated
@BROCCOLO1D
BROCCOLO1D force-pushed the fix/tempo-fork-coinbase branch from f5bc16a to 7c0b0dc Compare May 29, 2026 14:34

@figtracer figtracer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two follow-up comments from local repros.

Comment thread crates/anvil/src/eth/backend/mem/mod.rs
Comment thread crates/anvil/src/config.rs Outdated
@BROCCOLO1D

Copy link
Copy Markdown
Contributor Author

Addressed the Tempo fork beneficiary follow-ups: the fee-manager default now only applies while the beneficiary is still zero, so a runtime anvil_setCoinbase value survives anvil_reset into fork mode; after genesis handling, default Genesis::default() still gets the Tempo fee-manager beneficiary. Added targeted regressions for both cases and reran cargo fmt --check, git diff --check, and the three focused Tempo tests.

Comment thread crates/anvil/src/config.rs
@BROCCOLO1D

BROCCOLO1D commented Jun 5, 2026

Copy link
Copy Markdown
Contributor Author

Addressed the load-state follow-up in cb92dff: Backend::load_state now normalizes zero beneficiaries for Tempo forks after restoring the saved block env, covering both startup --load-state and runtime anvil_loadState. Added focused regressions for both paths.

Validation:

  • cargo fmt --check
  • git diff --check
  • cargo test -p anvil --test it loaded_zero_beneficiary_state -- --nocapture
  • cargo test -p anvil --test it load_state_uses_fee_manager -- --nocapture
  • cargo test -p anvil --test it tempo::test_tempo -- --nocapture

stevencartavia
stevencartavia previously approved these changes Jun 5, 2026

@mablr mablr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just fixed a weak write lock pattern.

Sgtm, thanks.

@figtracer figtracer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mablr
mablr merged commit 4be4ce5 into foundry-rs:master Jun 11, 2026
19 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Foundry Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

anvil --network tempo --fork-url: silently drops every state-changing tx; eth_getTransactionReceipt returns null forever

4 participants