feat(evm): Backend generic network#13579
Merged
zerosnacks merged 9 commits intofoundry-rs:masterfrom Mar 24, 2026
Merged
Conversation
d5c5ca8 to
92c4b51
Compare
Member
|
Small test failure, looks to be a regression in |
…chains When forking non-standard EVM chains (e.g. Moonbeam, Arbitrum), their block headers may lack standard Ethereum fields like `mixHash`. Using the generic `N`-typed provider (defaulting to `Ethereum`) caused deserialization failures for these chains.
mablr
commented
Mar 14, 2026
Collaborator
Author
mablr
left a comment
There was a problem hiding this comment.
When forking non-standard EVM chains (e.g. Moonbeam, Arbitrum), their block headers may lack standard Ethereum fields.
It's hacky to go back to AnyNetwork as default since we can't recover generically TxEnv from AnyTxEnvelope. A simple workaround is to spawn an AnyNetwork provider on init just to get the evm_env, and then continue with generic one.
0xrusowsky
reviewed
Mar 16, 2026
… conversion Introduces TryAnyIntoTxEnv trait in foundry-evm-core to replace the TxEnv: FromRecoveredTx<N::TxEnvelope> bound on Backend<N>. This allows Backend to default to AnyNetwork: - TxEnvelope (Ethereum): delegates to FromRecoveredTx directly - AnyTxEnvelope: extracts inner TxEnvelope via as_envelope(), then delegates to FromRecoveredTx; returns error for unknown tx types Co-authored-by: Amp <amp@ampcode.com>
0xrusowsky
reviewed
Mar 23, 2026
Contributor
0xrusowsky
left a comment
There was a problem hiding this comment.
i think that works now. thoughts @zerosnacks ?
0xrusowsky
approved these changes
Mar 23, 2026
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.
Description
Backend<N>generic over Network, leveraging foundry-fork-db that has become generic as well feat(backend): genericNetworkfoundry-fork-db#103TxEnvproduced thanks to this powerful boundTxEnv: FromRecoveredTx<N::TxEnvelope>, made possible by chore(evm): removeconfigure_tx_env*helpers #13728TryAnyIntoTxEnvtrait forAnyTxEnvelopetoTxEnvconversion