Fix removing headers at bootstrap#7798
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## feat/supernova-async-exec #7798 +/- ##
=============================================================
- Coverage 77.54% 77.53% -0.01%
=============================================================
Files 882 882
Lines 123683 123690 +7
=============================================================
+ Hits 95908 95909 +1
- Misses 21429 21436 +7
+ Partials 6346 6345 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses storage bootstrap behavior by cleaning up header-related storage entries for rounds above the configured BootstrapRoundIndex, preventing stale data from persisting across restarts.
Changes:
- Update
loadBlocks()to immediately remove storage + notarized storage for bootstrap rounds aboveBootstrapRoundIndex. - Add shard bootstrap tests validating cleanup behavior for
BootstrapRoundIndex > 0andBootstrapRoundIndex == 0. - Add equivalent metachain bootstrap tests validating the same cleanup behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| process/sync/storageBootstrap/baseStorageBootstrapper.go | Cleans up storage entries for rounds above BootstrapRoundIndex during bootstrap iteration (not only after successful bootstrap). |
| process/sync/storageBootstrap/shardStorageBootstrapper_test.go | Adds tests asserting round cleanup behavior during shard storage bootstrap. |
| process/sync/storageBootstrap/metaStorageBootstrapper_test.go | Adds tests asserting round cleanup behavior during metachain storage bootstrap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| assert.True(t, wasCalledBlockchainSetHeader) | ||
| }) | ||
|
|
||
| t.Run("bootstrapRoundIndex zero should cleaned all", func(t *testing.T) { |
There was a problem hiding this comment.
This subtest title has a grammatical error: "should cleaned all" -> "should clean all" (or similar).
| t.Run("bootstrapRoundIndex zero should cleaned all", func(t *testing.T) { | |
| t.Run("bootstrapRoundIndex zero should clean all", func(t *testing.T) { |
Reasoning behind the pull request
Proposed changes
Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
featbranch created?featbranch merging, do all satellite projects have a proper tag insidego.mod?