Skip to content

feat: Don't store every block number in block indices DB#10658

Merged
PhilWindle merged 16 commits intomasterfrom
pw/optimise-block-indices
Dec 17, 2024
Merged

feat: Don't store every block number in block indices DB#10658
PhilWindle merged 16 commits intomasterfrom
pw/optimise-block-indices

Conversation

@PhilWindle
Copy link
Collaborator

The block indices DB is what enables clients to query the block number for a given index. Where there were blocks of zero size (so multiple block numbers against an index) it was storing every block number against that index. This could result in an unbounded values size in the DB. We now just store the block range in this scenario.

@PhilWindle PhilWindle changed the base branch from master to pw/batch-index-requests December 12, 2024 14:27
Comment on lines +135 to +136
// Size must be 2 here, if larger, this is an error
if (blockNumbers.size() != 2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT of changing this to explicit interval_start, interval_end member variables?

Base automatically changed from pw/batch-index-requests to master December 13, 2024 07:14
@PhilWindle PhilWindle enabled auto-merge (squash) December 13, 2024 14:36
@PhilWindle PhilWindle merged commit a3fba84 into master Dec 17, 2024
@PhilWindle PhilWindle deleted the pw/optimise-block-indices branch December 17, 2024 19:20
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.

Block indices DB should store ranges of blocks instead of individual block numbers

2 participants