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

test: interchain accounts via interchaintest #3308

Merged
merged 10 commits into from
Apr 22, 2024

Conversation

rootulp
Copy link
Collaborator

@rootulp rootulp commented Apr 12, 2024

Closes #3207.

For posterity, this branch contains a messy commit history that describes issues encountered when setting up these tests.

@rootulp rootulp self-assigned this Apr 12, 2024
@rootulp rootulp marked this pull request as ready for review April 12, 2024 17:35
@rootulp rootulp requested a review from a team as a code owner April 12, 2024 17:35
@rootulp rootulp requested review from rach-id and evan-forbes and removed request for a team April 12, 2024 17:35
Copy link
Contributor

coderabbitai bot commented Apr 12, 2024

Warning

Rate Limit Exceeded

@rootulp has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 7 minutes and 14 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 009cfc0 and fb3ca28.

Walkthrough

The recent updates include enhancements to interchain testing capabilities, particularly focusing on the Interchain Accounts (ICA) feature. New testing targets and configurations have been introduced in the Makefile, along with updates to the go.work.example to support interchain package imports. Furthermore, new functionalities and configurations for Celestia and CosmosHub chains are defined, alongside a specific test case for ICA functionality.

Changes

Files Changes
Makefile, go.work.example Added update functionality for go.mod, new test target test-interchain, and alias test-ic.
test/interchain/README.md Provided detailed instructions and information for interchain tests.
.../chainspec/celestia.go, constants.go, .../cosmosHub.go Defined chain setup functions and configurations for Celestia and CosmosHub.
test/interchain/ica_test.go, relayer.go Added a new test case TestICA and defined relayer setup functions for interchain testing.

Assessment against linked issues

