Conversation
mattsse
requested review from
0xrusowsky,
DaniPopes,
figtracer,
grandizzy,
mablr and
stevencartavia
as code owners
September 1, 2026 11:33
Contributor
✅ Changelog foundThe deterministic check will validate the changed entry. |
figtracer
previously approved these changes
Sep 1, 2026
Member
Author
|
this looks a bit sloppy still |
mattsse
marked this pull request as draft
September 1, 2026 12:27
mattsse
commented
Sep 1, 2026
Comment on lines
+65
to
+72
| fn inject_hyperevm_precompiles<'db, I: FoundryInspectorExt<Self::FoundryContext<'db>>>( | ||
| &self, | ||
| evm: &mut Self::FoundryEvm<'db, I>, | ||
| data: &foundry_evm_networks::hyperevm::HyperEvmBlockPrecompileData, | ||
| block_number: u64, | ||
| ) { | ||
| data.inject(evm.precompiles_mut(), block_number); | ||
| } |
Member
Author
There was a problem hiding this comment.
I don't like this approach, I'd prefer if we could always inject the precompiles by going through evm.precompiles_mut()
figtracer
reviewed
Sep 1, 2026
| /// RPC block number exposed while executing a historical transaction in a temporary backend. | ||
| fork_block_number_override: Option<u64>, | ||
| /// Block-scoped HyperEVM read precompile data used for historical replay. | ||
| hyperevm_precompile_data: Option<HyperEvmBlockPrecompileData>, |
Member
There was a problem hiding this comment.
yep this shouldn't be here i belive
mattsse
force-pushed
the
mattsse/hyperevm-precompiles
branch
from
September 1, 2026 13:05
0a7fd0e to
19c315a
Compare
mattsse
marked this pull request as ready for review
September 1, 2026 14:12
mattsse
force-pushed
the
mattsse/hyperevm-precompiles
branch
2 times, most recently
from
September 1, 2026 15:52
fdde2eb to
7091471
Compare
Keep one EVM alive while cast run applies a block prefix and executes its target transaction. This preserves EVM-local configuration across replay while continuing to trace only the target and update network transaction context between transactions.
HyperEVM read calls depend on HyperCore state that is unavailable in the EVM database. Install exact block-scoped call results from archive nodes once before block replay when eth_blockPrecompileData is available, while keeping the RPC capability optional.
mattsse
force-pushed
the
mattsse/hyperevm-precompiles
branch
from
September 1, 2026 16:07
7091471 to
8e1dde4
Compare
decofe
approved these changes
Sep 7, 2026
mablr
requested changes
Sep 11, 2026
Comment on lines
+177
to
+192
| /// Tries to execute a canonical system transaction on a Foundry-wrapped EVM during replay. | ||
| /// | ||
| /// Returning `Ok(None)` means the transaction was not recognized. Implementations must not | ||
| /// mutate the EVM, its database, or inspector before returning `Ok(None)`, because callers may | ||
| /// fall back to ordinary execution using the same EVM instance. | ||
| #[cfg(feature = "monad")] | ||
| fn try_transact_foundry_system_replay<'db, I: FoundryInspectorExt<Self::FoundryContext<'db>>>( | ||
| &self, | ||
| _evm: &mut Self::FoundryEvm<'db, I>, | ||
| _tx: &Self::Tx, | ||
| ) -> eyre::Result<Option<ResultAndState<Self::HaltReason>>> | ||
| where | ||
| Self: 'db, | ||
| { | ||
| Ok(None) | ||
| } |
Member
There was a problem hiding this comment.
We should not add this to FoundryEvmFactory imo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HyperEVM read precompiles expose HyperCore state, so their results cannot be reconstructed from the EVM database alone. This adds a reusable block-scoped implementation that mirrors Nanoreth's exact
(calldata, gas limit)lookup semantics, including the active-address warming range and out-of-gas behavior for missing or failed queries.On HyperEVM mainnet and testnet,
cast runnow opportunistically requestseth_blockPrecompileDatafor the exact transaction block hash. The response remains local to that replay and is injected once into the replay EVM before any prefix or target transaction executes; it is not stored in the executor or backend, and no HyperEVM-specific transaction path is introduced. The RPC extension remains optional, so endpoints that do not expose it retain the existing replay behavior rather than becoming unusable.This is stacked on #16531, which makes
cast runreuse one EVM for block replay. A pinned end-to-end case covers a transaction that calls the BBO precompile at0x080efour times and reproduces its receipt gas exactly. This advances the HyperEVM portion of #7262.This contribution was implemented with AI assistance and reviewed and tested by the contributor.