Open
Description
Range sync want to sync a chain of blocks from a peer which declares to known a block unknown to us. There should exist some intersection block which is the first unknown block given our current fork-choice. An optimal sync algorithm would sync only starting from the intersection block. BUT we don't know it..
Optimistic batch is an optimization that assumes that the intersection block is in the last epoch. It tries to sync the last epoch only, and if it fails it starts from current finalized. So failures are expected.
However we actually downscore peers for those failures
Jan 29 03:12:05.546 DEBG Sync reporting peer msg: faulty_batch, action: Low Tolerance Error, peer_id: 16Uiu2HAm6mGaKhbAuEvpeQiqkw86rDpcVQrCLPVbyYsHUHyXgHtw, service: sync
Jan 29 03:12:05.546 DEBG Rejected optimistic batch reason: batch was invalid, epoch: 128, chain: 5365095180884896044, service: range_sync, service: sync
Jan 29 03:12:05.546 DEBG Peer score adjusted score: -10.00, peer_id: 16Uiu2HAm6mGaKhbAuEvpeQiqkw86rDpcVQrCLPVbyYsHUHyXgHtw, msg: faulty_batch, service: libp2p
The effects are not noticeable since it's a rare event that only happens once in a while. But we should fix it.