Skip to content

fix: create alias oracle once per block instead of per address#103

Merged
prestwich merged 1 commit intomainfrom
fix/alias-oracle-per-block-main
Mar 13, 2026
Merged

fix: create alias oracle once per block instead of per address#103
prestwich merged 1 commit intomainfrom
fix/alias-oracle-per-block-main

Conversation

@prestwich
Copy link
Member

Summary

Performance fix: creates the alias oracle once per block instead of once per address lookup.

  • Moves AliasOracleFactory::create() out of the per-address should_alias helper and into run_evm, so all addresses in a block share the same host state snapshot
  • Removes the now-unused should_alias helper method
  • Expands the code comment in AliasOracleFactory::create() with a full correctness analysis of why Latest is safe (EOA→contract transitions require a birthday attack, and even then the failure mode is benign over-aliasing)

Previously, each address in a block called create()state_by_block_number_or_tag(Latest), opening a new state snapshot per address. Now a single snapshot is shared across the block.

Equivalent to #102 (targeting develop), ported to main.

Linear: ENG-2037

Test plan

  • cargo clippy -p signet-block-processor --all-features --all-targets
  • cargo clippy -p signet-block-processor --no-default-features --all-targets
  • cargo +nightly fmt
  • cargo t -p signet-block-processor

🤖 Generated with Claude Code

Move AliasOracleFactory::create() out of the per-address should_alias
helper and into run_evm, so all addresses in a block share the same
host state snapshot. Expand the comment in create() with a full
correctness analysis of why Latest is safe.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@prestwich prestwich requested a review from a team as a code owner March 13, 2026 18:43
@prestwich prestwich requested review from Evalir and Fraser999 March 13, 2026 18:44
@prestwich prestwich merged commit 7829e19 into main Mar 13, 2026
6 checks passed
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.

2 participants