Skip to content
This repository has been archived by the owner on May 11, 2024. It is now read-only.

feat(prover): increase the assignment expiration waiting time #431

Merged
merged 3 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions driver/chain_syncer/calldata/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
21 changes: 14 additions & 7 deletions prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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())

Expand Down Expand Up @@ -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
Expand Down