celestiaorg / go-header

Go library with all the services needed to request, sync and store blockchain headers.
Apache License 2.0
17 stars 16 forks source link

fix(p2p/exchange): Remove peer blocking from head request #113

Closed renaynay closed 9 months ago

renaynay commented 9 months ago

Currently, the exchange will block peers for giving a bad header that does not pass the Verify check (unless it is a SoftFailure). Unless we introduce another field inside of VerifyError to indicate to the caller whether the error was severe enough to warrant blocking, we shouldn't blanket block for verify errors as a good peer that sends a slightly outdated header will get banned.

(this is currently observable on arabica - have not tested on mocha yet)

Moral of the story: do not prematurely implement blocking behaviour.

codecov-commenter commented 9 months ago

Codecov Report

Merging #113 (a2895a7) into main (e75d00d) will decrease coverage by 0.05%. The diff coverage is n/a.

@@            Coverage Diff             @@
##             main     #113      +/-   ##
==========================================
- Coverage   69.20%   69.16%   -0.05%     
==========================================
  Files          37       37              
  Lines        2939     2938       -1     
==========================================
- Hits         2034     2032       -2     
  Misses        756      756              
- Partials      149      150       +1     
Files Coverage Δ
p2p/exchange.go 85.89% <ø> (-0.07%) :arrow_down:

... and 2 files with indirect coverage changes