-
Notifications
You must be signed in to change notification settings - Fork 205
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
Merge rc v1.4.0 in multisigner #4524
Changes from 1 commit
3be0b7e
323d3f9
60b05ff
aac70c1
67ed8dd
5969f45
a7ab265
b8b0369
ca40a0a
9c1b662
f8fd0c7
e099ad4
5880e80
3bba066
91df00a
f1d055a
87a659b
71ed404
57694f7
f160ad5
cff3734
1310485
0c2ebd6
a3e62b2
97de57e
5f2e83b
ec948c6
0d066b0
20e5ca3
020dcf7
2c3f76d
69f41e7
2a0130a
79ac4e9
19af831
dc313c8
16c0ee9
58bee12
243818c
7544338
3ef2e70
fb16b70
5c2a752
1fcc29e
8e402fa
018294d
6d9aa55
cca896e
2bd27c4
9dfb5f8
e07eebe
da5deb1
3dd2132
296f7f9
39e6f1a
08bb77b
2768eb7
d424b06
b1c21ab
749e202
d5cd600
b6da3f1
b0ee408
e4efa09
8f73599
5b0ac6f
fc8abea
b287445
09612ca
5057964
6d038ca
35d49b9
846ff81
9edf78e
927071c
6f509c1
f55263a
b1a9140
3040213
ba9bcb2
9b5a7cb
b180e4c
b0c0349
e50fe5e
e60e6ca
0ddd82b
8e84a1d
fd20734
55a1dfc
d6d9bc8
dfbf79f
0e4f225
8c37efd
7888a44
9f0c489
791ea86
b12139a
a12cffa
66e6f53
fa98e7c
5b11a82
90bd65a
dc680b2
ed4d26e
99e11bb
326726a
731530c
d76bffb
a72b09a
7d806e2
27567a0
7a32f56
2380fe8
95e5203
5a31928
0a022bc
6f8740b
05f6f1d
f6181a9
c899ac6
013b2cf
f3b5d4f
2a5719b
44d948c
961ead7
ceeb79f
52da3a3
8eecfa5
8303b62
09cd9ef
f348a6c
06f259e
03660bd
7981f9e
e6bed50
28a9823
2e4fae7
af5e1c1
93e9ba2
a907030
a50c6f5
72b3676
7a0610c
5aed6c6
a0442ea
12149cc
3f39a3c
d646ca8
a982c2c
14d5394
d4a9180
cd21c73
554158f
bf806d4
f33c98a
9566e28
e4fc932
a068c83
aeddd79
1c5dfa7
2edb60b
1d22b38
8de041b
57fe4d9
6eebc53
933f36c
d0758e9
46c31fc
708aa24
63414ce
ff5c28a
5027b0c
5c3f16e
3796daf
349b6f3
ceabff3
916458d
6cc8a00
a0ad600
fa3ed86
1097ca4
aa410c2
90c114b
47b8513
5bd2e68
bde1072
3858875
8adbdcc
b08cc25
de74bf1
36680d1
07ceaa8
92fa342
f18d477
e9fbe20
62f2d9e
33bfb47
1166693
0bffd13
b6a2105
5392db3
5e91f25
c368820
23cc3c7
20b7aa7
1e290d8
94b10b3
c557cf3
8006dc2
49c6b5f
534f082
9c87724
97aeb57
64b7950
01bdd33
5c653a1
4562f8e
b2e134a
8dd305e
a0af5ab
c414b68
1e30493
45b3e87
14792e2
ef40caf
67c8853
07c3fb0
d007840
894a3d7
e7da853
825cacb
908d307
4cd69d3
fb7d791
607790a
805c09d
6a2897b
5b8eb89
a7f97d6
e0b586c
1f07e99
b08f0d2
254cfca
9206bcf
70e023f
f61564c
fca85b6
848f8f7
743b92a
a09acff
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,21 +73,16 @@ func (sr *subroundSignature) doSignatureJob(_ context.Context) bool { | |
return false | ||
} | ||
|
||
selfIndex, err := sr.SelfConsensusGroupIndex() | ||
if err != nil { | ||
log.Debug("doSignatureJob.SelfConsensusGroupIndex: not in consensus group") | ||
return false | ||
} | ||
|
||
signatureShare, err := sr.SignatureHandler().CreateSignatureShare(sr.GetData(), uint16(selfIndex), sr.Header.GetEpoch()) | ||
if err != nil { | ||
log.Debug("doSignatureJob.CreateSignatureShare", "error", err.Error()) | ||
return false | ||
} | ||
isSelfLeader := sr.IsSelfLeaderInCurrentRound() | ||
|
||
if isSelfLeader || sr.IsNodeInConsensusGroup(sr.SelfPubKey()) { | ||
signatureShare, err := sr.MultiSigner().CreateSignatureShare(sr.GetData(), nil) | ||
selfIndex, err := sr.SelfConsensusGroupIndex() | ||
if err != nil { | ||
log.Debug("doSignatureJob.SelfConsensusGroupIndex: not in consensus group") | ||
return false | ||
} | ||
|
||
signatureShare, err := sr.SignatureHandler().CreateSignatureShare(sr.GetData(), uint16(selfIndex), sr.Header.GetEpoch()) | ||
if err != nil { | ||
log.Debug("doSignatureJob.CreateSignatureShare", "error", err.Error()) | ||
return false | ||
|
@@ -368,7 +363,19 @@ func (sr *subroundSignature) doSignatureJobForManagedKeys() bool { | |
} | ||
|
||
managedPrivateKey := sr.GetMessageSigningPrivateKey(pkBytes) | ||
signatureShare, err := sr.MultiSigner().CreateAndAddSignatureShareForKey(sr.GetData(), managedPrivateKey, pkBytes) | ||
selfIndex, err := sr.ConsensusGroupIndex(pk) | ||
if err != nil { | ||
log.Warn("doSignatureJobForManagedKeys: index not found", "pk", pkBytes) | ||
continue | ||
} | ||
|
||
managedPrivateKeyBytes, err := managedPrivateKey.ToByteArray() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. signature handler was supposed to do itself the management of private keys and signing and move that out of the consensus, but here it is partially moved into consensus again. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added TODO |
||
if err != nil { | ||
log.Warn("doSignatureJobForManagedKeys: can not recover the private key bytes", "pk", pkBytes) | ||
continue | ||
} | ||
|
||
signatureShare, err := sr.SignatureHandler().CreateSignatureShareWithPrivateKey(sr.GetData(), uint16(selfIndex), sr.Header.GetEpoch(), managedPrivateKeyBytes) | ||
if err != nil { | ||
log.Debug("doSignatureJobForManagedKeys.CreateAndAddSignatureShareForKey", "error", err.Error()) | ||
return false | ||
|
This file was deleted.
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.
this needs to be refactored to remove private key as parameter.
If you add a TODO I can do the refactor.
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.
added TODO