Conversation
dirvine
left a comment
There was a problem hiding this comment.
APPROVE — reviewed at exact head 674aa0d2eb9dcf794497a69ac6affc15accf47ff together with saorsa-core #163.
The tally fix is conservative in every relevant interleaving:
agent=Nonefollowed by disconnected means the peer left after theconnected_peerssnapshot, so skipping it removes the observed falseUnreportedtick.- If the peer reconnects between the two reads, it remains
Unreported; that is a possible false outstanding count, not false clearance. - If an agent is read before a disconnect, the snapshot's last announced state is counted, matching the existing snapshot semantics.
- A still-connected peer with no agent remains
Unreported.
The change therefore cannot manufacture a Files result or falsely clear the migration gate. It is safe on its own and gains the stronger missing-agent meaning from saorsa-core #163.
Verification:
- focused migration-signal suite: 15 passed
- clippy all targets/features: passed
- no-default-features library check: passed
- formatting and rustdoc warnings check: passed
- GitHub build/test/lint/filesystem/platform matrix is green
Non-blocking gap: no deterministic mid-tally disconnect/reconnect test was added. The branch logic is small and the paired transport invariant was checked directly, so I do not consider this a merge blocker.
The failing Security Audit is inherited, not introduced: Cargo.lock is byte-identical to the base and the newly published RUSTSEC-2026-0285 affects that existing rustls version. It should be handled by the release train in a separate dependency bump to rustls >=0.23.45.
Operationally, this is consistent with — and closes — the reported false-positive path in the #218 testnet. I have not independently reclassified the whole run from its Linear evidence here. The peer tally remains observational evidence rather than proof of whole-fleet completion, so the rest of the ADR-0015 gate still applies.
…ported `tally_peers` lists the connected peers and then reads each one's user agent. saorsa-core drops a peer's agent when its last channel closes, so a peer that disconnects between the two reads has no agent, and the tally counted it as a node running a build from before the migration signal. On a 990-node testnet this put a departing client in `peers_unreported` on one tick in 21,402, which is exactly the count the release gate for removing the LMDB store reads. A peer with no agent that is no longer connected is now skipped: it is not a peer this node can see. A peer that is still connected with no agent recorded keeps its place in the unreported bucket, so the count stays conservative with or without the saorsa-core change that records the agent under the peer's connection entry.
saorsa-core records a peer's user agent and removes it under the same lock as the peer's connection entry, so a connected peer always has an agent. When `tally_peers` reads no agent and then finds the peer connected, the peer disconnected and came back between the two reads. The tally counted it as unreported from the first, stale read, even when the peer had announced a finished store or was a client. That is the same false `unreported` reading the previous commit removes for a departing peer. The agent is now read a second time in that case and the peer is classified from what it announced. If the second read still finds no agent, the peer stays in the unreported bucket, so a connected peer is never dropped from the count.
674aa0d to
019ec6a
Compare
Linear issue
Closes V2-1290
Split from V2-1260, whose saorsa-core half (saorsa-core #163) has merged.
Risk tier
Changes the migration signal's output, in
tally_peersonly:peer_stateline is written for it.No wire, format or penalty change.
Compatibility
Semver impact
Test evidence
Rebased onto main at
d9ff670. The diff is one file,src/storage/migration_signal.rs, in two commits: the original fix and the reconnect re-read. NoCargo.tomlorCargo.lockchange.peers_unreported=1, aclient/0.27.3connection tallied withagent=none. The tally takes the peer list, then reads each agent, and saorsa-core drops the agent when the peer's last channel closes.cargo test --lib --features test-utils migration_signal: 15 passed. Full--lib --features test-utils: 1153 passed.--lib --no-default-features: 1110 passed.migration_reclaims_disk2,migration_crash_safety5,migration_shared_volume5,e2e97 passed (3 ignored, as on main),webrtc_direct_devnet3,poc_commitment_audit_attacks19,poc_audit_handler_live16,poc_bootstrap_stall3,poc_shutdown_lmdb_drain1. All passed, none failed.cargo clippy --all-targets --all-features -- -D warnings,RUSTFLAGS=-D warnings cargo check --lib --no-default-features --locked,cargo fmt --all -- --check,RUSTDOCFLAGS=-D warnings cargo doc --all-features --no-deps,scripts/adr-governance.py: clean.New dependency
none
ADR
https://github.com/WithAutonomi/ant-node/blob/main/docs/adr/ADR-0014-file-based-chunk-store-and-lmdb-retirement.md
Mitigation / rollback
Revert the two commits. They only change the migration signal's log output.