-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[dkg] Add chunky DKG types and module structure #18542
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
base: main
Are you sure you want to change the base?
Conversation
Adds the core Chunky DKG type definitions: - ChunkyDKGConfig, ChunkyDKGSessionMetadata, ChunkyDKGStartEvent - ChunkyDKGTranscript, CertifiedAggregatedChunkySubtranscript - ChunkyDKGSessionState, ChunkyDKGState - ChunkyDKG wrapper with deal/verify/aggregate helpers Also adds on-chain config types: - ChunkyDKGConfigMoveStruct, OnChainChunkyDKGConfig (Off/V1 variants) And exports InputSecret, EncryptPubKey, PublicParameters from aptos-dkg.
3c691a6 to
46d8fbd
Compare
be3a963 to
2fd2bb8
Compare
2fd2bb8 to
920951f
Compare
46d8fbd to
222ea46
Compare
- Add chunky module with types, placeholder submodules - Add ChunkyDKG message types to DKGMessage enum - Add chunky DKG metrics and observability functions - Add required dependencies to Cargo.toml
920951f to
90382e5
Compare
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.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| DKGMessage::ChunkyTranscriptRequest(_) => "ChunkyDKGTranscriptRequest", | ||
| DKGMessage::ChunkyTranscriptResponse(_) => "ChunkyDKGTranscriptResponse", | ||
| DKGMessage::SubtranscriptSignatureRequest(_) => "DKGSubtranscriptSignatureRequest", | ||
| DKGMessage::SubtranscriptSignatureResponse(_) => "DKGSubtranscriptSignatureResponse", |
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.
Inconsistent naming missing "Chunky" prefix in name() method
Low Severity
The name() method returns "DKGSubtranscriptSignatureRequest" and "DKGSubtranscriptSignatureResponse" for the SubtranscriptSignatureRequest and SubtranscriptSignatureResponse variants, but the actual wrapped types are ChunkyDKGSubtranscriptSignatureRequest and ChunkyDKGSubtranscriptSignatureResponse. This is inconsistent with the pattern used for ChunkyTranscriptRequest and ChunkyTranscriptResponse, which correctly include the "Chunky" prefix in their returned names. Since name() is used for logging/debugging in error messages, this inconsistency could cause confusion when searching for or identifying these message types.
| DKG_STAGE_SECONDS | ||
| .with_label_values(&[my_addr.short_str().as_str(), stage]) | ||
| .observe(secs_since_dkg_start); | ||
| } |
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.
Metric label format inconsistent with existing DKG code
Low Severity
The new observe_dkg_stage function uses my_addr.short_str() to format the dealer label, but existing code in dkg_manager/mod.rs records to the same DKG_STAGE_SECONDS metric using self.my_addr.to_hex(). short_str() returns only the first 8 hex characters while to_hex() returns the full 64-character address. If this function is ever enabled, the same dealer would appear as different entities in metrics, making analysis difficult.
| #[derive(Clone, Debug, Serialize, Deserialize, CryptoHasher, BCSCryptoHash)] | ||
| pub struct AggregatedSubtranscript { | ||
| pub subtranscript: ChunkySubtranscript, | ||
| pub dealers: Vec<Player>, |
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.
use hashset?
| #[derive(Clone, Serialize, Deserialize, Debug, PartialEq)] | ||
| pub struct MissingTranscriptResponse { | ||
| pub metadata: DKGTranscriptMetadata, | ||
| pub transcript: ChunkyDKGTranscriptResponse, |
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.
transcript already has metadata?



Summary
Adds the
dkg/src/chunky/module structure with types and stubs.types.rs- Network message typesChunkyDKGTranscriptRequest/Response- for collecting transcripts from peersMissingTranscriptRequest/Response- for fetching missing transcriptsAggregatedSubtranscript- aggregated result with contributorsCertifiedAggregatedSubtranscript- aggregated result with multi-sigModule structure (stubs for subsequent PRs)
agg_subtrx_producer.rs- aggregated subtranscript producersubtrx_cert_producer.rs- subtranscript certificate producerdkg_manager.rs- DKG state machinemissing_transcript_fetcher.rs- transcript fetcherDependencies
aptos-dkg,aptos-batch-encryption,aptos-short-hex-str,serde_bytes