Commit Graph

4884 Commits

Author SHA1 Message Date
Rusty Russell 72e7856bf3 hsmd: reorder functions (MOVEONLY).
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-20 09:49:39 +02:00
Rusty Russell e41e1a177e pytest: wait until mock is called for set_feerates.
Got a spurious failure in test_no_fee_estimate; we fired too soon from the logs (presumably
we raced in on the first response, but estimatesmartfee gets called 3 times).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-20 09:12:28 +02:00
Saibato d5c3626fa7 parse autotor: address before separate_address_and_port
this enables addr like --addr=autotor:127.0.0.1 or
--addr=autotor:localhost to just use the default tor service port

Signed-off-by: Saibato <Saibato.naga@pm.me>
2018-09-20 09:09:11 +02:00
Rusty Russell 4198cb34a2 CHANGELOG.md: catchup with changes so far.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-20 05:24:40 +00:00
Simon Vrouwe 94e42f2384 openingd: prioritize incoming peer traffic over handling (and sending out) gossip
- reduces probability for a deadlock where we block on sending data because
  the other peer cannot receive because it blocks on sending data etc.
- when either side sends so much data that it fills up the kernel/network buffer
- however sending out gossip can still block when (malicious) peer never receives
2018-09-20 03:28:42 +00:00
Christian Decker 674d176087 doc: Update docs to remove 100% upper bound
Actual change is in the previous commit.
2018-09-20 02:41:28 +00:00
Christian Decker cf52b7161f json-rpc: Remove upper limit for percentage
The `json_tok_percentage` parser is used for the `fuzzpercent` in `getroute` and
`maxfeepercent` in `pay`. In both cases it seems reasonable to allow values
larger than 100%. This has bitten users in the past when they transferred single
satoshis to things like satoshis.place over a route longer than 2 hops.
2018-09-20 02:41:28 +00:00
Saibato 60b51d29b6 set the tor port also in struct wireaddr
fixes also #1939

Signed-off-by: Saibato <Saibato.naga@pm.me>
2018-09-19 13:48:05 +02:00
Rusty Russell f6fb120e4a lightningd: allow more than one bitcoind request at once, run multiple queues.
With the previous patch, we could still get stuck behind a low-prio
request.  Generalize it into separate queues, and allow more than one
request in parallel.

Worth noting that the test time for `VALGRIND=0 pytest -vx tests/ -n 10`
doesn't change measurably.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-19 13:21:21 +02:00
Rusty Russell e7a0ffca05 lightningd: verbose debugging for bitcoind commands.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-19 13:21:21 +02:00
Rusty Russell 9b8c8f652b lightningd: make bcli_args() helper take ctx.
Otherwise we can get leak complaints: all callers now use tmpctx.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-19 13:21:21 +02:00
Rusty Russell 2cdc5fb964 lightningd: make some bitcoind requests high priority.
fiatjaf has a cheap VPS, connecting remotely to his home bitcoind node.
    fiatjaf's latency on bitcoin-cli getblock is between 10 and 37 seconds.
    fiatjaf's c-lightning node is getting one block per hour.
    fiatjaf is sad.

We single-file our bitcoind requests, because bitcoind has a limited
thread pool and it *fails* rather than queueing if you upset it.  We
probably be fine using separate queues for each command type, but simply
allowing some requests to cut in line should prove my theory that we're
getting stuck behind gossip verification requests.

    fiatjaf now gets one block per 2 minutes.
    fiatjaf is less sad.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-19 13:21:21 +02:00
