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

E2E Upgrade Part 2 - Human Readable IBC Denom #4649

Merged
merged 44 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
618947d
chore: adding scaffolding function and workflow for v8 upgrade
chatton Sep 5, 2023
c1e3359
chore: adding basic scaffolding for upgrade test
chatton Sep 6, 2023
b41931c
chore: duplicating sdk function temporarily
chatton Sep 6, 2023
635bc3c
chore: happy path test passing
chatton Sep 6, 2023
46be834
chore: adding proposal to modify allowed clients list
chatton Sep 6, 2023
4455333
chore: remove proposal id
chatton Sep 6, 2023
7a50bd6
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
charleenfei Sep 8, 2023
94eb0d5
linter
charleenfei Sep 8, 2023
26841f9
update params for ExecuteGovProposalV1
charleenfei Sep 8, 2023
9c13c40
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 11, 2023
eb1fe98
chore: use actualBalance Int64 values
chatton Sep 11, 2023
283f9dd
chore: add conditional check for tmjson/json libraries
chatton Sep 11, 2023
860fb84
chore: hard code image to PR
chatton Sep 11, 2023
307f28f
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 12, 2023
f7482c0
chore: bumping go.mod versions to version with migration fix
chatton Sep 12, 2023
df0d044
chore: merge conflicts
chatton Sep 12, 2023
a4f47ac
chore: run upgrade tests when upgrade_test.go changes
chatton Sep 12, 2023
9a830a1
chore: adding better comment to the custom MustProtoMarshalJSON
chatton Sep 12, 2023
1299b98
chore: removing dupliated function and use the sdk fn directly
chatton Sep 12, 2023
b883409
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 12, 2023
f469dc3
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 13, 2023
6c7d4cf
Merge branch 'cian/issue#4216-add-v7-to-v8-e2e-upgrade-test' of https…
chatton Sep 13, 2023
ecd9a33
chore: bumping sdk version to latest commit
chatton Sep 13, 2023
882b657
chore: merge main
chatton Sep 13, 2023
4b4fa7b
chore: merge main
chatton Sep 13, 2023
591203c
chore: fixed usage of s.ExecuteGovV1Proposal
chatton Sep 13, 2023
4a8b708
chore: update E2E to assert human readable denom
chatton Sep 13, 2023
f863354
Merge branch 'main' into cian/issue#4216-add-v7-to-v8-e2e-upgrade-test
chatton Sep 13, 2023
1b80c4f
chore: correct logic around proposal id
chatton Sep 14, 2023
20c810f
chore: addressing PR feedback
chatton Sep 14, 2023
c0faf67
chore: fix proposal id logic
chatton Sep 14, 2023
ed168a3
chore: merge main
chatton Sep 14, 2023
b76b9c9
Merge branch 'cian/issue#4216-add-v7-to-v8-e2e-upgrade-test' into cia…
chatton Sep 14, 2023
d37c0a0
chore: corrected HumanReadableDenomFeatureReleases
chatton Sep 14, 2023
46fd3ba
chore: correcting upgrade chain
chatton Sep 14, 2023
ef727b6
chore: addressed PR feedback
chatton Sep 14, 2023
5785dc6
Merge branch 'main' into cian/issue#4645-v7-to-v8-upgrade-test-part-2
chatton Sep 14, 2023
aace0a1
Merge branch 'main' into cian/issue#4645-v7-to-v8-upgrade-test-part-2
chatton Sep 14, 2023
d0f3b34
Merge branch 'main' into cian/issue#4645-v7-to-v8-upgrade-test-part-2
Sep 15, 2023
240c89c
Merge branch 'main' into cian/issue#4645-v7-to-v8-upgrade-test-part-2
Sep 15, 2023
33dc779
merged with other code for testing denom metadata
Sep 15, 2023
76b007f
Merge branch 'main' into cian/issue#4645-v7-to-v8-upgrade-test-part-2
chatton Sep 18, 2023
043ca76
chore: merge main
chatton Sep 18, 2023
a5087a6
chore: merge main
chatton Sep 18, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/e2e-upgrade.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
chain-binary: simd
chain-a-tag: v7.0.0
chain-b-tag: v7.0.0
chain-upgrade-tag: pr-4591 # TODO: update this to a real tag once v8 is released
chain-upgrade-tag: main # TODO: update this to a real tag once v8 is released
Copy link
Contributor

Choose a reason for hiding this comment

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

I opened #4674.

upgrade-plan-name: "v8"
test-entry-point: "TestUpgradeTestSuite"
test: "TestV7ToV8ChainUpgrade"
Expand Down
4 changes: 4 additions & 0 deletions e2e/tests/transfer/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ func (s *TransferTestSuite) TestMsgTransfer_Succeeds_Nonincentivized() {

expected := testvalues.IBCTransferAmount
s.Require().Equal(expected, actualBalance.Int64())

if testvalues.HumanReadableDenomFeatureReleases.IsSupported(chainBVersion) {
s.AssertHumanReadableDenom(ctx, chainB, chainADenom, channelA)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I put together both assertions (check metadata is stored, check that balance returns the human readable denom). I hope that's ok, @chatton.

}
})

