Skip to content

chore(release): v2.4.0-beta#2345

Merged
shamardy merged 71 commits intomainfrom
dev
May 2, 2025
Merged

chore(release): v2.4.0-beta#2345
shamardy merged 71 commits intomainfrom
dev

Conversation

@shamardy
Copy link
Collaborator

@shamardy shamardy commented Feb 8, 2025

v2.4.0-beta - 2025-04-15

Features:

Experimental Namespace:

  • Introduced experimental namespace for APIs that may undergo breaking changes in future releases #2372

Event Streaming:

  • Refactored event-streaming system to support dynamic, API-driven subscription management #2172
  • Added support for additional event types including transaction history events, swap events, and more #2172

Cosmos Staking:

  • The following staking operations were added for Cosmos chains:
  • Additional RPC endpoints were added for:
    • Validator data queries #2310
    • Delegation status and ongoing undelegations #2377
  • Relocated staking RPCs under experimental::staking namespace with new method names #2372

Enhancements/Fixes:

Event Streaming:

  • UnknownClient error was moved to trace level #2401
  • Initial addresses registration in UTXO balance streaming was fixed to properly track address balances when streamer is enabled #2431

Peer-to-Peer Network:

  • Implemented network time synchronization validation to avoid swap failures due to node clock drift #2255 #2302, with additional testing coverage #2304
  • Removed static seed node IP addresses for improved reliability #2407
  • Improved error handling in best_orders RPC when no peers respond to orderbook requests #2318
  • Fixed peer-to-peer backward compatibility for swap negotiations by improving serialization of pubkey fields #2353

Trading Protocol Improvements:

  • Implemented zero DEX fees for v2 swaps (TPU) for KMD trading pairs #2323
  • Added swap protocol versioning with fallback support to legacy swaps #2324
  • Added pre-burn address outputs for collecting 25% of taker DEX fees:
    • UTXO swaps (both v1 and v2 protocols) #2112
    • Cosmos and ARRR swaps (legacy protocol only) #2112
  • Fixed payment spend and secret extraction logic in swaps v2 #2261
  • Removed unnecessary state during ETH funding validation in swaps v2 #2334
  • Allowed skipping unnecessary P2P message handling in ETH swaps v2 #2359
  • Improved swap robustness by checking for existing maker/taker payments before timeout validation #2283
  • Fixed memory leak issue in legacy swaps tracking (running_swap) #2301
  • Added is_success field to legacy swap status response, making success state more explicit #2371

Tendermint/Cosmos Improvements:

  • Improved transaction query reliability using standardized TxSearchRequest #2384
  • Added token transaction history support #2404
  • Fixed unhandled IBC and HTLC events #2385

Wallet Improvements:

  • Added an RPC to change mnemonic passwords #2317
  • Enabled storage and usage of non-BIP39 mnemonics #2312
  • Fixed hardware-wallet context initialization for UTXO withdrawals #2333
  • Added validation to restrict wallet names to alphanumeric characters, dash, and underscore #2400
  • Changed wallet file extension from .dat to .json to better reflect content #2400
  • Implemented optional password strength validation for mnemonic encryption #2400

FIRO Integration:

  • Added support for FIRO Spark verbose transaction details #2396

Pirate/ARRR Integration:

  • Dockerized Zombie/Pirate tests for improved test environment reliability #2374

Database and File System Improvements:

  • Improved database architecture with context functions and global DB usage has started in #2378, this is still under development under the new-db-arch compilation flag.
  • Fixed file filtering logic to exclude directories #2364

RPC Enhancements:

  • Implemented dynamic RPC port allocation (rpcport: 0) allowing automatic selection of available ports #2342

NFT integration #900:

  • Fixed update_nft to work correctly with HD wallets using the enabled address #2386
  • Fixed withdraw_nft method to work correctly in HD mode #2424

Simple Maker Bot #1065:

  • Added LiveCoinWatch price provider and removed deprecated Nomics provider #2416

UTXO Improvements:

  • Added support for parsing taproot output address types from blockchain.transaction.get verbose transactions #2423

Qtum Delegation:

  • Standardized parameter naming by using validator_address for QTUM delegation similar to Cosmos #2419

Security Fixes:

  • Fixed potential panics in hash processing by enforcing fixed-size arrays and proper length validation #2279
  • Improved security of key derivation by validating key material length #2356
  • Ensured consistent Argon2 parameters for wallet encryption/decryption #2360
  • Fixed path traversal vulnerability in wallet file handling #2400

Other Changes:

Code and Dependencies:

  • Added default implementations for protocol-specific SwapOps functions #2354
  • ETH address displaying now uses a generic trait #2348
  • Removed unnecessary Arc wrappers from Ethereum websocket implementation #2291
  • Updated dependencies:
    • Replaced deprecated instant dependency #2391
    • Completed migration to timed-map crate #2247 #2306 #2308
    • Bumped libp2p from k-0.52.11 to k-0.52.12 to fix iOS platform build issues #2326

