Skip to content

Commit 785a310

Browse files
committed
Fix eon/keyper config index mismatch
1 parent fcec220 commit 785a310

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

rolling-shutter/keyper/epochkghandler/sendkeyshare.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,16 @@ func (ksh *KeyShareHandler) ConstructDecryptionKeyShares(
6666
if !isKeyper {
6767
return nil, errors.Wrap(ErrNotAKeyper, ErrIgnoreDecryptionRequest.Error())
6868
}
69+
keyperConfigIndex, err := medley.Int64ToUint64Safe(eon.KeyperConfigIndex)
70+
if err != nil {
71+
return nil, err
72+
}
6973

7074
// check if we already computed (and therefore most likely sent) our key shares
7175
allSharesExist := true
7276
for _, identityPreimage := range identityPreimages {
7377
shareExists, err := db.ExistsDecryptionKeyShare(ctx, database.ExistsDecryptionKeyShareParams{
74-
Eon: eon.Eon,
78+
Eon: int64(keyperConfigIndex),
7579
EpochID: identityPreimage.Bytes(),
7680
KeyperIndex: keyperIndex,
7781
})
@@ -113,17 +117,13 @@ func (ksh *KeyShareHandler) ConstructDecryptionKeyShares(
113117
})
114118
}
115119

116-
keyperSetIndexUint, err := medley.Int64ToUint64Safe(eon.KeyperConfigIndex)
117-
if err != nil {
118-
return nil, err
119-
}
120120
keyperIndexUint, err := medley.Int64ToUint64Safe(keyperIndex)
121121
if err != nil {
122122
return nil, err
123123
}
124124
msg := &p2pmsg.DecryptionKeyShares{
125125
InstanceID: ksh.InstanceID,
126-
Eon: keyperSetIndexUint,
126+
Eon: keyperConfigIndex,
127127
KeyperIndex: keyperIndexUint,
128128
Shares: shares,
129129
}

0 commit comments

Comments
 (0)