@@ -135,7 +135,7 @@ func (s *Service) submitClaimsAndUpdateDatabase(
135135 s .Logger .Info ("Claim submitted" ,
136136 "app" , apps [key ].IApplicationAddress ,
137137 "receipt_block_number" , receipt .BlockNumber ,
138- "claim_hash" , fmt .Sprintf ("%x" , computedEpoch .ClaimHash ),
138+ "claim_hash" , fmt .Sprintf ("%x" , computedEpoch .OutputsMerkleRoot ),
139139 "last_block" , computedEpoch .LastBlock ,
140140 "tx" , txHash )
141141 delete (computedEpochs , key )
@@ -258,7 +258,7 @@ func (s *Service) submitClaimsAndUpdateDatabase(
258258 }
259259 s .Logger .Debug ("Updating claim status to submitted" ,
260260 "app" , app .IApplicationAddress ,
261- "claim_hash" , fmt .Sprintf ("%x" , currEpoch .ClaimHash ),
261+ "claim_hash" , fmt .Sprintf ("%x" , currEpoch .OutputsMerkleRoot ),
262262 "last_block" , currEpoch .LastBlock ,
263263 )
264264 txHash := currClaimSubmissionEvent .Raw .TxHash
@@ -277,21 +277,21 @@ func (s *Service) submitClaimsAndUpdateDatabase(
277277 s .Logger .Info ("Claim previously submitted" ,
278278 "app" , app .IApplicationAddress ,
279279 "event_block_number" , currClaimSubmissionEvent .Raw .BlockNumber ,
280- "claim_hash" , fmt .Sprintf ("%x" , currEpoch .ClaimHash ),
280+ "claim_hash" , fmt .Sprintf ("%x" , currEpoch .OutputsMerkleRoot ),
281281 "last_block" , currEpoch .LastBlock ,
282282 )
283283 } else if s .submissionEnabled {
284284 if prevEpoch != nil && prevEpoch .Status != model .EpochStatus_ClaimAccepted {
285285 s .Logger .Debug ("Waiting previous claim to be accepted before submitting new one. Previous:" ,
286286 "app" , app .IApplicationAddress ,
287- "claim_hash" , fmt .Sprintf ("%x" , prevEpoch .ClaimHash ),
287+ "claim_hash" , fmt .Sprintf ("%x" , prevEpoch .OutputsMerkleRoot ),
288288 "last_block" , prevEpoch .LastBlock ,
289289 )
290290 goto nextApp
291291 }
292292 s .Logger .Debug ("Submitting claim to blockchain" ,
293293 "app" , app .IApplicationAddress ,
294- "claim_hash" , fmt .Sprintf ("%x" , currEpoch .ClaimHash ),
294+ "claim_hash" , fmt .Sprintf ("%x" , currEpoch .OutputsMerkleRoot ),
295295 "last_block" , currEpoch .LastBlock ,
296296 )
297297 txHash , err := s .blockchain .submitClaimToBlockchain (ic , app , currEpoch )
@@ -304,7 +304,7 @@ func (s *Service) submitClaimsAndUpdateDatabase(
304304 } else {
305305 s .Logger .Debug ("Claim submission disabled. Doing nothing" ,
306306 "app" , app .IApplicationAddress ,
307- "claim_hash" , fmt .Sprintf ("%x" , currEpoch .ClaimHash ),
307+ "claim_hash" , fmt .Sprintf ("%x" , currEpoch .OutputsMerkleRoot ),
308308 "last_block" , currEpoch .LastBlock ,
309309 )
310310
@@ -409,7 +409,7 @@ func (s *Service) acceptClaimsAndUpdateDatabase(
409409 }
410410 s .Logger .Debug ("Updating claim status to accepted" ,
411411 "app" , app .IApplicationAddress ,
412- "claim_hash" , fmt .Sprintf ("%x" , submittedEpoch .ClaimHash ),
412+ "claim_hash" , fmt .Sprintf ("%x" , submittedEpoch .OutputsMerkleRoot ),
413413 "last_block" , submittedEpoch .LastBlock ,
414414 )
415415 txHash := currEvent .Raw .TxHash
@@ -482,7 +482,7 @@ func checkEpochConstraint(c *model.Epoch) error {
482482 return fmt .Errorf ("unexpected epoch state. first_block: %v > last_block: %v" , c .FirstBlock , c .LastBlock )
483483 }
484484 if c .Status == model .EpochStatus_ClaimSubmitted {
485- if c .ClaimHash == nil {
485+ if c .OutputsMerkleRoot == nil {
486486 return fmt .Errorf ("unexpected epoch state. missing claim_hash." )
487487 }
488488 }
@@ -520,13 +520,13 @@ func checkEpochSequenceConstraint(prevEpoch *model.Epoch, currEpoch *model.Epoch
520520
521521func claimSubmittedEventMatches (application * model.Application , epoch * model.Epoch , event * iconsensus.IConsensusClaimSubmitted ) bool {
522522 return application .IApplicationAddress == event .AppContract &&
523- * epoch .ClaimHash == event .OutputsMerkleRoot &&
523+ * epoch .OutputsMerkleRoot == event .OutputsMerkleRoot &&
524524 epoch .LastBlock == event .LastProcessedBlockNumber .Uint64 ()
525525}
526526
527527func claimAcceptedEventMatches (application * model.Application , epoch * model.Epoch , event * iconsensus.IConsensusClaimAccepted ) bool {
528528 return application .IApplicationAddress == event .AppContract &&
529- * epoch .ClaimHash == event .OutputsMerkleRoot &&
529+ * epoch .OutputsMerkleRoot == event .OutputsMerkleRoot &&
530530 epoch .LastBlock == event .LastProcessedBlockNumber .Uint64 ()
531531}
532532
0 commit comments