Closed fjarri closed 1 week ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
manul/src/session/session.rs | 24 | 26 | 92.31% | ||
manul/src/session/evidence.rs | 8 | 16 | 50.0% | ||
manul/src/protocol/object_safe.rs | 38 | 48 | 79.17% | ||
manul/src/combinators/misbehave.rs | 143 | 156 | 91.67% | ||
manul/src/protocol/errors.rs | 0 | 22 | 0.0% | ||
manul/src/protocol/round.rs | 17 | 53 | 32.08% | ||
manul/src/combinators/chain.rs | 159 | 280 | 56.79% | ||
<!-- | Total: | 403 | 615 | 65.53% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
manul/src/protocol/object_safe.rs | 7 | 78.1% | ||
<!-- | Total: | 7 | --> |
Totals | |
---|---|
Change from base Build 11602146783: | -2.5% |
Covered Lines: | 1731 |
Relevant Lines: | 2509 |
- Naming is kind of awkward. Suggestions?
I'm struggling with this. I don't love EntryPoint
but it's pretty clear what it is/does. Let's go with that and if either of us have a brilliant idea we'll revisit.
- Random idea: should
EntryPoint::new
take&self
? This way we can basically formalize the concept of protocol constructors used insynedrion
.
I like this!
- Should
misbehave
go intotesting
? Or gated behind thetesting
feature?
I like misbehave
to be difficult to misuse. Today we want to use it in tests, so let's put it there until we need it. I can totally envision a scenario where the core team wants to build a malicious node to test on (private?) testnets so maybe it'd be useful to have misbehave
under a feature, but let's do that when the need arises.
The system with
From
bounds in the chain combinator is a little awkward, since we have to clone stuff for the first protocol. Some kind of a "splitting" trait might be more idiomatic, to split the full inputs into the inputs for Protocol 1 and the inputs for Protocol 2.Also it requires us to impl
From
for the type from the original protocol, which may be foreign in practice.
Hmm. I like the idea of a "splitting" trait, but I don't have a strong opinion on this.
Random idea: should EntryPoint::new take &self? This way we can basically formalize the concept of protocol constructors used in synedrion. Hmm. I like the idea of a "splitting" trait, but I don't have a strong opinion on this.
This is actually coming in #68
I remember seeing your comment about tinyvec
vs smallvec
, and, having looked at them, I agree that tinyvec
is preferable.
We have several different situations where we need to build on top of an existing protocol or combine several of them:
Round::Protocol
the same. This is useful for writing tests.misbehave
. Override macro and its machinery is removed fromtesting
.chain
.Also:
FirstRound
trait toEntryPoint
. It is not bound onRound
anymore.Protocol
type andENTRY_ROUND
constant toEntryPoint
.EntryPoint
andFinalizeOutcome::AnotherRound
now use a newBoxedRound
wrapper type.ProtocolError
for()
for protocols that don't use errors.CorrectnessProof
trait.RoundId
now supports nesting.Notes:
EntryPoint::new
take&self
? This way we can basically formalize the concept of protocol constructors used insynedrion
.misbehave
go intotesting
? Or gated behind thetesting
feature?EntryPoint::ENTRY_ROUND
, or make the user define it explicitly every time?From
bounds in the chain combinator is a little awkward, since we have to clone stuff for the first protocol. Some kind of a "splitting" trait might be more idiomatic, to split the full inputs into the inputs for Protocol 1 and the inputs for Protocol 2.From
for the type from the original protocol, which may be foreign in practice.