mimblewimble / grin

Minimal implementation of the Mimblewimble protocol.
https://grin.mw/
Apache License 2.0
5.04k stars 990 forks source link

cleanup and stop wrapping errors in other/unfit #3616

Closed antiochp closed 3 years ago

antiochp commented 3 years ago

Related #3605 Resolves #3627

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.


A hotfix had been deployed as part of 5.0.4 to fix this for the specific InvalidBlockProof case.

https://github.com/mimblewimble/grin/pull/3600/files#diff-821b94c6d358718330722e717ee1226b384b1b657262c0e42e357f621d60433aR528-R536

This PR reworks the error handling in a more generic way.