Skip to content

fix(platform): answer query request errors with INVALID_ARGUMENT - #5333

Merged
QuantumExplorer merged 3 commits into
v5.0-devfrom
fix/query-request-errors-invalid-argument
Oct 8, 2026
Merged

QuantumExplorer merged 3 commits into
v5.0-devfrom
fix/query-request-errors-invalid-argument

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Basic explanation

What this does: Some requests to a Platform node can't be answered, for example "prove these 0 data contracts" or "give me the next 0 group actions". About 20 query endpoints answered them with "unknown error" or "internal error". The node now answers "invalid request" (gRPC INVALID_ARGUMENT) instead. A request that already got a real answer, even an empty one, keeps getting it. Two smaller fixes come along: error messages are capped at 1 KB, and a keys request that used to fail now gets its answer.

Value: SDKs read "unknown" and "internal" as a broken node. They stop using that node for a while (a "ban") and send the request to the next node, which answers the same way. On the sakura devnet, three contracts.getMany([]) calls from evo-sdk banned all 13 nodes for at least 61 seconds. "Invalid request" is final for the SDKs: no ban, no retry on another node. A new end-to-end test shows all 13 nodes staying available.

Risks: Low. Queries are not consensus: no block execution code changes, and the proofs of the requests that are still served do not change. No request that got an answer before is refused now. Error messages over 1024 bytes are cut, with a note saying how many bytes were dropped.

Issue being fixed or feature implemented

The 5.0.0-beta.2 adversarial QA on devnet sakura found that limit 0 or an empty id list made about 15 endpoints answer UNKNOWN or INTERNAL, and that the SDK then banned every node. query_error_into_status turned every QueryError outside five variants into Status::unknown, and error_into_status turned every handler Err into Status::internal, including Drive's own query syntax errors.

The same report listed lower findings with the same cause, fixed here as well:

  • a composite page with $id IN over 100 values answered INTERNAL "corrupted code execution", while the plain query answered INVALID_ARGUMENT;
  • an error that repeats an oversized document type name went out whole in the grpc-message HTTP/2 header, which peers refuse past a few kilobytes, so the client saw INTERNAL.

#5331 fixes the same finding with checks in the gRPC methods. This PR takes three things from it: the rule to refuse only what fails today, its end-to-end test, and its book section. On top of that it covers the cases #5331 leaves as INTERNAL, including one #5331 documents as a known residual. The client side, which also protects against nodes older than this fix, is #5334.

What was done?

Two rules for the handlers (packages/rs-drive-abci/src/query/**/v0/mod.rs):

  • Refuse only what fails. A request with an answer, even an empty one, keeps it.
  • GroveDB cannot prove an empty query, or one with a limit of 0. With a proof, an empty id list or a limit of 0 is refused; without one, the answer is empty, as before.

Each handler checks the request before Drive sees it and refuses with a validation error, never with ?:

