Commit Graph

873 Commits (bc176bc4fbdee9ec4b5b904cecadb8dfa5284a9d)
 

Author SHA1 Message Date
Thomas Eizinger 84bc2c82b7
Upgrade to bdk 4.0
To achieve this we also:

- upgrade rust-bitcoin to 0.26
- upgrade bitcoin-harness to latest version (which also depends bitcoin 0.26)
- upgrade to latest edcsa-fun
- replace cross_curve_dleq proof with sigma_fun (to avoid an upgrade dance over there)
3 years ago
bors[bot] 374c2d4372
Merge #205
205: Optimize GitHub workflow file r=thomaseizinger a=thomaseizinger

See commit messages for further details.

Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Thomas Eizinger fb45ff66eb
Update rust-toolchain to new toml syntax
This allows us to completely skip the "Install Rust" step in CI
because the rust-toolchain file completely describes what we need.
The first invocation of cargo will simply install all the required
components.

Additionally, we make all caches dependant on the version of Rust
that we require.
3 years ago
Thomas Eizinger 8072f4d7ee
Only install tomlfmt if we don't have ~/.cargo/bin cached 3 years ago
bors[bot] b3f49cf83e
Merge #200
200: Wait for refund if insufficient Monero is locked up r=da-kami a=da-kami

In a scenario where Alice does not lock up sufficient funds Bob should properly transition to refunds. At the moment the CLI just panics. 
I noticed this when Alice accidentally had a different amount set than Bob. In the future this should not happen, because Alice provides the amount for Bob. However, in case Alice is malicious Bob should still transition correctly. 

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
bors[bot] 8537b88a68
Merge #201
201: Fix ASB - Prevent the future from being stopped in production r=da-kami a=da-kami



Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
Thomas Eizinger a3b5c13b52
Upgrade to actions/cache@v2.1.4
Usually, we can follow the rolling major tag (@v2) of actions.
However the recent release (2.1.4) is not yet included. See
https://github.com/actions/cache/issues/528 for more details.

We do want to depend on 2.1.4 because it contains a fix that allows
us to use the cache action MacOS. v2 also features better compression
and allows for multiple paths to be specified.
3 years ago
Thomas Eizinger f1b097877b
Split `build_test` into `build` and `test`
Building binaries and building tests results in different artifacts
inside the `target` directory. If we use distinct caches for these
commands, the caches are more useful because less code has to be
re-built.
3 years ago
Thomas Eizinger e57c005920
Remove unused matrix entry 3 years ago
Thomas Eizinger acbc0f5551
Upload nectar binary in addition to swap_cli 3 years ago
Thomas Eizinger 3c7880f771
Fix path to CLI for artifact upload
The name was recently changed but the workflow wasn't adapted.
3 years ago
bors[bot] 48635156ad
Merge #206
206: Remove misplaced wallet sync call r=rishflab a=rishflab

These bdk wallet sync calls must of gotten lost during a rebase. Removed the call in build TxLock and added one when nectar starts up

Co-authored-by: rishflab <rishflab@hotmail.com>
3 years ago
bors[bot] bd00abe070
Merge #204
204: Upgrade to testcontainers v0.12 r=thomaseizinger a=thomaseizinger



Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
Daniel Karzel babd1d7b60
Wait for refund if insufficient Monero is locked up 3 years ago
Daniel Karzel ebb869e6f4 Distinguish transient and permanent Electrum errors 3 years ago
Daniel Karzel 9b93cabfdf Use context instead of map_error 3 years ago
rishflab fe362d765b Add sync wallet on nectar's startup 3 years ago
rishflab 00e2b257c4 Remove misplaced sync wallet call 3 years ago
Thomas Eizinger 8c83f7e2e1
Upgrade to testcontainers v0.12 3 years ago
Daniel Karzel 2ced9ddba4 Prevent future from being stopped by calling forget on handle 3 years ago
Daniel Karzel 77ec7e502f Distinguish permanent and transient error when watching tx 3 years ago
bors[bot] 7a9569ffd4
Merge #178
178: Replace bitcoind wallet with bdk wallet r=rishflab a=da-kami

Create and pair bitcoind and electrs testcontainers using the same docker network and volume.

Follow-up to be fixed on top: 

- [ ] Remove bitcoin-harness dependency and directly depend on https://github.com/thomaseizinger/rust-jsonrpc-client for the RPC client. 

Co-authored-by: rishflab <rishflab@hotmail.com>
Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
3 years ago
rishflab b66bb00c77 Remove stale code 3 years ago
rishflab bc1d2bda54 Test URL creation for default electrum HTTP API 3 years ago
rishflab d296c22ecf Log bitcoin deposit address on startup 3 years ago
rishflab 4768c79070 Derive bitcoin private key from seed 3 years ago
Thomas Eizinger a51194b9fa Instantiate electrum client with custom config with 2 retries
The default number of retries is 1. Unfortunately, the way this config
value is interpreted doesn't actually lead to a retry. We have to set
it to 2 to actually make it retry.

