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

Validate Range Availibility #13587

Merged
merged 9 commits into from
Feb 10, 2024
Merged

Validate Range Availibility #13587

merged 9 commits into from
Feb 10, 2024

Conversation

nisdas
Copy link
Member

@nisdas nisdas commented Feb 6, 2024

What type of PR is this?

Bug Fix

What does this PR do? Why is it needed?

Nodes which are undergoing backfill or have checkpoint synced need to be aware of their current backfill status before returning responses to other peers. Rather than returning an empty batch, an error indicating that the resource is unavailable is correct according to the p2p specification.

Which issues(s) does this PR fix?

N.A

Other notes for review

@nisdas nisdas added Ready For Review A pull request ready for code review Networking P2P related items labels Feb 6, 2024
@nisdas nisdas requested a review from a team as a code owner February 6, 2024 08:09
return false, err
}
cpr, err := s.cfg.beaconDB.OriginCheckpointBlockRoot(ctx)
if errors.Is(err, db.ErrNotFoundOriginBlockRoot) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please use backfill service AvailableBlocker interface instead? You can initialize it exactly like stategen: https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/node/node.go#L550

@nisdas nisdas added this pull request to the merge queue Feb 9, 2024
Merged via the queue into develop with commit 5df8b83 Feb 10, 2024
17 checks passed
@nisdas nisdas deleted the validateRangeAvail branch February 10, 2024 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Networking P2P related items Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants