Range sync: step past a span with no blocks instead of failing the peer that serves it

Đang mở
#812 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 6 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust

Hướng nghiên cứu

Start with RangeSyncState::complete_batch in crates/net/p2p/src/lib.rs and the Lean and Beacon BlocksByRange handlers named in the issue. Read the stall-window note in docs/spec_deviations.md and the linked discussion in lambdaclass/ethlambda#791 to understand the prior attempt. A fix should advance across empty spans, verify skips using the next batch's parent link, and retry or count a failure when that check does not match.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem. Range sync cannot pass a stretch of slots with no block on the chain, such as a long run of missed proposals during a non-finality incident.

  • A BlocksByRange answer with no block in the requested range counts as a failed request. Lean: crates/net/p2p/src/req_resp/handlers.rs:943-953. Beacon: handlers.rs:2905-2913.
  • The range session's cursor only moves when a batch delivers blocks (RangeSyncState::complete_batch, crates/net/p2p/src/lib.rs:865-867). Across a span a whole batch long with no block on the chain, range sync therefore never advances.
  • The honest peers asked for that span cool down. After three such answers in a row they become suspects (SUSPECT_AFTER_FAILURES, crates/net/p2p/src/peer_heads.rs), and their claims stop counting towards the network head.
  • The node can then read as synced while it is still behind, and only the parent lookups of newer gossip blocks fill the gap.

The trade-off is stated in docs/spec_deviations.md (the stall-window bullet of the sync-gate section). It was discussed in rounds seven, eight, eleven and thirteen of lambdaclass/ethlambda#791.

Why it is out of that PR's scope.

  • main already stops at such a span. Its lean handler fails an empty answer and returns before complete_batch (crates/net/p2p/src/req_resp/handlers.rs:817-821 on main), so its cursor does not move either.
  • Excusing empty answers in place was tried and reverted in lambdaclass/ethlambda#791. A peer claiming a high head was then excused on every batch below it, and took a batch on every Status it sent.
  • The fix is a change to range sync itself, not to the sync gate.

What a fix could look like.

  • Advance the cursor: when a peer whose Status head is past the span answers it empty, move the cursor past it.
  • Remember the skip: keep the skipped span and who answered it.
  • Check it with the next batch: use the parent link HeadWatch::note_delivery already uses. If the next batch's first block names, as its parent, the last block delivered below the span, the span was empty and the peer is credited.
  • Otherwise: re-ask the span from another peer, and count a failure against the peer that answered it empty.
Ngôn ngữ chính
Rust
Star
86
Fork
34
Merge trung bình
9 ngày 20 giờ
Pull request đã merge (30 ngày)
77

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của lambdaclass/ethlambda

Tất cả issue của lambdaclass/ethlambda

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.