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

p2p: Run checks ealier when processing headers #2399

Merged
merged 3 commits into from
Aug 29, 2024

Commits on Aug 29, 2024

  1. p2p: Disconnect from peers that sent too few headers

    The existing full node software (dcrd) always sends batches of 2000
    headers when requesting headers during Initial Block Download.
    
    The check added in this commit ensures the wallet disconnects from any
    peers that deviate from this behavior. While receiving less than 2000
    headers could not cause any consistency or safety issues, it could slow
    down sync time.
    matheusd committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    34395a5 View commit details
    Browse the repository at this point in the history
  2. p2p: Move headers requested check earlier in the call

    This moves the check for requested headers earlier in the call stack for
    processing headers messages.
    
    This ensures misbehaving peers are disconnected earlier, before spending
    cpu processing for block hash calculation.
    matheusd committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    68ed4d3 View commit details
    Browse the repository at this point in the history
  3. p2p: Move check for getheaders locators earlier in the call

    This moves the check that ensures that a reply to a getheaders connects
    to the existing locators ealier in the call stack for processing a
    headers response.
    
    This ensures the wallet disconnects from misbehaving peers before
    processing block hashes.
    matheusd committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    08c05e9 View commit details
    Browse the repository at this point in the history