Skip to content

Latest release py-evm==0.12.0b2 seems to break on _init_vm for excess blob gas #397

@s3bc40

Description

@s3bc40

Hey!

We had two discussions issues on moccasin course concerning the following error:

Traceback (most recent call last):

[... mox error]

  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/boa/__init__.py", line 35, in <module>
    env = Env.get_singleton()
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/boa/environment.py", line 193, in get_singleton
    cls._singleton = cls()
                     ~~~^^
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/boa/environment.py", line 48, in __init__
    self.evm = PyEVM(self, fast_mode_enabled, fork_try_prefetch_state)
               ~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/boa/vm/py_evm.py", line 391, in __init__
    self._init_vm()
    ~~~~~~~~~~~~~^^
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/boa/vm/py_evm.py", line 394, in _init_vm
    self.vm = self.chain.get_vm()
              ~~~~~~~~~~~~~~~~~^^
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/eth/chains/base.py", line 263, in get_vm
    header = self.ensure_header(at_header)
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/eth/chains/base.py", line 306, in ensure_header
    return self.create_header_from_parent(head)
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/eth/chains/base.py", line 280, in create_header_from_parent
    return self.get_vm_class_for_block_number(
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        block_number=BlockNumber(parent_header.block_number + 1),
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ).create_header_from_parent(parent_header, **header_params)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "cytoolz/functoolz.pyx", line 268, in cytoolz.functoolz.curry.__call__
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/eth/vm/forks/prague/headers.py", line 59, in create_prague_header_from_parent
    all_fields["excess_blob_gas"] = calc_excess_blob_gas_prague(parent_header)
                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/eth/vm/forks/prague/headers.py", line 31, in calc_excess_blob_gas_prague
    parent_header.excess_blob_gas + parent_header.blob_gas_used
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/s3bc40/.local/share/uv/tools/moccasin/lib/python3.13/site-packages/eth/rlp/headers.py", line 202, in excess_blob_gas
    raise AttributeError("Excess blob gas not available until Cancun fork")
AttributeError: Excess blob gas not available until Cancun fork

It seems the recent release of py-evm==0.12.0b2 (Released: Apr 23, 2025) is breaking the moccasin process.

In boa (line 394, /boa/vm/py_evm.py):

_init_vm
    self.vm = self.chain.get_vm()

In py-evm (line 31, eth/vm/forks/prague/headers.py):

calc_excess_blob_gas_prague
    parent_header.excess_blob_gas + parent_header.blob_gas_used

Forcing the py-evm version fixes the issue:

➜ uv tool install --with py-evm==0.10.0b4 moccasin
Resolved 109 packages in 267ms
Prepared 1 package in 313ms
Uninstalled 1 package in 11ms
Installed 1 package in 6ms
 - py-evm==0.12.0b2
 + py-evm==0.10.0b4

Any idea what could be the best solution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions