Conversation
063d1fc to
c7b884b
Compare
c7b884b to
f089ac2
Compare
pkg/accountability/simpleacc/internal/predecisions/predecisions.go
Outdated
Show resolved
Hide resolved
| for i, nodeId := range nodeIds { | ||
| predecisions.ApplySigVerified(m, mc, params, state, nodeId, errs[i], vsr.certificate[nodeId], false, logger) | ||
| } | ||
| poms.SendPoMs(m, mc, params, state, logger) |
There was a problem hiding this comment.
Would it still be correct to set the flag to true and not call poms.SendPoMs? If yes, the code could be simplified quite a bit by completely removing the flag and always acting as if it was true.
In fact, would we then even still need the UnsentPoMs variable in the state?
There was a problem hiding this comment.
We can but in a received certificate for a different decision we will likely detect either no PoMs or at least a weak quorum (e.g. n/3+1) of them. this means n/3+1 events if we remove the flag and sendPoMs for each detected PoM.
There was a problem hiding this comment.
In that case I have the quite strong opinion that we should simplify the code. Finding a PoM should be, in practice, an EXTREMELY rare event, and even in that case, such a performance detail would probably make almost no difference. Simplicity of the code, however, is a very important thing that should take precedence here I think.
pkg/accountability/simpleacc/internal/predecisions/predecisions.go
Outdated
Show resolved
Hide resolved
pkg/accountability/simpleacc/internal/predecisions/predecisions.go
Outdated
Show resolved
Hide resolved
pkg/accountability/simpleacc/internal/predecisions/predecisions.go
Outdated
Show resolved
Hide resolved
pkg/accountability/simpleacc/internal/certificates/lightcertificates/lightcertificates.go
Outdated
Show resolved
Hide resolved
pkg/accountability/simpleacc/internal/predecisions/predecisions.go
Outdated
Show resolved
Hide resolved
fdd97de to
7c4e481
Compare
matejpavlovic
left a comment
There was a problem hiding this comment.
Nice job, I resolved most of the conversations.
One bigger thing does need to be added I think before merging: some form of test that exerces these code paths. With so much added code that has never been run, it is extremely likely that we both missed something that will be obvious once the code is executed.
|
|
||
| message SignedPredecision { | ||
| option (net.message) = true; | ||
| option (mir.struct) = true; |
There was a problem hiding this comment.
Do we need to specify the mir.struct when we already declare it a message?
| moduleParams.Membership = accParams.Membership | ||
| moduleParams.RetentionIndex = accParams.RetentionIndex | ||
|
|
||
| // Create a new instance of the multisig collector. |
There was a problem hiding this comment.
Copy-paste artifact?
| for i, nodeId := range nodeIds { | ||
| predecisions.ApplySigVerified(m, mc, params, state, nodeId, errs[i], vsr.certificate[nodeId], false, logger) | ||
| } | ||
| poms.SendPoMs(m, mc, params, state, logger) |
There was a problem hiding this comment.
In that case I have the quite strong opinion that we should simplify the code. Finding a PoM should be, in practice, an EXTREMELY rare event, and even in that case, such a performance detail would probably make almost no difference. Simplicity of the code, however, is a very important thing that should take precedence here I think.
Signed-off-by: Matej Pavlovic <matopavlovic@gmail.com>
From pkg/accountability/simpleacc/accountability.go:
Closes #383
TODOs (in later PRs?):