From 69b1141a1a7b5d664d9a0c9e7d5e55b35a2e8c4c Mon Sep 17 00:00:00 2001 From: Jeffery Walsh Date: Fri, 14 Jul 2023 00:04:04 -0700 Subject: [PATCH] also notify non-blocking for oracle --- prover/prover.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/prover/prover.go b/prover/prover.go index 380a7dd8e..7eefe45af 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -684,7 +684,20 @@ func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1Clien // generate oracle proof if oracle prover, proof is invalid if p.cfg.OracleProver { // call proveNotify and pass in the L1 start height - p.proveNotify <- new(big.Int).SetUint64(event.Raw.BlockNumber) + notify := func() { + select { + case p.proveNotify <- new(big.Int).SetUint64(event.Raw.BlockNumber): + default: + log.Info("unable to request oracle proof, proveNotify channel busy", + "blockID", + event.BlockId.Uint64(), + "l1Height", + new(big.Int).SetUint64(event.Raw.BlockNumber), + ) + } + } + + notify() } } @@ -925,3 +938,7 @@ func (p *Prover) checkProofWindowExpired(ctx context.Context, l1Height, blockId // otherwise, keep it in the map and check again next iteration return nil } + +func (p *Prover) notify(l1Height *big.Int) { + +}