Skip to content

fix(store): batch DB transactions in copy_state_to_cold#15624

Open
Wiezzel wants to merge 1 commit intomasterfrom
wiezzel/copy-state-batch
Open

fix(store): batch DB transactions in copy_state_to_cold#15624
Wiezzel wants to merge 1 commit intomasterfrom
wiezzel/copy-state-batch

Conversation

@Wiezzel
Copy link
Copy Markdown
Contributor

@Wiezzel Wiezzel commented Apr 23, 2026

This functions copies only genesis state, but on forknet this contains the full mainnet state, which leads to gigabytes of RAM allocations and archival nodes getting eventually OOM-killed.

The fix re-introduces copying in 500 MB batches, which was removed by #15484

This functions copies only genesis state, but on forknet this contains
the full mainnet state, which leads to gigabytes of RAM allocations and
archival nodes getting eventually OOM-killed.

The fix re-introduces copying in 500 MB batches, which was removed by #15484
@Wiezzel Wiezzel requested review from shreyan-gupta and wacban April 23, 2026 08:36
@Wiezzel Wiezzel requested a review from a team as a code owner April 23, 2026 08:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 23, 2026

Codecov Report

❌ Patch coverage is 58.82353% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.33%. Comparing base (beebaca) to head (7f074ca).

Files with missing lines Patch % Lines
core/store/src/archive/cold_storage.rs 58.82% 4 Missing and 3 partials ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #15624   +/-   ##
=======================================
  Coverage   69.32%   69.33%           
=======================================
  Files         942      942           
  Lines      213123   213134   +11     
  Branches   213123   213134   +11     
=======================================
+ Hits       147754   147772   +18     
+ Misses      59498    59480   -18     
- Partials     5871     5882   +11     
Flag Coverage Δ
pytests-nightly 1.14% <0.00%> (-0.01%) ⬇️
unittests 68.73% <58.82%> (+<0.01%) ⬆️
unittests-nightly 68.90% <58.82%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

Copy link
Copy Markdown
Contributor

@wacban wacban left a comment

Choose a reason for hiding this comment

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

LGTM

Is it covered by any tests? Do those tests have big enough size to actually exercise the batching logic?

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.

2 participants