Commit Graph

6877 Commits

Author SHA1 Message Date
Sebastian Geisler 4c2f51ce13 Fix syntax error in sql-rewrite.py
On python 3.4.2 having kwargs after unpacking
a dict in a function call seems to be a syntax
error.
2019-11-02 16:11:28 +01:00
Rusty Russell fe17acf07b TAGS: reformat to fix when PRINTF_FMT() used.
I was wondering why TAGS was missing some functions, and finally
tracked it down: PRINTF_FMT() confuses etags if it's at the start
of a function, and it ignores the rest of the file.

So we put PRINTF_FMT at the end, but that doesn't work for
*definitions*, only *declarations*.  So we remove it from definitions
and add gratuitous declarations in the few static places.1

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-11-01 17:27:20 -05:00
lisa neigut 7374134dab doc: add reminder to close out Milestone to Making-Releases 2019-11-01 18:55:54 +01:00
lisa neigut 16fde5c79d releases: break up first git tag for verification purposes
I'm not sure what went wrong, but the first RC I cut had some trouble
with the tag being picked up with `git describe`, I think it was missing
a 'tag message'. I'm not sure what caused this.

This commit breaks up the first git tag procedure to have the releaser
verify that the tag command works as intended (and sensitizes them to
checking this for subsequent release cuts, if necessary)
2019-11-01 18:55:54 +01:00
lisa neigut c581fd9956 releases: update with niftynei's notes from release 0.7.3 2019-11-01 18:55:54 +01:00
arowser 82a2c6b02d change psycopg2 to psycopg2-binary 2019-11-01 18:54:57 +01:00
Jorge Timón 61383408a4 pay: Return error when trying to pay to an invoice from unkown or different chain 2019-10-30 13:06:24 -05:00
Rusty Russell 6fa965c6b5 CHANGELOG.md: reset to Unreleased.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-30 12:59:16 -05:00
gorazdko a3851f2943 wallet: always create signatures with low r-value 2019-10-29 18:51:09 -05:00
arowser 67ce27aac7 remove repeat line in doc/requirements.txt 2019-10-29 12:18:45 -05:00
arowser cd894468e7 remove repeat install dependencies 2019-10-29 12:18:45 -05:00
arowser d1060e1b80 .gitignore: Remove devtools/create-gossipstore 2019-10-29 12:18:27 -05:00
arowser 90667a24b6 devtools/.gitignore: Ignore create-gossipstore checkchannels mkquery lightning-checkmessage 2019-10-29 12:18:27 -05:00
gorazdko 35ee800b6e json-rpc: show lightning-dir in getinfo 2019-10-29 12:18:06 -05:00
darosior f690c35883 cleanup lightning-pay
No json.dumps, make bolt11 a required argument (better usage output instead of assertion error)
2019-10-29 12:15:29 -05:00
darosior 8a9650c887 pylightning: reorder imports 2019-10-29 12:15:29 -05:00
lisa neigut 5bc2de8997 update version to 0.7.3 2019-10-28 15:23:37 -05:00
lisa neigut 0cee553ed7 remove reverted feature desc 2019-10-28 15:23:37 -05:00
Rusty Russell 21d2cc663b lightningd: apply feerate changes correctly.
Feerate changes are asymmetric, as they can only be sent by the funder.

For FUNDER, the remote feerate is set when upon send of
commitment_signed, and the local feerate is set on receipt of
revoke_and_ack.

For non-funder, the local feerate is set on receipt of
commitment_signed, and the remote feerate set on send of
revoke_and_ack.  In our code, these two happen together.

channeld gets this right, but lightningd ignored the funder/fundee
distinction, and as a result, receipt of a commitment_signed by the
funder altered fees in the database.  If there was a reconnection
event or restart, then these (incorrect) values would be used, causing
us to complain about a 'Bad commit_sig signature' and close the
channel.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-28 13:07:41 -05:00
Rusty Russell 61e1d6431c pytest: stress fee_update code, trigger bug.
A 'Bad commit_sig signature' was reported by @Javier on Telegram and
@DarthCoin.  This was between two c-lightning peers, so definitely our fault.

Analysis of this message revealed the signature was using the wrong
feerate.  I finally managed to make a test case which triggered this.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-28 13:07:41 -05:00
Rusty Russell f6571460ff configure: fix FreeBSD which has sqlite3 in /usr/local
Fixes: #3080
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-27 21:42:54 -05:00
arowser 0985c6e219 Fix build fail on 32bit OS. 2019-10-23 07:23:33 +11:00
Rusty Russell 4d0c2e93bf common: remove spammy debug msg.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-22 07:05:47 -07:00
lisa neigut d5706b80c0 rc3 2019-10-21 15:29:43 +02:00
Rusty Russell 35bbba68a5 Revert "gossipd: query_messages: fail the connection if peer says it does not have up-to-date infos"
This reverts commit 7fd2f6db6d.

We want to set 'complete' to false in future if we don't know
everything!
2019-10-21 15:28:42 +02:00
Rusty Russell 2801d98e34 pytest: allow bad gossip in test_pay_direct.
Whenever we have multi-connected nodes, out-of-order gossip is possible.
In particular, if a node_announcement is 1 second fresher than the
channel_announcement, a timestamp_filter might get one and not the
other.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-21 14:08:05 +02:00
Rusty Russell bc430cced3 gossipd: fix false-positive memleak detection in pending_node_map.
lightning_gossipd(17421): MEMLEAK: 0x564b4b17b5a8
    ligtning_gossipd(17421):   label=gossipd/routing.c:1490:struct pending_node_announce
    lightning_gossipd(17421):   backtrace:
    lightning_gossipd(17421):     ccan/ccan/tal/tal.c:437 (tal_alloc_)
    lightning_gossipd(17421):     gossipd/routing.c:1490 (catch_node_announcement)
    lightning_gossipd(17421):     gossipd/routing.c:1837 (handle_channel_announcement)
    lightning_gossipd(17421):     gossipd/gossipd.c:238 (handle_channel_announcement_msg)
    lightning_gossipd(17421):     gossipd/gossipd.c:461 (peer_msg_in)
    lightning_gossipd(17421):     common/daemon_conn.c:31 (handle_read)
    lightning_gossipd(17421):     ccan/ccan/io/io.c:59 (next_plan)
    lightning_gossipd(17421):     ccan/ccan/io/io.c:407 (do_plan)
    lightning_gossipd(17421):     ccan/ccan/io/io.c:417 (io_ready)
    lightning_gossipd(17421):     ccan/ccan/io/poll.c:445 (io_loop)
    lightning_gossipd(17421):     gossipd/gossipd.c:1700 (main)
    lightning_gossipd(17421):   parents:
    lightning_gossipd(17421):     gossipd/routing.c:294:struct routing_state

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-21 14:08:05 +02:00
Kristaps Kaupe e16ac08f6f Change order of paragraphs in manpage of fundchannel 2019-10-21 14:01:49 +02:00
Christian Decker 21c8eaf105 pytest: Check for null access warnings in tests 2019-10-21 13:56:10 +02:00
Christian Decker 396e8224fa db: Add a migration to set received_time on forwards in rare cases
The case where this is needed is when the wallet had a forwarded payment
somewhere between commits 66a47d2 (which started tracking forwardings) and
d901304 (which added the `received_time` column). This just emulates the
behavior of sqlite3 for postgres as well.

Signed-off-by: Christian Decker <@cdecker>
2019-10-21 13:56:10 +02:00
Christian Decker 1ecad0cc53 db: Maybe a bit too pedantic?
Checking on whether we access a null field is ok, but should we crash right
away? Probably not. This reduces the access to a warning on sqlite3 and let's
it continue. We can look for occurences and fix them as they come up and then
re-arm the asserts once we addressed all cases.
2019-10-21 13:56:10 +02:00
Christian Decker 712595f0d2 db: Wire in the logs into the database so we can give feedback 2019-10-21 13:56:10 +02:00
lisa neigut f5e4a30c8d add gettext to build release script
new dependency for this build means we need it
2019-10-20 22:33:23 +02:00
Rusty Russell 78c9d69111 gossipd: makes probe larger.
These are fairly cheap, and it's important to make sure we're not
missing gossip.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-18 16:12:42 +02:00
Rusty Russell 4b33b50625 gossipd: ask a peer for *every* channel it knows on startup.
Asking for the last few blocks was logical, but my node is missing
most gossip in practice.

For the moment, simply ask a peer for every channel it knows, once
we're started up.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-18 16:12:42 +02:00
Rusty Russell 79df507442 gossipd: exclude early blocks from random probes.
When probing, no point probing for before lightning became cool.  Current
logic means we often probe below block 500,000, and think things are OK
because there are no short_channel_ids.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-18 16:12:42 +02:00
Christian Decker be49a599bc elements: Do not get upset if we see a confidential asset or value
I made some assumptions that turn out not to be true, mea culpa.
2019-10-18 16:10:17 +02:00
Christian Decker d35ec902f4 elements: Work around libwally getting upset with helpful flags
libwally really is pedantic about the kind of hints it will accept.

