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

Save, reload and replay of in-memory chain for ForkedChain #2888

Open
jangko opened this issue Nov 28, 2024 · 0 comments
Open

Save, reload and replay of in-memory chain for ForkedChain #2888

jangko opened this issue Nov 28, 2024 · 0 comments
Labels

Comments

@jangko
Copy link
Contributor

jangko commented Nov 28, 2024

A segment of chain being processed by ForkedChain is not written to the database if the base is not moved forward. Finalized blocks that still in memory will be lost if the client restarted.

Find a way to serialize this in-memory stuff to database. But care must be taken to allow block import via rlp and era file still works.

The serialized stuff also self purging, only need stuff is in database. expired stuff should gone automatically.

If the base is newer or the block number of base is greater than smallest finalized block number, the loader can decide to replay only relevant finalized blocks or discard the entire serialized things.

What about segment from Finalized Head to Canonical Head? They will not serialized and not saved to database.
Next time the client load the serialized data from database, the Canonical Head is equal to Finalized Head.

What if in memory chain Finalized Head is equals to Base Head, we can remove the serialized stuff from database or still serialized it but no replay will occur by the loader.

@jangko jangko added the EL label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant