Skip to content

Conversation

@ibalajiarun
Copy link
Contributor

@ibalajiarun ibalajiarun commented Jan 29, 2026

Summary

Adds the dkg/src/chunky/ module structure with types and stubs.

types.rs - Network message types

  • ChunkyDKGTranscriptRequest/Response - for collecting transcripts from peers
  • MissingTranscriptRequest/Response - for fetching missing transcripts
  • AggregatedSubtranscript - aggregated result with contributors
  • CertifiedAggregatedSubtranscript - aggregated result with multi-sig

Module structure (stubs for subsequent PRs)

  • agg_subtrx_producer.rs - aggregated subtranscript producer
  • subtrx_cert_producer.rs - subtranscript certificate producer
  • dkg_manager.rs - DKG state machine
  • missing_transcript_fetcher.rs - transcript fetcher

Dependencies

  • Adds aptos-dkg, aptos-batch-encryption, aptos-short-hex-str, serde_bytes

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.
@ibalajiarun ibalajiarun changed the base branch from balaji/chunky-dkg-reconfig-vm to graphite-base/18542 January 30, 2026 16:33
@ibalajiarun ibalajiarun force-pushed the balaji/chunky-dkg-crate-types branch from be3a963 to 2fd2bb8 Compare January 30, 2026 16:33
@ibalajiarun ibalajiarun changed the base branch from graphite-base/18542 to balaji/chunky-dkg-validator-txn January 30, 2026 16:33
@ibalajiarun ibalajiarun changed the base branch from balaji/chunky-dkg-validator-txn to graphite-base/18542 January 30, 2026 16:44
@ibalajiarun ibalajiarun force-pushed the balaji/chunky-dkg-crate-types branch from 2fd2bb8 to 920951f Compare January 30, 2026 16:45
@ibalajiarun ibalajiarun changed the base branch from graphite-base/18542 to balaji/chunky-dkg-types January 30, 2026 16:45
- 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
@ibalajiarun ibalajiarun force-pushed the balaji/chunky-dkg-crate-types branch from 920951f to 90382e5 Compare January 30, 2026 16:46
@ibalajiarun ibalajiarun marked this pull request as ready for review January 30, 2026 17:02
Copy link

@cursor cursor bot left a 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",
Copy link

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.

Fix in Cursor Fix in Web

DKG_STAGE_SECONDS
.with_label_values(&[my_addr.short_str().as_str(), stage])
.observe(secs_since_dkg_start);
}
Copy link

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.

Fix in Cursor Fix in Web

#[derive(Clone, Debug, Serialize, Deserialize, CryptoHasher, BCSCryptoHash)]
pub struct AggregatedSubtranscript {
pub subtranscript: ChunkySubtranscript,
pub dealers: Vec<Player>,
Copy link
Contributor

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,
Copy link
Contributor

Choose a reason for hiding this comment

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

transcript already has metadata?

Base automatically changed from balaji/chunky-dkg-types to main January 30, 2026 20:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants