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

chore(proposer): span -> range #149

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 3 additions & 3 deletions proposer/op/proposer/db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func (db *ProofDB) GetNextUnrequestedProof() (*ent.ProofRequest, error) {
spanProof, err := db.client.ProofRequest.Query().
Where(
proofrequest.StatusEQ(proofrequest.StatusUNREQ),
proofrequest.TypeEQ(proofrequest.TypeSPAN),
proofrequest.TypeEQ(proofrequest.TypeRANGE),
).
Order(ent.Asc(proofrequest.FieldStartBlock)).
First(context.Background())
Expand Down Expand Up @@ -402,7 +402,7 @@ func (db *ProofDB) GetMaxContiguousSpanProofRange(start uint64) (uint64, error)

query := client.ProofRequest.Query().
Where(
proofrequest.TypeEQ(proofrequest.TypeSPAN),
proofrequest.TypeEQ(proofrequest.TypeRANGE),
proofrequest.StatusEQ(proofrequest.StatusCOMPLETE),
proofrequest.StartBlockGTE(start),
).
Expand Down Expand Up @@ -435,7 +435,7 @@ func (db *ProofDB) GetConsecutiveSpanProofs(start, end uint64) ([][]byte, error)
// Query the DB for the span proofs that cover the range [start, end].
query := client.ProofRequest.Query().
Where(
proofrequest.TypeEQ(proofrequest.TypeSPAN),
proofrequest.TypeEQ(proofrequest.TypeRANGE),
proofrequest.StatusEQ(proofrequest.StatusCOMPLETE),
proofrequest.StartBlockGTE(start),
proofrequest.EndBlockLTE(end),
Expand Down
2 changes: 1 addition & 1 deletion proposer/op/proposer/db/ent/migrate/schema.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions proposer/op/proposer/db/ent/proofrequest/proofrequest.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion proposer/op/proposer/db/ent/schema/proofrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type ProofRequest struct {
// Fields of the ProofRequest.
func (ProofRequest) Fields() []ent.Field {
return []ent.Field{
field.Enum("type").Values("SPAN", "AGG"),
field.Enum("type").Values("RANGE", "AGG"),
field.Uint64("start_block"),
field.Uint64("end_block"),
field.Enum("status").Values("UNREQ", "WITNESSGEN", "PROVING", "FAILED", "COMPLETE"),
Expand Down
2 changes: 1 addition & 1 deletion proposer/op/proposer/prove.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ func (l *L2OutputSubmitter) RequestOPSuccinctProof(p ent.ProofRequest) error {
if err != nil {
return fmt.Errorf("failed to request AGG proof: %w", err)
}
} else if p.Type == proofrequest.TypeSPAN {
} else if p.Type == proofrequest.TypeRANGE {
proofId, err = l.RequestSpanProof(p.StartBlock, p.EndBlock)
if err != nil {
return fmt.Errorf("failed to request SPAN proof: %w", err)
Expand Down
2 changes: 1 addition & 1 deletion proposer/op/proposer/span_batches.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (l *L2OutputSubmitter) DeriveNewSpanBatches(ctx context.Context) error {
spans := l.CreateSpans(newL2StartBlock, newL2EndBlock)
// Add each span to the DB. If there are no spans, we will not create any proofs.
for _, span := range spans {
err := l.db.NewEntry(proofrequest.TypeSPAN, span.Start, span.End)
err := l.db.NewEntry(proofrequest.TypeRANGE, span.Start, span.End)
l.Log.Info("New range proof request.", "start", span.Start, "end", span.End)
if err != nil {
l.Log.Error("failed to add span to db", "err", err)
Expand Down
Loading