Hardfork configuration controlling which EIP rules are active during execution.
The spec_id atom identifies the target hardfork, and enabled?/2 answers
whether a given EIP is active under that spec.
Hardfork timeline (oldest → newest):
| Hardfork | Notable EIPs |
|---|---|
:frontier | baseline |
:homestead | — |
:tangerine_whistle | EIP-150 gas repricing |
:spurious_dragon | EIP-155, EIP-161, EIP-170 (code size limit) |
:byzantium | REVERT, RETURNDATASIZE, RETURNDATACOPY, STATICCALL |
:constantinople | CREATE2, SHL/SHR/SAR, EXTCODEHASH |
:istanbul | EIP-1344 (CHAINID), EIP-1884 (SELFBALANCE), EIP-2200 (SSTORE) |
:berlin | EIP-2929 (cold/warm access), EIP-2930 (access lists) |
:london | EIP-1559 (basefee), EIP-3529 (refund cap), EIP-3541 (0xEF rejection) |
:paris | The Merge (PREVRANDAO replaces DIFFICULTY) |
:shanghai | EIP-3651 (COINBASE pre-warm), EIP-3855 (PUSH0), EIP-3860 (initcode limit) |
:cancun | EIP-1153 (TLOAD/TSTORE), EIP-4844 (blobs), EIP-5656 (MCOPY), EIP-6780 (SELFDESTRUCT) |
:prague | EIP-2537 (BLS12-381 precompiles), EIP-7623 (calldata floor), EIP-7702 (set-code) |
:osaka | EIP-7825 (tx gas limit cap), EIP-7918 (blob base fee floor), EIP-7934 (block RLP size limit), EIP-7939 (CLZ) |
| EIP-7883 (ModExp repricing), EIP-7951 (P256VERIFY precompile) |
Summary
Functions
Returns a list of all known spec IDs in chronological order.
Returns the default hardfork config — Cancun, the most-tested hardfork.
Returns true if the given EIP feature flag is active in this hardfork config.
Creates a new hardfork config for the given spec_id.
Types
@type spec_id() ::
:frontier
| :homestead
| :tangerine_whistle
| :spurious_dragon
| :byzantium
| :constantinople
| :istanbul
| :berlin
| :london
| :paris
| :shanghai
| :cancun
| :prague
| :osaka
@type t() :: %EEVM.HardforkConfig{spec_id: spec_id()}
Functions
@spec all_spec_ids() :: [spec_id()]
Returns a list of all known spec IDs in chronological order.
@spec default() :: t()
Returns the default hardfork config — Cancun, the most-tested hardfork.
Callers that don't specify a hardfork explicitly get Cancun semantics, preserving backwards compatibility with all existing tests.
Returns true if the given EIP feature flag is active in this hardfork config.
Examples
iex> config = EEVM.HardforkConfig.new(:cancun)
iex> EEVM.HardforkConfig.enabled?(config, :eip_6780)
true
iex> config = EEVM.HardforkConfig.new(:london)
iex> EEVM.HardforkConfig.enabled?(config, :eip_6780)
false
iex> config = EEVM.HardforkConfig.new(:berlin)
iex> EEVM.HardforkConfig.enabled?(config, :eip_2929)
true
Creates a new hardfork config for the given spec_id.
Example
iex> EEVM.HardforkConfig.new(:cancun)
%EEVM.HardforkConfig{spec_id: :cancun}