mx-chain-go
mx-chain-go copied to clipboard
Sync missing snapshot nodes
Description of the reasoning behind the pull request (what feature was missing / how the problem was manifesting itself / what was the motive behind the refactoring)
- If a trie node is missing, the node will not be able to progress. In order to fix this, when the state snapshot process is triggered, also start a sync process that will sync missing trie nodes from the network.
Proposed Changes
- Add a trie syncer to accountsDB. The syncer will be triggered if there are any missing nodes during the snapshot process.
Testing procedure
- Check that everything works as before
- Do not save some trie nodes to storage, and check that they will be synced during snapshot
Codecov Report
Base: 73.41% // Head: 73.30% // Decreases project coverage by -0.11% :warning:
Coverage data is based on head (
3796daf) compared to base (57fe4d9). Patch coverage: 50.00% of modified lines in pull request are covered.
Additional details and impacted files
@@ Coverage Diff @@
## rc/v1.4.0 #4367 +/- ##
=============================================
- Coverage 73.41% 73.30% -0.12%
=============================================
Files 655 659 +4
Lines 85340 85518 +178
=============================================
+ Hits 62655 62686 +31
- Misses 17841 17979 +138
- Partials 4844 4853 +9
| Impacted Files | Coverage Δ | |
|---|---|---|
| factory/consensusComponents.go | 0.00% <0.00%> (ø) |
|
| node/nodeRunner.go | 0.00% <0.00%> (ø) |
|
| process/txsimulator/wrappedAccountsDB.go | 65.38% <0.00%> (-5.45%) |
:arrow_down: |
| state/accountsDBApi.go | 91.45% <0.00%> (-3.24%) |
:arrow_down: |
| state/accountsDBApiWithHistory.go | 89.21% <0.00%> (-3.65%) |
:arrow_down: |
| state/errors.go | 50.00% <ø> (ø) |
|
| trie/keyBuilder/disabledKeyBuilder.go | 0.00% <0.00%> (ø) |
|
| trie/trieStorageManagerWithoutCheckpoints.go | 83.33% <ø> (ø) |
|
| trie/extensionNode.go | 70.46% <30.76%> (-0.93%) |
:arrow_down: |
| trie/branchNode.go | 78.26% <50.00%> (-0.55%) |
:arrow_down: |
| ... and 23 more |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.