Sync: Fix issue of not freeing a block announcement slot (#8006)

* Sync: Fix issue of not freeing a block announcement slot

There was a bug that when the block announcement validation returned an
error, the slot reserved for this validation wasn't freed. This could
lead to a situation where we rejected any block announcement from such a
peer for that the block announcement returned an error multiple times.

* Better logging

* Fuck I'm dumb

* 🤦
This commit is contained in:
Bastian Köcher
2021-01-29 17:29:25 +01:00
committed by GitHub
parent 92cde30078
commit d40f9c166f
3 changed files with 87 additions and 11 deletions
@@ -59,6 +59,10 @@ pub trait BlockAnnounceValidator<B: Block> {
///
/// Returning [`Validation::Failure`] will lead to a decrease of the
/// peers reputation as it sent us invalid data.
///
/// The returned future should only resolve to an error iff there was an internal error validating
/// the block announcement. If the block announcement itself is invalid, this should *always*
/// return [`Validation::Failure`].
fn validate(
&mut self,
header: &B::Header,