.. py:module:: ethereum.paris.vm.instructions.block Ethereum Virtual Machine (EVM) Block Instructions ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ Implementations of the EVM block instructions. .. only:: stage1 Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: ethereum.paris.vm.instructions.block.block_hash ethereum.paris.vm.instructions.block.coinbase ethereum.paris.vm.instructions.block.timestamp ethereum.paris.vm.instructions.block.number ethereum.paris.vm.instructions.block.prev_randao ethereum.paris.vm.instructions.block.gas_limit ethereum.paris.vm.instructions.block.chain_id Module Details --------------- block_hash ~~~~~~~~~~ .. function:: block_hash(evm: ethereum.paris.vm.Evm) -> None :noindexentry: Push the hash of one of the 256 most recent complete blocks onto the stack. The block number to hash is present at the top of the stack. :param evm: The current EVM frame. :raises ~ethereum.paris.vm.exceptions.StackUnderflowError: If `len(stack)` is less than `1`. :raises ~ethereum.paris.vm.exceptions.OutOfGasError: If `evm.gas_left` is less than `20`. .. undocinclude:: /../src/ethereum/paris/vm/instructions/block.py :language: python :pyobject: block_hash coinbase ~~~~~~~~ .. function:: coinbase(evm: ethereum.paris.vm.Evm) -> None :noindexentry: Push the current block's beneficiary address (address of the block miner) onto the stack. Here the current block refers to the block in which the currently executing transaction/call resides. :param evm: The current EVM frame. :raises ~ethereum.paris.vm.exceptions.StackOverflowError: If `len(stack)` is equal to `1024`. :raises ~ethereum.paris.vm.exceptions.OutOfGasError: If `evm.gas_left` is less than `2`. .. undocinclude:: /../src/ethereum/paris/vm/instructions/block.py :language: python :pyobject: coinbase timestamp ~~~~~~~~~ .. function:: timestamp(evm: ethereum.paris.vm.Evm) -> None :noindexentry: Push the current block's timestamp onto the stack. Here the timestamp being referred is actually the unix timestamp in seconds. Here the current block refers to the block in which the currently executing transaction/call resides. :param evm: The current EVM frame. :raises ~ethereum.paris.vm.exceptions.StackOverflowError: If `len(stack)` is equal to `1024`. :raises ~ethereum.paris.vm.exceptions.OutOfGasError: If `evm.gas_left` is less than `2`. .. undocinclude:: /../src/ethereum/paris/vm/instructions/block.py :language: python :pyobject: timestamp number ~~~~~~ .. function:: number(evm: ethereum.paris.vm.Evm) -> None :noindexentry: Push the current block's number onto the stack. Here the current block refers to the block in which the currently executing transaction/call resides. :param evm: The current EVM frame. :raises ~ethereum.paris.vm.exceptions.StackOverflowError: If `len(stack)` is equal to `1024`. :raises ~ethereum.paris.vm.exceptions.OutOfGasError: If `evm.gas_left` is less than `2`. .. undocinclude:: /../src/ethereum/paris/vm/instructions/block.py :language: python :pyobject: number prev_randao ~~~~~~~~~~~ .. function:: prev_randao(evm: ethereum.paris.vm.Evm) -> None :noindexentry: Push the `prev_randao` value onto the stack. The `prev_randao` value is the random output of the beacon chain's randomness oracle for the previous block. :param evm: The current EVM frame. :raises ~ethereum.paris.vm.exceptions.StackOverflowError: If `len(stack)` is equal to `1024`. :raises ~ethereum.paris.vm.exceptions.OutOfGasError: If `evm.gas_left` is less than `2`. .. undocinclude:: /../src/ethereum/paris/vm/instructions/block.py :language: python :pyobject: prev_randao gas_limit ~~~~~~~~~ .. function:: gas_limit(evm: ethereum.paris.vm.Evm) -> None :noindexentry: Push the current block's gas limit onto the stack. Here the current block refers to the block in which the currently executing transaction/call resides. :param evm: The current EVM frame. :raises ~ethereum.paris.vm.exceptions.StackOverflowError: If `len(stack)` is equal to `1024`. :raises ~ethereum.paris.vm.exceptions.OutOfGasError: If `evm.gas_left` is less than `2`. .. undocinclude:: /../src/ethereum/paris/vm/instructions/block.py :language: python :pyobject: gas_limit chain_id ~~~~~~~~ .. function:: chain_id(evm: ethereum.paris.vm.Evm) -> None :noindexentry: Push the chain id onto the stack. :param evm: The current EVM frame. :raises ~ethereum.paris.vm.exceptions.StackOverflowError: If `len(stack)` is equal to `1024`. :raises ~ethereum.paris.vm.exceptions.OutOfGasError: If `evm.gas_left` is less than `2`. .. undocinclude:: /../src/ethereum/paris/vm/instructions/block.py :language: python :pyobject: chain_id