Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make object retrieval RPC logging match HTTP logging #3299

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading