Closed fjarri closed 1 month ago
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 | |
---|---|
Change from base Build 11514244461: | -0.8% |
Covered Lines: | 1242 |
Relevant Lines: | 1761 |
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:
Round::make_echo_broadcast()
,Round::make_direct_message()
,Round::receive_message()
removingOption
s there.Round::make_direct_message_with_artifact()
;Round::make_direct_message()
would be the one most used because most rounds in Synedrion don't actually create an artifact.Artifact::empty()
removed, since now we can just returnNone
.Outstanding questions:
None
leads to the same outcome as a deserialization error on aSome
payload, soDirectMessage::deserialize()
just returns aDirectMessageError
in this case as well, same for the echo broadcast.make_direct_message_with_artifact()
tomake_direct_message()
is a little tricky inRoundOverride
; if the round defines the former, but we override the latter, the override won't be effective. Not sure how to handle that; I really want to keep the artifact-creating method separate since it's not used all that much.None
for an emptyPayload
?