-
Notifications
You must be signed in to change notification settings - Fork 109
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
Recording fixes #169
Conversation
core/state/state_object.go
Outdated
@@ -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 }) |
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 think we can directly compare common.Hash
s as they're a [32]byte
right? It's worth a try to simplify this I think.
core/state/statedb.go
Outdated
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 }) |
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.
Same thing here, I think we can directly compare addresses
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
Not enough to fix recordings. Specifically, for arbone block 27,199,859
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
recording fixes.
If replay uses state.NewDeterministic, PrepareRecording can be called with validateDeleted = false. Otherwise true is required (will collect more preimages)