Skip to content

Yet another batch of improvements for Coordinator#107

Merged
KPrasch merged 16 commits intonucypher:developmentfrom
cygnusv:chachachanges
Aug 27, 2023
Merged

Yet another batch of improvements for Coordinator#107
KPrasch merged 16 commits intonucypher:developmentfrom
cygnusv:chachachanges

Conversation

@cygnusv
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

uint32 endTimestamp;
uint16 totalTranscripts;
uint16 totalAggregations;
//
Copy link
Copy Markdown
Contributor

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?

uint16 dkgSize;
uint16 threshold;
bool aggregationMismatch;
//
Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

@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
keccak256(ritual.aggregatedTranscript) != aggregatedTranscriptDigest
) {
ritual.aggregationMismatch = true;
delete ritual.publicKey;
Copy link
Copy Markdown
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
Copy Markdown
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