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 fixes #169

Merged
merged 4 commits into from
Oct 5, 2022
Merged

Recording fixes #169

merged 4 commits into from
Oct 5, 2022

Conversation

tsahee
Copy link
Contributor

@tsahee tsahee commented Oct 3, 2022

recording fixes.
If replay uses state.NewDeterministic, PrepareRecording can be called with validateDeleted = false. Otherwise true is required (will collect more preimages)

@@ -351,6 +361,13 @@ func (s *stateObject) updateTrie(db Database) Trie {
}
usedStorage = append(usedStorage, common.CopyBytes(key[:])) // Copy needed for closure
}
if len(keysToDelete) > 0 {
sort.Slice(keysToDelete, func(i, j int) bool { return keysToDelete[i].big.Cmp(keysToDelete[j].big) < 0 })
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can directly compare common.Hashs as they're a [32]byte right? It's worth a try to simplify this I think.

for addr := range s.stateObjectsPending {
addressesToUpdate = append(addressesToUpdate, addressAndBig{addr, addr.Hash().Big()})
}
sort.Slice(addressesToUpdate, func(i, j int) bool { return addressesToUpdate[i].big.Cmp(addressesToUpdate[j].big) < 0 })
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same thing here, I think we can directly compare addresses

PlasmaPower
PlasmaPower previously approved these changes Oct 3, 2022
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

Not enough to fix recordings.
Specifically, for arbone block 27,199,859
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 9da94bd into master Oct 5, 2022
@PlasmaPower PlasmaPower deleted the recording-fixes branch October 5, 2022 03:58
@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