massa icon indicating copy to clipboard operation
massa copied to clipboard

Inject testing into `SecureSend` deserialisers when `#[cfg(any(test, feature = "testing))]

Open Ben-PH opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Signature verification is opted into, as the best time to test is context dependant. E.g. a node can receive the same block multiple times due to the nature of how it propogates through the network, and so verifying signatures of every block deserialised is a redundant operation after the first one is verified.

Under testing conditions, the value in not missing out on edge-cases supercedes the performance requirements.

Describe the solution you'd like

under testing conditions, a deserialization call will recursively check for signature validity, and that object invariants are upheld, and pass up error details as appropriate.

Describe alternatives you've considered

none so far

Additional context

This is a branch-out from #3364, which introduces this to the BlockHeader deserialization

Keep in mind, if we lean into this proposed tool to validate, for example, massa-node, then we are using it to catch issues when it's already too late.

Ben-PH avatar Jan 10 '23 13:01 Ben-PH

This might be a good first issue for the same reason I found #3364 a good one: it was an excellent way to consolidate the lessons from damir on blockclicque principals, as well as an introduction to the code-base

It will direct the implementer to understand the manner in which data propagates through the network, how the data is handled, etc.

Ben-PH avatar Jan 10 '23 14:01 Ben-PH