333 Commits

Author SHA1 Message Date
Franck Royer
4ed2b5877b
Save Bob state during swap 2020-12-10 17:07:39 +11:00
Franck Royer
ba887fc2e3
Remove generator for bob 2020-12-10 17:07:38 +11:00
Franck Royer
fb3d3c940e
Introduce test where alice restarts before all communications are done 2020-12-10 17:07:38 +11:00
Franck Royer
f56e26f578
Add test where Alice restart after encsign is learned 2020-12-10 17:07:38 +11:00
Franck Royer
968728efbf
Remove unneeded peer id argument 2020-12-10 17:07:38 +11:00
Franck Royer
4bf4f5ba29
Reorder calls 2020-12-10 17:07:38 +11:00
Franck Royer
eca2dff71e
Remove unneeded as_ref_calls 2020-12-10 17:07:38 +11:00
Franck Royer
7535da1413
Scope futures' instanciation 2020-12-10 17:07:37 +11:00
Franck Royer
a67f9c8a27
Introduce test where alice restart mid-swap 2020-12-10 17:07:37 +11:00
Franck Royer
24ddbc7efe
Add zero const to monero::Amount 2020-12-10 17:07:37 +11:00
Franck Royer
23543aa3fa
Save Alice states in db 2020-12-10 16:53:01 +11:00
Franck Royer
b5a80462e9
Extract spend key as soon as possible 2020-12-10 16:53:01 +11:00
Franck Royer
fb83d1fbaf
Refund swap if resumed from a step that requires further communication 2020-12-10 16:53:00 +11:00
Franck Royer
744fc625aa
Remove passing alice peer id
The usage of the peer id is incorrect as we do not even check it when
dialing. For now, we can ignore it.
We can then re-introduce it and use it properly at a later stage.
2020-12-10 14:59:09 +11:00
rishflab
205b879967
Merge pull request #65 from comit-network/eventloop
Drive swarm in separate async task
2020-12-10 14:38:20 +11:00
rishflab
8f5eac8201
Merge pull request #68 from comit-network/ci-time
Improve CI execution time
2020-12-10 14:37:34 +11:00
Franck Royer
43ffccff78
Remove duplicate happy and punish tests 2020-12-10 13:39:18 +11:00
Franck Royer
989d9d08d3
Reduce verbosity of monero block generate trace 2020-12-10 13:39:12 +11:00
rishflab
9ba89194b0 Rename swarm driver to event loop 2020-12-10 13:29:53 +11:00
rishflab
f5d3d54b13 Prevent premature Bob t1 timeout
Bob was hitting the t1 timeout and entering cancel
instead of redeem. This was resolved by increasing
the timeouts to 50.
2020-12-10 13:29:53 +11:00
rishflab
27d1334726 Init Alice behaviour with state0
Previously state0 had to be set after creating Alice's behaviour.
With the event loop we no longer has access to the swarm so
set_state0() has to be called indirectly through a channel. This
means it is difficult to guarantee state0 is being set due to the
asynchronous nature of channels. This was solved by initialising
Alice with state0.
2020-12-10 13:29:53 +11:00
rishflab
3d8866f1a0 Convert event loop to use fused futures select
Co-authored-by: Daniel Karzel <daniel@comit.network>
2020-12-10 13:29:53 +11:00
rishflab
58da1df9dc Create SwarmDriverHandle to resolve ownership issues 2020-12-10 11:24:08 +11:00
rishflab
6f7408ecce Drive swarm in seperate async task
Previously the libp2p swarm had to be manually polled within the
protocol execution code to execute actions such as sending a
message. The swarm is now wrapped in SwarmDriver which polls the
swarm in a seperate task
2020-12-10 11:24:05 +11:00
Franck Royer
2541fad40f
Report times in CI 2020-12-09 17:33:24 +11:00
rishflab
f88ed9183b
Merge pull request #54 from comit-network/bob-unhappy-paths
Punish Test
2020-12-09 15:51:16 +11:00
rishflab
bd8e6e36e0 Fix monero blocktime config 2020-12-09 15:10:29 +11:00
Daniel Karzel
1a2857af29 Properly init tracing per test and reverse the filter to be exclusive
Tracing should be initialized by test and the `_guard` kept alive within the test.
Re-using this code in different tests does not really have any additional value.

