Skip to content

Commit 70cd8e1

Browse files
authored
[vms/platformvm] Declare maxPageSize in service.go (#2881)
1 parent 42aefda commit 70cd8e1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

vms/platformvm/service.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
"github.com/ava-labs/avalanchego/vms/platformvm/state"
3737
"github.com/ava-labs/avalanchego/vms/platformvm/status"
3838
"github.com/ava-labs/avalanchego/vms/platformvm/txs"
39-
"github.com/ava-labs/avalanchego/vms/platformvm/txs/builder"
4039
"github.com/ava-labs/avalanchego/vms/secp256k1fx"
4140

4241
avajson "github.com/ava-labs/avalanchego/utils/json"
@@ -51,6 +50,9 @@ const (
5150
// Max number of addresses that can be passed in as argument to GetStake
5251
maxGetStakeAddrs = 256
5352

53+
// Max number of items allowed in a page
54+
maxPageSize = 1024
55+
5456
// Note: Staker attributes cache should be large enough so that no evictions
5557
// happen when the API loops through all stakers.
5658
stakerAttributesCacheSize = 100_000
@@ -365,8 +367,8 @@ func (s *Service) GetUTXOs(_ *http.Request, args *api.GetUTXOsArgs, response *ap
365367
endUTXOID ids.ID
366368
)
367369
limit := int(args.Limit)
368-
if limit <= 0 || builder.MaxPageSize < limit {
369-
limit = builder.MaxPageSize
370+
if limit <= 0 || maxPageSize < limit {
371+
limit = maxPageSize
370372
}
371373

372374
s.vm.ctx.Lock.Lock()

0 commit comments

Comments
 (0)