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: ICS27 interchain accounts x/group integration #2195

Merged
merged 36 commits into from
Oct 14, 2022

Conversation

damiannolan
Copy link
Member

@damiannolan damiannolan commented Sep 6, 2022

Description

  • Adding e2e with x/group integration for interchain-accounts.

closes: #2039


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Targeted PR against correct branch (see CONTRIBUTING.md)
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

members := []grouptypes.MemberRequest{
{
Address: chainAAddress,
Weight: "1",
Copy link
Member Author

Choose a reason for hiding this comment

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

extract to const?

Copy link
Contributor

Choose a reason for hiding this comment

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

probably a good habit

Copy link
Contributor

Choose a reason for hiding this comment

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

what is a threshold decision policy? What does the weight do?

Copy link
Member Author

Choose a reason for hiding this comment

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

The ThresholdDecisionPolicy defines a weighted threshold that x amount of YES votes must meet in order to succeed. Each group member can carry a different weight which is accounted for in the tally.

I've moved a bunch of fields to consts at the top of file and added godocs (some copy pasted from sdk).

e2e/go.mod Outdated Show resolved Hide resolved
@chatton
Copy link
Contributor

chatton commented Sep 28, 2022

All the e2e tests will fail as the ibctest ibc-go version needs to match the one in our e2e go mod. This is an sdk limitation at the moment as duplicate types are registered.

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Woot woot!! Superb work! Left some suggestions, will review in detail once it is updated to an alpha tag

e2e/testconfig/testconfig.go Outdated Show resolved Hide resolved
e2e/testsuite/testsuite.go Outdated Show resolved Hide resolved
e2e/testsuite/grpc_query.go Show resolved Hide resolved
members := []grouptypes.MemberRequest{
{
Address: chainAAddress,
Weight: "1",
Copy link
Contributor

Choose a reason for hiding this comment

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

probably a good habit

members := []grouptypes.MemberRequest{
{
Address: chainAAddress,
Weight: "1",
Copy link
Contributor

Choose a reason for hiding this comment

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

what is a threshold decision policy? What does the weight do?

e2e/tests/interchain_accounts/groups_test.go Outdated Show resolved Hide resolved
e2e/tests/interchain_accounts/groups_test.go Show resolved Hide resolved
e2e/tests/interchain_accounts/groups_test.go Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Oct 11, 2022

Codecov Report

Merging #2195 (c21fa95) into main (4bd05c6) will increase coverage by 0.04%.
The diff coverage is 66.66%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2195      +/-   ##
==========================================
+ Coverage   78.70%   78.74%   +0.04%     
==========================================
  Files         178      178              
  Lines       12311    12298      -13     
==========================================
- Hits         9689     9684       -5     
+ Misses       2195     2190       -5     
+ Partials      427      424       -3     
Impacted Files Coverage Δ
modules/apps/29-fee/types/msgs.go 90.43% <ø> (-0.33%) ⬇️
modules/core/02-client/types/msgs.go 75.73% <ø> (ø)
.../27-interchain-accounts/controller/types/params.go 47.82% <33.33%> (ø)
...s/apps/27-interchain-accounts/host/types/params.go 42.10% <33.33%> (ø)
modules/apps/transfer/types/params.go 48.00% <40.00%> (ø)
modules/apps/transfer/ibc_module.go 64.96% <66.66%> (+0.03%) ⬆️
modules/apps/transfer/keeper/msg_server.go 100.00% <100.00%> (ø)
modules/apps/transfer/keeper/relay.go 90.63% <100.00%> (+2.56%) ⬆️
modules/apps/transfer/types/msgs.go 95.12% <100.00%> (-0.12%) ⬇️
modules/apps/transfer/types/packet.go 92.00% <100.00%> (+0.33%) ⬆️
... and 1 more

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks, @damiannolan!

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Excellent! 😎 Super cool to see a test for this. Thanks for handling this work!

@@ -365,8 +379,10 @@ func (s *E2ETestSuite) initGRPCClients(chain *cosmos.CosmosChain) {
ClientQueryClient: clienttypes.NewQueryClient(grpcConn),
ChannelQueryClient: channeltypes.NewQueryClient(grpcConn),
FeeQueryClient: feetypes.NewQueryClient(grpcConn),
ICAQueryClient: intertxtypes.NewQueryClient(grpcConn),
ICAQueryClient: controllertypes.NewQueryClient(grpcConn),
InterTxQueryClient: intertxtypes.NewQueryClient(grpcConn),
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we should open up an issue to remove all the intertx stuff once v5 is no longer supported?

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, I can open an issue. When is v5 no longer supported? Like 1 year from now?

})

t.Run("verify interchain account registration success", func(t *testing.T) {
interchainAccAddr, err = s.QueryInterchainAccount(ctx, chainA, groupPolicyAddr, ibctesting.FirstConnectionID)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you could assert the addr is non empty

Copy link
Member Author

Choose a reason for hiding this comment

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

Added as an extra sanity check but I don't think its reachable. Something would be wrong with the query then I think

Comment on lines 146 to 148
channels, err := relayer.GetChannels(ctx, s.GetRelayerExecReporter(), chainA.Config().ChainID)
s.Require().NoError(err)
s.Require().Equal(len(channels), 2)
Copy link
Contributor

Choose a reason for hiding this comment

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

1 transfer channel, 1 ica channel?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup! Added inline comment 👍

balance, err := chainB.GetBalance(ctx, chainBAddress, chainB.Config().Denom)
s.Require().NoError(err)

_, err = chainB.GetBalance(ctx, interchainAccAddr, chainB.Config().Denom)
Copy link
Contributor

Choose a reason for hiding this comment

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

should you check that this balance has be subtracted as a sanity check?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done :)

@damiannolan damiannolan merged commit 8abcba0 into main Oct 14, 2022
@damiannolan damiannolan deleted the damian/2039-e2e-ics27-groups branch October 14, 2022 14:23
mergify bot pushed a commit that referenced this pull request Oct 14, 2022
* adding x/group to simapp

* [WIP] initial groups e2e scaffolding

* work in progress

* clean

* adding interchain account address query to ica controller

* adding basic cli query

* satisfy linter, aligning recvr var naming

* initial passing, register account proposal

* successfully passing locally

* updating default genesis state with allow all ica msgs, cleanup

* reinstate num validators and num full nodes

* unpin ibctest

* Update e2e/tests/interchain_accounts/groups_test.go

Co-authored-by: Carlos Rodriguez <[email protected]>

* updating swagger docs

* updating e2e to ibc-go/v6

* update deps, remove genesis code, extract consts

* code comments and consts

* readding intertx query client

* fixing godoc

* removing json entry in test matracies

* adding sanity checks and in-line comment

Co-authored-by: Carlos Rodriguez <[email protected]>
(cherry picked from commit 8abcba0)

# Conflicts:
#	e2e/go.mod
#	e2e/go.sum
#	e2e/tests/interchain_accounts/base_test.go
#	e2e/tests/interchain_accounts/incentivized_test.go
#	e2e/testsuite/grpc_query.go
#	e2e/testsuite/testsuite.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add e2e test for ics27 using groups
5 participants