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

Devise a way export state to sync a fresh sidechain to a preexisting rootchain contract #133

Open
colin-axner opened this issue Mar 21, 2019 · 3 comments

Comments

@colin-axner
Copy link
Member

Summary

Offer a way to export state of a sidechain into a genesis file.

Problem

If plasmad unsafe-reset-all is run, it is likely a new contract needs to be deployed. It would be very useful if we could simply provide a genesis file which allows the chain to reprocess all txs that occured relative to the rootchain contract

Proposal

Initial thought: Post all txBytes processed in tm blocks into genesis file. Run all txBytes in genesis file at the beginning of the chain. Disable exit checking when doing this, otherwise it will run into sync issues. Fail if any block header != rootchain block header, otherwise process all txBytes

@hamdiallam
Copy link
Member

Can TM create multiple blocks from genesis?

@hamdiallam
Copy link
Member

I could see this working if we get around to #145

@colin-axner
Copy link
Member Author

colin-axner commented Dec 26, 2019

Can TM create multiple blocks from genesis?

I don't think it can

I could see this working if we get around to #145

I agree, if none of our code relies on the correct TM block number than the first question wouldn't matter. We could process blocks 1 to n in the genesis block and as long as the correct info is added into the stores then queries should return correctly. I suppose this wouldn't work because of TM consensus, ie I'm on block 2 and you are on block n + 1, but I think this could work under given conditions.

If we require this feature only to be used during software upgrades then I don't see an issue. So if all the validators/full nodes export into genesis and resync from the contract they would all be at n+1 plasma block and TM block 2. My initial thought is you could do breaking changes without redeploying rootchain contract. Hard code in if statement if plasmaBlock <= n then old_code else new_code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants