Fix RPC hang: route ABCI via custom GRPCQueryRouter; enforce local-only bank iterators; make /abci_info responsive#10
Conversation
…auth/acc query tracing
…er; add debug logs for bank/auth/acc RPC path
…ing(store): force local-only iterators for bank/auth/acc on RPC/ABCI paths
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
User description
Fix RPC hang: route ABCI via custom GRPCQueryRouter; enforce local-only bank iterators; make /abci_info responsive
Summary
Fixes the RPC hanging issue where
thornode query bank balances <address>would timeout without gRPC flags, while keeping REST and gRPC behavior intact. The root cause was that ABCI queries (used by RPC) weren't routing through the customGRPCQueryRouterwithBankQueryWrapper, and bank store iterators could still attempt remote fetches causing hangs.Key changes:
BaseAppuses the customGRPCQueryRouterso ABCI queries hitBankQueryWrapperTHOR_FORK_DEBUG=1) to trace query paths and store operationsReview & Testing Checklist for Human
thornode query bank balances thor10qvy72uwd6en70w4ctswnx4534epghgcccu0dx -o jsonreturns promptly with correct balances (no timeout)curl http://localhost:26657/abci_inforeturns JSON without timing outcurl http://localhost:1317/cosmos/bank/v1beta1/balances/<addr>andthornode query bank balances <addr> --grpc-addr localhost:9090 --grpc-insecurereturn matching resultsTHOR_FORK_DEBUG=1, verify bank store operations logallowRemote=falseand no remote fetch attemptsNotes
THOR_FORK_DEBUG=1to avoid production noiseLink to Devin run: https://app.devin.ai/sessions/0b323a13287f4954866e09d7212be2d1
Requested by: @tiljrd
PR Type
Bug fix, Enhancement
Description
Fix RPC hanging issue for bank balance queries
Route ABCI queries through custom GRPCQueryRouter
Force local-only iterators for bank/auth/acc stores
Add debug logging for query path tracing
Diagram Walkthrough
File Walkthrough
app.go
Wire custom GRPCQueryRouter for ABCI queriesapp/app.go
store.go
Enforce local-only bank store operationsx/thorchain/forking/store.go
ReverseIterator)
query_service_router.go
Add debug logging to bank query wrapperapp/query_service_router.go