This commit is contained in:
Christien Rioux 2024-03-13 09:57:49 -04:00
parent 64832748a9
commit d800f39c28
2 changed files with 15 additions and 10 deletions

View File

@ -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),

View File

@ -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(),
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?;