Build and Testing Improvements:

  • Rewrote main build script for clarity/stability and to eliminate cache invalidation #2319
  • mm2_main error is now unified across native and wasm #2389
  • mm2_main in wasm now returns a js promise by making it async #2389
  • A lot of unstable tests were made more stable in #2365
  • Added additional Sepolia testnet nodes for improved test coverage #2358
  • Fixed failing Electrum protocol version test #2412
  • Updated Docker build configuration for WASM to fix dependency version issues #2294
  • Fixed WASM build by adding test-ext-api feature to required toml files #2295
  • Improved CI performance with proper Rust caching implementation #2303
  • Updated broken RPC link in Cosmos tests #2305
  • Unlocked wasm-pack version constraints in CI workflows and Docker builds #2307
  • Fixed mm2_p2p module development build to support individual module testing #2311
  • Added Cargo.lock validation to CI process to prevent lockfile inconsistencies #2309
  • Improved branch naming flexibility by allowing feature-specific patterns like feat/swapstatus-is-success #2371
  • Fixed formatting and linting job failures by correcting the syntax for rustup component installation #2390

NB - Backwards compatibility breaking changes:

  • Event streaming model changed from static configuration to API-driven subscription #2172

onur-ozkan and others added 26 commits December 23, 2024 15:06
* add time validation core logic

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

* nit fixes

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

* handle time gap

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

* improve logging

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

* add more trackable processing logs

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

* improve info log and remove debugging leftover

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

* rename `NetworkInfoRequest` to `PeerInfoRequest`

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

* handle recently dialed peers

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

* add useful logs

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

* create function for pre-dial check

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

* set max cap for timestamp channel

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

* remove leftover

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

* use `Multiaddr` as key

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

* fix p2p tests

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

* update logs

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

* rename leftovers

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

* update timing values

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

* minor fixes

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

* update pre dial check calls

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

* apply nit fixes

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

* don't update existing expiries

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

* revert breakage

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

---------

Signed-off-by: onur-ozkan <work@onurozkan.dev>
* handle p2p features properly

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

* use `PeerId` type for timestamp channel straight away

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

---------

Signed-off-by: onur-ozkan <work@onurozkan.dev>
* update wasm build for docker

* lock wasm-pack version on build runners

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

---------

Signed-off-by: onur-ozkan <work@onurozkan.dev>
Co-authored-by: onur-ozkan <work@onurozkan.dev>
…#2295)

* add feature flag to mm2_main and mm2_bin_lib tomls

* filter 'status:' pr labels

* remove old labels

* dont allow to pass blocked and invalid statuses

* pass in progress and pending review statuses

* update statuses list
* switch to proper rust caching

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

* fix linting

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

* rename cargo-cache to build-cache

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

* try caching

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

* switch to rust-cache

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

---------

Signed-off-by: onur-ozkan <work@onurozkan.dev>
* remove unnecessary Arc<

The inners are already `Arc<`ed

* eth websocket: avoid locking control message sender and clone it instead

* review(sami): move tx declaration close to where it's being used

* review(sami): free rx end out of the Arc

and arc the entire controller channel instead
Signed-off-by: onur-ozkan <work@onurozkan.dev>
Signed-off-by: onur-ozkan <work@onurozkan.dev>
* unlock wasm-pack version

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

* force yes on docker build

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

---------

Signed-off-by: onur-ozkan <work@onurozkan.dev>
* fix peer response error log (only if error)

* add test for peer time difference validation

* fix linux clippy

* Revert "fix linux clippy"

This reverts commit 2bfe34c.

* Revert "add test for peer time difference validation"

This reverts commit c8d1165.

* Revert "fix peer response error log (only if error)"

This reverts commit b6d6fbc.

* add docker test for peer time sync validation

* remove unneeded test println

* use Mm2TestConf::seednode

* review(borngraced): refactor get_utc_timestamp with test code

* use const in peer time sync test
* Validate Cargo.lock

* Revert "Validate Cargo.lock" and add validate-cargo-lock.yml

* review: run only `cargo update` and simplify yml
* save dev state

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

* save dev state

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

* make proto types serializable for RPC endpoint

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

* remove dummy test

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

* add RPC error type

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

* add TODO

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

* fix status filtering

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

* fix clippy warn

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

* resolve `todo!()`s

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

* remove inline attribute

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

* improve `validators_rpc`

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

* add coverage for tendermint_validators RPC

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

* apply nit changes

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

* document `ValidatorStatus`

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

* use proper error variant on coin filtering

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

* apply nits

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

---------

