entropyxyz / manul

Round-based distributed protocols
https://docs.rs/manul
GNU Affero General Public License v3.0
6 stars 1 forks source link

Handle cases where a node sent or not sent a part of the message unexpectedly #46

Closed fjarri closed 1 month ago

fjarri commented 1 month ago

Fixes #23

The gist of the changes is that now even if a node does not send, say, a direct message, it still signs a None value with the corresponding metadata and sends it off in a bundle with the rest of the parts. This way the receiver can assert that the direct part or the echo part should be none, and register a provable error if they aren't.

Of course the node could just not send the corresponding part at all (equivalent to sending any other malformed or mal-signed message), but as #39 suggests, we're mostly protecting against nodes with obsolete software, not actively malicious ones.

Changes:

Outstanding questions:

coveralls commented 1 month ago

Pull Request Test Coverage Report for Build 11524276230

Details


Changes Missing Coverage Covered Lines Changed/Added Lines %
manul/src/testing/macros.rs 15 17 88.24%
manul/src/session/session.rs 19 22 86.36%
manul/src/protocol/errors.rs 1 8 12.5%
manul/src/protocol/round.rs 6 13 46.15%
manul/src/session/evidence.rs 6 14 42.86%
manul/src/protocol/message.rs 40 74 54.05%
<!-- Total: 118 179 65.92% -->
Files with Coverage Reduction New Missed Lines %
manul/src/session/message.rs 1 98.68%
manul/src/protocol/round.rs 3 60.34%
manul/src/session/session.rs 4 72.59%
manul/src/testing/macros.rs 6 87.18%
<!-- Total: 14 -->
Totals Coverage Status
Change from base Build 11514244461: -0.8%
Covered Lines: 1242
Relevant Lines: 1761

💛 - Coveralls