From d800f39c2881096332acefb37c772e6069606f8a Mon Sep 17 00:00:00 2001 From: Christien Rioux Date: Wed, 13 Mar 2024 09:57:49 -0400 Subject: [PATCH] xfer --- .../src/rpc_processor/rpc_inspect_value.rs | 5 ++++- veilid-core/src/storage_manager/mod.rs | 20 ++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/veilid-core/src/rpc_processor/rpc_inspect_value.rs b/veilid-core/src/rpc_processor/rpc_inspect_value.rs index 9d4f9b0b..b7cc66bb 100644 --- a/veilid-core/src/rpc_processor/rpc_inspect_value.rs +++ b/veilid-core/src/rpc_processor/rpc_inspect_value.rs @@ -15,7 +15,10 @@ impl RPCProcessor { /// Because this leaks information about the identity of the node itself, /// replying to this request received over a private route will leak /// the identity of the node and defeat the private route. - + /// The number of subkey sequence numbers returned may either be: + /// * the amount requested + /// * an amount truncated to MAX_INSPECT_VALUE_A_SEQS_LEN subkeys + /// * zero if nothing was found #[cfg_attr( feature = "verbose-tracing", instrument(level = "trace", skip(self, last_descriptor), diff --git a/veilid-core/src/storage_manager/mod.rs b/veilid-core/src/storage_manager/mod.rs index 8696ec12..fb9b55f7 100644 --- a/veilid-core/src/storage_manager/mod.rs +++ b/veilid-core/src/storage_manager/mod.rs @@ -772,7 +772,7 @@ impl StorageManager { ); assert!( local_inspect_result.subkeys.is_subset(&subkeys), - "mismatch between local subkeys returned and sequence number list returned" + "more subkeys returned locally than requested" ); // If this is the maximum scope we're interested in, return the report @@ -816,16 +816,18 @@ impl StorageManager { .await?; // Sanity check before zip - assert!( - result.inspect_result.subkeys.len() == result.fanout_results.len(), + assert_eq!( + result.inspect_result.subkeys.len(), + result.fanout_results.len(), "mismatch between subkeys returned and fanout results returned" ); - assert!( - local_inspect_result.subkeys.is_empty() - || result.inspect_result.subkeys.is_empty() - || result.inspect_result.subkeys.len() == local_inspect_result.subkeys.len(), - "mismatch between local subkeys returned and network results returned" - ); + if !local_inspect_result.subkeys.is_empty() && !result.inspect_result.subkeys.is_empty() { + assert_eq!( + result.inspect_result.subkeys.len(), + local_inspect_result.subkeys.len(), + "mismatch between local subkeys returned and network results returned" + ); + } // Keep the list of nodes that returned a value for later reference let mut inner = self.lock().await?;