Signed-off-by: onur-ozkan <work@onurozkan.dev>
…ut (#2283)

This commit moves payment existence check in maker_payment/send_taker_payment before timeout validation and skips timeout if payment is already sent, as the taker swap should proceed to waiting for maker to spend the taker payment.
Fixes an issue where passphrases were incorrectly validated as BIP39 mnemonics during storage decryption. Now, passphrases no longer require bip39 validation.
This commit makes the build script straightforward and more stable without causing cache invalidation. The final versioning output remains as is, but the implementation side is robust than ever.
Bumps libp2p from k-0.52.11 to k-0.52.12 to fix build problems on IOS platform.
Adds tendermint protocol support on add_delegation RPC, and extends tendermint transaction history implementation to support delegation transactions.
We now enforce fixed-length byte arrays instead of indexing slices.  
This prevents unhandled panics when incoming slices are too short.

- Replaced slice indexing with safe fixed-size array creation.
- Removed methods that relied on unchecked slice indexing.
- Ensured each code path now handles invalid lengths gracefully.

Closes #2275
Refactor event streaming to support dynamic client subscriptions over RPC using a unified StreamingManager. The StreamingManager now orchestrates background streamers by initializing a streamer when a client activates it via the RPC API and shutting it down when no longer needed. Legacy fee estimator endpoints have been replaced with streaming RPC methods, and new task manager RPCs for BCH and Tendermint have been added. Additionally, event stream configuration has been migrated from static JSON settings to runtime API initialization for improved flexibility.
…2333)

This fixes `task::withdraw::init` for non-trezor utxo withdraws as it was failing with "error_data": "NoTrezorDeviceAvailable". It also allows the user to withdraw from any address in the HD wallet using `task::withdraw::init` instead of only the activated address.
Adds tendermint protocol support on remove_delegation RPC, and extends tendermint transaction history implementation to support undelegate transactions.
laruh and others added 3 commits February 8, 2025 16:04
)

This commit also provides EthCoin support in kickstart handler for taker and maker swaps #2300
This commit provides swap protocol versioning with a fallback to legacy swap protocol if any of the swap parties uses it.
onur-ozkan and others added 12 commits March 20, 2025 17:40
Adds a burn output sending 25% of the taker DEX fee to a dedicated pre-burn address. Funds collected on the pre-burn address will be traded for KMD to burn them (thus additionally burning KMD supply).
The first commit in a series of commits related to database architecture changes. Changes here won't have effect on builds since they are guarded with a new-db-arch feature flag.

This adds some utility methods in the context to get the global & wallet & address databases and data directories.

Also adds some concrete usages of the global db.
…ion (#2412)

Was fixed by faking the accepted server version to an unrealistic number then re-mocking it with 1.4 again to test failure and success cases.
Previously it was not possible to query history of Tendermint tokens. This commit makes that
possible. It also breaks the tx-history logic due to the new internal ID computation. But still users will not notice this change as it will be handled silently in the background.
DeckerSU
DeckerSU previously approved these changes Apr 14, 2025
Copy link

@DeckerSU DeckerSU left a comment

Choose a reason for hiding this comment

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

LGTM. The security review of #2345 is complete. All new and updated dependencies were checked, and no malicious code was found. However, the newly introduced KDF/MM2 logic wasn’t reviewed in full—only the new seed derivation, storage, encryption, and decryption procedures were examined, and they appear to be fine for now.

This commit fixes the inconsistency in how startup failures are handled between the native and WASM implementations of mm2_main. Additionally, mm2_main in wasm now return a Promise (async fn with Result<i8, JsValue>).
… file extension (#2400)

This commit adds validation in wallet_file_path to only allow alphanumeric characters, dash, and underscore in wallet names. Changes wallet file extension from .dat to .json to better reflect content and adds password policy to mnemonic passwords by default unless allow_weak_password is set to true.
v2.3.0-beta changelogs were missing, so they are added in this commit too.
shamardy and others added 6 commits April 17, 2025 18:39
Also removes Nomics as it was shutdown.
Now uses `validator_address` similar to Cosmos.
From `blockchain.transaction.get` verbose txs
…streaming (#2431)

We need to initially register the addresses we wanna get balance notification for. We used to do that in the past at coin enablement time (since event streaming config was static and doesn't change at runtime), that was removed since it doesn't make sense with runtime enabled/disabled streaming. But was never replaced with the appropriate logic to register these addresses once the streamer was enabled.

This commit registers our addresses with the event streamer on initialization so it could track them.
smk762
smk762 previously approved these changes May 1, 2025
Copy link

@smk762 smk762 left a comment

Choose a reason for hiding this comment

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

Testing complete, review feedback addressed, docs drafted.
Nice work on a big update!

Adds changelogs for latest commits that were not included in #2415
@shamardy shamardy merged commit c800ea0 into main May 2, 2025
26 checks passed
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.

9 participants