-
Notifications
You must be signed in to change notification settings - Fork 67
fix: use MiningChain #398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: use MiningChain #398
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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" | ||
| # TODO make genesis params+state configurable | ||
| def _make_chain(): | ||
| # TODO should we use MiningChain? is there a perf difference? | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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)) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would definitely recommend using _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) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See suggestion below.