This repository was archived by the owner on May 11, 2024. It is now read-only.
File tree 1 file changed +16
-8
lines changed
1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -293,14 +293,22 @@ func (h *BlockProposedEventHandler) checkExpirationAndSubmitProof(
293
293
)
294
294
return nil
295
295
}
296
-
297
- // The proof submitted to protocol is invalid.
298
- h .proofContestCh <- & proofProducer.ContestRequestBody {
299
- BlockID : e .BlockId ,
300
- ProposedIn : new (big.Int ).SetUint64 (e .Raw .BlockNumber ),
301
- ParentHash : proofStatus .ParentHeader .Hash (),
302
- Meta : & e .Meta ,
303
- Tier : e .Meta .MinTier ,
296
+ // If the current proof has not been contested, we should contest it at first.
297
+ if proofStatus .CurrentTransitionState .Contester == rpc .ZeroAddress {
298
+ h .proofContestCh <- & proofProducer.ContestRequestBody {
299
+ BlockID : e .BlockId ,
300
+ ProposedIn : new (big.Int ).SetUint64 (e .Raw .BlockNumber ),
301
+ ParentHash : proofStatus .ParentHeader .Hash (),
302
+ Meta : & e .Meta ,
303
+ Tier : e .Meta .MinTier ,
304
+ }
305
+ } else {
306
+ // The invalid proof submitted to protocol is contested by another prover,
307
+ // we need to submit a proof with a higher tier.
308
+ h .proofSubmissionCh <- & proofProducer.ProofRequestBody {
309
+ Tier : proofStatus .CurrentTransitionState .Tier + 1 ,
310
+ Event : e ,
311
+ }
304
312
}
305
313
return nil
306
314
}
You can’t perform that action at this time.
0 commit comments