shardeum / shardus-core

Other
10 stars 2 forks source link

Limit the number of accounts requested #256

Closed jintukumardas closed 1 week ago

jintukumardas commented 3 weeks ago

Linear: https://linear.app/shm/issue/PRI-40 Summary: Limit the number of accounts requested by get_account_data_by_lists to 200 (default)

github-actions[bot] commented 3 weeks ago

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Key issues to review

Hardcoded Value
The maximum number of accounts (`MAX_ACCOUNTS`) is retrieved from `this.config.stateManager.accountBucketSize` but defaults to 200 if not set. Consider making this default value configurable or clearly documented to avoid magic numbers in the code. Error Handling
The error handling for exceeding `MAX_ACCOUNTS` does not specify the maximum allowed in the error message. It might be helpful for debugging and user feedback to include the maximum number allowed in the error message.