-
Notifications
You must be signed in to change notification settings - Fork 11
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
Yet another batch of improvements for Coordinator #107
Conversation
address authority; | ||
uint16 dkgSize; | ||
uint16 threshold; |
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.
This is going to help declutter API in nucypher-ts
…or the moment We currently define it as the lowest value that produces a threshold set that's strictly greater than the 50% of the overall size. See nucypher/nucypher#3095
We can revert to a composition model later, but for the moment this will make our lives easier
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.
LGTM! 👌
Just a few questions/suggestions...
struct Ritual { | ||
address initiator; | ||
uint32 initTimestamp; | ||
uint32 endTimestamp; | ||
uint16 totalTranscripts; | ||
uint16 totalAggregations; | ||
// |
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.
It's not a important thing, but why this empty line is commented?
bool aggregationMismatch; | ||
// |
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.
It's not a important thing, but why this empty line is commented?
function getRitualIdFromPublicKey( | ||
BLS12381.G1Point memory dkgPublicKey | ||
) external view returns (uint32 ritualId) { | ||
// If public key is not registered, result will produce underflow error |
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.
An underflow error sounds like a too cryptic message if you just used a wrong ritualId, doesn't it?
What about using a require here? Something like
// If public key is not registered, result will produce underflow error | |
require(getRitualState(ritualId) != RitualState.INVALID, "Ritual not found") |
@@ -338,21 +342,43 @@ contract Coordinator is AccessControlDefaultAdminRules { | |||
keccak256(ritual.aggregatedTranscript) != aggregatedTranscriptDigest | |||
) { | |||
ritual.aggregationMismatch = true; | |||
delete ritual.publicKey; |
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.
👍
bytes32 digest // signed message hash | ||
uint32 ritualId, | ||
bytes memory evidence, // supporting evidence for authorization | ||
bytes memory ciphertextHeader // data to be signed by authorized |
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.
👏 .
@cygnusv Is the ciphertext header a fixed size? If so, any benefits that we can leverage from that fact like bytes32
or ...?
1 + dkg size/2
. See Should DKG Threshold be specified for Ritual nucypher#3095FeeModel
andCoordinator
GlobalAllow
list (Closes Optimze allow list storage lookups #97)IEncryptionAuthorizer
API to requireciphertext_header
instead ofdigest
, to further strengthen verification.