lisa neigut
a3ef71b182
devtools: fixup chainparams crash (global now)
5 years ago
lisa neigut
c5e79432e6
devtools: add note when using option-static-remotekey
5 years ago
lisa neigut
3705b5f605
devtools: add privkey+hash printing to mkcommit/mkgossip
We updated the protocol spec tests to verify a sig from a hash
and a private key; this updates mkcommit + mkgossip utilities
to print out the procotol compatible SIG() notation for all signatures.
--verbose will print a computed signature and more data as well.
Also adds --verbose flag to mkgossip.
Changelog-None
5 years ago
Rusty Russell
ce1049115a
channeld: remove chainparams local parameter.
Use global everywhere. This leaks into openingd a little, too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
14a5584b50
devtools/gossipwith: allow setting features on cmdline.
Particularly important when talking with modern lnd, which
will hang up on you if you don't offer feature bit 1!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
2e9b8f42fb
devtools/gossipwith: option to print out messages in hex.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
3437f7e25d
devtools/gossipwith: change timeout to seconds.
I always get this wrong, then wonder why it's dying!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
00cb5adfe6
common: allow subdaemons to specify the node_id in status messages.
This is ignored in subdaemons which are per-peer, but very useful for
multi-peer daemons like connectd and gossipd.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
9dc8cff9b4
devtools/onion: use raw sphinx helper or new style, allow TLV.
This means we can make sphinx_add_v0_hop static, too.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
a76518a029
common/sphinx: rename hop_data to hop_data_legacy.
This highlights the various places we need to change.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Richard Myers
2821187fdc
trim whitespace from end of onion before decoding
5 years ago
Richard Myers
1c6ac953af
fixed to properly pass outgoing cltv to hopdata
5 years ago
Richard Myers
8dbb32afec
fixed generate/decode to use assocdata
5 years ago
Richard Myers
d4c074676e
fixed argv indexes for parsing commands
5 years ago
Rusty Russell
7679f25aec
devtools: fix mkcommit crash.
Needs to initialize global now.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Christian Decker
290b4d68b3
changelog: Add a tool to extract changelog entries from the commits
Since the `CHANGELOG.md` file is a major source for merge conflicts I decided
to build a tiny tool that generates the entries for the changelog
automatically from the commit messages.
5 years ago
Rusty Russell
40d34fed9e
pytest: clean up test_gossip_notices_close now that gossipwith has more options.
And drive-by fix: document that you can now (since
e40f07803c
) use --max-messages=0.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
bb370e66a8
gossipd: handle a "push" marker into the gossip_store.
This tells clients to ignore any timestamp_filter and always
send this message when it sees it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
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.
5 years ago
arowser
90667a24b6
devtools/.gitignore: Ignore create-gossipstore checkchannels mkquery lightning-checkmessage
5 years ago
Rusty Russell
b81ed5be86
devtools: lightning-lightning-checkmessage to validate zbase32 node sigs
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
9d336763ff
devtools/dump-gossipstore: get offets correct when we have DELETED entries.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
38524d907b
devtools/gossipwith: Add timeout for better use in tests.
Useful for testing you *didn't* send anything else.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
72aa83026a
devtools/mkquery: tool to generate gossip query messages.
These helpers would be better autogenerated in python, perhaps as part
of cdecker's pyln package?
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
6dca80a375
checkchannels tool.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
722b4942ed
common: rename decode_short_channel_ids.{c,h} to decode_array.{c.h}
This encoding scheme is no longer just used for short_channel_ids, so make
the names more generic.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
2a74d53841
Move gossip_constants.h into common/
Turns out we weren't checking the BOLT comments before, so they
needed an overhaul.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Christian Decker
2ddf168d59
db: Implement SQL statement rewriting
We now have an abstract rewriter that will perform some common extractions and
replacements (type replacement for example), that can then be customized in
derived classes.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
5 years ago
Christian Decker
640e64cb73
db: Switch statement lookup to use the original query instead
Using a generated identifier with filename and line proved to be brittle since
compilers assign the __LINE__ macro differently on multi-line macro
invocations.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
5 years ago
Christian Decker
bf613fa48a
postgres: Add postgres statement rewriting support
Signed-off-by: Christian Decker <decker.christian@gmail.com>
5 years ago
Rusty Russell
895e552475
BOLT: update to master with gossip_queries_ex.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
f4e7ed179f
devtools/mkencoded: tool to encode short_channel_id / other for testing
In particular, it does zlib.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
8ef996d56e
devtools/mkgossip: tool to create gossip msgs for testing.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
5592cfb174
devtools/dump-gossipstore: add flag to show deleted entries.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
87f0ee6351
channeld: set option_static_remotekey when negotiated.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
c99906a9a9
per-peer-daemons: tie in gossip filter.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
aca2e4f722
common/memleak: add dynamic hooks for assisting memleak.
Rather than reaching into data structures, let them register their own
callbacks. This avoids us having to expose "memleak_remove_xxx"
functions, and call them manually.
Under the hood, this is done by having a specially-named tal child of
the thing we want to assist, containing the callback.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
acf3952acc
JSON: remove handling of pre-Adelaide (B:T:N) short_channel_ids.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
a134062f98
bolt11: handle `9` fields for new features.
This implements https://github.com/lightningnetwork/lightning-rfc/pull/656
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Christian Decker
70e8da4fbd
wallet: Add read-only flag to extracted queries
This gets rid of the two parallel execution paths of read-only and write
queries, by explicitly stating with each query whether it is a read-only
query, we only need to remember the ones marked as write queries.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
6 years ago
Christian Decker
e4ab98459c
wallet: Add tooling to extract SQL queries and generate driver info
This is the counterpart of the annotations we did in the last few commits. It
extracts queries, passes them through a driver-specific query rewriter and
dumps them into a driver-specific query-list, along with some metadata to
facilitate processing later on. The generated query list is then registered as
a `db_config` and will be loaded by the driver upon instantiation.
Signed-off-by: Christian Decker <decker.christian@gmail.com>
6 years ago
Rusty Russell
2600a6ed2e
channeld: get current block height when an HTLC fails.
We need it to put in the error code for
WIRE_INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
9dd314226d
devtools/mkclose: make a mutual close transaction.
Guess who's been writing gossip protocol tests?
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
39b34a35c8
bitcoin/tx.c: don't free witness implicitly.
This causes a crash in mkfunding, which didn't expect it:
$ devtools/mkfunding 16835ac8c154b616baac524163f41fb0c4f82c7b972ad35d4d6f18d854f6856b 1 0.01btc 253 76edf0c303b9e692da9cb491abedef46ca5b81d32f102eb4648461b239cb0f99 0000000000000000000000000000000000000000000000000000000000000010 0000000000000000000000000000000000000000000000000000000000000020
# funding sig: 798d96d5a057b5b7797988a855217f41af05ece3ba8278366e2f69763c72e78565d5dd7eeddc0766ddf65557c92b9c52c301f23f94d2cf681860d32153e6ae1e
# funding witnesses: [
Aborted (core dumped)
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
e40f07803c
devtools/gossipwith: allow --max-messages=0 to avoid reading msgs at all.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
Rusty Russell
f1e84b3d99
devtools: make clean should remove devtools/gen_print_onion_wire.[c,h,o]
Reported-by: @JavierRSobrino
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
5 years ago
lisa neigut
0acdeeec06
fixup mkcommit's reverse ordered chainparams
5 years ago
lisa neigut
c7f3fa34b2
funding tx: include segwit marker + flag in fee calculation
Noticed an off by one error when running tests for dual-funding;
we're not including the two 'header' segwit bytes in our weight
calculations.
5 years ago
lisa neigut
b0b6ddb66f
devtools: rm repetitive field (it's included in remotesecrets)
5 years ago
lisa neigut
abcde461df
devtools: print witnesses along with signatures for mkfunding
we need the witnesses for dual-funding transactions
5 years ago