Confirmed that ChainExchange failures should be in the console output or log. Theoretically, there is a chance that a remote peer always returns a successful empty response and leads the downloading code to a dead loop with no errors.
This PR tries to mitigate the issue by adding validation logic to the chain exchange response
Changes introduced in this pull request:
add validation logic to the chain exchange response
minor logging improvement
use NonEmptyU64 instead of u64 for chain_exchangerequest_len
refine stateless peer filtering logic to fallback to all peers when the result is empty
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist
[x] I have performed a self-review of my own code,
[x] I have made corresponding changes to the documentation,
[x] I have added tests that prove my fix is effective or that my feature works (if possible),
[x] I have made sure the CHANGELOG is up-to-date. All user-facing changes should be reflected in this document.
Summary of changes
Part of #4441 investigation
Confirmed that
ChainExchange
failures should be in the console output or log. Theoretically, there is a chance that a remote peer always returns a successful empty response and leads the downloading code to a dead loop with no errors.This PR tries to mitigate the issue by adding validation logic to the chain exchange response
Changes introduced in this pull request:
NonEmptyU64
instead ofu64
forchain_exchange
request_len
Reference issue to close (if applicable)
Closes
Other information and links
Change checklist