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

N-ary Test Chains Support #1572

Merged
merged 53 commits into from
Mar 14, 2022
Merged

N-ary Test Chains Support #1572

merged 53 commits into from
Mar 14, 2022

Conversation

soareschen
Copy link
Contributor

@soareschen soareschen commented Nov 16, 2021

Closes #1577 and #1776

Description

This is a follow up on #1521 to allow tests to setup N-ary test chains using const generics

Documentation for how to use the N-ary constructs indexed by const generics: https://informalsystems.github.io/ibc-rs-doc/ibc_integration_test/types/nary/index.html


For contributor use:

  • Added a changelog entry, using unclog.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

@soareschen soareschen marked this pull request as draft November 16, 2021 22:03
soareschen added a commit that referenced this pull request Nov 18, 2021
soareschen added a commit that referenced this pull request Nov 18, 2021
@soareschen soareschen force-pushed the soares/nary-test-chains branch from 79e146d to 6b804cd Compare November 18, 2021 11:18
Base automatically changed from soares/integration-test to master November 18, 2021 14:29
romac pushed a commit that referenced this pull request Nov 18, 2021
* WIP relayer test

* Bootstrap chain almost working

* Refactor chain bootstrap code

* Trying to get create client work.

* Test create client is now working

* Fix formatting

* WIP IBC packet transfer

* Got IBC transfer working

* Refactor supervisor and denom tracing

* More refactoring

* More refactoring

* Refactor build_and_send_transfer_messages

* Round trip IBC token transfer is now working

* Refactor channel bootstrap code

* Add tagged chain handle wrapper

* Rename ChainCommand to ChainDriver

* Make bootstrap pair return impl ChainHandle

* Add tagged types

* Refactor bootstrap pair

* Tag ChainDriver

* Add mono tag, refactor single chain bootstrap

* More refactoring

* More refactoring

* Fix chain tags

* Channel creation ordering is now consistent

* Test IBC transfer in both directions

* Fix monitor shutdown error

* Refactor wait wallet amount

* Make init script return test config. Add hang test helper

* Draft memo testing working

* Add boostrap_chain_and_channel_pair

* Add memo test as separate test

* Disable health check in tests to suppress version errors from gaiad in Nix

* Add CI workflow

* Use experimental Nix with flakes

* Refactor test cases to use composable traits

* Use NoTestConfig wrapper type for test defaults

* Reorder code definitions

* Try out new way to override test config and implement override defaults

* Preemptively shutdown supervisor at the end of chain tests

* Rearrange type definitions

* Rename framework traits

* Rename and move override traits

* Rename ChainDeployment to ConnectedChains

* Refactor chain bootstrap

* Add BinaryNodeTest trait

* Add alpha- and beta- prefix to binary chain nodes

* Add HANG_ON_FAIL test hooks

* Add non-owned BinaryNodeTest

* Refactor Supervisor to use shared reference to chain registry

* Spawn supervisor in OwnedBinaryChainTest

* New test override approach with separate override argument

* Clean up overrides design

* Fix cargo doc

* Save relayer config onto file system

* Simplify test overrides

* Use absolute path for data directory path

* Adding documentation

* Add documentation for `framework` module

* Adding more documentation

* Reorganize test data directory

* Add documentation for `bootstrap` module

* Reorganize tagged module

* Add documentation for MonoTagged

* Refactor tagged methods into traits

* Add documentation for DualTagged

* Finish documenting most constructs

* Move example documentation

* Rename hang to suspend

* Fix example doctest

* Add more detailed documentation for DualTagged::contra_map

* Remove ChainClientServer and inline the handle and node fields directly

* Add documentation for connected chains and channels

* Finish documenting everything

* Only check for version in health check.

Failure in parsing chain version should not result in failure of
the entire relayer.

* Stop chain handle when it is dropped

* Add simulation manual test

* Add documentation for new constructs

* Move manual tests into the tests::manual module

* Add test framework for running tests with self-connected chains

* Add NodeConfigOverride for overriding full node config

* Draft definition for N-ary connected chains using const generics

* Implement N-ary bootstrap chains code

* Done initial bootstrap code for N-ary channels.

* Refactor to allow dynamic sized n-ary chains

* Running binary IBC transfer test as n-ary test successful

* Add environment exporter to test

* Separate drop handlers from chain and node types

* Remove reference version of test traits

* Remove "Owned" and "owned_" prefixes

* Put N-ary chain features behind "experimental" feature flag

* Clean up cargo configuration, address review feedback

* Fix build error

* Fix doctests

* Add custom Default instance for ModeConfig which enables everything by default

* Follow default ModeConfig as specified in #1539

* Add test_setup_with_binary_channel command wrapper

* Fix clippy

* Fix unit test CI

* Randomize created client and connection ids

* Randomize channel IDs when bootstrapping channels

* Move bootstrap connection code to separate module

* Add back child process as a shared Arc pointer in FullNode

* Move experimental N-ary test chains to separate PR

* Fill out missing documentation

* Move N-ary chain constructs to #1572

* Minor fix documentation

* Add a bit more documentation to tagged identifiers

* Slightly clean up bootstrap logs
@soareschen soareschen force-pushed the soares/nary-test-chains branch from 6b804cd to 4fa47e2 Compare November 19, 2021 10:22
@adizere adizere linked an issue Nov 25, 2021 that may be closed by this pull request
5 tasks
@mzabaluev
Copy link
Contributor

Conflicts need to be resolved.

@adizere adizere mentioned this pull request Feb 1, 2022
5 tasks
@@ -456,7 +456,7 @@ impl ChainDriver {
) -> Result<(), Error> {
assert_eventually_succeed(
"wallet reach expected amount",
20,
40,
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 seems like there is some performance regression when the relayer is setup with multiple channels. I have to increase the timeout limit for assert_eventual_wallet_amount to > 20s for the IBC transfer test to not fail.

@soareschen
Copy link
Contributor Author

This branch is currently crashing in Rust Analyzer caused by rust-lang/rust-analyzer#11659.

@soareschen
Copy link
Contributor Author

This branch is now working with the pre-release version of Rust Analyzer. You'll have to explicitly enable that in the VSCode extension for it to work:

Screenshot from 2022-03-10 17-45-48

This PR is blocked from merging until new official release of Rust Analyzer.

@adizere it might also be a good idea for you to test this on IntelliJ. If it doesn't work there, we'd have to switch back to always having const generic parameters at the last position.

@@ -19,7 +19,7 @@ jobs:
- run: cargo doc

- name: Deploy
if: ${{ github.ref == 'ref/head/master' }}
if: ${{ github.ref == 'refs/heads/soares/nary-test-chains' }}
Copy link
Member

Choose a reason for hiding this comment

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

Let's revert this before merging?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, actually I keep having problem finding the correct expression to trigger this step. It is not triggering on master as well.

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 have reverted the branch to master. It probably still won't work on master, but we can figure out a fix in a separate PR.

@soareschen soareschen merged commit d1a5043 into master Mar 14, 2022
@soareschen soareschen deleted the soares/nary-test-chains branch March 14, 2022 17:21
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* WIP relayer test

* Bootstrap chain almost working

* Refactor chain bootstrap code

* Trying to get create client work.

* Test create client is now working

* Fix formatting

* WIP IBC packet transfer

* Got IBC transfer working

* Refactor supervisor and denom tracing

* More refactoring

* More refactoring

* Refactor build_and_send_transfer_messages

* Round trip IBC token transfer is now working

* Refactor channel bootstrap code

* Add tagged chain handle wrapper

* Rename ChainCommand to ChainDriver

* Make bootstrap pair return impl ChainHandle

* Add tagged types

* Refactor bootstrap pair

* Tag ChainDriver

* Add mono tag, refactor single chain bootstrap

* More refactoring

* More refactoring

* Fix chain tags

* Channel creation ordering is now consistent

* Test IBC transfer in both directions

* Fix monitor shutdown error

* Refactor wait wallet amount

* Make init script return test config. Add hang test helper

* Draft memo testing working

* Add boostrap_chain_and_channel_pair

* Add memo test as separate test

* Disable health check in tests to suppress version errors from gaiad in Nix

* Add CI workflow

* Use experimental Nix with flakes

* Refactor test cases to use composable traits

* Use NoTestConfig wrapper type for test defaults

* Reorder code definitions

* Try out new way to override test config and implement override defaults

* Preemptively shutdown supervisor at the end of chain tests

* Rearrange type definitions

* Rename framework traits

* Rename and move override traits

* Rename ChainDeployment to ConnectedChains

* Refactor chain bootstrap

* Add BinaryNodeTest trait

* Add alpha- and beta- prefix to binary chain nodes

* Add HANG_ON_FAIL test hooks

* Add non-owned BinaryNodeTest

* Refactor Supervisor to use shared reference to chain registry

* Spawn supervisor in OwnedBinaryChainTest

* New test override approach with separate override argument

* Clean up overrides design

* Fix cargo doc

* Save relayer config onto file system

* Simplify test overrides

* Use absolute path for data directory path

* Adding documentation

* Add documentation for `framework` module

* Adding more documentation

* Reorganize test data directory

* Add documentation for `bootstrap` module

* Reorganize tagged module

* Add documentation for MonoTagged

* Refactor tagged methods into traits

* Add documentation for DualTagged

* Finish documenting most constructs

* Move example documentation

* Rename hang to suspend

* Fix example doctest

* Add more detailed documentation for DualTagged::contra_map

* Remove ChainClientServer and inline the handle and node fields directly

* Add documentation for connected chains and channels

* Finish documenting everything

* Only check for version in health check.

Failure in parsing chain version should not result in failure of
the entire relayer.

* Stop chain handle when it is dropped

* Add simulation manual test

* Add documentation for new constructs

* Move manual tests into the tests::manual module

* Add test framework for running tests with self-connected chains

* Add NodeConfigOverride for overriding full node config

* Draft definition for N-ary connected chains using const generics

* Implement N-ary bootstrap chains code

* Done initial bootstrap code for N-ary channels.

* Refactor to allow dynamic sized n-ary chains

* Running binary IBC transfer test as n-ary test successful

* Add environment exporter to test

* Separate drop handlers from chain and node types

* Remove reference version of test traits

* Remove "Owned" and "owned_" prefixes

* Put N-ary chain features behind "experimental" feature flag

* Clean up cargo configuration, address review feedback

* Fix build error

* Fix doctests

* Add custom Default instance for ModeConfig which enables everything by default

* Follow default ModeConfig as specified in informalsystems#1539

* Add test_setup_with_binary_channel command wrapper

* Fix clippy

* Fix unit test CI

* Randomize created client and connection ids

* Randomize channel IDs when bootstrapping channels

* Move bootstrap connection code to separate module

* Add back child process as a shared Arc pointer in FullNode

* Move experimental N-ary test chains to separate PR

* Fill out missing documentation

* Move N-ary chain constructs to informalsystems#1572

* Minor fix documentation

* Add a bit more documentation to tagged identifiers

* Slightly clean up bootstrap logs
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Implement N-ary chain test support

This reverts commit 20d502d.

* Add binary connection test traits

* Refactor and share code between N-ary and binary constructs

* Add bootstrap N-ary connections code

* Add N-ary connection test traits

* Remove "experimental" feature flag for N-ary modules

* Propagate bootstrap_with_random_ids flag

* Increase timeout limit for assert_eventual_wallet_amount

* Add N-ary self connected chains test

* Fix cargo doc

* Adding documentation for N-ary constructs

* Add more documentation

* Add CI workflow to publish cargo doc

* Add documentation for array utilities

* Publish cargo doc only on master

* Remove stale code

* Add should_spawn_supervisor() method in TestOverrides

* Fix errors from merge

* Test deploy cargo doc

* WIP Ternary IBC transfer test

* Require tests to spawn supervisor explicitly

* 2-hop IBC transfer test is now working

* Full ternary transfer test is now working

* Fix supervisor test

* Trying to find the correct syntax for GitHub publish condition

* Refactor N-ary foreign client pairs

* Introduce ForeignClientPair

* Fix publish docs CI

* Refactor self connected chain tests to single node test

* Refine N-ary constructs naming

* Update Rust to 1.59.0

* Place const generics parameters at the front of N-ary constructs

* Fix unordered test CI

* Fix conflict error

* Fix cargo doc

* Add some documentation

* Introduce ConnectionDelayOverride

* Simplify spawning of refresh client tasks

* Add some documentation

* Revert publish doc step to master even though it is still not working
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.

IBC integration test suite documentation does not build Support N-ary chains in integration test
3 participants