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

Use BtreeMap for block numbers #10038

Closed
Tracked by #8742
mattsse opened this issue Aug 2, 2024 · 0 comments · Fixed by #10040
Closed
Tracked by #8742

Use BtreeMap for block numbers #10038

mattsse opened this issue Aug 2, 2024 · 0 comments · Fixed by #10040
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started

Comments

@mattsse
Copy link
Collaborator

mattsse commented Aug 2, 2024

for use cases like

#10037

it is beneficial to have the block numbers in canonical order

currently we're using a regular hashmap:

/// Mapping of block numbers to block hashes.
numbers: RwLock<HashMap<u64, B256>>,

we can easily find the lowest and highest block with a btreemap

TODO

  • replace hashmap with betreemap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started
Projects
Archived in project
1 participant