When we call pipe::process_block() we were wrapping the wide variety of error in one of either Unfit or Other.
This makes no sense as we lose fidelity.
Additionally we have no reliable way of knowing if the error was bad_data and we cannot correctly ban peers for sending us "bad" blocks.
This PR simplifies the error handling in process_block_single() to allow any errors received to simply propagate up without wrapping them.
Other will propagate unchanged as Other.
Unfit will propagate unchanged as Unfit.
crucially bad errors like InvalidBlockProof will propagate unchanged and will be identified as is_bad_data
this will result in peer being banned as expected
A hotfix had been deployed as part of 5.0.4 to fix this for the specific InvalidBlockProof case.
Related #3605 Resolves #3627
When we call
pipe::process_block()
we were wrapping the wide variety of error in one of eitherUnfit
orOther
. This makes no sense as we lose fidelity. Additionally we have no reliable way of knowing if the error wasbad_data
and we cannot correctly ban peers for sending us "bad" blocks.This PR simplifies the error handling in
process_block_single()
to allow any errors received to simply propagate up without wrapping them.Other
will propagate unchanged asOther
.Unfit
will propagate unchanged asUnfit
.InvalidBlockProof
will propagate unchanged and will be identified asis_bad_data
A hotfix had been deployed as part of
5.0.4
to fix this for the specificInvalidBlockProof
case.https://github.com/mimblewimble/grin/pull/3600/files#diff-821b94c6d358718330722e717ee1226b384b1b657262c0e42e357f621d60433aR528-R536
This PR reworks the error handling in a more generic way.