From 579dcc50686f73f42961f1624f067ede52701b4e Mon Sep 17 00:00:00 2001 From: David Date: Thu, 19 Oct 2023 13:50:33 +0800 Subject: [PATCH] feat(prover): increase the assignment expiration waiting time (#431) --- driver/chain_syncer/calldata/syncer.go | 8 ++++---- prover/prover.go | 21 ++++++++++++++------- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/driver/chain_syncer/calldata/syncer.go b/driver/chain_syncer/calldata/syncer.go index 33a2c60c7..592865932 100644 --- a/driver/chain_syncer/calldata/syncer.go +++ b/driver/chain_syncer/calldata/syncer.go @@ -199,10 +199,10 @@ func (s *Syncer) onBlockProposed( log.Info( "New BlockProposed event", - "L1Height", event.Raw.BlockNumber, - "L1Hash", event.Raw.BlockHash, - "BlockID", event.BlockId, - "Removed", event.Raw.Removed, + "l1Height", event.Raw.BlockNumber, + "l1Hash", event.Raw.BlockHash, + "blockID", event.BlockId, + "removed", event.Raw.Removed, ) // Fetch the L2 parent block. diff --git a/prover/prover.go b/prover/prover.go index 14552de0f..2ecf354ee 100644 --- a/prover/prover.go +++ b/prover/prover.go @@ -424,7 +424,7 @@ func (p *Prover) onBlockProposed( "L1 block hash mismatch due to L1 reorg", "height", event.Meta.L1Height, "currentL1OriginHeader", currentL1OriginHeader.Hash(), - "L1HashInEvent", event.Meta.L1Hash, + "l1HashInEvent", event.Meta.L1Hash, ) return fmt.Errorf( @@ -436,10 +436,10 @@ func (p *Prover) onBlockProposed( log.Info( "Proposed block", - "L1Height", event.Raw.BlockNumber, - "L1Hash", event.Raw.BlockHash, - "BlockID", event.BlockId, - "Removed", event.Raw.Removed, + "l1Height", event.Raw.BlockNumber, + "l1Hash", event.Raw.BlockHash, + "blockID", event.BlockId, + "removed", event.Raw.Removed, ) metrics.ProverReceivedProposedBlockGauge.Update(event.BlockId.Int64()) @@ -531,8 +531,15 @@ func (p *Prover) onBlockProposed( ) if p.cfg.ProveUnassignedBlocks { - log.Info("Add proposed block to wait for proof window expiration", "blockID", event.BlockId) - time.AfterFunc(timeToExpire, func() { p.proofWindowExpiredCh <- event }) + log.Info( + "Add proposed block to wait for proof window expiration", + "blockID", event.BlockId, + ) + time.AfterFunc( + // Add another 12 seconds, to ensure one more L1 block will be mined before the proof submission + timeToExpire+12*time.Second, + func() { p.proofWindowExpiredCh <- event }, + ) } return nil