Skip to content

feat(host-rpc): add RpcAliasOracle with shared positive-result cache#114

Merged
prestwich merged 4 commits intodevelopfrom
prestwich/eng-2079-rpc-alias-oracle-pr
Mar 23, 2026
Merged

feat(host-rpc): add RpcAliasOracle with shared positive-result cache#114
prestwich merged 4 commits intodevelopfrom
prestwich/eng-2079-rpc-alias-oracle-pr

Conversation

@prestwich
Copy link
Member

@prestwich prestwich commented Mar 20, 2026

[Claude Code]

Summary

  • Adds RpcAliasOracle<P> to signet-host-rpc — an RPC-based AliasOracle + AliasOracleFactory that queries EIP-7702 delegation bytecode via eth_getCode
  • Shared Arc<RwLock<HashSet<Address>>> cache across all clones/oracles: once an address is confirmed as a non-delegation contract, subsequent lookups skip the RPC call
  • Only positive results are cached (contract status is permanent); negatives are not cached since EOAs can become contracts later

Closes ENG-2079.

PR stack

#112 ← blobber abstraction ✅ merged
#113 ← config restructure ✅ merged

No remaining dependencies — this PR is ready to merge independently.

Test plan

  • cargo clippy -p signet-host-rpc --all-features --all-targets — clean
  • cargo +nightly fmt --check — clean
  • cargo t -p signet-host-rpc — pass

🤖 Generated with Claude Code

@prestwich prestwich requested a review from a team as a code owner March 20, 2026 18:45
@prestwich prestwich marked this pull request as draft March 20, 2026 18:45
@prestwich prestwich force-pushed the prestwich/eng-2078-config-restructure branch from c98993f to 42a76db Compare March 20, 2026 18:51
@prestwich prestwich force-pushed the prestwich/eng-2079-rpc-alias-oracle-pr branch from 8e099db to 0b4117a Compare March 20, 2026 18:53
@prestwich
Copy link
Member Author

Code review

[Claude Code]

No issues found. Checked for bugs and CLAUDE.md compliance.

Several items were considered but scored below threshold:

  • Delegation designator check uses starts_with rather than exact 23-byte length validation (low practical risk due to EIP-3541 EOF reservation)
  • std::sync::RwLock guards are correctly scoped before .await but lack an explicit comment documenting the invariant
  • No unit tests (consistent with the reth counterpart pattern)

None of these rose to the level of a blocking issue.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@prestwich prestwich force-pushed the prestwich/eng-2078-config-restructure branch from 42a76db to 842b1f0 Compare March 23, 2026 17:12
@prestwich prestwich force-pushed the prestwich/eng-2079-rpc-alias-oracle-pr branch from 0d3de36 to 299e356 Compare March 23, 2026 17:13
prestwich and others added 4 commits March 23, 2026 14:19
Merge RpcAliasOracle and RpcAliasOracleFactory into a single
RpcAliasOracle type that implements both traits. Add a shared
Arc<RwLock<HashSet>> cache for positive results — once an address
is confirmed as a non-delegation contract, subsequent lookups
return immediately without an RPC call.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Validate exact 23-byte length for EIP-7702 delegation detection
- Add #[instrument] span on should_alias with debug events
- Document std::sync::RwLock safety invariant (guards dropped before .await)
- Extract should_alias_bytecode for testability, add 6 unit tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@prestwich prestwich force-pushed the prestwich/eng-2079-rpc-alias-oracle-pr branch from 299e356 to fb78c75 Compare March 23, 2026 18:20
@prestwich prestwich marked this pull request as ready for review March 23, 2026 18:20
@prestwich prestwich changed the base branch from prestwich/eng-2078-config-restructure to develop March 23, 2026 18:21
@prestwich prestwich enabled auto-merge (squash) March 23, 2026 18:21
@prestwich prestwich closed this Mar 23, 2026
auto-merge was automatically disabled March 23, 2026 20:10

Pull request was closed

@prestwich prestwich reopened this Mar 23, 2026
@prestwich prestwich enabled auto-merge (squash) March 23, 2026 20:11
@prestwich prestwich merged commit e58c656 into develop Mar 23, 2026
12 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