@@ -359,7 +359,7 @@ func (cr *ChallengeRequest) VerifyChallenge(challengeObj *Challenge, allocationO
359
359
if len (cr .ObjectProof ) == 0 && latestWM .ChainSize == 0 {
360
360
return nil
361
361
}
362
- err = cr .verifyObjectProof (latestWM , challengeObj .BlobberID , allocationObj . OwnerPublicKey , challengeObj .RandomNumber )
362
+ err = cr .verifyObjectProof (latestWM , challengeObj .BlobberID , cr . WriteMarkers [ len ( cr . WriteMarkers ) - 1 ]. ClientPublicKey , challengeObj .RandomNumber )
363
363
if err != nil {
364
364
logging .Logger .Error ("Failed to verify object proof" , zap .String ("challenge_id" , challengeObj .ID ), zap .Error (err ))
365
365
return err
@@ -445,7 +445,7 @@ func (vt *ValidationTicket) Sign() error {
445
445
return err
446
446
}
447
447
448
- func (cr * ChallengeRequest ) verifyObjectProof (latestWM * writemarker.WriteMarker , blobberID , OwnerPublicKey string , challengeRand int64 ) error {
448
+ func (cr * ChallengeRequest ) verifyObjectProof (latestWM * writemarker.WriteMarker , blobberID , ownerPublicKey string , challengeRand int64 ) error {
449
449
if len (cr .ObjectProof ) == 0 {
450
450
return common .NewError ("invalid_object_proof" , "Object proof is missing" )
451
451
}
@@ -481,8 +481,9 @@ func (cr *ChallengeRequest) verifyObjectProof(latestWM *writemarker.WriteMarker,
481
481
// verify fixed merkle root
482
482
hashData := fmt .Sprintf ("%s:%s:%s:%s" , cr .Meta .ActualFileHash , cr .Meta .ValidationRoot , cr .Meta .FixedMerkleRoot , blobberID )
483
483
validationRootHash := encryption .Hash (hashData )
484
- verify , err := encryption .Verify (OwnerPublicKey , cr .Meta .ValidationRootSignature , validationRootHash )
484
+ verify , err := encryption .Verify (ownerPublicKey , cr .Meta .ValidationRootSignature , validationRootHash )
485
485
if err != nil {
486
+ logging .Logger .Error ("Failed to verify the validation root signature" , zap .Error (err ), zap .String ("validation_root" , cr .Meta .ValidationRoot ), zap .String ("validation_root_signature" , cr .Meta .ValidationRootSignature ), zap .String ("owner_public_key" , ownerPublicKey ))
486
487
return common .NewError ("invalid_object_proof" , "Failed to verify the validation root signature. " + err .Error ())
487
488
}
488
489
if ! verify {
0 commit comments