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

Commit

Permalink
feat(prover): increase the assignment expiration waiting time (#431)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaikocha committed Oct 19, 2023
1 parent ab4e613 commit 579dcc5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
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

0 comments on commit 579dcc5

Please sign in to comment.