Skip to content
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

Merged
merged 16 commits into from
Aug 27, 2023

Conversation

cygnusv
Copy link
Member

@cygnusv cygnusv commented Aug 7, 2023

@cygnusv cygnusv changed the base branch from main to development August 7, 2023 14:59
@cygnusv cygnusv changed the title [WIP] Coordinator can't get enough Yet another batch of improvements for Coordinator Aug 23, 2023
@cygnusv cygnusv marked this pull request as ready for review August 23, 2023 14:20
address authority;
uint16 dkgSize;
uint16 threshold;
Copy link
Contributor

@piotr-roslaniec piotr-roslaniec Aug 24, 2023

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

Copy link
Member

@manumonti manumonti left a 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;
//
Copy link
Member

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;
//
Copy link
Member

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
Copy link
Member

@manumonti manumonti Aug 25, 2023

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

Suggested change
// If public key is not registered, result will produce underflow error
require(getRitualState(ritualId) != RitualState.INVALID, "Ritual not found")

@KPrasch KPrasch merged commit af4433b into nucypher:development Aug 27, 2023
2 checks passed
@@ -338,21 +342,43 @@ contract Coordinator is AccessControlDefaultAdminRules {
keccak256(ritual.aggregatedTranscript) != aggregatedTranscriptDigest
) {
ritual.aggregationMismatch = true;
delete ritual.publicKey;
Copy link
Member

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
Copy link
Member

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 ...?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants