Skip to content
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

chore(release): v2.1.0-beta #2043

Open
wants to merge 58 commits into
base: main
Choose a base branch
from
Open

chore(release): v2.1.0-beta #2043

wants to merge 58 commits into from

Conversation

shamardy
Copy link
Collaborator

changelog to be added ...

dimxy and others added 4 commits December 19, 2023 22:02
This commit implements balance events for UTXOs and fixes an electrum notification receiving bug.
…Cs (#2015)

This commit does the following:
- Implements WASM storage for upgraded swaps.
- Implements old swaps data migration.
- Swaps kickstart on MM2 reload.
- Swaps file lock, preventing the same swap from starting from different processes.
- my_swap_status, my_recent_swaps V2 RPCs.
- V1 RPCs can also return upgraded swaps data.
- Adds BoolAsInt struct because boolean can be used as IndexedDb indexes.
- Implements refund states for both swap types.

*Important note:
- Seednodes should be updated to support/rebroadcast new swap protocol messages.
@shamardy shamardy added the in progress Changes will be made from the author label Dec 21, 2023
dimxy and others added 14 commits December 21, 2023 17:03
This commit adds support for witness inputs and outputs for withdraw tx to sign it with trezor device. It also adds a test tool to sign withdraw tx with witness inputs/outputs with trezor and emulator.
This commit implements balance events for ETH plus error events.
This commit does the following:
* Adds address builder pattern
* Adds `script_type` field to Address structure
* Refactors output script creation
* Replaces use of u8 addr prefixes to a strict type `NetworkAddressPrefixes`
This commit does the following:
* It introduces two new functions, erc1155_balance and erc721_owner, to the EthCoin structure. These enhancements streamline the NFT withdrawal process in the withdraw_nft RPC by directly interacting with smart contracts for validation, eliminating the need to access database information.
* It adds a new clear_nft_db RPC for NFT data management. This new method allows users to selectively clear NFT data for specified blockchain networks, or to completely wipe it across all supported chains.
This commit adds the ability to detect the current execution environment (window or worker) and follows the appropriate way of getting `web_sys::IdbFactory` instance depending on it.
Signed-off-by: onur-ozkan <work@onurozkan.dev>
…2046)

What's done:
- Locked amount handling for UTXO swaps (more work will be needed for ETH/ERC20)
- Implemented conditional wait for maker payment confirmation before signing funding tx spend preimage on taker's side.
- active_swaps V2 RPC
- Handling accept_only_from for swap messages (validation of the sender)
- Added swap_uuid for swap v2 messages to avoid reusage of the messages generated for other swaps
- Implemented maker payment immediate refund path handling
- Implemented KMD dex fee burn for upgraded swaps
- Added dockerized Geth node for ETH-related integration tests (more to be done in the next sprints)
- Fixed ETH watcher tests

Updated deps:
- test-containers (other Cargo.lock updates are triggered by it). The purpose is to rely on the official version instead of using the fork. The fork also didn't allow passing additional arguments to the image (only `docker run` options were available).
@shamardy shamardy added under review and removed in progress Changes will be made from the author labels Feb 23, 2024
@shamardy shamardy marked this pull request as ready for review February 23, 2024 16:47
@cipig
Copy link
Member

cipig commented Feb 23, 2024

What effects does the DB changes have? If seed nodes don't save JSON files of swaps any more, then i can't use this on my seeds, else i will destroy all stats.
What about the "normal" maker nodes? will updating those will have an effect on swap JSON files on the seeds?

Other question: is there a way to tell mm2 to continue saving swap infos in files, like with a startup param?
That would help a lot, since i have other workflows that require the presence of those files, eg failed swap recovering.

@shamardy
Copy link
Collaborator Author

What effects does the DB changes have? If seed nodes don't save JSON files of swaps any more, then i can't use this on my seeds, else i will destroy all stats.
What about the "normal" maker nodes? will updating those will have an effect on swap JSON files on the seeds?

JSON files are not used for v2 swaps only which to be activated currently "use_trading_proto_v2": true has to be added to MM2.conf

Other question: is there a way to tell mm2 to continue saving swap infos in files, like with a startup param?
That would help a lot, since i have other workflows that require the presence of those files, eg failed swap recovering.

We can look into that for v2 swaps before activating it or you can use my_swap_status to get the data and save it in files yourself (adding another workflow).

@cipig
Copy link
Member

cipig commented Feb 23, 2024

so for v1 swaps, nothing changes? the files will still be there on makers and seeds?

i use the files on the seeds to add the swaps to MySQL which feeds different things

and on the makers i need them to refund... i need to call this manually from time to time

## maker
for i in `grep -l '"type":"MakerPaymentRefundFailed"' DB/*/SWAPS/MY/* | cut -d "/" -f 5 | cut -d "." -f 1`; do echo $i && curl -s --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"recover_funds_of_swap\",\"params\":{\"uuid\":\"$i\"}}" | json_pp; done
for i in `grep -l '"type":"TakerPaymentSpendFailed"' DB/*/SWAPS/MY/* | cut -d "/" -f 5 | cut -d "." -f 1`; do echo $i && curl -s --url "http://127.0.0.1:7783" --data "{\"userpass\":\"$userpass\",\"method\":\"recover_funds_of_swap\",\"params\":{\"uuid\":\"$i\"}}" | json_pp; done

it looks in all files for "MakerPaymentRefundFailed" and "TakerPaymentSpendFailed" and calls recover_funds_of_swap with the uuid. this is needed because the automatic refund sometimes fails with "non-final" error, so only a manual call will refund those swaps

btw, what will we do with the users whose swap files need to be manually edited before refund? will it be possible to edit the stuff in the DB?

This commit implements the following:
- ETH websocket transport.
   - komodo-defi-proxy signed messages.
   - expirable hashmap, so that request contexts can be cleaned after timeout.
- Refactor web3 contexts, connection rotation and remove singular `web3` field from ETH coin.
- Heartbeats implementation for streaming channels.
- Refactored node rotation (moved from transport to protocol level, so it can be rotated across different transports)
- RPC abstraction for ETH
laruh and others added 7 commits April 9, 2024 16:06
This commit implements the NFT maker payment sending, validating, spending and refunding. This process is tested using the dockerized geth dev node.
…#2095)

This makes `aes` version in mm2 `v0.8.3` except for `rust-libp2p` `aes` dep
This commit fixes failing tests, updates tendermint deps. In addition to this, it updates some other deps and fixes a few minor issues.
* add nucleus htlc definitions

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* save dev state

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* try to unify iris and nucleus htlc definitions

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* abstract nucleus and iris htlc types

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* implement `HtlcType` for multi-support cosmos HTLCs

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* implement various inner abstraction functions

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* complete abstraction over iris & nucleus htlcs

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* create `htlc::get_htlc_abci_query_path`

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* update tendermint swap tests

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* replace rick with doc

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* make test_htlc_create_and_claim work by fixing pair2 address

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* add ibc swap tests

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* fix WASM test

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* use iris for tendermint unit tests

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* fix ABCI paths

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* document tendermint HTLC implementation

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* use rick in best orders test

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* replace doc confs with rick

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* revert mm2_tests_inner.rs

Signed-off-by: onur-ozkan <work@onurozkan.dev>

---------

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit eliminates the dependency on ETH_DEV_NODE from all tests and utilizes the Sepolia network in some tests instead. It also removes the test_send wasm test, which would require periodic funding if retained. Lastly, it fixes some issues in mac CI.
…2099)

This commit fixes `BCH` block header deserialization by making it the same as `BTC`
ca333
ca333 previously approved these changes Apr 25, 2024
Copy link

@ca333 ca333 left a comment

Choose a reason for hiding this comment

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

secure code reviewed @ d36f43d

will proceed with additional contributions / diff timely

This commit does the following:
- Adds skeleton Sia integration to demonstrate the code organization.
- Mocks the minimal amount of functionality to support enabling a "sia protocol" coin
- Implements PoC of HTTP(s) interface between mm2 and Sia's walletd node software
- Implements 2 walletd endpoints, GET `api/consensus/tip` and GET `api/addresses/<address>/balance`
- Adds conditional compilation for all sia features
shamardy and others added 20 commits April 25, 2024 20:52
- Full UTXO HD wallet functionalities are implemented. UTXO HD wallet now uses the same APIs used for Trezor except for withdraw were `withdraw` is used for HD wallet and `task::withdraw` for Trezor.
 - `path_to_address` in activation now uses `HDAccountAddressId` struct, `StandardHDCoinAddress` was removed to reduce redundancies.
- `task::create_new_account` can now take an optional parameter `account_id` to specify the new account index instead of just incrementing the account index. If not specified, incrementing will be used as before.
- `WithdrawFrom` also uses `HDAccountAddressId` instead of `StandardHDCoinAddress`, a full derivation path can be also used to specify the address to withdraw from, this makes specifying the address more easy since the full derivation path is what is returned in the response of activation/`account_balance`/etc..
- HD wallet and trezor is implemented for EVM coins/tokens alongside new task manager activation methods.
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Consolidate all the runtime files together under $HOME/.kdf by default (so you don't have to set environment variables on the host). This should improve the user experience significantly as this is a standard practice followed by most of the programs on UNIX systems.
This commit improves memory usage a bit by doing preallocation when possible
This commit adds missed apply_event for events discovered while taker was offline, like the maker spent or watcher refunded the taker payment.
…ir (#2115)

`sign_and_send_transaction_with_keypair` now uses the address provided from the caller instead of having `my_address` inside it.
Testnet bitcoin currently has high fees which causes some tests to fail due to not enough balance. Since failing tests don't send actual tbtc, this commit sets a fixed fee to fix these tests.
This commit implements pubkey-only mode for the Tendermint protocol, which means we can use any external wallet for wallet and swap operations on Tendermint.

Additionally, ibc_withdraw RPC is removed and withdraw is refactored for Tendermint to support IBC transfers by automatically finding IBC channels whenever possible.
This avoids concurrent reading/writing by enabling .tmp file for swap and order files. This fix should not create a problem for two mm2 instances running on the same node as both would use different directories for their data, derived from different listening IP-addresses.
UTXO P2PK balance is shown as part of the P2PKH/Legacy address balance, it can be also spent in withdraws and swaps.
This commit does the following:
* Adds eth EIP1559 priority fee estimator
* Adds tx priority fee support for withdraw and swaps
* Improve gas limit for swap txns
Test test_taker_completes_swap_after_taker_payment_spent_while_offline sometimes fails, apparently due to too early taker stop, so it does not have time to send p2p message with taker payment data to the maker.
This fix improves the test log wait condition to ensure the p2p message is sent and only then taker stops.
Addresses bunch of potential database problems by improving the validation function.
Fixes a regression (check mm2_tests::tendermint_tests::test_tendermint_withdraw_hd test) which started with pubkey-only activation implementation.
* handle base64 encoded transaction values

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* add coverage for history parsing

Signed-off-by: onur-ozkan <work@onurozkan.dev>

* increase test coverage

Signed-off-by: onur-ozkan <work@onurozkan.dev>

---------

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit tries to get global with type safety and explicit type conversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet