Commit Graph

1432 Commits (4a5e9d47b722297b0439167c9c29feef30fcf758)
 

Author SHA1 Message Date
bors[bot] 4a5e9d47b7
Merge #545
545: Release version 0.7.0 r=da-kami a=comit-botty-mc-botface

Hi @da-kami!

This PR was created in response to a manual trigger of the release workflow here: https://github.com/comit-network/xmr-btc-swap/actions/runs/884754906.
I've updated the changelog and bumped the versions in the manifest files in this commit: 7e6ff81efb.

Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.

Co-authored-by: COMIT Botty McBotface <botty@coblox.tech>
3 years ago
COMIT Botty McBotface 7e6ff81efb Prepare release 0.7.0 3 years ago
bors[bot] 0cc98baa98
Merge #540
540: Bump hyper from 0.14.7 to 0.14.8 r=thomaseizinger a=dependabot[bot]

Bumps [hyper](https://github.com/hyperium/hyper) from 0.14.7 to 0.14.8.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/hyperium/hyper/releases">hyper's releases</a>.</em></p>
<blockquote>
<h2>v0.14.8</h2>
<h2>Features</h2>
<ul>
<li><strong>client:</strong> allow to config http2 max concurrent reset streams (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2535">#2535</a>) (<a href="b9916c4101">b9916c41</a>)</li>
<li><strong>error:</strong> add <code>Error::is_parse_too_large</code> and <code>Error::is_parse_status</code> methods (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2538">#2538</a>) (<a href="960a69a587">960a69a5</a>)</li>
<li><strong>http2:</strong>
<ul>
<li>Implement Client-side CONNECT support over HTTP/2 (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2523">#2523</a>) (<a href="5442b6fadd">5442b6fa</a>, closes <a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2508">#2508</a>)</li>
<li>allow HTTP/2 requests by ALPN when http2_only is unset (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2527">#2527</a>) (<a href="be9677a1e7">be9677a1</a>)</li>
</ul>
</li>
</ul>
<h2>Performance</h2>
<ul>
<li><strong>http2:</strong> reduce amount of adaptive window pings as BDP stabilizes (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2550">#2550</a>) (<a href="https://github.com/hyperium/hyper/commit/4cd06bf2">4cd06bf2</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/hyperium/hyper/blob/master/CHANGELOG.md">hyper's changelog</a>.</em></p>
<blockquote>
<h3>v0.14.8 (2021-05-25)</h3>
<h4>Features</h4>
<ul>
<li><strong>client:</strong> allow to config http2 max concurrent reset streams (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2535">#2535</a>) (<a href="b9916c4101">b9916c41</a>)</li>
<li><strong>error:</strong> add <code>Error::is_parse_too_large</code> and <code>Error::is_parse_status</code> methods (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2538">#2538</a>) (<a href="960a69a587">960a69a5</a>)</li>
<li><strong>http2:</strong>
<ul>
<li>Implement Client-side CONNECT support over HTTP/2 (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2523">#2523</a>) (<a href="5442b6fadd">5442b6fa</a>, closes <a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2508">#2508</a>)</li>
<li>allow HTTP/2 requests by ALPN when http2_only is unset (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2527">#2527</a>) (<a href="be9677a1e7">be9677a1</a>)</li>
</ul>
</li>
</ul>
<h4>Performance</h4>
<ul>
<li><strong>http2:</strong> reduce amount of adaptive window pings as BDP stabilizes (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2550">#2550</a>) (<a href="https://github.com/hyperium/hyper/commit/4cd06bf2">4cd06bf2</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="e61b494e3b"><code>e61b494</code></a> v0.14.8</li>
<li><a href="5442b6fadd"><code>5442b6f</code></a> feat(http2): Implement Client-side CONNECT support over HTTP/2 (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2523">#2523</a>)</li>
<li><a href="be9677a1e7"><code>be9677a</code></a> feat(http2): allow HTTP/2 requests by ALPN when http2_only is unset (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2527">#2527</a>)</li>
<li><a href="4cd06bf256"><code>4cd06bf</code></a> perf(http2): slow adaptive window pings as the BDP stabilizes (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2550">#2550</a>)</li>
<li><a href="960a69a587"><code>960a69a</code></a> feat(error): add <code>Error::is_parse_too_large</code> and <code>Error::is_parse_status</code> met...</li>
<li><a href="b9916c4101"><code>b9916c4</code></a> feat(client): allow to config http2 max concurrent reset streams (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2535">#2535</a>)</li>
<li><a href="ccba59fb1b"><code>ccba59f</code></a> docs(common): remove favicon doc from sync_wrapper module (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2548">#2548</a>)</li>
<li><a href="8a05f8eec1"><code>8a05f8e</code></a> docs(server): add bigger example to server module (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2539">#2539</a>)</li>
<li><a href="e79d09396d"><code>e79d093</code></a> docs(client): document the guarantees of cloning a <code>Client</code> (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2540">#2540</a>)</li>
<li><a href="d1d2f32a73"><code>d1d2f32</code></a> docs(headers): no_inline doc on HeaderMap (<a href="https://github-redirect.dependabot.com/hyperium/hyper/issues/2525">#2525</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/hyperium/hyper/compare/v0.14.7...v0.14.8">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=hyper&package-manager=cargo&previous-version=0.14.7&new-version=0.14.8)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
bors[bot] 5385fc1aa0
Merge #531 #535
531: Bump thiserror from 1.0.24 to 1.0.25 r=thomaseizinger a=dependabot[bot]

Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.24 to 1.0.25.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/dtolnay/thiserror/releases">thiserror's releases</a>.</em></p>
<blockquote>
<h2>1.0.25</h2>
<ul>
<li>Support <code>error(transparent)</code> on errors containing a non-<code>'static</code> inner error (<a href="https://github-redirect.dependabot.com/dtolnay/thiserror/issues/113">#113</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="19cb5cee4b"><code>19cb5ce</code></a> Release 1.0.25</li>
<li><a href="e49c10f2ba"><code>e49c10f</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/dtolnay/thiserror/issues/134">#134</a> from dtolnay/nonstatic</li>
<li><a href="1ed8751081"><code>1ed8751</code></a> Support non-static AsDynError lifetimes</li>
<li><a href="51a1ff6593"><code>51a1ff6</code></a> Add regression test for issue 113</li>
<li><a href="ee2a47d3af"><code>ee2a47d</code></a> Adjust macro hygiene test formatting</li>
<li><a href="c610d97267"><code>c610d97</code></a> Update ui test suite to nightly-2021-05-14</li>
<li><a href="c10adbc25e"><code>c10adbc</code></a> Ignore manual_map clippy lint</li>
<li>See full diff in <a href="https://github.com/dtolnay/thiserror/compare/1.0.24...1.0.25">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=thiserror&package-manager=cargo&previous-version=1.0.24&new-version=1.0.25)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

535: Bitcoin network check when building PSBT r=da-kami a=da-kami

This ensures that funds are not sent to an address on the wrong network.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
bors[bot] 1688d7e603
Merge #521 #543
521: Introduce dedicated ParseResult to simplify error handling in main r=da-kami a=thomaseizinger



543: Tell dependabot to stop automatically rebasing PRs r=thomaseizinger a=thomaseizinger

This interferes with bors trying to merge several PRs at once.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Thomas Eizinger 76b81ac2c4
Tell dependabot to stop automatically rebasing PRs 3 years ago
Thomas Eizinger 229d840990
Introduce dedicated `ParseResult` to simplify error handling in main 3 years ago
Thomas Eizinger d43ba33e15
Lift out `Ok` wrapping from match expression 3 years ago
Daniel Karzel 766ac706de
Application arg tests
Includes validation for given Bitcoin address against network.
3 years ago
bors[bot] baf5a0896e
Merge #536
536: Switch to using stable Rust instead of nightly r=thomaseizinger a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Daniel Karzel 202f6d1fa0
Bitcoin network check when building PSBT
This ensures that funds are not sent to an address on the wrong network.
3 years ago
bors[bot] 60d595f6c7
Merge #542
542: More resilient `MoneroWalletRpc` startup in the harness r=da-kami a=da-kami

Recently we se this problem on CI quite often:

```
 May 27 01:26:55.898  INFO testcontainers::core::wait_for_message: Found message after comparing 80 lines
May 27 01:27:00.858  INFO testcontainers::core::wait_for_message: Found message after comparing 2 lines
May 27 01:27:00.859  INFO monero_harness: Starting monerod: DQma_monerod
May 27 01:27:08.143  INFO testcontainers::core::wait_for_message: Found message after comparing 183 lines
May 27 01:27:08.204  INFO monero_harness: Starting miner wallet: miner
May 27 01:27:09.832  INFO testcontainers::core::wait_for_message: Found message after comparing 16 lines
May 27 01:27:12.261  INFO monero_harness: Starting wallet: alice
May 27 01:27:14.482  INFO testcontainers::core::wait_for_message: Found message after comparing 16 lines
thread 'alice_punishes_after_restart_if_bob_dead' panicked at 'called `Result::unwrap()` on an `Err` value: error sending request for url (http://127.0.0.1:49177/json_rpc): operation was canceled: connection closed before message completed
```

Given the message `connection closed before message completed` it is likely that the `monero-wallet-rpc` is not fully started yet.

Unfortunately we cannot wait to see a different message in the logs upon container startup, because there are just no further deterministic messages after the one we are currently listening on.

To overcome this problem without extending testcontainers we introduce a retry mechanism when creating the wallet.

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
bors[bot] c164f3d1f5
Merge #538
538: Add ping protocol to ensure connection is alive r=da-kami a=da-kami

Fixes #532 

Adds the ping behaviour to both ASB and CLI behaviour that periodically pings a connected party to ensure that the underlying network connection is still alive.
This fixes problems with long-running connections that become dead without a connection closure being reported back to the swarm.

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Daniel Karzel 5d3060a2e6
More resilient `MoneroWalletRpc` startup in the harness
Recently we se this problem on CI quite often:

```
 May 27 01:26:55.898  INFO testcontainers::core::wait_for_message: Found message after comparing 80 lines
May 27 01:27:00.858  INFO testcontainers::core::wait_for_message: Found message after comparing 2 lines
May 27 01:27:00.859  INFO monero_harness: Starting monerod: DQma_monerod
May 27 01:27:08.143  INFO testcontainers::core::wait_for_message: Found message after comparing 183 lines
May 27 01:27:08.204  INFO monero_harness: Starting miner wallet: miner
May 27 01:27:09.832  INFO testcontainers::core::wait_for_message: Found message after comparing 16 lines
May 27 01:27:12.261  INFO monero_harness: Starting wallet: alice
May 27 01:27:14.482  INFO testcontainers::core::wait_for_message: Found message after comparing 16 lines
thread 'alice_punishes_after_restart_if_bob_dead' panicked at 'called `Result::unwrap()` on an `Err` value: error sending request for url (http://127.0.0.1:49177/json_rpc): operation was canceled: connection closed before message completed
```

Given the message `connection closed before message completed` it is likely that the `monero-wallet-rpc` is not fully started yet.
Unfortunately we cannot wait to see a different message in the logs, because there are just no further deterministic messages after the one we are currently listening on.
to overcome this problem without extending testcontainers we introduce a retry mechanism when creating the wallet.
3 years ago
Daniel Karzel c9064d5a37
Add ping protocol to ensure connection is alive
Adds the ping behaviour to both ASB and CLI behaviour that periodically pings a connected party to ensure that the underlying network connection is still alive.
This fixes problems with long-running connections that become dead without a connection closure being reported back to the swarm.
3 years ago
dependabot[bot] 44005fb757
Bump hyper from 0.14.7 to 0.14.8
Bumps [hyper](https://github.com/hyperium/hyper) from 0.14.7 to 0.14.8.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.14.7...v0.14.8)

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
Thomas Eizinger 8f9d612af2
Change to stable Rust 1.52
Fix clippy warnings that are new in this version.
3 years ago
Thomas Eizinger 5d7acd39ee
Use new .toml extension for rust-toolchain file 3 years ago
Thomas Eizinger 694ade11d1
Replace cargo-fmt with dprint
If we want to use stable Rust, we can't use cargo-fmt with nightly
features.
3 years ago
Thomas Eizinger b8cb9e1b8b
Update secp256kfun and rand to latest version
This will allow us to compile on stable Rust.
The latest version of `secp256kfun` uses `curve25519-dalek-ng` instead
of the original curve25519-dalek crate. Instead of converting back and
forth, we simply switch to this crate as well. Judging from the README
it is just a fork because there was trouble between the maintainers of
the original crate.
3 years ago
Thomas Eizinger e79ac4563b
Delete unused code 3 years ago
bors[bot] 6743801c71
Merge #533
533: fix typo r=da-kami a=SamouraiDev



Co-authored-by: TDevD <dev@samouraiwallet.com>
3 years ago
bors[bot] 2a570058fa
Merge #528
528: Add the arm CLI build to the release binaries r=da-kami a=da-kami

Currently it is not shipped because we forgot to include it.
I don't see a reason not to ship that as well. @bonomat  and me tested it on a raspi last Friday :)

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
TDevD 5da075f533 fix typo 3 years ago
Daniel Karzel 7dfe719e5f
Add the arm CLI build to the release binaries
Currently it is not shipped because we forgot to include it.
3 years ago
dependabot[bot] 78b29a944d
Bump thiserror from 1.0.24 to 1.0.25
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.24 to 1.0.25.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.24...1.0.25)

Signed-off-by: dependabot[bot] <support@github.com>
3 years ago
bors[bot] ca6cb0a76a
Merge #527
527: Release version 0.6.0 r=da-kami a=comit-botty-mc-botface

Hi @da-kami!

This PR was created in response to a manual trigger of the release workflow here: https://github.com/comit-network/xmr-btc-swap/actions/runs/870083908.
I've updated the changelog and bumped the versions in the manifest files in this commit: 30b2cb467a8dde873da16cedf69f5b4ccbdb7508.

Merging this PR will create a GitHub release and upload any assets that are created as part of the release build.

Co-authored-by: Daniel Karzel <daniel@comit.network>
Co-authored-by: COMIT Botty McBotface <botty@coblox.tech>
3 years ago
COMIT Botty McBotface 3f2d094f65
Prepare release 0.6.0 3 years ago
Daniel Karzel 4804359ee3
Update ASB readme
Remove CLi defaults because they may get outdated very fast.
Recommendation to run own node.
Link to public bitcoin nodes as well.
3 years ago
Daniel Karzel 1de907b176
Change default Monero mainnet node to xmr.to
It appears to be more stable.
Encountered issues with the previous setup, `monero-wallet-rpc` logs:

```
2021-05-24 04:23:54.852	E !r. THROW EXCEPTION: tools::error::no_connection_to_daemon
2021-05-24 04:23:54.857	E Exception at while refreshing, what=no connection to daemon
```
3 years ago
bors[bot] ded9ea1b79
Merge #525
525: Bitcoin transaction published state r=da-kami a=da-kami

This improves the error handling on the ASB.
Once the Bitcoin redeem transaction is seen in mempool, the state machine cannot transition to a cancel scenario anymore because at that point the CLI will have redeemed the Monero.
The additional state then waits for transaction finality and prevents re-publishing the transaction.

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
bors[bot] 284733d359
Merge #522
522: Add support for arm architecture to Swap CLI r=da-kami a=bonomat

Tested locally on my RPI4

Co-authored-by: Philipp Hoenisch <philipp@hoenisch.at>
3 years ago
Daniel Karzel 01af9a5676
Bitcoin transaction published state
This improves the error handling on the ASB.
Once the Bitcoin redeem transaction is seen in mempool, the state machine cannot transition to a cancel scenario anymore because at that point the CLI will have redeemed the Monero.
The additional state then waits for transaction finality.
3 years ago
bors[bot] bc27b9a47d
Merge #524
524: Update the README for mainnet r=da-kami a=da-kami



Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Daniel Karzel 7a787fba6a
Update the README for mainnet 3 years ago
bors[bot] db319d0a90
Merge #520
520: Cli json logging r=da-kami a=da-kami

Combining `--json` with the debug file logger was a pita, so I stopped and went for a simpler approach:

If `--json` is given we just log to terminal - **no** logfiles will be created in `{data-dir}/logs`. 
The `--debug` flag applies to `--json` (i.e. if not given it will just print json on info level). We could change that to automatically fallback to debug - could add a `required_if` dependency via strucopt/clap but I did not want to invest more time into thinking about this.

Note on extending binary functionality:
As discussed with @thomaseizinger recently, we will have to think about multiple binaries soon, i.e. a binary that focuses to be used to building on top of it (that always logs json) and potientially keeping a simple CLI that is more user friendly. This also goes towards more clearly separating the application code from re-usable protocol / network code. 


Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Philipp Hoenisch 21babf9678
Support armv7 architecture for monero-wallet-rpc.
This allows us to run swap cli on a raspberry pi 4.
3 years ago
Philipp Hoenisch a445ddd2bd
Print download URL while downloading. 3 years ago
Philipp Hoenisch f6c7410457
Upgrade monero-wallet-rpc to version 2.0 3 years ago
bors[bot] ba33e1acc1
Merge #519
519: Avoid application error upon `--help` r=da-kami a=da-kami

Our `preview` release is currently broken because of this issue.

The way we use clap's `get_matches_from_safe` caused parsing errors upon `--help` and `--version` to be bubbled up to the application - which causes the application to exit with an error when running `--help` and `--version`.
This is solved by using `get_matches_from` instead of `get_matches_from_safe` which handles these known clap commands internally and exits early. 

Added smoke tests to CI so we catch such kind of problems in the future. Smoke testing by calling `--help` is cheap and should be OK in CI.

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Daniel Karzel fb9fb21c2b
CLI log statements to be more JSON friendly
Values to be logged as fields.
Upon starting a swap we print the swap-id as well.
3 years ago
Daniel Karzel 0187d9ef4f
Introduce `--json` flag for the CLI
When `--json` is used the CLI does not log to file, but only on the command line in json output.
3 years ago
bors[bot] 0032e820af
Merge #512
512: Bump libp2p from 0.37.1 to 0.38.0 r=thomaseizinger a=dependabot[bot]

Bumps [libp2p](https://github.com/libp2p/rust-libp2p) from 0.37.1 to 0.38.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/libp2p/rust-libp2p/releases">libp2p's releases</a>.</em></p>
<blockquote>
<h2>v0.38.0</h2>
<p>See individual <a href="https://github.com/libp2p/rust-libp2p/blob/HEAD/CHANGELOG.md">changelogs</a> for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/libp2p/rust-libp2p/blob/master/CHANGELOG.md">libp2p's changelog</a>.</em></p>
<blockquote>
<h2>Version 0.38.0 [2021-05-17]</h2>
<ul>
<li>Update individual crates.
<ul>
<li><code>libp2p-core</code></li>
<li><code>libp2p-gossipsub</code></li>
<li><code>libp2p-noise</code></li>
<li><code>libp2p-pnet</code></li>
<li><code>libp2p-wasm-ext</code></li>
</ul>
</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="0b7ee3fa92"><code>0b7ee3f</code></a> *: Prepare v0.38.0 (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2072">#2072</a>)</li>
<li><a href="c5bcada2c2"><code>c5bcada</code></a> protocols/gossipsub: Rework connection keep-alive (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2043">#2043</a>)</li>
<li><a href="9c5dd84099"><code>9c5dd84</code></a> build(deps): Update snow requirement from 0.7.1 to 0.8.0 (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2068">#2068</a>)</li>
<li><a href="1fdac073fc"><code>1fdac07</code></a> build(deps): Bump actions-rs/toolchain from 1 to 1.0.7 (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2069">#2069</a>)</li>
<li><a href="10fcc1c485"><code>10fcc1c</code></a> build(deps): Bump actions-rs/cargo from 1 to 1.0.3 (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2070">#2070</a>)</li>
<li><a href="82c8b1a4b3"><code>82c8b1a</code></a> build(deps): Bump actions/checkout from 2 to 2.3.4 (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2071">#2071</a>)</li>
<li><a href="43a8ad8fc2"><code>43a8ad8</code></a> protocols/relay/examples: Add client server instructions (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2060">#2060</a>)</li>
<li><a href="8988ac247e"><code>8988ac2</code></a> protocols/mdns: Fix discovered event emission. (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2065">#2065</a>)</li>
<li><a href="5c541a16f1"><code>5c541a1</code></a> build(deps): update salsa20 requirement from 0.7 to 0.8 (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2062">#2062</a>)</li>
<li><a href="d931f36428"><code>d931f36</code></a> transport/wasm-ext: Support dialing <code>Multiaddr</code> with <code>/p2p</code> protocol (<a href="https://github-redirect.dependabot.com/libp2p/rust-libp2p/issues/2058">#2058</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/libp2p/rust-libp2p/compare/v0.37.1...v0.38.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=libp2p&package-manager=cargo&previous-version=0.37.1&new-version=0.38.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
3 years ago
Daniel Karzel 9ff29ae491
CLI `--help` and `--version` are handled correctly
Since we introduced our own parsing function for command line arguments, we have to make sure that clap's behaviour is handled correctly.
Clap's `get_matches_from_safe` returns an error of a certain kind, of which `ErrorKind::HelpDisplayed` and `ErrorKind::VersionDisplayed ` have to be handled to properly print the help/version and exit the program.
The clap error includes the message, so we print help/version in main now and ensure the program exits with `0` afterwards.
3 years ago
bors[bot] 014388bfaa
Merge #518
518: Fix bug that breaks swap ID for logging r=da-kami a=da-kami

Somehow I introduced this really stupid bug. Might have happened during a rebase. 

We create the swap id at the top of main.
Creating another id here breaks the name of the swap's logfile for the CLI, because the actual swap will have another id. 
Should definitely go in before releasing :)

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Daniel Karzel 22bf48c287
Fix bug that breaks swap ID for logging 3 years ago
bors[bot] bdb88f89cb
Merge #490
490: Mainnet switch r=da-kami a=da-kami

Fixes  #446
Fixes #360 
Fixes #506 
Fixes #478 

To be precise: It is actually a testnet switch, because I think mainnet should be default.

I took several assumptions on the way (e.g. network support, ...).

At this stage any feedback welcome :)

TODO:

- [ ] successful mainnet swap with this code base before merging :)

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Daniel Karzel 2db470f099
Bitcoin=2 Monero=10 default finality confirmations
It is currently not expected that ASB and CLI are used for swaps > 10_000$ equivalent to XMR/BTC, thus the finality confirmations were reduced to an equivalent of 20 mins of work (2 blocks for Bitcoin, 10 for Monero).
Monero enforces 10 unlocking blocks until the balance is spendable, so the finality confirmations cannot be set lower than 10.
3 years ago
Daniel Karzel 6694e4f4e0
Ensure that output of lock script is at tx-output index `0`
We subscribe to transactions upon broadcast, where we use output index `0` for the subscription.
In order to ensure that this subscription is guaranteed to be for the locking script (and not a change output) we now ensure that the locking script output is always at index `0` of the outputs of the transaction.

We chose this solution because otherwise we would have to add more information to broadcasting a transaction.
This solution is less intrusive, because the order of transaction outputs should not have any side effects and ensuring index `0` makes the whole behaviour more deterministic.
3 years ago
Daniel Karzel bae38a712f
Sync on interval instead of ping
Since we don't rely on long running subscriptions anymore we can remove the ping that was used to ensure a connection refresh.
3 years ago