-
Notifications
You must be signed in to change notification settings - Fork 98
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
Segwit support. WASM P2P. Bug fixes. #1004
Conversation
* Add 'kmd_rewards' to UtxoCoin::tx_details_by_hash * TODO fill the 'kmd_rewards' filed in UtxoCoin::withdraw * Add 'kmd_rewards' to the UtxoCoin::withdraw result * Add the KMD rewards re-calculating on tx history * Add 'get_mut_verbose_transaction_from_map_or_rpc', 'calc_interest_of_tx' to 'UtxoCommonOps' * Add 'update_kmd_rewards' to 'UtxoStandardOps' * Return error on calc_interest_of_tx for coins that don't support transaction rewards * Pass 'HistoryUtxoTxMap' to 'tx_details_by_hash' * Replace Result<(), String> with UtxoRpcResult<()> * Fill and fix comments * Fix the broken 'test_process_cached_tx_transfer_map_updated' test * Fix rustfmt warnings * Add the 'claimed_by_me' field to 'kmd_rewards' details * Remove the confusing comment
# Conflicts: # mm2src/coins/utxo/utxo_tests.rs
…r-history hotfix for disable order history #968
* WIP. Support multiple amounts in SEND. Start adding docker tests. * WIP. Added methods to generate SLP send transaction. * WIP. Sent and spent HTLC from MM2. * WIP. Sent and refunded HTLC from MM2. Preparing for swap demo. * WIP. Implementing SwapOps for SlpToken. * WIP. Implementing traits for SlpToken. * WIP. Implementing traits for SlpToken. * Fix tests compilation. * WIP. Implemented dex fee validation for SlpToken. * Fix clippy. * Review fixes and errors refactoring. * Use utxo_common::DEFAULT_SWAP_VOUT in ZCoin too.
* Some helpers changes for notary helpers. * Explicitly require thread-pool feature for futures. * Re-export serde and serde-json from common. * Also re-export serde-derive. * Fix re-exports. * Add UtxoCoinFields::transaction_preimage.
* Segwit Withdraw Implementation * fix build issue in test * change seed in tests for an address with balance * first review fixes * segwit spending swaps * fix rustfmt warning * fix failing tests * review fixes and some refactoring * address_from_str refactor * review fixes * more review fixes * fix typo mistake * use coins address_from_str implementation
* Start gossipsub in WASM * Fix p2p wasm compile errors * Establish connection between native and wasm nodes * Update rustup toolchain from nightly-2020-10-25 to nightly-2021-02-17 * Update libp2p to 0.38.0 * Update tokio from 0.2 to 1.7 * Update hyper from 0.13 to 0.14 * Fix clippy warnings * Replace NotifyHandler::Any using with NotifyHandler::One * Add Gossipsub::notify_primary and other methods * Add rust-toolchain.toml * Remove the 'common' crate from dependencies of mm2_libp2p, gossipsub * Remove the specified wasm32-support branch of libp2p * Fix gossipsub::tests * notify any connection if there is no peer connections in Gossipsub::peer_connections * Fix clippy warnings * Fix panic on gossipsub cache timeout * Fix parse_relay_address: add the '/ws' postfix
@tonymorony @cipig Please test the following:
To activate the Segwit please use the most recent coins file and new
The default format is always legacy now. During the implementation, we assumed that the address format will be picked by users upon coin activation. If users want to switch to another format they can disable the coin and activate it back using a different option. If there is any problem with such a use case in existing GUIs UX please let me know, we can figure out possible workarounds. PS. Old nodes are not able to trade with new nodes using the Segwit address. We are figuring out how to deny swaps between them in MM2. |
* fix segwit display balance for native client * fix formating * add bech32_hrp check for segwit address format
KMD/LTC swap 725533a5-26bd-40f7-aa7a-a9c5758f0561 successfull, taker was non-segwit and maker was segwit |
cc @cipig this pr also fix all Firo hidden transaction |
https://github.com/cipig/atomicDEX-Desktop/actions/runs/1008681807 |
https://github.com/KomodoPlatform/atomicDEX-Desktop/actions/runs/1008994845 @tonymorony @smk762 to test on all platform |
@Milerius
works fine on CLI: |
validate address seems to not work with segwit address, not sure i can do anything ? |
i see:
|
Blocked temporary by this PR: #1009. Approximate resolve ETA: today or Monday next week 🙂 |
* segwit validateaddress * fix clippy warning * review and test fixes * fix convert to legacy address * add segwit to address_from_any_format * convertaddress fixes * move failing tests to docker tests * review fixes * move "QTUM" inside match statement * review fix
* WIP. Updating deps. * WIP. Fixing new clippy. * WIP. Fixing new clippy. * WIP. Checking error stack traces. * Remove some code. * WIP. Rollback toolchain to fix MmError stack trace collection. * Removed outdated libsecp256k1 versions from deps. Added more electrums for tBCH tests. * Replaced bigint with uint and term with crossterm. * Fix fmt. * Fix WASM. Enable resolver = "2". * Add deny.toml and cargo deny CI task. * Remove unneeded #![feature(try_trait_v2)].
Comparing versions
Loads and does simple swap. More intensive segwit related testing pending.
Same seed on both versions in CLI = same address
History and rewards value matching what is shown on komodod.com
Confirmed |
Passed on desktop ( https://github.com/KomodoPlatform/atomicDEX-Desktop/actions/runs/1119665975 ).
a) New GUI <-> Old seed works, passed (point 1 test actually)
Do have concerns in some cases, e.g. :
rewards amount is tx details from full KMD node: https://paste.ubuntu.com/p/Fz33qVZvRR/
it returns a ticker now
curl --url "http://127.0.0.1:7783" --data "{"method":"withdraw","coin":"LTC","to":"ltc1q5x0h4gj5mnks59ujp2cu9t8knzzp7elkrw5uhr","amount":"0.01","userpass":"$userpass"}"
|
Swaps: 16ae4923-22bf-4eb4-b1b0-6f6c7f3339c3.txt
|
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.
tested trough the checklist - lgtm
great news that such swap has not started! that's expected behavior (old mm will not able to validate segwit transaction that's why swap does not kick start to prevent funds loss) |
* Move best_orders logs to debug level. Update Hyper. Temporary comment getrandom. * Fix cyclic package dependency Co-authored-by: Sergey O. Boyko <sergey.boyko0791@gmail.com>
* fix pair trie to be same for old and new nodes * rename function to clone_without_protocol_info * old nodes to see segwit orders but can not match * Remove protocol_info from OrderbookItem/MakerOrder
In the last merged PR #1046 we decided to remove recently added fields from the Ordermatching protocol. It allowed us to fix orders disappearing from the Orderbook. What we have now:
Thanks @shamardy for the proposed solutions and for the fix. I think we can merge the |
* Make 'test_match_maker_order_and_taker_request' red * Don't match a taker order if the result base volume greater than max base volume * Check if the resulting base_amount doesn't violate min_base_vol * Extend test_match_maker_order_and_taker_request
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.
performed the following tests on the latest commit:
old client <-> updated seed: see full order books, traded fine
updated client <-> old seed: see full order books, traded fine
swaps:
new client with segwit enabled <-> new client with not enabled segwit (LTC/KMD swap), performed fine
new client with segwit enabled <-> old client (LTC/KMD swap), swap not matched as expected
also can confirm that only legacy addresses are visible in order books in all cases
best orders worked correctly for me on 5 pairs from 5 checked
all test session swaps statuses were broadcasted to seeds
at the moment checking with @sergeyboyko0791 tx_history rewards
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
More details TBA.