Skip to content

fix(tpu-v2): provide ethcoin support in tpu kickstart process#2300

Merged
shamardy merged 12 commits intofix-tpu-v2-wait-for-payment-spendfrom
fix-tpu-v2-wait-for-payment-spend-kickstart
Feb 8, 2025
Merged

fix(tpu-v2): provide ethcoin support in tpu kickstart process#2300
shamardy merged 12 commits intofix-tpu-v2-wait-for-payment-spendfrom
fix-tpu-v2-wait-for-payment-spend-kickstart

Conversation

@laruh
Copy link
Copy Markdown

@laruh laruh commented Dec 22, 2024

This pr provides EthCoin support in kickstart handler for taker and maker swaps

added test_v2_eth_eth_kickstart

@laruh laruh force-pushed the fix-tpu-v2-wait-for-payment-spend-kickstart branch from d08fa86 to df7778c Compare December 22, 2024 11:36
@mariocynicys mariocynicys self-assigned this Dec 23, 2024
@mariocynicys mariocynicys self-requested a review December 23, 2024 13:00
@mariocynicys mariocynicys removed their assignment Dec 23, 2024
Copy link
Copy Markdown

@borngraced borngraced left a comment

Choose a reason for hiding this comment

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

welldone, 3 minor notes

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.

Thanks
LGTM

Copy link
Copy Markdown

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

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

Please ping me once you are done with reviews @borngraced

Copy link
Copy Markdown

@borngraced borngraced 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!

@onur-ozkan
Copy link
Copy Markdown

@laruh
Copy link
Copy Markdown
Author

laruh commented Dec 24, 2024

Can you add test coverage for ETH ? Seems like we have one for UTXOs

https://github.com/KomodoPlatform/komodo-defi-framework/blob/ea5f3076084e568f528e6927f5aa9f6fb0b03435/mm2src/mm2_main/tests/docker_tests/swap_proto_v2_tests.rs#L722-L723

I can, but it will be on sepolia and use feature flag

@onur-ozkan
Copy link
Copy Markdown

I can, but it will be on sepolia and use feature flag

No problem I guess, better than nothing

@laruh laruh force-pushed the fix-tpu-v2-wait-for-payment-spend-kickstart branch from 6c332f2 to 1e10d83 Compare December 26, 2024 14:05
@laruh laruh force-pushed the fix-tpu-v2-wait-for-payment-spend-kickstart branch from 1e10d83 to d48cc25 Compare December 26, 2024 14:09
@laruh laruh requested a review from mariocynicys December 27, 2024 08:33
…d' into fix-tpu-v2-wait-for-payment-spend-kickstart
@laruh
Copy link
Copy Markdown
Author

laruh commented Dec 27, 2024

Added test_v2_eth_eth_kickstart test.
It uses Geth node, checks that taker and maker restarted their tpu eth-eth swap after stop (active swap uuid should be the same as before stop).

Copy link
Copy Markdown

@borngraced borngraced left a comment

Choose a reason for hiding this comment

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

re-approve

Comment on lines +2812 to +2819
let uuids = block_on(start_swaps(&mut mm_bob, &mut mm_alice, &[(ETH, ETH1)], 1.0, 1.0, 77.));
log!("{:?}", uuids);
let parsed_uuids: Vec<Uuid> = uuids.iter().map(|u| u.parse().unwrap()).collect();

for uuid in uuids.iter() {
log_swap_status_before_stop(&mm_bob, uuid, "Maker");
log_swap_status_before_stop(&mm_alice, uuid, "Taker");
}
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.

nit: uuids is just a single item in a vector. you might want to extract it.

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.

The loop handles unexpected cases where there might be more than one swap.
Logging all uuids (even if vec has one element) ensures we don’t miss anything if something goes wrong, making the test more reliable.

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.

The loop handles unexpected cases where there might be more than one swap.

tbh, i don't think this should be our way to approach things, this will leave us with a lot of dept.
and i don't think there should even be any unexpected cases in a test.

that's my opinion about the reasoning, but the thing is still a nit.

Comment on lines +2824 to +2826
// Restart Bob and Alice
bob_conf.conf["dbdir"] = mm_bob.folder.join("DB").to_str().unwrap().into();
bob_conf.conf["log"] = mm_bob.folder.join("mm2_dup.log").to_str().unwrap().into();
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.

nit: or you might just use MarketMakerIt::seednode_trade_v2

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.

Comment on lines +2832 to +2834
alice_conf.conf["dbdir"] = mm_alice.folder.join("DB").to_str().unwrap().into();
alice_conf.conf["log"] = mm_alice.folder.join("mm2_dup.log").to_str().unwrap().into();
alice_conf.conf["seednodes"] = vec![mm_bob.ip.to_string()].into();
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.

nit: or MarketMakerIt::light_node_trade_v2

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.

btw, why create a different mm2_dup.log? u could not call mm_dump if u want.

@laruh laruh added the priority: medium Moderately important tasks that should be completed but are not urgent. label Jan 15, 2025
@shamardy shamardy self-requested a review January 22, 2025 12:55
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.

Thanks for the PR, LGTM! I will not merge this until #2261 is approved first, but I remember this should be merged first.

@dimxy dimxy self-requested a review January 27, 2025 07:12
@shamardy
Copy link
Copy Markdown
Collaborator

shamardy commented Feb 3, 2025

Merge blocked by #2261

laruh added 2 commits February 6, 2025 17:45
…d' into fix-tpu-v2-wait-for-payment-spend-kickstart

# Conflicts:
#	mm2src/mm2_main/tests/docker_tests/eth_docker_tests.rs
…d' into fix-tpu-v2-wait-for-payment-spend-kickstart
@shamardy shamardy merged commit 91fea90 into fix-tpu-v2-wait-for-payment-spend Feb 8, 2025
@shamardy shamardy deleted the fix-tpu-v2-wait-for-payment-spend-kickstart branch February 8, 2025 12:06
shamardy pushed a commit that referenced this pull request Feb 8, 2025
)

This commit also provides EthCoin support in kickstart handler for taker and maker swaps #2300
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Moderately important tasks that should be completed but are not urgent.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants