@@ -83,7 +83,7 @@ func (p *EonKeyPublisher) Publish(key keyper.EonPublicKey) {
83
83
// set, unless the key is already confirmed or the keyper has already voted on it.
84
84
func (p * EonKeyPublisher ) publishIfResponsible (ctx context.Context , key keyper.EonPublicKey ) {
85
85
db := obskeyperdb .New (p .dbpool )
86
- keyperSet , err := db .GetKeyperSetByKeyperConfigIndex (ctx , int64 (key .Eon ))
86
+ keyperSet , err := db .GetKeyperSetByKeyperConfigIndex (ctx , int64 (key .KeyperConfigIndex ))
87
87
if err != nil {
88
88
log .Error ().
89
89
Err (err ).
@@ -121,11 +121,21 @@ func (p *EonKeyPublisher) publishOldKeys(ctx context.Context) {
121
121
}
122
122
dkgResult , err := shdb .DecodePureDKGResult (dkgResultDB .PureResult )
123
123
if err != nil {
124
- err := errors .Wrapf (err , "failed to decode DKG result of eon %d" , dkgResultDB .Eon )
125
- log .Error ().Err (err ).Msg ("failed to publish old eon keys" )
124
+ log .Error ().
125
+ Err (err ).
126
+ Int64 ("eon" , dkgResultDB .Eon ).
127
+ Msg ("failed to decode DKG result to publish old eon key" )
126
128
continue
127
129
}
128
- p .publish (ctx , dkgResult .PublicKey .Marshal (), dkgResult .Eon , dkgResult .Keyper )
130
+ eon , err := db .GetEon (ctx , dkgResultDB .Eon )
131
+ if err != nil {
132
+ log .Error ().
133
+ Err (err ).
134
+ Int64 ("eon" , dkgResultDB .Eon ).
135
+ Msg ("failed to fetch eon to publish old eon public key" )
136
+ continue
137
+ }
138
+ p .publish (ctx , dkgResult .PublicKey .Marshal (), uint64 (eon .KeyperConfigIndex ), dkgResult .Keyper )
129
139
}
130
140
}
131
141
0 commit comments