Commit Graph

2874 Commits

Author SHA1 Message Date
dependabot[bot]
4d557d1ef9
build(deps): bump mockito from 1.3.0 to 1.4.0 (#1567)
* build(deps): bump mockito from 1.3.0 to 1.3.1

Bumps [mockito](https://github.com/lipanski/mockito) from 1.3.0 to 1.3.1.
- [Release notes](https://github.com/lipanski/mockito/releases)
- [Commits](https://github.com/lipanski/mockito/compare/1.3.0...1.3.1)

---
updated-dependencies:
- dependency-name: mockito
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: breaking change in mockito async

* bump mockito to 1.4

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Byron Hambly <byron@hambly.dev>
2024-06-19 15:35:05 +02:00
Byron Hambly
1d5df5498c
Merge pull request #1682 from comit-network/dependabot/cargo/serial_test-3.1.1
build(deps): bump serial_test from 3.0.0 to 3.1.1
2024-06-19 15:21:14 +02:00
Byron Hambly
787edbbca2
Merge pull request #1681 from comit-network/dependabot/cargo/url-2.5.2
build(deps): bump url from 2.5.0 to 2.5.2
2024-06-19 13:58:17 +02:00
dependabot[bot]
543f2748b5
build(deps): bump serial_test from 3.0.0 to 3.1.1
Bumps [serial_test](https://github.com/palfrey/serial_test) from 3.0.0 to 3.1.1.
- [Release notes](https://github.com/palfrey/serial_test/releases)
- [Commits](https://github.com/palfrey/serial_test/compare/v3.0.0...v3.1.1)

---
updated-dependencies:
- dependency-name: serial_test
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-19 11:35:30 +00:00
dependabot[bot]
7da996ab7b
build(deps): bump url from 2.5.0 to 2.5.2
Bumps [url](https://github.com/servo/rust-url) from 2.5.0 to 2.5.2.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.0...v2.5.2)

---
updated-dependencies:
- dependency-name: url
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-19 11:34:57 +00:00
Byron Hambly
ad212c8663
Merge pull request #1680 from comit-network/dependabot/cargo/reqwest-0.12.5
build(deps): bump reqwest from 0.12.4 to 0.12.5
2024-06-18 15:27:21 +02:00
dependabot[bot]
f4792174da
build(deps): bump reqwest from 0.12.4 to 0.12.5
Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.12.4 to 0.12.5.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.12.4...v0.12.5)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 11:45:28 +00:00
Byron Hambly
cbab8647fd
Merge pull request #1679 from comit-network/dependabot/github_actions/actions/checkout-4.1.7
build(deps): bump actions/checkout from 4.1.6 to 4.1.7
2024-06-13 18:01:00 +02:00
dependabot[bot]
122aee022a
build(deps): bump actions/checkout from 4.1.6 to 4.1.7
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.6 to 4.1.7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.6...v4.1.7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-13 11:53:20 +00:00
COMIT Botty McBotface
a3b1e772b2
Prepare release 0.13.1 (#1675) 2024-06-10 20:23:50 +02:00
Byron Hambly
90494ba4a5
fix: monero wallet refresh (#1596)
This PR changes the following behaviour in the refresh functionality of the monero wallet
- Allows for multiple retries because in some cases users have experienced an issue where the wallet rpc returns `no connection to daemon` even though the daemon is available. I'm not 100% sure why this happens but retrying often fixes the issue
- Print the current sync height after each failed attempt at syncing to see how far we've come
- The `monero-wallet-rpc` is started with the `--no-initial-sync` flag which ensures that as soon as it's started, it's ready to respond to requests
- The `monero-wallet-rpc` was upgraded to `v0.18.3.1` because this PR https://github.com/monero-project/monero/pull/8941 has improved some of the issues mentioned above


This PR is part of a larger effort to fix this issue https://github.com/comit-network/xmr-btc-swap/issues/1432
2024-06-10 18:53:52 +02:00
Byron Hambly
9594b0c46b
Merge pull request #1673 from comit-network/bob-extensive-quote-log
feat (Bob): Log extensive information about deposit requirements
2024-06-07 09:41:43 +02:00
Byron Hambly
72202b714e
Merge pull request #1663 from comit-network/dependabot/cargo/tokio-1.38.0
build(deps): bump tokio from 1.37.0 to 1.38.0
2024-06-07 09:32:01 +02:00
binarybaron
55b67d31d4 feat (Bob): Log extensive information about deposit requirements 2024-06-06 15:21:48 +02:00
dependabot[bot]
b99978879d
build(deps): bump tokio from 1.37.0 to 1.38.0
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.37.0 to 1.38.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.37.0...tokio-1.38.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-06 11:25:09 +00:00
chengehe
49a7f7eed6
chore: remove repeat word (#1671)
Signed-off-by: chengehe <hechenge@yeah.net>
2024-06-06 12:10:19 +02:00
Byron Hambly
2eb9e01f97
Merge pull request #1667 from comit-network/dependabot/cargo/toml-0.8.14
build(deps): bump toml from 0.8.13 to 0.8.14
2024-06-04 15:22:03 +02:00
dependabot[bot]
16d5ffc07e
build(deps): bump toml from 0.8.13 to 0.8.14
Bumps [toml](https://github.com/toml-rs/toml) from 0.8.13 to 0.8.14.
- [Commits](https://github.com/toml-rs/toml/compare/toml-v0.8.13...toml-v0.8.14)

---
updated-dependencies:
- dependency-name: toml
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-04 11:31:51 +00:00
pokkst
9635c0b551
fix (Bob): Check if Bitcoin redeem transaction was published before transitioning to CancelTimelockExpired (#1427)
* fix (Bob): Check if Bitcoin redeem transaction was published before transitioning to CancelTimelockExpired

---------

Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
Co-authored-by: Byron Hambly <bhambly@blockstream.com>
2024-06-04 12:49:15 +02:00
dependabot[bot]
1930540c1f
build(deps): bump reqwest from 0.11.27 to 0.12.4 (#1588)
* build(deps): bump reqwest from 0.11.27 to 0.12.0

Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.27 to 0.12.0.
- [Release notes](https://github.com/seanmonstar/reqwest/releases)
- [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.27...v0.12.0)

---
updated-dependencies:
- dependency-name: reqwest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* wip

* wip

* ci: lock sqlx-cli install

* bump reqwest to 0.12.2

* deps: reqwest to 0.12.4

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Byron Hambly <byron@hambly.dev>
2024-05-30 10:27:48 +02:00
COMIT Botty McBotface
2932abc9ec
Prepare release 0.13.0 (#1659) 2024-05-29 16:00:17 +02:00
binarybaron
41687ffab9
CI: Fix faulty x86-darwin release name (#1658) 2024-05-29 11:58:28 +02:00
Byron Hambly
6c487d4a5f
Merge pull request #1654 from comit-network/dependabot/cargo/serde-1.0.203
build(deps): bump serde from 1.0.202 to 1.0.203
2024-05-28 12:57:11 +02:00
Byron Hambly
21e6bbe681
Merge pull request #1656 from delta1/ci-binaries
ci: wip fixing binaries
2024-05-28 12:39:32 +02:00
Byron Hambly
e09401b9f7
ci: wip fixing build binaries actions 2024-05-28 12:37:55 +02:00
Byron Hambly
81d1f7e1bb
Merge pull request #1655 from delta1/ci-binaries
ci: wip fixing build binaries actions
2024-05-28 12:23:41 +02:00
Byron Hambly
66bc59892a
ci: wip fixing build binaries actions 2024-05-28 12:21:19 +02:00
dependabot[bot]
6399343de9
build(deps): bump serde from 1.0.202 to 1.0.203
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.202 to 1.0.203.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.202...v1.0.203)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-27 11:29:09 +00:00
Byron Hambly
7b9ca3b420
Merge pull request #1653 from delta1/deps-miniscript
deps: bump miniscript 9.0.0 to 9.0.2 to fix overflow issue
2024-05-27 13:04:17 +02:00
Byron Hambly
268a24083f
deps: bump miniscript 9.0.0 to 9.0.2 to fix overflow issue 2024-05-27 12:57:32 +02:00
Byron Hambly
1d4a536bb1
Merge pull request #1652 from delta1/ci-release-bins
ci: fix build-release-binaries
2024-05-27 12:20:23 +02:00
Byron Hambly
52d56ae254
ci: fix build-release-binaries 2024-05-27 12:19:26 +02:00
Byron Hambly
2ef2863e89
Merge pull request #1651 from delta1/ci-release-bins
ci: fix build-release-binaries
2024-05-27 12:04:47 +02:00
Byron Hambly
bbf8f84312
ci: fix build-release-binaries 2024-05-27 12:04:04 +02:00
Byron Hambly
a471a17a88
Merge pull request #1648 from delta1/ci-fix-stable
ci: fix duplicate definition of check_stable
2024-05-27 11:38:09 +02:00
Byron Hambly
e6d37c01a6
ci: fix duplicate definition of check_stable 2024-05-27 11:06:10 +02:00
Byron Hambly
796863359f
upgrade secp256kfun (#1466)
* ci: add cargo check on rust stable

* refactor: upgrade secp256kfun and fix resulting issues

* build(deps): update sigma_fun and ecdsa_fun to a52142cf7f

 #1520
 #1521

* chore: fix clippy issue

* update to 91112f80b24

* bump to 294de1721add

* chore(deps): remove spectral

spectral fails to compile on rust stable 1.76 due to dep on deprecated
rustc-serialize

* secp256kfun: update to 7da9d277 and set rev in manifest

* update to 6fdc5d8

* switch to crates.io versions of ecdsa_fun and sigma_fun

* ci: update toolchain to 1.74 and fix draft action

* clippy fixes

---------

Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
2024-05-27 11:03:20 +02:00
Byron Hambly
1e2dddb61b
Merge pull request #1629 from comit-network/dependabot/cargo/toml-0.8.13
build(deps): bump toml from 0.8.12 to 0.8.13
2024-05-27 10:09:28 +02:00
Byron Hambly
dc8e1e53f2
Merge pull request #1647 from comit-network/monero-wallet-rpc-update-01831
CLI: Upgrade monero-wallet-rpc to 0.18.3.1, clarify a few log. messages
2024-05-27 09:42:06 +02:00
binarybaron
32ca0b1a4a CLI: Upgrade monero-wallet-rpc to 0.18.3.1, clarify a few log. messages 2024-05-25 18:22:17 +02:00
binarybaron
c433bd2389
CLI: Initiate tracing earlier to avoid lost logs (#1646) 2024-05-25 17:59:12 +02:00
binarybaron
0ca98cd0b7
Make tracing file appender blocking (#1643) 2024-05-25 14:43:22 +02:00
binarybaron
2f28ef9401
Add missing changelog entries (#1641) 2024-05-24 18:06:21 +02:00
binarybaron
0c4b7d50c2
Lower DEFAULT_BITCOIN_CONFIRMATION_TARGET to 1 to ensure timely confirmation of bitcoin transactions (#1640) 2024-05-24 18:02:29 +02:00
Byron Hambly
838a7ab5fb
Merge pull request #1637 from comit-network/dependabot/github_actions/actions/checkout-4.1.6
build(deps): bump actions/checkout from 4.1.1 to 4.1.6
2024-05-23 13:54:11 +02:00
Byron Hambly
db78a1e99e
Merge pull request #1636 from comit-network/dependabot/github_actions/Swatinem/rust-cache-2.7.3
build(deps): bump Swatinem/rust-cache from 2.7.1 to 2.7.3
2024-05-23 13:54:00 +02:00
dependabot[bot]
b443a96469
build(deps): bump actions/checkout from 4.1.1 to 4.1.6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.1 to 4.1.6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.1...v4.1.6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-23 11:10:29 +00:00
dependabot[bot]
97210739a1
build(deps): bump Swatinem/rust-cache from 2.7.1 to 2.7.3
Bumps [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) from 2.7.1 to 2.7.3.
- [Release notes](https://github.com/swatinem/rust-cache/releases)
- [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md)
- [Commits](https://github.com/swatinem/rust-cache/compare/v2.7.1...v2.7.3)

---
updated-dependencies:
- dependency-name: Swatinem/rust-cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-23 11:10:26 +00:00
yamabiiko
5ff46be279
RPC server for API Interface (#1276)
* saving: implementing internal api shared by cli and rpc server

* writing async rpc methods and using arc for shared struct references

* cleaning up, renamed Init to Context

* saving: cleaning up and initial work for tests

* Respond with bitcoin withdraw txid

* Print RPC server address

* Cleanup, formatting, add `get_seller`, `get_swap_start_date` RPC endpoints

* fixing tests in cli module

* uncommenting and fixing more tests

* split api module and propagate errors with rpc server

* moving methods to api and validating addresses for rpc

* add broadcast channel to handle shutdowns gracefully and prepare for RPC server test

* added files

* Update rpc.rs

* adding new unfinished RPC tests

* updating rpc-server tests

* fixing warnings

* fixing formatting and cargo clippy warnings

* fix missing import in test

* fix: add data_dir to config to make config command work

* set server listen address manually and return file locations in JSON on Config

* Add called api method and swap_id to tracing for context, reduced boilerplate

* Pass server_address properly to RpcServer

* Update Cargo.lock

* dprint fmt

* Add cancel_refund RPC endpoint

* Combine Cmd and Params

* Disallow concurrent swaps

* Use RwLock instead of Mutex to allow for parallel reads and add get_current_swap endpoint

* Return wallet descriptor to RPC API caller

* Append all cli logs to single log file

After careful consideration, I've concluded that it's not practical/possible to ensure that the previous behaviour (one log file per swap) is preserved due to limitations of the tracing-subscriber crate and a big in the built in JSON formatter

* Add get_swap_expired_timelock timelock, other small refactoring

- Add get_swap_expired_timelock endpoint to return expired timelock if one exists. Fails if bitcoin lock tx has not yet published or if swap is already finished.
- Rename current_epoch to expired_timelock to enforce consistent method names
- Add blocks left until current expired timelock expires (next timelock expires) to ExpiredTimelock struct
- Change .expect() to .unwrap() in rpc server method register because those will only fail if we register the same method twice which will never happen

* initiating swaps in a separate task and handling shutdown signals with broadcast queues

* Replace get_swap_start_date, get_seller, get_expired_timelock with one get_swap_info rpc method

* WIP: Struct for concurrent swaps manager

* Ensure correct tracing spans

* Add note regarding Request, Method structs

* Update request.rs

* Add tracing span attribute log_reference_id to logs caused by rpc call

* Sync bitcoin wallet before initial max_giveable call

* use Span::current() to pass down to tracing span to spawned tasks

* Remove unused shutdown channel

* Add `get_monero_recovery_info` RPC endpoint

- Add `get_monero_recovery_info` RPC endpoint
- format PrivateViewKey using Display

* Rename `Method::RawHistory` to `Method::GetRawStates`

* Wait for swap to be suspended after sending signal

* Remove notes

* Add tracing span attribute log_reference_id to logs caused by rpc call

* Sync bitcoin wallet before initial max_giveable call

* use Span::current() to pass down to tracing span to spawned tasks

* Remove unused shutdown channel

* Add `get_monero_recovery_info` RPC endpoint

- Add `get_monero_recovery_info` RPC endpoint
- format PrivateViewKey using Display

* Rename `Method::RawHistory` to `Method::GetRawStates`

* Wait for swap to be suspended after sending signal

* Return additonal info on GetSwapInfo

* Update wallet.rs

* fix compile issues for tests and use serial_test crate

* fix rpc tests, only check for RPC errors and not returned values

* Rename `get_raw_history` tp `get_raw_states`

* Fix typo in rpc server stopped tracing log

* Remove unnecessary success property on suspend_current_swap response

* fixing test_cli_arguments and other tests

* WIP: RPC server integration tests

* WIP: Integration tests for RPC server

* Update rpc tests

* fix compile and warnings in tests/rpc.rs

* test: fix assert

* clippy --fix

* remove otp file

* cargo clippy fixes

* move resume swap initialization code out of spawned task

* Use `in_current_span` to pass down tracing span to spawned tasks

* moving buy_xmr initialization code out of spawned tasks

* cargo fmt

* Moving swap initialization code inside tokio select block to handle swap lock release logic

* Remove unnecessary swap suspension listener from determine_btc_to_swap call in BuyXmr

* Spawn event loop before requesting quote

* Release swap lock after receiving shutdown signal

* Remove inner tokio::select in BuyXmr and Resume

* Improve debug text for swap resume

* Return error to API caller if bid quote request fails

* Print error if one occurs during process invoked by API call

* Return bid quote to API caller

* Use type safe query! macro for database retrieval of states

* Return tx_lock_fee to API caller on GetSwapInfo call

Update request.rs

* Allow API caller to retrieve last synced bitcoin balane and avoid costly sync

* Return restore height on MoneroRecovery command to API Caller

* Include entire error cause-chain in API response

* Add span to bitcoin wallet logs

* Log event loop connection properties as tracing fields

* Wait for background tasks to complete before exiting CLI

* clippy

* specify sqlx patch version explicitly

* remove mem::forget and replace with _guard

* ci: add rpc test job

* test: wrap rpc test in #[cfg(test)]

* add missing tokio::test attribute

* fix and merge rpc tests, parse uuuid and multiaddr from serde_json value

* default Tor socks port to 9050, Cargo fmt

* Update swap/sqlite_dev_setup.sh: add version

Co-authored-by: Byron Hambly <byron@hambly.dev>

* ci: free up space on ubuntu test job

* Update swap/src/bitcoin/wallet.rs

Co-authored-by: Byron Hambly <byron@hambly.dev>

* Update swap/src/bitcoin/wallet.rs

Co-authored-by: Byron Hambly <byron@hambly.dev>

* fmt

---------

Co-authored-by: binarybaron <86064887+binarybaron@users.noreply.github.com>
Co-authored-by: Byron Hambly <byron@hambly.dev>
2024-05-22 15:12:58 +02:00
Byron Hambly
7d4a6c90f3
Merge pull request #1633 from comit-network/dependabot/cargo/anyhow-1.0.86
build(deps): bump anyhow from 1.0.83 to 1.0.86
2024-05-20 13:47:35 +02:00