Closed pyrex41 closed 5 months ago
Looks like boa.env.vm.build_state(atomic_db, headers, chain_context, prev_hashes)
should do what i was trying to do here, but it still doesn't have they bytecode deployed at the same address across different environments.
one thing i need to be convinced of before implementing this is - that there is a use case where there is actually a significant performance difference for loading state from a file rather than just recreating it on the fly.
I also think that it's easier to run the code again instead of exporting evm data. Can we close this?
Due to the lack of responses I'm closing this issue
Want to be able to export state of boa.env in a file that can be loaded by a different instantiation of boa.env. Currently working on this as follows:
under class VMPatcher: ~87
Under class ENV: ~399
It all seems to work but the new env doesn't have the same compiled bytecode when load_partial(contract_source_code.vy).at(contract_address_in_first_env) is invoked:
warnings.warn(f"casted bytecode does not match compiled bytecode at {self}")
.Obv. the second env isn't loading the bytecode from the first. I'm not familiar enough with py-evm to understand why or where the issue is -- welcome to suggestions.
ENV 1 Saves state
ENV 2 Loads state, but fails