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

Recreate trie after revert. #4608

Merged
merged 1 commit into from
Jan 18, 2024
Merged

Recreate trie after revert. #4608

merged 1 commit into from
Jan 18, 2024

Conversation

Frozen
Copy link
Contributor

@Frozen Frozen commented Jan 14, 2024

I discovered that the node state contains blocks, but not their states. I extended the revert method and added additional repairRecreateStateTries to recalculate their states.

@@ -781,13 +781,37 @@ func (bc *BlockChainImpl) resetWithGenesisBlock(genesis *types.Block) error {
return nil
}

func (bc *BlockChainImpl) repairRecreateStateTries(head **types.Block) error {
Copy link
Contributor Author

@Frozen Frozen Jan 14, 2024

Choose a reason for hiding this comment

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

This should be ok, because blocks we previously checked, so we need only to recreate state.

@sophoah
Copy link
Contributor

sophoah commented Jan 15, 2024

let's test it we can kill the harmony process sudo kill -9 harmony and restart

Copy link
Contributor

@diego1q2w diego1q2w left a comment

Choose a reason for hiding this comment

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

makes sense I think we can test this on devnet with the reset

@diego1q2w diego1q2w merged commit 17a2522 into dev Jan 18, 2024
4 checks passed
@diego1q2w diego1q2w deleted the fix/repair-recreate-state branch January 18, 2024 02:08
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