Repository navigation
Feat(newstate): migrate to new state on pruned db - #4210
NazariiDenha wants to merge 3 commits into
Conversation
247a8de to
9e95695
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4210 +/- ##
==========================================
- Coverage 81.18% 81.13% -0.05%
==========================================
Files 478 478
Lines 35585 35634 +49
==========================================
+ Hits 28888 28912 +24
- Misses 6691 6716 +25
Partials 6 6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9e95695 to
3e43e0c
Compare
Title(Describe updated until commit 4144169)Feat(newstate): migrate to new state on pruned db PR TypeEnhancement Description
|
| Relevant files | |||||||||
|---|---|---|---|---|---|---|---|---|---|
| Documentation | |||||||||
| Tests | 4 files
| ||||||||
| Enhancement | 4 files
| ||||||||
| Configuration changes | 1 files
|
| // pre-value, or the head leaf when no history is left. Unpruned, it is always zero. | ||
| // Deprecated rows are wiped with the whole bucket once the phase completes. | ||
| // | ||
| //nolint:gocyclo,funlen // one lockstep walk over the history and the head trie |
There was a problem hiding this comment.
Could we avoid the nolint and refactor it instead?
There was a problem hiding this comment.
I tried moving things outside the function, but it looks like the only thing that can be moved cleanly is writeLeavesBefore. Even with writeLeavesBefore outside gocyclo complexity is still 21 with target 15
| // cancellations and a restart after a crash, and checks every read from the | ||
| // floor up against the deprecated state before pruning. | ||
| // retained == blocks means no pruning. | ||
| func TestMigratePrunedHistory(t *testing.T) { |
There was a problem hiding this comment.
These three scenarios should be subtests rather than blocks separated by assert messages, so a failure names the scenario and each can be run on its own.
deb1be6 to
4144169
Compare

PR Type
Enhancement, Tests
Description
Remove mutual exclusivity between
--prune-modeand--new-stateflagsUpdate new state migrator to calculate and respect a history
floor(the oldest retained block)Refactor
nonceIngestorandstorageIngestorto anchor pruned historical data at the computed floorAdd comprehensive test suites verifying pruned history migration, including crash and interruption recovery
File Walkthrough
2 files
Remove CLI flag restriction for --new-state and --prune-modeRemove node init validation conflicting new state with prune mode4 files
Add test utilities for generating and verifying pruned chainsUpdate phase tests to pass the new floor argumentAdd tests for history pruning, crashes, and migration resilienceRemove unit tests enforcing new state and prune mode mutualexclusivity3 files
Calculate history floor and pass it to ingestorsAdapt nonce ingestor to write floor values when history is prunedAdapt storage ingestor to process floor logic and headless tries1 files
Update documentation to allow combining prune-mode and new-state