Conversation
… with all-seen-shares proof
Base automatically changed from
fspreiss/CON-1708-add-is_reject-to-metadata
to
master
April 14, 2026 13:20
michael-weigelt
approved these changes
Apr 14, 2026
eichhorl
approved these changes
Apr 14, 2026
eichhorl
reviewed
Apr 14, 2026
eichhorl
approved these changes
Apr 15, 2026
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.
Strengthens the
ResponsesTooLargeerror for flexible HTTP outcalls to prevent a malicious block proposer from fabricating the error by selectively omitting small OK shares.metadata_shares→all_seen_sharesinFlexibleCanisterHttpError::ResponsesTooLargeand the corresponding protobuf message, so the error now carries all seen shares (both OK and reject), not just a subset.find_flexible_result) to emit all OK and reject shares intoall_seen_shares.is_reject(from CON-1708) to partition shares, computenum_unseenandmin_known_ok_needed, and verify that the smallest set of OK responses genuinely exceedsMAX_CANISTER_HTTP_PAYLOAD_SIZE. An early check rejects payloads with too few OK shares before computing sizes.FlexibleInsufficientMetadataShareCountwith the more descriptiveFlexibleResponsesTooLargeInsufficientEvidenceerror variant.Attack vector closed
Previously, a malicious proposer could craft a
ResponsesTooLargeerror by including only a few hand-picked large OK shares while omitting committee members who submitted small responses. The validator would check only the provided shares and accept the error as valid.Now, the validator computes
num_unseen = committee_size - all_seen_shares.len()andmin_known_ok_needed = min_responses - num_unseen. Since unseen members could have submitted zero-size OK responses, the validator conservatively assumes they did. A proposer who omits members increasesnum_unseen, which lowersmin_known_ok_needed, making it harder to prove responses are too large—the opposite of what an attacker wants.Test plan
flexible_build_responses_too_large— builder emits all 4 OK sharesflexible_build_responses_too_large_with_rejects_reducing_unseen— builder emits 3 OK + 2 reject sharesflexible_error_responses_too_large_valid— all committee members with huge OK → acceptedflexible_error_responses_too_large_valid_with_unseen_members— legitimate error with 1 unseen member → acceptedflexible_error_responses_too_large_valid_with_mixed_ok_and_reject— 2 huge OK + 2 reject, all seen → acceptedflexible_error_responses_too_large_invalid_when_small— small OK shares + high unseen → rejected (min_known_ok_needed=0)flexible_error_responses_too_large_invalid_when_committee_members_omitted— attacker omits members, num_unseen defeats the claim → rejectedflexible_error_responses_too_large_too_few_ok_shares— not enough OK shares for min_known_ok_needed →InsufficientEvidence