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.