Skip to content

Commit

Permalink
Make object retrieval RPC logging match HTTP logging
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Dec 9, 2024
1 parent 9bc35f4 commit e04ae4d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions crates/subspace-gateway-rpc/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use subspace_core_primitives::hashes::{blake3_hash, Blake3Hash};
use subspace_core_primitives::objects::GlobalObjectMapping;
use subspace_data_retrieval::object_fetcher::{self, ObjectFetcher};
use subspace_data_retrieval::piece_getter::PieceGetter;
use tracing::debug;
use tracing::{debug, error, trace};

const SUBSPACE_ERROR: i32 = 9000;

Expand Down Expand Up @@ -154,7 +154,13 @@ where

let data_hash = blake3_hash(&data);
if data_hash != mapping.hash {
debug!(?data_hash, ?mapping.hash, "Retrieved data did not match mapping hash");
error!(
?data_hash,
data_size = %data.len(),
?mapping.hash,
"Retrieved data did not match mapping hash",
);
trace!(data = %hex::encode(data), "Retrieved data");
return Err(Error::InvalidObjectHash {
mapping_hash: mapping.hash,
data_hash,
Expand Down

0 comments on commit e04ae4d

Please sign in to comment.