From 618947d90d8f579057dd74fc4fa0baa242165a38 Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 5 Sep 2023 16:25:01 +0100 Subject: [PATCH 01/20] chore: adding scaffolding function and workflow for v8 upgrade --- .github/workflows/e2e-upgrade.yaml | 13 +++++++++++++ e2e/tests/upgrades/upgrade_test.go | 2 ++ 2 files changed, 15 insertions(+) diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml index f478e72dd92..2ace6e7755c 100644 --- a/.github/workflows/e2e-upgrade.yaml +++ b/.github/workflows/e2e-upgrade.yaml @@ -57,3 +57,16 @@ jobs: test-entry-point: "TestUpgradeTestSuite" test: "TestV7ToV7_1ChainUpgrade" upload-logs: true + + upgrade-v8: + uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main + with: + chain-image: ghcr.io/cosmos/ibc-go-simd + chain-binary: simd + chain-a-tag: v7.0.0 + chain-b-tag: v7.0.0 + chain-upgrade-tag: main # TODO: update this to a real tag once v8 is released + upgrade-plan-name: "v8" + test-entry-point: "TestUpgradeTestSuite" + test: "TestV7ToV8ChainUpgrade" + upload-logs: true diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index e4a2bd59ce4..9d83f617bf0 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -673,6 +673,8 @@ func (s *UpgradeTestSuite) TestV7ToV7_1ChainUpgrade() { }) } +func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() {} + // RegisterInterchainAccount will attempt to register an interchain account on the counterparty chain. func (s *UpgradeTestSuite) RegisterInterchainAccount(ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, msgRegisterAccount *intertxtypes.MsgRegisterAccount) { txResp := s.BroadcastMessages(ctx, chain, user, msgRegisterAccount) From c1e33590b9441a8a3630331d6d36f4c4d6c371d0 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 6 Sep 2023 09:46:10 +0100 Subject: [PATCH 02/20] chore: adding basic scaffolding for upgrade test --- e2e/tests/upgrades/upgrade_test.go | 56 +++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index 9d83f617bf0..e6a57153830 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -673,7 +673,61 @@ func (s *UpgradeTestSuite) TestV7ToV7_1ChainUpgrade() { }) } -func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() {} +func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { + t := s.T() + testCfg := testsuite.LoadConfig() + + ctx := context.Background() + relayer, channelA := s.SetupChainsRelayerAndChannel(ctx) + chainA, chainB := s.GetChains() + + chainADenom := chainA.Config().Denom + + chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) + chainAAddress := chainAWallet.FormattedAddress() + + chainBWallet := s.CreateUserOnChainB(ctx, testvalues.StartingTokenAmount) + chainBAddress := chainBWallet.FormattedAddress() + + s.Require().NoError(test.WaitForBlocks(ctx, 1, chainA, chainB), "failed to wait for blocks") + + t.Run("transfer native tokens from chainA to chainB", func(t *testing.T) { + transferTxResp := s.Transfer(ctx, chainA, chainAWallet, channelA.PortID, channelA.ChannelID, testvalues.DefaultTransferAmount(chainADenom), chainAAddress, chainBAddress, s.GetTimeoutHeight(ctx, chainB), 0, "") + s.AssertTxSuccess(transferTxResp) + }) + + t.Run("tokens are escrowed", func(t *testing.T) { + actualBalance, err := s.GetChainANativeBalance(ctx, chainAWallet) + s.Require().NoError(err) + + expected := testvalues.StartingTokenAmount - testvalues.IBCTransferAmount + s.Require().Equal(expected, actualBalance) + }) + + t.Run("start relayer", func(t *testing.T) { + s.StartRelayer(relayer) + }) + + chainBIBCToken := testsuite.GetIBCToken(chainADenom, channelA.Counterparty.PortID, channelA.Counterparty.ChannelID) + + t.Run("packet is relayed", func(t *testing.T) { + s.AssertPacketRelayed(ctx, chainA, channelA.PortID, channelA.ChannelID, 1) + + actualBalance, err := chainB.GetBalance(ctx, chainBAddress, chainBIBCToken.IBCDenom()) + s.Require().NoError(err) + + expected := testvalues.IBCTransferAmount + s.Require().Equal(expected, actualBalance) + }) + + s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA), "failed to wait for blocks") + + t.Run("upgrade chain", func(t *testing.T) { + govProposalWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount) + s.UpgradeChain(ctx, chainA, govProposalWallet, testCfg.UpgradeConfig.PlanName, testCfg.ChainConfigs[0].Tag, testCfg.UpgradeConfig.Tag) + }) + +} // RegisterInterchainAccount will attempt to register an interchain account on the counterparty chain. func (s *UpgradeTestSuite) RegisterInterchainAccount(ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, msgRegisterAccount *intertxtypes.MsgRegisterAccount) { From b41931cb7ad3a29a9e584daabbd325e103e774b0 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 6 Sep 2023 12:10:07 +0100 Subject: [PATCH 03/20] chore: duplicating sdk function temporarily --- e2e/testsuite/sanitize/params.go | 7 ++++ e2e/testsuite/testconfig.go | 57 +++++++++++++++++++++++++++----- 2 files changed, 56 insertions(+), 8 deletions(-) create mode 100644 e2e/testsuite/sanitize/params.go diff --git a/e2e/testsuite/sanitize/params.go b/e2e/testsuite/sanitize/params.go new file mode 100644 index 00000000000..729ae38ec5f --- /dev/null +++ b/e2e/testsuite/sanitize/params.go @@ -0,0 +1,7 @@ +package sanitize + +import govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + +func GovV1Params(version string, params *govv1.Params) *govv1.Params { + return params +} diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index b60328d65a9..6bd2fe7bd3a 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -1,12 +1,17 @@ package testsuite import ( + "bytes" "encoding/json" "fmt" + "io" "os" "path" "strings" + tmjson "github.com/cometbft/cometbft/libs/json" + cmttypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/version" "github.com/strangelove-ventures/interchaintest/v7/ibc" interchaintestutil "github.com/strangelove-ventures/interchaintest/v7/testutil" "gopkg.in/yaml.v2" @@ -20,6 +25,7 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/ibc-go/e2e/relayer" + "github.com/cosmos/ibc-go/e2e/testsuite/sanitize" "github.com/cosmos/ibc-go/e2e/testvalues" ) @@ -435,19 +441,52 @@ func getGenesisModificationFunction(cc ChainConfig) func(ibc.ChainConfig, []byte icadSupportsGovV1Genesis := testvalues.IcadGovGenesisFeatureReleases.IsSupported(version) if simdSupportsGovV1Genesis || icadSupportsGovV1Genesis { - return defaultGovv1ModifyGenesis() + return defaultGovv1ModifyGenesis(version) } return defaultGovv1Beta1ModifyGenesis() } +// AppGenesisFromReader reads the AppGenesis from the reader. +// TODO: this function is a duplicate of one that was added in the SDK. Remove this function in https://github.com/cosmos/ibc-go/issues/4556 +func AppGenesisFromReader(reader io.Reader) (*genutiltypes.AppGenesis, error) { + jsonBlob, err := io.ReadAll(reader) + if err != nil { + return nil, err + } + + var appGenesis genutiltypes.AppGenesis + if err := json.Unmarshal(jsonBlob, &appGenesis); err != nil { + // fallback to CometBFT genesis + var ctmGenesis cmttypes.GenesisDoc + if err2 := tmjson.Unmarshal(jsonBlob, &ctmGenesis); err2 != nil { + return nil, fmt.Errorf("error unmarshalling AppGenesis: %w\n failed fallback to CometBFT GenDoc: %w", err, err2) + } + + appGenesis = genutiltypes.AppGenesis{ + AppName: version.AppName, + // AppVersion is not filled as we do not know it from a CometBFT genesis + GenesisTime: ctmGenesis.GenesisTime, + ChainID: ctmGenesis.ChainID, + InitialHeight: ctmGenesis.InitialHeight, + AppHash: ctmGenesis.AppHash, + AppState: ctmGenesis.AppState, + Consensus: &genutiltypes.ConsensusGenesis{ + Validators: ctmGenesis.Validators, + Params: ctmGenesis.ConsensusParams, + }, + } + } + return &appGenesis, nil +} + // defaultGovv1ModifyGenesis will only modify governance params to ensure the voting period and minimum deposit // are functional for e2e testing purposes. -func defaultGovv1ModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, error) { +func defaultGovv1ModifyGenesis(version string) func(ibc.ChainConfig, []byte) ([]byte, error) { return func(chainConfig ibc.ChainConfig, genbz []byte) ([]byte, error) { - var appGenesis genutiltypes.AppGenesis - if err := json.Unmarshal(genbz, &appGenesis); err != nil { - return nil, fmt.Errorf("failed to unmarshal genesis bytes into SDK AppGenesis: %w", err) + appGenesis, err := AppGenesisFromReader(bytes.NewReader(genbz)) + if err != nil { + return nil, fmt.Errorf("failed to unmarshal genesis bytes into genesis doc: %w", err) } var appState genutiltypes.AppMap @@ -455,7 +494,7 @@ func defaultGovv1ModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, error) { return nil, fmt.Errorf("failed to unmarshal genesis bytes into app state: %w", err) } - govGenBz, err := modifyGovAppState(chainConfig, appState[govtypes.ModuleName]) + govGenBz, err := modifyGovAppState(chainConfig, version, appState[govtypes.ModuleName]) if err != nil { return nil, err } @@ -467,7 +506,7 @@ func defaultGovv1ModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, error) { return nil, err } - bz, err := json.MarshalIndent(appGenesis, "", " ") + bz, err := tmjson.MarshalIndent(appGenesis, "", " ") if err != nil { return nil, err } @@ -521,7 +560,7 @@ func defaultGovv1Beta1ModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, err } // modifyGovAppState takes the existing gov app state and marshals it to a govv1 GenesisState. -func modifyGovAppState(chainConfig ibc.ChainConfig, govAppState []byte) ([]byte, error) { +func modifyGovAppState(chainConfig ibc.ChainConfig, chainVersion string, govAppState []byte) ([]byte, error) { cfg := testutil.MakeTestEncodingConfig() cdc := codec.NewProtoCodec(cfg.InterfaceRegistry) @@ -537,6 +576,8 @@ func modifyGovAppState(chainConfig ibc.ChainConfig, govAppState []byte) ([]byte, govGenesisState.Params = &govv1.Params{} } + govGenesisState.Params = sanitize.GovV1Params(chainVersion, govGenesisState.Params) + govGenesisState.Params.MinDeposit = sdk.NewCoins(sdk.NewCoin(chainConfig.Denom, govv1beta1.DefaultMinDepositTokens)) vp := testvalues.VotingPeriod govGenesisState.Params.VotingPeriod = &vp From 635bc3cd246a52ac463d7751e679409f94f0d878 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 6 Sep 2023 15:06:15 +0100 Subject: [PATCH 04/20] chore: happy path test passing --- e2e/tests/upgrades/upgrade_test.go | 2 +- e2e/testsuite/codec.go | 33 ++++++++++++++++++++++++++++++ e2e/testsuite/sanitize/params.go | 7 ------- e2e/testsuite/testconfig.go | 22 +++++++++----------- testing/simapp/upgrades.go | 12 +++++++++++ 5 files changed, 56 insertions(+), 20 deletions(-) delete mode 100644 e2e/testsuite/sanitize/params.go diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index e6a57153830..2be98d01243 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -717,7 +717,7 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { s.Require().NoError(err) expected := testvalues.IBCTransferAmount - s.Require().Equal(expected, actualBalance) + s.Require().Equal(expected, actualBalance.Int64()) }) s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA), "failed to wait for blocks") diff --git a/e2e/testsuite/codec.go b/e2e/testsuite/codec.go index 1422120a3a1..9fc6818f9cf 100644 --- a/e2e/testsuite/codec.go +++ b/e2e/testsuite/codec.go @@ -1,9 +1,13 @@ package testsuite import ( + "bytes" "encoding/hex" "fmt" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/gogoproto/jsonpb" + "github.com/cosmos/gogoproto/proto" intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types" upgradetypes "cosmossdk.io/x/upgrade/types" @@ -112,3 +116,32 @@ func UnmarshalMsgResponses(txResp sdk.TxResponse, msgs ...codec.ProtoMarshaler) return nil } + +// MustProtoMarshalJSON provides an auxiliary function to return Proto3 JSON encoded +// bytes of a message. +// NOTE: Copied from https://github.com/cosmos/cosmos-sdk/blob/971c542453e0972ef1dfc5a80159ad5049c7211c/codec/json.go +// and modified in order to allow `EmitDefaults` to be set to false for ics20 packet marshalling. +// This allows for the introduction of the memo field to be backwards compatible. +func MustProtoMarshalJSON(msg proto.Message) []byte { + anyResolver := codectypes.NewInterfaceRegistry() + + // EmitDefaults is set to false to prevent marshalling of unpopulated fields (memo) + // OrigName and the anyResovler match the fields the original SDK function would expect + // in order to minimize changes. + + // OrigName is true since there is no particular reason to use camel case + // The any resolver is empty, but provided anyways. + jm := &jsonpb.Marshaler{OrigName: true, EmitDefaults: false, AnyResolver: anyResolver} + + err := codectypes.UnpackInterfaces(msg, codectypes.ProtoJSONPacker{JSONPBMarshaler: jm}) + if err != nil { + panic(err) + } + + buf := new(bytes.Buffer) + if err := jm.Marshal(buf, msg); err != nil { + panic(err) + } + + return buf.Bytes() +} diff --git a/e2e/testsuite/sanitize/params.go b/e2e/testsuite/sanitize/params.go deleted file mode 100644 index 729ae38ec5f..00000000000 --- a/e2e/testsuite/sanitize/params.go +++ /dev/null @@ -1,7 +0,0 @@ -package sanitize - -import govv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - -func GovV1Params(version string, params *govv1.Params) *govv1.Params { - return params -} diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index 6bd2fe7bd3a..abd27d28a45 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -8,9 +8,11 @@ import ( "os" "path" "strings" - + "github.com/cosmos/gogoproto/jsonpb" + "github.com/cosmos/gogoproto/proto" tmjson "github.com/cometbft/cometbft/libs/json" cmttypes "github.com/cometbft/cometbft/types" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/version" "github.com/strangelove-ventures/interchaintest/v7/ibc" interchaintestutil "github.com/strangelove-ventures/interchaintest/v7/testutil" @@ -25,7 +27,6 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/ibc-go/e2e/relayer" - "github.com/cosmos/ibc-go/e2e/testsuite/sanitize" "github.com/cosmos/ibc-go/e2e/testvalues" ) @@ -441,7 +442,7 @@ func getGenesisModificationFunction(cc ChainConfig) func(ibc.ChainConfig, []byte icadSupportsGovV1Genesis := testvalues.IcadGovGenesisFeatureReleases.IsSupported(version) if simdSupportsGovV1Genesis || icadSupportsGovV1Genesis { - return defaultGovv1ModifyGenesis(version) + return defaultGovv1ModifyGenesis() } return defaultGovv1Beta1ModifyGenesis() @@ -482,8 +483,9 @@ func AppGenesisFromReader(reader io.Reader) (*genutiltypes.AppGenesis, error) { // defaultGovv1ModifyGenesis will only modify governance params to ensure the voting period and minimum deposit // are functional for e2e testing purposes. -func defaultGovv1ModifyGenesis(version string) func(ibc.ChainConfig, []byte) ([]byte, error) { +func defaultGovv1ModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, error) { return func(chainConfig ibc.ChainConfig, genbz []byte) ([]byte, error) { + appGenesis, err := AppGenesisFromReader(bytes.NewReader(genbz)) if err != nil { return nil, fmt.Errorf("failed to unmarshal genesis bytes into genesis doc: %w", err) @@ -494,7 +496,7 @@ func defaultGovv1ModifyGenesis(version string) func(ibc.ChainConfig, []byte) ([] return nil, fmt.Errorf("failed to unmarshal genesis bytes into app state: %w", err) } - govGenBz, err := modifyGovAppState(chainConfig, version, appState[govtypes.ModuleName]) + govGenBz, err := modifyGovAppState(chainConfig, appState[govtypes.ModuleName]) if err != nil { return nil, err } @@ -559,8 +561,9 @@ func defaultGovv1Beta1ModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, err } } + // modifyGovAppState takes the existing gov app state and marshals it to a govv1 GenesisState. -func modifyGovAppState(chainConfig ibc.ChainConfig, chainVersion string, govAppState []byte) ([]byte, error) { +func modifyGovAppState(chainConfig ibc.ChainConfig, govAppState []byte) ([]byte, error) { cfg := testutil.MakeTestEncodingConfig() cdc := codec.NewProtoCodec(cfg.InterfaceRegistry) @@ -576,16 +579,11 @@ func modifyGovAppState(chainConfig ibc.ChainConfig, chainVersion string, govAppS govGenesisState.Params = &govv1.Params{} } - govGenesisState.Params = sanitize.GovV1Params(chainVersion, govGenesisState.Params) - govGenesisState.Params.MinDeposit = sdk.NewCoins(sdk.NewCoin(chainConfig.Denom, govv1beta1.DefaultMinDepositTokens)) vp := testvalues.VotingPeriod govGenesisState.Params.VotingPeriod = &vp - govGenBz, err := cdc.MarshalJSON(govGenesisState) - if err != nil { - return nil, fmt.Errorf("failed to marshal gov genesis state: %w", err) - } + govGenBz := MustProtoMarshalJSON(govGenesisState) return govGenBz, nil } diff --git a/testing/simapp/upgrades.go b/testing/simapp/upgrades.go index 91325cbb91f..a49def47b88 100644 --- a/testing/simapp/upgrades.go +++ b/testing/simapp/upgrades.go @@ -2,6 +2,7 @@ package simapp import ( storetypes "cosmossdk.io/store/types" + circuittypes "cosmossdk.io/x/circuit/types" upgradetypes "cosmossdk.io/x/upgrade/types" consensusparamtypes "github.com/cosmos/cosmos-sdk/x/consensus/types" @@ -60,6 +61,7 @@ func (app *SimApp) registerUpgradeHandlers() { ), ) + upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { panic(err) @@ -76,4 +78,14 @@ func (app *SimApp) registerUpgradeHandlers() { // configure store loader that checks if version == upgradeHeight and applies store upgrades app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) } + + if upgradeInfo.Name == upgrades.V8 && !app.UpgradeKeeper.IsSkipHeight(upgradeInfo.Height) { + storeUpgrades := storetypes.StoreUpgrades{ + Added: []string{ + circuittypes.ModuleName, + }, + } + // configure store loader that checks if version == upgradeHeight and applies store upgrades + app.SetStoreLoader(upgradetypes.UpgradeStoreLoader(upgradeInfo.Height, &storeUpgrades)) + } } From 46be83426eff67fc4231a071a7d60a4e8a408b50 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 6 Sep 2023 15:49:03 +0100 Subject: [PATCH 05/20] chore: adding proposal to modify allowed clients list --- e2e/tests/upgrades/upgrade_test.go | 20 ++++++++++++++++++++ e2e/testsuite/testconfig.go | 4 +--- e2e/testsuite/testsuite.go | 9 +++++++++ e2e/testsuite/tx.go | 16 +++++++++++----- 4 files changed, 41 insertions(+), 8 deletions(-) diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index 2be98d01243..b728b72ff38 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -6,6 +6,7 @@ import ( "testing" "time" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/cosmos/gogoproto/proto" intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types" interchaintest "github.com/strangelove-ventures/interchaintest/v7" @@ -727,6 +728,25 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { s.UpgradeChain(ctx, chainA, govProposalWallet, testCfg.UpgradeConfig.PlanName, testCfg.ChainConfigs[0].Tag, testCfg.UpgradeConfig.Tag) }) + t.Run("update params", func(t *testing.T) { + authority, err := s.QueryModuleAccountAddress(ctx, govtypes.ModuleName, chainA) + s.Require().NoError(err) + s.Require().NotNil(authority) + + msg := clienttypes.NewMsgUpdateParams(authority.String(), clienttypes.NewParams(exported.Tendermint, "some-client")) + s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet) + }) + + t.Run("query params", func(t *testing.T) { + clientParams, err := s.GetChainGRCPClients(chainA).ClientQueryClient.ClientParams(ctx, &clienttypes.QueryClientParamsRequest{}) + s.Require().NoError(err) + + allowedClients := clientParams.Params.AllowedClients + + s.Require().Len(allowedClients, 2) + s.Require().Contains(allowedClients, exported.Tendermint) + s.Require().Contains(allowedClients, "some-client") + }) } // RegisterInterchainAccount will attempt to register an interchain account on the counterparty chain. diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index abd27d28a45..a4be8ce3128 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -8,11 +8,9 @@ import ( "os" "path" "strings" - "github.com/cosmos/gogoproto/jsonpb" - "github.com/cosmos/gogoproto/proto" + tmjson "github.com/cometbft/cometbft/libs/json" cmttypes "github.com/cometbft/cometbft/types" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/version" "github.com/strangelove-ventures/interchaintest/v7/ibc" interchaintestutil "github.com/strangelove-ventures/interchaintest/v7/testutil" diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index b158d002977..3c60c981b7f 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -34,6 +34,8 @@ const ( type E2ETestSuite struct { testifysuite.Suite + // proposalIds keeps track of the active proposal ID for each chain. + proposalIds map[string]uint64 grpcClients map[string]GRPCClients paths map[string]pathPair relayers relayer.Map @@ -223,6 +225,13 @@ func (s *E2ETestSuite) GetChains(chainOpts ...ChainOptionConfiguration) (*cosmos path = newPath(chainA, chainB) s.paths[s.T().Name()] = path + if s.proposalIds == nil { + s.proposalIds = map[string]uint64{} + } + + s.proposalIds[chainA.Config().ChainID] = 1 + s.proposalIds[chainB.Config().ChainID] = 1 + return path.chainA, path.chainB } diff --git a/e2e/testsuite/tx.go b/e2e/testsuite/tx.go index ef53c62f525..e29fc160dfa 100644 --- a/e2e/testsuite/tx.go +++ b/e2e/testsuite/tx.go @@ -137,10 +137,13 @@ If this is a compatibility test, ensure that the fields are being sanitized in t // ExecuteGovProposalV1 submits a governance proposal using the provided user and message and uses all validators // to vote yes on the proposal. It ensures the proposal successfully passes. -func (s *E2ETestSuite) ExecuteGovProposalV1(ctx context.Context, msg sdk.Msg, chain *cosmos.CosmosChain, user ibc.Wallet, proposalID uint64) { +func (s *E2ETestSuite) ExecuteGovProposalV1(ctx context.Context, msg sdk.Msg, chain *cosmos.CosmosChain, user ibc.Wallet) { sender, err := sdk.AccAddressFromBech32(user.FormattedAddress()) s.Require().NoError(err) + proposalID := s.proposalIds[chain.Config().ChainID] + s.proposalIds[chain.Config().ChainID]++ + msgs := []sdk.Msg{msg} msgSubmitProposal, err := govtypesv1.NewMsgSubmitProposal( msgs, @@ -168,6 +171,9 @@ func (s *E2ETestSuite) ExecuteGovProposalV1(ctx context.Context, msg sdk.Msg, ch // ExecuteGovProposal submits the given governance proposal using the provided user and uses all validators to vote yes on the proposal. // It ensures the proposal successfully passes. func (s *E2ETestSuite) ExecuteGovProposal(ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, content govtypesv1beta1.Content) { + proposalID := s.proposalIds[chain.Config().ChainID] + s.proposalIds[chain.Config().ChainID]++ + sender, err := sdk.AccAddressFromBech32(user.FormattedAddress()) s.Require().NoError(err) @@ -180,21 +186,21 @@ func (s *E2ETestSuite) ExecuteGovProposal(ctx context.Context, chain *cosmos.Cos // TODO: replace with parsed proposal ID from MsgSubmitProposalResponse // https://github.com/cosmos/ibc-go/issues/2122 - proposal, err := s.QueryProposal(ctx, chain, 1) + proposal, err := s.QueryProposal(ctx, chain, proposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusVotingPeriod, proposal.Status) - err = chain.VoteOnProposalAllValidators(ctx, "1", cosmos.ProposalVoteYes) + err = chain.VoteOnProposalAllValidators(ctx, fmt.Sprintf("%d", proposalID), cosmos.ProposalVoteYes) s.Require().NoError(err) // ensure voting period has not passed before validators finished voting - proposal, err = s.QueryProposal(ctx, chain, 1) + proposal, err = s.QueryProposal(ctx, chain, proposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusVotingPeriod, proposal.Status) time.Sleep(testvalues.VotingPeriod) // pass proposal - proposal, err = s.QueryProposal(ctx, chain, 1) + proposal, err = s.QueryProposal(ctx, chain, proposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusPassed, proposal.Status) } From 4455333d124e9d1ef9a01da26f8eadf1e9c02509 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 6 Sep 2023 16:03:42 +0100 Subject: [PATCH 06/20] chore: remove proposal id --- e2e/tests/core/03-connection/connection_test.go | 2 +- e2e/testsuite/testconfig.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/e2e/tests/core/03-connection/connection_test.go b/e2e/tests/core/03-connection/connection_test.go index 151e7b27e9d..54b3d86577a 100644 --- a/e2e/tests/core/03-connection/connection_test.go +++ b/e2e/tests/core/03-connection/connection_test.go @@ -88,7 +88,7 @@ func (s *ConnectionTestSuite) TestMaxExpectedTimePerBlockParam() { s.Require().NotNil(authority) msg := connectiontypes.NewMsgUpdateParams(authority.String(), connectiontypes.NewParams(delay)) - s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet, 1) + s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet) } else { changes := []paramsproposaltypes.ParamChange{ paramsproposaltypes.NewParamChange(ibcexported.ModuleName, string(connectiontypes.KeyMaxExpectedTimePerBlock), fmt.Sprintf(`"%d"`, delay)), diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index a4be8ce3128..0e37ecceb00 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -506,6 +506,7 @@ func defaultGovv1ModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, error) { return nil, err } + // TODO: use regular marshal indent in the case of < 8.0.0 bz, err := tmjson.MarshalIndent(appGenesis, "", " ") if err != nil { return nil, err From 94eb0d55a03ae016f94d32a92395a7699316b11c Mon Sep 17 00:00:00 2001 From: Charly Date: Fri, 8 Sep 2023 11:48:46 +0200 Subject: [PATCH 07/20] linter --- testing/simapp/upgrades.go | 1 - 1 file changed, 1 deletion(-) diff --git a/testing/simapp/upgrades.go b/testing/simapp/upgrades.go index 8fbd4c03247..81b4902da4c 100644 --- a/testing/simapp/upgrades.go +++ b/testing/simapp/upgrades.go @@ -61,7 +61,6 @@ func (app *SimApp) registerUpgradeHandlers() { ), ) - upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk() if err != nil { panic(err) From 26841f9e8b55887d35558152dfac2c675990836f Mon Sep 17 00:00:00 2001 From: Charly Date: Fri, 8 Sep 2023 11:55:31 +0200 Subject: [PATCH 08/20] update params for ExecuteGovProposalV1 --- e2e/tests/core/02-client/client_test.go | 2 +- e2e/tests/interchain_accounts/gov_test.go | 4 ++-- e2e/tests/interchain_accounts/params_test.go | 4 ++-- e2e/tests/transfer/base_test.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/e2e/tests/core/02-client/client_test.go b/e2e/tests/core/02-client/client_test.go index e31237e5ff4..ea54b582640 100644 --- a/e2e/tests/core/02-client/client_test.go +++ b/e2e/tests/core/02-client/client_test.go @@ -286,7 +286,7 @@ func (s *ClientTestSuite) TestAllowedClientsParam() { s.Require().NotNil(authority) msg := clienttypes.NewMsgUpdateParams(authority.String(), clienttypes.NewParams(allowedClient)) - s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet, 1) + s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet) } else { value, err := tmjson.Marshal([]string{allowedClient}) s.Require().NoError(err) diff --git a/e2e/tests/interchain_accounts/gov_test.go b/e2e/tests/interchain_accounts/gov_test.go index 1213c2f49c0..fedd99a1810 100644 --- a/e2e/tests/interchain_accounts/gov_test.go +++ b/e2e/tests/interchain_accounts/gov_test.go @@ -52,7 +52,7 @@ func (s *InterchainAccountsGovTestSuite) TestInterchainAccountsGovIntegration() t.Run("execute proposal for MsgRegisterInterchainAccount", func(t *testing.T) { version := icatypes.NewDefaultMetadataString(ibctesting.FirstConnectionID, ibctesting.FirstConnectionID) msgRegisterAccount := controllertypes.NewMsgRegisterInterchainAccount(ibctesting.FirstConnectionID, govModuleAddress.String(), version) - s.ExecuteGovProposalV1(ctx, msgRegisterAccount, chainA, controllerAccount, 1) + s.ExecuteGovProposalV1(ctx, msgRegisterAccount, chainA, controllerAccount) }) t.Run("start relayer", func(t *testing.T) { @@ -102,7 +102,7 @@ func (s *InterchainAccountsGovTestSuite) TestInterchainAccountsGovIntegration() } msgSendTx := controllertypes.NewMsgSendTx(govModuleAddress.String(), ibctesting.FirstConnectionID, uint64(time.Hour.Nanoseconds()), packetData) - s.ExecuteGovProposalV1(ctx, msgSendTx, chainA, controllerAccount, 2) + s.ExecuteGovProposalV1(ctx, msgSendTx, chainA, controllerAccount) }) t.Run("verify tokens transferred", func(t *testing.T) { diff --git a/e2e/tests/interchain_accounts/params_test.go b/e2e/tests/interchain_accounts/params_test.go index 43c976ce0dd..0520023ad55 100644 --- a/e2e/tests/interchain_accounts/params_test.go +++ b/e2e/tests/interchain_accounts/params_test.go @@ -74,7 +74,7 @@ func (s *InterchainAccountsParamsTestSuite) TestControllerEnabledParam() { Signer: authority.String(), Params: controllertypes.NewParams(false), } - s.ExecuteGovProposalV1(ctx, &msg, chainA, controllerAccount, 1) + s.ExecuteGovProposalV1(ctx, &msg, chainA, controllerAccount) } else { changes := []paramsproposaltypes.ParamChange{ paramsproposaltypes.NewParamChange(controllertypes.StoreKey, string(controllertypes.KeyControllerEnabled), "false"), @@ -131,7 +131,7 @@ func (s *InterchainAccountsParamsTestSuite) TestHostEnabledParam() { Signer: authority.String(), Params: hosttypes.NewParams(false, []string{hosttypes.AllowAllHostMsgs}), } - s.ExecuteGovProposalV1(ctx, &msg, chainB, chainBUser, 1) + s.ExecuteGovProposalV1(ctx, &msg, chainB, chainBUser) } else { changes := []paramsproposaltypes.ParamChange{ paramsproposaltypes.NewParamChange(hosttypes.StoreKey, string(hosttypes.KeyHostEnabled), "false"), diff --git a/e2e/tests/transfer/base_test.go b/e2e/tests/transfer/base_test.go index 124abbb230a..d5ee016ef99 100644 --- a/e2e/tests/transfer/base_test.go +++ b/e2e/tests/transfer/base_test.go @@ -275,7 +275,7 @@ func (s *TransferTestSuite) TestSendEnabledParam() { t.Run("change send enabled parameter to disabled", func(t *testing.T) { if isSelfManagingParams { msg := transfertypes.NewMsgUpdateParams(govModuleAddress.String(), transfertypes.NewParams(false, true)) - s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet, 1) + s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet) } else { changes := []paramsproposaltypes.ParamChange{ paramsproposaltypes.NewParamChange(transfertypes.StoreKey, string(transfertypes.KeySendEnabled), "false"), @@ -366,7 +366,7 @@ func (s *TransferTestSuite) TestReceiveEnabledParam() { t.Run("change receive enabled parameter to disabled ", func(t *testing.T) { if isSelfManagingParams { msg := transfertypes.NewMsgUpdateParams(govModuleAddress.String(), transfertypes.NewParams(false, false)) - s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet, 1) + s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet) } else { changes := []paramsproposaltypes.ParamChange{ paramsproposaltypes.NewParamChange(transfertypes.StoreKey, string(transfertypes.KeyReceiveEnabled), "false"), From eb1fe983a5688e3722d71ae6e84bd664dbba07ba Mon Sep 17 00:00:00 2001 From: chatton Date: Mon, 11 Sep 2023 11:34:11 +0100 Subject: [PATCH 09/20] chore: use actualBalance Int64 values --- e2e/tests/upgrades/upgrade_test.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index a1583fd3199..d45d9376d6d 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -145,7 +145,7 @@ func (s *UpgradeTestSuite) TestIBCChainUpgrade() { s.Require().NoError(err) expected := testvalues.IBCTransferAmount - s.Require().Equal(expected, actualBalance) + s.Require().Equal(expected, actualBalance.Int64()) }) s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA, chainB), "failed to wait for blocks") @@ -173,7 +173,7 @@ func (s *UpgradeTestSuite) TestIBCChainUpgrade() { s.Require().NoError(err) expected := testvalues.IBCTransferAmount * 2 - s.Require().Equal(expected, actualBalance) + s.Require().Equal(expected, actualBalance.Int64()) }) t.Run("ensure packets can be received, send from chainB to chainA", func(t *testing.T) { @@ -191,7 +191,7 @@ func (s *UpgradeTestSuite) TestIBCChainUpgrade() { s.Require().NoError(err) expected := testvalues.IBCTransferAmount - s.Require().Equal(expected, actualBalance) + s.Require().Equal(expected, actualBalance.Int64()) }) }) } @@ -552,7 +552,7 @@ func (s *UpgradeTestSuite) TestV6ToV7ChainUpgrade() { s.Require().NoError(err) expected := testvalues.IBCTransferAmount - s.Require().Equal(expected, actualBalance) + s.Require().Equal(expected, actualBalance.Int64()) }) // create separate user specifically for the upgrade proposal to more easily verify starting @@ -585,7 +585,7 @@ func (s *UpgradeTestSuite) TestV6ToV7ChainUpgrade() { s.Require().NoError(err) expected := testvalues.IBCTransferAmount * 2 - s.Require().Equal(expected, actualBalance) + s.Require().Equal(expected, actualBalance.Int64()) }) t.Run("check that the v2 solo machine clientstate has been updated to the v3 solo machine clientstate", func(t *testing.T) { @@ -639,7 +639,7 @@ func (s *UpgradeTestSuite) TestV7ToV7_1ChainUpgrade() { s.Require().NoError(err) expected := testvalues.IBCTransferAmount - s.Require().Equal(expected, actualBalance) + s.Require().Equal(expected, actualBalance.Int64()) }) s.Require().NoError(test.WaitForBlocks(ctx, 5, chainA), "failed to wait for blocks") From 283f9dd59bf1527b63c1bb0f326c49b5738b7ecc Mon Sep 17 00:00:00 2001 From: chatton Date: Mon, 11 Sep 2023 11:39:27 +0100 Subject: [PATCH 10/20] chore: add conditional check for tmjson/json libraries --- e2e/testsuite/testconfig.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index e3155112be7..45490f88379 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -25,6 +25,7 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/ibc-go/e2e/relayer" + "github.com/cosmos/ibc-go/e2e/semverutil" "github.com/cosmos/ibc-go/e2e/testvalues" ) @@ -440,7 +441,7 @@ func getGenesisModificationFunction(cc ChainConfig) func(ibc.ChainConfig, []byte icadSupportsGovV1Genesis := testvalues.IcadGovGenesisFeatureReleases.IsSupported(version) if simdSupportsGovV1Genesis || icadSupportsGovV1Genesis { - return defaultGovv1ModifyGenesis() + return defaultGovv1ModifyGenesis(version) } return defaultGovv1Beta1ModifyGenesis() @@ -481,7 +482,8 @@ func AppGenesisFromReader(reader io.Reader) (*genutiltypes.AppGenesis, error) { // defaultGovv1ModifyGenesis will only modify governance params to ensure the voting period and minimum deposit // are functional for e2e testing purposes. -func defaultGovv1ModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, error) { +func defaultGovv1ModifyGenesis(version string) func(ibc.ChainConfig, []byte) ([]byte, error) { + var stdlibJSONMarshalling = semverutil.FeatureReleases{MajorVersion: "v8"} return func(chainConfig ibc.ChainConfig, genbz []byte) ([]byte, error) { appGenesis, err := AppGenesisFromReader(bytes.NewReader(genbz)) @@ -506,8 +508,15 @@ func defaultGovv1ModifyGenesis() func(ibc.ChainConfig, []byte) ([]byte, error) { return nil, err } - // TODO: use regular marshal indent in the case of < 8.0.0 - bz, err := tmjson.MarshalIndent(appGenesis, "", " ") + // in older version < v8, tmjson marshal must be used. + // regular json marshalling must be used for v8 and above as the + // sdk is de-coupled from comet. + marshalIndentFn := tmjson.MarshalIndent + if stdlibJSONMarshalling.IsSupported(version) { + marshalIndentFn = json.MarshalIndent + } + + bz, err := marshalIndentFn(appGenesis, "", " ") if err != nil { return nil, err } From 860fb84cebe09273748cb0050106f9c2f8c511a5 Mon Sep 17 00:00:00 2001 From: chatton Date: Mon, 11 Sep 2023 11:42:50 +0100 Subject: [PATCH 11/20] chore: hard code image to PR --- .github/workflows/e2e-upgrade.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml index 2ace6e7755c..cc5424a18db 100644 --- a/.github/workflows/e2e-upgrade.yaml +++ b/.github/workflows/e2e-upgrade.yaml @@ -65,7 +65,7 @@ jobs: chain-binary: simd chain-a-tag: v7.0.0 chain-b-tag: v7.0.0 - chain-upgrade-tag: main # TODO: update this to a real tag once v8 is released + chain-upgrade-tag: pr-4591 # TODO: update this to a real tag once v8 is released upgrade-plan-name: "v8" test-entry-point: "TestUpgradeTestSuite" test: "TestV7ToV8ChainUpgrade" From f7482c01fe3f0b9748f7eee52788e66082061d5d Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 12 Sep 2023 12:28:38 +0100 Subject: [PATCH 12/20] chore: bumping go.mod versions to version with migration fix --- e2e/go.mod | 4 ++-- e2e/go.sum | 8 ++++---- go.mod | 4 ++-- go.sum | 8 ++++---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/e2e/go.mod b/e2e/go.mod index 312c4184e92..57c96b70d00 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -7,7 +7,7 @@ require ( cosmossdk.io/math v1.1.2 cosmossdk.io/x/upgrade v0.0.0-20230818115413-c402c51a1508 github.com/cometbft/cometbft v0.38.0-rc3 - github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230905141004-6a9777fff287 + github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef github.com/cosmos/gogoproto v1.4.11 github.com/cosmos/ibc-go/v8 v8.0.0-20230906115913-46ee5f92e1af github.com/docker/docker v24.0.6+incompatible @@ -73,7 +73,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.10.0 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20230817233644-564b068800e0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index 89f9f849563..eff469eb092 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -328,8 +328,8 @@ github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOG github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= -github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230817233644-564b068800e0 h1:M4A5LioEhkZ/s+m0g0pWgiLBQr83p0jWnQUo320Qy+A= @@ -359,8 +359,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230905141004-6a9777fff287 h1:8KqZgZEGzPjqAL66YDOzAVFiDrLQA4Sr8RsoesV3Ymk= -github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230905141004-6a9777fff287/go.mod h1:olbHxcVB4zWwnF+oNPbKIoEIO5HgHndzKUqdpuu4s34= +github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef h1:mlpjg/QOANo0VdkZLDegmMbeNyFQcDxO2C1CaRxtL5k= +github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef/go.mod h1:Wt09sg4Ir44vkMXDq5w/4ZixxEUcA0SgXeAl9Yge7uQ= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= diff --git a/go.mod b/go.mod index 28818082cd0..72963c780ce 100644 --- a/go.mod +++ b/go.mod @@ -19,7 +19,7 @@ require ( github.com/cometbft/cometbft v0.38.0-rc3 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230905141004-6a9777fff287 + github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef github.com/cosmos/gogoproto v1.4.11 github.com/cosmos/ibc-go/modules/capability v1.0.0-rc5 github.com/cosmos/ics23/go v0.10.0 @@ -59,7 +59,7 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect - github.com/cockroachdb/errors v1.10.0 // indirect + github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20230817233644-564b068800e0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect diff --git a/go.sum b/go.sum index c522a1520e5..304e1381ed3 100644 --- a/go.sum +++ b/go.sum @@ -324,8 +324,8 @@ github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOG github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= -github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= -github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= github.com/cockroachdb/pebble v0.0.0-20230817233644-564b068800e0 h1:M4A5LioEhkZ/s+m0g0pWgiLBQr83p0jWnQUo320Qy+A= @@ -353,8 +353,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230905141004-6a9777fff287 h1:8KqZgZEGzPjqAL66YDOzAVFiDrLQA4Sr8RsoesV3Ymk= -github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230905141004-6a9777fff287/go.mod h1:olbHxcVB4zWwnF+oNPbKIoEIO5HgHndzKUqdpuu4s34= +github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef h1:mlpjg/QOANo0VdkZLDegmMbeNyFQcDxO2C1CaRxtL5k= +github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef/go.mod h1:Wt09sg4Ir44vkMXDq5w/4ZixxEUcA0SgXeAl9Yge7uQ= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= From a4f47acae0071149e8ac41478623fa90e924645e Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 12 Sep 2023 13:47:16 +0100 Subject: [PATCH 13/20] chore: run upgrade tests when upgrade_test.go changes --- .github/workflows/e2e-upgrade.yaml | 10 ++++++++-- e2e/tests/upgrades/upgrade_test.go | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-upgrade.yaml b/.github/workflows/e2e-upgrade.yaml index cc5424a18db..6c9e8e43c4e 100644 --- a/.github/workflows/e2e-upgrade.yaml +++ b/.github/workflows/e2e-upgrade.yaml @@ -1,10 +1,16 @@ name: Tests / E2E Upgrade -on: +on: workflow_dispatch: - + pull_request: + branches: + - main + paths: + # upgrade tests will run on any changes to the upgrade_test.go file. + - 'e2e/tests/upgrades/upgrade_test.go' schedule: - cron: '0 0 * * *' + jobs: upgrade-v5: uses: cosmos/ibc-go/.github/workflows/e2e-test-workflow-call.yml@main diff --git a/e2e/tests/upgrades/upgrade_test.go b/e2e/tests/upgrades/upgrade_test.go index 30fdabf6cb8..1df81a1f3aa 100644 --- a/e2e/tests/upgrades/upgrade_test.go +++ b/e2e/tests/upgrades/upgrade_test.go @@ -731,7 +731,7 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() { s.Require().NotNil(authority) msg := clienttypes.NewMsgUpdateParams(authority.String(), clienttypes.NewParams(exported.Tendermint, "some-client")) - s.ExecuteGovProposalV1(ctx, msg, chainA, chainAWallet) + s.ExecuteGovV1Proposal(ctx, msg, chainA, chainAWallet) }) t.Run("query params", func(t *testing.T) { From 9a830a104b6eedd3ffe574b432503cc9c6cf0902 Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 12 Sep 2023 13:52:01 +0100 Subject: [PATCH 14/20] chore: adding better comment to the custom MustProtoMarshalJSON --- e2e/testsuite/codec.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/e2e/testsuite/codec.go b/e2e/testsuite/codec.go index bcfdd5a5a7d..649422c6620 100644 --- a/e2e/testsuite/codec.go +++ b/e2e/testsuite/codec.go @@ -118,10 +118,10 @@ func UnmarshalMsgResponses(txResp sdk.TxResponse, msgs ...codec.ProtoMarshaler) } // MustProtoMarshalJSON provides an auxiliary function to return Proto3 JSON encoded -// bytes of a message. -// NOTE: Copied from https://github.com/cosmos/cosmos-sdk/blob/971c542453e0972ef1dfc5a80159ad5049c7211c/codec/json.go -// and modified in order to allow `EmitDefaults` to be set to false for ics20 packet marshalling. -// This allows for the introduction of the memo field to be backwards compatible. +// bytes of a message. This function should be used when marshalling a proto.Message +// from the e2e tests. This function strips out unknown fields. This is useful for +// backwards compatibility tests where the the types imported by the e2e package have +// new fields that older versions do not recognize. func MustProtoMarshalJSON(msg proto.Message) []byte { anyResolver := codectypes.NewInterfaceRegistry() From 1299b98b35d6119957deeeafe0c93c2ae9ee9222 Mon Sep 17 00:00:00 2001 From: chatton Date: Tue, 12 Sep 2023 13:53:26 +0100 Subject: [PATCH 15/20] chore: removing dupliated function and use the sdk fn directly --- e2e/testsuite/testconfig.go | 38 +------------------------------------ 1 file changed, 1 insertion(+), 37 deletions(-) diff --git a/e2e/testsuite/testconfig.go b/e2e/testsuite/testconfig.go index 45490f88379..e30ea9cc910 100644 --- a/e2e/testsuite/testconfig.go +++ b/e2e/testsuite/testconfig.go @@ -4,14 +4,11 @@ import ( "bytes" "encoding/json" "fmt" - "io" "os" "path" "strings" tmjson "github.com/cometbft/cometbft/libs/json" - cmttypes "github.com/cometbft/cometbft/types" - "github.com/cosmos/cosmos-sdk/version" "github.com/strangelove-ventures/interchaintest/v8/ibc" interchaintestutil "github.com/strangelove-ventures/interchaintest/v8/testutil" "gopkg.in/yaml.v2" @@ -447,46 +444,13 @@ func getGenesisModificationFunction(cc ChainConfig) func(ibc.ChainConfig, []byte return defaultGovv1Beta1ModifyGenesis() } -// AppGenesisFromReader reads the AppGenesis from the reader. -// TODO: this function is a duplicate of one that was added in the SDK. Remove this function in https://github.com/cosmos/ibc-go/issues/4556 -func AppGenesisFromReader(reader io.Reader) (*genutiltypes.AppGenesis, error) { - jsonBlob, err := io.ReadAll(reader) - if err != nil { - return nil, err - } - - var appGenesis genutiltypes.AppGenesis - if err := json.Unmarshal(jsonBlob, &appGenesis); err != nil { - // fallback to CometBFT genesis - var ctmGenesis cmttypes.GenesisDoc - if err2 := tmjson.Unmarshal(jsonBlob, &ctmGenesis); err2 != nil { - return nil, fmt.Errorf("error unmarshalling AppGenesis: %w\n failed fallback to CometBFT GenDoc: %w", err, err2) - } - - appGenesis = genutiltypes.AppGenesis{ - AppName: version.AppName, - // AppVersion is not filled as we do not know it from a CometBFT genesis - GenesisTime: ctmGenesis.GenesisTime, - ChainID: ctmGenesis.ChainID, - InitialHeight: ctmGenesis.InitialHeight, - AppHash: ctmGenesis.AppHash, - AppState: ctmGenesis.AppState, - Consensus: &genutiltypes.ConsensusGenesis{ - Validators: ctmGenesis.Validators, - Params: ctmGenesis.ConsensusParams, - }, - } - } - return &appGenesis, nil -} - // defaultGovv1ModifyGenesis will only modify governance params to ensure the voting period and minimum deposit // are functional for e2e testing purposes. func defaultGovv1ModifyGenesis(version string) func(ibc.ChainConfig, []byte) ([]byte, error) { var stdlibJSONMarshalling = semverutil.FeatureReleases{MajorVersion: "v8"} return func(chainConfig ibc.ChainConfig, genbz []byte) ([]byte, error) { - appGenesis, err := AppGenesisFromReader(bytes.NewReader(genbz)) + appGenesis, err := genutiltypes.AppGenesisFromReader(bytes.NewReader(genbz)) if err != nil { return nil, fmt.Errorf("failed to unmarshal genesis bytes into genesis doc: %w", err) } From ecd9a332ebef02e06ab94699ec0bb9c6b32287d7 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 13 Sep 2023 10:14:41 +0100 Subject: [PATCH 16/20] chore: bumping sdk version to latest commit --- e2e/go.mod | 12 ++++++------ e2e/go.sum | 24 ++++++++++++------------ go.mod | 22 +++++++++++----------- go.sum | 44 ++++++++++++++++++++++---------------------- 4 files changed, 51 insertions(+), 51 deletions(-) diff --git a/e2e/go.mod b/e2e/go.mod index 57c96b70d00..1ff58786771 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -6,8 +6,8 @@ require ( cosmossdk.io/errors v1.0.0 cosmossdk.io/math v1.1.2 cosmossdk.io/x/upgrade v0.0.0-20230818115413-c402c51a1508 - github.com/cometbft/cometbft v0.38.0-rc3 - github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef + github.com/cometbft/cometbft v0.38.0 + github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913040121-1c9c5ae64ea8 github.com/cosmos/gogoproto v1.4.11 github.com/cosmos/ibc-go/v8 v8.0.0-20230906115913-46ee5f92e1af github.com/docker/docker v24.0.6+incompatible @@ -15,7 +15,7 @@ require ( github.com/stretchr/testify v1.8.4 go.uber.org/zap v1.25.0 golang.org/x/mod v0.12.0 - google.golang.org/grpc v1.57.0 + google.golang.org/grpc v1.58.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -38,7 +38,7 @@ require ( github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/ulikunitz/xz v0.5.11 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.126.0 // indirect google.golang.org/appengine v1.6.7 // indirect @@ -48,7 +48,7 @@ require ( cosmossdk.io/api v0.7.0 // indirect cosmossdk.io/client/v2 v2.0.0-20230818115413-c402c51a1508 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/core v0.10.0 // indirect + cosmossdk.io/core v0.11.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/log v1.2.1 // indirect cosmossdk.io/store v1.0.0-rc.0 // indirect @@ -205,7 +205,7 @@ require ( golang.org/x/tools v0.13.0 // indirect google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index eff469eb092..5fdca479253 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -193,8 +193,8 @@ cosmossdk.io/client/v2 v2.0.0-20230818115413-c402c51a1508 h1:tt5OMwdouv7dkwkWJYx cosmossdk.io/client/v2 v2.0.0-20230818115413-c402c51a1508/go.mod h1:iHeSk2AT6O8RNGlfcEQq6Yty6Z/6gydQsXXBh5I715Q= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.10.0 h1:NP28Ol9YyRODmZLJg2ko/mUl40hMegeMzhJnG+XPkcY= -cosmossdk.io/core v0.10.0/go.mod h1:MygXNld9DvMgYY4yE76DM/mdZpgfeyRjy6FPjEEehlY= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= @@ -341,8 +341,8 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1: github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/colin-axner/interchaintest/v8 v8.0.0-20230906142353-5d89200aad4a h1:rWxVtMsp/X9FVOzIvLCrJ8FWzuAGwpI7jwh51Pgt5Lc= github.com/colin-axner/interchaintest/v8 v8.0.0-20230906142353-5d89200aad4a/go.mod h1:aXLHcZ5Tv0R5/LynEsE86bc4UwuHl5TZpzGSLqo79AE= -github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= -github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0 h1:ogKnpiPX7gxCvqTEF4ly25/wAxUqf181t30P3vqdpdc= +github.com/cometbft/cometbft v0.38.0/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -359,8 +359,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef h1:mlpjg/QOANo0VdkZLDegmMbeNyFQcDxO2C1CaRxtL5k= -github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef/go.mod h1:Wt09sg4Ir44vkMXDq5w/4ZixxEUcA0SgXeAl9Yge7uQ= +github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913040121-1c9c5ae64ea8 h1:mGGlOhfCQcrwsMoOGH8zCHxtn1lcxG63LkYg37L5YhM= +github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913040121-1c9c5ae64ea8/go.mod h1:PXE/bVnJ2v6KZkczOxLqNVEnTYcOJ3dpObNHnoxA9JY= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -1226,8 +1226,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1616,8 +1616,8 @@ google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWof google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1:z3vDksarJxsAKM5dmEGv0GHwE2hKJ096wZra71Vs4sw= google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1659,8 +1659,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= +google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/go.mod b/go.mod index 72963c780ce..d408c6fbf71 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ module github.com/cosmos/ibc-go/v8 require ( cosmossdk.io/api v0.7.0 cosmossdk.io/client/v2 v2.0.0-20230818115413-c402c51a1508 - cosmossdk.io/core v0.10.0 + cosmossdk.io/core v0.11.0 cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.2.1 cosmossdk.io/math v1.1.2 @@ -16,10 +16,10 @@ require ( cosmossdk.io/x/feegrant v0.0.0-20230818115413-c402c51a1508 cosmossdk.io/x/tx v0.9.1 cosmossdk.io/x/upgrade v0.0.0-20230818115413-c402c51a1508 - github.com/cometbft/cometbft v0.38.0-rc3 + github.com/cometbft/cometbft v0.38.0 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef + github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913040121-1c9c5ae64ea8 github.com/cosmos/gogoproto v1.4.11 github.com/cosmos/ibc-go/modules/capability v1.0.0-rc5 github.com/cosmos/ics23/go v0.10.0 @@ -31,7 +31,7 @@ require ( github.com/spf13/viper v1.16.0 github.com/stretchr/testify v1.8.4 google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e - google.golang.org/grpc v1.57.0 + google.golang.org/grpc v1.58.0 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 ) @@ -170,19 +170,19 @@ require ( github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.12.0 // indirect + golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect - golang.org/x/net v0.14.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/term v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.126.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.0 // indirect diff --git a/go.sum b/go.sum index 304e1381ed3..01a4d246f3f 100644 --- a/go.sum +++ b/go.sum @@ -193,8 +193,8 @@ cosmossdk.io/client/v2 v2.0.0-20230818115413-c402c51a1508 h1:tt5OMwdouv7dkwkWJYx cosmossdk.io/client/v2 v2.0.0-20230818115413-c402c51a1508/go.mod h1:iHeSk2AT6O8RNGlfcEQq6Yty6Z/6gydQsXXBh5I715Q= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.10.0 h1:NP28Ol9YyRODmZLJg2ko/mUl40hMegeMzhJnG+XPkcY= -cosmossdk.io/core v0.10.0/go.mod h1:MygXNld9DvMgYY4yE76DM/mdZpgfeyRjy6FPjEEehlY= +cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= @@ -335,8 +335,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= -github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0 h1:ogKnpiPX7gxCvqTEF4ly25/wAxUqf181t30P3vqdpdc= +github.com/cometbft/cometbft v0.38.0/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -353,8 +353,8 @@ github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0 github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef h1:mlpjg/QOANo0VdkZLDegmMbeNyFQcDxO2C1CaRxtL5k= -github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef/go.mod h1:Wt09sg4Ir44vkMXDq5w/4ZixxEUcA0SgXeAl9Yge7uQ= +github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913040121-1c9c5ae64ea8 h1:mGGlOhfCQcrwsMoOGH8zCHxtn1lcxG63LkYg37L5YhM= +github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913040121-1c9c5ae64ea8/go.mod h1:PXE/bVnJ2v6KZkczOxLqNVEnTYcOJ3dpObNHnoxA9JY= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -1069,8 +1069,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1173,8 +1173,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1200,8 +1200,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= -golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1318,13 +1318,13 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= -golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.12.0 h1:/ZfYdc3zq+q02Rv9vGqTeSItdzZTSNDmfTi0mBAuidU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1336,8 +1336,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1588,8 +1588,8 @@ google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWof google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1:z3vDksarJxsAKM5dmEGv0GHwE2hKJ096wZra71Vs4sw= google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d h1:uvYuEyMHKNt+lT4K3bN6fGswmK8qSvcreM3BwjDh+y4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1631,8 +1631,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.58.0 h1:32JY8YpPMSR45K+c3o6b8VL73V+rR8k+DeMIr4vRH8o= +google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From 591203cd4e9a3453968444e3ca151ea1e826da07 Mon Sep 17 00:00:00 2001 From: chatton Date: Wed, 13 Sep 2023 13:15:19 +0100 Subject: [PATCH 17/20] chore: fixed usage of s.ExecuteGovV1Proposal --- e2e/tests/core/02-client/client_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e2e/tests/core/02-client/client_test.go b/e2e/tests/core/02-client/client_test.go index 02acf6278a3..319159a6d8b 100644 --- a/e2e/tests/core/02-client/client_test.go +++ b/e2e/tests/core/02-client/client_test.go @@ -112,7 +112,7 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() { upgradedClientState, ) s.Require().NoError(err) - s.ExecuteGovV1Proposal(ctx, scheduleUpgradeMsg, chainA, chainAWallet, 1) + s.ExecuteGovV1Proposal(ctx, scheduleUpgradeMsg, chainA, chainAWallet) }) t.Run("check that IBC software upgrade has been scheduled successfully on chainA", func(t *testing.T) { @@ -200,7 +200,7 @@ func (s *ClientTestSuite) TestRecoverClient_Succeeds() { s.Require().NoError(err) recoverClientMsg := clienttypes.NewMsgRecoverClient(authority.String(), subjectClientID, substituteClientID) s.Require().NotNil(recoverClientMsg) - s.ExecuteGovV1Proposal(ctx, recoverClientMsg, chainA, chainAWallet, 1) + s.ExecuteGovV1Proposal(ctx, recoverClientMsg, chainA, chainAWallet) }) t.Run("check status of each client", func(t *testing.T) { From 1b80c4fd59d3daaff622fd6e0ff791141e970134 Mon Sep 17 00:00:00 2001 From: chatton Date: Thu, 14 Sep 2023 09:33:05 +0100 Subject: [PATCH 18/20] chore: correct logic around proposal id --- e2e/testsuite/tx.go | 26 ++++++++++++++------------ modules/apps/callbacks/go.mod | 22 +++++++++++----------- modules/apps/callbacks/go.sum | 11 +++++++++++ 3 files changed, 36 insertions(+), 23 deletions(-) diff --git a/e2e/testsuite/tx.go b/e2e/testsuite/tx.go index 1b5b2564314..50330e0142f 100644 --- a/e2e/testsuite/tx.go +++ b/e2e/testsuite/tx.go @@ -141,8 +141,7 @@ func (s *E2ETestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, ch sender, err := sdk.AccAddressFromBech32(user.FormattedAddress()) s.Require().NoError(err) - proposalID := s.proposalIds[chain.Config().ChainID] - s.proposalIds[chain.Config().ChainID]++ + nextProposalID := s.proposalIds[chain.Config().ChainID] + 1 msgs := []sdk.Msg{msg} msgSubmitProposal, err := govtypesv1.NewMsgSubmitProposal( @@ -150,8 +149,8 @@ func (s *E2ETestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, ch sdk.NewCoins(sdk.NewCoin(chain.Config().Denom, govtypesv1.DefaultMinDepositTokens)), sender.String(), "", - fmt.Sprintf("e2e gov proposal: %d", proposalID), - fmt.Sprintf("executing gov proposal %d", proposalID), + fmt.Sprintf("e2e gov proposal: %d", nextProposalID), + fmt.Sprintf("executing gov proposal %d", nextProposalID), false, ) s.Require().NoError(err) @@ -159,20 +158,21 @@ func (s *E2ETestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, ch resp := s.BroadcastMessages(ctx, chain, user, msgSubmitProposal) s.AssertTxSuccess(resp) - s.Require().NoError(chain.VoteOnProposalAllValidators(ctx, strconv.Itoa(int(proposalID)), cosmos.ProposalVoteYes)) + s.Require().NoError(chain.VoteOnProposalAllValidators(ctx, strconv.Itoa(int(nextProposalID)), cosmos.ProposalVoteYes)) time.Sleep(testvalues.VotingPeriod) - proposal, err := s.QueryProposalV1(ctx, chain, proposalID) + proposal, err := s.QueryProposalV1(ctx, chain, nextProposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1.StatusPassed, proposal.Status) + + s.proposalIds[chain.Config().ChainID] = nextProposalID } // ExecuteGovV1Beta1Proposal submits the given v1beta1 governance proposal using the provided user and uses all validators to vote yes on the proposal. // It ensures the proposal successfully passes. func (s *E2ETestSuite) ExecuteGovV1Beta1Proposal(ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, content govtypesv1beta1.Content) { - proposalID := s.proposalIds[chain.Config().ChainID] - s.proposalIds[chain.Config().ChainID]++ + nextProposalID := s.proposalIds[chain.Config().ChainID] + 1 sender, err := sdk.AccAddressFromBech32(user.FormattedAddress()) s.Require().NoError(err) @@ -186,23 +186,25 @@ func (s *E2ETestSuite) ExecuteGovV1Beta1Proposal(ctx context.Context, chain *cos // TODO: replace with parsed proposal ID from MsgSubmitProposalResponse // https://github.com/cosmos/ibc-go/issues/2122 - proposal, err := s.QueryProposalV1Beta1(ctx, chain, proposalID) + proposal, err := s.QueryProposalV1Beta1(ctx, chain, nextProposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusVotingPeriod, proposal.Status) - err = chain.VoteOnProposalAllValidators(ctx, fmt.Sprintf("%d", proposalID), cosmos.ProposalVoteYes) + err = chain.VoteOnProposalAllValidators(ctx, fmt.Sprintf("%d", nextProposalID), cosmos.ProposalVoteYes) s.Require().NoError(err) // ensure voting period has not passed before validators finished voting - proposal, err = s.QueryProposalV1Beta1(ctx, chain, proposalID) + proposal, err = s.QueryProposalV1Beta1(ctx, chain, nextProposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusVotingPeriod, proposal.Status) time.Sleep(testvalues.VotingPeriod) // pass proposal - proposal, err = s.QueryProposalV1Beta1(ctx, chain, 1) + proposal, err = s.QueryProposalV1Beta1(ctx, chain, nextProposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusPassed, proposal.Status) + + s.proposalIds[chain.Config().ChainID] = nextProposalID } // Transfer broadcasts a MsgTransfer message. diff --git a/modules/apps/callbacks/go.mod b/modules/apps/callbacks/go.mod index d30f89347ba..9d92eb3d73c 100644 --- a/modules/apps/callbacks/go.mod +++ b/modules/apps/callbacks/go.mod @@ -11,7 +11,7 @@ replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.2021 require ( cosmossdk.io/api v0.7.0 cosmossdk.io/client/v2 v2.0.0-20230818115413-c402c51a1508 - cosmossdk.io/core v0.10.0 + cosmossdk.io/core v0.11.0 cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.2.1 cosmossdk.io/math v1.1.2 @@ -22,9 +22,9 @@ require ( cosmossdk.io/x/feegrant v0.0.0-20230818115413-c402c51a1508 cosmossdk.io/x/tx v0.9.1 cosmossdk.io/x/upgrade v0.0.0-20230818115413-c402c51a1508 - github.com/cometbft/cometbft v0.38.0-rc3 + github.com/cometbft/cometbft v0.38.0 github.com/cosmos/cosmos-db v1.0.0 - github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef + github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913040121-1c9c5ae64ea8 github.com/cosmos/gogoproto v1.4.11 github.com/cosmos/ibc-go/modules/capability v1.0.0-rc5 github.com/cosmos/ibc-go/v8 v8.0.0 @@ -171,21 +171,21 @@ require ( github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.12.0 // indirect + golang.org/x/crypto v0.13.0 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect - golang.org/x/net v0.14.0 // indirect - golang.org/x/oauth2 v0.8.0 // indirect + golang.org/x/net v0.15.0 // indirect + golang.org/x/oauth2 v0.10.0 // indirect golang.org/x/sync v0.3.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/term v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect + golang.org/x/sys v0.12.0 // indirect + golang.org/x/term v0.12.0 // indirect + golang.org/x/text v0.13.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/api v0.126.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect - google.golang.org/grpc v1.57.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d // indirect + google.golang.org/grpc v1.58.0 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/modules/apps/callbacks/go.sum b/modules/apps/callbacks/go.sum index 226ccb29afa..9009b60d1d5 100644 --- a/modules/apps/callbacks/go.sum +++ b/modules/apps/callbacks/go.sum @@ -195,6 +195,7 @@ cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= cosmossdk.io/core v0.10.0 h1:NP28Ol9YyRODmZLJg2ko/mUl40hMegeMzhJnG+XPkcY= cosmossdk.io/core v0.10.0/go.mod h1:MygXNld9DvMgYY4yE76DM/mdZpgfeyRjy6FPjEEehlY= +cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= @@ -337,6 +338,7 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1: github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.0-rc3 h1:Ly3eVPWoFu0y68PmZwLljucPdEBtfigZtqm+OV1W6dE= github.com/cometbft/cometbft v0.38.0-rc3/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= +github.com/cometbft/cometbft v0.38.0/go.mod h1:5Jz0Z8YsHSf0ZaAqGvi/ifioSdVFPtEGrm8Y9T/993k= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -355,6 +357,7 @@ github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQ github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef h1:mlpjg/QOANo0VdkZLDegmMbeNyFQcDxO2C1CaRxtL5k= github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230911190209-e4033faa38ef/go.mod h1:Wt09sg4Ir44vkMXDq5w/4ZixxEUcA0SgXeAl9Yge7uQ= +github.com/cosmos/cosmos-sdk v0.50.0-rc.0.0.20230913040121-1c9c5ae64ea8/go.mod h1:PXE/bVnJ2v6KZkczOxLqNVEnTYcOJ3dpObNHnoxA9JY= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -1069,6 +1072,7 @@ golang.org/x/crypto v0.0.0-20220314234659-1baeb1ce4c0b/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= +golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1173,6 +1177,7 @@ golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfS golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= +golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1200,6 +1205,7 @@ golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= +golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1317,11 +1323,13 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.11.0 h1:F9tnn/DA/Im8nCwm+fX+1/eBwi4qFjRT++MhtVC4ZX0= golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= +golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1335,6 +1343,7 @@ golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1587,6 +1596,7 @@ google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1: google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0= google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230822172742-b8732ec3820d/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1630,6 +1640,7 @@ google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCD google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +google.golang.org/grpc v1.58.0/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From 20c810f0cb225ae5df98b8e9c70ddb02298168d6 Mon Sep 17 00:00:00 2001 From: chatton Date: Thu, 14 Sep 2023 09:36:47 +0100 Subject: [PATCH 19/20] chore: addressing PR feedback --- e2e/testsuite/testsuite.go | 12 ++++++------ e2e/testsuite/tx.go | 14 ++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/e2e/testsuite/testsuite.go b/e2e/testsuite/testsuite.go index 24541e1a7d9..a0b2349c686 100644 --- a/e2e/testsuite/testsuite.go +++ b/e2e/testsuite/testsuite.go @@ -34,8 +34,8 @@ const ( type E2ETestSuite struct { testifysuite.Suite - // proposalIds keeps track of the active proposal ID for each chain. - proposalIds map[string]uint64 + // proposalIDs keeps track of the active proposal ID for each chain. + proposalIDs map[string]uint64 grpcClients map[string]GRPCClients paths map[string]pathPair relayers relayer.Map @@ -225,12 +225,12 @@ func (s *E2ETestSuite) GetChains(chainOpts ...ChainOptionConfiguration) (*cosmos path = newPath(chainA, chainB) s.paths[s.T().Name()] = path - if s.proposalIds == nil { - s.proposalIds = map[string]uint64{} + if s.proposalIDs == nil { + s.proposalIDs = map[string]uint64{} } - s.proposalIds[chainA.Config().ChainID] = 1 - s.proposalIds[chainB.Config().ChainID] = 1 + s.proposalIDs[chainA.Config().ChainID] = 1 + s.proposalIDs[chainB.Config().ChainID] = 1 return path.chainA, path.chainB } diff --git a/e2e/testsuite/tx.go b/e2e/testsuite/tx.go index 50330e0142f..396e5b3543e 100644 --- a/e2e/testsuite/tx.go +++ b/e2e/testsuite/tx.go @@ -141,7 +141,10 @@ func (s *E2ETestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, ch sender, err := sdk.AccAddressFromBech32(user.FormattedAddress()) s.Require().NoError(err) - nextProposalID := s.proposalIds[chain.Config().ChainID] + 1 + nextProposalID := s.proposalIDs[chain.Config().ChainID] + 1 + defer func() { + s.proposalIDs[chain.Config().ChainID] = nextProposalID + }() msgs := []sdk.Msg{msg} msgSubmitProposal, err := govtypesv1.NewMsgSubmitProposal( @@ -165,14 +168,15 @@ func (s *E2ETestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, ch proposal, err := s.QueryProposalV1(ctx, chain, nextProposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1.StatusPassed, proposal.Status) - - s.proposalIds[chain.Config().ChainID] = nextProposalID } // ExecuteGovV1Beta1Proposal submits the given v1beta1 governance proposal using the provided user and uses all validators to vote yes on the proposal. // It ensures the proposal successfully passes. func (s *E2ETestSuite) ExecuteGovV1Beta1Proposal(ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, content govtypesv1beta1.Content) { - nextProposalID := s.proposalIds[chain.Config().ChainID] + 1 + nextProposalID := s.proposalIDs[chain.Config().ChainID] + 1 + defer func() { + s.proposalIDs[chain.Config().ChainID] = nextProposalID + }() sender, err := sdk.AccAddressFromBech32(user.FormattedAddress()) s.Require().NoError(err) @@ -203,8 +207,6 @@ func (s *E2ETestSuite) ExecuteGovV1Beta1Proposal(ctx context.Context, chain *cos proposal, err = s.QueryProposalV1Beta1(ctx, chain, nextProposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusPassed, proposal.Status) - - s.proposalIds[chain.Config().ChainID] = nextProposalID } // Transfer broadcasts a MsgTransfer message. From c0faf678b00a36f7ab30b631d6bb8a955c98a53e Mon Sep 17 00:00:00 2001 From: chatton Date: Thu, 14 Sep 2023 10:11:00 +0100 Subject: [PATCH 20/20] chore: fix proposal id logic --- e2e/testsuite/tx.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/e2e/testsuite/tx.go b/e2e/testsuite/tx.go index 396e5b3543e..a248f481897 100644 --- a/e2e/testsuite/tx.go +++ b/e2e/testsuite/tx.go @@ -141,9 +141,9 @@ func (s *E2ETestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, ch sender, err := sdk.AccAddressFromBech32(user.FormattedAddress()) s.Require().NoError(err) - nextProposalID := s.proposalIDs[chain.Config().ChainID] + 1 + proposalID := s.proposalIDs[chain.Config().ChainID] defer func() { - s.proposalIDs[chain.Config().ChainID] = nextProposalID + s.proposalIDs[chain.Config().ChainID] = proposalID + 1 }() msgs := []sdk.Msg{msg} @@ -152,8 +152,8 @@ func (s *E2ETestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, ch sdk.NewCoins(sdk.NewCoin(chain.Config().Denom, govtypesv1.DefaultMinDepositTokens)), sender.String(), "", - fmt.Sprintf("e2e gov proposal: %d", nextProposalID), - fmt.Sprintf("executing gov proposal %d", nextProposalID), + fmt.Sprintf("e2e gov proposal: %d", proposalID), + fmt.Sprintf("executing gov proposal %d", proposalID), false, ) s.Require().NoError(err) @@ -161,11 +161,11 @@ func (s *E2ETestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, ch resp := s.BroadcastMessages(ctx, chain, user, msgSubmitProposal) s.AssertTxSuccess(resp) - s.Require().NoError(chain.VoteOnProposalAllValidators(ctx, strconv.Itoa(int(nextProposalID)), cosmos.ProposalVoteYes)) + s.Require().NoError(chain.VoteOnProposalAllValidators(ctx, strconv.Itoa(int(proposalID)), cosmos.ProposalVoteYes)) time.Sleep(testvalues.VotingPeriod) - proposal, err := s.QueryProposalV1(ctx, chain, nextProposalID) + proposal, err := s.QueryProposalV1(ctx, chain, proposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1.StatusPassed, proposal.Status) } @@ -173,9 +173,9 @@ func (s *E2ETestSuite) ExecuteGovV1Proposal(ctx context.Context, msg sdk.Msg, ch // ExecuteGovV1Beta1Proposal submits the given v1beta1 governance proposal using the provided user and uses all validators to vote yes on the proposal. // It ensures the proposal successfully passes. func (s *E2ETestSuite) ExecuteGovV1Beta1Proposal(ctx context.Context, chain *cosmos.CosmosChain, user ibc.Wallet, content govtypesv1beta1.Content) { - nextProposalID := s.proposalIDs[chain.Config().ChainID] + 1 + proposalID := s.proposalIDs[chain.Config().ChainID] defer func() { - s.proposalIDs[chain.Config().ChainID] = nextProposalID + s.proposalIDs[chain.Config().ChainID] = proposalID + 1 }() sender, err := sdk.AccAddressFromBech32(user.FormattedAddress()) @@ -190,21 +190,21 @@ func (s *E2ETestSuite) ExecuteGovV1Beta1Proposal(ctx context.Context, chain *cos // TODO: replace with parsed proposal ID from MsgSubmitProposalResponse // https://github.com/cosmos/ibc-go/issues/2122 - proposal, err := s.QueryProposalV1Beta1(ctx, chain, nextProposalID) + proposal, err := s.QueryProposalV1Beta1(ctx, chain, proposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusVotingPeriod, proposal.Status) - err = chain.VoteOnProposalAllValidators(ctx, fmt.Sprintf("%d", nextProposalID), cosmos.ProposalVoteYes) + err = chain.VoteOnProposalAllValidators(ctx, fmt.Sprintf("%d", proposalID), cosmos.ProposalVoteYes) s.Require().NoError(err) // ensure voting period has not passed before validators finished voting - proposal, err = s.QueryProposalV1Beta1(ctx, chain, nextProposalID) + proposal, err = s.QueryProposalV1Beta1(ctx, chain, proposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusVotingPeriod, proposal.Status) time.Sleep(testvalues.VotingPeriod) // pass proposal - proposal, err = s.QueryProposalV1Beta1(ctx, chain, nextProposalID) + proposal, err = s.QueryProposalV1Beta1(ctx, chain, proposalID) s.Require().NoError(err) s.Require().Equal(govtypesv1beta1.StatusPassed, proposal.Status) }