Commit Graph

1027 Commits (master)

Author SHA1 Message Date
Philipp Hoenisch 7fc5a47619
Add checks to max_giveable amount.
3 years ago
Philipp Hoenisch 26e0383e17
Apply suggestions from code review
3 years ago
Philipp Hoenisch fc0cceb180
Toggle json logs using commandline flag.
3 years ago
Philipp Hoenisch 316f95c65b
Always log whole causality chain for errors.
3 years ago
Philipp Hoenisch c011e95062
Improve logging by adding details as fields instead of into the msg.
3 years ago
Philipp Hoenisch 1706b36800
Log exchange rate at each state.
3 years ago
bors[bot] 227c383d76
Merge #481
3 years ago
Daniel Karzel 652aae9590
Introduce a minimum buy amount
3 years ago
Daniel Karzel 6d3cf0af91
Include too low balance into Alice's error
3 years ago
Daniel Karzel 1d62f4916c
Move `max_buy` and `ask_spread` into config
3 years ago
Philipp Hoenisch 330269a1e9
Update assert_weight test to account for a range up to 8 bytes.
3 years ago
Daniel Karzel 538b25a6dd
Only create config-directory on init success
3 years ago
bors[bot] d96e20a5b0
Merge #479
3 years ago
Philipp Hoenisch b5073e3052
Use rust_decimal in estimate_fee function.
3 years ago
Daniel Karzel 23d9637a4b
Work in review comments
3 years ago
Daniel Karzel daa572e5bf
Move recovery commands in dedicated module
3 years ago
Daniel Karzel 4deb96a3c5
ASB manual recovery commands
3 years ago
Daniel Karzel efcd39eeef
Add info messages to each subcommand
3 years ago
Daniel Karzel 0c616c7437
Move loading the state into the function
3 years ago
Daniel Karzel 89b3d07eba
Network protocol tests for spot_price behaviour
3 years ago
Daniel Karzel 03a0dc73cd
Alice's spot_price Behaviour reports back Error
3 years ago
Daniel Karzel 5aac76598d
Decouple ASB/CLI Errors from Error sent over wire
3 years ago
Daniel Karzel 52f648e1de
Alice's spot price logic into dedicated behaviour
3 years ago
Daniel Karzel ea76ae5821
Return proper error to CLI for all expected scenarios
3 years ago
Daniel Karzel f6497778ed
Add resume-only mode for the ASB
3 years ago
Philipp Hoenisch 0090e3b48e
Typo
3 years ago
Philipp Hoenisch 59a55dcbdd
Remove todo for cleanup note.
3 years ago
Philipp Hoenisch e93eeb81a2
Added some proptests.
3 years ago
Philipp Hoenisch 040cce1eb6
Format all the files
3 years ago
Philipp Hoenisch 68ae47edf4
Log error message.
3 years ago
Philipp Hoenisch aebdb063f1
Remove TODO
3 years ago
Philipp Hoenisch 9fb1a43f29
Rename variable.
3 years ago
Philipp Hoenisch cfdbacfbb5
Add comment.
3 years ago
Philipp Hoenisch e69a2c9111
Apply suggestions from code review
3 years ago
Philipp Hoenisch dc8dd5af28
Add relative and absolute max transaction fee.
3 years ago
Philipp Hoenisch dc6ab0fa52
Ensure that constant weights do not go out of sync with code.
3 years ago
Philipp Hoenisch 7fe9087bc2
Pull trait-bounds up one level for easier testing.
3 years ago
Philipp Hoenisch 77f6f11a7f
Pass address/fees into State0 instead of passing in the wallet.
3 years ago
Philipp Hoenisch 14c5a4f025
Add upper bound for bitcoin fees of 100,000 satoshi.
3 years ago
Philipp Hoenisch 46e0449b8e
Add config/argument to swap/asb to configure bitcoin tx fees.
3 years ago
Philipp Hoenisch 9e8b788aa9
Rename weight constants.
3 years ago
Philipp Hoenisch ee90c228b4
Dynamically calculate fees using electrum's estimate_fee.
3 years ago
Philipp Hoenisch 38540b4de5
Dynamically chose fee for TxCancel.
3 years ago
Philipp Hoenisch 1012e39527
Dynamically chose fee for TxRefund and TxPunish.
3 years ago
Philipp Hoenisch d5c1b6693e
Dynamically chose fee for TxRedeem.
3 years ago
Philipp Hoenisch 002e7b38c3
Define TX_FEE within test files only.
3 years ago
Philipp Hoenisch 1db7586632
Increase timeout sending/receiving protocol messages.
3 years ago
bors[bot] e7785d2c83
Merge #434
3 years ago
bors[bot] cf1c448b7c
Merge #460
3 years ago
bors[bot] 1244b30094
Merge #459
3 years ago
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