Skip to content

test(tendermint): migrate to local/offline containerized testnets#2128

Merged
shamardy merged 43 commits intodevfrom
offline-tendermint-testnets
Jul 5, 2024
Merged

test(tendermint): migrate to local/offline containerized testnets#2128
shamardy merged 43 commits intodevfrom
offline-tendermint-testnets

Conversation

@onur-ozkan
Copy link
Copy Markdown

@onur-ozkan onur-ozkan commented May 28, 2024

This PR refactors the tendermint integration tests as follows:

  • Run a local ATOM testnet network inside a container and use it in the integration tests.
  • Run a local NUCLEUS testnet network inside a container and use it in the integration tests.
  • Run a local IBC relayer node inside a container connected to both the ATOM and NUCLEUS local testnets, and use it in the integration tests.
  • Add test coverage for Tendermint - ETH swap.

The files inside the .docker/container-state directory ensure that the testnet networks start with a fixed state for consistent test results.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the offline-tendermint-testnets branch from 6a8acb7 to 335589f Compare May 29, 2024 14:25
onur-ozkan added 11 commits May 29, 2024 18:16
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the offline-tendermint-testnets branch from 56784a2 to a19237b Compare June 6, 2024 05:53
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the offline-tendermint-testnets branch from ae6878a to af75d4e Compare June 6, 2024 14:51
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the offline-tendermint-testnets branch from 52462a1 to e6229f3 Compare June 10, 2024 17:32
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the offline-tendermint-testnets branch 4 times, most recently from 4fffa84 to 6696109 Compare June 12, 2024 06:35
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Copy link
Copy Markdown
Collaborator

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

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

Awesome! 🎉

First review iter.

0.008,
));
lazy_static! {
// Simple lock used for running the swap tests sequentially.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

but why tho?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

They use same account seed; the same tendermint account tries to swap from multiple instances. Normally, we have this https://github.com/KomodoPlatform/komodo-defi-framework/blob/b0fd99e8406e67ea06435dd028991caa5f522b5c/mm2src/coins/tendermint/tendermint_coin.rs#L891-L919 function which ensures we end up with the correct sequence id so the swap doesn't fail because of sequence mismatch errors, but somehow that didn't help (the node was keep giving the same sequence id instead of the new one, this is either docker testnet specific problem or it's cached for too long from the nucleus node).

Signed-off-by: onur-ozkan <work@onurozkan.dev>
shamardy
shamardy previously approved these changes Jul 2, 2024
Copy link
Copy Markdown
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Great Work 🔥 ! Only one non-blocker comment.

btw, test_tendermint_ibc_withdraw and test_tendermint_ibc_withdraw_hd failed in the latest run so they seem a bit unstable, do you think this is acceptable @onur-ozkan?

@onur-ozkan
Copy link
Copy Markdown
Author

btw, test_tendermint_ibc_withdraw and test_tendermint_ibc_withdraw_hd failed in the latest run so they seem a bit unstable, do you think this is acceptable @onur-ozkan?

It seems like IBC relayer wasn't ready for connections when those tests were invoked. I will try to handle that properly. Thanks!

Signed-off-by: onur-ozkan <work@onurozkan.dev>
@onur-ozkan onur-ozkan force-pushed the offline-tendermint-testnets branch from 476c5aa to 6fd189e Compare July 3, 2024 14:35
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
@shamardy
Copy link
Copy Markdown
Collaborator

shamardy commented Jul 5, 2024

@mariocynicys @dimxy please check if your comments are resolved and if you have any more comments / review iterations.

Copy link
Copy Markdown
Collaborator

@mariocynicys mariocynicys left a comment

Choose a reason for hiding this comment

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

please check if your comments are resolved and if you have any more comments / review iterations.

Nope, LGTM

Copy link
Copy Markdown
Collaborator

@dimxy dimxy left a comment

Choose a reason for hiding this comment

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

LGTM

@shamardy shamardy merged commit 8e312a1 into dev Jul 5, 2024
@shamardy shamardy deleted the offline-tendermint-testnets branch July 5, 2024 15:40
dimxy pushed a commit that referenced this pull request Jul 21, 2024
* dev:
  feat(nft-swap): add standalone maker contract and proxy support (#2100)
  feat(ETH): add `gas_limit` coins param to override default values (#2137)
  feat(tendermint): implement better sequence resolving logic (#2164)
  ci(artifact): add target for macos on apple silicon (#2163)
  fix(helpers): extend http to ws address conversion (#2166)
  fix(makerbot): add "testcoin" to provider options (#2161)
  fix(hd_wallet): make extended pubkey of hd wallet generic (#2159)
  fix(docker-tests): implement containers runtime directories (#2162)
  feat(tendermint): improve the `max` handling for tendermint withdraw (#2155)
  revert #2158 (comment) (#2160)
  ci(artifacts): upload build artifacts with in-tree script (#2158)
  test(tendermint): migrate to local/offline containerized testnets (#2128)
  use easingthemes/ssh-deploy@v5.0.3 for all builds except windows (#2157)
  chore(bin): rename mm2 binaries to kdf (#2126)
dimxy pushed a commit to dimxy/komodo-defi-framework that referenced this pull request Aug 12, 2024
* dev: (22 commits)
  chore(release): bump mm2 version to 2.2.0-beta (GLEECBTC#2188)
  ci(docker-tests): ignore tendermint IBC tests for now (GLEECBTC#2185)
  feat(nft-swap): complete refund methods (GLEECBTC#2129)
  chore(release): add changelog entries for v2.1.0-beta (GLEECBTC#2165)
  fix(zcoin): don't force low r signing to generate htlc pubkey for zcoin (GLEECBTC#2184)
  chore(rust-analyzer): add rust-analyzer into the workspace toolchain (GLEECBTC#2179)
  chore: migrate .cargo/config to .cargo/config.toml to avoid deprecation warning (GLEECBTC#2177)
  fix(swaps): ensure taker payment spend confirmations (GLEECBTC#2176)
  feat(nft-swap): add standalone maker contract and proxy support (GLEECBTC#2100)
  feat(ETH): add `gas_limit` coins param to override default values (GLEECBTC#2137)
  feat(tendermint): implement better sequence resolving logic (GLEECBTC#2164)
  ci(artifact): add target for macos on apple silicon (GLEECBTC#2163)
  fix(helpers): extend http to ws address conversion (GLEECBTC#2166)
  fix(makerbot): add "testcoin" to provider options (GLEECBTC#2161)
  fix(hd_wallet): make extended pubkey of hd wallet generic (GLEECBTC#2159)
  fix(docker-tests): implement containers runtime directories (GLEECBTC#2162)
  feat(tendermint): improve the `max` handling for tendermint withdraw (GLEECBTC#2155)
  revert GLEECBTC#2158 (comment) (GLEECBTC#2160)
  ci(artifacts): upload build artifacts with in-tree script (GLEECBTC#2158)
  test(tendermint): migrate to local/offline containerized testnets (GLEECBTC#2128)
  ...
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.

4 participants