Skip to content

feat: add more signing functions#370

Merged
varex83 merged 2 commits into
mainfrom
bohdan/dkg-signing
May 5, 2026
Merged

feat: add more signing functions#370
varex83 merged 2 commits into
mainfrom
bohdan/dkg-signing

Conversation

@varex83
Copy link
Copy Markdown
Collaborator

@varex83 varex83 commented May 4, 2026

No description provided.

Comment thread crates/dkg/src/dkg.rs Outdated

pub use crate::{
aggregate::{AggregateError, agg_deposit_data, agg_lock_hash_sig, agg_validator_registrations},
disk,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need pub use this?

Comment thread crates/dkg/src/dkg.rs Outdated
/// preserves existing creator/operator signatures.
pub unverified: bool,
/// Validator addresses for the newly added validators. Length must match
/// [`AppendConfig::add_validators`].
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we need to validate this: Length must match [AppendConfig::add_validators]? There is no constructor for this, so not sure if we can validate that

Comment thread crates/dkg/src/signing.rs Outdated
withdrawal_addresses: &[String],
network: &str,
node_idx: &NodeIdx,
deposit_amounts: &[u64],
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

should we use Gwei here

Comment thread crates/dkg/src/signing.rs Outdated

/// Signs, exchanges, and aggregates deposit data for each deposit amount.
#[allow(dead_code, reason = "will be used in dkg later ")]
pub async fn sign_and_agg_deposit_data(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

pub(crate)

Comment thread crates/dkg/src/signing.rs Outdated

/// Signs, exchanges, and aggregates validator registrations.
#[allow(dead_code, reason = "will be used in dkg later ")]
pub async fn sign_and_agg_validator_registrations(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

pub(crate)

Comment thread crates/dkg/src/signing.rs Outdated
/// unverified, in which case signing is skipped.
#[allow(dead_code, reason = "will be used in dkg later ")]
#[allow(clippy::too_many_arguments, reason = "mirrors Go signAndAggLockHash")]
pub async fn sign_and_aggregate_lock_hash(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

pub(crate)

- Drop redundant `pub use crate::disk` re-export; add private `use crate::disk`.
- Add `DkgError::AppendConfigAddressCountMismatch` and `AppendConfig::validate`
  so callers can enforce the documented length invariant.
- Use `phase0::Gwei` instead of `u64` for `sign_and_agg_deposit_data`'s
  `deposit_amounts`.
- Lower visibility of `sign_and_agg_deposit_data`,
  `sign_and_agg_validator_registrations`, and `sign_and_aggregate_lock_hash`
  to `pub(crate)`; they are not used outside the crate.

Co-Authored-By: Bohdan Ohorodnii <35969035+varex83@users.noreply.github.com>
@varex83 varex83 merged commit fb1567c into main May 5, 2026
9 checks passed
@varex83 varex83 deleted the bohdan/dkg-signing branch May 5, 2026 11:37
@claude claude Bot mentioned this pull request May 6, 2026
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