From d7dd474a18451ce504c52790037ec7a6b0aef205 Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Wed, 21 Jun 2023 21:52:00 -0400 Subject: [PATCH] chore: improve invalid block warnings (#3312) --- crates/consensus/beacon/src/engine/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/consensus/beacon/src/engine/mod.rs b/crates/consensus/beacon/src/engine/mod.rs index 5bf34ad4ac..7f1bc1749d 100644 --- a/crates/consensus/beacon/src/engine/mod.rs +++ b/crates/consensus/beacon/src/engine/mod.rs @@ -1368,8 +1368,7 @@ impl InvalidHeaderCache { /// Inserts an invalid block into the cache, with a given invalid ancestor. fn insert_with_invalid_ancestor(&mut self, header_hash: H256, invalid_ancestor: Arc
) { - warn!(target: "consensus::engine", "Bad block with header hash: {:?}, invalid ancestor: {:?}", - header_hash, invalid_ancestor); + warn!(target: "consensus::engine", hash=?header_hash, ?invalid_ancestor, "Bad block with existing invalid ancestor"); self.headers.insert(header_hash, invalid_ancestor); } @@ -1377,8 +1376,7 @@ impl InvalidHeaderCache { fn insert(&mut self, invalid_ancestor: SealedHeader) { let hash = invalid_ancestor.hash; let header = invalid_ancestor.unseal(); - warn!(target: "consensus::engine", "Bad block with header hash: {:?}, invalid ancestor: {:?}", - hash, header); + warn!(target: "consensus::engine", ?hash, ?header, "Bad block with hash"); self.headers.insert(hash, Arc::new(header)); } }