From 8aa85685d3bfaa768d265eb2babb96e277fafa20 Mon Sep 17 00:00:00 2001 From: quake Date: Mon, 12 Aug 2024 08:46:29 +0800 Subject: [PATCH] chore: tweak log level for some error message --- src/protocols/filter/block_filter.rs | 8 ++++---- .../light_client/components/send_blocks_proof.rs | 4 ++-- src/protocols/light_client/mod.rs | 4 ++-- src/utils/network.rs | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/protocols/filter/block_filter.rs b/src/protocols/filter/block_filter.rs index f4c2387..2b84954 100644 --- a/src/protocols/filter/block_filter.rs +++ b/src/protocols/filter/block_filter.rs @@ -6,7 +6,7 @@ use ckb_constant::sync::INIT_BLOCKS_IN_TRANSIT_PER_PEER; use ckb_network::{async_trait, bytes::Bytes, CKBProtocolContext, CKBProtocolHandler, PeerIndex}; use ckb_types::{core::BlockNumber, packed, prelude::*}; use golomb_coded_set::{GCSFilterReader, SipHasher24Builder, M, P}; -use log::{debug, error, info, log_enabled, trace, warn, Level}; +use log::{debug, info, log_enabled, trace, warn, Level}; use rand::seq::SliceRandom as _; use std::io::Cursor; use std::sync::RwLock; @@ -259,7 +259,7 @@ impl FilterProtocol { .build(); if let Err(err) = nc.send_message_to(peer, message.as_bytes()) { let error_message = format!("nc.send_message GetBlockFilters, error: {:?}", err); - error!("{}", error_message); + info!("{}", error_message); } } @@ -282,7 +282,7 @@ impl FilterProtocol { .build(); if let Err(err) = nc.send_message_to(peer, message.as_bytes()) { let error_message = format!("nc.send_message GetBlockFilterHashes, error: {:?}", err); - error!("{}", error_message); + info!("{}", error_message); } } @@ -308,7 +308,7 @@ impl FilterProtocol { "nc.send_message GetBlockFilterCheckPoints, error: {:?}", err ); - error!("{}", error_message); + info!("{}", error_message); } } } diff --git a/src/protocols/light_client/components/send_blocks_proof.rs b/src/protocols/light_client/components/send_blocks_proof.rs index 8fd079f..7984127 100644 --- a/src/protocols/light_client/components/send_blocks_proof.rs +++ b/src/protocols/light_client/components/send_blocks_proof.rs @@ -5,7 +5,7 @@ use ckb_types::{ prelude::*, utilities::merkle_mountain_range::VerifiableHeader, }; -use log::{debug, error}; +use log::{debug, error, info}; use rand::seq::SliceRandom; use crate::storage::HeaderWithExtension; @@ -207,7 +207,7 @@ impl<'a> SendBlocksProofProcess<'a> { ) { let error_message = format!("nc.send_message SyncMessage, error: {:?}", err); - error!("{}", error_message); + info!("{}", error_message); return StatusCode::Network.with_context(error_message); } } diff --git a/src/protocols/light_client/mod.rs b/src/protocols/light_client/mod.rs index 5854ab9..67c71a1 100644 --- a/src/protocols/light_client/mod.rs +++ b/src/protocols/light_client/mod.rs @@ -749,7 +749,7 @@ impl LightClientProtocol { ) { let error_message = format!("nc.send_message LightClientMessage, error: {:?}", err); - error!("{}", error_message); + info!("{}", error_message); } self.peers.fetching_idle_headers(block_hashes, now); } @@ -788,7 +788,7 @@ impl LightClientProtocol { ) { let error_message = format!("nc.send_message LightClientMessage, error: {:?}", err); - error!("{}", error_message); + info!("{}", error_message); } self.peers.fetching_idle_txs(tx_hashes, now); } else { diff --git a/src/utils/network.rs b/src/utils/network.rs index 10da7bc..5184c84 100644 --- a/src/utils/network.rs +++ b/src/utils/network.rs @@ -1,7 +1,7 @@ use crate::protocols::{Peers, GET_BLOCKS_PROOF_LIMIT}; use ckb_network::{CKBProtocolContext, SupportProtocols}; use ckb_types::{packed, prelude::*, H256}; -use log::{debug, error}; +use log::{debug, info}; use rand::seq::SliceRandom; use std::collections::HashMap; use std::sync::Arc; @@ -53,7 +53,7 @@ pub(crate) fn prove_or_download_matched_blocks( ) { let error_message = format!("nc.send_message LightClientMessage, error: {:?}", err); - error!("{}", error_message); + info!("{}", error_message); } } else { break; @@ -97,7 +97,7 @@ pub(crate) fn prove_or_download_matched_blocks( nc.send_message(SupportProtocols::Sync.protocol_id(), *peer_index, message) { let error_message = format!("nc.send_message SyncMessage, error: {:?}", err); - error!("{}", error_message); + info!("{}", error_message); } } else { break;