chore: improve tree traces (#2781)

Co-authored-by: Georgios Konstantopoulos <me@gakonst.com>
Co-authored-by: Roman Krasiuk <rokrassyuk@gmail.com>
This commit is contained in:
Matthias Seitz
2023-05-22 16:24:44 +02:00
committed by GitHub
parent 7273ce8028
commit 9cd7b4130f
2 changed files with 6 additions and 3 deletions

View File

@@ -336,7 +336,7 @@ impl<DB: Database, C: Consensus, EF: ExecutorFactory> BlockchainTree<DB, C, EF>
parent: BlockNumHash,
) -> Result<BlockStatus, InsertBlockError> {
let block_num_hash = block.num_hash();
debug!(target: "blockchain_tree", ?parent, "Appending block to canonical chain");
debug!(target: "blockchain_tree", head = ?block_num_hash.hash, ?parent, "Appending block to canonical chain");
// create new chain that points to that block
//return self.fork_canonical_chain(block.clone());
// TODO save pending block to database
@@ -742,6 +742,8 @@ impl<DB: Database, C: Consensus, EF: ExecutorFactory> BlockchainTree<DB, C, EF>
/// Connect unconnected,buffered blocks if the new block closes a gap.
fn try_connect_buffered_blocks(&mut self, new_block: BlockNumHash) {
trace!(target: "blockchain_tree", ?new_block, "try_connect_buffered_blocks");
let include_blocks = self.buffered_blocks.take_all_children(new_block);
// insert block children
for block in include_blocks.into_iter() {

View File

@@ -412,7 +412,7 @@ where
self.update_canon_chain(&state)?;
}
self.listeners.notify(BeaconConsensusEngineEvent::ForkchoiceUpdated(state));
trace!(target: "consensus::engine", ?state, status = ?payload_response, "Returning forkchoice status");
trace!(target: "consensus::engine", status = ?payload_response, ?state, "Returning forkchoice status ");
return Ok(payload_response)
}
@@ -438,7 +438,8 @@ where
};
self.listeners.notify(BeaconConsensusEngineEvent::ForkchoiceUpdated(state));
trace!(target: "consensus::engine", ?state, ?status, "Returning forkchoice status");
trace!(target: "consensus::engine", ?status, ?state, "Returning forkchoice status");
Ok(OnForkChoiceUpdated::valid(status))
}