Skip to content

Commit

Permalink
Merge pull request #405 from contrun/remove-some-outputs
Browse files Browse the repository at this point in the history
Reduce some noice in output
  • Loading branch information
quake authored Dec 19, 2024
2 parents 1563ca7 + e17a41b commit 715ec6c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 24 deletions.
10 changes: 0 additions & 10 deletions src/ckb/tests/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ impl Actor for MockChainActor {
message: Self::Msg,
state: &mut Self::State,
) -> Result<(), ActorProcessingErr> {
debug!("MockChainActor received message: {:?}", message);
use CkbChainMessage::*;
match message {
Fund(tx, request, reply_port) => {
Expand Down Expand Up @@ -437,10 +436,6 @@ impl Actor for MockChainActor {
let index = index as usize;
let cell = tx.outputs().get(index).unwrap();
let data = tx.outputs_data().get(index).unwrap();
debug!(
"Creating cell with outpoint: {:?}, cell: {:?}, data: {:?}",
outpoint, cell, data
);
context.create_cell_with_out_point(
outpoint.clone(),
cell,
Expand Down Expand Up @@ -515,11 +510,6 @@ impl Actor for MockChainActor {
.entry(request.block_hash())
.or_insert(now_timestamp_as_millis_u64());

debug!(
"Get block timestamp: block_hash: {:?}, timestamp: {}",
request.block_hash(),
timestamp
);
let _ = rpc_reply_port.send(Ok(Some(timestamp)));
}
}
Expand Down
13 changes: 8 additions & 5 deletions src/fiber/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ where
GossipSyncingActorMessage::NewGetRequest() => {
let latest_cursor = state.get_cursor().clone();
let request_id = state.get_and_increment_request_id();
debug!(
trace!(
"Sending GetBroadcastMessages request to peers: request_id {}, latest_cursor {:?}",
request_id, latest_cursor
);
Expand Down Expand Up @@ -1231,9 +1231,10 @@ impl<S: GossipMessageStore + Send + Sync + 'static> Actor for ExtendedGossipMess
.send((id, tx, Arc::clone(&output_port)))
.expect("send reply");
rx.await.expect("receive notification");
debug!(
trace!(
"Loading messages from store for subscriber {}: subscription cursor {:?}",
id, cursor
id,
cursor
);
// Since the handling of LoadMessagesFromStore interleaves with the handling of Tick,
// we may send the messages in an order that is different from both the dependency order
Expand Down Expand Up @@ -1348,6 +1349,9 @@ impl<S: GossipMessageStore + Send + Sync + 'static> Actor for ExtendedGossipMess

// These are the messages that have complete dependencies and can be sent to the subscribers.
let complete_messages = state.prune_messages_to_be_saved().await;
if complete_messages.is_empty() {
return Ok(());
}
for (id, subscription) in state.output_ports.iter() {
let messages_to_send = complete_messages
.iter()
Expand Down Expand Up @@ -2417,13 +2421,12 @@ where

GossipActorMessage::TickNetworkMaintenance => {
trace!(
"Gossip network maintenance ticked, current state: num of peers: {}, num of finished syncing peers: {}, num of active syncing peers: {}, num of passive syncing peers: {}, num of pending queries: {}, peer states: {:?}",
"Gossip network maintenance ticked, current state: num of peers: {}, num of finished syncing peers: {}, num of active syncing peers: {}, num of passive syncing peers: {}, num of pending queries: {}",
state.peer_states.len(),
state.num_finished_active_syncing_peers,
state.num_of_active_syncing_peers(),
state.num_of_passive_syncing_peers(),
state.pending_queries.len(),
&state.peer_states
);
for peer in state.peers_to_start_active_syncing() {
state.start_new_active_syncer(&peer).await;
Expand Down
14 changes: 6 additions & 8 deletions src/fiber/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ where
if messages.is_empty() {
return false;
}
debug!("Updating network graph with #{} messages", messages.len());
debug!("Updating network graph with {} messages", messages.len());
for message in messages {
self.update_lastest_cursor(message.cursor());
if message.chain_hash() != get_chain_hash() {
Expand Down Expand Up @@ -330,7 +330,6 @@ where
}

fn load_channel_info_mut(&mut self, channel_outpoint: &OutPoint) -> Option<&mut ChannelInfo> {
debug!("Loading channel info: {:?}", channel_outpoint);
if !self.channels.contains_key(channel_outpoint) {
if let Some((timestamp, channel_announcement)) =
self.store.get_latest_channel_announcement(channel_outpoint)
Expand All @@ -350,10 +349,6 @@ where
timestamp: u64,
channel_announcement: ChannelAnnouncement,
) -> Option<Cursor> {
debug!(
"Processing channel announcement: timestamp {}, channel announcement {:?}",
timestamp, &channel_announcement
);
match self.channels.get(&channel_announcement.channel_outpoint) {
Some(_channel) => {
trace!(
Expand All @@ -369,7 +364,7 @@ where
channel_announcement.channel_outpoint.clone(),
),
);
debug!(
trace!(
"Inserting new channel announcement: {:?}",
&channel_announcement
);
Expand All @@ -394,7 +389,6 @@ where
}

fn process_channel_update(&mut self, channel_update: ChannelUpdate) -> Option<Cursor> {
debug!("Processing channel update: {:?}", &channel_update);
let channel_outpoint = &channel_update.channel_outpoint;
// The channel update message may have smaller timestamp than channel announcement.
// So it is possible that the channel announcement is not loaded into the graph yet,
Expand All @@ -420,6 +414,10 @@ where
channel_update.timestamp,
BroadcastMessageID::ChannelUpdate(channel_update.channel_outpoint.clone()),
);
trace!(
"Saving new channel update to the graph: {:?}",
&channel_update
);
*update_info = Some(ChannelUpdateInfo::from(channel_update));
return Some(cursor);
}
Expand Down
1 change: 0 additions & 1 deletion src/fiber/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,6 @@ where
));
}
NetworkActorEvent::GossipMessageUpdates(gossip_message_updates) => {
trace!("Network actor received gossip updates, updating graph");
let mut graph = self.network_graph.write().await;
graph.update_for_messages(gossip_message_updates.messages);
}
Expand Down

0 comments on commit 715ec6c

Please sign in to comment.