Commit Graph

1027 Commits (master)

Author SHA1 Message Date
Daniel Karzel 69f7565746
!fixup Different default directories for CLI and ASB
3 years ago
Thomas Eizinger dd6bfd3bf4
Extend RPC client for monerod with binary requests
3 years ago
Daniel Karzel b0ffeeab1d
Different default directories for CLI and ASB
3 years ago
Daniel Karzel 08fecb8fe3
Peer check for incoming transfer proofs
3 years ago
Daniel Karzel 3c2dfa830a
Peer check for incoming encrypted signatures
3 years ago
Thomas Eizinger 1820139786
Use dprint for formatting Cargo.toml files
3 years ago
Philipp Hoenisch ea6e2f8f09
Simplify `to_address_string` by implying more context on the structure.
3 years ago
Philipp Hoenisch c8e6db24f8
Derive Tor secret key from seed.
3 years ago
Philipp Hoenisch 3a5395d7a5
Optimize torut features.
3 years ago
Philipp Hoenisch 632293cf91
Add support for swapping through Tor.
3 years ago
bors[bot] e262345b4f
Merge #442
3 years ago
Thomas Eizinger 8d76607343
Refactor monero-harness containers
3 years ago
Thomas Eizinger 0970c2bc72
Initialize reqwest clients with verbose logging
3 years ago
Daniel Karzel 0f11ab051e
Print peer ID on debog when starting CLI
3 years ago
Thomas Eizinger dc840e1562
Take wallet names by reference
3 years ago
Thomas Eizinger 22bdc08c83
Get rid of Bob's swap Builder
3 years ago
Thomas Eizinger e266fb07ef
Don't stutter
3 years ago
Thomas Eizinger 7adeaae12d
Be smart about how we import Config
3 years ago
Thomas Eizinger be5bf01ed4
Don't overqualify types that are already imported
3 years ago
Thomas Eizinger 325fcbdb8c
Introduce protocol::bob::behaviour to mimic structure from alice module
3 years ago
Thomas Eizinger 5b515d6fb2
Don't qualify with `alice::` if we are within a module of Alice
3 years ago
Thomas Eizinger a31d6febca
We don't need to import ourselves
3 years ago
Thomas Eizinger 881913ad9c
Re-order content of harness/mod.rs in a sane way
3 years ago
Thomas Eizinger 6d06db3259
Use macro-based JSON-RPC client
3 years ago
dependabot[bot] 19483c5ead
Bump libp2p from 0.36.0 to 0.37.1
3 years ago
Thomas Eizinger 39eea61538
Upgrade to bdk 0.6
3 years ago
COMIT Botty McBotface 43dc74cd9d Prepare release 0.5.0
3 years ago
Daniel Karzel c1e993deb2
Json codec for quote protocol
3 years ago
Daniel Karzel f70e2aa8d6
Listen on tcp and websocket transports
3 years ago
Thomas Eizinger b417950f99
Improve error reporting of failed protocols
3 years ago
Thomas Eizinger f0f7288bb6
Introduce a `redial::Behaviour`
3 years ago
Thomas Eizinger d4c10a1292
Introduce swarm::{alice,bob} function to construct a Swarm instance
3 years ago
bors[bot] 19766b9759
Merge #405
3 years ago
Daniel Karzel c976358c37
Multiple swaps with the same peer
3 years ago
Daniel Karzel 46f144ac67
Switch monero-rpc to debug in tests
3 years ago
bors[bot] 2f19222948
Merge #397
3 years ago
Daniel Karzel 489696ee08
Swap-id as file name for generated Monero wallet
3 years ago
Daniel Karzel 548f057726
Try to open wallet in case generate_from_keys fails
3 years ago
Daniel Karzel b60790a32c
Allow buffering multiple transfer proofs per peer
3 years ago
rishflab 8805002f96 Remove redundant noun from tracing initialiser functions
3 years ago
rishflab 9745d150e7 Log at debug level to file
3 years ago
rishflab e517c5934e Move asb tracing initializer to asb module
3 years ago
COMIT Botty McBotface 1687f84aa1 Prepare release 0.4.0
3 years ago
bors[bot] 32912ebd4a
Merge #394
3 years ago
bors[bot] f0a8be6835
Merge #396
3 years ago
rishflab 9b0467d43a Remove default connection details from CLI
3 years ago
bors[bot] e0b859bb1e
Merge #387
3 years ago
Thomas Eizinger a99d12b9df
Add a configurable spread to the ASB
3 years ago
Thomas Eizinger 3e0301a9d4
Move `FixedRate` into event_loop module
3 years ago
Thomas Eizinger 654cfff2a8
Make `kraken` module emit `PriceUpdate`s instead of `Rate`s
3 years ago
Thomas Eizinger cfc530e8ab
Make `ask` field of `Rate` private
3 years ago
Thomas Eizinger bc46d95985
Remove unnecessary `Serialize` implementations
3 years ago
Daniel Karzel 0341e7c9fc
Point BDK to commit that fixes overflow error
3 years ago
rishflab 7df93faa4b Remove unnecessary wrapper struct
3 years ago
Daniel Karzel 04b49d7117 Add command to print Bitcoin and Monero balance
3 years ago
Daniel Karzel 96008ec130 Add command to withdraw BTC
3 years ago
Daniel Karzel f5e81bb0ee Move seed and env_config outside Start command
3 years ago
Daniel Karzel d9d697821e Separate bitcoin and monero wallet initialization
3 years ago
Daniel Karzel 084fc618b4 Test Alice refunds if restarted and Bob refunded
3 years ago
Thomas Eizinger 1b2f476cae
Have `--force` flag only override the timelock check
3 years ago
Thomas Eizinger 24f444b9f7
Race sending transfer proof against cancel timelock
3 years ago
Thomas Eizinger c0785ab05a
"Buffer" all requests to Alice until we are connected
3 years ago
Thomas Eizinger 1b0c29b424
Use bmrng to model communicaton of Alice's EventLoop with the handle
3 years ago
Thomas Eizinger 1c47b32681
Use bmrng to model communicaton of Bob's EventLoop with the handle
3 years ago
Thomas Eizinger 958e5b12bc
Don't match on expired_timelocks and race it in a select in parallel
3 years ago
Thomas Eizinger dbe03ba1cf
Timeout Bob's execution-setup after 10 seconds
3 years ago
Thomas Eizinger 5d75f1adba
Remove import line in favor of FQ macro usage
3 years ago
Thomas Eizinger 4c2e254543
Don't log subscription
3 years ago
Thomas Eizinger 5b230bc75f
Don't import tracing macros
3 years ago
Thomas Eizinger 90a7760124
Add some log statements to bob::cancel
3 years ago
Thomas Eizinger 3f54b39281
Make all error messages start with an uppercase letter
3 years ago
Thomas Eizinger 0ef9d97679
Remove delegation functions in favor of public fields
3 years ago
Thomas Eizinger b1d0ae8db7
Remove dead code
3 years ago
Daniel Karzel 2135a6e53e
Alice resumes swaps
3 years ago
Daniel Karzel b6e4fb4f9d
Improve comment
3 years ago
Daniel Karzel d233e9914e
Avoid problems when re-ordering / changing Bob's states
3 years ago
Daniel Karzel e6dd194f77
next_state loop always exits in final state
3 years ago
Daniel Karzel d90496931b
Save Alice's peer-id in the db for Bob
3 years ago
Daniel Karzel bc442bcad3
Await 10 confirmations of lock tx in refund
3 years ago
Daniel Karzel 1c129d58c4
Distinguish loading all swaps for alice or bob on db level
3 years ago
Daniel Karzel 183e8f02de
Wait for lock tx and send transfer proof in separate state
3 years ago
Daniel Karzel dfd69c9c80
Alice aborts if any timelock expired before locking XMR
3 years ago
bors[bot] 6df26109aa
Merge #389
3 years ago
dependabot[bot] 8440cb9d9a
Bump monero from 0.10.0 to 0.11.1
3 years ago
dependabot[bot] 04fc870756
Bump bdk-testutils from 0.3.0 to 0.4.0
3 years ago
Thomas Eizinger 52b9a78de2
Alice to validate Bob's PSBT for correctness
3 years ago
Thomas Eizinger 8576894c10
Split bitcoin::Wallet functions into various impl blocks
3 years ago
Thomas Eizinger b9d8cbeaa2
Rename testutils to harness
3 years ago
Thomas Eizinger 11b45cd8c0
Move messages into `protocol` module
3 years ago
Thomas Eizinger e130448200
Make as many fields of Alice's states private as possible
3 years ago
Thomas Eizinger 7f5715e147
Remove unnecessary serde implementations
3 years ago
Thomas Eizinger c539465925
Make it possible to create random public keys
3 years ago
rishflab 86f312e143 Safely abort swap if TxLock is not confirmed in a reasonable time
3 years ago
Thomas Eizinger 01739eddb1
Introduce a more flexible transaction subscription system
3 years ago
bors[bot] 6fb495b6ab
Merge #383 #385 #386
3 years ago
bors[bot] a18c071559
Merge #384
3 years ago
Thomas Eizinger 0a82ce989b
Improve resilience of balance assertions
3 years ago
Thomas Eizinger a4c70dfe94
Don't call as_ref() unless necessary
3 years ago
Thomas Eizinger 4ab7e83806
Make use of `cargo test`s scoped test output
3 years ago
Thomas Eizinger 908dae3442
Inline tracing initialization
3 years ago
Thomas Eizinger c01cccb288
Use `tracing-log` feature flag instead of manual initialization
3 years ago
Thomas Eizinger c5827f84ca
Refactor recursive function to loop
3 years ago
Thomas Eizinger fc175a3f53
De-couple state from Monero wallet
3 years ago
Thomas Eizinger 42b6368298
Use full-qualified path for tracing macros
3 years ago
Thomas Eizinger 5616683d7d
Monero confirmations are a u64
3 years ago
Thomas Eizinger 1b63d5486d
Move tick to the beginning of the loop
3 years ago
Thomas Eizinger 393ed45b9e
Say who we are in the `--help` message
3 years ago
Thomas Eizinger 39b27e37d8
Delete empty file
3 years ago
rishflab a3e85526c6 Specify LANG env variable for monero wallet rpc for unix systems
3 years ago
rishflab bc902ea63a Use language agnostic heuristic to check if monero_wallet_rpc is ready
3 years ago
bors[bot] 7397cb5990
Merge #359
3 years ago
bors[bot] 9c9b1e4f0c
Merge #370
3 years ago
Thomas Eizinger 1057d115d1
Re-order bob::event_loop based on importance
3 years ago
Thomas Eizinger 638a169a04
Buffer transfer proof if we are not connected to Bob
3 years ago
Thomas Eizinger cde3f0f74a
Remove connection handling from swap execution
3 years ago
Daniel Karzel 1e2a3c2d32 No Bitcoin deposit for Alice
3 years ago
Thomas Eizinger 804b34f6b0
Listen on all swarm events instead of just behaviour events
3 years ago
Thomas Eizinger 2200fce3f3
Pass Swarm into EventLoop
3 years ago
Thomas Eizinger 2c9ab4f6eb
Improve code structure and error messages for running swaps
3 years ago
Thomas Eizinger 0c0a322a8f
Rename module to better represent what it contains
3 years ago
Thomas Eizinger 1de0b39b32
Unify encrypted-signature protocol to a single one
3 years ago
Thomas Eizinger 9979cc9f1f
Unify transfer-proof protocol to a single one
3 years ago
Thomas Eizinger 9d0b9abde0
Introduce helper function for mapping RequestResponseEvent
3 years ago
Thomas Eizinger 73f30320a6
Seed should neither be Clone nor Copy
3 years ago
Thomas Eizinger 96b2a76971
Take advantage of upgraded electrum-client dependency
3 years ago
dependabot[bot] 7f6299075c
Bump bdk from 0.4.0 to 0.5.0
3 years ago
bors[bot] 968502827a
Merge #339
3 years ago
bors[bot] 097197783c
Merge #351
3 years ago
bors[bot] 189a13c063
Merge #319
3 years ago
Daniel Karzel 62079fc342 Punish scenario falls back to refund or fails
3 years ago
Thomas Eizinger a228349d8b
Bump dependency versions
3 years ago
Daniel Karzel 668d34080d Show the actual BTC amount and fee to be swapped
3 years ago
Thomas Eizinger f49f8977d3
Remove dead code
3 years ago
Daniel Karzel 396c4177a6 Alice sweeps refunded funds into default wallet
3 years ago
Thomas Eizinger 16dfea035b
Simplify code within BobState::XmrLockProofReceived
3 years ago
Thomas Eizinger 338f4b82e5
Introduce dedicated bob::State6 for cancelling
3 years ago
Thomas Eizinger c32ef92cf5
Simplify code within BobState::EncSigSent
3 years ago
Thomas Eizinger 09e2d5b5d7
Simplify code within BobState::XmrLocked
3 years ago
Thomas Eizinger 776a50137d
Use tokio::select macro instead of function
3 years ago
Thomas Eizinger b1affe3ecf
Insert latest state and call run_until only once
3 years ago
Thomas Eizinger 0d8962762a
Use early return to reduce one level of indentation
3 years ago
Thomas Eizinger 05849505b1
Inline `wait_for_bitcoin_refund`
3 years ago
Thomas Eizinger 8c9285f1f9
Inline step function because it has been reduced to a single statement
3 years ago
Thomas Eizinger afb7e816a1
Don't wait for confirmations again
3 years ago
Thomas Eizinger c92f2dbc77
Move more domain knowledge onto the `TxCancel` type
3 years ago
Thomas Eizinger 75aec95b0c
Introduce monero::TransferRequest
3 years ago
Thomas Eizinger d682433ec9
Move `EventLoopHandle` next to its impl block
3 years ago
Thomas Eizinger e77f1729b4
Move `extract_monero_private_key` onto TxRefund
3 years ago
Thomas Eizinger a1e065b4e7
Simplify racing cancel timelock against learning enc-sig
3 years ago
Thomas Eizinger 575893fb51
Use domain types in fn signature instead of messages
3 years ago
Thomas Eizinger 64b71d0b16
Remove unnecessary pinning
3 years ago
Daniel Karzel 105e291e67 Update the application name for `--version` print
3 years ago
Daniel Karzel 07542d75ac prepare 0.3 release
3 years ago
bors[bot] d487aa3c5b
Merge #327 #330 #331
3 years ago
dependabot[bot] 47544764d9
Bump tokio from 1.0.2 to 1.3.0
3 years ago
bors[bot] 7f6f2408a3
Merge #332
3 years ago
bors[bot] 2c385ee7d9
Merge #321
3 years ago
dependabot[bot] e6fda4a787
Bump base64 from 0.12.3 to 0.13.0
3 years ago
dependabot[bot] 64351a29b5
Bump dialoguer from 0.7.1 to 0.8.0
3 years ago
bors[bot] 113f2fa385
Merge #322
3 years ago
bors[bot] fc28609a96
Merge #323 #324
3 years ago
Thomas Eizinger e54d26b26c
Improve log messages by including PeerId
3 years ago
Thomas Eizinger a57f88d1b4
Properly handle concurrent messages to and from peers
3 years ago
Thomas Eizinger ce78075932
Make Monero and Bitcoin wallet use a generalized sync interval
3 years ago
Thomas Eizinger 09c41f89c4
Rename ExecutionParams to EnvironmentConfig
3 years ago
Thomas Eizinger bc43ed6ebd
Pass execution params directly into wallet for initialization
3 years ago
Thomas Eizinger 7213907a79
Group bitcoin and monero fields together
3 years ago
bors[bot] 95acbc6277
Merge #307
3 years ago
rishflab 8675d88727 Don't wait for tx lock confirmed after broadcast
3 years ago
rishflab f5e6ba18e0 Use different address for redeem and punish
3 years ago
bors[bot] 345bc5b316
Merge #320
3 years ago
bors[bot] 9ed5ca9a04
Merge #317
3 years ago
Thomas Eizinger 9e3a104b42
Disable timestamp if we log to a non-interactive terminal
3 years ago
Thomas Eizinger edb8851ce2
Fix env filter for asb
3 years ago
Thomas Eizinger 273cf15631
Introduce `Watchable` abstraction for Bitcoin wallet
3 years ago
Thomas Eizinger a0830f099f
Pass relevant execution params into wallet instead of via functions
3 years ago
Thomas Eizinger 84ea092a1b
Remove unnecessary state variables by constructing TXs on demand
3 years ago
rishflab e5c0158597
Greatly reduce load onto the Electrum backend
3 years ago
Thomas Eizinger e17cbadccb
Don't add signatures to transaction unless necessary
3 years ago
Thomas Eizinger 6beb732e35
Eliminate `build_bitcoin_punish_transaction`
3 years ago
Daniel Karzel d85c0ce57c Re-introduce punish test
3 years ago
Daniel Karzel ea05c306e0 Alice spawns swaps outside the event loop
3 years ago
Thomas Eizinger dd6c66a594
Move completing of Bitcoin redeem tx onto RedeemTx
3 years ago
rishflab 21429f24b2
Inline wait_for_locked_bitcoin() that is only called once
3 years ago
rishflab 6a3e4802f1
Remove redundant reference
3 years ago
rishflab 458a8d594a
Rename fn param to correctly reflect underlying type
3 years ago
rishflab 752e5be8f3
Cleanup test logging
3 years ago
Thomas Eizinger 2704245ed5
Fix monero refresh interval
3 years ago
bors[bot] a02389f8bd
Merge #314
3 years ago
bors[bot] 8505d76561
Merge #311
3 years ago
Daniel Karzel 0091b6cdaf Remove CLI config file in favour of parameters
3 years ago
Daniel Karzel 442c377490 Remove openssl dependency
3 years ago
Daniel Karzel 58c33f8468 Add asb to release including ARM build
3 years ago
rishflab 7cb198aea1 Remove pointless todo
3 years ago
rishflab 9f534996ee Remove unused capability to configure bitcoind docker version tag
3 years ago
rishflab 7b1d901ea0 Fix incorrectly formatted tag
3 years ago
bors[bot] 009597ac49
Merge #306
3 years ago
Daniel Karzel be52892e65
Monero wallet should not know about all execution params
3 years ago
Thomas Eizinger 82738b111e
Refactor `monero::Wallet::watch_for_transfer` to not use `backoff`
3 years ago
Thomas Eizinger 7e0c44ad1d
Add avg monero block time to execution params
3 years ago
Thomas Eizinger d560e69203
Make durations more readable by using extension methods from `time`
3 years ago
Thomas Eizinger ecff1d1cbe
Remove indirection of constants
3 years ago
Thomas Eizinger bac0f11898
Disable `backoff`s `max_elapsed_time` functionality
3 years ago
Thomas Eizinger 9ad2160c69
Refactor the kraken module to automatically re-connect on errors
3 years ago
Thomas Eizinger c560b3b21a
Introduce `RateUpdate` type alias to reduce duplication
3 years ago
Thomas Eizinger fd5b38739a
Remove constant in favor of inlining string
3 years ago
Thomas Eizinger 142e5e2d3a
Use tracing macros by fully-qualifying them
3 years ago
bors[bot] cc131ecf60
Merge #293
3 years ago
Thomas Eizinger 08923a14f3
Simplify GET request for block tip height
3 years ago
Thomas Eizinger e9d7d9299c
Simplify the GET request to the tx status URL
3 years ago
Thomas Eizinger 418ad7089d
Make tests more readable by following arrange-act-assert
3 years ago
Thomas Eizinger c2329b19a2
Tell the user more about the monero lock transaction
3 years ago
Thomas Eizinger 13c4d29d40
Tell the user immediately how many confirmations we expect
3 years ago
Thomas Eizinger 4883e23dd8
Tell the user for how many confirmations we are waiting
3 years ago
Thomas Eizinger 5d4cf40831
Fix comparison of Monero confirmations
3 years ago
rishflab f92a8ac300 Improve CLI help comments and "type" hints
3 years ago
Daniel Karzel 196557b377 Rename binary to swap
3 years ago
Daniel Karzel f8b61e2e0e Make monero daemon host configurable
3 years ago
Daniel Karzel f091402c7a Remove parameter duplication by introducing structs
3 years ago
Thomas Eizinger c826a28911
Add context if we fail to compute extended private key
3 years ago
Thomas Eizinger 1aa6d177bf
Improve error messages when determining BTC amount to be swapped
3 years ago
Thomas Eizinger 4138039ea0
Make sure all error messages start with an uppercase letter
3 years ago
Thomas Eizinger 816e8b9b96
Add more context to fallible functions inside bitcoin::Wallet
3 years ago
Thomas Eizinger 5c24a46298
Improve error message if stuff fails directly in main
3 years ago
Thomas Eizinger 37f97ac471
Shorten function name
3 years ago
Thomas Eizinger 4f66269887
Move error message on sync _into_ the function
3 years ago
Thomas Eizinger 5953037b81
Don't repeat the module name within the type
3 years ago
Thomas Eizinger 87f928f56c
Move const to function where it is used
3 years ago
Thomas Eizinger 4642e6c0e3
Simplify arguments to `init_XYZ_wallet` functions
3 years ago
Thomas Eizinger d0db6cba10
Favour individual logs over one in main
3 years ago
bors[bot] 2041f367c6
Merge #288
3 years ago
rishflab 754159c9f8 Switch to public stagenet node that works
3 years ago
Thomas Eizinger b178e95f95
Redo layout of eventloop module
3 years ago
Thomas Eizinger 1822886cd0
Provide stronger isolation of kraken module
3 years ago
Thomas Eizinger f6ed4d65b5
Properly deal with additional messages sent from kraken
3 years ago
Thomas Eizinger 7575d412b8
Add kraken_ticker CLI for local testing of the client
3 years ago
Thomas Eizinger 60d6d50246
Extract kraken websocket client into dedicated module
3 years ago
Thomas Eizinger 25c4639689
Prepare for next release
3 years ago
bors[bot] 20f2e56e2d
Merge #271
3 years ago
Daniel Karzel 47a31760c0 Bob can verify the Monero txs by tx-hash
3 years ago
Thomas Eizinger 14dcd150af
Extract `determine_btc_to_swap` function and test it
3 years ago
Thomas Eizinger 601bf07255
Introduce `quote` protocol and display it to the user before they fund
3 years ago
Thomas Eizinger 3da01ea44a
Rename local variables according to new protocol name
3 years ago
Thomas Eizinger ead5db3f45
Re-order fields to group them semantically
3 years ago
Thomas Eizinger bc176bc4fb
Minor import optimizations
3 years ago
Thomas Eizinger 6d9b21cb47
Change `imports_granularity` to module
3 years ago
Thomas Eizinger 2c8200621d
Move `pub use` into pub use block
3 years ago
bors[bot] d1363d130c
Merge #265
3 years ago
Daniel Karzel 7504c6ceee Context for monero address parsing errors
3 years ago
Daniel Karzel 35d0e246d8 Monero address network check
3 years ago