Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ibc/07-tendermint: MsgCreateClient has a "SignedHeader" json field #5983

Closed
4 tasks
ebuchman opened this issue Apr 10, 2020 · 1 comment
Closed
4 tasks

ibc/07-tendermint: MsgCreateClient has a "SignedHeader" json field #5983

ebuchman opened this issue Apr 10, 2020 · 1 comment

Comments

@ebuchman
Copy link
Member

Summary of Bug

MsgCreateClient contains a field with type Header which contains an embedded SignedHeader along with a "validator_set". However the embedded field is not unrolled so the resulting JSON has a field called "SignedHeader". Presumably we want the SignedHeader to be unrolled so that each of "header", "commit, and "validator_set" are at the same level, or at least for it to be proper snake_case. Adding a JSON dump to the test gives:

{
  "type": "ibc/client/MsgCreateClient",
  "value": {
    "client_id": "tendermint",
    "header": {
      "SignedHeader": {
        "header": {
          "version": {
            "block": "2",
            "app": "2"
          },
          "chain_id": "gaia",
          "height": "4",
          "time": "2020-01-02T00:00:00Z",
          "last_block_id": {
            "hash": "0000000000000000000000000000000000000000000000000000000000000000",
            "parts": {
              "total": "9223372036854775807",
              "hash": "0000000000000000000000000000000000000000000000000000000000000000"
            }
          },
          "last_commit_hash": "E7AAD01A1AF897B05BCF78C7563B5D1ADC2939D543DAC949A5C8712156D19BF8",
          "data_hash": "6D6E28B8B98B5327042EA50A57DD46E6CC851C72E528BDEAA6EFDEEEFE66A0B8",
          "validators_hash": "6D48E3DE5778140DEA5FB4E57CD8FC4DC1774DF2E6923181BD1DD115E18584C5",
          "next_validators_hash": "6D48E3DE5778140DEA5FB4E57CD8FC4DC1774DF2E6923181BD1DD115E18584C5",
          "consensus_hash": "E5E566C41ED57E3FF8CC10F184178788B8FAA602B07CF1F425217BD8179F1F24",
          "app_hash": "41CAFAE31CC70F5801FA1016A2DD54A9BCB8201B5B389919FE9976762532C516",
          "last_results_hash": "092E058630247ED6009863A12EEE117D26CD9D08B5ADCAAB37F2AB35DB475A37",
          "evidence_hash": "73865DB08F49D58428905D389AB4CA4B96E45A3206C7A69D43A5DC7372E60714",
          "proposer_address": "A2EDB64E5F4834206D9E371F19A4E3770525AD61"
        },
        "commit": {
          "height": "4",
          "round": "1",
          "block_id": {
            "hash": "C11E93A6DD7AEB82A7794B59D7D2E0E5DCFC8B0481835BAAA91BAEC8923C0023",
            "parts": {
              "total": "3",
              "hash": "87080A39CFE336A663EA5C0D9BDEEF493ABDC18B7C3E3E0C8E661354C1831432"
            }
          },
          "signatures": [
            {
              "block_id_flag": 2,
              "validator_address": "A2EDB64E5F4834206D9E371F19A4E3770525AD61",
              "timestamp": "2020-01-02T00:00:00Z",
              "signature": "RymybNrwkRBz8eg3XJSLUmNzVd2hWWdLlJPrJeOHSCAYmCCiQYchY1M8FjMcYL4BqxOahTG7dDYX5wCn8OZrBQ=="
            }
          ]
        }
      },
      "validator_set": {
        "validators": [
          {
            "address": "A2EDB64E5F4834206D9E371F19A4E3770525AD61",
            "pub_key": {
              "type": "tendermint/PubKeyEd25519",
              "value": "ZAbhOHN5TCuZSbzcKG8wBal6tp7ClAFUxsheffE2DTo="
            },
            "voting_power": "10",
            "proposer_priority": "0"
          }
        ],
        "proposer": {
          "address": "A2EDB64E5F4834206D9E371F19A4E3770525AD61",
          "pub_key": {
            "type": "tendermint/PubKeyEd25519",
            "value": "ZAbhOHN5TCuZSbzcKG8wBal6tp7ClAFUxsheffE2DTo="
          },
          "voting_power": "10",
          "proposer_priority": "0"
        }
      }
    },
    "trusting_period": "1209600000000000",
    "unbonding_period": "1814400000000000",
    "address": "cosmos1hcusxqtdzx9jcqjgxpx5ty3cq67xht2c3syr7v"
  }
}

Version

ibc-alpha branch b85f82e

Steps to Reproduce

JSON dump the MsgCreateClient

We might want to build something that dumps all the msg types to JSON and runs some simple lints on it to prevent this in the future. Also we might want to double check them by eye just to make sure it all looks good.

This isn't a big deal in practice (not a bug per se), but we should try to be consistent and sensible with the JSON types which will help the overall UX and implementing in other langs.

Maybe this all goes away with proto, not sure. In any case, we might still want to have that JSON dumping tool so we can still sanity check everything.


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@github-actions
Copy link
Contributor

github-actions bot commented Jul 5, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant