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

Add Local-Ic Relayer Edge Case Tests for Remote Chain Splitter #319

Merged
merged 2 commits into from
Aug 13, 2024

Conversation

dowlandaiello
Copy link
Contributor

Closes #235 . This PR implements relayer edge case tests in local-interchain for the remote chain splitter. These tests include:

  • Happy path test: ensure the remote chain splitter creates an ICA when the relayer is up
  • Timeout handling test: ensure the remote chain splitter does not advance when the relayer is down (causing a packet timeout)
  • Recovery test: ensure the remote chain splitter can continue after a timed out packet to create the ICA when the relayer is restored

Failing Tests

Some local-ic tests are not currently working (namely the two party osmo pol test). However, all of the remote chain splitter tests are working. Fixing the two party osmo pol test is not within the scope of this PR, so I did not fix them.

Overview on Changes / Additions

  • local-interchaintest/Cargo.toml - Added the remote chain splitter as a dependency to local-ic so that it can be tested
  • Cargo.lock - See above about Cargo.toml
  • local-interchaintest/src/main.rs - Added the remote chain splitter tests as tests run by local-ictest-e2e
  • local-interchaintest/src/tests/mod.rs, local-interchaintest/src/tests/remote_chain_splitter/mod.rs - Self explanatory
  • local-interchaintest/src/tests/remote_chain_splitter/remote_chain_splitter.rs - See above on the 3 tests I added. Of note: two functions in this file, start_relayer and stop_relayer may be useful in other local-ic relayer tests, so moving them to a utils file could be prudent to prevent test dependencies across tests.

Macro Usage

There is a very short macro in remote_chain_splitter.rs. I can remove it if necessary. The macro just consolidates some redundant timeout checking logic in a way that allows breaking from the timeout check on successful ICA creation, which would be slightly more convoluted with a function. IMO, it's short and relatively useful, but not necessary, so it can be removed if desired.

Copy link
Contributor

@keyleu keyleu left a comment

Choose a reason for hiding this comment

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

LGTM

@dowlandaiello dowlandaiello merged commit 815bda1 into main Aug 13, 2024
5 checks passed
@dowlandaiello dowlandaiello deleted the dowlandaiello/testing-remotechainsplitter-merged branch August 13, 2024 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remote-chain splitter local interchaintest
3 participants