feat: client-side close group quorum validation#16
Draft
mickvandijke wants to merge 5 commits intomainfrom
Draft
feat: client-side close group quorum validation#16mickvandijke wants to merge 5 commits intomainfrom
mickvandijke wants to merge 5 commits intomainfrom
Conversation
The client now extracts close group views from quote responses and validates that a mutually-recognizing subset of at least CLOSE_GROUP_MAJORITY peers exists before paying. This ensures the client only pays when the data will be accepted by enough close group nodes for durable storage and replication. The validation finds the largest subset of queried peers where every peer in the subset appears in every other peer's close group view — matching the server-side threshold that nodes enforce during payment verification. Fails with CloseGroupQuorumFailure if no such subset of sufficient size exists. Key changes: - get_store_quotes extracts close_group from ChunkQuoteResponse::Success - validate_close_group_quorum finds largest mutual-recognition clique - New CloseGroupQuorumFailure error variant in data::error Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Without the P2P node, test nodes return empty close_group views in quote responses, which causes the new quorum validation to always fail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Covers next_combination, is_mutual_subset, find_largest_mutual_subset, and validate_close_group_quorum with 16 tests: full clique, partial clique at majority boundary, below-majority failure, empty views, asymmetric recognition, rogue peer, and combination enumeration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reorder quoted peers so that mutually-recognizing quorum members appear first in the list returned by get_store_quotes. Since chunk_put_to_close_group takes the first CLOSE_GROUP_MAJORITY peers as its initial upload targets, this ensures we try the peers most likely to accept payment proofs before falling back to non-quorum peers. Co-Authored-By: Claude Opus 4.6 (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
CloseGroupQuorumFailureif no mutually-recognizing subset ofCLOSE_GROUP_MAJORITY(3) peers existsCloseGroupQuorumFailureindata::errorMotivation
Ensures the client only pays when data will be accepted by enough close group nodes for durable storage and replication. The mutual-recognition threshold matches what nodes enforce server-side during payment verification.
Test plan
cargo test -p ant-core --lib)--all-targets --all-features -- -D warnings🤖 Generated with Claude Code