Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(core/02-client): remove legacy proposal types. #6782

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions e2e/tests/core/02-client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() {
chainAWallet := s.CreateUserOnChainA(ctx, testvalues.StartingTokenAmount)

const planHeight = int64(300)
const legacyPlanHeight = planHeight * 2
var newChainID string

t.Run("execute proposal for MsgIBCSoftwareUpgrade", func(t *testing.T) {
Expand Down Expand Up @@ -130,34 +129,6 @@ func (s *ClientTestSuite) TestScheduleIBCUpgrade_Succeeds() {
s.Require().Equal("upgrade-client", plan.Name)
s.Require().Equal(planHeight, plan.Height)
})

t.Run("ensure legacy proposal does not succeed", func(t *testing.T) {
authority, err := query.ModuleAccountAddress(ctx, govtypes.ModuleName, chainA)
s.Require().NoError(err)
s.Require().NotNil(authority)

clientState, err := query.ClientState(ctx, chainB, ibctesting.FirstClientID)
s.Require().NoError(err)

originalChainID := clientState.(*ibctm.ClientState).ChainId
revisionNumber := clienttypes.ParseChainID(originalChainID)
// increment revision number even with new chain ID to prevent loss of misbehaviour detection support
newChainID, err = clienttypes.SetRevisionNumber(originalChainID, revisionNumber+1)
s.Require().NoError(err)
s.Require().NotEqual(originalChainID, newChainID)

upgradedClientState := clientState.(*ibctm.ClientState).ZeroCustomFields()
upgradedClientState.ChainId = newChainID

legacyUpgradeProposal, err := clienttypes.NewUpgradeProposal(ibctesting.Title, ibctesting.Description, upgradetypes.Plan{
Name: "upgrade-client-legacy",
Height: legacyPlanHeight,
}, upgradedClientState)

s.Require().NoError(err)
txResp := s.ExecuteGovV1Beta1Proposal(ctx, chainA, chainAWallet, legacyUpgradeProposal)
s.AssertTxFailure(txResp, govtypes.ErrInvalidProposalContent)
})
}

// TestRecoverClient_Succeeds tests that a governance proposal to recover a client using a MsgRecoverClient is successful.
Expand Down
4 changes: 0 additions & 4 deletions e2e/tests/wasm/feature_releases.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ package wasm

import "github.com/cosmos/ibc-go/e2e/semverutil"

var govV1FeatureReleases = semverutil.FeatureReleases{
MajorVersion: "v8",
}

var govV1FailedReasonFeatureReleases = semverutil.FeatureReleases{
MajorVersion: "v8",
}
19 changes: 6 additions & 13 deletions e2e/tests/wasm/grandpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
transfertypes "github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibctesting "github.com/cosmos/ibc-go/v8/testing"
)

const (
Expand Down Expand Up @@ -548,19 +547,13 @@ func (s *GrandpaTestSuite) TestRecoverClient_Succeeds_GrandpaContract() {
s.Require().NoError(err)
s.Require().Equal(ibcexported.Active.String(), status, "unexpected substitute client status")

version := cosmosChain.Nodes()[0].Image.Version
if govV1FeatureReleases.IsSupported(version) {
// create and execute a client recovery proposal
authority, err := query.ModuleAccountAddress(ctx, govtypes.ModuleName, cosmosChain)
s.Require().NoError(err)
// create and execute a client recovery proposal
authority, err := query.ModuleAccountAddress(ctx, govtypes.ModuleName, cosmosChain)
s.Require().NoError(err)

msgRecoverClient := clienttypes.NewMsgRecoverClient(authority.String(), subjectClientID, substituteClientID)
s.Require().NotNil(msgRecoverClient)
s.ExecuteAndPassGovV1Proposal(ctx, msgRecoverClient, cosmosChain, cosmosUser)
} else {
proposal := clienttypes.NewClientUpdateProposal(ibctesting.Title, ibctesting.Description, subjectClientID, substituteClientID)
s.ExecuteAndPassGovV1Beta1Proposal(ctx, cosmosChain, cosmosWallet, proposal)
Comment on lines -561 to -562
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe there's no other sensible thing to do here now, right? (Not that we run these tests atm, but that's besides the point)

Copy link
Contributor

Choose a reason for hiding this comment

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

what version did we release wasm in. This should fail compatibility if tested on pre v8

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it would but we don't run compat for 08-wasm. This is typical problem with rm'ing types in newer versions that are used in compat tests. We could get em in e2e if you feel like this is a must. Will slam this in for now.

}
msgRecoverClient := clienttypes.NewMsgRecoverClient(authority.String(), subjectClientID, substituteClientID)
s.Require().NotNil(msgRecoverClient)
s.ExecuteAndPassGovV1Proposal(ctx, msgRecoverClient, cosmosChain, cosmosUser)

// ensure subject client is active
status, err = query.ClientStatus(ctx, cosmosChain, subjectClientID)
Expand Down
Loading
Loading