Forking: bank keeper with local-first reads and TLS gRPC fallback; wire in app; scaffold forking KV under x/bloctopus - #14
Conversation
…LS gRPC fallback, and denom metadata fallback; wire bank keeper as interface
🤖 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:
|
||||||||||||||||
…d read endpoint from --fork.grpc (with hyphenated flag aliases)
…th forking KV service when fork.enabled
… forking bank store
…) to match SDK on til/forking
…ch runtime.NewKVStoreService
…p store/types for keys
… metadata on init when fork.enabled
…te TLS gRPC; wire endpoint into KVStoreService
… rely on keeper to materialize with proper codec
…odule so QueryServer hits our overrides
User description
Forking: Bank keeper with local-first reads and TLS gRPC fallback
Summary
Implements a
ForkingBankKeeperunderx/bloctopus/forkbankthat provides local-first balance and metadata queries with remote mainnet fallback via TLS gRPC togrpc.thor.pfc.zone:443. When querying balances or denom metadata, the keeper first checks local storage and falls back to querying mainnet if the data doesn't exist locally. For write operations likeSendCoins, the keeper relies on the base keeper's internal logic which will call back into our overriddenGetBalancemethods to materialize remote balances locally when needed.Key changes:
bankkeeper.BaseKeeperand implementsbankkeeper.KeeperinterfaceTHORChainApp.BankKeeperfrom concreteBaseKeepertoKeeperinterfacex/bloctopus/forkingfor future KV store functionalityReview & Testing Checklist for Human
🔴 HIGH RISK - Core banking functionality changes
grpc.thor.pfc.zone:443is unreachable - should gracefully return empty resultsHasBalance(addr, NewCoin(denom, NewInt(1)))logic correctly distinguishes local vs remote accounts across different scenariosNotes
grpc.thor.pfc.zone:443x/bloctopus/forkingfiles are mostly empty scaffolds and not used yetLink to Devin run: https://app.devin.ai/sessions/005c15c5a6a54dab8494af7a0e7f5ad5
Requested by: Til Jordan (@tiljrd)
PR Type
Enhancement
Description
Implement
ForkingBankKeeperwith local-first balance queriesAdd TLS gRPC fallback to mainnet for missing data
Wire bank keeper as interface in app configuration
Scaffold forking KV store infrastructure under
x/bloctopusDiagram Walkthrough
File Walkthrough
2 files
Wire ForkingBankKeeper as interface in appCommand line flags for forking configuration8 files
Core forking bank keeper implementationTLS gRPC client for mainnet queriesType definitions for forking keeperGas meter wrapper for SDK integrationMerged iterator scaffold for KV operationsKV store service wrapper scaffoldKV store wrapper scaffoldConfiguration types for forking options2 files
Empty iterator scaffold fileEmpty cache scaffold file