-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
Summary
agcli disk cache keys for expensive chain queries are not network/endpoint scoped in affected versions, so cached data from one network can be reused on another network.
This can cause commands to return valid-looking but incorrect data (from a different chain), without errors.
Criticalness
- Operators and bots frequently switch between
local/test/finney/archiveon the same machine. - Cache TTL is long enough (5 min) to hit cross-run contamination.
- Output looks normal; no hard failure warns the user.
- This can drive incorrect staking/operations decisions based on wrong network state.
Reproduction
agcli --network finney view overview --output json > finney.json
agcli --network test view overview --output json > test.jsonThe second command may reuse cached data from the first network instead of fetching fresh data for testnet.
Root cause
Disk cache keys are global and not namespaced by network/endpoint/chain identity.
Code path:
- QueryCache reads/writes fixed keys like all_subnets and all_dynamic_info
- Disk path is ~/.agcli/cache/.json
- No network scope in key construction
Proposed fix
Scope disk keys by connection context, e.g.:
- v2_<endpoint_hash>_all_subnets
- v2_<endpoint_hash>_all_dynamic_info
Chain-id/genesis scoped is also valid; endpoint-scoped can be a clean minimal fix.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels