@@ -299,29 +299,34 @@ namespace fc::mining::checks {
299
299
if (deal_count == 0 ) {
300
300
return ERROR_TEXT (" checkUpdate: no deals" );
301
301
}
302
+
303
+ if (!sector_info->update_unsealed ) {
304
+ return ChecksError::kBadUpdateReplica ;
305
+ }
306
+
302
307
OUTCOME_TRY (comm_d,
303
308
getDataCommitment (miner_address, sector_info, tipset_key, api));
304
- if (sector_info->update_comm_d != comm_d) {
305
- return ERROR_TEXT ( " checkUpdate: wrong update_comm_d " ) ;
309
+ if (sector_info->update_unsealed != comm_d) {
310
+ return ChecksError:: kBadUpdateReplica ;
306
311
}
307
- if (!sector_info->update_comm_r ) {
308
- return ERROR_TEXT ( " checkUpdate: no update_comm_r " ) ;
312
+ if (!sector_info->update_sealed ) {
313
+ return ChecksError:: kBadUpdateReplica ;
309
314
}
310
315
if (!sector_info->update_proof ) {
311
- return ERROR_TEXT ( " checkUpdate: no update_proof " ) ;
316
+ return ChecksError:: kBadUpdateProof ;
312
317
}
313
318
OUTCOME_TRY (update_type,
314
319
getRegisteredUpdateProof (sector_info->sector_type ));
315
320
OUTCOME_TRY (verified,
316
321
proofs->verifyUpdateProof ({
317
322
update_type,
318
323
*sector_info->comm_r ,
319
- *sector_info->update_comm_r ,
320
- *sector_info->update_comm_d ,
324
+ *sector_info->update_sealed ,
325
+ *sector_info->update_unsealed ,
321
326
*sector_info->update_proof ,
322
327
}));
323
328
if (!verified) {
324
- return ERROR_TEXT ( " checkUpdate: wrong proof " ) ;
329
+ return ChecksError:: kBadUpdateProof ;
325
330
}
326
331
return outcome::success ();
327
332
}
@@ -358,6 +363,10 @@ OUTCOME_CPP_DEFINE_CATEGORY(fc::mining::checks, ChecksError, e) {
358
363
return " ChecksError: need to wait commit" ;
359
364
case E::kMinerVersion :
360
365
return " ChecksError::kMinerVersion" ;
366
+ case E::kBadUpdateReplica :
367
+ return " ChecksError: bad update replica" ;
368
+ case E::kBadUpdateProof :
369
+ return " ChecksError: bad update proof" ;
361
370
default :
362
371
return " ChecksError: unknown error" ;
363
372
}
0 commit comments