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

Respond to un-synced blocks request with ResourceUnavailable #6977

Merged
merged 2 commits into from
Mar 6, 2025

Conversation

etan-status
Copy link
Contributor

When serving beacon blocks by range requests, there are three outcomes:

  1. We have blocks available: Response is non-empty
  2. The entire epoch actually is empty: Response is empty
  3. We have not backfilled that far or have pruned the history

To distinguish (2) from (3), send ResourceUnavailable if the requested range is for blocks earlier than our backfill progress.

When serving beacon blocks by range requests, there are three outcomes:

1. We have blocks available: Response is non-empty
2. The entire epoch actually is empty: Response is empty
3. We have not backfilled that far or have pruned the history

To distinguish (2) from (3), send `ResourceUnavailable` if the
requested range is for blocks earlier than our backfill progress.
Copy link

github-actions bot commented Mar 3, 2025

Unit Test Results

       15 files  ±  0    2 614 suites  ±0   1h 21m 9s ⏱️ + 5m 48s
  6 412 tests +  1    5 891 ✔️ +  1  521 💤 ±0  0 ±0 
44 616 runs  +10  43 898 ✔️ +10  718 💤 ±0  0 ±0 

Results for commit 848a192. ± Comparison against base commit 3a91604.

♻️ This comment has been updated with latest results.

@@ -233,8 +233,14 @@ p2pProtocol BeaconSync(version = 1,
raise newException(InvalidInputsError, "Empty range requested")

var blocks: array[MAX_REQUEST_BLOCKS.int, BlockId]
let dag = peer.networkState.dag
if startSlot < dag.backfill.slot:
# Peers that are unable to reply to block requests within the
Copy link
Contributor

Choose a reason for hiding this comment

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

@tersec tersec merged commit 902f5a2 into unstable Mar 6, 2025
12 checks passed
@tersec tersec deleted the dev/etan/gf-blocksunavailable branch March 6, 2025 01:26
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