Skip to content

fix: added safe guard for rewardPercentiles size limit #3605

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

Merged

Conversation

quiet-node
Copy link
Contributor

Description:
This PR adds a guard to the feeHistory method to limit the size of the rewardPercentiles array. The maximum allowed size is set to 100 in a new constant, FEE_HISTORY_REWARD_PERCENTILES_MAX_SIZE, preventing excessive memory usage when the rewardPercentiles parameter contains a large number of entries.

Related issue(s):

Fixes #3527

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@quiet-node quiet-node added the enhancement New feature or request label Mar 27, 2025
@quiet-node quiet-node added this to the 0.68.0 milestone Mar 27, 2025
@quiet-node quiet-node self-assigned this Mar 27, 2025
@quiet-node quiet-node linked an issue Mar 27, 2025 that may be closed by this pull request
@quiet-node quiet-node marked this pull request as ready for review March 27, 2025 23:27
@quiet-node quiet-node requested review from a team as code owners March 27, 2025 23:27
@quiet-node quiet-node requested a review from simzzz March 27, 2025 23:27
Copy link

github-actions bot commented Mar 27, 2025

Test Results

 18 files   -   4  236 suites   - 56   32m 34s ⏱️ - 30m 0s
625 tests +  1  621 ✅ + 13  4 💤 ±0  0 ❌  - 12 
641 runs   - 316  637 ✅  - 297  4 💤  - 4  0 ❌  - 15 

Results for commit a105acb. ± Comparison against base commit 92adeae.

♻️ This comment has been updated with latest results.

@Ferparishuertas Ferparishuertas self-requested a review March 28, 2025 08:58
Copy link

@Ferparishuertas Ferparishuertas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Please review the requestId comment

@quiet-node quiet-node force-pushed the 3527-optimize-memory-usage-for-feehistory-reward-field branch from 3d3e252 to 716ad4c Compare March 28, 2025 14:14
@quiet-node quiet-node force-pushed the 3527-optimize-memory-usage-for-feehistory-reward-field branch from 716ad4c to a105acb Compare March 28, 2025 16:22
@quiet-node quiet-node merged commit 28ea22f into main Mar 30, 2025
38 of 39 checks passed
@quiet-node quiet-node deleted the 3527-optimize-memory-usage-for-feehistory-reward-field branch March 30, 2025 03:16
@acuarica acuarica modified the milestones: 0.68.0, 0.67.0 Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize memory usage for feeHistory reward field
4 participants