.. py:module:: ethereum.gray_glacier.vm.interpreter Ethereum Virtual Machine (EVM) Interpreter ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ A straightforward interpreter that executes EVM code. .. only:: stage1 Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: ethereum.gray_glacier.vm.interpreter.MessageCallOutput Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: ethereum.gray_glacier.vm.interpreter.process_message_call ethereum.gray_glacier.vm.interpreter.process_create_message ethereum.gray_glacier.vm.interpreter.process_message ethereum.gray_glacier.vm.interpreter.execute_code Attributes ~~~~~~~~~~ .. autoapisummary:: ethereum.gray_glacier.vm.interpreter.STACK_DEPTH_LIMIT ethereum.gray_glacier.vm.interpreter.MAX_CODE_SIZE Module Details --------------- STACK_DEPTH_LIMIT ~~~~~~~~~~~~~~~~~ .. py:data:: STACK_DEPTH_LIMIT .. undocinclude:: /../src/ethereum/gray_glacier/vm/interpreter.py :language: python :lines: 49-49 MAX_CODE_SIZE ~~~~~~~~~~~~~ .. py:data:: MAX_CODE_SIZE .. undocinclude:: /../src/ethereum/gray_glacier/vm/interpreter.py :language: python :lines: 50-50 MessageCallOutput ~~~~~~~~~~~~~~~~~ Output of a particular message call Contains the following: 1. `gas_left`: remaining gas after execution. 2. `refund_counter`: gas to refund after execution. 3. `logs`: list of `Log` generated during execution. 4. `accounts_to_delete`: Contracts which have self-destructed. 5. `touched_accounts`: Accounts that have been touched. 6. `has_erred`: True if execution has caused an error. .. class:: MessageCallOutput .. py:attribute:: gas_left :annotation: :ethereum.base_types.U256 .. py:attribute:: refund_counter :annotation: :ethereum.base_types.U256 .. py:attribute:: logs :annotation: :Tuple[ethereum.gray_glacier.eth_types.Log, Ellipsis] .. py:attribute:: accounts_to_delete :annotation: :Set[ethereum.gray_glacier.eth_types.Address] .. py:attribute:: touched_accounts :annotation: :Iterable[ethereum.gray_glacier.eth_types.Address] .. py:attribute:: has_erred :annotation: :bool process_message_call ~~~~~~~~~~~~~~~~~~~~ .. function:: process_message_call(message: ethereum.gray_glacier.vm.Message, env: ethereum.gray_glacier.vm.Environment) -> MessageCallOutput :noindexentry: If `message.current` is empty then it creates a smart contract else it executes a call from the `message.caller` to the `message.target`. :param message: Transaction specific items. :param env: External items required for EVM execution. :returns: **output** -- Output of the message call :rtype: `MessageCallOutput` .. undocinclude:: /../src/ethereum/gray_glacier/vm/interpreter.py :language: python :pyobject: process_message_call process_create_message ~~~~~~~~~~~~~~~~~~~~~~ .. function:: process_create_message(message: ethereum.gray_glacier.vm.Message, env: ethereum.gray_glacier.vm.Environment) -> ethereum.gray_glacier.vm.Evm :noindexentry: Executes a call to create a smart contract. :param message: Transaction specific items. :param env: External items required for EVM execution. :returns: **evm** -- Items containing execution specific objects. :rtype: :py:class:`~ethereum.london.vm.Evm` .. undocinclude:: /../src/ethereum/gray_glacier/vm/interpreter.py :language: python :pyobject: process_create_message process_message ~~~~~~~~~~~~~~~ .. function:: process_message(message: ethereum.gray_glacier.vm.Message, env: ethereum.gray_glacier.vm.Environment) -> ethereum.gray_glacier.vm.Evm :noindexentry: Executes a call to create a smart contract. :param message: Transaction specific items. :param env: External items required for EVM execution. :returns: **evm** -- Items containing execution specific objects :rtype: :py:class:`~ethereum.london.vm.Evm` .. undocinclude:: /../src/ethereum/gray_glacier/vm/interpreter.py :language: python :pyobject: process_message execute_code ~~~~~~~~~~~~ .. function:: execute_code(message: ethereum.gray_glacier.vm.Message, env: ethereum.gray_glacier.vm.Environment) -> ethereum.gray_glacier.vm.Evm :noindexentry: Executes bytecode present in the `message`. :param message: Transaction specific items. :param env: External items required for EVM execution. :returns: **evm** -- Items containing execution specific objects :rtype: `ethereum.vm.EVM` .. undocinclude:: /../src/ethereum/gray_glacier/vm/interpreter.py :language: python :pyobject: execute_code