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

checkpoint: list api increase max limit #1154

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
6 changes: 4 additions & 2 deletions checkpoint/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
hmTypes "github.com/maticnetwork/heimdall/types"
)

const maxCheckpointListLimit = 10_000 // a checkpoint is ~100 bytes => can fit 10k in 1 MB response

var (
DefaultValue = []byte{0x01} // Value to store in CacheCheckpoint and CacheCheckpointACK & ValidatorSetChange Flag

Expand Down Expand Up @@ -145,8 +147,8 @@
var checkpoints []hmTypes.Checkpoint

// have max limit
if limit > 20 {
limit = 20
if limit > maxCheckpointListLimit {
limit = maxCheckpointListLimit

Check warning on line 151 in checkpoint/keeper.go

View check run for this annotation

Codecov / codecov/patch

checkpoint/keeper.go#L151

Added line #L151 was not covered by tests
}

// get paginated iterator
Expand Down
Loading