Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't try to propose until we hit safe head #15

Merged
merged 1 commit into from
Nov 7, 2024
Merged
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
12 changes: 12 additions & 0 deletions op-proposer/proposer/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ var (
ErrProposerNotRunning = errors.New("proposer is not running")
)

func init() {
if aggregateBatchSize <= 1 {
panic("aggregateBatchSize must be greater than 1")
}
}

type OOContract interface {
Version(*bind.CallOpts) (string, error)
LatestL2Output(opts *bind.CallOpts) (bindings.TypesOutputProposal, error)
Expand Down Expand Up @@ -319,6 +325,12 @@ func (l *L2OutputSubmitter) nextOutput(ctx context.Context, latestOutput binding
}
proposal := l.pending[0]

if proposal.To.Number < latestSafe.Number {
l.Log.Info("Aggregated output is not the latest safe block, waiting for more proofs",
"aggregated", l2BlockRefToBlockID(proposal.To), "latestSafe", latestSafe)
return nil, false, nil
}

if proposal.To.Hash != latestSafe.Hash {
l.Log.Warn("Aggregated output does not match the latest batched block, possible reorg",
"aggregated", l2BlockRefToBlockID(proposal.To), "latestSafe", latestSafe)
Expand Down