Endpoint Request Before (no proof / proof) After (no proof / proof)
getDataContracts ids: [] OK / INTERNAL OK / INVALID_ARGUMENT
getIdentitiesBalances ids: [] OK / OK, a proof the SDK cannot verify OK / INVALID_ARGUMENT
getIdentitiesContractKeys no ids, or no purposes OK / INTERNAL OK / INVALID_ARGUMENT
getEvonodesProposedEpochBlocksByIds ids: [] OK / UNKNOWN OK / INVALID_ARGUMENT
getIdentityTokenBalances, getIdentityTokenInfos token_ids: [] OK / UNKNOWN OK / INVALID_ARGUMENT
getIdentitiesTokenBalances, getIdentitiesTokenInfos identity_ids: [] OK / UNKNOWN OK / INVALID_ARGUMENT
getTokenStatuses token_ids: [] OK / UNKNOWN OK / INVALID_ARGUMENT
getAddressesInfos addresses: [] OK / UNKNOWN OK / INVALID_ARGUMENT
getIdentityKeys limit: 0 OK / INTERNAL OK / INVALID_ARGUMENT
getEpochsInfo count: 0 OK / UNKNOWN OK / INVALID_ARGUMENT
getIdentityKeys specific keys, limit below the number of ids INTERNAL / OK OK / OK, the same keys
getIdentityKeys key search without a limit INTERNAL / OK INVALID_ARGUMENT / OK
getDataContractHistory limit: 0, or over 10 INTERNAL INVALID_ARGUMENT
getProtocolVersionUpgradeVoteStatus count: 0 UNKNOWN INVALID_ARGUMENT
getEvonodesProposedEpochBlocksByRange limit: 0 INTERNAL INVALID_ARGUMENT
getContestedResourceIdentityVotes limit: 0 INTERNAL INVALID_ARGUMENT
getTokenPreProgrammedDistributions limit: 0 INTERNAL INVALID_ARGUMENT
getGroupInfos, getGroupActions count: 0 INTERNAL INVALID_ARGUMENT
getAddressesBranchState depth outside [6, 9] INTERNAL INVALID_ARGUMENT

Details:

  • Keys under a limit. Without a proof, GroveDB only fetches specific keys under a limit that covers every requested id. The handler now fetches them all and keeps the first limit keys that exist, in id order. Those are the keys the proof with that limit proves: ids [9, 0, 7, 3] with limit 2 return keys 0 and 3 in both modes.
  • Limit refusals. Five handlers (group infos, group actions, identity votes, pre-programmed distributions, evonode blocks by range) already computed the right refusal but returned it through ? as a Drive error. They now return it as a validation error naming the bound: limit 0 out of bounds of [1, 100] instead of limit greater than max limit 100.
  • Range checks. The branch-state depth is checked on the wire u32, so 263 is no longer read as 263 as u8 = 7. getEpochsInfo uses saturating_add for start_epoch + count.

Status mapping (packages/rs-drive-abci/src/query/service.rs)

  • Syntax errors. A Drive query syntax error is INVALID_ARGUMENT wherever it surfaces: returned by a handler (was INTERNAL) or reported as QueryError::Drive (was UNKNOWN). That also covers a document query whose clauses fail to parse.
  • Unchanged codes. Node faults stay INTERNAL. A request this node cannot decode, or a request version it does not serve, stays UNKNOWN, because a newer node may serve it.
  • Message cap. Status messages are cut to 1024 bytes at a character boundary, with ... (N bytes truncated).
  • One path. query_result_into_response is the one path from a handler result to a response or status, used by the service and by the tests.

Composite pages (packages/rs-drive/src/query/composite_document_query/mod.rs): page_ids turns a bad $id IN or $id == value into the plain query path's syntax errors instead of CorruptedCodeExecution.

Book: book/src/error-handling/drive-errors.md gains "Query errors on the wire": how statuses reach clients, the mapping, the two rules and the table above.

Examples:

getDataContracts { ids: [], prove: true }
Before: INTERNAL          query: storage: grovedb: invalid query: proved path queries can not be for limit 0
After:  INVALID_ARGUMENT  ids must contain at least one identifier when requesting a proof

getDataContracts { ids: [], prove: false }
Before: OK, no entries
After:  OK, no entries (unchanged)
getGroupInfos { contract_id, count: 0 }
Before: INTERNAL          query: storage: query: query invalid limit error: limit greater than max limit 100
After:  INVALID_ARGUMENT  query invalid limit error: limit 0 out of bounds of [1, 100]
getIdentityKeys { specific key_ids: [0, 1, 2], limit: 1, prove: false }
Before: INTERNAL          query: storage: grovedb: query error: request amount exceeded error terminal keys limit exceeded ...
After:  OK, key 0 (what the proof with limit 1 proves)
getDocuments v1, composite page with where $id IN [101 ids]
Before: INTERNAL          query: storage: drive: corrupted code execution error: a primary-key in clause holds an array
After:  INVALID_ARGUMENT  invalid IN clause error: in clause must have at most 100 values
getDocuments { document_type: "xxx…" (100,000 bytes) }
Before: INVALID_ARGUMENT  document type xxx… not found for contract GWRSAVFM…   (100,082-byte message in the grpc-message header)
After:  INVALID_ARGUMENT  document type xxx…... (99058 bytes truncated)   (1024 bytes plus the note)