Objective Addressed Explanation
Enable faster iteration cycle for implementing CIPs by testing features in a local environment (#3050)
Develop a script to spin up a test environment including IBC components (#3050) The changes focus on test setup within the codebase, not on creating external scripts.
Integrate and test ics-027-interchain-accounts (#1533, #3207)
Address issues with Docker images and config overrides for interchaintest (#3207) The changes mention Docker configurations but do not clarify if the specific issues were resolved.

Possibly related issues


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

Note: Auto-reply has been disabled for this repository by the repository owner. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rootulp rootulp requested review from cmwaters and ninabarbakadze and removed request for rach-id and evan-forbes April 12, 2024 17:38
cmwaters
cmwaters previously approved these changes Apr 15, 2024
Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

LGTM

We don't need to add this to the test-race Makefile cmd right?

test/interchain/ica_test.go Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
@celestia-bot celestia-bot requested review from a team and staheri14 and removed request for a team April 15, 2024 14:38
@rootulp
Copy link
Collaborator Author

rootulp commented Apr 15, 2024

We don't need to add this to the test-race Makefile cmd right?

Good question. test-race passes even though I didn't mean for it to run this test case. I'm pretty sure the other TestICA is getting invoked on test-race and not this one.

=== RUN   TestICA
--- PASS: TestICA (0.06s)

I'll rename this one to verify.

Update: looks like TestInterChainAccounts isn't getting run during test-race so we don't need to explicitly add it to the skip portion in the Makefile.

@celestia-bot celestia-bot requested a review from a team April 15, 2024 14:44
@rootulp rootulp marked this pull request as draft April 15, 2024 14:56
@cmwaters
Copy link
Contributor

Update: looks like TestInterChainAccounts isn't getting run during test-race so we don't need to explicitly add it to the skip portion in the Makefile.

Why isn't it getting run? I thought it would

@rootulp
Copy link
Collaborator Author

rootulp commented Apr 15, 2024

It looks like go list ./... only lists packages that are under the root level go.mod's module: github.com/celestiaorg/celestia-app/v2. Per

A pattern containing "..." specifies the active modules whose
module paths match the pattern.

From go help list.

It doesn't list packages under github.com/celestiaorg/celestia-app/test/testground or github.com/celestiaorg/celestia-app/test/interchain

$ go list ./...
github.com/celestiaorg/celestia-app/v2/app
github.com/celestiaorg/celestia-app/v2/app/ante
github.com/celestiaorg/celestia-app/v2/app/encoding
github.com/celestiaorg/celestia-app/v2/app/errors
github.com/celestiaorg/celestia-app/v2/app/module
github.com/celestiaorg/celestia-app/v2/app/posthandler
github.com/celestiaorg/celestia-app/v2/app/test
github.com/celestiaorg/celestia-app/v2/cmd/celestia-appd
github.com/celestiaorg/celestia-app/v2/cmd/celestia-appd/cmd
github.com/celestiaorg/celestia-app/v2/pkg/appconsts
github.com/celestiaorg/celestia-app/v2/pkg/appconsts/testground
github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v1
github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v2
github.com/celestiaorg/celestia-app/v2/pkg/da
github.com/celestiaorg/celestia-app/v2/pkg/inclusion
github.com/celestiaorg/celestia-app/v2/pkg/proof
github.com/celestiaorg/celestia-app/v2/pkg/user
github.com/celestiaorg/celestia-app/v2/pkg/wrapper
github.com/celestiaorg/celestia-app/v2/proto/celestia/core/v1/da
github.com/celestiaorg/celestia-app/v2/test/cmd/txsim
github.com/celestiaorg/celestia-app/v2/test/e2e
github.com/celestiaorg/celestia-app/v2/test/ledger
github.com/celestiaorg/celestia-app/v2/test/packetforward
github.com/celestiaorg/celestia-app/v2/test/tokenfilter
github.com/celestiaorg/celestia-app/v2/test/txsim
github.com/celestiaorg/celestia-app/v2/test/util
github.com/celestiaorg/celestia-app/v2/test/util/blobfactory
github.com/celestiaorg/celestia-app/v2/test/util/genesis
github.com/celestiaorg/celestia-app/v2/test/util/malicious
github.com/celestiaorg/celestia-app/v2/test/util/sdkutil
github.com/celestiaorg/celestia-app/v2/test/util/testfactory
github.com/celestiaorg/celestia-app/v2/test/util/testnode
github.com/celestiaorg/celestia-app/v2/tools/blocktime
github.com/celestiaorg/celestia-app/v2/x/blob
github.com/celestiaorg/celestia-app/v2/x/blob/ante
github.com/celestiaorg/celestia-app/v2/x/blob/client/cli
github.com/celestiaorg/celestia-app/v2/x/blob/client/testutil
github.com/celestiaorg/celestia-app/v2/x/blob/keeper
github.com/celestiaorg/celestia-app/v2/x/blob/test
github.com/celestiaorg/celestia-app/v2/x/blob/types
github.com/celestiaorg/celestia-app/v2/x/blobstream
github.com/celestiaorg/celestia-app/v2/x/blobstream/client
github.com/celestiaorg/celestia-app/v2/x/blobstream/keeper
github.com/celestiaorg/celestia-app/v2/x/blobstream/types
github.com/celestiaorg/celestia-app/v2/x/minfee
github.com/celestiaorg/celestia-app/v2/x/mint
github.com/celestiaorg/celestia-app/v2/x/mint/client/cli
github.com/celestiaorg/celestia-app/v2/x/mint/client/testutil
github.com/celestiaorg/celestia-app/v2/x/mint/keeper
github.com/celestiaorg/celestia-app/v2/x/mint/simulation
github.com/celestiaorg/celestia-app/v2/x/mint/test
github.com/celestiaorg/celestia-app/v2/x/mint/types
github.com/celestiaorg/celestia-app/v2/x/paramfilter
github.com/celestiaorg/celestia-app/v2/x/paramfilter/test
github.com/celestiaorg/celestia-app/v2/x/signal
github.com/celestiaorg/celestia-app/v2/x/signal/cli
github.com/celestiaorg/celestia-app/v2/x/signal/types
github.com/celestiaorg/celestia-app/v2/x/tokenfilter

@rootulp rootulp marked this pull request as ready for review April 18, 2024 19:31
@rootulp rootulp requested a review from cmwaters April 18, 2024 19:31
ninabarbakadze
ninabarbakadze previously approved these changes Apr 19, 2024
Copy link
Member

@ninabarbakadze ninabarbakadze left a comment

Choose a reason for hiding this comment

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

lgtm!! well done for getting interchain test to work! :)

test/interchain/README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@cmwaters cmwaters left a comment

Choose a reason for hiding this comment

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

Thanks for adding the part that queries the channels.

Just a few minor nits. I think mainly we should be adding these tests to the CI (maybe only when certain files are touched)

Comment on lines +169 to +173
## test-interchain: Run interchain tests in verbose mode. Requires Docker.
test-interchain:
@echo "--> Running interchain tests"
@go test ./test/interchain -v
.PHONY: test-interchain
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add this to the CI then

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm hesitant to add it to CI now because this test currently uses a static docker image https://github.com/rootulp/celestia-app/blob/08ca4d2fe7971d69b71a39a1e2c91dbdb50e72ce/test/interchain/chainspec/celestia.go#L16

so even if a PR breaks ICA, we wouldn't get signal by running it in CI unless we update that static docker image to use a Docker image that is created on a per PR basis. Will create a follow up issue to add it to CI

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Created #3358

test/interchain/chainspec/cosmosHub.go Show resolved Hide resolved
test/interchain/inter_chain_accounts_test.go Outdated Show resolved Hide resolved
require.Empty(t, stderr)
t.Logf("stdout %v", string(stdout))

err = testutil.WaitForBlocks(ctx, 5, celestia, cosmosHub)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
err = testutil.WaitForBlocks(ctx, 5, celestia, cosmosHub)
err = testutil.WaitForBlocks(ctx, 1, celestia, cosmosHub)

Can this just be 1? Is the timeout for celestia going to be 11 seconds? i.e. the default

Copy link
Collaborator Author

@rootulp rootulp Apr 19, 2024

Choose a reason for hiding this comment

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

I just dropped it to 1 and hit an error because

    inter_chain_accounts_test.go:103:
        	Error Trace:	/Users/rootulp/git/rootulp/celestiaorg/celestia-app/test/interchain/inter_chain_accounts_test.go:103
        	Error:      	Received unexpected error:
        	            	exit code 1:  Error: rpc error: code = NotFound desc = rpc error: code = NotFound desc = failed to retrieve account address for icacontroller-cosmos15c8ytdk94gw4ksajeekzlmx6qjrnu4ul20l094 on connection connection-0: key not found

blocks are getting produced faster than 11 seconds b/c the test only takes ~80 seconds to complete and we're at least waiting for 9 blocks in the whole test (2, 2, then 5 here):

ok  	github.com/celestiaorg/celestia-app/test/interchain	82.041s

@evan-forbes evan-forbes self-requested a review April 19, 2024 15:52
evan-forbes
evan-forbes previously approved these changes Apr 19, 2024
Copy link
Member

@evan-forbes evan-forbes left a comment

Choose a reason for hiding this comment

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

LGTM great debugging

@rootulp rootulp dismissed stale reviews from evan-forbes and ninabarbakadze via 08ca4d2 April 19, 2024 20:54
@celestia-bot celestia-bot requested review from a team and evan-forbes and removed request for a team April 19, 2024 20:54
@celestia-bot celestia-bot requested a review from a team April 19, 2024 20:59
@rootulp rootulp requested review from ninabarbakadze and cmwaters and removed request for staheri14 and a team April 19, 2024 21:07
@rootulp rootulp merged commit 3af8da5 into celestiaorg:main Apr 22, 2024
33 checks passed
@rootulp rootulp deleted the rp/ica-tests-squashed branch April 22, 2024 13:29
ninabarbakadze pushed a commit to ninabarbakadze/celestia-app that referenced this pull request Apr 25, 2024
Closes celestiaorg#3207. 

For posterity, [this
branch](https://github.com/rootulp/celestia-app/tree/rp/ica-tests)
contains a messy commit history that describes issues encountered when
setting up these tests.
ninabarbakadze pushed a commit to ninabarbakadze/celestia-app that referenced this pull request Apr 25, 2024
Closes celestiaorg#3207. 

For posterity, [this
branch](https://github.com/rootulp/celestia-app/tree/rp/ica-tests)
contains a messy commit history that describes issues encountered when
setting up these tests.
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.

ICA end-to-end tests
4 participants