fix: migration crash on min-GC RPC nodes#15975
Merged
Trisfald merged 1 commit intoJun 25, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 2.13-release #15975 +/- ##
===============================================
Coverage ? 69.69%
===============================================
Files ? 946
Lines ? 204333
Branches ? 204333
===============================================
Hits ? 142414
Misses ? 57161
Partials ? 4758
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
shreyan-gupta
approved these changes
Jun 25, 2026
jancionear
pushed a commit
to jancionear/nearcore
that referenced
this pull request
Jun 25, 2026
**Same as near#15975** Upgrading to 2.13 (DB 48->49) crashed at startup on nodes with `gc_num_epochs_to_keep = 3` with `DB Not Found Error: epoch block: <hash>`. Cause: the migration regenerated the epoch sync proof via `find_target_epoch_to_produce_proof_for`, which anchors at the final head and reads BlockInfo ~4 epochs back, which gc=3 has already collected. Fix: build the proof anchored at the current epoch (target head-2), the same way continuous epoch sync does at a boundary. If the node restarted mid-epoch, where even head-2's inputs are collected, fall back to the freshest fully retained epoch (head-1).
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Upgrading to 2.13 (DB 48->49) crashed at startup on nodes with
gc_num_epochs_to_keep = 3withDB Not Found Error: epoch block: <hash>.Cause: the migration regenerated the epoch sync proof via
find_target_epoch_to_produce_proof_for, which anchors at the final head and reads BlockInfo ~4 epochs back, which gc=3 has already collected.Fix: build the proof anchored at the current epoch (target head-2), the same way continuous epoch sync does at a boundary. If the node restarted mid-epoch, where even head-2's inputs are collected, fall back to the freshest fully retained epoch (head-1).