-
Notifications
You must be signed in to change notification settings - Fork 94
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
fix(legacy-swap): taker failed spend maker payment marked as failed #2199
Conversation
…d_taker_expected.json
…sts, iris_nimda_rick_taker_swap.json
Second problem solving approach If we wouldn't like to do changes in legacy taker swap events/logic and increase backward incompatibility risks, there is an alternative. We can add maker payment spend confirmation right after komodo-defi-framework/mm2src/mm2_main/src/lp_swap/taker_swap.rs Lines 1787 to 1812 in 5c47ef0
If confirmation failed, then also return swap finish command and MakerPaymentSpendFailed event return Ok((Some(TakerSwapCommand::Finish), vec![
TakerSwapEvent::MakerPaymentSpendFailed(ERRL!("{}", err.get_plain_text_format()).into()),
]));
In comparison, Maker has taker payment spend confirmation events in komodo-defi-framework/mm2src/mm2_main/src/lp_swap/maker_swap.rs Lines 1646 to 1648 in 5c47ef0
|
Solved with second approach in this pr #2206 UPD: opened again as we decided to test both approaches #2206 (comment)
This pr approach could be preferable |
…d::ConfirmMakerPaymentSpend)
…d => Ok(command),
…and_add_event(ctx, swap, saved).await in taker restart
…pCommand::Finish),
…TS in for_tests.rs
@laruh this is still draft, should I review it? I want to check it so that I can close the other PR if there are no problems with the approach here. |
Its almost r2r, I just wanted to fix these notes #2206 (review) in other approach and cherry pick commit to this branch, as both branches would have the same review notes. (already fixed this b2446b9, just confirmation number is left) |
4462a41
to
0073fe8
Compare
… in is_recoverable function
cd75bd0
to
aed8d4c
Compare
d2fd10f
to
5ce137f
Compare
…nfirm_taker_payment_spend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…Swap and MakerSavedSwap" This reverts commit 5ce137f.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but for one nit!
Please open docs issue and add To Test comment to the PR opening comment.
|
* dev: fix(orders): fix cancel order race condition using time-based cache (#2232) fix(legacy-swap): taker failed spend maker payment marked as failed (#2199) chore(adex-cli): deprecate adex-cli (#2234) feat(new-RPC): connection healthcheck implementation for peers (#2194) fix(proxy-signature): add message lifetime overflows (#2233) feat(CI): handle remote files in a safer way (#2217) chore(doc): update issue address in README (#2227) fix(merge): remove duplicated db_root function (#2229) feat(wallets): add `get_wallet_names` rpc (#2202) chore(tests): don't use `.wait()` and use `block_on` instead (#2220) fix(native-rpc): remove escaped response body (#2219) fix(clippy): fix coins mod clippy warnings in wasm (#2224) feat(core): handling CTRL-C signal with graceful shutdown (#2213) docs(README): fix typos (#2212) remove the non-sense arguments (#2216) fix(db): stop creating the all-zeroes dir on KDF start (#2218)
* dev: fix(orders): fix cancel order race condition using time-based cache (#2232) fix(legacy-swap): taker failed spend maker payment marked as failed (#2199) chore(adex-cli): deprecate adex-cli (#2234) feat(new-RPC): connection healthcheck implementation for peers (#2194) fix(proxy-signature): add message lifetime overflows (#2233) feat(CI): handle remote files in a safer way (#2217) chore(doc): update issue address in README (#2227) fix(merge): remove duplicated db_root function (#2229) feat(wallets): add `get_wallet_names` rpc (#2202) chore(tests): don't use `.wait()` and use `block_on` instead (#2220) fix(native-rpc): remove escaped response body (#2219) fix(clippy): fix coins mod clippy warnings in wasm (#2224) feat(core): handling CTRL-C signal with graceful shutdown (#2213) docs(README): fix typos (#2212) remove the non-sense arguments (#2216) fix(db): stop creating the all-zeroes dir on KDF start (#2218)
* dev: fix(cosmos): fix tx broadcasting error (#2238) chore(solana): remove solana implementation (#2239) chore(cli): remove leftover subcommands from help message (#2235) fix(orders): fix cancel order race condition using time-based cache (#2232) fix(legacy-swap): taker failed spend maker payment marked as failed (#2199) chore(adex-cli): deprecate adex-cli (#2234) feat(new-RPC): connection healthcheck implementation for peers (#2194) fix(proxy-signature): add message lifetime overflows (#2233) feat(CI): handle remote files in a safer way (#2217) chore(doc): update issue address in README (#2227) fix(merge): remove duplicated db_root function (#2229) feat(wallets): add `get_wallet_names` rpc (#2202) chore(tests): don't use `.wait()` and use `block_on` instead (#2220) fix(native-rpc): remove escaped response body (#2219) fix(clippy): fix coins mod clippy warnings in wasm (#2224) feat(core): handling CTRL-C signal with graceful shutdown (#2213) docs(README): fix typos (#2212) remove the non-sense arguments (#2216) fix(db): stop creating the all-zeroes dir on KDF start (#2218)
related to #2175 (comment)
To fix issue where taker doesnt wait for maker payment spend tx was confirmed we added two new events:
"MakerPaymentSpendConfirmed"
: successful event, which goes after"MakerPaymentSpent"
Note:
MakerPaymentSpent
event means that broadcasted txtaker spends maker payment
wasnt reverted"MakerPaymentSpendConfirmFailed"
: error event, means thattaker spend maker payment
transaction confirmation was failed.