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

Update sync pipelines to continue from era1 import #8403

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

Matilda-Clerke
Copy link
Contributor

PR description

Update FAST sync and derivatives to sync after previously importing blocks from era1 files

Fixed Issue(s)

#7935

Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Copy link
Contributor

@fab-10 fab-10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it correct

Comment on lines 95 to 99
} else if (protocolContext
.getWorldStateArchive()
.getWorldState()
.rootHash()
.equals(Hash.EMPTY_TRIE_HASH)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try to understand the change, should not this condition be negated? I mean if the root hash is not empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, you're right. We should be checking that the root hash is not empty. I guess this indicates that actually it's not currently set to the EMPTY_TRIE_HASH. I'll have to figure out what it's actually returning and check for that.

… starting sync pipelines

Signed-off-by: Matilda Clerke <[email protected]>
Signed-off-by: Matilda Clerke <[email protected]>
Comment on lines +51 to +52
protected static final Hash GENESIS_STATE_ROOT =
Hash.fromHexString("0xd7f8974fb5ac78d9ac099b9ad5018bedc2ce0a72dad1827a1709da30580f0544");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should not this depend on the actual network or genesis used, so the value can change, maybe @matkt has suggestion on how to check if the world state is empty

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I'm not sure anyone really cares about the ability to import era1 files on sepolia, but it could be useful for testing. Afaik, we don't really know which network the era1 files we're importing are for, so I could add --network and --data-path to allow people to better specify what they're doing. The network option would allow us to just check a different genesis state root, but alternative ways of checking whether a sync is already completed might be preferable

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to check if the initial sync is done you can use

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes clearly it's not good like that. So when we are passing this code the state is not empty and has the genesis modification already ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it is the case why not using ?

Hash genesisStateRoot = protocolContext.getBlockchain().getGenesisBlock().getHeader().getStateRoot()

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

Successfully merging this pull request may close these issues.

3 participants