Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

IBC Connection Demo #34

Merged
merged 24 commits into from
Mar 10, 2020
Merged

IBC Connection Demo #34

merged 24 commits into from
Mar 10, 2020

Conversation

jackzampolin
Copy link
Member

@jackzampolin jackzampolin commented Feb 21, 2020

This is the PR for working connections. Will merge once connection handshakes are working. The CI currently tests that.

NOTE: this is for both the tx raw conn-* commands and the tx connection-step commands.

jackzampolin and others added 12 commits February 21, 2020 12:02
* Use light client API directly

* Remove all direct store access

* Add some comments and fix two-chainz

* Update to latest SDK

* Merge PR #38: verifier: update to the latest Tendermint light client

* refactor UpdateLiteDBsToLatestHeaders

* refactor GetLatestHeaders

* use channel

* close channel via defer

* update verifier to the latest lite version

ValidateBasic was removed because lite does this.

Co-authored-by: Jack Zampolin <[email protected]>

Co-authored-by: Jack Zampolin <[email protected]>
Co-authored-by: Anton Kaliaev <[email protected]>
@cwgoes
Copy link
Contributor

cwgoes commented Mar 9, 2020

Running two-chains.sh on the latest commit, I get:

{"height":"0","txhash":"9DF8677AA34E9CE7C5F335A1BF035893F0AC11A1994D2ED6F5C97DE304865C06","codespace":"client","code":6,"raw_log":"client type not found: cannot update client with ID ibconeclient","gas_wanted":"200000","gas_used":"45559"}
{"height":"0","txhash":"09C605EF9CED3022E182391E0F2BD2AB60FA8712478A02F1B914C90F8D13E3D7","codespace":"client","code":6,"raw_log":"client type not found: cannot update client with ID ibczeroclient","gas_wanted":"200000","gas_used":"45569"}

Is this a known problem?

@jackzampolin
Copy link
Member Author

I'm getting the following error which is different:

$ go run main.go --home $RLY tx client ibc0 ibc1 clientoneprime -i
{
  "height": "0",
  "txhash": "2440F865196C247756F2927304DC131B059BFF2A0944B80E51AB219DE6D36A82",
  "codespace": "tendermint",
  "code": 3,
  "raw_log": "invalid header: header failed validatebasic with its own chain-id"
}

@cwgoes
Copy link
Contributor

cwgoes commented Mar 9, 2020

Hmm, I get that now as well, maybe that's the cause of the client type error later actually.

Are we running ValidateBasic() on the header prior to creating the client? We should be.

@cwgoes
Copy link
Contributor

cwgoes commented Mar 9, 2020

Looks like at least the version of Tendermint we are importing here expects the header to have a NextValidatorSet, and I suspect that's likely the problem with CreateClient as well.

@jackzampolin jackzampolin changed the title WIP Relayer Demo IBC Connection Demo Mar 9, 2020
@jackzampolin
Copy link
Member Author

Ok, thanks to @cwgoes and @AdityaSripal we made some great progress today. I've taken the work we did and made the necessary changes in the codebase. One thing that I did additionally is update the relayer tx connection-step command to work up to the current debugging point and modify ci-chains.sh to expect a working connection. So once that is passing as written we should merge this PR and start on some new work.

@cwgoes
Copy link
Contributor

cwgoes commented Mar 10, 2020

I've added back the timestamp in cosmos/cosmos-sdk#5774 & updated all branches, the leaf values now match, and two-chains.sh fails with:

{"height":"9","txhash":"B67ABC7EE102A3B629201D6EB36136820FA87CCAFA24677F221BDC6BB8B1E646","raw_log":"[{\"msg_index\":0,\"log\":\"\",\"events\":[{\"type\":\"connection_open_init\",\"attributes\":[{\"key\":\"connection_id\",\"value\":\"connectionidtest\"},{\"key\":\"client_id\",\"value\":\"ibconeclient\"},{\"key\":\"counterparty_client_id\",\"value\":\"ibczeroclient\"}]},{\"type\":\"message\",\"attributes\":[{\"key\":\"action\",\"value\":\"connection_open_init\"},{\"key\":\"module\",\"value\":\"ibc_connection\"},{\"key\":\"sender\",\"value\":\"cosmos1w9cjphczwvrvgevdl7hlue7ylzleauy9qa7pc5\"}]}]}]","logs":[{"msg_index":0,"log":"","events":[{"type":"connection_open_init","attributes":[{"key":"connection_id","value":"connectionidtest"},{"key":"client_id","value":"ibconeclient"},{"key":"counterparty_client_id","value":"ibczeroclient"}]},{"type":"message","attributes":[{"key":"action","value":"connection_open_init"},{"key":"module","value":"ibc_connection"},{"key":"sender","value":"cosmos1w9cjphczwvrvgevdl7hlue7ylzleauy9qa7pc5"}]}]}],"gas_wanted":"200000","gas_used":"56139"}
{"height":"11","txhash":"68E595B9CCFED09ED6329ADA7C9CE816614E3EAB35B8ADA74174A53367213AF6","codespace":"client","code":13,"raw_log":"client consensus state verification failed: calculated root hash is invalid: expected [32 206 32 97 71 37 11 33 89 192 253 171 41 55 151 152 219 107 219 114 188 3 2 243 129 11 227 218 21 253 241 10] but got [228 103 228 144 238 130 100 210 161 125 132 255 216 66 164 249 220 93 21 175 216 96 141 60 125 25 228 44 226 185 107 53]: failed to execute message; message index: 1","gas_wanted":"200000","gas_used":"114882"}

Looking into that now.

@cwgoes
Copy link
Contributor

cwgoes commented Mar 10, 2020

Connection handshake working end-to-end in #45.

@jackzampolin
Copy link
Member Author

Ok! Since this code is now working to create connections I'm going to merge this branch and we can move on to a channel debugging branch! 🎉 💃

@jackzampolin jackzampolin merged commit 053298f into master Mar 10, 2020
@jackzampolin jackzampolin deleted the jack/debuggin branch March 10, 2020 15:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants