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

Improve in memory range lookups #10037

Closed
Tracked by #8742
mattsse opened this issue Aug 2, 2024 · 1 comment · Fixed by #11332
Closed
Tracked by #8742

Improve in memory range lookups #10037

mattsse opened this issue Aug 2, 2024 · 1 comment · Fixed by #11332
Assignees
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

currently, these lookups are susceptible to race conditions:

for num in start..=end {
if let Some(block_state) = self.canonical_in_memory_state.state_by_number(num) {
// TODO: there might be an update between loop iterations, we
// need to handle that situation.
headers.push(block_state.block().block().header.header().clone());

TODO

this should be integrated natively into the

pub struct CanonicalInMemoryState {
type so that a range lookup returns either no result, partial results, or full, this can be encapsulated with a helper enum that expresses this, for example the range ends below the lowest block in memory

ref #9999

@mattsse mattsse added C-enhancement New feature or request D-good-first-issue Nice and easy! A great choice to get started labels Aug 2, 2024
@PelleKrab
Copy link
Contributor

I can take it.

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
2 participants