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

fix: run DKG only once #1115

Merged
merged 9 commits into from
Dec 13, 2024
Merged

fix: run DKG only once #1115

merged 9 commits into from
Dec 13, 2024

Conversation

djordon
Copy link
Collaborator

@djordon djordon commented Dec 13, 2024

Description

Closes #1114

Changes

  • Construct the WSTS coordinator state machine using the correct DKG shares.
  • Do not run DKG if it has been run before.
  • Remove some currently unused code. The tests that exercise that code path have already been ignored.

Testing Information

No tests yet, hence the draft status.

Checklist:

  • I have performed a self-review of my code

@djordon djordon added sbtc signer binary The sBTC Bootstrap Signer. key rotation The functionality to rotate a private key for a signer in sBTC-v1. labels Dec 13, 2024
@djordon djordon added this to the sBTC 0.9, mainnet release milestone Dec 13, 2024
@djordon djordon self-assigned this Dec 13, 2024
Copy link
Collaborator

@matteojug matteojug left a comment

Choose a reason for hiding this comment

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

LGTM

signer/src/storage/postgres.rs Outdated Show resolved Hide resolved
signer/tests/integration/stacks_events_observer.rs Outdated Show resolved Hide resolved
@djordon djordon marked this pull request as ready for review December 13, 2024 02:35
Copy link
Collaborator

@matteojug matteojug left a comment

Choose a reason for hiding this comment

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

Tested in devnet

@djordon djordon merged commit c60dedf into main Dec 13, 2024
4 checks passed
@djordon djordon deleted the use-correct-aggregate-keys branch December 13, 2024 04:13
@djordon
Copy link
Collaborator Author

djordon commented Dec 13, 2024

Oh I figured out how to test that we sign things correctly, even when locking deposits and signer UTXOs with different keys. It isn't so bad, will add tomorrow.

@@ -1467,10 +1475,10 @@ impl super::DbRead for PgStore {
, signer_set_public_keys
, signature_share_threshold
FROM sbtc_signer.dkg_shares
WHERE aggregate_key = $1;
WHERE substring(aggregate_key FROM 2) = $1;
Copy link
Member

Choose a reason for hiding this comment

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

Just a nit -- I think I would have preferred that we stored this in an extra column instead of messing around with it at query-time. I think we do something similar and even more convoluted somewhere else..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
key rotation The functionality to rotate a private key for a signer in sBTC-v1. sbtc signer binary The sBTC Bootstrap Signer.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Bug]: DKG can be triggered whenever
3 participants