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

Statically-set maximum event cursor overflows #325

Merged
merged 1 commit into from
Nov 12, 2024
Merged
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 cmd/soroban-rpc/internal/db/cursor.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ var (
// MaxCursor is the largest possible cursor
//nolint:gochecknoglobals
MaxCursor = Cursor{
Ledger: math.MaxUint32,
Tx: math.MaxUint32,
Op: math.MaxUint32,
Ledger: math.MaxInt32,
Tx: math.MaxInt32,
Op: math.MaxInt32,
Event: math.MaxUint32,
}
)
2 changes: 0 additions & 2 deletions cmd/soroban-rpc/internal/methods/get_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,8 @@ func (h eventsRPCHandler) getEvents(ctx context.Context, request GetEventsReques
}
}
endLedger := start.Ledger + LedgerScanLimit

// endLedger should not exceed ledger retention window
endLedger = min(ledgerRange.LastLedger.Sequence+1, endLedger)

if request.EndLedger != 0 {
endLedger = min(request.EndLedger, endLedger)
}
Expand Down
Loading