Skip to content

Commit c09a538

Browse files
committed
fix(logging): disconnection reason not logged
1 parent 336c842 commit c09a538

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

node/src/block_producer/block_producer_actions.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ pub enum BlockProducerAction {
6060
proof: Box<MinaBaseProofStableV2>,
6161
},
6262
BlockProduced,
63+
#[action_event(level = trace)]
6364
BlockInject,
6465
BlockInjected,
6566
}

node/src/p2p/callbacks/p2p_callbacks_reducer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,7 @@ impl crate::State {
287287
let response = None.or_else(|| {
288288
let best_tip = best_chain.last()?;
289289
let mut chain_iter = best_chain.iter();
290-
let root_block = chain_iter.next();
291-
// when our best tip is genesis block.
292-
let root_block = root_block.unwrap_or(best_tip);
290+
let root_block = chain_iter.next()?;
293291
// TODO(binier): cache body hashes
294292
let Ok(body_hashes) = chain_iter
295293
.map(|b| b.header().protocol_state.body.try_hash())

p2p/src/disconnection/p2p_disconnection_actions.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::{P2pPeerStatus, P2pState, PeerId};
77
pub type P2pDisconnectionActionWithMetaRef<'a> = redux::ActionWithMeta<&'a P2pDisconnectionAction>;
88

99
#[derive(Serialize, Deserialize, Debug, Clone, ActionEvent)]
10-
#[action_event(fields(display(peer_id), display(reason)), level = info)]
10+
#[action_event(level = debug)]
1111
pub enum P2pDisconnectionAction {
1212
/// Initialize disconnection.
1313
#[action_event(fields(display(peer_id), display(reason)), level = info)]
@@ -16,7 +16,7 @@ pub enum P2pDisconnectionAction {
1616
reason: P2pDisconnectionReason,
1717
},
1818
/// Finish disconnecting from a peer.
19-
#[action_event(level = debug)]
19+
#[action_event(fields(display(peer_id)), level = debug)]
2020
Finish { peer_id: PeerId },
2121
}
2222

0 commit comments

Comments
 (0)