@ethereumjs/evm / EVMOpts
Options for instantiating a EVM.
- allowUnlimitedContractSize
- allowUnlimitedInitCodeSize
- blockchain
- common
- customOpcodes
- customPrecompiles
- profiler
- stateManager
• 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]
• 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.
• Optional
blockchain: Blockchain
• Optional
common: Common
Use a Common instance for EVM instantiation.
- EIP-1153 - Transient storage opcodes (Cancun)
- EIP-1559 - Fee market change for ETH 1.0 chain
- EIP-2315 - Simple subroutines for the EVM (
outdated
) - EIP-2537 - BLS precompiles (removed in v4.0.0, see latest v3 release)
- EIP-2565 - ModExp gas cost
- EIP-2718 - Transaction Types
- EIP-2935 - Save historical block hashes in state (
experimental
) - 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-6780 - SELFDESTRUCT only in same transaction (Cancun)
- EIP-7516 - BLOBBASEFEE opcode (Cancun)
Annotations:
experimental
: behaviour can change on patch versions
• 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
• Optional
customPrecompiles: CustomPrecompile
[]
• Optional
profiler: EVMProfilerOpts
• Optional
stateManager: EVMStateManagerInterface