Skip to content

refactor(cast): generic cast run#14121

Merged
zerosnacks merged 2 commits into
foundry-rs:masterfrom
figtracer:feat/cast-run-generic
Apr 7, 2026
Merged

refactor(cast): generic cast run#14121
zerosnacks merged 2 commits into
foundry-rs:masterfrom
figtracer:feat/cast-run-generic

Conversation

@figtracer
Copy link
Copy Markdown
Collaborator

@figtracer figtracer commented Apr 3, 2026

@figtracer figtracer changed the title generic cast run refactor(cast): generic cast run Apr 3, 2026
@figtracer figtracer force-pushed the feat/cast-run-generic branch 7 times, most recently from bb2d324 to 3aa03f5 Compare April 3, 2026 16:01
Copy link
Copy Markdown
Collaborator

@mablr mablr left a comment

Choose a reason for hiding this comment

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

Lgtm 👍

Merge conflicts to be resolved.

@figtracer
Copy link
Copy Markdown
Collaborator Author

on it

@figtracer figtracer force-pushed the feat/cast-run-generic branch from 3aa03f5 to b9fdc02 Compare April 6, 2026 10:53
@figtracer figtracer marked this pull request as ready for review April 6, 2026 10:54
@zerosnacks zerosnacks merged commit d7af499 into foundry-rs:master Apr 7, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Foundry Apr 7, 2026
decofe added a commit that referenced this pull request Apr 9, 2026
The generic `FoundryEvmNetwork` refactor (PR #14121) changed `cast run`
from using `AnyNetwork` to dispatching via `FEN::Network`. Non-Tempo
chains use `EthEvmNetwork` whose `Network = Ethereum`, which cannot
deserialize OP Stack deposit transactions (type 0x7e).

When `cast run` fetches a full block from Base or Optimism, the block
contains deposit transactions that `Ethereum`'s `TxEnvelope` can't
parse, causing: `data did not match any variant of untagged enum
BlockTransactions`.

Fix: use `FoundryNetwork` for the RPC provider (which supports all tx
types including OP deposits) while keeping the EVM factory dispatch
unchanged. Also adds `UIfmt` and `UIfmtSignatureExt` impls for
`FoundryTxEnvelope`.

Co-authored-by: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019d7101-de26-7256-87eb-0f2365d1fc6c
decofe added a commit that referenced this pull request Apr 9, 2026
`cast run` on OP Stack chains (Base, Optimism) fails with:
`data did not match any variant of untagged enum BlockTransactions`

Root cause: the generic `FoundryEvmNetwork` refactor (PR #14121) changed
`cast run` from using `AnyNetwork` to dispatching via `FEN::Network`.
Non-Tempo chains use `EthEvmNetwork` whose `Network = Ethereum`, which
cannot deserialize OP deposit transactions (type 0x7e).

Fix: decouple the RPC provider network type from the EVM factory by making
`run_with_provider` generic over both `FEN` (EVM factory) and `N`
(provider network). The dispatch in `run()` now detects OP Stack chains
early via `is_optimism()` and uses `FoundryNetwork` as the provider
network, which supports all transaction types including OP deposits.

Co-Authored-By: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
decofe added a commit that referenced this pull request Apr 13, 2026
- Add Vyper installation to test-isolate.yml flaky job (was missing,
  causing 'Found Vyper sources, but no compiler versions are available'
  since the flaky_testdata test was added in #14052)
- Wildcard ambiguous selector names and gas values in
  flaky_osaka_can_run_p256_precompile snapshot (the OpenChain 4byte API
  returns non-deterministic ordering for colliding selectors, and gas
  values shifted after the generic cast run refactor in #14121)

Co-Authored-By: zerosnacks <95942363+zerosnacks@users.noreply.github.com>
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.

3 participants