Skip to content

refactor(evm): harden uniform family dispatch #79

Closed

Description

@mowind

Parent

#78

What to build

Make Forge test execution, Cast transaction replay and local/traced calls, and Chisel session construction select their concrete EVM network type through direct exhaustive matches on the canonical resolved EvmFamily.

Remove the local shadow family enums, projection helpers, sibling-command dispatch coupling, and helper-only mapping tests. Preserve each command's resolved-profile flow, generic execution implementation, diagnostics, output channels, and construction-time family coherence validation.

This is a caller-local static-dispatch cleanup. It must not introduce a shared dispatcher, macro, visitor framework, trait object, registry, sum type, typed carrier, or other new seam.

Acceptance criteria

  • Forge test execution directly matches the canonical EvmFamily, explicitly naming Ethereum, Optimism, and Tempo without a wildcard, default arm, or inferred Ethereum fallback.
  • Cast run and Cast call each directly match the canonical EvmFamily; Cast call no longer imports a dispatch enum or projection helper from Cast run.
  • Chisel execution directly matches the canonical EvmFamily; session identity persistence remains unchanged.
  • The affected local shadow enums, projection helpers, helper-only imports, and helper-only mapping tests are removed.
  • HashKey continues to use the Optimism EVM family, Celo continues to use the Ethereum EVM family, and Tempo continues to use the Tempo EVM family without profile-specific execution arms.
  • Profile resolution, fork identity resolution, concrete EVM network associations, EVM construction, Cast RPC representation paths, Script, Anvil, and Verify bytecode remain unchanged.
  • No new public, private, or test-only dispatch seam is introduced.
  • Existing Forge, Cast, and Chisel command/profile coverage remains green, including relevant HashKey and Tempo coverage.
  • A final source audit finds no affected NetworkDispatchKind, network_dispatch_kind, ChiselExecutionKind, or chisel_execution_kind, and no catch-all family projection in the migrated leaves.
  • Rust formatting and focused Forge, Cast, and Chisel validation pass with the HashKey feature enabled.

Blocked by

None — can start immediately.

Activity

  1. mowind commented on Aug 5, 2026

    @mowind
    OwnerAuthor

    Implemented in e7d3aad on v1.7.1-hsk-b20.

    • Forge test execution, cast run, cast call, and chisel session construction now match the canonical ResolvedNetworkProfile::evm_family() exhaustively (Ethereum / Optimism / Tempo, no wildcard or default arm).
    • Removed the local NetworkDispatchKind / ChiselExecutionKind shadow enums, their catch-all projection helpers, the cross-command dispatch import in cast call, and the helper-only mapping tests.
    • No new dispatch seam introduced; profile resolution, fork identity, EVM construction, Cast RPC representation paths, Script, Anvil, and Verify bytecode untouched. Chisel session identity persistence unchanged.
    • Source audit: no NetworkDispatchKind / network_dispatch_kind / ChiselExecutionKind / chisel_execution_kind remain; no catch-all family projection in the migrated leaves.
    • Validation with the hashkey feature: typecheck clean; forge/cast/chisel lib tests green except the pre-existing cast opts::tests::parse_* SIGABRT stack overflows (reproduced on base); forge cli test_cmd + hashkey green except pre-existing vyper-missing testdata failure (reproduced on base); cast cli suite 187/187; chisel it 29/29 (incl. hashkey_b20_stateful_session); rustfmt clean on the touched files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentFully specified and ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions