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

add execution block hash index to block cache #144

Merged
merged 2 commits into from
Oct 15, 2024
Merged

Conversation

pk910
Copy link
Member

@pk910 pk910 commented Oct 10, 2024

This PR adds a execution block hash to block reference map to the block cache.
This map significantly lowers the processing time for the getBlocksByExecutionBlockHash function, which is more heavily used with #141.

The negative effect of this change is the memory overhead.
The map holds all execution hashes & references to blocks for all unfinalized blocks,
which roughly sums up to about 2.5M memory for a week of unfinality (50k blocks).

I think the overhead is acceptable compared to iterating the full unfinalized block range for each call to getBlocksByExecutionBlockHash.

@Maliksb11
Copy link

Ok

@pk910 pk910 requested a review from skylenet October 14, 2024 21:44
@pk910 pk910 merged commit 8c978a0 into master Oct 15, 2024
3 checks passed
@pk910 pk910 deleted the pk910/exec-hash-index branch October 15, 2024 20:48
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.

3 participants