erigontech / erigon

Ethereum implementation on the efficiency frontier https://erigon.gitbook.io
GNU Lesser General Public License v3.0
3.11k stars 1.09k forks source link

polygon/p2p: fix p2p fetcher peer errors on chain tip #11927

Closed taratorio closed 1 week ago

taratorio commented 1 week ago

More issues surfaced on chain tip when testing astrid:

  1. context deadline exceeded when requesting new block event at tip from peer - can happen, safe to ignore event and continue instead of crashing:
    [EROR] [09-06|03:41:00.183] [2/6 PolygonSync] stopping node          err="await *eth.BlockHeadersPacket66 response interrupted: context deadline exceeded"
  2. Noticed we do not penalise peers for penalize-able errors when calling FetchBlocks - added that in
  3. We got another error that crashed the process - ErrNonSequentialHeaderNumbers - it is safe to ignore new block event if this happens and continue
    EROR[09-05|20:26:35.141] [2/6 PolygonSync] stopping node          err="non sequential header numbers in fetch headers response: current=11608859, expected=11608860"
  4. Added all other p2p errors that may happen and are safe to ignore at tip event processing
  5. Added debug logging for better visibility into chain tip events
  6. Fixed missing check for whether we have already processed a new block event (ie if its hash is already contained in the canonical chain builder)