refactor: remove logical_seq from client events, session tracking and stats usage

It was an attempt at handling integer wraparound more cleanly keeping in mind that we have a continuous mode,
and so we can more easily reach seq > u32::MAX

However after running the numbers, if we run with a interval of 10ms, it's still gonna take ~497 days before we hit integer overflow, so for now it doesn't seem worth to have this extra logic to handle something that'll in 99.9% of cases be purely an edge case

Keeping in mind autorate usage, in sqm-autorate-rust each send loop is 500 ms by default, and the sleep is then 500 ms / 5 reflectors, so our interval is 100 ms. that means it'll take 4970 days or ~13.6 years to reach the limit. Not worth dealing with IMO
This commit was merged in pull request #11.
This commit is contained in:
Nils Andreas Svee committed 2026-05-11 14:56:07 +07:00
1 parent 8ef53c999a
commit 7ad83ca1f6
13 files changed
+117 -273

No files matched your search

+1 -11
View File
@@ -16,7 +16,6 @@ use support::{
struct ReplyView<'a> {
seq: u32,
logical_seq: u64,
rtt: &'a RttSample,
server_timing: Option<&'a ServerTiming>,
one_way: Option<&'a OneWayDelaySample>,
@@ -38,7 +37,6 @@ fn received_stats_modes_drive_negotiated_echo_and_reply_events() {
let reply = expect_echo_reply(&run.reply);
assert_eq!(reply.seq, 0);
assert_eq!(reply.logical_seq, 0);
assert_eq!(reply.bytes, echo_packet_len(false, &params));
assert!(reply.server_timing.is_none());
assert!(reply.one_way.is_none());
@@ -251,14 +249,8 @@ fn assert_echo_uses_params(run: &OneProbeRun, params: &Params, hmac: bool) {
assert_eq!(sequence, 0);
match &run.sent {
ClientEvent::EchoSent {
seq,
logical_seq,
bytes,
..
} => {
ClientEvent::EchoSent { seq, bytes, .. } => {
assert_eq!(*seq, 0);
assert_eq!(*logical_seq, 0);
assert_eq!(*bytes, echo_packet_len(hmac, params));
}
other => panic!("expected EchoSent, got {other:?}"),
@@ -288,7 +280,6 @@ fn expect_echo_reply(event: &ClientEvent) -> ReplyView<'_> {
match event {
ClientEvent::EchoReply {
seq,
logical_seq,
rtt,
server_timing,
one_way,
@@ -297,7 +288,6 @@ fn expect_echo_reply(event: &ClientEvent) -> ReplyView<'_> {
..
} => ReplyView {
seq: *seq,
logical_seq: *logical_seq,
rtt,
server_timing: server_timing.as_ref(),
one_way: one_way.as_ref(),