From d1309b725e2714942808d7a1711cbe0682e6abe7 Mon Sep 17 00:00:00 2001 From: Alexxxxxx <118710506+alexgao001@users.noreply.github.com> Date: Mon, 18 Sep 2023 16:14:33 +0800 Subject: [PATCH 1/2] restrict pagination limit (#315) --- types/query/filtered_pagination.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/query/filtered_pagination.go b/types/query/filtered_pagination.go index 50c85ac49a..5a85dd3ae1 100644 --- a/types/query/filtered_pagination.go +++ b/types/query/filtered_pagination.go @@ -151,7 +151,7 @@ func GenericFilteredPaginate[T codec.ProtoMarshaler, F codec.ProtoMarshaler]( return results, nil, fmt.Errorf("invalid request, either offset or key is expected, got both") } - if limit == 0 { + if limit == 0 || limit > DefaultLimit { limit = DefaultLimit // count total results when the limit is zero/not supplied From e02e6c03ba90691c1f6980ecc954cf2facf728c4 Mon Sep 17 00:00:00 2001 From: randyahx <62416962+randyahx@users.noreply.github.com> Date: Wed, 20 Sep 2023 20:37:04 +0800 Subject: [PATCH 2/2] release: draft release for v0.2.6 alpha.2 (#319) * Update CHANGELOG.md * Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ae54078b6..26cd8f5803 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## v0.2.6 +This release caps the pagination limit for queries at 100 records if it exceeds the default pagination limit. + +* [#315](https://github.com/bnb-chain/greenfield-cosmos-sdk/pull/315) fix: restrict pagination limit + ## v0.2.6-alpha.1 This release includes 1 new feature.