Skip to main content

Module evm_version

Module evm_version 

Source
Expand description

Detects the EVM version a node executes at a given block.

Replaying a transaction needs the spec its chain applied at that block. For chains without a hardfork schedule known to Foundry, header fields only hint at it, and replaying an old block under a newer spec can make a transaction succeed locally that failed on-chain because an opcode was not active yet. probe_evm_version instead asks the node which features it executes.

Constantsยง

PROBES ๐Ÿ”’
Probed features in activation order, each paired with the EVM version that introduced it and runtime code that halts exceptionally unless the feature is active.
PROBE_CALL_GAS ๐Ÿ”’
Gas limit of the probe call, enough for the worst case in which every probe fails. Under EIP-8037 the six accounts the probe creates cost 1,101,600 state gas alone.
PROBE_GAS ๐Ÿ”’
Gas forwarded to each probe. A failing probe consumes all of it.

Functionsยง

deploy_code ๐Ÿ”’
Returns initcode that deploys runtime.
evm_version_from_mask ๐Ÿ”’
Maps the probe result to the newest version whose probe and all earlier probes succeeded.
probe_code ๐Ÿ”’
Builds the creation code of the probe call.
probe_evm_version
Returns the newest EVM version whose features, and those of every earlier probed version, the node executes at block.