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

Make P1 requests concurrent #2311

Closed
shawn-zil opened this issue Feb 7, 2025 · 0 comments
Closed

Make P1 requests concurrent #2311

shawn-zil opened this issue Feb 7, 2025 · 0 comments
Assignees

Comments

@shawn-zil
Copy link
Contributor

shawn-zil commented Feb 7, 2025

Treat it as just larger segments. Scheme:

  1. When request_missing_metadata() is called, fire off batch request for different segments.
  2. Insert peer into request queue back.
  3. If V2 peer, keep firing batch until N peers used.
  4. If V1 peer, STOP - we don't speed-up V1.

When responses are received. Scheme:

  1. Insert response into a response cache.
  2. Process in-order, based on request queue.
  3. If response is Error/Empty, fire one request, insert into front of queue.
  4. If response is valid, process the segment.
  5. Repeat processing front-of-queue until done or waiting on response.
  6. If queue is empty i.e. done, fire next batch request.
  7. If history is hit, drop all pending requests.

When empty/error, mark that in the response cache.

Important to ensure that each peer is used only one-at-a-time.

@shawn-zil shawn-zil self-assigned this Feb 7, 2025
shawn-zil added a commit that referenced this issue Feb 10, 2025
shawn-zil added a commit that referenced this issue Feb 11, 2025
github-merge-queue bot pushed a commit that referenced this issue Feb 19, 2025
* Resolves #2310 - migrate to VecDeque.

* Resolve #2313 - ensure a unique peer in the SyncPeers set.

* initial sub-segmentation #2312

* initial concurrent phase-1 #2311

* feat: working primitive concurrent requests. #2311

* Resolved #2311. Speed-up 10x.

* Resolve #2314. No longer returning ExternalMessage::Acknowledgement.

* nit: merge checkpoint_at with started_at function.

* feat: #2313 - bias peer selection to be optimistic, previously pessimistic and eventually degenerates to 1 peer.

* feat: size-based dynamic sub-segments (#2312)

* feat: (#2312) drop peers due to network errors.

* feat: (#2298) removing V1 compatibility.

* Resolve #2312 - compute dynamic sub-segments.

* nit: clippy.

* nit: improve logging.

* fix: DoS mitigation logic, log messages.

* fix: simplify block_to_proposal().

* feat: (#2312) use gas guesstimate, when sync_size_estimate is missing.

* fix: change offset computation in do_missing_metadata() in preparation for dynamic sizing.

* fix: (#2313) - improve peer selection for when peer_count < MAX_CONCURRENT_PEERS.

* nit: use new SyncBlockHeader for syncing instead of raw BlockHeader.
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

No branches or pull requests

1 participant