Rusty Russell 252bbe1d2d pytest: don't wait for sendrawtx, wait for expected tx.
In particular, test_no_fee_estimate was flaky due to seeing the funding
tx being sent.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-19 13:04:01 +02:00
Rusty Russell 7744c41521 listpeers: add 'scratch_txid' for the tx we would broadcast if necessary.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-19 13:04:01 +02:00
Rusty Russell 5f059ef3fe CHANGELOG.md: add Unreleased section at the top.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-19 13:04:01 +02:00
Christian Decker 36eab5de26 pytest: Disable early abort if we run in parallel 2018-09-16 00:05:34 +02:00
Christian Decker f29f92a5fe pytest: Clean up bitcoind_cmd_override, it's no longer used 2018-09-16 00:05:34 +02:00
Christian Decker 9e5d7dacb0 pytest: Use the mock bitcoind everywhere 2018-09-16 00:05:34 +02:00
Christian Decker 16869e3fe6 pytest: Use the bitcoind proxy to mock feerates 2018-09-16 00:05:34 +02:00
Christian Decker aa80a330f1 pytest: Remove auto-proxying in favor of a per-node btc proxy 2018-09-16 00:05:34 +02:00
Christian Decker 2dabc5af93 pytest: Set correct header in mock bitcoind 2018-09-16 00:05:34 +02:00
Christian Decker 74f228deb8 btcproxy: Unpack batched JSON-RPC calls and issue them separately 2018-09-16 00:05:34 +02:00
Christian Decker 88186020e0 pytest: Implement method mocking for ProxiedBitcoinRpc 2018-09-16 00:05:34 +02:00
Christian Decker e132dffa0b pytest: Add an RPC proxy inbetween bitcoind and bitcoin-cli
This is a simple reverse proxy that `bitcoin-cli` can talk to when invoked by
`lightningd`. It allows us to trace `bitcoin-cli` calls, and intercept calls to
mock the replies, better than the current bash-script based method.
2018-09-16 00:05:34 +02:00
Christian Decker 0a5c45e8b1 docker: Prepare builder to include flask and cherrypy
This is in preparation for the next commit.
2018-09-16 00:05:34 +02:00
Christian Decker f505a9418b pytest: Fix lint error 2018-09-16 00:05:34 +02:00
arowser 3372228cad add "io" to -log-level usage 2018-09-14 22:12:13 +02:00
Rusty Russell bcbcf2f0ae lightningd: fix Makefile to remove cruft.
Everything depends on common headers etc, and the HSM_CLIENT_HEADERS was removed
quite a while ago.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-14 22:11:48 +02:00
Rusty Russell 30f129252d wallet: include Makefile from lightningd/Makefile so that lightning headers defined.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-14 22:11:48 +02:00
Rusty Russell c2e56fbb1b wallet: fix Makefile to include correct dependencies.
It didn't depend on its own headers, it should also depend on
lightningd/lightningd.h.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-14 22:11:48 +02:00
Rusty Russell 704d30edce ping: complete JSON RPC ping commands even if one ping gets no response.
We would never complete further ping commands if we had < responses
than pings.  Oops.

Fixes: #1928
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-14 22:11:23 +02:00
alan8325 4a1bc0f90c Add files via upload 2018-09-14 21:20:19 +02:00
Rusty Russell bdb8416446 lightningd: split pidfile handling.
We want to try it before --daemon, in case we error, but we don't know
the pid yet, so we split into 'lock' and 'write'.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-14 21:19:50 +02:00
Christian Decker f1e931f7bb pytest: Fix flaky test_logging
File was rotated away but didn't wait for the first line to be actually written.
2018-09-14 21:19:50 +02:00
Christian Decker 79da1b9aa2 pytest: Keep the test directory even if the failure is in the fixtures 2018-09-14 21:19:50 +02:00
Christian Decker b861e44f36 docker: Add missing dependencies to builder for `a2x` 2018-09-14 21:19:50 +02:00
Christian Decker d9ea2e6b45 master: Move JSON-RPC setup below PID-file creation
If we run two daemons on the same directory we'd be getting the failure from
trying to listen to the same file before we'd hit the pid-file error, which was
causing confusion.
2018-09-14 21:19:50 +02:00
Christian Decker dc88c35d7f channeld: Do not fail if we get a chain_hash we don't know 2018-09-14 21:18:11 +02:00
Christian Decker e10cde3516 chainparams: Remove index from chainparams
We no longer use it to reference chainparams, so we can remove it completely.
2018-09-14 21:18:11 +02:00
Christian Decker f417dfa0e1 chainparams: Always retrieve chainparams by the chain_hash 2018-09-14 21:18:11 +02:00
Christian Decker 2d7e603ac1 chainparams: Move the BOLT2 quote to the chainparams where we set it 2018-09-14 21:18:11 +02:00
Christian Decker 0128bc7362 channeld: Use the chainparams to check msatoshi and funding_satoshi 2018-09-14 21:18:11 +02:00
Christian Decker 2402c524cc channeld: Keep track of the chainparams for the chain we are using 2018-09-14 21:18:11 +02:00
Christian Decker 8d95917e7c chainparams: Add max_funding_satoshi and max_payment_msat to chainparams 2018-09-14 21:18:11 +02:00
Rusty Russell 10167eedd2 wire/gen_peer_wire: Update to BOLTVERSION.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-13 17:38:13 -07:00
Rusty Russell e8a7a7addb wire/Makefile: generate CSVs from specs based on BOLTVERSION.
Not whatever happens to be lying around!

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-13 17:38:13 -07:00
Rusty Russell fc02af12d0 wire: add onion_defs.h to bolt-check, update quote.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-13 17:38:13 -07:00
Rusty Russell fdf67d62ba CHANGELOG.md: update for 0.6.1 final.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2018-09-11 17:02:40 -07:00
lisa neigut cbac5ff19e ping: fix documentation in all remaining places {peerid} -> peer {id} 2018-09-11 16:37:31 -07:00
Wladimir J. van der Laan 84eacaee26 ping: First parameter is called 'id' not 'peerid', fix help
The first argument of 'ping' was documented as 'peerid', however
internally it is expected to be just 'id'.

To avoid breaking the API, opt to fix the documentation.
2018-09-11 14:09:26 -07:00