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 various bugs by using correct QueryTMProof func in IBC module #508

Closed
wants to merge 1 commit into from

Conversation

colin-axner
Copy link
Contributor

Use this SDK branch, replace in go.mod

Run make test

If you run into a prefix error, rerun the tests. It is an indeterminate error due to SDK config setup

@jackzampolin
Copy link
Member

Link to SDK patch: cosmos/cosmos-sdk@7ba386f

@colin-axner
Copy link
Contributor Author

Here is the link to the SDK patch pr. I can reopen it once the fix is tested on this relayer

When trying to run this branch, you'll likely run into an error which looks like this:

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xedec18]

goroutine 983 [running]:
github.com/tendermint/tendermint/light.(*Client).verifyLightBlock(0xc00001c180, 0x1b15ca8, 0xc000040150, 0xc000f2e620, 0xc025a30f059d7b50, 0x9e7862cab, 0x2508ea0, 0x4387a059d7b50, 0x59d7b5000d782e0)
	/home/bartleby/work/go/pkg/mod/github.com/tendermint/[email protected]/light/client.go:581 +0x2b8
github.com/tendermint/tendermint/light.(*Client).VerifyLightBlockAtHeight(0xc00001c180, 0x1b15ca8, 0xc000040150, 0x23, 0xc025a30f059d7b50, 0x9e7862cab, 0x2508ea0, 0x0, 0x0, 0x22)
	/home/bartleby/work/go/pkg/mod/github.com/tendermint/[email protected]/light/client.go:493 +0x12a
github.com/cosmos/relayer/relayer.(*Chain).GetLightSignedHeaderAtHeight(0xc000f659e0, 0x23, 0x0, 0x0, 0x0)
	/home/bartleby/work/go/src/github.com/cosmos/relayer/relayer/tm-light-client.go:323 +0x153
github.com/cosmos/relayer/relayer.(*Chain).InjectTrustedFields(0xc000f659e0, 0xc000f65b00, 0xc002380810, 0x0, 0xc000e1c0d0, 0x203000)
	/home/bartleby/work/go/src/github.com/cosmos/relayer/relayer/ibc-client.go:110 +0xf7
github.com/cosmos/relayer/relayer.(*Chain).GetIBCUpdateHeader(0xc000f659e0, 0xc000f65b00, 0x40fc5b, 0xc00251bcb0, 0x4532cc)
	/home/bartleby/work/go/src/github.com/cosmos/relayer/relayer/ibc-client.go:65 +0x85
github.com/cosmos/relayer/relayer.(*Chain).UpdateClient(0xc000f65b00, 0xc000f659e0, 0xc0012d5400, 0x0, 0xc00251bd80, 0x453505)
	/home/bartleby/work/go/src/github.com/cosmos/relayer/relayer/msgs.go:53 +0x4d

For some reason, the light client is having trouble accessing the light block needed for verification (presumably because the light store is empty). Instead of trying to fix this issue, I would recommend trying to remove the light client entirely #493. This will make any leftover issues much easier to debug

Any functionality the current relayer needs from the light client should be replaced by using the associated full node. Primarily for create client headers, update client headers, and getting the current block height. In this file you would replace light client dependency for a full node. This file will be removed. The associated light command line commands/documentation could be removed. This function will also need to be replaced with the latest height of the blockchain (ensure this is the latest height committed)

The ibc-go testing package may be a useful resource

@jackzampolin jackzampolin deleted the colin/query-tm-proof-fix branch October 25, 2021 22:12
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.

2 participants