@@ -3,7 +3,6 @@ package epochkghandler
3
3
import (
4
4
"bytes"
5
5
"context"
6
- "strconv"
7
6
8
7
"github.com/jackc/pgx/v4"
9
8
"github.com/jackc/pgx/v4/pgxpool"
@@ -15,7 +14,6 @@ import (
15
14
"github.com/shutter-network/shutter/shlib/shcrypto"
16
15
17
16
"github.com/shutter-network/rolling-shutter/rolling-shutter/keyper/database"
18
- "github.com/shutter-network/rolling-shutter/rolling-shutter/keyper/keypermetrics"
19
17
"github.com/shutter-network/rolling-shutter/rolling-shutter/medley"
20
18
"github.com/shutter-network/rolling-shutter/rolling-shutter/p2p"
21
19
"github.com/shutter-network/rolling-shutter/rolling-shutter/p2pmsg"
@@ -54,31 +52,25 @@ func (handler *DecryptionKeyHandler) ValidateMessage(ctx context.Context, msg p2
54
52
return pubsub .ValidationReject , err
55
53
}
56
54
if ! isKeyper {
57
- keypermetrics .MetricsKeyperIsKeyper .WithLabelValues (strconv .FormatInt (eon , 10 )).Set (0 )
58
55
log .Debug ().Int64 ("eon" , eon ).Msg ("Ignoring decryptionKey for eon; we're not a Keyper" )
59
56
return pubsub .ValidationReject , nil
60
57
}
61
- keypermetrics .MetricsKeyperIsKeyper .WithLabelValues (strconv .FormatInt (eon , 10 )).Set (1 )
62
58
63
59
dkgResultDB , err := queries .GetDKGResultForKeyperConfigIndex (ctx , eon )
64
60
if errors .Is (err , pgx .ErrNoRows ) {
65
- keypermetrics .MetricsKeyperSuccessfulDKG .WithLabelValues (strconv .FormatInt (eon , 10 )).Set (0 )
66
61
return pubsub .ValidationReject , errors .Errorf ("no DKG result found for eon %d" , eon )
67
62
}
68
63
if err != nil {
69
- keypermetrics .MetricsKeyperSuccessfulDKG .WithLabelValues (strconv .FormatInt (eon , 10 )).Set (0 )
70
64
return pubsub .ValidationReject , errors .Wrapf (err , "failed to get dkg result for eon %d from db" , eon )
71
65
}
72
66
if ! dkgResultDB .Success {
73
- keypermetrics .MetricsKeyperSuccessfulDKG .WithLabelValues (strconv .FormatInt (eon , 10 )).Set (0 )
74
67
return pubsub .ValidationReject , errors .Errorf ("no successful DKG result found for eon %d" , eon )
75
68
}
76
69
pureDKGResult , err := shdb .DecodePureDKGResult (dkgResultDB .PureResult )
77
70
if err != nil {
78
71
return pubsub .ValidationReject , errors .Wrapf (err , "error while decoding pure DKG result for eon %d" , eon )
79
72
}
80
73
81
- keypermetrics .MetricsKeyperSuccessfulDKG .WithLabelValues (strconv .FormatInt (eon , 10 )).Set (1 )
82
74
if len (decryptionKeys .Keys ) == 0 {
83
75
return pubsub .ValidationReject , errors .New ("no keys in message" )
84
76
}
0 commit comments