Skip to content

Move blob/transaction gas calculations out of .../vm/gas.py #1264

@SamWilsn

Description

@SamWilsn

The vm module should only contain stuff relevant to the EVM. Blob and tx fee calculations should be moved into a higher module.

A few other random gas constants that should be put somewhere better:

  • TX_BASE_COST = Uint(21000)
    """
    Base cost of a transaction in gas units. This is the minimum amount of gas
    required to execute a transaction.
    """
    FLOOR_CALLDATA_COST = Uint(10)
    """
    Minimum gas cost per byte of calldata as per [EIP-7623]. Used to calculate
    the minimum gas cost for transactions that include calldata.
    [EIP-7623]: https://eips.ethereum.org/EIPS/eip-7623
    """
    STANDARD_CALLDATA_TOKEN_COST = Uint(4)
    """
    Gas cost per byte of calldata as per [EIP-7623]. Used to calculate the
    gas cost for transactions that include calldata.
    [EIP-7623]: https://eips.ethereum.org/EIPS/eip-7623
    """
    TX_CREATE_COST = Uint(32000)
    """
    Additional gas cost for creating a new contract.
    """
    TX_ACCESS_LIST_ADDRESS_COST = Uint(2400)
    """
    Gas cost for including an address in the access list of a transaction.
    """
    TX_ACCESS_LIST_STORAGE_KEY_COST = Uint(1900)
    """
    Gas cost for including a storage key in the access list of a transaction.
    """
    TX_MAX_GAS_LIMIT = Uint(16_777_216)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-spec-specsArea: Specification—The Ethereum specification itself (eg. `src/ethereum/*`)C-featCategory: an improvement or new featureE-easyExperience: easy, good for newcomersP-low

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions