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 authored and GitHub committed 2021-01-29 16:29:25 +00:00
1 parent 92cde30078
commit d40f9c166f
3 files changed
+87 -11

No files matched your search

@@ -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,