Skip to content
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

dkg: add signing to dkg #564

Merged
merged 19 commits into from
May 20, 2022
Merged

dkg: add signing to dkg #564

merged 19 commits into from
May 20, 2022

Conversation

dB2510
Copy link
Contributor

@dB2510 dB2510 commented May 19, 2022

Adds signing and aggregation of lock hash and deposit data to dkg.

category: feature
ticket: #522

@codecov
Copy link

codecov bot commented May 19, 2022

Codecov Report

Merging #564 (4f56a20) into main (0bfa40b) will increase coverage by 0.31%.
The diff coverage is 51.54%.

@@            Coverage Diff             @@
##             main     #564      +/-   ##
==========================================
+ Coverage   54.39%   54.70%   +0.31%     
==========================================
  Files          92       92              
  Lines        8496     8636     +140     
==========================================
+ Hits         4621     4724     +103     
+ Misses       3243     3239       -4     
- Partials      632      673      +41     
Impacted Files Coverage Δ
dkg/disk.go 44.26% <50.00%> (+3.72%) ⬆️
dkg/dkg.go 53.58% <51.47%> (+12.20%) ⬆️
dkg/exchanger.go 80.95% <100.00%> (ø)
core/qbft/qbft.go 81.48% <0.00%> (-0.66%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bfa40b...4f56a20. Read the comment docs.

@dB2510 dB2510 marked this pull request as draft May 19, 2022 11:17
dkg/dkg.go Outdated
Comment on lines 200 to 324
sig := &bls_sig.Signature{}
if err = sig.UnmarshalBinary(s.Signature); err != nil {
return nil, nil, errors.Wrap(err, "Unmarshal signature")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can do tblsconv.SigFromCore(core.Signature(s))

dkg/dkg.go Outdated
if err != nil {
return nil, errors.Wrap(err, "aggregate signature")
return nil, nil, errors.Wrap(err, "BLS Aggregate Signatures")
Copy link
Contributor

Choose a reason for hiding this comment

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

errors should not be capitalised

@dB2510 dB2510 marked this pull request as ready for review May 20, 2022 10:45
@dB2510 dB2510 requested a review from corverroos May 20, 2022 10:45
dkg/dkg.go Outdated
@@ -136,24 +148,128 @@ func Run(ctx context.Context, conf Config) error {
return err
}

pubkeyToVerifiers := make(map[core.PubKey]*sharing.FeldmanVerifier)
Copy link
Contributor

Choose a reason for hiding this comment

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

why not pass in shares directly into aggSignLock hash, no need for these verbose types I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i did this because we are getting response from exchange according to pubkeys and in aggSignLockhash also we are iterating according to pubkeys

dkg/dkg.go Outdated
lock := cluster.Lock{
Definition: def,
Validators: dvs,
}

if conf.TestSigning {
sig, err := aggSignLockHash(ctx, tcpNode, nodeIdx, nil, lock, shares)
sigLockHash, err := signLockHash(lock, nodeIdx.ShareIdx, shares)
Copy link
Contributor

@corverroos corverroos May 20, 2022

Choose a reason for hiding this comment

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

split lockhash signing/exchage/aggregation and depositdata signing/exchage/aggregation into separate functions, there is too much going on this root function

dkg/dkg.go Outdated
return errors.Wrap(err, "verify multisignature")
}

if !verified {
Copy link
Contributor

Choose a reason for hiding this comment

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

else if maybe?

@dB2510 dB2510 added the merge when ready Indicates bulldozer bot may merge when all checks pass label May 20, 2022
@obol-bulldozer obol-bulldozer bot merged commit 273d7a0 into main May 20, 2022
@obol-bulldozer obol-bulldozer bot deleted the dhruv/dkgsign2 branch May 20, 2022 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge when ready Indicates bulldozer bot may merge when all checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants