Skip to content

Improve assetslist.json validation #3467

@omniwired

Description

@omniwired
Contributor

Feature request:

When a user adds a ibc trace, compare the value from:
"base": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2",
with the one provided at chain path

Example:

      "type_asset": "ics20",
      "base": "ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2",
      "name": "Cosmos Hub Atom",
      "display": "atom",
      "symbol": "ATOM",
      "traces": [
        {
          "type": "ibc",
          "counterparty": {
            "chain_name": "cosmoshub",
            "base_denom": "uatom",
            "channel_id": "channel-141"
          },
          "chain": {
            "channel_id": "channel-0",
            "path": "transfer/channel-0/uatom"
          }
        }
      ],

The algorithm to use is described in the cosmos SDK.

Via command line it would be:

echo -n "transfer/channel-0/uatom" | sha256sum

27394fb092d2eccd56123c74f36e4c1f926001ceada9ca97ea622b25f41e5eb2

Activity

JeremyParish69

JeremyParish69 commented on Jun 4, 2024

@JeremyParish69
Contributor

I assume you're pointing out the difference being in lower vs uppercase? The on-chain ics20 denoms shift letters to uppercase.

omniwired

omniwired commented on Jun 5, 2024

@omniwired
ContributorAuthor

hi Jeremy, it's not about the case being different but adding an automatic check that does the following.

1- Compare the value provided in the base key against the sha256 of the IBC path.
2- Inform the user and/or refuse to merge if the base and sha256 equivalent are different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @omniwired@JeremyParish69

        Issue actions

          Improve assetslist.json validation · Issue #3467 · cosmos/chain-registry