Forking: bank balances local-first with remote fallback and graceful NotFound#13
Forking: bank balances local-first with remote fallback and graceful NotFound#13tiljrd wants to merge 7442 commits intotil/forkingfrom
Conversation
…rnal nullLogger (to not confuse simulated swap logs with Mainnet swap logs)
…rower) to avoid list failures Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
…case-insensitive address match Co-Authored-By: francesco@bloctopus.io <ocsenarf@outlook.com>
… pool asset before parsing
…/0X and case-insensitive match
…er with {asset=**}; regenerate gateway/types
This allows mimir transactions to bypass all ante handlers including the SDK's DeductFeeDecorator, enabling them to work in test/forking environments where validators may not have unbonded funds.
In forking mode, the bond module may have 0 balance. This change checks the bond module balance before attempting to transfer fees and skips the transfer if insufficient, allowing mimir transactions to succeed in test/forking environments.
…authz integration
…kv-collision app: deduplicate KVStoreKeys to fix 'acc' collision after authz integration
…d on remote balances as empty for graceful fallback
🤖 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:
|
|||||||||
…back, and write materialization
… bankkeeper.Keeper
…rtion during service registration
…(local precedence)
…ks; use value-returning remote client
Full Forking Bank Keeper Implementation
Summary
Implements a complete forking bank keeper under
x/bloctopusthat replaces THORChain's standard bank keeper when forking is enabled. The keeper provides transparent access to mainnet balance data while maintaining local-first behavior and materializing remote state on writes.Key Features:
grpc.thor.pfc.zone) and returns merged balances with local precedencebankkeeper.Keeperinterface so all modules (staking/mint/wasm/authz/denom/thorchain) use it transparently--fork.grpcand--fork.chain-idflags are providedArchitecture:
ForkingBankKeeperembedsbankkeeper.BaseKeeperand adds remote gRPC clientGetBalance,GetAllBalances,IterateAccountBalances) for remote fallbackensureMaterialized()before base operationsReview & Testing Checklist for Human
--fork.grpc=grpc.thor.pfc.zone:443 --fork.chain-id=thorchain-1, query balance of mainnet-only address via/cosmos/bank/v1beta1/balances/{addr}, send coins to that address, re-query to confirm remote+local mergegrpc.thor.pfc.zoneis unreachable - should gracefully fall back to local-only without breaking core functionalityNotes
(nil, nil)on errors, masking potential issues but preventing crashesLink to Devin run: https://app.devin.ai/sessions/005c15c5a6a54dab8494af7a0e7f5ad5
Requested by: Til Jordan (@tiljrd)