|
// arrival time of the first notification. |
|
// TODO: should we use the blocks' timestamps? |
|
if block_sender |
|
.send(BlockEvent { block, received_at }) |
|
.await |
|
.is_err() |
In block_stream.rs, catch_up_scan propagates the received_at time of the first post-reconnect notification to all missed blocks, rather than timestamping each catch-up block at the moment it is actually fetched.
Impact:
All N catch-up blocks share an identical latency value (the reconnect moment), artificially flattening the latency distribution during gap scans. For example, if the spammer reconnects after a 5-second gap covering 10 blocks, all 10 blocks report the same received_at — making it appear they were all observed simultaneously, which is incorrect.
Suggested Fix:
Replace the shared received_at parameter with a per-block timestamp_now() call inside the catch-up loop
FetchResult::Ok(block) => {
let received_at = timestamp_now(); // timestamps each block individually
if block_sender
.send(BlockEvent { block, received_at })
.await
.is_err()
{
return Ok(());
}
}
arc-node/crates/spammer/src/latency/block_stream.rs
Lines 370 to 375 in a85368c
In block_stream.rs,
catch_up_scanpropagates thereceived_attime of the first post-reconnect notification to all missed blocks, rather than timestamping each catch-up block at the moment it is actually fetched.Impact:
All N catch-up blocks share an identical latency value (the reconnect moment), artificially flattening the latency distribution during gap scans. For example, if the spammer reconnects after a 5-second gap covering 10 blocks, all 10 blocks report the same
received_at— making it appear they were all observed simultaneously, which is incorrect.Suggested Fix:
Replace the shared
received_atparameter with a per-blocktimestamp_now()call inside the catch-up loop