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

feat(storage): use roaring bitmaps for history tables #5463

Merged
merged 28 commits into from
Feb 2, 2024

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Nov 16, 2023

Performance benchmarks

X axis is the random delta in the range of x-x/2..=x+x/2 between 2000 integers

image
image

Size benchmarks

Mainnet Archive Node

Elias-Fano Roaring Bitmaps
AccountHistory 63 GB 37 GB
StorageHistory 389 GB 220 GB

Sepolia Full Node

Elias-Fano Roaring Bitmaps
AccountHistory 82 MB 23 MB
StorageHistory 712 MB 223 MB

@shekhirin shekhirin added C-enhancement New feature or request A-db Related to the database labels Nov 16, 2023
@gakonst gakonst added the S-breaking This PR includes a breaking change label Nov 16, 2023
@shekhirin shekhirin force-pushed the alexey/roaring-bitmaps branch 5 times, most recently from 1ac1618 to 1918293 Compare November 16, 2023 20:27
@shekhirin shekhirin changed the base branch from main to breaking-changes November 17, 2023 19:57
@shekhirin shekhirin marked this pull request as ready for review November 23, 2023 19:15
let rank = chunk.rank(self.block_number as usize);
// Adjust the rank, so that we have the rank of the first entry strictly before our
// block (not equal to it).
if rank.checked_sub(1).and_then(|rank| chunk.select(rank)) == Some(self.block_number) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

til

Copy link
Collaborator

@joshieDo joshieDo left a comment

Choose a reason for hiding this comment

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

faster, smaller lfg. i'd just remove any mention of elias wrt to this from the codebase, maybe some reference to this PR should be enough on IntegerList

@shekhirin
Copy link
Collaborator Author

i'd just remove any mention of elias wrt to this from the codebase

yeah, already done, only snapshots and benches left

image

@github-actions github-actions bot added the S-stale This issue/PR is stale and will close with no further activity label Dec 16, 2023
@github-actions github-actions bot closed this Dec 24, 2023
@shekhirin shekhirin added M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity and removed S-stale This issue/PR is stale and will close with no further activity labels Dec 26, 2023
@shekhirin shekhirin reopened this Dec 26, 2023
@gakonst
Copy link
Member

gakonst commented Jan 9, 2024

Just confirming that we want this and we'll release alongside the next alpha which breaks the DB.

@shekhirin
Copy link
Collaborator Author

@gakonst correct. This PR can already be reviewed, because it'll get merged into breaking-changes branch.

Copy link
Member

@onbjerg onbjerg left a comment

Choose a reason for hiding this comment

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

lgtm

@shekhirin shekhirin merged commit da9d9d8 into breaking-changes Feb 2, 2024
23 checks passed
@shekhirin shekhirin deleted the alexey/roaring-bitmaps branch February 2, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-db Related to the database C-enhancement New feature or request M-prevent-stale Prevents old inactive issues/PRs from being closed due to inactivity S-breaking This PR includes a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants