diff --git a/src/comm/comm_session.cpp b/src/comm/comm_session.cpp index 07c96f56..8b0cb524 100644 --- a/src/comm/comm_session.cpp +++ b/src/comm/comm_session.cpp @@ -275,7 +275,7 @@ namespace comm /** * Returns printable name for the session based on uniqueid (used for logging). */ - const std::string comm_session::display_name() + const std::string comm_session::display_name() const { if (challenge_status == comm::CHALLENGE_STATUS::CHALLENGE_VERIFIED) { diff --git a/src/comm/comm_session.hpp b/src/comm/comm_session.hpp index 38d9db40..6c381a0f 100644 --- a/src/comm/comm_session.hpp +++ b/src/comm/comm_session.hpp @@ -71,7 +71,7 @@ namespace comm void mark_for_closure(); void close(); void mark_as_verified(); - virtual const std::string display_name(); + virtual const std::string display_name() const; void set_threshold(const SESSION_THRESHOLDS threshold_type, const uint64_t threshold_limit, const uint32_t intervalms); void increment_metric(const SESSION_THRESHOLDS threshold_type, const uint64_t amount); diff --git a/src/hpfs/hpfs_sync.cpp b/src/hpfs/hpfs_sync.cpp index 2aa0acea..c238342f 100644 --- a/src/hpfs/hpfs_sync.cpp +++ b/src/hpfs/hpfs_sync.cpp @@ -263,7 +263,7 @@ namespace hpfs // Validate received fs data against the hash. if (!validate_fs_entry_hash(vpath, hash, fs_resp.dir_mode(), peer_fs_entries)) { - LOG_INFO << "Hpfs " << name << " sync: Skipping response from [" << from << "] due to fs entry hash mismatch."; + LOG_INFO << "Hpfs " << name << " sync: Skipping mismatched fs entries response from [" << from << "] for " << vpath; continue; } @@ -281,7 +281,7 @@ namespace hpfs // Validate received hashmap against the hash. if (!validate_file_hashmap_hash(vpath, hash, file_resp.file_mode(), block_hashes, block_hash_count)) { - LOG_INFO << "Hpfs " << name << " sync: Skipping response from [" << from << "] due to file hashmap hash mismatch."; + LOG_INFO << "Hpfs " << name << " sync: Skipping mismatched hashmap response from [" << from << "] for " << vpath; continue; } @@ -309,7 +309,8 @@ namespace hpfs // Validate received block data against the hash. if (!validate_file_block_hash(hash, block_id, buf)) { - LOG_INFO << "Hpfs " << name << " sync: Skipping response from [" << from << "] due to file block hash mismatch."; + LOG_INFO << "Hpfs " << name << " sync: Skipping mismatched block response from [" << from << "] for block_id:" << block_id + << " (len:" << buf.length() << ") of " << vpath; continue; } diff --git a/src/msg/fbuf/p2pmsg_conversion.cpp b/src/msg/fbuf/p2pmsg_conversion.cpp index bfb1412b..efa36f6f 100644 --- a/src/msg/fbuf/p2pmsg_conversion.cpp +++ b/src/msg/fbuf/p2pmsg_conversion.cpp @@ -45,7 +45,7 @@ namespace msg::fbuf::p2pmsg const uint64_t time_now = util::get_epoch_milliseconds(); if (p2p_msg->created_on() < (time_now - (conf::cfg.contract.roundtime * 4))) { - LOG_DEBUG << "Peer message is too old. type:" << p2p_msg->content_type() << " [" << (session ? session->uniqueid : "") << "]"; + LOG_DEBUG << "Peer message is too old. type:" << p2p_msg->content_type() << " from:" << (session ? session->display_name() : ""); return p2p::peer_message_info{NULL, P2PMsgContent_NONE, 0}; } } diff --git a/src/p2p/p2p.cpp b/src/p2p/p2p.cpp index 159cd835..ad938de8 100644 --- a/src/p2p/p2p.cpp +++ b/src/p2p/p2p.cpp @@ -259,7 +259,7 @@ namespace p2p const uint64_t time_now = util::get_epoch_milliseconds(); if (originated_on < (time_now - (conf::cfg.contract.roundtime * 3))) { - LOG_DEBUG << "Peer message is too old for forwarding. type:" << msg_type << " [" << session.uniqueid << "]"; + LOG_DEBUG << "Peer message is too old for forwarding. type:" << msg_type << " from:" << session.display_name(); return false; } diff --git a/src/p2p/peer_session_handler.cpp b/src/p2p/peer_session_handler.cpp index de2285ff..1626e888 100644 --- a/src/p2p/peer_session_handler.cpp +++ b/src/p2p/peer_session_handler.cpp @@ -82,7 +82,7 @@ namespace p2p if (!recent_peermsg_hashes.try_emplace(crypto::get_hash(message))) { session.increment_metric(comm::SESSION_THRESHOLDS::MAX_DUPMSGS_PER_MINUTE, 1); - LOG_DEBUG << "Duplicate peer message. type:" << mi.type << " " << session.display_name() << " [" << session.uniqueid << "]"; + LOG_DEBUG << "Duplicate peer message. type:" << mi.type << " from:" << session.display_name(); return 0; } diff --git a/test/bin/hpfs b/test/bin/hpfs index 1fb8ea4c..ced9ddda 100755 Binary files a/test/bin/hpfs and b/test/bin/hpfs differ diff --git a/test/local-cluster/cluster-create.sh b/test/local-cluster/cluster-create.sh index c5b7ca46..43795e71 100755 --- a/test/local-cluster/cluster-create.sh +++ b/test/local-cluster/cluster-create.sh @@ -116,7 +116,7 @@ do }, null, 2)") log_json=$(node -p "JSON.stringify({...require('./tmp.json').log, \ - loglevel: '$loglevel', \ + log_level: '$loglevel', \ loggers:['console', 'file'] \ }, null, 2)")