chore(replication): log audit challenge responses#157
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds responder-side logging for incoming replication audit challenges and whether the corresponding audit reply was successfully accepted by the existing send path, enabling production log-based counts of audit traffic/outcomes without changing protocol behavior.
Changes:
- Log each received audit challenge at INFO with a stable “Audit challenge received” phrase and bounded fields (key count, bootstrapping, request-response flag).
- Send audit responses via the checked send helper to capture a success boolean and log “Audit challenge reply sent” (INFO) vs “Audit challenge reply not sent” (WARN).
- Add a small helper to log a stable
responsekind label derived fromprotocol::AuditResponse.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mickvandijke
approved these changes
Jun 22, 2026
jacderida
added a commit
to grumbach/ant-node
that referenced
this pull request
Jun 22, 2026
logging to subtree/byte audits) Resolve conflicts after main advanced (incl. WithAutonomi#157 audit-challenge logging, WithAutonomi#135 aged repair hints, the prune-proof/admission gate, and the neighbor-sync hints refactor): - neighbor_sync: thread the gossiped commitment through main's hints-based sync path (sync_with_peer_with_hints). The commitment piggybacks on NeighborSync messages, so this is load-bearing for the gossip-triggered subtree audit (ADR-0002), not optional. Fixes a silent (non-marker) auto-merge breakage that referenced `commitment` without a parameter. - mod.rs: keep the ADR-0002 gossip-audit trigger; combine main's per-batch sync hints with the per-round my_commitment snapshot at every sync call site; take main's new VERIFICATION_CYCLE_SLOW_LOG_MS. - pruning: keep main's record_prune_lookup_groups prune-proof/admission gate AND re-apply the ADR-0002 commitment-retention veto (is_held) so a key still committed under a recently-gossiped commitment is never pruned. - tests/e2e: union both sides' prune tests; fill the merged PrunePassContext (repair_proof_now + commitment_state) on every literal. Fold WithAutonomi#157's audit-challenge logging convention into the subtree and byte challenge responders (received + reply sent/not-sent via send_replication_response_checked) and the capacity-dropped paths. Verified: cargo fmt --check, cargo check --all-targets (+test-utils), and cargo clippy --all-targets --features test-utils all clean; cargo test --lib --features test-utils -> 674 passed, 0 failed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit challenge receivedphrase.Audit challenge reply sent/Audit challenge reply not sentphrases.Why
PROD logs currently show audit outcomes from the auditor side, but the responder path is silent on successful incoming audit challenges and replies. These two stable log lines let ES answer hourly averages for:
without changing protocol behaviour.
Review team
send_replication_response_checkedneeded context and suggested lowering cardinality/clarifying field names.stored_chunksfrom the log message, renamedrrtorequest_response, and made failed sends WARN while successful sends remain INFO.send_replication_response_checkedand discarded its boolean.Verification
cargo fmt --allcargo checkcargo test replication::audit::tests --lib— 32 passedgit diff --checkcargo clippy --all-features -- -D clippy::panic -D clippy::unwrap_used -D clippy::expect_used