Improving progress log of snap sync / state sync.
Closes #4552 #4670 #4621
Changes:
- Added 'Phase 1 of 2' for snap state ranages and 'Phase 2 of 2' for state sync to better describe process
- Adding bytes synced during snap state ranges to state sync, so state sync doesn't start from 0% when snap sync is used
- Added elapsed time for snap state ranges
Types of changes
What types of changes does your code introduce?
Put an x in the boxes that apply
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation Update
- [ ] Code style update (formatting, renaming)
- [ ] Refactoring (no functional changes, no api changes)
- [ ] Build related changes
- [x] Other (please describe): logging
Testing
Requires testing
- [x] Yes
- [ ] No
In case you checked yes, did you write tests??
- [ ] Yes
- [x] No
Latest excerpt from mainnet sync: 2023-02-28 19:23:46.2534|INFO|102|SNAP - progress of State Ranges (Phase 1 of 2): 00.05:16:32 | 99.61% [********* ] | SavedToDb: 111843.00 MB 2023-02-28 19:23:47.6577|INFO|111|SNAP - progress of State Ranges (Phase 1 of 2): 00.05:16:33 | 99.61% [********* ] | SavedToDb: 111852.00 MB 2023-02-28 19:27:11.9575|INFO|12|SNAP - progress of State Ranges (Phase 1 of 2): 00.05:19:57 | 99.61% [********* ] | SavedToDb: 113414.00 MB 2023-02-28 19:27:13.2128|INFO|91|SNAP - progress of State Ranges (Phase 1 of 2): 00.05:19:59 | 99.61% [********* ] | SavedToDb: 113418.00 MB 2023-02-28 19:27:14.0166|INFO|90|State Sync (Phase 2 of 2) - already synced data: 118935 MB 2023-02-28 19:27:17.1247|INFO|95|State Sync (Phase 2 of 2) 00.00:00:01 | ~99.00 % | 113721.30MB / ~114870.00MB | branches: 0.00 % | kB/s: 75297783 | accounts 0 | nodes 0 | diagnostics: 0.0.00ms 2023-02-28 19:27:18.1334|INFO|107|State Sync (Phase 2 of 2) 00.00:00:02 | ~99.00 % | 113721.31MB / ~114870.00MB | branches: 0.00 % | kB/s: 9 | accounts 9 | nodes 31 | diagnostics: 33.2353.91ms 2023-02-28 19:27:19.1935|INFO|75|State Sync (Phase 2 of 2) 00.00:00:03 | ~99.00 % | 113721.33MB / ~114870.00MB | branches: 0.00 % | kB/s: 19 | accounts 25 | nodes 98 | diagnostics: 30.4544.38ms 2023-02-28 19:27:20.4164|INFO|101|State Sync (Phase 2 of 2) 00.00:00:04 | ~99.00 % | 113721.34MB / ~114870.00MB | branches: 0.00 % | kB/s: 12 | accounts 39 | nodes 149 | diagnostics: 34.6008.40ms 2023-02-28 19:39:34.8345|INFO|95|State Sync (Phase 2 of 2) 00.00:11:44 | ~99.17 % | 113921.05MB / ~114870.00MB | branches: 18.36 % | kB/s: 1529 | accounts 67267 | nodes 737910 | diagnostics: 11.6055639.31ms 2023-02-28 19:39:44.3401|INFO|125|State Sync (Phase 2 of 2) 00.00:11:53 | ~99.18 % | 113928.96MB / ~114870.00MB | branches: 98.05 % | kB/s: 17 | accounts 68018 | nodes 763941 | diagnostics: 3.6443119.21ms 2023-02-28 19:39:44.5808|INFO|102|Saving root 0xc6d9d1eca591a6fb02cecd7321c6a211de7b524e38fe2d0aedb5226fd6430bf6 of 16728750 2023-02-28 19:39:44.5845|INFO|9|StateNode sync: falling asleep - root saved
Seems you have some merge conflict.
So maybe we should scrap everything else and just set it to 99% after snap sync phase 1? xD
@damian-orzechowski close this?
Very out of date