@@ -188,7 +188,19 @@ func (pb *RemoteProposalBuilder) build(
188
188
if ! ok {
189
189
slots , nonce , err := pb .proposalSvc .CalculateEligibilitySlotsFor (ctx , nodeId , epoch )
190
190
if err != nil {
191
- pb .logger .Error ("calculate eligibility slots error" , zap .Error (err ))
191
+ pb .logger .Error ("calculate eligibility slots error" ,
192
+ log .ZContext (ctx ),
193
+ zap .Stringer ("node" , nodeId ),
194
+ zap .Error (err ),
195
+ )
196
+ continue
197
+ }
198
+ if slots == 0 {
199
+ pb .logger .Info ("node not eligible in this epoch, will try later" ,
200
+ log .ZContext (ctx ),
201
+ zap .Stringer ("node" , nodeId ),
202
+ zap .Uint32 ("epoch" , epoch .Uint32 ()),
203
+ )
192
204
continue
193
205
}
194
206
proofs = calcEligibilityProofs (
@@ -210,7 +222,11 @@ func (pb *RemoteProposalBuilder) build(
210
222
211
223
proposal , _ , err := pb .proposalSvc .Proposal (ctx , layer , nodeId )
212
224
if err != nil {
213
- pb .logger .Error ("get partial proposal" , zap .Error (err ))
225
+ pb .logger .Error ("get partial proposal" ,
226
+ log .ZContext (ctx ),
227
+ zap .Stringer ("node" , nodeId ),
228
+ zap .Error (err ),
229
+ )
214
230
pb .identityStates .Set (nodeId , & smesherIdentity.ProposalBuildFailed {
215
231
ErrorMsg : fmt .Sprintf ("get partial proposal: %v" , err ),
216
232
Layer : layer ,
@@ -219,18 +235,28 @@ func (pb *RemoteProposalBuilder) build(
219
235
}
220
236
if proposal == nil {
221
237
// this node signer isn't eligible this epoch, continue
222
- pb .logger .Info ("node not eligible on this layer. will try later" )
238
+ pb .logger .Info ("node not eligible on this layer: no proposal received, will try later" ,
239
+ log .ZContext (ctx ),
240
+ zap .Stringer ("node" , nodeId ),
241
+ zap .Uint32 ("lid" , layer .Uint32 ()),
242
+ )
223
243
continue
224
244
}
225
245
226
- eligibilities , ok := proofs [layer ]
246
+ // TODO(mafa): I don't think this belongs here, either do this check before requesting a proposal
247
+ // (client decides about eligibilities) or don't do it at all (server decides eligibilities)
248
+ eligProofs , ok := proofs [layer ]
227
249
if ! ok {
228
250
// not eligible in this layer, continue
229
- pb .logger .Info ("node not eligible in this layer, will try later" )
251
+ pb .logger .Info ("node not eligible in this layer, will try later" ,
252
+ log .ZContext (ctx ),
253
+ zap .Stringer ("node" , nodeId ),
254
+ zap .Uint32 ("lid" , layer .Uint32 ()),
255
+ )
230
256
continue
231
257
}
232
258
233
- proposal .EligibilityProofs = eligibilities
259
+ proposal .EligibilityProofs = eligProofs
234
260
proposal .Ballot .Signature = signer .signer .Sign (signing .BALLOT , proposal .Ballot .SignedBytes ())
235
261
proposal .Signature = signer .signer .Sign (signing .PROPOSAL , proposal .SignedBytes ())
236
262
err = proposal .Initialize ()
0 commit comments