Skip to content

Conversation

@pratikspatil024
Copy link
Member

Description

Please provide a detailed description of what was done in this PR

Changes

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)
  • Changes only for a subset of nodes

Breaking changes

Please complete this section if any breaking changes have been made, otherwise delete it

Nodes audience

In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)

Checklist

  • I have added at least 2 reviewer or the whole pos-v1 team
  • I have added sufficient documentation in code
  • I will be resolving comments - if any - by pushing each fix in a separate commit and linking the commit hash in the comment reply
  • Created a task in Jira and informed the team for implementation in Erigon client (if applicable)
  • Includes RPC methods changes, and the Notion documentation has been updated

Cross repository changes

  • This PR requires changes to heimdall
    • In case link the PR here:
  • This PR requires changes to matic-cli
    • In case link the PR here:

Testing

  • I have added unit tests
  • I have added tests to CI
  • I have tested this code manually on local environment
  • I have tested this code manually on remote devnet using express-cli
  • I have tested this code manually on amoy
  • I have created new e2e tests into express-cli

Manual tests

Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it

Additional comments

Please post additional comments in this section if you have them, otherwise delete it

@codecov
Copy link

codecov bot commented Jan 30, 2026

Codecov Report

❌ Patch coverage is 89.41176% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.57%. Comparing base (0caee33) to head (72cb861).
⚠️ Report is 3 commits behind head on develop.

Files with missing lines Patch % Lines
triedb/pathdb/biased_fastcache.go 65.38% 8 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (89.41%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #2029   +/-   ##
========================================
  Coverage    49.57%   49.57%           
========================================
  Files          874      874           
  Lines       150499   150595   +96     
========================================
+ Hits         74605    74653   +48     
- Misses       70856    70901   +45     
- Partials      5038     5041    +3     
Files with missing lines Coverage Δ
core/blockchain.go 62.11% <100.00%> (+0.01%) ⬆️
eth/backend.go 52.56% <100.00%> (+0.06%) ⬆️
eth/ethconfig/config.go 37.50% <ø> (ø)
internal/cli/server/config.go 63.18% <100.00%> (+1.49%) ⬆️
internal/cli/server/flags.go 100.00% <100.00%> (ø)
triedb/pathdb/config.go 78.78% <100.00%> (+3.78%) ⬆️
triedb/pathdb/disklayer.go 77.27% <100.00%> (ø)
triedb/pathdb/biased_fastcache.go 85.52% <65.38%> (-2.94%) ⬇️

... and 20 files with indirect coverage changes

Files with missing lines Coverage Δ
core/blockchain.go 62.11% <100.00%> (+0.01%) ⬆️
eth/backend.go 52.56% <100.00%> (+0.06%) ⬆️
eth/ethconfig/config.go 37.50% <ø> (ø)
internal/cli/server/config.go 63.18% <100.00%> (+1.49%) ⬆️
internal/cli/server/flags.go 100.00% <100.00%> (ø)
triedb/pathdb/config.go 78.78% <100.00%> (+3.78%) ⬆️
triedb/pathdb/disklayer.go 77.27% <100.00%> (ø)
triedb/pathdb/biased_fastcache.go 85.52% <65.38%> (-2.94%) ⬇️

... and 20 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 2, 2026

@pratikspatil024 pratikspatil024 changed the title [WIP] added rate limiting to address biased trie cache preloading added rate limiting to address biased trie cache preloading Feb 2, 2026
@pratikspatil024 pratikspatil024 requested a review from a team February 2, 2026 09:51
Copy link
Contributor

@cffls cffls left a comment

Choose a reason for hiding this comment

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

Looks good overall! What long does it take to preload mainnet with the default throttling setting?

// Apply rate limiting after reading, based on actual bytes read
if limiter != nil {
if err := limiter.WaitN(c.ctx, len(nodeData)); err != nil {
log.Info("Preload interrupted during rate limit wait",
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this line flood the log?

"max depth", maxDepthReached,
"size", common.StorageSize(totalBytesLoaded).String(),
"elapsed", time.Since(startTime))
return
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why the function returns here. If we return here it means the cache won't be warmed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants