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

How to increase gas limit when creating IBC clients? #1055

Closed
rootulp opened this issue Apr 8, 2024 · 3 comments
Closed

How to increase gas limit when creating IBC clients? #1055

rootulp opened this issue Apr 8, 2024 · 3 comments

Comments

@rootulp
Copy link
Contributor

rootulp commented Apr 8, 2024

Context

I'm trying to use interchaintest to test ICA on Celestia. I'm connecting Celestia to Cosmos Hub via interchaintest. When I start my interchaintest, I encounter:

   ica_test.go:57:
        	Error Trace:	/Users/rootulp/git/rootulp/celestiaorg/celestia-app/test/interchain/ica_test.go:57
        	Error:      	Received unexpected error:
        	            	failed to link path path on relayer &{%!s(*relayer.DockerRelayer=&{0x14001695e30 {0x14001695e30 []} f31db91af875170f502f80a2f3470f996de6c8e4b507d82644832d716ca8ebc6 0x14000a0a500 3c749427439d36bf88143bf63d142b4f4512c2385d08ba9dbd02135848872028 TestICA <nil> true <nil> map[celestia:0x14001883380 cosmoshub-4:0x1400235e8d0] /home/relayer})} between chains celestia and cosmoshub-4: exit code 1:  2024-04-08T01:32:30.992241Z	debug	Creating client	{"src_chain_id": "celestia", "dst_chain_id": "cosmoshub-4", "dst_header_height": 8, "trust_period": 1540800}
        	            	2024-04-08T01:32:30.993793Z	debug	Creating client	{"src_chain_id": "cosmoshub-4", "dst_chain_id": "celestia", "dst_header_height": 8, "trust_period": 1540800}
        	            	2024-04-08T01:32:30.994798Z	debug	No client found on source chain tracking the state of counterparty chain; creating client	{"src_chain_id": "celestia", "dst_chain_id": "cosmoshub-4"}
        	            	2024-04-08T01:32:30.996727Z	debug	No client found on source chain tracking the state of counterparty chain; creating client	{"src_chain_id": "cosmoshub-4", "dst_chain_id": "celestia"}
        	            	2024-04-08T01:32:32.181501Z	warn	Sent transaction but received failure response	{"provider_type": "cosmos", "chain_id": "cosmoshub-4", "msg_types": ["/ibc.core.client.v1.MsgCreateClient"], "response": {"height": 9, "tx_hash": "5AC452E31B94916FD55D47CA38E925BAF01D8633C4DB93C3EDB566B6788EC296", "codespace": "sdk", "code": 11, "data": "", "events": []}}
        	            	2024-04-08T01:32:32.181543Z	info	Failed sending transaction	{"chain_id": "cosmoshub-4", "msg-0": {"msg_json": "{\"client_state\":{\"chain_id\":\"celestia\",\"trust_level\":{\"numerator\":\"1\",\"denominator\":\"3\"},\"trusting_period\":\"1540800000000000\",\"unbonding_period\":\"1814400000000000\",\"max_clock_drift\":\"600000000000\",\"frozen_height\":{},\"latest_height\":{\"revision_height\":\"8\"},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"],\"allow_update_after_expiry\":true,\"allow_update_after_misbehaviour\":true},\"consensus_state\":{\"timestamp\":\"2024-04-08T01:32:28.575842966Z\",\"root\":{\"hash\":\"H754Y37JCHanXLOSStdo68x6jGTJV0NLcO760HKWc3c=\"},\"next_validators_hash\":\"EEBE6BCCB720854C32A2682194E2BDB2FECA294D4DF54148829C61868406B61F\"},\"signer\":\"cosmos16ftu9zeq8wg2hgrx4yh20873llp864xgmezqpp\"}"}, "error": "out of gas", "errorVerbose": "out of gas\ncosmossdk.io/errors.Wrap\n\t/root/go/pkg/mod/cosmossdk.io/errors@v1.0.0-beta.7/errors.go:187\ncosmossdk.io/errors.ABCIError\n\t/root/go/pkg/mod/cosmossdk.io/errors@v1.0.0-beta.7/errors.go:75\ngithub.com/cosmos/relayer/v2/relayer/chains/cosmos.(*CosmosProvider).sdkError\n\t/go/relayer/chains/cosmos/tx.go:343\ngithub.com/cosmos/relayer/v2/relayer/chains/cosmos.(*CosmosProvider).waitForTx\n\t/go/relayer/chains/cosmos/tx.go:440\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_arm64.s:1172"}
        	            	2024-04-08T01:32:32.675534Z	info	Successful transaction	{"provider_type": "cosmos", "chain_id": "celestia", "gas_used": 108878, "fees": "279utia", "fee_payer": "celestia1tetf5yec5rx6dez3xdjm0866tyk8e7rmjxmqnh", "height": 9, "msg_types": ["/ibc.core.client.v1.MsgCreateClient"], "tx_hash": "6228D0D0B3D6CB0B538EDA5F72BFE9E7FE3FCA11ADBD6A8A0E2CFC432F332AA5"}
        	            	2024-04-08T01:32:32.675595Z	info	Client Created	{"src_chain_id": "celestia", "src_client_id": "07-tendermint-0", "dst_chain_id": "cosmoshub-4"}
        	            	2024-04-08T01:32:34.238469Z	warn	Sent transaction but received failure response	{"provider_type": "cosmos", "chain_id": "cosmoshub-4", "msg_types": ["/ibc.core.client.v1.MsgCreateClient"], "response": {"height": 10, "tx_hash": "7AB0AECC03E3668072E6A62EC52ECD11BEF899690853CF3C92728FE50A8F4F19", "codespace": "sdk", "code": 11, "data": "", "events": []}}
        	            	2024-04-08T01:32:34.238557Z	info	Failed sending transaction	{"chain_id": "cosmoshub-4", "msg-0": {"msg_json": "{\"client_state\":{\"chain_id\":\"celestia\",\"trust_level\":{\"numerator\":\"1\",\"denominator\":\"3\"},\"trusting_period\":\"1540800000000000\",\"unbonding_period\":\"1814400000000000\",\"max_clock_drift\":\"600000000000\",\"frozen_height\":{},\"latest_height\":{\"revision_height\":\"8\"},\"proof_specs\":[{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":33,\"min_prefix_length\":4,\"max_prefix_length\":12,\"hash\":1}},{\"leaf_spec\":{\"hash\":1,\"prehash_value\":1,\"length\":1,\"prefix\":\"AA==\"},\"inner_spec\":{\"child_order\":[0,1],\"child_size\":32,\"min_prefix_length\":1,\"max_prefix_length\":1,\"hash\":1}}],\"upgrade_path\":[\"upgrade\",\"upgradedIBCState\"],\"allow_update_after_expiry\":true,\"allow_update_after_misbehaviour\":true},\"consensus_state\":{\"timestamp\":\"2024-04-08T01:32:28.575842966Z\",\"root\":{\"hash\":\"H754Y37JCHanXLOSStdo68x6jGTJV0NLcO760HKWc3c=\"},\"next_validators_hash\":\"EEBE6BCCB720854C32A2682194E2BDB2FECA294D4DF54148829C61868406B61F\"},\"signer\":\"cosmos16ftu9zeq8wg2hgrx4yh20873llp864xgmezqpp\"}"}, "error": "out of gas", "errorVerbose": "out of gas\ncosmossdk.io/errors.Wrap\n\t/root/go/pkg/mod/cosmossdk.io/errors@v1.0.0-beta.7/errors.go:187\ncosmossdk.io/errors.ABCIError\n\t/root/go/pkg/mod/cosmossdk.io/errors@v1.0.0-beta.7/errors.go:75\ngithub.com/cosmos/relayer/v2/relayer/chains/cosmos.(*CosmosProvider).sdkError\n\t/go/relayer/chains/cosmos/tx.go:343\ngithub.com/cosmos/relayer/v2/relayer/chains/cosmos.(*CosmosProvider).waitForTx\n\t/go/relayer/chains/cosmos/tx.go:440\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_arm64.s:1172"}

