Conversation
as of py-evm 0.12.x, MainnetChain behaves differently (doesn't have all the header fields filled in). use MiningChain as going forward it will apparently be more future-proof
|
I am getting a fix in for that I can't speak to the integration test failures here but this is the recommended way to instantiate the chain. I suggested another approach that can likely make things more modular for future iterations and allow you to control what VM you are at rather than relying on the changing |
| # 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? |
| # TODO should we use MiningChain? is there a perf difference? | ||
| # 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.
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)])| GENESIS_PARAMS = {"gas_limit": int(1e8)} | ||
|
|
||
|
|
||
| # TODO make fork configurable - ex. "latest", "frontier", "berlin" |
i suspect the test failures have to do with changing the start block from |
as of py-evm 0.12.x, MainnetChain behaves differently (doesn't have all the header fields filled in). use MiningChain as going forward it will apparently be more future-proof
What I did
fix for #397
How I did it
How to verify it
Description for the changelog
Cute Animal Picture