Instead of specifying what messages we want to include, I went for a filter that excludes noise.
That way we get more useful logging.
2020-12-09 11:48:53 +11:00
rishflab
883a913f30 Remove nonsensical monero * monero multiplication 2020-12-08 16:12:00 +11:00
Franck Royer
b47c6cad37
Merge pull request #64 from comit-network/bitcoin-harness-rpc-client
Upgrade bitcoin-harness
2020-12-07 14:22:19 +11:00
rishflab
627b1a9f00 Remove unnecessary execution restart 2020-12-07 14:03:50 +11:00
rishflab
8592ef5f79 Address PR feedback
Add context to logging statements. Use amount type for monero in tests. Remove stale
code and comments.
2020-12-07 13:55:13 +11:00
rishflab
282997c105 Make monero finality calculation clearer 2020-12-07 13:43:23 +11:00
Franck Royer
78674818c2
Upgrade bitcoin-harness 2020-12-07 12:31:25 +11:00
Daniel Karzel
84ce9cd27d
Merge pull request #58 from comit-network/feature-anonymity
Add potential feature section on improving anonymity
2020-12-07 11:57:17 +11:00
Franck Royer
5a1fff5ee3
Merge pull request #62 from D4nte/clean-up-versions
Clean-up dep versions
2020-12-07 10:28:24 +11:00
rishflab
b4ac69fa9c Reduce stack size to prevent CI resource issues 2020-12-07 09:44:26 +11:00
rishflab
e4eed7b1a5 Change multiaddr for test runs 2020-12-05 14:06:08 +11:00
rishflab
c91e9652aa Add alice punish test
Use reusable test init functions for happy path test

Extract tracing setup to reusable function

Move test initialization to seperate functions

Increase stack size in CI

Fix monero max finality time

Force Bob swarm polling to send message 2

Run Bob state to xmr_locked in punish test to force the sending of
message2. Previously Bob state was run until btc_locked. Although
this was the right thing to do, message2 was not being sent as the
swarm was not polled in btc_locked. Alice punish test passes.

Add info logging to executor
2020-12-04 17:23:37 +11:00
rishflab
5fef68322a Allow Alice to exit execution at a specified state 2020-12-04 17:16:03 +11:00
rishflab
584cc22024 Allow Bob to exit execution at a specified state 2020-12-04 17:16:03 +11:00
Franck Royer
cfcd1e7170
Clean-up dep versions
- Use bitcoin-harness 0.2
- Use cross-curve-dleq latest master commit
2020-12-04 16:56:08 +11:00
Daniel Karzel
150e5f2aba
Merge pull request #50 from comit-network/b-prototypes
Add B (multi-maker) prototypes to validation doc
2020-12-04 16:47:26 +11:00
Franck Royer
0ce3c54f13
Merge pull request #60 from D4nte/rust-bitcoin-0.25 2020-12-04 13:43:13 +11:00
Franck Royer
247a993b55
Increase regtest timeout values for Linux CI 2020-12-04 12:54:48 +11:00
Franck Royer
624716d8a7
Upgrade rust-bitcoin to 0.25 2020-12-04 08:11:55 +11:00
Franck Royer
fa6b696c45
Merge pull request #53 from D4nte/rishflab-automated 2020-12-03 15:08:41 +11:00
Daniel Karzel
ca74166cc7 Add potential feature section on improving anonymity
Lists Dandelion++ and I2P (community guide) besides Tor.
2020-12-03 13:35:14 +11:00
Franck Royer
c3e43f50aa
Update bitcoin-harness to specific revision 2020-12-02 11:32:34 +11:00
Franck Royer
765482b0aa
Implement wait_for_transaction_finality 2020-12-02 10:02:20 +11:00