Skip to content

Commit

Permalink
bor: increase max limit for list span api (#1180)
Browse files Browse the repository at this point in the history
  • Loading branch information
shohamc1 authored Sep 5, 2024
1 parent b7d59fe commit ad9219f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bor/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import (
hmTypes "github.com/maticnetwork/heimdall/types"
)

const maxSpanListLimit = 150 // a span is ~6 KB => we can fit 150 spans in 1 MB response

var (
LastSpanIDKey = []byte{0x35} // Key to store last span start block
SpanPrefixKey = []byte{0x36} // prefix key to store span
Expand Down Expand Up @@ -153,8 +155,8 @@ func (k *Keeper) GetSpanList(ctx sdk.Context, page uint64, limit uint64) ([]hmTy
store := ctx.KVStore(k.storeKey)

// have max limit
if limit > 20 {
limit = 20
if limit > maxSpanListLimit {
limit = maxSpanListLimit
}

// get paginated iterator
Expand Down

0 comments on commit ad9219f

Please sign in to comment.