Iiuc this led to us misinterpreting injective balance metrics in alerts / dashboards
Solution
We already have the nativeToken config that comes from the SDK chain metadatas (at least for EVM chains - recall that atm all non-EVM chain configs are handcrafted. This should be addressed in https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/3325).
The configured native token decimals should be used for our balance metrics -- we should consider still keeping protocol-wide defaults to keep required configs slim
Specify the nativeToken in the JSON configs for any chains that don't already have them - e.g. all non-EVM chains are likely to not have this. As Injective is the motivating case for this ticket, also add injective
Problem
At the moment, we assume that a particular protocol type will always have the same number of decimals for their native token: https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/e737d998ff23b5aa6cf2be9634789ca5dc5a4275/rust/hyperlane-core/src/metrics/agent.rs#L24-L29
This is not the case for Cosmos - atm our
COSMOS_DECIMALS
is set to 6, which is correct for Neutron, but Injective's decimal count is 18: https://github.com/cosmos/chain-registry/blob/9a9a5860aebc27b280f4377adca93eab82c59e78/injective/assetlist.json#L14Iiuc this led to us misinterpreting injective balance metrics in alerts / dashboards
Solution
We already have the
nativeToken
config that comes from the SDK chain metadatas (at least for EVM chains - recall that atm all non-EVM chain configs are handcrafted. This should be addressed in https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/3325).nativeToken
in the JSON configs for any chains that don't already have them - e.g. all non-EVM chains are likely to not have this. As Injective is the motivating case for this ticket, also add injective