Signed-off-by: Christian Decker <@cdecker>
2019-10-18 16:10:17 +02:00
Christian Decker 3c3d7e2df4 connectd: Do not clobber the for-variable when resolving over DNS
We were using `i` as index variable in two nested loops. This works as long as
the DNS seed resolves to a single address, but will crash if the node has both
an A as well as an AAAA entry, at which point we'll try to index the hostname
without a matching entry.

Signed-off-by: Christian Decker <@cdecker>
2019-10-18 14:34:49 +02:00
lisa neigut 6b1b99d7de release 0.7.3 2019-10-18 08:32:15 +02:00
Christian Decker 0a641c9443 pytest: Don't assume UTXO ordering when selecting coins
This was failing because the internal coin-selection doesn't go by insertion
order when using postgres.
2019-10-18 08:29:46 +02:00
Christian Decker ec8d774b29 db: Make column access way more pedantic
We should never access a nulled field, so add an assert to that effect.
2019-10-18 08:29:46 +02:00
Christian Decker 12f40f2227 db: Add _or_default variants for column accesses
We were implicitly relying on sqlite3 behavior that returns the zero-value for
nulled fields when accessing them. This adds the same behavior explicitly to
the DB abstraction in order to reduce `db_column_is_null` checks in the logic,
but still make it evident what is happening here.

Fixes https://github.com/fiatjaf/mcldsp/issues/1

Signed-off-by: Christian Decker <@cdecker>
2019-10-18 08:29:46 +02:00
Christian Decker 894627a287 db: Fix report and commit order for DB transactions
Reported-by: Simon Vrouwe <@SimonVrouwe>
Signed-off-by: Christian Decker <@cdecker>
2019-10-18 08:29:46 +02:00
Christian Decker 2ab56214ca json-rpc: Fix spacing issue in error report
There was a non-breakable space and a missing space in the error message for
missing utxo params.
2019-10-18 08:29:46 +02:00
darosior 4083e077a4 configure: test XChaCha20Poly1305 stream state for HAVE_GOOD_LIBSODIUM
author: @rustyrussell
2019-10-17 23:42:15 +02:00
Rusty Russell 79e2c3f89a gossipd: don't crash if we're forced to discard corrupt gossip store.
When we're in remove_all_gossip, we *don't* call free_chan, but free it
manually.  This trips over the developer-mode check that we called free_chan!
Make it also insert the magic so that destroy_chan_check passes:

lightning_gossipd: gossipd/routing.c:496: destroy_chan_check: Assertion `chan->sat.satoshis == (u64)chan' failed.
lightning_gossipd: FATAL SIGNAL 6 (version v0.7.3rc2-2-gf89d7c1)
0x5632436a4544 send_backtrace
	common/daemon.c:41
0x5632436a45ea crashdump
	common/daemon.c:54
0x7f053c3c7f5f ???
	???:0
0x7f053c3c7ed7 ???
	???:0
0x7f053c3a9534 ???
	???:0
0x7f053c3a940e ???
	???:0
0x7f053c3b9011 ???
	???:0
0x563243698b9d destroy_chan_check
	gossipd/routing.c:496
0x5632436dca46 notify
	ccan/ccan/tal/tal.c:235
0x5632436dcf35 del_tree
	ccan/ccan/tal/tal.c:397
0x5632436dd2c1 tal_free
	ccan/ccan/tal/tal.c:481
0x56324369f004 remove_all_gossip
	gossipd/routing.c:2981
0x563243692f5d gossip_store_load
	gossipd/gossip_store.c:772
0x56324368eff4 gossip_init
	gossipd/gossipd.c:872
0x563243690cbb recv_req
	gossipd/gossipd.c:1580
0x5632436a4a69 handle_read
	common/daemon_conn.c:31
0x5632436cc7ae next_plan
	ccan/ccan/io/io.c:59
0x5632436cd32b do_plan
	ccan/ccan/io/io.c:407
0x5632436cd369 io_ready
	ccan/ccan/io/io.c:417
0x5632436cf52f io_loop
	ccan/ccan/io/poll.c:445
0x56324369102f main
	gossipd/gossipd.c:1700

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2019-10-17 23:40:05 +02:00
darosior f89d7c1d74 hsm encryption: correct salt length 2019-10-17 15:51:55 +02:00
darosior 3c038e4171 hsm encryption: don't include '\n' when deriving the encryption key 2019-10-17 15:51:55 +02:00
lisa neigut f278416708 changelog: update to rc2 2019-10-15 22:38:34 +02:00