Not changed:

  • Malformed protobuf bytes. tonic answers INTERNAL while decoding, before any handler runs, as the gRPC status code guide prescribes for a parse failure. Changing it needs a custom codec on both servers, and an SDK that encodes with prost never sends such bytes.
  • Documented defaults and served requests. getDocuments v0 limit: 0 and getShieldedEncryptedNotes count: 0 keep their documented meaning (the default, the maximum). Empty specific key ids and an empty key search are still answered in both modes. getPathElements with no keys is still answered.

In-place changes to shipped generations

  • What was edited: the v0 gRPC query handlers listed above, selected by every protocol version that serves them, and CompositeDocumentQuery::page_ids (protocol version 14).
  • Why consensus can't change: they only run when a node answers a gRPC query, and nothing in block execution calls them. The composite query module is only used by the query handlers and the client-side verifier.
  • What changes on the wire: for every request that is still served, the responses and proofs are byte-identical. The unproved specific-keys request under a limit, which failed before, now returns a subset of what it returns without the limit.

How Has This Been Tested?

  • packages/rs-drive-abci/tests/query_request_errors.rs (ported from fix(drive-abci): classify invalid query requests without banning nodes #5331), against the real QueryService over a fresh state:

    • every row of the table above, in both proof modes, plus requests without a version (still UNKNOWN);
    • three proof requests for no data contracts through the real DapiClient over 13 nodes: each reaches one node, gets INVALID_ARGUMENT, and bans none;
    • a node fault (INTERNAL, UNAVAILABLE) still bans the node and moves the request on.

    The test calls the service in-process instead of over an in-memory gRPC server, so rs-dapi-client is its only new dev-dependency. Run against the base branch's query code, the first two fail with exactly the "Before" column; the node-fault control passes either way.

  • Per-handler tests: each fixed handler has a should_refuse_…_as_invalid_argument test in its v0 module. They assert through assert_invalid_argument_status, which uses the service's own query_result_into_response, and check that the unproved request still gets its answer.

  • should_cap_an_unproved_specific_keys_request_like_its_proof compares the unproved keys with the keys the limited proof verifies to, for five id lists and limits.

  • Existing tests: those that pinned the old answers (Err(Drive(Query(InvalidLimit))), is_err()) are rewritten. test_branch_state_no_checkpoint_returns_error had only passed because its depth was out of range; it now uses a valid depth, so it tests the missing checkpoint.

  • service.rs: syntax errors from Drive map to INVALID_ARGUMENT; node faults and undecodable requests keep their codes; a message is cut at a character boundary; an oversized document type name comes back bounded, end to end.

  • composite.rs: should_refuse_a_malformed_by_ids_page_as_invalid_argument.

  • Commands:

    • cargo test -p drive-abci --lib query::: 791 passed
    • cargo test -p drive-abci --test query_request_errors: 3 passed
    • cargo test -p drive composite: 43 passed
    • cargo clippy -p drive-abci -p drive --all-features --all-targets -- -D warnings
    • cargo check -p drive --no-default-features --features verify
    • cargo fmt --all

Breaking Changes

None. Requests that failed before get INVALID_ARGUMENT (or, for keys under a limit, their answer); requests that were answered keep their answer.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · 6611c21

  • Bots — coderabbitai not yet · thepastaclaw not yet — /skip-bots proceeds without the ones not yet reported
  • Self-review — post /self-reviewed
  • Build running
  • Approvals — you own every area touched; none needed

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

About twenty query endpoints answered a request with an empty id list or a
limit of 0 with gRPC UNKNOWN or INTERNAL. Clients take those for node
faults, ban the node and send the request to the next one, so a few such
calls banned every node.

Each handler now refuses those requests itself, with INVALID_ARGUMENT, in
both proof modes:
- empty id lists: data contracts, identities balances, identities contract
  keys (ids or purposes), identity keys (specific keys or search purposes),
  evonode blocks by ids, identity and identities token balances and infos,
  token statuses, addresses infos;
- a limit or count of 0: identity keys, evonode blocks by range, contract
  history (and above its maximum of 10), protocol upgrade vote status,
  epochs info, identity votes, pre-programmed distributions, group infos,
  group actions;
- an addresses branch depth outside the allowed range, and an unproved key
  search without a limit.

Handlers that rejected a limit by returning a Drive query error through `?`
now return a validation error, and the service answers any Drive query
syntax error with INVALID_ARGUMENT. A composite page with `$id IN` over
100 values, or over values that are not identifiers, is refused like the
plain query instead of reporting corrupted code execution. Status messages
are cut at 1024 bytes, so an error echoing an oversized document type name
no longer exceeds HTTP/2 header limits.

Queries are not consensus: no block execution path changes and proof
contents are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: dashpay/platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 61140a5d-278a-48af-9c44-73e89f655998
📥 Commits

Reviewing files that changed from the base of the PR and between ad63a48 and 6611c21.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (27)
  • book/src/error-handling/drive-errors.md
  • packages/rs-drive-abci/Cargo.toml
  • packages/rs-drive-abci/src/query/address_funds/addresses_branch_state/v0/mod.rs
  • packages/rs-drive-abci/src/query/address_funds/addresses_infos/v0/mod.rs
  • packages/rs-drive-abci/src/query/data_contract_based_queries/data_contract_history/v0/mod.rs
  • packages/rs-drive-abci/src/query/data_contract_based_queries/data_contracts/v0/mod.rs
  • packages/rs-drive-abci/src/query/document_query/v1/dispatch/composite.rs
  • packages/rs-drive-abci/src/query/group_queries/group_actions/v0/mod.rs
  • packages/rs-drive-abci/src/query/group_queries/group_infos/v0/mod.rs
  • packages/rs-drive-abci/src/query/identity_based_queries/balances/v0/mod.rs
  • packages/rs-drive-abci/src/query/identity_based_queries/identities_contract_keys/v0/mod.rs
  • packages/rs-drive-abci/src/query/identity_based_queries/keys/v0/mod.rs
  • packages/rs-drive-abci/src/query/mod.rs
  • packages/rs-drive-abci/src/query/service.rs
  • packages/rs-drive-abci/src/query/system/epoch_infos/v0/mod.rs
  • packages/rs-drive-abci/src/query/system/version_upgrade_vote_status/v0/mod.rs
  • packages/rs-drive-abci/src/query/token_queries/identities_token_balances/v0/mod.rs
  • packages/rs-drive-abci/src/query/token_queries/identities_token_infos/v0/mod.rs
  • packages/rs-drive-abci/src/query/token_queries/identity_token_balances/v0/mod.rs
  • packages/rs-drive-abci/src/query/token_queries/identity_token_infos/v0/mod.rs
  • packages/rs-drive-abci/src/query/token_queries/token_pre_programmed_distributions/v0/mod.rs
  • packages/rs-drive-abci/src/query/token_queries/token_status/v0/mod.rs
  • packages/rs-drive-abci/src/query/validator_queries/proposed_block_counts_by_evonode_ids/v0/mod.rs
  • packages/rs-drive-abci/src/query/validator_queries/proposed_block_counts_by_range/v0/mod.rs
  • packages/rs-drive-abci/src/query/voting/contested_resource_identity_votes/v0/mod.rs
  • packages/rs-drive-abci/tests/query_request_errors.rs
  • packages/rs-drive/src/query/composite_document_query/mod.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet · thepastaclaw ✓. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Oct 8, 2026
@thepastaclaw

thepastaclaw commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

🔍 Review in progress — actively reviewing now (commit 6611c21) · triage: normal
██████████████░░░░░░ 70% · about 5 min left · running for 9 min
✅ triage → ✅ Phase 1 → ✅ verify 1 → ✅ gate → ⏳ Phase 2 (2/5 lanes) → ▫️ verify 2 → ▫️ fresh Phase 2 → ▫️ fresh verify → ▫️ publish
Estimated from recent reviews of this tier · updated 16:10 UTC · live progress

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 1 + Phase 2

Verified both supplied findings against head 994d5c7: the empty-search validation misses searches containing only empty nested maps, and the status-message bound comment incorrectly describes a prefix limit as a total-message limit. Both are non-blocking; no blocking findings were supplied or confirmed. Validation was static only; the supplied CI snapshot reports successful Rust workspace tests and Swift/Kotlin checks, with PR Hygiene pending.

🟡 1 suggestion(s) | 💬 1 nitpick(s)

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — The cross-cutting query validation and gRPC error-mapping changes span many endpoints but do not themselves change consensus, funds movement, cryptography, key handling, network deserialization, or storage migrations.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 15% left, 5h 100% left), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-drive-abci/src/query/identity_based_queries/keys/v0/mod.rs`:
- [SUGGESTION] packages/rs-drive-abci/src/query/identity_based_queries/keys/v0/mod.rs:69-73: Validate that a search contains at least one purpose/security-level pair
  The new guard rejects an empty outer map but accepts an equivalent empty search such as `purpose_map = { AUTHENTICATION: SecurityLevelMap { security_level_map: {} } }`. `IdentityKeysRequest::construct_search_query` skips every purpose whose nested map is empty, so this request produces the same empty GroveDB query that the new validation intends to refuse. With an explicit positive limit, it also bypasses the separate unproved-search limit check. Reject searches when all nested maps are empty, and cover this representation in both proof modes with a positive limit. A mixed map containing empty and nonempty entries should remain accepted.

In `packages/rs-drive-abci/src/query/service.rs`:
- [NITPICK] packages/rs-drive-abci/src/query/service.rs:87-91: Describe the status-message bound as a prefix limit
  `bounded_message` keeps up to 1024 bytes and then appends `... (N bytes truncated)`, so the final message exceeds `MAX_STATUS_MESSAGE_BYTES`. This behavior is explicitly documented in the PR description and reflected in the test's `MAX_STATUS_MESSAGE_BYTES + 64` assertion; it is not a functional defect. Correct the constant's comment so future callers do not mistake it for a total-message size guarantee.

…ific keys

Refuse only what fails today, as #5331 does: an empty id list, an identity
keys limit of 0 and an epochs count of 0 are refused only when a proof is
asked, since GroveDB cannot prove an empty query. Without a proof they keep
their empty answer. Empty specific key ids and an empty key search, which
both proof modes already answer, are no longer refused.

An unproved specific-keys request whose limit is below its number of ids
failed inside GroveDB with an internal error. The handler now fetches every
requested id and keeps the first `limit` keys that exist, in id order: the
keys the proof with that limit proves.

Ported from #5331: an end-to-end test through the real `QueryService` and
`DapiClient`, which checks every changed request in both proof modes, that
three empty contract proof requests leave all 13 nodes available, and that
a node fault still bans the node; and a book section on how query errors
reach clients. The test calls the service in-process, so `rs-dapi-client`
is its only new dev-dependency.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-10-08T15:59:57.010Z

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet · thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

QuantumExplorer added a commit that referenced this pull request Oct 8, 2026
Nodes now answer an empty id list without a proof with an empty result, as
they always did, and refuse only a proof of it (#5333). The client follows:
`names_nothing` holds only for a proved request, with the node's message,
and the identity keys request has no entry, since nodes answer empty
specific key ids and an empty key search in both proof modes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-review — Final validation — Phase 1 + Phase 2

Verified the complete diff at head 457299a and found no blocking correctness or consensus-safety issues. One documentation nit remains; the empty-search validation recommendation is withdrawn, and the proposed Drive helper is outside this PR's required scope. Validation was static only: Rust workspace tests and PR Hygiene remained pending in the supplied CI snapshot taken at 2026-10-08T14:43:51Z.

💬 1 nitpick(s)

1 carried-forward finding(s) already raised on this PR; not re-posting as new inline comments.

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 8: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 9: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 10: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 11: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 12: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — The change is broad and alters query validation, error mapping, and response handling, but does not itself change consensus, funds movement, cryptography, key handling, network deserialization, or storage migrations.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (antigravity below 15% reserve: weekly 15% left, 5h 100% left), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.

In `packages/rs-drive-abci/src/query/service.rs`:
- [NITPICK] packages/rs-drive-abci/src/query/service.rs:87-91: Describe the status-message bound as a prefix limit
  (existing thread: https://github.com/dashpay/platform/pull/5333#discussion_r4219442949)
  MAX_STATUS_MESSAGE_BYTES bounds the retained prefix, not the complete status message: bounded_message truncates at a UTF-8 boundary and then appends `... (N bytes truncated)` at lines 1208–1210. The PR example correctly describes this as "1024 bytes plus the note," and the regression tests permit the additional suffix. Align this comment and the book's message-cap explanation with that distinction so future header-budget calculations do not treat 1024 bytes as a strict total-message maximum. No truncation behavior needs to change.
Out-of-scope follow-up suggestions (3)

These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.

  • Pre-existing query synchronization loop can retain blocking workers indefinitely — In packages/rs-drive-abci/src/query/service.rs:147–165, counter is reset inside every polling iteration, so the intended 100-iteration timeout cannot fire. If the committed height advances beyond the captured platform-state snapshot, the loop neither refreshes that snapshot nor exits, retaining a blocking worker indefinitely. The same implementation exists at base ad63a48 and is not worsened by this PR, but the query-service availability impact warrants separate tracking.
    • Follow-up: Track a separate issue or maintainer-requested PR to bound the synchronization wait, reload the state snapshot after a mismatch, and cover a height advance between snapshot acquisition and the guard check with a deterministic regression test.
  • Centralize limited existing-key retrieval in Drive — Out of scope — the direct generic Drive fetch passes the original limit to the optional-result query at both base and head; this PR does not introduce that native-caller constraint. The handler's distinct-ID bound makes fetch-all-then-truncate bounded, SerializedKeyVec filters absent keys before truncation, and the new regression test compares the result with the limited proof. Adding a separate query-facing Drive API is an adjacent ownership redesign, not required for the stated gRPC repair; leaving the shared consensus-used fetch implementation unchanged is appropriate.
    • Follow-up: Consider creating a separate issue or author/maintainer-requested PR for this.
  • Own limited specific-key fetching in Drive — Out of scope — this overlaps the proposed Drive-helper redesign above. The existing generic optional-result fetch contract is unchanged, while the RPC adapter safely expands its bounded storage-fetch limit and applies the requested response cap. No incorrect endpoint result, dependency inversion, or newly broken native API was established.
    • Follow-up: Consider creating a separate issue or author/maintainer-requested PR for this.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. and removed waiting-bots Waiting for the review bots to report on this head labels Oct 8, 2026
The note about dropped bytes is appended after the 1024 kept bytes, so the
constant bounds the prefix, not the whole message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai not yet · thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed bot-review-skipped A required review bot did not report; it was skipped by the window or by a person. labels Oct 8, 2026
@QuantumExplorer
QuantumExplorer merged commit d28689f into v5.0-dev Oct 8, 2026
22 of 24 checks passed
@QuantumExplorer
QuantumExplorer deleted the fix/query-request-errors-invalid-argument branch October 8, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-bots Waiting for the review bots to report on this head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants