Skip to content
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

Snapshot state to a genesis file #130

Open
carver opened this issue Sep 20, 2018 · 3 comments
Open

Snapshot state to a genesis file #130

carver opened this issue Sep 20, 2018 · 3 comments

Comments

@carver
Copy link
Contributor

carver commented Sep 20, 2018

What was wrong?

Inspired by #88 (comment)

People want to pick up chain state from somewhere they left off in a test chain. It would be cool to use this to set up integration tests for non-eth-tester nodes too!

How can it be fixed?

It would be sweet to have an easy way to snapshot state into a genesis file (which can then be reimported using #129).

I think a good API is: genesis_dict = tester.genesis_snapshot(). First step is consensus on that.

@pipermerriam
Copy link
Member

I suspect we should also be able to use an extended version of EIP1085 for this, with something like an additional blocks key.

@evertonfraga
Copy link
Member

With the risk of being too late in the game, I ask: how should contract accounts' state be represented in a "non zero-block" snapshot?

@carver
Copy link
Contributor Author

carver commented Nov 5, 2019

I've been defaulting to this (unmerged) proposal for genesis file format: ethereum/EIPs#1085

So you would list the storage slots. in each contract account.

Probably the most work for implementing this is that we do not currently track preimages (of slots or account addresses). So we can't just iterate the database to create the state, we have to add a preimage tracker, I think. Maybe this belongs as a custom AccountDB and StorageDB, but I'm not sure without diving in to design it.

pacrob pushed a commit to pacrob/eth-tester that referenced this issue Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants