Skip to content

Commit

Permalink
feat(CON-1413): Create local transcripts for Vetkeys (#3387)
Browse files Browse the repository at this point in the history
This PR adds functionality to generate local NiDkg transcripts for
Vetkeys to the DKG component.

- Introduce `get_enabled_vet_keys` to get all NiDKG key ids from the
`ChainKeyConfig`.
- Introduce the `tags_iter` function, which iterates over `LowThreshold`
and `HighThreshold` as well as provided `HighThresholdForKeyId` variants
off `NiDkgTag`
- Unit tests to capture the new behaviour
- Adapt test code
- Adapt CUP loading functions to load the `initializations`

---------

Co-authored-by: Leo Eichhorn <[email protected]>
  • Loading branch information
Sawchord and eichhorl authored Feb 10, 2025
1 parent bee195f commit 0ff90c2
Show file tree
Hide file tree
Showing 10 changed files with 778 additions and 202 deletions.
5 changes: 5 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions rs/consensus/dkg/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ DEPENDENCIES = [
"//rs/protobuf",
"//rs/registry/helpers",
"//rs/replicated_state",
"//rs/types/management_canister_types",
"//rs/types/types",
"@crate_index//:prometheus",
"@crate_index//:rayon",
Expand All @@ -24,13 +25,16 @@ DEV_DEPENDENCIES = [
"//rs/artifact_pool",
"//rs/consensus/mocks",
"//rs/crypto/test_utils/ni-dkg",
"//rs/interfaces/registry/mocks",
"//rs/registry/subnet_features",
"//rs/test_utilities",
"//rs/test_utilities/artifact_pool",
"//rs/test_utilities/consensus",
"//rs/test_utilities/logger",
"//rs/test_utilities/registry",
"//rs/test_utilities/state",
"//rs/test_utilities/types",
"@crate_index//:prost",
]

rust_library(
Expand Down
7 changes: 6 additions & 1 deletion rs/consensus/dkg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ic-interfaces = { path = "../../interfaces" }
ic-interfaces-registry = { path = "../../interfaces/registry" }
ic-interfaces-state-manager = { path = "../../interfaces/state_manager" }
ic-logger = { path = "../../monitoring/logger" }
ic-management-canister-types-private = { path = "../../types/management_canister_types" }
ic-metrics = { path = "../../monitoring/metrics" }
ic-protobuf = { path = "../../protobuf" }
ic-registry-client-helpers = { path = "../../registry/helpers" }
Expand All @@ -22,10 +23,14 @@ slog = { workspace = true }
rayon = { workspace = true }

[dev-dependencies]

ic-interfaces-registry-mocks = { path = "../../interfaces/registry/mocks" }
ic-test-artifact-pool = { path = "../../test_utilities/artifact_pool" }
prost = { workspace = true }
ic-artifact-pool = { path = "../../artifact_pool" }
ic-consensus-mocks = { path = "../mocks" }
ic-crypto-test-utils-ni-dkg = { path = "../../crypto/test_utils/ni-dkg" }
ic-test-artifact-pool = { path = "../../test_utilities/artifact_pool" }
ic-registry-subnet-features = { path = "../../registry/subnet_features" }
ic-test-utilities = { path = "../../test_utilities" }
ic-test-utilities-consensus = { path = "../../test_utilities/consensus" }
ic-test-utilities-logger = { path = "../../test_utilities/logger" }
Expand Down
3 changes: 1 addition & 2 deletions rs/consensus/dkg/src/dkg_key_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,8 +483,7 @@ impl DkgKeyManager {
.consensus_membership_registry_version
.set(summary.registry_version.get() as i64);

for tag in [NiDkgTag::LowThreshold, NiDkgTag::HighThreshold].iter() {
let current_transcript = summary.current_transcript(tag).unwrap();
for (tag, current_transcript) in summary.current_transcripts() {
let metric_label = &format!("{:?}", tag);

self.metrics
Expand Down
Loading

0 comments on commit 0ff90c2

Please sign in to comment.