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

feat: distribute public keys #123

Merged
merged 12 commits into from
Apr 25, 2023
Merged

feat: distribute public keys #123

merged 12 commits into from
Apr 25, 2023

Conversation

ChaoticTempest
Copy link
Member

@ChaoticTempest ChaoticTempest commented Apr 24, 2023

Resolves #115.

Opened up to test for now since local dev isn't working on macos right now

Creates two new endpoints /public_key_node and /accept_pk_set in sign nodes.

  • public_key_node: fetches the public key for the sign node.
  • accept_pk_set: sign node accepts a list of public keys to be set.

Currently leader node will aggregate all public keys from sign nodes, then send them to each sign node separately. /accept_pk_set can also be used to set the keys manually too if needed.

@ChaoticTempest ChaoticTempest marked this pull request as ready for review April 25, 2023 05:57
Copy link
Contributor

@itegulov itegulov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I would wait for @DavidM-D's approval that this is what he had in mind

Copy link
Collaborator

@volovyks volovyks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
It's a bit strange that we are setting PK set separately from other info about nodes. But it will work for now. Maybe this logic will be executed exactly one time :/

@volovyks
Copy link
Collaborator

So... how it will work in dev env? Is it automated?

@itegulov
Copy link
Contributor

@volovyks what do you mean? Signer nodes still need to know their key pairs statically (i.e. they are generated outside of the application). Leader node makes a bunch of requests on startup to collect all public keys and then distributes them across the signer nodes.

@volovyks
Copy link
Collaborator

@itegulov ok, cool then
Just making sure that dev signing nodes will uses the same keys across deployment

Copy link
Contributor

@DavidM-D DavidM-D left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from one comment, LGTM


let mut public_keys = state.node_info.nodes_public_keys.write().await;
tracing::debug!("Setting node public keys => {:?}", request.public_keys);
public_keys.replace(request.public_keys);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these keys should only be set in a situation where there are no public keys on the node currently. I don't think we want nodes changing signing groups with payloads in flight.

Also what happens if a sign node restart, do they lose their public keys?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, let me store them in Datastore

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@itegulov itegulov requested a review from DavidM-D April 25, 2023 12:03
Copy link
Contributor

@DavidM-D DavidM-D left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@itegulov itegulov merged commit 7c454c6 into develop Apr 25, 2023
@itegulov itegulov deleted the phuong/distribute-pks branch April 25, 2023 14:47
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.

Bootstrap signing server public key list
4 participants