Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions boa/vm/py_evm.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import eth.vm.forks.spurious_dragon.computation as spurious_dragon
from eth._utils.address import generate_contract_address
from eth.abc import ComputationAPI
from eth.chains.mainnet import MainnetChain
from eth.chains.base import MiningChain
from eth.db.account import AccountDB
from eth.db.atomic import AtomicDB
from eth.exceptions import Halt
Expand Down Expand Up @@ -565,13 +565,13 @@ def get_storage_slot(self, address: Address, slot: int) -> bytes:
return data.to_bytes(32, "big")


GENESIS_PARAMS = {"difficulty": constants.GENESIS_DIFFICULTY, "gas_limit": int(1e8)}
GENESIS_PARAMS = {"gas_limit": int(1e8)}


# TODO make fork configurable - ex. "latest", "frontier", "berlin"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See suggestion below.

# TODO make genesis params+state configurable
def _make_chain():
# TODO should we use MiningChain? is there a perf difference?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These can probably go now.

# TODO debug why `fork_at()` cannot accept 0 as block num
_Chain = chain.build(MainnetChain, chain.latest_mainnet_at(1))
_Chain = chain.build(MiningChain, chain.latest_mainnet_at(0))
Copy link

@fselmo fselmo Apr 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would definitely recommend using MiningChain over MainnetChain for stability and your own control. Alternatively, you can configure the chain directly:

_Chain = MiningChain.configure(chain_id=1, vm_configuration=[(0, PragueVM)])

Seeing as one of the comments above has a goal to make this configurable, you could eventually configure it as, for example, Cancun to Prague at 5:

vm_configuration=[(0, CancunVM), (5, PragueVM)])

return _Chain.from_genesis(AtomicDB(), GENESIS_PARAMS)
Loading