-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix(storage): fallback lookups for pruned history #4121
Conversation
Codecov Report
... and 14 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
9121bed
to
65296d0
Compare
c9ef7bb
to
4f20ae4
Compare
78b7427
to
47f00e5
Compare
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.
nice find!
…nto alexey/historical-state-maybe-plainstate
…te-maybe-plainstate
Changes
Missed cursor jump to delete the original shard
We did a jump to the previous shard
reth/crates/prune/src/pruner.rs
Lines 529 to 530 in aa9036e
reth/crates/prune/src/pruner.rs
Lines 544 to 547 in aa9036e
HistoryInfo
lookups with pruned historyHistory shard exists
Two problems:
reth/crates/storage/provider/src/providers/state/historical.rs
Line 151 in aa9036e
rank == 0
can mean not only that the target block is less then the first block in the shard, but also that the first block in shard is equal to the target block, in which case we need to look it up in the changeset.reth/crates/storage/provider/src/providers/state/historical.rs
Lines 154 to 161 in aa9036e
History shard does not exist
If the target block is not found in any shard and the history is pruned, it doesn't always mean that it's the first write ever. So we need to fallback to the plain state lookup because the key may have been actually written:
reth/crates/storage/provider/src/providers/state/historical.rs
Lines 170 to 174 in aa9036e