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

feat: issue download requests #9704

Merged
merged 1 commit into from
Jul 22, 2024
Merged

feat: issue download requests #9704

merged 1 commit into from
Jul 22, 2024

Conversation

mattsse
Copy link
Collaborator

@mattsse mattsse commented Jul 22, 2024

closes #9672

adds missing logic for issuing download requests

@mattsse mattsse added the C-enhancement New feature or request label Jul 22, 2024
Comment on lines +842 to +850
let request = if let Some(distance) =
self.distance_from_local_tip(head.number, missing_parent.number)
{
DownloadRequest::BlockRange(missing_parent.hash, distance)
} else {
// This happens when the missing parent is on an outdated
// sidechain and we can only download the missing block itself
DownloadRequest::BlockSet(HashSet::from_iter([missing_parent.hash]))
};
Copy link
Member

Choose a reason for hiding this comment

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

Makes sense, I like documenting these outcomes explicitly, since the Option alone doesn't make the meaning super clear.

@mattsse mattsse added this pull request to the merge queue Jul 22, 2024
Merged via the queue into main with commit 35edcd4 Jul 22, 2024
33 checks passed
@mattsse mattsse deleted the matt/fetch-blocks branch July 22, 2024 13:35
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue requests for missing blocks on forkchoice update
2 participants