Remove LocalCosmosAddress from SDK Config + Derive Address Internally From Keyring
#232
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR removes the redundant
LocalCosmosAddressfield from the SDK’sAccountConfigand rewires the SDK to derive the signer’s Cosmos address internally from the providedKeyring + KeyName.This change improves correctness, reduces configuration surface area, and ensures SDK behavior cannot drift due to mismatched config inputs.
Why This Change Was Needed
❌ Previous Design Problems
KeyNameand the correspondingLocalCosmosAddress.✔️ New Design Principles
SDK config should contain only primary inputs, not derived data.
The Cosmos address is fully determined by
(Keyring, KeyName).The SDK should internally and reliably perform:
This makes the SDK simpler, safer, and impossible to misconfigure.
What Was Changed
1. Removed
LocalCosmosAddressfromAccountConfigCallers now only provide:
2. Updated
FactoryConfigandClientFactoryLocalCosmosAddressfromFactoryConfig.KeyNameinstead.ClientFactorynow resolves and caches the signer’s address internally:3. Updated
CascadeTaskReplaced:
with:
Since address resolution now happens inside the factory, the task no longer needs an explicit address.
4. Updated all internal call-sites
Any SDK module that previously referenced:
now uses:
client.signerAddr(cached once in constructor), orkeyringpkg.GetAddress(cfg.Account.Keyring, cfg.Account.KeyName)if needed temporarily.Backward Compatibility
✔️ No breaking changes for chains, Lumera modules, or Supernode protocols.
✔️ No changes to on-chain metadata format.
✔️ No changes to StartCascade / Download flows.
❗ Breaking change for SDK callers:
They must remove
LocalCosmosAddressfrom their config and only passKeyName+Keyring.(This change is deliberate and improves correctness.)
Benefits
Testing
LocalCosmosAddress.MsgRequestActionvalidations.