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

Migrate to Gaia v3.0 #278

Merged
merged 57 commits into from
Sep 21, 2020
Merged

Migrate to Gaia v3.0 #278

merged 57 commits into from
Sep 21, 2020

Conversation

jackzampolin
Copy link
Member

@jackzampolin jackzampolin commented Aug 27, 2020

Current Status: #281

@jackzampolin
Copy link
Member Author

make test-gaia pulls the latest build of gaiav3.0 branch.

@zmanian
Copy link
Member

zmanian commented Aug 27, 2020

You have local replace directives in the go.mod FYI

@jackzampolin
Copy link
Member Author

jackzampolin commented Aug 30, 2020

Ok, so this branch is now compiling and running a developer environment with ./dev-env. Due to the changes there are some significant refactors that need to be undertaken. Below is the planned order:

  • Lite client initialization - the lite client isn't initializing properly. Need to debug this.
  • Submitting transactions is currently broken.
  • Refactor connection handshake messages - the arguments changed substantially here and make take some work to get right.
  • Packet Commitment sequences - This code has changed considerably. The previous version required a good deal of relayer side code where as the new version has a more streamlined flow.
  • Packet relaying - this flow has changed considerably and previously relied on a type in the relayer. Need to figure out the new flow.

@jackzampolin
Copy link
Member Author

jackzampolin commented Sep 1, 2020

Ok to reproduce the current error make sure you have gaia checked out to jack/gaiav3.0 and run ./dev-env skip from the root of this repo.

$ ./dev-env skip
Generating gaia configurations...
Creating gaiad instance with home=./data chain-id=ibc0 p2p=:26656 rpc=:26657...
Creating gaiad instance with home=./data chain-id=ibc1 p2p=:26556 rpc=:26557...
Building Relayer...
installing rly binary...
Generating rly configurations...
added path demo...
added chain ibc0...
added chain ibc1...

Key cosmos1h3jlfsfhp3hqp8tfnf2gmcqnaj0msrnpmefwpe imported from ibc0 to relayer...
Key cosmos104gh7dqzy6gpr05sytdqttyzc6l3z6ppfswkpn imported from ibc1 to relayer...

Creating lite clients...

I[2020-09-01|16:20:50.313] - [ibc0] -> creating client (ibconeclient) for [ibc1]header-height{9} trust-period(336h0m0s) 
I[2020-09-01|16:20:50.341] - [ibc1] -> creating client (ibczeroclient) for [ibc0]header-height{9} trust-period(336h0m0s) 
I[2020-09-01|16:20:50.361] - [ibc0] -> sending transaction:             
I[2020-09-01|16:20:50.361] ✘ [ibc0]@{0} - msg(0:create_client) err(sdk:2:Mismatched "*ics23.InnerSpec": {TagNum: 1, GotWireType: "bytes" != WantWireType: "varint"}: tx parse error) 
I[2020-09-01|16:20:50.361] - transaction response:                      
{"txhash":"0963B2FD26C149A4B3A67695259B1A3E4FC93EE5A13088D0DE52ABC68E7C8E5B","codespace":"sdk","code":2,"raw_log":"Mismatched \"*ics23.InnerSpec\": {TagNum: 1, GotWireType: \"bytes\" != WantWireType: \"varint\"}: tx parse error","logs":null}
I[2020-09-01|16:20:50.381] - [ibc1] -> sending transaction:             
I[2020-09-01|16:20:50.381] ✘ [ibc1]@{0} - msg(0:create_client) err(sdk:2:Mismatched "*ics23.InnerSpec": {TagNum: 1, GotWireType: "bytes" != WantWireType: "varint"}: tx parse error) 
I[2020-09-01|16:20:50.381] - transaction response:                      
{"txhash":"EBD5E08670461C8FD2B125AFD5C8CA190E2A9B2E9D7093FF78FF0033140B6274","codespace":"sdk","code":2,"raw_log":"Mismatched \"*ics23.InnerSpec\": {TagNum: 1, GotWireType: \"bytes\" != WantWireType: \"varint\"}: tx parse error","logs":null}
Error: err: cannot proto marshal <nil>: failed packing protobuf message to Any [cosmos/[email protected]/x/ibc/02-client/types/codec.go:62] 

Blocked on cosmos/cosmos-sdk#7211

@michaelfig michaelfig mentioned this pull request Sep 3, 2020
4 tasks
@@ -432,7 +432,8 @@ func relayPacketFromQueryResponse(src, dst *PathEnd, res *ctypes.ResultTx,
rp.packetData = []byte(p.Value)
}
if string(p.Key) == "packet_timeout_height" {
timeout, _ := strconv.ParseUint(strings.Split(string(p.Value), "-")[0], 10, 64)
fmt.Println("TIMEOUT HEIGHT VALUE:", string(p.Value))
timeout, _ := strconv.ParseUint(strings.Split(string(p.Value), "-")[1], 10, 64)
rp.timeout = timeout
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: rp.timeout should eventually become a clienttypes.Height struct

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there an open issue on the SDK for this? Do we need to track this workstream somewhere?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already done in the SDK, this is a relayer issue. I mean that the relayer structs like relayMsgRecvPacket and relayMsgTimeout still use a uint64 to represent timeout height. The SDK uses clienttypes.Height and the relayer currently hacks around this by getting the epoch height from the sending chain like so:

https://github.com/ovrclk/relayer/blob/jack%2Fgaiav3.0/relayer/naive-strategy.go#L434

And then recreating a clienttypes.Height for the receiving chain like so:

https://github.com/ovrclk/relayer/blob/jack%2Fgaiav3.0/relayer/relayPackets.go#L162

Instead, the relayer structs should have timeoutHeight be a clienttypes.Height struct and then simply parse the height from the events and place the clienttypes.Height in the relayer struct. Then the full height with the epoch number can be sent to the receiving chain.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would allow the relayer to work for chains with non-zero epochs

@jackzampolin
Copy link
Member Author

Once the issue with rly start {path} not receiving transaction notifications is fixed, will merge this branch into master.

@jackzampolin jackzampolin merged commit 372bbfb into master Sep 21, 2020
@jackzampolin jackzampolin deleted the jack/gaiav3.0 branch September 21, 2020 22:45
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.

4 participants