diff options
author | chris erway <chris.erway@algorand.com> | 2022-02-25 16:01:28 -0500 |
---|---|---|
committer | chris erway <chris.erway@algorand.com> | 2022-02-25 16:01:28 -0500 |
commit | aa4a0509b4a57d8595077841afbbd9c21abf7cc4 (patch) | |
tree | 7dbf2430a7a96c835924b332ceb395272c6b1d0a | |
parent | 6278dc182def3950d79313963fb0efa6ac1ee517 (diff) |
rename MaxAccountsAPIResults=>MaxAPIResourcesPerAccount
-rw-r--r-- | config/localTemplate.go | 7 | ||||
-rw-r--r-- | config/local_defaults.go | 2 | ||||
-rw-r--r-- | daemon/algod/api/server/v2/handlers.go | 2 | ||||
-rw-r--r-- | daemon/algod/api/server/v2/test/handlers_resources_test.go | 2 | ||||
-rw-r--r-- | installer/config.json.example | 2 | ||||
-rw-r--r-- | test/testdata/configs/config-v21.json | 2 |
6 files changed, 9 insertions, 8 deletions
diff --git a/config/localTemplate.go b/config/localTemplate.go index 72f15fb69..924365044 100644 --- a/config/localTemplate.go +++ b/config/localTemplate.go @@ -431,9 +431,10 @@ type Local struct { // (hard limit) connections already. RestConnectionsHardLimit uint64 `version[20]:"2048"` - // MaxAccountsAPIResults limits the total number of assets and applications per account that will be - // provided by the REST API before returning a 400 Bad Request. Set zero for no limit. - MaxAccountsAPIResults uint64 `version[21]:"1000000"` + // MaxAPIResourcesPerAccount sets the maximum total number of resources (created assets, created apps, + // asset holdings, and application local state) per account that will be allowed in AccountInformation + // REST API responses before returning a 400 Bad Request. Set zero for no limit. + MaxAPIResourcesPerAccount uint64 `version[21]:"1000000"` } // DNSBootstrapArray returns an array of one or more DNS Bootstrap identifiers diff --git a/config/local_defaults.go b/config/local_defaults.go index 75eed2798..361e342c3 100644 --- a/config/local_defaults.go +++ b/config/local_defaults.go @@ -80,7 +80,7 @@ var defaultLocal = Local{ LogArchiveMaxAge: "", LogArchiveName: "node.archive.log", LogSizeLimit: 1073741824, - MaxAccountsAPIResults: 1000000, + MaxAPIResourcesPerAccount: 1000000, MaxCatchpointDownloadDuration: 7200000000000, MaxConnectionsPerIP: 30, MinCatchpointFileDownloadBytesPerSecond: 20480, diff --git a/daemon/algod/api/server/v2/handlers.go b/daemon/algod/api/server/v2/handlers.go index 17963f46f..cff779ce7 100644 --- a/daemon/algod/api/server/v2/handlers.go +++ b/daemon/algod/api/server/v2/handlers.go @@ -296,7 +296,7 @@ func (v2 *Handlers) AccountInformation(ctx echo.Context, address string, params myLedger := v2.Node.LedgerForAPI() // count total # of resources, if max limit is set - if maxResults := v2.Node.Config().MaxAccountsAPIResults; maxResults != 0 { + if maxResults := v2.Node.Config().MaxAPIResourcesPerAccount; maxResults != 0 { record, _, _, err := myLedger.LookupAccount(myLedger.Latest(), addr) if err != nil { return internalError(ctx, err, errFailedLookingUpLedger, v2.Log) diff --git a/daemon/algod/api/server/v2/test/handlers_resources_test.go b/daemon/algod/api/server/v2/test/handlers_resources_test.go index 44d7f2403..c8e0134f5 100644 --- a/daemon/algod/api/server/v2/test/handlers_resources_test.go +++ b/daemon/algod/api/server/v2/test/handlers_resources_test.go @@ -119,7 +119,7 @@ func setupTestForLargeResources(t *testing.T, acctSize, maxResults int) (handler ml.accounts[fakeAddr] = randomAccountWithResources(acctSize) mockNode := makeMockNode(&ml, t.Name(), nil) - mockNode.config.MaxAccountsAPIResults = uint64(maxResults) + mockNode.config.MaxAPIResourcesPerAccount = uint64(maxResults) dummyShutdownChan := make(chan struct{}) handlers = v2.Handlers{ Node: mockNode, diff --git a/installer/config.json.example b/installer/config.json.example index a84303096..e3bdd41f5 100644 --- a/installer/config.json.example +++ b/installer/config.json.example @@ -59,7 +59,7 @@ "LogArchiveMaxAge": "", "LogArchiveName": "node.archive.log", "LogSizeLimit": 1073741824, - "MaxAccountsAPIResults": 1000000, + "MaxAPIResourcesPerAccount": 1000000, "MaxCatchpointDownloadDuration": 7200000000000, "MaxConnectionsPerIP": 30, "MinCatchpointFileDownloadBytesPerSecond": 20480, diff --git a/test/testdata/configs/config-v21.json b/test/testdata/configs/config-v21.json index a84303096..e3bdd41f5 100644 --- a/test/testdata/configs/config-v21.json +++ b/test/testdata/configs/config-v21.json @@ -59,7 +59,7 @@ "LogArchiveMaxAge": "", "LogArchiveName": "node.archive.log", "LogSizeLimit": 1073741824, - "MaxAccountsAPIResults": 1000000, + "MaxAPIResourcesPerAccount": 1000000, "MaxCatchpointDownloadDuration": 7200000000000, "MaxConnectionsPerIP": 30, "MinCatchpointFileDownloadBytesPerSecond": 20480, |