Question

How can I manually increase the gas limit used by the ibc-go relayer when creating clients?

@rootulp rootulp changed the title how to increase gas limit when creating IBC clients How to increase gas limit when creating IBC clients? Apr 8, 2024
@rootulp
Copy link
Contributor Author

rootulp commented Apr 9, 2024

FWIW I tried manually bumping the GasAdjustment from something sane 1.1 to 10 to 100 and couldn't resolve. My Cosmos Hub chain spec:

package chainspec

import (
	"github.com/strangelove-ventures/interchaintest/v6"
	"github.com/strangelove-ventures/interchaintest/v6/ibc"
)

const (
	cosmosDockerRepository = "ghcr.io/strangelove-ventures/heighliner/gaia"
	cosmosDockerVersion    = "v15.1.0"
)

var Cosmos = &interchaintest.ChainSpec{
	Name: "gaia",
	ChainConfig: ibc.ChainConfig{
		Type:                   "cosmos",
		Name:                   "gaia",
		ChainID:                "cosmoshub-4",
		Bin:                    "gaiad",
		Bech32Prefix:           "cosmos",
		Denom:                  "uatom",
		GasPrices:              "0.01uatom",
		GasAdjustment:          100.0,
		TrustingPeriod:         "504hours",
		NoHostMount:            false,
		UsingNewGenesisCommand: true,
		Images:                 cosmosDockerImages(),
	},
	NumValidators: numValidators(),
	NumFullNodes:  numFullNodes(),
}

func cosmosDockerImages() []ibc.DockerImage {
	return []ibc.DockerImage{
		{
			Repository: cosmosDockerRepository,
			Version:    cosmosDockerVersion,
			UidGid:     "1025:1025",
		},
	}
}

@jtieri
Copy link
Contributor

jtieri commented Apr 9, 2024

interesting, i would have expected that to resolve the issue. give me some time to reproduce this issue locally and see if i can't figure something out!

@rootulp
Copy link
Contributor Author

rootulp commented Apr 10, 2024

I was able to circumvent this problem. It turns out the gas adjustment I was providing was nested in the ibc.ChainConfig but in order to have it applied to the create client command, I needed to provide it as a field to interchaintest.ChainSpec. In other words, this worked for me

var cosmosHub = &interchaintest.ChainSpec{
	Name: "gaia",
	ChainConfig: ibc.ChainConfig{
		Name:                   "gaia",
		Type:                   "cosmos",
		ChainID:                "gaia",
		Bin:                    "gaiad",
		Bech32Prefix:           "cosmos",
		Denom:                  "uatom",
		GasPrices:              "0.01uatom",
		GasAdjustment:          *gasAdjustment(),
		TrustingPeriod:         "504hours",
		NoHostMount:            false,
		Images:                 cosmosDockerImages(),
		UsingNewGenesisCommand: true,
	},
	NumValidators: numValidators(),
	NumFullNodes:  numFullNodes(),
	GasAdjustment: gasAdjustment(), // the default gas estimation fails to create a client on Cosmos Hub so we need to bump it up.
}

func gasAdjustment() *float64 {
	gasAdjustment := 2.0
	return &gasAdjustment
}

@rootulp rootulp closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
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

2 participants