From 98ba72bc118c1c24fa087dff453f4b7fca4c444a Mon Sep 17 00:00:00 2001 From: Zach Obront Date: Mon, 12 Aug 2024 23:51:43 -0500 Subject: [PATCH] skip concurrent proof limit for agg proofs --- op-proposer/flags/flags.go | 2 +- op-proposer/proposer/prove.go | 21 ++++++++++++------- op-proposer/proposer/span_batches.go | 2 +- packages/contracts-bedrock/lib/sp1-contracts | 1 + proofs.db | Bin 12288 -> 20480 bytes 5 files changed, 16 insertions(+), 10 deletions(-) create mode 160000 packages/contracts-bedrock/lib/sp1-contracts diff --git a/op-proposer/flags/flags.go b/op-proposer/flags/flags.go index fa8ca4d35f..01f5f499ab 100644 --- a/op-proposer/flags/flags.go +++ b/op-proposer/flags/flags.go @@ -130,7 +130,7 @@ var ( MaxConcurrentProofRequestsFlag = &cli.Uint64Flag{ Name: "max-concurrent-proof-requests", Usage: "Maximum number of proofs to generate concurrently", - Value: 10, + Value: 20, EnvVars: prefixEnvVars("MAX_CONCURRENT_PROOF_REQUESTS"), } TxCacheOutDirFlag = &cli.StringFlag{ diff --git a/op-proposer/proposer/prove.go b/op-proposer/proposer/prove.go index 2c7cfbf0dd..9611b548a7 100644 --- a/op-proposer/proposer/prove.go +++ b/op-proposer/proposer/prove.go @@ -37,7 +37,7 @@ func (l *L2OutputSubmitter) ProcessPendingProofs() error { timeout := uint64(time.Now().Unix()) > req.ProofRequestTime+l.DriverSetup.Cfg.MaxProofTime // ZTODO: Talk to Succinct about logic of different statuses - if timeout { + if timeout || status == "PROOF_UNCLAIMED" { // update status in db to "FAILED" l.Log.Info("proof timed out", "id", req.ProverRequestID) err = l.db.UpdateProofStatus(req.ID, "FAILED") @@ -84,15 +84,10 @@ func (l *L2OutputSubmitter) RequestQueuedProofs(ctx context.Context) error { if err != nil { return fmt.Errorf("failed to get unrequested proofs: %w", err) } - - currentRequestedProofs, err := l.db.CountRequestedProofs() - if err != nil { - return fmt.Errorf("failed to count requested proofs: %w", err) - } - if currentRequestedProofs >= int(l.Cfg.MaxConcurrentProofRequests) { - l.Log.Info("max concurrent proof requests reached, waiting for next cycle") + if nextProofToRequest == nil { return nil } + if nextProofToRequest.Type == proofrequest.TypeAGG { blockNumber, blockHash, err := l.checkpointBlockHash(ctx) if err != nil { @@ -100,8 +95,18 @@ func (l *L2OutputSubmitter) RequestQueuedProofs(ctx context.Context) error { return err } l.db.AddL1BlockInfoToAggRequest(nextProofToRequest.StartBlock, nextProofToRequest.EndBlock, blockNumber, blockHash.Hex()) + } else { + currentRequestedProofs, err := l.db.CountRequestedProofs() + if err != nil { + return fmt.Errorf("failed to count requested proofs: %w", err) + } + if currentRequestedProofs >= int(l.Cfg.MaxConcurrentProofRequests) { + l.Log.Info("max concurrent proof requests reached, waiting for next cycle") + return nil + } } go func(p ent.ProofRequest) { + l.Log.Info("requesting proof from server", "proof", p) err = l.db.UpdateProofStatus(nextProofToRequest.ID, "REQ") if err != nil { l.Log.Error("failed to update proof status", "err", err) diff --git a/op-proposer/proposer/span_batches.go b/op-proposer/proposer/span_batches.go index f6953f7d7d..439d1cee42 100644 --- a/op-proposer/proposer/span_batches.go +++ b/op-proposer/proposer/span_batches.go @@ -66,7 +66,7 @@ func (l *L2OutputSubmitter) DeriveNewSpanBatches(ctx context.Context) error { tmpStart := nextBlock for { - maxEnd := tmpStart + l.DriverSetup.Cfg.MaxBlockRangePerSpanProof + maxEnd := tmpStart + l.DriverSetup.Cfg.MaxBlockRangePerSpanProof - 1 tmpEnd := uint64(math.Min(float64(maxEnd), float64(end))) // insert the new span into the db to be requested in the future diff --git a/packages/contracts-bedrock/lib/sp1-contracts b/packages/contracts-bedrock/lib/sp1-contracts new file mode 160000 index 0000000000..e98c8cd404 --- /dev/null +++ b/packages/contracts-bedrock/lib/sp1-contracts @@ -0,0 +1 @@ +Subproject commit e98c8cd404128046318c12ab4750e5e802a17bd3 diff --git a/proofs.db b/proofs.db index 61a91fb1431c0de2e701e4a439d3f5dd11dc59cb..8638b82bffcb96131863d5a3220b3449178422e8 100644 GIT binary pat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