@@ -42,25 +42,30 @@ async def _run(self) -> None:
42
42
# See https://github.com/ethereum/py-evm/issues/654 for more details
43
43
if head .timestamp < time .time () - FAST_SYNC_CUTOFF :
44
44
# Fast-sync chain data.
45
- self .logger .info ("Starting fast-sync; current head: #%d " , head . block_number )
45
+ self .logger .info ("Starting fast-sync; current head: %s " , head )
46
46
fast_syncer = FastChainSyncer (
47
47
self .chain ,
48
48
self .chaindb ,
49
49
self .peer_pool ,
50
50
self .cancel_token ,
51
51
)
52
52
await fast_syncer .run ()
53
+
54
+ previous_head = head
55
+ head = await self .wait (self .chaindb .coro_get_canonical_head ())
56
+ self .logger .info (
57
+ "Finished fast fast-sync; previous head: %s, current head: %s" , previous_head , head
58
+ )
53
59
# remove the reference so the memory can be reclaimed
54
60
del fast_syncer
55
61
56
62
if self .cancel_token .triggered :
57
63
return
58
64
59
65
# Ensure we have the state for our current head.
60
- head = await self .wait (self .chaindb .coro_get_canonical_head ())
61
66
if head .state_root != BLANK_ROOT_HASH and head .state_root not in self .base_db :
62
67
self .logger .info (
63
- "Missing state for current head (#%d) , downloading it" , head . block_number )
68
+ "Missing state for current head %s , downloading it" , head )
64
69
downloader = StateDownloader (
65
70
self .chaindb , self .base_db , head .state_root , self .peer_pool , self .cancel_token )
66
71
await downloader .run ()
@@ -71,7 +76,7 @@ async def _run(self) -> None:
71
76
return
72
77
73
78
# Now, loop forever, fetching missing blocks and applying them.
74
- self .logger .info ("Starting regular sync; current head: #%d " , head . block_number )
79
+ self .logger .info ("Starting regular sync; current head: %s " , head )
75
80
regular_syncer = RegularChainSyncer (
76
81
self .chain , self .chaindb , self .peer_pool , self .cancel_token )
77
82
await regular_syncer .run ()
0 commit comments