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

fix: blockchain-provider-state-retrieva-issue #13817

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Dhanraj30
Copy link
Contributor

issue details: #13794
This modification ensures that the function first checks for the pending state within the canonical_in_memory_state if the previous checks fail.

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

ptal @shekhirin

Comment on lines +560 to +566
} else if let Some(pending_state) = self.canonical_in_memory_state.pending_state() {
// Check if the pending state matches the requested hash
if pending_state.hash() == hash {
Ok(Box::new(self.block_state_provider(&pending_state)?))
} else {
Err(ProviderError::StateForHashNotFound(hash))
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

how is this different than

    fn pending_state_by_hash(&self, block_hash: B256) -> ProviderResult<Option<StateProviderBox>> {
        if let Some(pending) = self.canonical_in_memory_state.pending_state() {
            if pending.hash() == block_hash {
                return Ok(Some(Box::new(self.block_state_provider(&pending)?)));
            }
        }
        Ok(None)
    }

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.

2 participants