From 4a1012ac702acc4d1d1bae5c295cdad02c99caef Mon Sep 17 00:00:00 2001 From: David Date: Sat, 7 Oct 2023 03:30:40 +0800 Subject: [PATCH] fix(prover): fix L1 height used in `onBlockProven` handler (#421) --- prover/prover.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prover/prover.go b/prover/prover.go index 86d1a2add..0420c2976 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -728,7 +728,11 @@ func (p *Prover) onBlockProven(ctx context.Context, event *bindings.TaikoL1Clien } else { // generate oracle proof if oracle prover, proof is invalid if p.cfg.OracleProver { - return p.requestProofForBlockId(event.BlockId, new(big.Int).SetUint64(event.Raw.BlockNumber)) + l1Height, err := p.rpc.TaikoL2.LatestSyncedL1Height(&bind.CallOpts{Context: ctx, BlockNumber: event.BlockId}) + if err != nil { + return err + } + return p.requestProofForBlockId(event.BlockId, new(big.Int).SetUint64(l1Height)) } }