Context
Raised by @carneiro in #2710 (comment): the execution type system (EvmKind, ExecutionKind, PoolTaskKind, plus PointInTime/BlockFilter) is redundant and can lose meaning — e.g. an ExecutionKind::CallPast always maps onto an EvmKind::CallPast, so the second enum adds no information, and since the tags are stored and hand-constructed, nothing stops them from disagreeing (a CallPast execution ending up tagged Inspect, etc.).
Analysis confirms the redundancy is structural:
EvmKind fuses three different concerns:
- revm configuration policy — but
create_evm (src/eth/executor/evm/util.rs) only ever reads kind.is_transaction()/is_call() (chain-id check, nonce check, EIP-3607). CallPast vs CallPresent vs Inspect make zero difference to the EVM.
- storage view — which actually comes from the input's
ExecutionKind (database.reset(input.kind())), not from EvmKind at all.
- pool scheduling lane — admission gate key + limits + metrics label, its only real job.
ExecutionKind mixes the what (transaction/call/inspect/access-list) with the where (pending/latest/past block) in its variants (CallPast(n), RPC(PointInTime), ...).
Proposal
Collapse to two orthogonal axes and derive everything else:
enum Job { Transaction, Call, Inspect, AccessList } — what is executed.
PointInTime { Pending, Latest, Past(n) } — which state view (already exists).
struct ExecutionContext { job: Job, at: PointInTime } replaces ExecutionKind.
create_evm takes only the policy bit it needs (is_transaction).
- The pool derives a small
Lane from (job, at) in a single match — used as admission gate key and metrics label (label strings unchanged so dashboards don't break).
EvmKind and the old ExecutionKind are deleted; hand-constructed kind tags disappear, so tag/input mismatches become impossible by construction.
PointInTime and BlockFilter stay separate: one is the execution-internal state view, the other is RPC request resolution (hash/timestamp/range → number) that happens before execution.
Scope
On main: ExecutionKind is used in 12 files (rpc/server.rs, storage/resolve_pending.rs, stratus_storage.rs, session.rs, evm inputs, follower importer/consensus, metrics); EvmKind in 7 (infra/metrics.rs, evm_worker_pool.rs, transaction_worker.rs, evm/mod.rs, evm/util.rs).
Branch: refac/evm-kind-orthogonal.
Context
Raised by @carneiro in #2710 (comment): the execution type system (
EvmKind,ExecutionKind,PoolTaskKind, plusPointInTime/BlockFilter) is redundant and can lose meaning — e.g. anExecutionKind::CallPastalways maps onto anEvmKind::CallPast, so the second enum adds no information, and since the tags are stored and hand-constructed, nothing stops them from disagreeing (a CallPast execution ending up taggedInspect, etc.).Analysis confirms the redundancy is structural:
EvmKindfuses three different concerns:create_evm(src/eth/executor/evm/util.rs) only ever readskind.is_transaction()/is_call()(chain-id check, nonce check, EIP-3607).CallPastvsCallPresentvsInspectmake zero difference to the EVM.ExecutionKind(database.reset(input.kind())), not fromEvmKindat all.ExecutionKindmixes the what (transaction/call/inspect/access-list) with the where (pending/latest/past block) in its variants (CallPast(n),RPC(PointInTime), ...).Proposal
Collapse to two orthogonal axes and derive everything else:
enum Job { Transaction, Call, Inspect, AccessList }— what is executed.PointInTime { Pending, Latest, Past(n) }— which state view (already exists).struct ExecutionContext { job: Job, at: PointInTime }replacesExecutionKind.create_evmtakes only the policy bit it needs (is_transaction).Lanefrom(job, at)in a single match — used as admission gate key and metrics label (label strings unchanged so dashboards don't break).EvmKindand the oldExecutionKindare deleted; hand-constructed kind tags disappear, so tag/input mismatches become impossible by construction.PointInTimeandBlockFilterstay separate: one is the execution-internal state view, the other is RPC request resolution (hash/timestamp/range → number) that happens before execution.Scope
On main:
ExecutionKindis used in 12 files (rpc/server.rs, storage/resolve_pending.rs, stratus_storage.rs, session.rs, evm inputs, follower importer/consensus, metrics);EvmKindin 7 (infra/metrics.rs, evm_worker_pool.rs, transaction_worker.rs, evm/mod.rs, evm/util.rs).Branch:
refac/evm-kind-orthogonal.