feat(trading-proto-upgrade): wasm DB, kickstart, refund states, v2 RPCs#2015
feat(trading-proto-upgrade): wasm DB, kickstart, refund states, v2 RPCs#2015
Conversation
…ration-4 # Conflicts: # mm2src/mm2_main/src/lp_swap/swap_wasm_db.rs
|
@shamardy I've fixed your review notes 🙂 |
shamardy
left a comment
There was a problem hiding this comment.
Thank you for the fixes! Next review Iteration!
| loop { | ||
| match state_machine | ||
| .maker_coin | ||
| .can_refund_htlc(state_machine.maker_payment_locktime()) |
There was a problem hiding this comment.
I think we should add the case of immediate refund using the taker refund secret here. I am sure you have this on your rader and plan to implement it in next sprints but this is just a reminder :)
Also, recover_funds_of_swap for swaps v2 is probably needed.
There was a problem hiding this comment.
Yeah, I have this on radar, will do in the next iteration 🙂
| pub(super) fn init_additional_context_impl(ctx: &MmArc, swap_info: ActiveSwapV2Info) { | ||
| subscribe_to_topic(ctx, swap_v2_topic(&swap_info.uuid)); | ||
| let swap_ctx = SwapsContext::from_ctx(ctx).expect("SwapsContext::from_ctx should not fail"); | ||
| swap_ctx.init_msg_v2_store(swap_info.uuid, bits256::default()); |
There was a problem hiding this comment.
I am just wondering why was accept_only_from needed in legacy swap implementation?
There was a problem hiding this comment.
This part is not finished yet: we should limit processing of the swap messages only to the node, with which we matched our order.
| maker_coin_swap_contract: None, | ||
| taker_coin_swap_contract: None, |
There was a problem hiding this comment.
These are None here but retrieved in the mirror implementation for taker swap similar to p2p_keypair.
There was a problem hiding this comment.
These are placeholders for the ETH/ERC-20 support in upgraded swaps.
|
@borngraced did you finish review for this PR? |
| .reverse() | ||
| .open_cursor("migration") | ||
| .await? | ||
| // TODO refactor when "closure invoked recursively or after being dropped" is fixed |
There was a problem hiding this comment.
we started working on this already.
#2019
|
@artemii235 I will merge this PR to dev once |
| pub(super) async fn get_current_migration( | ||
| migration_table: &DbTable<'_, SwapsMigrationTable>, | ||
| ) -> MmResult<u32, SavedSwapError> { | ||
| let migrations = migration_table | ||
| .cursor_builder() | ||
| .bound("migration", 0, u32::MAX) | ||
| .reverse() | ||
| .open_cursor("migration") | ||
| .await? | ||
| // TODO refactor when "closure invoked recursively or after being dropped" is fixed | ||
| .collect() | ||
| .await?; | ||
|
|
||
| Ok(migrations.first().map(|(_, m)| m.migration).unwrap_or_default()) |
There was a problem hiding this comment.
I have a fix for for this issue now..So I think this pr can be hold till #2028 is merged then you can query first directly instead of collecting all.
…ration-4 # Conflicts: # mm2src/mm2_main/src/lp_native_dex.rs
* dev: (22 commits) chore(config): remove vscode launchjson (GLEECBTC#2040) feat(trading-proto-upgrade): wasm DB, kickstart, refund states, v2 RPCs (GLEECBTC#2015) feat(UTXO): balance event streaming for Electrum clients (GLEECBTC#2013) feat(tx): add new sign_raw_transaction rpc for UTXO and EVM coins (GLEECBTC#1930) fix(p2p): handle encode_and_sign errors (GLEECBTC#2038) chore(release): add changelog entries for v2.0.0-beta (GLEECBTC#2037) chore(network): write network information to stdout (GLEECBTC#2034) fix(price_endpoints): add cached url (GLEECBTC#2032) deps(network): sync with upstream yamux (GLEECBTC#2030) fix(config): accept a string as rpcport value (GLEECBTC#2026) feat(nft): move db lock, add tx fee and confirmations (GLEECBTC#1989) chore(network): update seednodes for netid 8762 (GLEECBTC#2024) chore(network): add todo on peer storage behaviour (GLEECBTC#2025) chore(network): exclude `168.119.236.249` from the seednode list (GLEECBTC#2021) feat(network): deprecate 7777 network (GLEECBTC#2020) chore(release): bump mm2 version to 2.0.0-beta (GLEECBTC#2018) feat(UTXO swaps): kmd burn plan impl (GLEECBTC#2006) chore(docs): fix the link to simple market maker in README.md (GLEECBTC#2011) refactor(cli): cli dependency updates and warn on bad config perm (GLEECBTC#1956) chore(containers and docs): update docs and container images (GLEECBTC#2003) ... # Conflicts: # mm2src/mm2_main/tests/mm2_tests/mm2_tests_inner.rs # mm2src/mm2_test_helpers/src/for_tests.rs
* dev: (24 commits) chore(release): bump mm2 version to 2.1.0-beta (GLEECBTC#2044) feat(trezor): add segwit support for withdraw with trezor (GLEECBTC#1984) chore(config): remove vscode launchjson (GLEECBTC#2040) feat(trading-proto-upgrade): wasm DB, kickstart, refund states, v2 RPCs (GLEECBTC#2015) feat(UTXO): balance event streaming for Electrum clients (GLEECBTC#2013) feat(tx): add new sign_raw_transaction rpc for UTXO and EVM coins (GLEECBTC#1930) fix(p2p): handle encode_and_sign errors (GLEECBTC#2038) chore(release): add changelog entries for v2.0.0-beta (GLEECBTC#2037) chore(network): write network information to stdout (GLEECBTC#2034) fix(price_endpoints): add cached url (GLEECBTC#2032) deps(network): sync with upstream yamux (GLEECBTC#2030) fix(config): accept a string as rpcport value (GLEECBTC#2026) feat(nft): move db lock, add tx fee and confirmations (GLEECBTC#1989) chore(network): update seednodes for netid 8762 (GLEECBTC#2024) chore(network): add todo on peer storage behaviour (GLEECBTC#2025) chore(network): exclude `168.119.236.249` from the seednode list (GLEECBTC#2021) feat(network): deprecate 7777 network (GLEECBTC#2020) chore(release): bump mm2 version to 2.0.0-beta (GLEECBTC#2018) feat(UTXO swaps): kmd burn plan impl (GLEECBTC#2006) chore(docs): fix the link to simple market maker in README.md (GLEECBTC#2011) ...
* evm-hd-wallet: (27 commits) Fix todo comments Fix HDAddressOps::Address trait bounds fix(indexeddb): fix IDB cursor.continue_() call after drop (GLEECBTC#2028) security bump for `h2` (GLEECBTC#2062) fix(makerbot): allow more than one prices url in makerbot (GLEECBTC#2027) fix(wasm worker env): refactor direct usage of `window` (GLEECBTC#1953) feat(nft): nft abi in withdraw_nft RPC, clear_nft_db RPC (GLEECBTC#2039) refactor(utxo): refactor utxo output script creation (GLEECBTC#1960) feat(ETH): balance event streaming for ETH (GLEECBTC#2041) chore(release): bump mm2 version to 2.1.0-beta (GLEECBTC#2044) feat(trezor): add segwit support for withdraw with trezor (GLEECBTC#1984) chore(config): remove vscode launchjson (GLEECBTC#2040) feat(trading-proto-upgrade): wasm DB, kickstart, refund states, v2 RPCs (GLEECBTC#2015) feat(UTXO): balance event streaming for Electrum clients (GLEECBTC#2013) feat(tx): add new sign_raw_transaction rpc for UTXO and EVM coins (GLEECBTC#1930) fix(p2p): handle encode_and_sign errors (GLEECBTC#2038) chore(release): add changelog entries for v2.0.0-beta (GLEECBTC#2037) chore(network): write network information to stdout (GLEECBTC#2034) fix(price_endpoints): add cached url (GLEECBTC#2032) deps(network): sync with upstream yamux (GLEECBTC#2030) ...
#1895
What's done:
Important notes:
Test plan:
Prerequisites for all test cases:
setpriceandbuy/sellcalls.RPC
Kickstart
coins_needed_for_kick_startmust return tickers used in swap.Coin deactivation prevention
Old swaps data migration