See https://github.com/bitcoindevkit/rust-electrum-client/issues/47.
3 years ago
rishflab 180e778df9 Allow blockchain calls to fail
Prior to this change, functions could not fail early on permanent errors eg. parsing a url. Merged error enums.
3 years ago
rishflab a0ef1f96ec Replace bitcoind wallet with bdk wallet
The bitcoind wallet required the user to run a bitcoind node. It was replaced with a bdk wallet which allows the user to connect to an electrum instance hosted remotely. An electrum and bitcoind testcontainer were created to the test the bdk wallet. The electrum container reads the blockdata from the bitcoind testcontainer through a shared volume. bitcoind-harness was removed as bitcoind initialisation code was moved into test_utils. The bdk wallet differs from the bitcoind wallet in that it needs to be manually synced with an electrum node. We synchronise the wallet once upon initialisation to prevent a potentially long running blocking task from interrupting protocol execution. The electrum HTTP API was used to get the latest block height and the transaction block height as this functionality was not present in the bdk wallet API or it required the bdk wallet to be re-synced to get an up to date value.
3 years ago
bors[bot] 4d8e801c1e
Merge #190
190: Do not pass Monero amount to the CLI r=D4nte a=D4nte

The CLI user only pass the Bitcoin amount they want to sell.

The CLI then do a quote request to nectar which provides the Monero amount the taker can get.

Co-authored-by: Franck Royer <franck@coblox.tech>
3 years ago
bors[bot] 5d215caf35
Merge #188
188: Tor cleanup r=da-kami a=da-kami

We never removed Tor install from CI. I don't think it should be necessary given that Tor was removed in code.

Co-authored-by: Daniel Karzel <daniel@comit.network>
3 years ago
bors[bot] 946483d880
Merge #192
192: Remove unnecessary async block r=D4nte a=D4nte



Co-authored-by: Franck Royer <franck@coblox.tech>
3 years ago
Franck Royer f36f5acaf1
Remove unnecessary async block 3 years ago
Franck Royer 73c52ffb61
Remove unused structs 3 years ago
Franck Royer 2dbd43e2c0
Only pass btc amount to CLI
The CLI requests a quote to nectar to know how much xmr it can get.
Also align terminology with the sequence diagram.
3 years ago
Franck Royer 144da75270
Remove redundant data 3 years ago
Franck Royer fb3b2aa546
Remove unnecessary pub qualifier 3 years ago
Franck Royer b4e2e11dde
Remove unnecessary fields 3 years ago
Franck Royer d6effb7d39
Remove unnecessary pub qualifiers 3 years ago
Franck Royer b8a84aa34b
Avoid possible mix up between timelocks
Introduce new type to ensure no mix up happens when ordering the fields
in function calls.
3 years ago
Franck Royer 9a321a4f09
Move transaction types in dedicated modules
To allow the related timelock to be defined with the
transaction that uses it. This will allow the access to the
timelock's struct inner field with defining `From` impl.
3 years ago
bors[bot] 6e6c207715
Merge #191
191: Use Remote handle to access ongoing swaps on Alice r=rishflab a=D4nte

This helps stabilizing the test as sometimes we were checking Alice state (in the DB) too early.

Co-authored-by: Franck Royer <franck@coblox.tech>
3 years ago
Franck Royer 65e0e5b731
Use Remote handle to access ongoing swaps on Alice 3 years ago
bors[bot] a0753e24dc
Merge #189
189: The first message is more of a quote request than a swap request r=D4nte a=D4nte



Co-authored-by: Franck Royer <franck@coblox.tech>
3 years ago
bors[bot] 4314006b2a
Merge #184
184: Make `config` argument global r=D4nte a=D4nte



Co-authored-by: Franck Royer <franck@coblox.tech>
3 years ago
Franck Royer 5d78556665
Give a more specific name to the CLI binary: `swap-cli`
The current binary name is very generic `cli`. `swap-cli` better
describes what this binary does.
3 years ago
Franck Royer 8fada42074
Make `config` argument global
The `config` argument apply to all commands. It is now optional and
needs to be passed before a command.
E.g. `cli --config ./config.toml history`
3 years ago
Franck Royer 83dcf4ba3c
Add `nectar` binary 3 years ago
Daniel Karzel c166232daf Remove unnecessary mention of Tor in comment 3 years ago
Daniel Karzel e353d0e89b Remove tor installation from CI 3 years ago