-
Notifications
You must be signed in to change notification settings - Fork 5
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: bootstrapping distributed key generation (stale) #632
Conversation
instead of that lon error function
transaction coordinator
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.
Looks good, assuming that the actual logic in wsts_state_machine
and wsts
is correct :)
@@ -132,6 +132,17 @@ deployer = "SN2V7WTJ7BHR03MPHZ1C9A9ZR6NZGR4WM8HT4V67Y" | |||
# Environment: SIGNER_SIGNER__DB_ENDPOINT | |||
db_endpoint = "postgresql://postgres:postgres@localhost:5432/signer" | |||
|
|||
# The public keys of known signers who are approved to be in the signer | |||
# set. | |||
# The signer database endpoint (pgsql connection string) |
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.
Snuck in your copy-paste ;)
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.
lol, 🙏🏽 thank you
signer/src/config/default.toml
Outdated
# | ||
# Required: true | ||
# Environment: SIGNER_SIGNER__PEER_PUBLIC_KEYS | ||
peer_public_keys = [ |
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.
Yeah, we should try to get rid of this for release, but for now is fine
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.
Yeah. I wasn't sure if we needed this for v1 or not (under the current design). I think the alternative is to have some other mechanism to get this information from their peers.
/// Check whether or not we need to run DKG | ||
/// | ||
/// This function checks for the existence of a | ||
/// [`RotateKeysTransaction`] in the database, and one does not exist |
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.
/// Check whether or not we need to run DKG | |
/// | |
/// This function checks for the existence of a | |
/// [`RotateKeysTransaction`] in the database, and one does not exist | |
/// Check whether or not we need to run DKG | |
/// | |
/// This function first checks for the existence of a | |
/// [`RotateKeysTransaction`] row in the database. If one exists, then DKG | |
/// has already been completed. | |
/// | |
/// If not, it then proceeds to check for DKG shares in the database for | |
/// the current signer aggregate key. If DKG shares exist but there is no | |
/// [`RotateKeysTransaction`] then one needs to be created, otherwise if | |
/// no shares exist then DKG needs to be run. |
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.
perfect, yeah I forgot to update this.
@@ -553,6 +619,15 @@ where | |||
PublicKey::from_private_key(&self.private_key) | |||
} | |||
|
|||
/// This function provides a deterministic 32-byte identifier for the | |||
/// signer. This should probably deterministically too. |
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 should probably deterministically too" ... ? 😆
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.
lol will update.
@@ -132,6 +132,17 @@ deployer = "SN2V7WTJ7BHR03MPHZ1C9A9ZR6NZGR4WM8HT4V67Y" | |||
# Environment: SIGNER_SIGNER__DB_ENDPOINT | |||
db_endpoint = "postgresql://postgres:postgres@localhost:5432/signer" | |||
|
|||
# The public keys of known signers who are approved to be in the signer | |||
# set. | |||
# The signer database endpoint (pgsql connection string) |
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.
nit: leftover line
@@ -169,6 +177,12 @@ where | |||
.await? | |||
.ok_or(Error::NoChainTip)?; | |||
|
|||
if self.needs_dkg(&bitcoin_chain_tip).await? == DkgState::NeedsDkg { |
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.
Since this is not guarded by some self.is_coordinator
condition, do we risk to have concurrent DKGs?
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.
Oh, I just forgot to add that in.
&mut self, | ||
chain_tip: &model::BitcoinBlockHash, | ||
) -> Result<PublicKey, Error> { | ||
let mut state_machine = CoordinatorStateMachine::new([], self.threshold, self.private_key); |
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.
sanity check: is the [ ]
just a wip thing?
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.
yeah, forgot to change that.
@@ -553,6 +619,15 @@ where | |||
PublicKey::from_private_key(&self.private_key) | |||
} | |||
|
|||
/// This function provides a deterministic 32-byte identifier for the | |||
/// signer. This should probably deterministically too. |
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.
nit: This should probably deterministically too
I guess a word is missing somewhere, or is a repetition of the deterministic
above
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.
lol yeah typo.
along with the associated public key.
shares from the database, use in some key places
142823a
to
e4a2b7d
Compare
a5fa87d
to
2c28d6e
Compare
the signing set
is no key roation transaction yet.
test private key
Description
Closes #590
Changes
There are still some things that need to be done,
dkg_shares
table for the current aggregate key if there is norotate_keys_transaction
in the database.Testing Information
This also needs tests.
Checklist: