fix(x): optimize gprc queries for collection use#2046
Conversation
Signed-off-by: Artur Troian <troian@users.noreply.github.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Disabled knowledge base sources:
WalkthroughTwo keeper modules refactor their gRPC query handlers to support multi-path traversal strategies for list operations. Deployment queries now route through direct-get, owner-path, or state-index paths with conditional logic based on provided filters. Similarly, Orders, Bids, and Leases queries adopt branching path resolution with distinct helpers for direct-get, owner-prefix, provider-index, and state-index traversals, maintaining consistent pagination and state filtering across paths. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant QueryHandler
participant PathResolver
participant KVStore
participant EscrowService
Client->>QueryHandler: Query request (filters, pagination)
QueryHandler->>PathResolver: Determine execution path<br/>(direct-get, owner-path, provider-path, state-index)
alt Direct-Get Path
PathResolver->>KVStore: Fetch single entity by primary keys
else Owner-Path
PathResolver->>KVStore: Iterate by owner prefix
else Provider-Path
PathResolver->>KVStore: Iterate by provider index
else State-Index Path
PathResolver->>KVStore: Iterate by state index
end
PathResolver->>KVStore: Apply state filter & pagination offset/limit
loop For Each Result Item
KVStore->>EscrowService: Fetch related escrow account/payment
EscrowService-->>KVStore: Return escrow data
end
PathResolver->>QueryHandler: Encode next pagination key
QueryHandler-->>Client: Return paginated results with next-key
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
I have...
!to the type prefix if API or client breaking changeCHANGELOG.md