@ethereumjs/evm / EVMOpts
Interface: EVMOpts
Options for instantiating a EVM.
Table of contents
Properties
Properties
allowUnlimitedContractSize
• Optional
allowUnlimitedContractSize: boolean
Allows unlimited contract sizes while debugging. By setting this to true
, the check for
contract size limit of 24KB (see EIP-170) is bypassed.
Default: false
[ONLY set to true
during debugging]
Defined in
types.ts:223
allowUnlimitedInitCodeSize
• Optional
allowUnlimitedInitCodeSize: boolean
Allows unlimited contract code-size init while debugging. This (partially) disables EIP-3860.
Gas cost for initcode size analysis will still be charged. Use with caution.
Defined in
types.ts:229
blockchain
• Optional
blockchain: Blockchain
Defined in
types.ts:269
common
• Optional
common: Common
Use a Common instance for EVM instantiation.
Supported EIPs
- EIP-1153 - Transient storage opcodes (Cancun)
- EIP-1559 - Fee market change for ETH 1.0 chain
- EIP-2537 - BLS precompiles (removed in v4.0.0, see latest v3 release)
- EIP-2565 - ModExp gas cost
- EIP-2718 - Transaction Types
- EIP-2935 - Serve historical block hashes from state (Prague)
- EIP-2929 - gas cost increases for state access opcodes
- EIP-2930 - Optional access list tx type
- EIP-3074 - AUTH and AUTHCALL opcodes
- EIP-3198 - Base fee Opcode
- EIP-3529 - Reduction in refunds
- EIP-3540 - EVM Object Format (EOF) v1 (
outdated
)
- EIP-3541 - Reject new contracts starting with the 0xEF byte
- EIP-3554 - Difficulty Bomb Delay to December 2021 (only PoW networks)
- EIP-3607 - Reject transactions from senders with deployed code
- EIP-3651 - Warm COINBASE (Shanghai)
- EIP-3670 - EOF - Code Validation (
outdated
)
- EIP-3675 - Upgrade consensus to Proof-of-Stake
- EIP-3855 - Push0 opcode (Shanghai)
- EIP-3860 - Limit and meter initcode (Shanghai)
- EIP-4345 - Difficulty Bomb Delay to June 2022
- EIP-4399 - Supplant DIFFICULTY opcode with PREVRANDAO (Merge)
- EIP-4788 - Beacon block root in the EVM (Cancun)
- EIP-4844 - Shard Blob Transactions (Cancun)
- EIP-4895 - Beacon chain push withdrawals as operations (Shanghai)
- EIP-5133 - Delaying Difficulty Bomb to mid-September 2022 (Gray Glacier)
- EIP-5656 - MCOPY - Memory copying instruction (Cancun)
- EIP-6110 - Supply validator deposits on chain (Prague)
- EIP-6780 - SELFDESTRUCT only in same transaction (Cancun)
- EIP-7002 - Execution layer triggerable withdrawals (Prague)
- EIP-7251 - Execution layer triggerable validator consolidations (Prague)
- EIP-7702 - EOA code transactions (Prague) (
outdated
)
- EIP-7709 - Read BLOCKHASH from storage and update cost (Osaka)
- EIP-7516 - BLOBBASEFEE opcode (Cancun)
- EIP-7685 - General purpose execution layer requests (Prague)
Annotations:
experimental
: behaviour can change on patch versions
Defined in
types.ts:215
customOpcodes
• Optional
customOpcodes: CustomOpcode
[]
Override or add custom opcodes to the EVM instruction set
These custom opcodes are EIP-agnostic and are always statically added
To delete an opcode, add an entry of format {opcode: number}
. This will delete that opcode from the EVM.
If this opcode is then used in the EVM, the INVALID
opcode would instead be used.
To add an opcode, add an entry of the following format:
{
// The opcode number which will invoke the custom opcode logic
opcode: number
// The name of the opcode (as seen in the step
event)
opcodeName: string
// The base fee of the opcode
baseFee: number
// If the opcode charges dynamic gas, add this here. To charge the gas, use the i
methods of the BN, to update the charged gas
gasFunction?: function(runState: RunState, gas: BN, common: Common)
// The logic of the opcode which holds the logic of changing the current state
logicFunction: function(runState: RunState)
}
Note: gasFunction and logicFunction can both be async or synchronous functions
Defined in
types.ts:251
customPrecompiles
• Optional
customPrecompiles: CustomPrecompile
[]
Defined in
types.ts:259
profiler
• Optional
profiler: EVMProfilerOpts
Defined in
types.ts:274
stateManager
• Optional
stateManager: EVMStateManagerInterface
Defined in
types.ts:264