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

recording database updates #177

Merged
merged 15 commits into from
Nov 8, 2022
Merged

recording database updates #177

merged 15 commits into from
Nov 8, 2022

Conversation

tsahee
Copy link
Contributor

@tsahee tsahee commented Nov 2, 2022

This converges support needed for validation without an archive node.

Copy link
Collaborator

@PlasmaPower PlasmaPower left a 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!

core/state/database.go Show resolved Hide resolved
arbitrum/recordingdb.go Outdated Show resolved Hide resolved
for ctx.Err() == nil {
block := r.bc.GetBlockByNumber(blockToRecreate)
if block == nil {
return nil, fmt.Errorf("block not found while recreating: %d", blockToRecreate)
Copy link
Collaborator

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

Copy link
Contributor Author

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

Copy link
Collaborator

@PlasmaPower PlasmaPower left a comment

Choose a reason for hiding this comment

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

LGTM

@PlasmaPower PlasmaPower merged commit 1b4f948 into master Nov 8, 2022
@PlasmaPower PlasmaPower deleted the recreate-state branch November 8, 2022 15:50
@Tristan-Wilson Tristan-Wilson mentioned this pull request Feb 28, 2023
13 tasks
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.

2 participants