Skip to content

Commit 81eb591

Browse files
committed
Validate signatures against keyper set
1 parent 138812b commit 81eb591

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

rolling-shutter/gnosisaccessnode/decryptionkeyshandler.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010

1111
"github.com/shutter-network/shutter/shlib/shcrypto"
1212

13-
obskeyperdatabase "github.com/shutter-network/rolling-shutter/rolling-shutter/chainobserver/db/keyper"
1413
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyperimpl/gnosis"
1514
"github.com/shutter-network/rolling-shutter/rolling-shutter/p2pmsg"
1615
)
@@ -97,12 +96,9 @@ func (handler *DecryptionKeysHandler) validateGnosisFields(keys *p2pmsg.Decrypti
9796
}
9897
extra := keys.Extra.(*p2pmsg.DecryptionKeys_Gnosis).Gnosis
9998

100-
// TODO: populate this from the contract
101-
keyperSet := &obskeyperdatabase.KeyperSet{
102-
KeyperConfigIndex: 0,
103-
ActivationBlockNumber: 0,
104-
Keypers: []string{},
105-
Threshold: 0,
99+
keyperSet, ok := handler.storage.GetKeyperSet(keys.Eon)
100+
if !ok {
101+
return pubsub.ValidationReject, errors.Errorf("no keyper set found for eon %d", keys.Eon)
106102
}
107103

108104
res, err = gnosis.ValidateDecryptionKeysSignatures(keys, extra, keyperSet)

0 commit comments

Comments
 (0)