Rusty Russell
d4178a389c
test/test_state_coverage: more information in error trail.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
bcfd50e28c
test/test_state_coverage: temporarily disable decline test.
It will come back better and stronger, later.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
31459d6cd2
protocol: rename update_complete_htlc to update_fulfill_htlc.
Complete was an overloaded word.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
ca68c5c47f
state: remove non-HTLC updates.
They're still in the base protocol (good for testing), just not here.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
0f4ad940ae
test/test_state_coverage: remove_event / add_event / have_event helpers.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
fbe6e9e0cf
state: allow multiple SPENDTHEM.
Malleability, there could be many of these.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
92bb5f03de
test_state_coverage: fix dependent events.
These tests are wrong, and are handled properly anyway when they
fire (the other one is disabled).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
42bf766d64
state: hand tx explicitly to bitcoin_watch / bitcoin_watch_delayed
Neater than assuming it's effect->broadcast.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
c19839816e
test/test_state_coverage: --dump-states
Simple code to dump the state transitions into text form.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
d88f96de17
test/test_state_coverage: speed up dot diagram generation.
We don't need a full test for this.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
29f22c165d
state: handle simultaneous close.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
066bf1f4e5
test/test_state_coverage: Check for deadlock.
We should always have a packet in flight unless we're in the two
waiting-for-anchor-to-mature states, or at the top of the main loop.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
642c3e36e3
test/test_state_coverage: Check that it terminates.
The state machine is infinite, but if we eliminate the normal inner
state loop, and a couple of other unusual cases where inputs can
repeat, we should be able to traverse it all.
This is slower than simply stopping when we hit a repeated state
though.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
786bef9002
test/test_state_coverage: output dot format.
Good for documentation, plus impressive with all the error states...
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
11f33ad12f
test/test_state_coverage: test the case where we decline an HTLC.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
8308e31d6c
test/test_state_coverage: ensure we produce all output packets.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
f51e9c81bf
test/test_state_coverage: make sure we test all inputs.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
1556315f2e
test_state_coverage: simple exhaustive coverage test for state machine.
Makes sure that we visit every state.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
5730b118f1
Some more ccan objs.
These are LGPL, but only used for tests.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
847ef21c07
state: Core state machine for lightning.
It's written in a repetitive and stylized form, for easier testing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
669479b671
gen_state_names.h: printable names for state_types enums.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
1fca363b31
state_types: types for state machine.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
1b2de5c830
CCAN: add cdump.
Used to print enums.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
3b0aca81f5
CCAN: update.
Trivial updae.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
f0cab4e74b
gather_updates: fix rebase error.
Didn't update amount field in d00eeded9f
.
Didn't compile test either :(
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
8af4619406
Makefile: neaten
Reduces gratuitous patch conflicts in future.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
02a563ba82
protocol: renumber.
Use lower numbers and clean up.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
fefe2deea2
protocol: add a third leg to the close operation.
This gives us a neat way to know the other end has received our sig.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
d00eeded9f
protocol: split message update_remove_htlc into update_timedout_htlc and update_routefail_htlc, remove update_remove_htlc_delay.
For the moment, there's no way to remove an in-progress HTLC before
it's timed out. The other side can remove it with a routefail, but
you can't push for it to be removed.
We may add that later, but by definition it's only a polited request, and
normally we should rely on timeouts.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
807ac38308
protocol: add decline response for HTLC.
We don't have to accept an HTLC they offer; we might not be able to
route it, or it might offer insufficient payment.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
5bc22f0368
protocol: increase HTLC precision to 1/1000 satoshi.
This gets truncated for on-chain transactions (thus, rounding may
contribute to fees).
This also means we currently have an upper bound of 0.04 BTC per HTLC;
this can be increased later if required.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
58a62e782d
bitcoin/script: don't pass value for HTLC script.
We don't need it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
186736050f
test-cli: fix alpha case.
The output of grep confuses the scripts.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
bc056fbc4d
doc/deployable-lightning: point out that Fig 4 is simplified.
Fixes #4
Reported-by: Pierre <pm+lists@acinq.fr>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
71c56e0360
doc: biblopgraphy update
Thanks to Anthony Towns for digging this up.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
9 years ago
Rusty Russell
17471d0788
Merge pull request #3 from pm47/master
explicitely specified proto version
9 years ago
pm47
d97c68717b
explicitely specified proto version
9 years ago
Rusty Russell
785b061034
Merge branch 'pm47-master'
9 years ago
pm47
a97d390128
fixed typos in pdf
9 years ago
Rusty Russell
1cb147c5b8
Version number, name, and build details.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
6883d28f6d
doc: move dual anchor with escapes to Appendix B.
Draft 0.2; we use a single-sided anchor now, for simplicity.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
3311580c62
scripts/test.sh: fix bitcoin case.
Now we use locktime, bitcoin needs delay too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
0b33da08c1
scripts: auto-detect alpha vs bitcoin
A bit hacky, but saves editing two places.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
6cea21750d
HOWTO-USE.md: Just refer to test scripts.
This has fallen behind.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
3b214479ae
test-cli/scripts/test.sh: basic HTLC spending test.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
fcbba0280d
test-cli/create-htlc-spend-tx: new util.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
bafc93886f
test-cli/scripts/test.sh: basic HTLC creation test.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
b5ff69e236
test-cli/update-channel-htlc-remove: new util.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
9b0ed51f2b
test-cli/update-channel-htlc-complete: new util.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago
Rusty Russell
5778b004dd
test-cli/update-channel-htlc: new util.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
10 years ago