-
Notifications
You must be signed in to change notification settings - Fork 115
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
recording database updates #177
Conversation
It simplifies recording data and takes care of references
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a couple minor comments but I love the approach!
for ctx.Err() == nil { | ||
block := r.bc.GetBlockByNumber(blockToRecreate) | ||
if block == nil { | ||
return nil, fmt.Errorf("block not found while recreating: %d", blockToRecreate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could check here if block.ParentHash()
matches what we'd expect to provide early protection against reorgs, though I suppose checking that the state root matches is also good enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. Worth noting, though, that most reorgs will only be found after we reach the block number we're originally looking for and comparing it with the param header
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This converges support needed for validation without an archive node.