t.Run("non-native IBC token transfer from chainB to chainA, receiver is source of tokens", func(t *testing.T) {
Expand Down
4 changes: 4 additions & 0 deletions e2e/tests/upgrades/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,10 @@ func (s *UpgradeTestSuite) TestV7ToV8ChainUpgrade() {
s.Require().Contains(allowedClients, exported.Tendermint)
s.Require().Contains(allowedClients, "some-client")
})

t.Run("query human readable ibc denom", func(t *testing.T) {
s.AssertHumanReadableDenom(ctx, chainB, chainADenom, channelA)
})
}

// RegisterInterchainAccount will attempt to register an interchain account on the counterparty chain.
Expand Down
16 changes: 16 additions & 0 deletions e2e/testsuite/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"sort"
"time"

banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
// intertxtypes "github.com/cosmos/interchain-accounts/x/inter-tx/types"
"github.com/strangelove-ventures/interchaintest/v8/chain/cosmos"
"github.com/strangelove-ventures/interchaintest/v8/ibc"
Expand Down Expand Up @@ -54,6 +55,7 @@ type GRPCClients struct {
AuthQueryClient authtypes.QueryClient
AuthZQueryClient authz.QueryClient
UpgradeQueryClient upgradetypes.QueryClient
BankQueryClient banktypes.QueryClient

ConsensusServiceClient cmtservice.ServiceClient
}
Expand Down Expand Up @@ -94,6 +96,7 @@ func (s *E2ETestSuite) InitGRPCClients(chain *cosmos.CosmosChain) {
AuthZQueryClient: authz.NewQueryClient(grpcConn),
ConsensusServiceClient: cmtservice.NewServiceClient(grpcConn),
UpgradeQueryClient: upgradetypes.NewQueryClient(grpcConn),
BankQueryClient: banktypes.NewQueryClient(grpcConn),
}
}

Expand Down Expand Up @@ -377,3 +380,16 @@ func (s *E2ETestSuite) QueryGranterGrants(ctx context.Context, chain *cosmos.Cos

return grants.Grants, nil
}

// QueryDenomMetdata queries the metadata for the given denom.
func (s *E2ETestSuite) QueryDenomMetdata(ctx context.Context, chain *cosmos.CosmosChain, denom string) (banktypes.Metadata, error) {
bankClient := s.GetChainGRCPClients(chain).BankQueryClient
queryRequest := &banktypes.QueryDenomMetadataRequest{
Denom: denom,
}
res, err := bankClient.DenomMetadata(ctx, queryRequest)
if err != nil {
return banktypes.Metadata{}, err
}
return res.Metadata, nil
}
13 changes: 13 additions & 0 deletions e2e/testsuite/testsuite.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,19 @@ func (s *E2ETestSuite) AssertPacketRelayed(ctx context.Context, chain *cosmos.Co
s.Require().Empty(commitment)
}

// AssertHumanReadableDenom asserts that a human readable denom is present for a given chain.
func (s *E2ETestSuite) AssertHumanReadableDenom(ctx context.Context, chain *cosmos.CosmosChain, counterpartyNativeDenom string, counterpartyChannel ibc.ChannelOutput) {
chainIBCDenom := GetIBCToken(counterpartyNativeDenom, counterpartyChannel.Counterparty.PortID, counterpartyChannel.Counterparty.ChannelID)

denomMetadata, err := s.QueryDenomMetdata(ctx, chain, chainIBCDenom.IBCDenom())
s.Require().NoError(err)

s.Require().Equal(chainIBCDenom.IBCDenom(), denomMetadata.Base)
s.Require().Equal(fmt.Sprintf("%s/%s/%s IBC token", counterpartyChannel.Counterparty.PortID, counterpartyChannel.Counterparty.ChannelID, counterpartyNativeDenom), denomMetadata.Name)
s.Require().Equal(fmt.Sprintf("%s/%s/%s", counterpartyChannel.Counterparty.PortID, counterpartyChannel.Counterparty.ChannelID, counterpartyNativeDenom), denomMetadata.Display)
s.Require().Equal(strings.ToUpper(counterpartyNativeDenom), denomMetadata.Symbol)
}

// createCosmosChains creates two separate chains in docker containers.
// test and can be retrieved with GetChains.
func (s *E2ETestSuite) createCosmosChains(chainOptions ChainOptions) (*cosmos.CosmosChain, *cosmos.CosmosChain) {
Expand Down
5 changes: 5 additions & 0 deletions e2e/testvalues/values.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,8 @@ var LocalhostClientFeatureReleases = semverutil.FeatureReleases{
"v7.1",
},
}

// HumanReadableDenomFeatureReleases represents the releases the human readable denom feature was released in.
var HumanReadableDenomFeatureReleases = semverutil.FeatureReleases{
Copy link
Member

Choose a reason for hiding this comment

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

could also call this DenomMetadataFeatureReleases might be the tiniest bit less wordy, but whatever, happy with this too!

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'll maybe do the rename in #4660 to avoid needing to do a full re-run of the upgrades here!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nvm the upgrade test failed anyway :D

MajorVersion: "v8",
}