Skip to content

feat: add full dkg mechanism #1821

Merged
joshieDo merged 23 commits intomainfrom
joshie/fulldkg
Jan 2, 2026
Merged

feat: add full dkg mechanism #1821
joshieDo merged 23 commits intomainfrom
joshie/fulldkg

Conversation

@joshieDo
Copy link
Copy Markdown
Contributor

@joshieDo joshieDo commented Dec 31, 2025

How it works

  • Outcome in the last block of epoch_N-1 will specify if the next epoch will execute a full dkg ceremony
  • Outcome in the last block of epoch_N will have the new public
  • epoch_N will be using the new public

@vercel
Copy link
Copy Markdown

vercel bot commented Dec 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Review Updated (UTC)
tempo-docs Ignored Ignored Preview Jan 2, 2026 8:05pm

@joshieDo joshieDo self-assigned this Dec 31, 2025
@joshieDo joshieDo added the A-consensus-infra Related to consensus label Dec 31, 2025
@jenpaff jenpaff linked an issue Jan 2, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

@SuperFluffy SuperFluffy left a comment

Choose a reason for hiding this comment

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

Looks fine to me. The test seems a bit overkill and I am on the fence about the metric, but other than that it's great!


/// Whether the next DKG ceremony should be a full ceremony (new polynomial)
/// instead of a reshare. Set when `nextFullDkgCeremony == epoch`.
pub is_next_full_dkg: bool,
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.

Should this be an epoch number instead of a boolean?

Comment thread crates/commonware-node/src/dkg/manager/actor/state.rs
if onchain_outcome.output == state.output {
self.metrics.failures.inc();
if state.is_full_dkg {
self.metrics.full_failures.inc();
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.

Let's just have a single counter for full re-DKGs instead of 2 new metrics for failures and successes.

Comment thread crates/commonware-node/src/dkg/manager/validators.rs Outdated
Comment thread crates/commonware-node/src/dkg/manager/validators.rs Outdated
Comment thread crates/commonware-node/src/dkg/manager/actor/state.rs Outdated
Comment thread crates/commonware-node/src/dkg/manager/actor/state.rs
async fn wait_for_outcome(
&self,
context: &Context,
validators: &[TestingNode<Context>],
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.

Maybe just pass in one of them if we only read the first?

Comment thread crates/e2e/src/tests/dkg/full_ceremony.rs Outdated
Comment thread xtask/src/genesis_args.rs
self.validators.iter().map(Validator::public_key),
)
.unwrap(),
is_next_full_dkg: false,
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.

We could make this configurable to force a full DKG on start.

Base automatically changed from joshie/redkg to main January 2, 2026 18:12
@joshieDo joshieDo marked this pull request as ready for review January 2, 2026 19:36
Comment thread crates/commonware-node/src/dkg/manager/actor/mod.rs Outdated
Comment thread crates/commonware-node/src/dkg/manager/actor/mod.rs Outdated
@joshieDo joshieDo added this pull request to the merge queue Jan 2, 2026
Merged via the queue into main with commit 25b71fa Jan 2, 2026
17 checks passed
@joshieDo joshieDo deleted the joshie/fulldkg branch January 2, 2026 20:20
Zygimantass pushed a commit that referenced this pull request Jan 11, 2026
* on top of #1680
* uses the precompile to know when to execute a full/fresh dkg ceremony 


How it works
* Outcome in the last block of `epoch_N-1` will specify if the next
epoch will execute a full dkg ceremony
* Outcome in the last block of `epoch_N`  will have the new public
* `epoch_N` will be using the new public
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-consensus-infra Related to consensus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement full re-dkg on a schedule

2 participants