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

Fix query header and node-state cli cmds #192

Merged
merged 6 commits into from
May 24, 2021

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented May 24, 2021

Description

closes: #190
closes: #61


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@colin-axner
Copy link
Contributor Author

colin-axner commented May 24, 2021

Tested in various ways, but achieves desired purpose of verifying a counterparty chain via consensus states:

$ gaiad q ibc client consensus-states 07-tendermint-0 --node tcp://localhost:27000
consensus_states:
- consensus_state:
    '@type': /ibc.lightclients.tendermint.v1.ConsensusState
    next_validators_hash: A19419B856881CD94A27E0ED7EC6ADAD9FA749C5543D601E39AC6C4FB95CD8E0
    root:
      hash: IbhPNTZYeUYdk3pfZHHWP8VG/gefxGxkkvUuTrmVKkA=
    timestamp: "2021-05-20T13:49:41.169759553Z"
  height:
    revision_height: "906"
    revision_number: "0"
    
$ gaiad q ibc client node-state --node tcp://localhost:27010 --height 906
next_validators_hash: A19419B856881CD94A27E0ED7EC6ADAD9FA749C5543D601E39AC6C4FB95CD8E0
root:
  hash: IbhPNTZYeUYdk3pfZHHWP8VG/gefxGxkkvUuTrmVKkA=
timestamp: "2021-05-20T13:49:41.169759553Z"

also allows query ibc client header to be used

$ gaiad q ibc client header --node tcp://localhost:27010 --height 906
signed_header:
  commit:
    block_id:
      hash: IOpZATpVW/JKT/7EhoTRqLJzviVT7np1EixE6mIO/g4=
      part_set_header:
        hash: FnKMdWuov+4NAcrgd0Emc+Xgy+dUc4I7FjWI0YF/180=
        total: 1
    height: "906"
    round: 0
    signatures:
    - block_id_flag: BLOCK_ID_FLAG_COMMIT
      signature: /QcJBKCHUntTukTBfdNPAEoyvP69ZYBeEcWsqW8Nl+k7KMfJTentq3CBw/Rp3wgeOdIM436RbuMnj1kPj451Cw==
      timestamp: "2021-05-20T13:49:46.182641326Z"
      validator_address: g+iimYfeUMx9HKhZRHokk+g8uAw=
  header:
    app_hash: IbhPNTZYeUYdk3pfZHHWP8VG/gefxGxkkvUuTrmVKkA=
    chain_id: network2
    consensus_hash: BICRvH3cKD93v7+R1zxE2ljD34qcvIZ0Bdi389qtoi8=
    data_hash: xpX8QUJZ+WG5ZrPy1jGCpZsmmbDImvkuwCnmZ+p17nI=
    evidence_hash: 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
    height: "906"
    last_block_id:
      hash: O6MIgBMvDE77HILi2Rhi3zbiXEe8On8bH18tbpmbV/o=
      part_set_header:
        hash: 0Z3Xb5gfI1VFEr6Gp9zg/KjHH87TDNU/Ah4Fd37h4E4=
        total: 1
    last_commit_hash: Y21hmqKj77WcnHGNYd9pKkk9o28hf494j0Pa/ukz7uQ=
    last_results_hash: kVWQfIjTRnxHpwIT5U/0TQLEKDh3SREy/xrU3Y6oiQ8=
    next_validators_hash: oZQZuFaIHNlKJ+DtfsatrZ+nScVUPWAeOaxsT7lc2OA=
    proposer_address: g+iimYfeUMx9HKhZRHokk+g8uAw=
    time: "2021-05-20T13:49:41.169759553Z"
    validators_hash: oZQZuFaIHNlKJ+DtfsatrZ+nScVUPWAeOaxsT7lc2OA=
    version:
      app: "0"
      block: "11"
trusted_height:
  revision_height: "0"
  revision_number: "0"
trusted_validators: null
validator_set:
  proposer:
    address: g+iimYfeUMx9HKhZRHokk+g8uAw=
    proposer_priority: "0"
    pub_key:
      ed25519: TD4e73q9ncj/hXsN7uaok6QjcqLmVI130rK+3fwMntE=
    voting_power: "100"
  total_voting_power: "100"
  validators:
  - address: g+iimYfeUMx9HKhZRHokk+g8uAw=
    proposer_priority: "0"
    pub_key:
      ed25519: TD4e73q9ncj/hXsN7uaok6QjcqLmVI130rK+3fwMntE=
    voting_power: "100"

note that the app_hash is now in the correct format

@colin-axner colin-axner enabled auto-merge (squash) May 24, 2021 14:07
@colin-axner colin-axner merged commit 4570955 into main May 24, 2021
@colin-axner colin-axner deleted the colin/190-consensus-state-cli branch May 24, 2021 15:57
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

Successfully merging this pull request may close these issues.

output of ibc client consensus-states can't be correlated with /commit?height Fix ibc client header cli cmd
2 participants