Skip to content

Commit

Permalink
Fix shouldPropose logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog committed Oct 4, 2024
1 parent 6cca03d commit d611150
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions op-proposer/proposer/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ func (l *L2OutputSubmitter) generateNextProposal(ctx context.Context, lastPropos
if lastProposal != nil {
proposals = append(proposals, lastProposal)
}
shouldPropose := l.Cfg.MinProposalInterval > 0 && latestBlockNumber-proposedBlockNumber > l.Cfg.MinProposalInterval
shouldPropose := lastProposalBlockNumber < latestBlockNumber &&
l.Cfg.MinProposalInterval > 0 && latestBlockNumber-proposedBlockNumber > l.Cfg.MinProposalInterval
for i := lastProposalBlockNumber + 1; i <= latestBlockNumber; i++ {
proposal, anyWithdrawals, err := l.prover.Generate(ctx, i)
if err != nil {
Expand All @@ -264,7 +265,7 @@ func (l *L2OutputSubmitter) generateNextProposal(ctx context.Context, lastPropos
lastProposal = proposals[0]
}

if lastProposalBlockNumber < latestBlockNumber {
if shouldPropose {
latestL1BlockHeader, err := l.L1Client.HeaderByNumber(l.ctx, nil)
if err != nil {
log.Warn("Failed to get latest block header", "err", err)
Expand Down

0 comments on commit d611150

Please sign in to comment.