Skip to content

Commit

Permalink
Log full head repr rather than just blocknumber
Browse files Browse the repository at this point in the history
  • Loading branch information
cburgdorf committed Nov 16, 2018
1 parent aabbe9d commit 1f60fd8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions trinity/sync/common/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ async def next_header_batch(self) -> AsyncIterator[Tuple[BlockHeader, ...]]:
head.block_number - MAX_REORG_DEPTH
)
self.logger.debug(
"All %d headers redundant, head at #%d, fetching from #%d",
"All %d headers redundant, head at %s, fetching from #%d",
len(all_headers),
head.block_number,
head,
start_at,
)
continue
Expand Down
8 changes: 4 additions & 4 deletions trinity/sync/full/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,8 @@ async def _display_stats(self) -> None:
last_head = head

self.logger.info(
"Advanced by %d blocks in %0.1f seconds, new head: #%d",
block_num_change, timer.pop_elapsed(), head.block_number)
"Advanced by %d blocks in %0.1f seconds, new head: %s",
block_num_change, timer.pop_elapsed(), head)

async def _persist_ready_blocks(self) -> None:
"""
Expand Down Expand Up @@ -793,10 +793,10 @@ async def _import_ready_blocks(self) -> None:

head = await self.wait(self.db.coro_get_canonical_head())
self.logger.info(
"Synced chain segment with %d blocks in %.2f seconds, new head: #%d",
"Synced chain segment with %d blocks in %.2f seconds, new head: %s",
len(completed_headers),
timer.elapsed,
head.block_number,
head,
)

async def _import_blocks(self, headers: Tuple[BlockHeader, ...]) -> None:
Expand Down
4 changes: 2 additions & 2 deletions trinity/sync/light/chain.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async def _persist_headers(self) -> None:

head = await self.wait(self.db.coro_get_canonical_head())
self.logger.info(
"Imported %d headers in %0.2f seconds, new head: #%d",
len(headers), timer.elapsed, head.block_number)
"Imported %d headers in %0.2f seconds, new head: %s",
len(headers), timer.elapsed, head)

self.header_queue.complete(batch_id, headers)

0 comments on commit 1f60fd8

Please sign in to comment.