-
Notifications
You must be signed in to change notification settings - Fork 15
Accountability module #505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>
From pkg/accountability/simpleacc/accountability.go:
Closes #383
TODOs (in later PRs?):