Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.8.0 #19

Merged
merged 307 commits into from
Dec 17, 2019
Merged

0.8.0 #19

merged 307 commits into from
Dec 17, 2019
This pull request is big! We’re only showing the most recent 250 commits.

Commits on Nov 12, 2019

  1. pyln: Default to DEVELOPER=0 when running outside of tree

    `DEVELOPER=1` assumes that the binary has been compiled with developer set to
    true, which might not be the case for plugin developers. Setting this to 0 by
    default has no effect in c-lightning since we always at least set it in
    `config.vars` but may prevent some issues outside.
    cdecker committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    53a2789 View commit details
    Browse the repository at this point in the history
  2. pyln: Move RPC and daemon instantiation into the LightningNode

    We were relying heavily on NodeFactory to do some magic before instantiating
    the Node with rpc and daemon initialized, that meant that we'd have to replace
    all 3 classes when customizing the node to our needs. Moving that
    initialization into the node itself means that the LightningNode class now can
    be swapped out and customized, without having to wire everything else through.
    cdecker committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    bc9b1c4 View commit details
    Browse the repository at this point in the history
  3. pyln: Allow users to override the LightningNode class

    Quite a few of the things in the LightningNode class are tailored to their use
    in the c-lightning tests, so I decided to split those customizations out into
    a sub-class, and adding one more fixture that just serves the class. This
    allows us to override the LightningNode implementation in our own tests, while
    still having sane defaults for other users.
    cdecker committed Nov 12, 2019
    Configuration menu
    Copy the full SHA
    9378be7 View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2019

  1. devtools: fix mkcommit crash.

    Needs to initialize global now.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    7679f25 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6f215a7 View commit details
    Browse the repository at this point in the history
  3. addr: handle P2SH/P2PKH in scriptpubkey encoding

    Previously, returned null if a scriptpubkey was not Segwit; now
    handles encoding to Base58 for other types.
    niftynei authored and rustyrussell committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    963a1da View commit details
    Browse the repository at this point in the history
  4. listpeers: show close_to address

    If a 'upfront_shutdown_script' was specified, show the address +
    scriptpubky in `listpeers`
    
    Changelog-added: JSON API: `listpeers` channels now include `close_to` and `close_to_addr` iff a `close_to` address was specified at channel open
    niftynei authored and rustyrussell committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    a333df4 View commit details
    Browse the repository at this point in the history
  5. dev: add option flag for specifying temporary channel id

    --dev-force-tmp-channel-id flag takes a 64-character hex string
    to use as the temporary channel id. Useful for spec tests
    
    [ Fixed crash in non-DEVELOPER mode --RR ]
    Changelog-None
    niftynei authored and rustyrussell committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    28cdccf View commit details
    Browse the repository at this point in the history
  6. pytest: fix make pytest

    Travis adds the correct PYTHONPATH, but "make check" doesn't.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 13, 2019
    Configuration menu
    Copy the full SHA
    eaa72ed View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2019

  1. Configuration menu
    Copy the full SHA
    d4c0746 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8dbb32a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1c6ac95 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2821187 View commit details
    Browse the repository at this point in the history
  5. common/sphinx: rename hop_data to hop_data_legacy.

    This highlights the various places we need to change.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    a76518a View commit details
    Browse the repository at this point in the history
  6. common/sphinx: handle decoding of TLV payload.

    We add routines to decode the expected fields from both legacy and tlv
    hop formats.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    b7bbccd View commit details
    Browse the repository at this point in the history
  7. lightningd: handle tlv-style payloads.

    Signed-off-by: Rusty Russell <[email protected]>
    Changelog-changed: JSON API: `htlc_accepted` hook has `type` (currently `legacy` or `tlv`) and other fields directly inside `onion`.
    Changelog-deprecated: JSON API: `htlc_accepted` hook `per_hop_v0` object deprecated, as is `short_channel_id` for the final hop.
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    2a22590 View commit details
    Browse the repository at this point in the history
  8. gossipd: add hop-style to nodes to mark whether they speak TLV onion.

    We keep the feature bitmap on disk, so we cache this in the struct
    explicitly.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    3a25e9b View commit details
    Browse the repository at this point in the history
  9. lightningd: move json_add_route into gossip_control.c and make static.

    There's only one caller.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    997e3f7 View commit details
    Browse the repository at this point in the history
  10. lightningd: expose/accept "style" parameter in routes.

    Default is legacy.  If we have future styles, new strings can be defined,
    but for now it's "tlv" or "legacy".
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    c83834c View commit details
    Browse the repository at this point in the history
  11. sphinx: separate nonfinal from final interface, add tlv option.

    For legacy, they were the same, but for TLV we care whether it's the
    final hop or not.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    0211712 View commit details
    Browse the repository at this point in the history
  12. 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 <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    9dc8cff View commit details
    Browse the repository at this point in the history
  13. features: set OPT_VAR_ONION (bit 9) iff EXPERIMENTAL_FEATURES

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    bb06bec View commit details
    Browse the repository at this point in the history
  14. tests: test that we only use tlv onion when advertized.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    21555b2 View commit details
    Browse the repository at this point in the history
  15. dev: add option to prevent HTLC timeouts.

    This is required for the protocol tests, which can be slow.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    323e4f6 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    39fa486 View commit details
    Browse the repository at this point in the history
  17. Revert "docker: Use system libraries, don't bring your own"

    This reverts commit 48728d3.
    NicolasDorier authored and cdecker committed Nov 14, 2019
    Configuration menu
    Copy the full SHA
    0d55dca View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2019

  1. Configuration menu
    Copy the full SHA
    ed23875 View commit details
    Browse the repository at this point in the history
  2. wallet: fix skipping tx dups memory corruption

    Changelog-Fixed: ElementsProject#3231 listtransactions crash
    m-schmoock authored and rustyrussell committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    fe4a25a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d7609e6 View commit details
    Browse the repository at this point in the history
  4. gossipd: don't discard node_announcements with old timestamps.

    It really, really doesn't matter.  But we were dramatically reducing
    our view of the network:
    
    In my gossip_store (mainnet):
      channel_announcement: 30349
      channel_update: 55119
      node_announcment: 1783
    
    Changelog-Fixed: No longer discard most node_announcements (fixes ElementsProject#3194)
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    fdd69af View commit details
    Browse the repository at this point in the history
  5. bitcoind: remove the chainparams member

    We now have a global constant, prefer to use it instead of having
    two variables with the same utility.
    darosior authored and cdecker committed Nov 15, 2019
    Configuration menu
    Copy the full SHA
    f075b87 View commit details
    Browse the repository at this point in the history

Commits on Nov 17, 2019

  1. lightningd: fix uninitialized variable

    ==1310== Conditional jump or move depends on uninitialised value(s)
    ==1310==    at 0x127C7F: io_loop_with_timers (io_loop_with_timers.c:30)
    ==1310==    by 0x14F0E1: plugins_init (plugin.c:1019)
    ==1310==    by 0x12E4B1: main (lightningd.c:694)
    ==1310==
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 17, 2019
    Configuration menu
    Copy the full SHA
    7f0a366 View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2019

  1. doc/lightningd-config.5.txt: remove

    Replaced by doc/lightningd-config.5.md.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    b0a72a6 View commit details
    Browse the repository at this point in the history
  2. lightningd: have optional node_id associated with subdaemons.

    We'll use this for logging it.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    4fa7b30 View commit details
    Browse the repository at this point in the history
  3. lightningd: have logging include an optional node_id for each entry.

    A log can have a default node_id, which can be overridden on a per-entry
    basis.  This changes the format of logging, so some tests need rework.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    e433d4d View commit details
    Browse the repository at this point in the history
  4. 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 <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    00cb5ad View commit details
    Browse the repository at this point in the history
  5. connectd, gossipd: use per-peer logging.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    eed654f View commit details
    Browse the repository at this point in the history
  6. lightningd: move log structs into log.c.

    Simply better encapsulation.   We still need to expose log_entry, since the
    notification hook uses it though.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    3270e5c View commit details
    Browse the repository at this point in the history
  7. lightningd: remove per-peer log book.

    We had a separate logbook for each peer, and copy log entries above
    the printable log level into the master logbook.  This didn't always
    work well, since we didn't dump it on crash for example.
    
    Keep a single global logbook instead, and remove this infrastructure.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    86fb54a View commit details
    Browse the repository at this point in the history
  8. log: make formatting more consistent.

    1. Printed form is always "[<nodeid>-]<prefix>: <string>"
    2. "jcon fd %i" becomes "jsonrpc #%i".
    3. "jsonrpc" log is only used once, and is removed.
    4. "database" log prefix is use for db accesses.
    5. "lightningd(%i)" becomes simply "lightningd" without the pid.
    6. The "lightningd_" prefix is stripped from subd log prefixes, and pid removed.
    
    Signed-off-by: Rusty Russell <[email protected]>
    Changelog-changed: Logging: formatting made uniform: [NODEID-]SUBSYSTEM: MESSAGE
    Changelog-removed: `lightning_` prefixes removed from subdaemon names, including in listpeers `owner` field.
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    ef7a820 View commit details
    Browse the repository at this point in the history
  9. options: allow --log-level <level>:<prefix> for finegrained log control.

    This allows finegrained logging control of particular subdaemons or
    subsystems.
    
    To do this, we defer setting the logging levels for each log object
    until after early argument parsing (since e.g. "bitcoind" log object
    is created early).
    
    Signed-off-by: Rusty Russell <[email protected]>
    Changelog-changed: Options: log-level can now specify different levels for different subsystems.
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    0607f99 View commit details
    Browse the repository at this point in the history
  10. lightningd: enable io logging on subdaemons iff we're going to print it.

    This simplifies our tests, too, since we don't need a magic option to
    enable io logging in subdaemons.
    
    Note that test_bad_onion still takes too long, due to a separate minor
    bug, so that's marked and left dev-only for now.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    4fc498f View commit details
    Browse the repository at this point in the history
  11. lightningd: avoid keeping multiple copies of nodeid.

    Simple refcount FTW.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    0c6d899 View commit details
    Browse the repository at this point in the history
  12. lightningd: perform better log pruning.

    1. Don't prune the last 10%.
    2. Be more aggressive on pruning IO and DEBUG.
    3. Account for skipped entries correctly across multiple prunes.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    a83fd16 View commit details
    Browse the repository at this point in the history
  13. lightningd: remove log_add functions.

    They added complexity, and were only used in a few places.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    39d537b View commit details
    Browse the repository at this point in the history
  14. lightningd: use a simple array for less memory usage.

    The tal overhead of 5 pointers, the linked list node is 2; and we also
    tal'd the string.  That's 96 bytes per entry.
    
    Use a simple array instead, though it means more work on deletion
    since each log_entry is no longer a tal object.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    b210c9d View commit details
    Browse the repository at this point in the history
  15. pytest: deflake test_htlc_send_timeout

    We can definitely get a pong from l1 (should test be slow enough):
    it's l3 we are concerned about.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    f91ff99 View commit details
    Browse the repository at this point in the history
  16. lightningd: kill per-peer daemons if they claim a different peer id.

    Suggested-by: @cdecker
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    24f708e View commit details
    Browse the repository at this point in the history
  17. logging: add examples for logging.

    As suggested by @cdecker, but also did a bit of minor reformatting.
    
    I don't like the excessive indenting in our man pages though,
    but that's a separate problem.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    0aad532 View commit details
    Browse the repository at this point in the history
  18. logging: remove spaces from subsystem names.

    Spaces just make life a little harder for everyone.
    
    (Plus, fix documentation: it's 'jsonrpc' not 'json' subsystem).
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    709c98f View commit details
    Browse the repository at this point in the history
  19. devtools/gossipwith: change timeout to seconds.

    I always get this wrong, then wonder why it's dying!
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    3437f7e View commit details
    Browse the repository at this point in the history
  20. devtools/gossipwith: option to print out messages in hex.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    2e9b8f4 View commit details
    Browse the repository at this point in the history
  21. 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 <[email protected]>
    rustyrussell authored and cdecker committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    14a5584 View commit details
    Browse the repository at this point in the history
  22. gossipd: work around LND reply_channel_range.

    We've been sending them errors for invalid replies; instead, this works
    around it.
    
    Changelog-Added: Workaround LND's reply_channel_range issues instead of sending error.
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    6e433e0 View commit details
    Browse the repository at this point in the history
  23. Configuration menu
    Copy the full SHA
    68b9ded View commit details
    Browse the repository at this point in the history
  24. plugin: Pass the full raw_payload including realm to htlc_accepted

    So far we've only handled legacy payloads, which meant we could drop the realm
    byte since it was always 0x00. Once we start handling TLV payloads the first
    byte, i.e., the former realm byte, is important since it gives us the length
    of the payload. This is a breaking change, however I don't think there's
    anyone using the `raw_payload` as of yet.
    
    Changelog-Changed: JSON-RPC: the `raw_payload` now includes the first byte, i.e., the realm byte, of the payload as well. This allows correct decoding of a TLV payload in the plugins.
    cdecker committed Nov 18, 2019
    Configuration menu
    Copy the full SHA
    dda792c View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2019

  1. .gitignore: add tools/hsmtool

    jsarenik authored and cdecker committed Nov 19, 2019
    Configuration menu
    Copy the full SHA
    69040e5 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2019

  1. onion fixup: use enum for type, not length of packet

    We should be using the enum here, not the length of the payload
    niftynei authored and cdecker committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    ea9faf6 View commit details
    Browse the repository at this point in the history
  2. Add cross-compilation options only when requested (ElementsProject#3275)

    Requesting them is done by setting BUILD=<target_arch>
    
    Otherwise autotools (used by external dependencies like
    libsodium) is not happy with setting cross-compilation
    variables and may possibly lead to unexpected results.
    jsarenik authored and cdecker committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    170918f View commit details
    Browse the repository at this point in the history
  3. gossipd: remove chainparams local var.

    We have a global, let's use it.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    5a95e9f View commit details
    Browse the repository at this point in the history
  4. channeld: remove chainparams local parameter.

    Use global everywhere.  This leaks into openingd a little, too.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    ce10491 View commit details
    Browse the repository at this point in the history
  5. lightningd: remove chainparams local parameter from wallet.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 20, 2019
    Configuration menu
    Copy the full SHA
    edbcb6f View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2019

  1. dump_tx: fixup compiliation errs

    When we refactored bitcoin_tx to use wally_tx, this (uncompiled)
    debug statement rotted. This unrots it.
    niftynei authored and rustyrussell committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    861b12b View commit details
    Browse the repository at this point in the history
  2. 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
    niftynei authored and rustyrussell committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    3705b5f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c5e7943 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a3ef71b View commit details
    Browse the repository at this point in the history
  5. gossipd: don't crash if we have > 7000 stale short_channel_ids.

    Fixes: ElementsProject#3269
    Signed-off-by: Rusty Russell <[email protected]>
    Changelog-Fixed: gossipd crash on huge number of unknown channels.
    rustyrussell committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    d119758 View commit details
    Browse the repository at this point in the history
  6. pytest: test that we refuse to follow bitcoind backwards.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    d4b48a6 View commit details
    Browse the repository at this point in the history
  7. lightningd: don't start if bitcoind is behind.

    This leads to all sorts of problems; in particular it's incredibly
    slow (days, weeks!)  if bitcoind is a long way back.  This also changes
    the behaviour of a rescan argument referring to a future block: we will
    also refuse to start in that case, which I think is the correct behavior.
    
    We already ignore bitcoind if it goes backwards while we're running.
    
    Also cover a false positive memleak.
    
    Changelog-Fixed: If bitcoind goes backwards (e.g. reindex) refuse to start (unless forced with --rescan).
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 21, 2019
    Configuration menu
    Copy the full SHA
    654faa6 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2019

  1. openchannel hook: add new close_to field

    Rounds out the application of `upfront_shutdown_script`, allowing
    an accepting node to specify a close_to address.
    
    Prior to this, only the opening node could specify one.
    
    Changelog-Added: Plugins: Allow the 'accepter' to specify an upfront_shutdown_script for a channel via a `close_to` field in the openchannel hook result
    niftynei authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    de16d0f View commit details
    Browse the repository at this point in the history
  2. pytest: Skip mem-leak test when not running in developer mode

    We were skipping it when running under valgrind, but not if not in developer,
    which is required to have access to `dev-*` methods.
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    1e89937 View commit details
    Browse the repository at this point in the history
  3. pytest: Fix a test assuming a specific DB order

    Postgresql does not guarantee insertion order when querying, so we need to
    actually go and look for the correct transaction.
    
    Signed-off-by: Christian Decker <[email protected]>
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    3482d25 View commit details
    Browse the repository at this point in the history
  4. pytest: Fix TLV hook tests in experimental mode

    I missed this test breaking with `EXPERIMENTAL_FEATURES` in ElementsProject#3261
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    5a233a1 View commit details
    Browse the repository at this point in the history
  5. github: Mark derived doc files as generated

    This should prevent Github from showing the diffs by default, they'd be
    duplicates of the changes in the .md files anyway.
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    162cea2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    2255024 View commit details
    Browse the repository at this point in the history
  7. tlv: Add typesafe fromwire codegen for TLV namespaces

    We were weaving in and out of generic code through `fromwire_tlvs` with custom
    parameters defining the types in that namespace. This hard-wires the parser
    with the namespace's types. Slowly trying to deprecate `fromwire_tlvs` in
    favor of this typesafe variant.
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    5794c83 View commit details
    Browse the repository at this point in the history
  8. tlv: Add validity check codegen for the tlv namespaces

    Since the parser itself just parses and doesn't include validation anymore we
    need to put that functionality somewhere. The validation consists of enforcing
    that the types are in monotonically increasing order without duplicates and
    that for the even types we know how to handle it.
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    2519f93 View commit details
    Browse the repository at this point in the history
  9. sphinx: Use the new fromwire_tlv_payload function

    We wire in the code-generated function, which removes the upfront validation
    and add the validation back after the `htlc_accepted` hook returns. If a
    plugin wanted to handle the onion in a special way it'll not have told us to
    just continue.
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    d69a437 View commit details
    Browse the repository at this point in the history
  10. sphinx: Decode payload and place shortcuts in the route-step

    We'll need to pass them around anyway, so just make them easier to access by
    doing a bit more to `process_onionpacket`.
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    baffa84 View commit details
    Browse the repository at this point in the history
  11. htlcs: Make necessary payload fields optional and derfer validation

    We make the fields in `htlc_accepted_payload` optional (NULL if not present in
    the payload) and defer validation till after the hook call.
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    fc14e5e View commit details
    Browse the repository at this point in the history
  12. htlc: Consolidate validation after the htlc_accepted hook returns

    This now enforces all rules for validity, both for the TLV format and checking
    that the required fields have been provided.
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    d7b28ac View commit details
    Browse the repository at this point in the history
  13. sphinx: Cleanup route_step_decode_* functions

    We have consolidated the two functions into a single `route_step_decode`
    function, and made it static since we call it in the `process_onionpacket`
    function. We remove the two exposed functions since they're no longer useful.
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    e46f423 View commit details
    Browse the repository at this point in the history
  14. htlc: Add a checker function tellung us whether we can continue

    This function ensures we have all the infos we need to continue if the
    htlc_accepted hook tells us to. It also enforces well-formedness of the TLV
    payload if we have a TLV payload.
    
    Suggested-by: List Neigut <@niftynei>
    Signed-off-by: Christian Decker <@cdecker>
    cdecker authored and rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    d1df4d6 View commit details
    Browse the repository at this point in the history
  15. channeld: allow transient negative balance.

    Travis randomly picked up an error in test_feerate_stress:
    **BROKEN** 0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518-channeld-chan#1: Cannot add htlc #0 10000msat to LOCAL (version a2541b9-modded)
    
    This is because it hit an unlikely corner case involving applying multiple HTLCs
    (similar to the previous c96cee9).
    
    In this case, the test sends a 500,000,000 "balancing" setup payment L1->L2.
    It waits for L2 to get the preimage (which is the when pay() helper returns),
    but crucially, it starts spamming with HTLCs before that HTLC is completely
    removed.
    
    From L2's point of view, the setup HTLC is in state RCVD_REMOVE_REVOCATION;
    gone from L1's commitment tx, but still waiting for the commitment_signed
    from L1 to remove it from L2's.
    
    Note that each side keeps a local and remove view of both sides' current
    balances: at this point, L2's view is REMOTE: "500,000,000 to L1, 499,900,000
    to L2", LOCAL: "500,000,000 to L1, 0 to L2".
    
    L2 sends a 10,000 msat HTLC to L1: legal, since L1 will allow it,
    then the commitment_signed.  L1 sends the revoke-and-ack for this,
    *then* belatedly follows with the commitment_signed which both completes the
    removal of the setup HTLC and adds the new one.
    
    But L2 processes the HTLCs in hashtable (i.e. random) order: so if it
    tries to apply its own HTLC first, it freaks out because it doesn't have
    funds in its local view.
    
    Signed-off-by: Rusty Russell <[email protected]>
    Changelog-Fixed: Unlikely corner case is simultanous HTLCs near balance limits fixed.
    rustyrussell committed Nov 22, 2019
    Configuration menu
    Copy the full SHA
    6defc69 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2019

  1. config: Add include directive support.

    Signed-off-by: Rusty Russell <[email protected]>
    Changelog-Added: Config: configuration files now support `include`.
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    34c89cb View commit details
    Browse the repository at this point in the history
  2. lightningd: don't use chainparams before param() call in json_fund_ch…

    …annel_start
    
    With coming changes, this will segfault if we access it when param
    code is trying to get usage from functions.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    5673607 View commit details
    Browse the repository at this point in the history
  3. lightningd: move basic parameter parsing into common/configdir

    lightning-cli is going to need to know what network we're on, so
    it will need to parse the config files.  Move the code which does
    the initial bootstrap parsing into common, as well as the config
    file parsing core.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    8b1aa3e View commit details
    Browse the repository at this point in the history
  4. config: Read both top-level and network-subdir config files.

    This lets you have a default, but also a network-specific config.
    
    Signed-off-by: Rusty Russell <[email protected]>
    Changelog-changed: Options: `config` and <network>/`config` read by default.
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    dc23c30 View commit details
    Browse the repository at this point in the history
  5. lightningd: change config-dir from plugin / wallet / hsm POV into <ne…

    …twork> subdir
    
    Changelog-changed: .lightningd plugins and files moved into <network>/ subdir
    Changelog-changed: WARNING: If you don't have a config file, you now may need to specify the network to lightning-cli
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    aab83e7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d512bcb View commit details
    Browse the repository at this point in the history
  7. common: parse --allow-deprecated-apis extremely early.

    We're going to want this for changing the default network.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    a56f2b2 View commit details
    Browse the repository at this point in the history
  8. common: change default network from testnet to mainnet for new installs.

    Changelog-changed: Default network (new installs) is now bitcoin, not testnet.
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    36c517b View commit details
    Browse the repository at this point in the history
  9. config: explicitly disallow nonsensical options.

    1. "conf" can't be specified in a configuration file.
    2. "lightning-dir" can't be specified in a configuration file unless the file
       was explicitly set with --conf=.
    3. "network" options can't be set in a per-network configuration file.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    e3dbd78 View commit details
    Browse the repository at this point in the history
  10. lightningd: keep pid files in top-level config dir.

    They're already qualified with network name, and there's little point
    moving them; it might even be dangerous if multiple are running.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    747bb99 View commit details
    Browse the repository at this point in the history
  11. pytest: test for config parsing errors.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    57a32ee View commit details
    Browse the repository at this point in the history
  12. log: print UNUSUAL messages before log initialization too.

    Otherwise we don't print out the upgrading messages when we move things!
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    a06fa7f View commit details
    Browse the repository at this point in the history
  13. pytest: upgrade tests.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    badeaf1 View commit details
    Browse the repository at this point in the history
  14. config: limit depth on includes.

    Don't spend too much effort on it, but this is better than running out
    of memory and crashing.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    f5831e5 View commit details
    Browse the repository at this point in the history
  15. lightningd: fix handling of truncated config options.

    Do the same thing '--help' does with them; append `...`.
    
    Valgrind noticed that we weren't NUL-terminarting if answer was over
    78 characters.
    
    Changelog-Fixed: JSONRPC: listconfigs appends '...' to truncated config options.
    rustyrussell committed Nov 23, 2019
    Configuration menu
    Copy the full SHA
    14997f6 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2019

  1. Spec: trivial update to latest.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    fb040bc View commit details
    Browse the repository at this point in the history
  2. lightningd: remove redundant htlc_accepted_hook_payload fields

    Now we cache them in the route_step, don't need to copy them here.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    50d6941 View commit details
    Browse the repository at this point in the history
  3. spec: update to experimental BOLTs with secret/total_amount.

    Also pulls in a new onion error (mpp_timeout).  We change our
    route_step_decode_end() to always return the total_msat and optional
    secret.
    
    We check total_amount (to prohibit mpp), but we do nothing with
    secret for now other than hand it to the htlc_accepted hook.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    ebac3d2 View commit details
    Browse the repository at this point in the history
  4. common: make BOLT11 use the normal feature array.

    This was decided at a recent spec meeting: in particular, mpp and
    var_onion_optin options will be used here.
    
    We enhanced "features_supported" into "features_unsupported" so it
    can return the first un-handlable bit number.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    09cdbb7 View commit details
    Browse the repository at this point in the history
  5. wallet: add invoice features into db.

    In a future version, we will use features to insist that payers
    provide the secret.  In transition, we may have old invoices which
    didn't insist on that, so we need to know this on a per-invoice basis.
    
    Not sure if I got the right syntax for adding an empty blob though!
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    81c89aa View commit details
    Browse the repository at this point in the history
  6. common/bolt11: add secret support.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    854c64f View commit details
    Browse the repository at this point in the history
  7. JSON: add payment_secret parameter to sendpay.

    This is not documented yet, since it's ignored unless EXPERIMENTAL_FEATURES
    is set.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    dfb1f6a View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    18e9144 View commit details
    Browse the repository at this point in the history
  9. lightningd: add secrets (and associated feature) to invoices.

    We don't need a new db column, since we can just derive the secret from
    the preimage as required.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    c2e8531 View commit details
    Browse the repository at this point in the history
  10. lightningd: check payment secret on htlc receipt.

    We don't set the secret to compulsory (yet!) but put code in for the
    future.  Meanwhile, if there is a secret, check it is correct.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    e5247a6 View commit details
    Browse the repository at this point in the history
  11. lightningd: use final_tlv if the payment_secret is supplied.

    This implies the final node understands TLV onion.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    9765642 View commit details
    Browse the repository at this point in the history
  12. common/features: clean up feature handling for different cases.

    The spec is (RSN!) going to explicitly denote where each feature should
    be presented, so create that infrastructure.
    
    Incorporate the new proposed bolt11 features, which need this.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    3b37c9d View commit details
    Browse the repository at this point in the history
  13. common/features: add payment_secret feature if EXPERIMENTAL.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell committed Nov 24, 2019
    Configuration menu
    Copy the full SHA
    8393d21 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2019

  1. feat: restructure plugin and options in listconfigs

    This will change the command `listconfigs` output in several ways:
    
     - Deprecated the duplicated "plugin" JSON output by replacing it with
     - a "plugins" array with substructures for each plugin with:
     - path, name and their options
    
    Changelog-Changed: JSON-RPC: `listconfigs` now structures plugins and include their options
    Changelog-Deprecated: JSON-RPC: `listconfigs` duplicated "plugin" paths
    m-schmoock authored and cdecker committed Nov 25, 2019
    Configuration menu
    Copy the full SHA
    6ed3201 View commit details
    Browse the repository at this point in the history
  2. don't enforce description_hash checking

    fiatjaf authored and cdecker committed Nov 25, 2019
    Configuration menu
    Copy the full SHA
    17bb862 View commit details
    Browse the repository at this point in the history

Commits on Nov 26, 2019

  1. Configuration menu
    Copy the full SHA
    e8ce9d0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d5a6072 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a3961c4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    5fb8e0a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    670f920 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2019

  1. openingd: clean up and fix minor leak.

    test_openchannel_hook_1:
    MEMLEAK: 0x557593c164e8'
      label=wire/fromwire.c:320:char[]'
       backtrace:'
         ccan/ccan/tal/tal.c:437 (tal_alloc_)'
         ccan/ccan/tal/tal.c:466 (tal_alloc_arr_)'
         wire/fromwire.c:320 (fromwire_wirestring)'
         openingd/gen_opening_wire.c:205 (fromwire_opening_got_offer_reply)'
         openingd/openingd.c:1067 (fundee_channel)'
         openingd/openingd.c:1279 (handle_peer_in)'
         openingd/openingd.c:1535 (main)'
       parents:
    
    fromwire_opening_got_offer_reply() allocates two fields off NULL:
    err_reason and our_upfront_shutdown_script.  err_reason is used
    immediately afterwards (and was the leak detected here), so fixing
    that is easy.
    
    To fix the leak of our_upfront_shutdown_script, it makes sense to simply
    make it a member of 'state'.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    493c2ab View commit details
    Browse the repository at this point in the history
  2. wallet/Makefile: fix dependency line.

    The .o files need regen, not the .c files!
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Nov 28, 2019
    Configuration menu
    Copy the full SHA
    b9a03a0 View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2019

  1. pyln: Add psycopg2-binary as a dependency

    Using the psycopg2-binary package means that the apropriate compiled binary
    for the user platform will be shipped alongside the python binaries. Otherwise
    the python bindings and the C shims would be shipped which would then require
    the postgres development packages as well.
    
    This just makes things easier, since we don't require the build dependencies.
    cdecker committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    3c5ed15 View commit details
    Browse the repository at this point in the history
  2. pyln-testing: Do not require a conftest.py to annotate tests

    In the c-lightning tests we have `tests/conftest.py` which annotates test
    function with the outcome. If we use pyln-testing outside of the c-lightning
    tree we cannot rely on that annotation being there, so we assume it passed.
    cdecker committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    9e59740 View commit details
    Browse the repository at this point in the history
  3. hsm: Stabilize the hsm encryption and decryption tests

    We were using sleeps to hope we catch the password prompt. This makes the test
    flaky. So I added a help text followed by a `fflush` to make sure we catcht he
    right moment, instead of guessing. The `fflush` is also useful for debugging
    if a user ever pipes the output to a file it'd get buffered and the user would
    wait forever. The same applies for automated systems such as `expect` or
    `pexpect` based scripts that enter the password on prompt.
    cdecker committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    c84473f View commit details
    Browse the repository at this point in the history
  4. connectd: setup chainparams

    We are going to signal the genesis block hash in the init message.
    darosior authored and cdecker committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    e6b8a02 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4b13b88 View commit details
    Browse the repository at this point in the history
  6. connectd: add network to init message

    Changelog-Added: protocol: We now signal the network we are running on at init.
    darosior authored and cdecker committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    3322048 View commit details
    Browse the repository at this point in the history
  7. devtools/gossipwith: add a "network" option

    If specified, this will add the corresponding chain_hash to the init message.
    darosior authored and cdecker committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    cd11c20 View commit details
    Browse the repository at this point in the history
  8. tool/hsmtool: add a 'guesstoremote' command

    This, in the case of data loss on a channel with `option_static_remotekey`
    negotiated, allows to likely (if the dbid is not unreasonable) recover
    the funds from a remote unilateral close just with the hsm_secret.
    
    Changelog-added: A new command, 'guesstoremote', is added to the hsmtool. It is meant to be used to recover funds after an unilateral close of a channel with `option_static_remotekey` enabled.
    darosior authored and cdecker committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    e5e4958 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    36e8d83 View commit details
    Browse the repository at this point in the history
  10. doc: adds pyln deps to command for running blackbox tests

    This one got missing when introducting `pyln` packages as test dependencies.
    m-schmoock authored and cdecker committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    895e061 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    dc1f27c View commit details
    Browse the repository at this point in the history
  12. pylightning - allow unicode symbols in the description to be passed a…

    …s-is to the daemon
    
    addresses issue ElementsProject#2753.
    
    Formatting the JSON with the default parameters will escape the unicode
    symbols in a way that c-lightning won't allow, leading to an exception.
    
    Changelog-Fixed: `pylightning` now handles unicode characters in JSON-RPC requests and responses correctly.
    jarret authored and cdecker committed Nov 29, 2019
    Configuration menu
    Copy the full SHA
    d712f73 View commit details
    Browse the repository at this point in the history

Commits on Dec 1, 2019

  1. json: Add two param parsers for secrets and hex-encoded binary data

    These are useful for the `createonion` JSON-RPC we're going to build next. The
    secret is used for the optional `session_key` while the hex-encoded binary is
    used for the `assocdata` field to which the onion commits. The latter does not
    have a constant size, hence the raw binary conversion.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    de6bf3e View commit details
    Browse the repository at this point in the history
  2. sphinx: Promote TLV payloads to be non-experimental

    This is what provides us with the ability to add custom fields in the payload
    when using `createonion` so make sure we actually have access to it.
    
    Changelog-Changed: The TLV payloads for the onion packets are no longer considered an experimental feature and generally available.
    Changelog-Added: Plugins may now handle modern TLV-style payloads via the `htlc_accepted` hook
    
    Signed-off-by: Christian Decker <@cdecker>
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    714b572 View commit details
    Browse the repository at this point in the history
  3. json-rpc: Add createonion command similar to the devtools/onion tool

    This allows us to create an onion in the JSON-RPC that we can then later inject with the `sendonion` command that we're about to implement.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    6ecdc3f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8daf9b2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e13ee29 View commit details
    Browse the repository at this point in the history
  6. pay: Make wallet_payment->destination optional

    If we use `sendonion` we don't actually know the destination, so we
    make the destination a pointer which is NULL if we don't know.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    41221b6 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    57f13af View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    42277a7 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    cb912c9 View commit details
    Browse the repository at this point in the history
  10. pay: Handle payment failures resulting from sendonion correctly

    We are breaking with a couple of assumptions, namely that we have the
    `path_secrets` to decode the error onion. If this happens we just want it to
    error out.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    b8ce175 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    43fb2a6 View commit details
    Browse the repository at this point in the history
  12. pay: Make erring_node optional in struct routing_failure

    When using `sendonion` with `shared_secrets` we may be able to decode the
    onioned error message but we cannot infer which node reported the failure
    since we don't know which nodes where involved.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    88961aa View commit details
    Browse the repository at this point in the history
  13. pay: Make erring_channel optional in struct routing_failure

    Same rationale as the previous commit: we may not have the channels in the
    path so we don't try to infer the failing channel from the error.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    7e41d6c View commit details
    Browse the repository at this point in the history
  14. pay: Allow sendonion callers to provide shared_secrets

    This means that c-lightning can now internally decrypt an eventual error
    message, and not force the caller to implement the decryption. The main
    difficulty was that we now have a new state (channels and nodes not specified,
    while shared_secrets are specified) which needed to be handled.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    27547ce View commit details
    Browse the repository at this point in the history
  15. cleanup: The failchannel is not tal-allocated when first assigned

    This makes the copy on write redundant.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    1cf3c12 View commit details
    Browse the repository at this point in the history
  16. json-rpc: Add the error onion if we stored it in the DB

    If we can't decode the onion, because the onion got corrupted or we used
    `sendonion` without specifying the `shared_secrets` used, the best we can do
    is tell the caller instead.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    16b6c31 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    705e189 View commit details
    Browse the repository at this point in the history
  18. doc: Add manpages for createonion and sendonion

    Changelog-Added: Added `createonion` and `sendonion` JSON-RPC methods allowing the implementation of custom protocol extensions that are not directly implemented in c-lightning itself.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    2080416 View commit details
    Browse the repository at this point in the history
  19. sphinx: Make the sphinx_hop struct public

    We're about to create a param helper for sphinx hops and this struct seems
    like the correct place to store the result.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    f569b52 View commit details
    Browse the repository at this point in the history
  20. param: Encapsulate hops parsing in a param_hops_array helper

    Suggested-by: Rusty Russell <@rustyrussell>
    Signed-off-by: Christian Decker <@cdecker>
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    55d8dcc View commit details
    Browse the repository at this point in the history
  21. json-rpc: Rename onion payload type to style

    Suggested-by: Rusty Russell <@rustyrussell>
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    21b5b59 View commit details
    Browse the repository at this point in the history
  22. json-rpc: Add helper for an array of secrets

    Suggested-by: Rusty Russell <@rustyrussell>
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    82255e2 View commit details
    Browse the repository at this point in the history
  23. json-rpc: Only show the amount_msat field if we know it in payments

    If we initiated the payment using an externally generated onion we don't know
    what the final hop gets, or even who it is, so we don't display the amount in
    these cases. I chose to show `null` instead in order not to break dependees
    that rely on the value being there.
    cdecker committed Dec 1, 2019
    Configuration menu
    Copy the full SHA
    0b61781 View commit details
    Browse the repository at this point in the history

Commits on Dec 2, 2019

  1. lightningd: fix reference to out-of-scope var.

    cppcheck found this:
    
    	[lightningd/options.c:1137] -> [lightningd/options.c:1120] -> [lightningd/options.c:1193]: (error) Using pointer to local variable 'buf' that is out of scope.
    
    Indeed, answer can point into buf, which is no longer in scope at the end.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    7f36a4e View commit details
    Browse the repository at this point in the history
  2. tests: update requirements

    cheroot release(/"changes"?) notes:
        ElementsProject#218 via PR ElementsProject#219: Fix HTTP parser to return 400 on invalid major-only HTTP version in Request-Line.
        ElementsProject#198 via 9f7affe: Fix race condition when toggling stats counting in the middle of request processing.
        Improve post Python 3.9 compatibility checks.
        Fix support of abstract namespace sockets.
        ElementsProject#222 via 621f4ee: Fix socket.SO_PEERCRED constant fallback value under PowerPC
        Revisit PR ElementsProject#85 under PR ElementsProject#221. Now backports.functools_lru_cache is only required on Python 3.2 and earlier.
        CherryPy ElementsProject#1206 via PR ElementsProject#204: Fix race condition in threadpool shrink code.
        PR ElementsProject#224: Refactored “open URL” behavior in webtest to rely on retry_call. Callers can no longer pass raise_subcls or ssl_context positionally, but must pass them as keyword arguments.
        ElementsProject#231 via PR ElementsProject#232: Remove custom setup.cfg parser handling, allowing the project (including sdist) to build/run on setuptools 41.4. Now building cheroot requires setuptools 30.3 or later (for declarative config support) and preferably 34.4 or later (as indicated in pyproject.toml).
        Workers are now request-based, addressing the long-standing issue with keep-alive connections (ElementsProject#91 via PR ElementsProject#199).
        Deprecated use of negative timeouts as alias for infinite timeouts in ThreadPool.stop.
        CherryPy ElementsProject#1662 via PR ElementsProject#74: For OPTION requests, bypass URI as path if it does not appear absolute.
        CherryPy ElementsProject#1818: Restore support for None default argument to WebCase.getPage().
    
    https://github.com/cherrypy/cheroot/blob/master/CHANGES.rst
    
    flaky changes:
        Bugfixes - Reraise KeyboardInterrupt when running tests under pytest.
    
    https://github.com/box/flaky/blob/v3.6.1/HISTORY.rst#361-2019-08-06
    
    python-bitcoinlib:
        New RPC `generatetoaddress(self,numblocks,addr)`.
        Fixed Python 2.7 incompatibility.
        Various OpenSSL fixes, including a memory leak.
    
    https://github.com/petertodd/python-bitcoinlib/blob/python-bitcoinlib-v0.10.2/release-notes.md#v0102
    
    pytest release notes:
        A lot of misc fixes, see https://docs.pytest.org/en/latest/changelog.html.
    darosior authored and cdecker committed Dec 2, 2019
    Configuration menu
    Copy the full SHA
    4661dfa View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d9aeeb4 View commit details
    Browse the repository at this point in the history

Commits on Dec 3, 2019

  1. wire: Let the TLV _is_valid function actually return validity

    I got this one wrong myself, since the function name implied a boolean
    result. So I changed it to take the optional err_index as argument.
    cdecker authored and rustyrussell committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    69c17d2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    838001a View commit details
    Browse the repository at this point in the history
  3. wire: Remove unused fromwire_tlvs

    We are now using the typesafe variant everywhere.
    cdecker authored and rustyrussell committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    5a78671 View commit details
    Browse the repository at this point in the history
  4. tlv: Add a typesafe serialization function for tlv namespaces

    This is the counterpart to the typesafe deserialization function implemented
    in an earlier commit.
    cdecker authored and rustyrussell committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    e12b5c3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    626675c View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    db92c2a View commit details
    Browse the repository at this point in the history
  7. jsonrpc: Add json_add_preimage helper

    fiatjaf authored and rustyrussell committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    7707896 View commit details
    Browse the repository at this point in the history
  8. also return preimage on listinvoices.

    fiatjaf authored and rustyrussell committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    c0368a7 View commit details
    Browse the repository at this point in the history
  9. update docs with payment_preimage.

    Changelog-Added: JSON-RPC: `listinvoices` now displays the payment preimage if the invoice was paid.
    fiatjaf authored and rustyrussell committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    99ff86f View commit details
    Browse the repository at this point in the history
  10. Init commit to be able to create a tor static service on the fly.

    We  want to have a static Tor service created from a blob bound to
    our node on cmdline
    
    Changelog-added: persistent Tor address support
    Changelog-added: allow the Tor inbound service port differ from 9735
    
    Signed-off-by: Saibato <[email protected]>
    
    Add base64 encode/decode to common
    
    We need this to encode the blob for the tor service
    
    Signed-off-by: Saibato <[email protected]>
    Saibato authored and cdecker committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    f6006f4 View commit details
    Browse the repository at this point in the history
  11. Reflect the changes in documentation

    Signed-off-by: Saibato <[email protected]>
    Saibato authored and cdecker committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    b18510a View commit details
    Browse the repository at this point in the history
  12. Add basic tests

    Signed-off-by: Saibato <[email protected]>
    Saibato authored and cdecker committed Dec 3, 2019
    Configuration menu
    Copy the full SHA
    2c16b41 View commit details
    Browse the repository at this point in the history

Commits on Dec 4, 2019

  1. doc: feerate is not obvious, refer to fundchannel documentation:

    It has a whole *two paragraphs* on it:
    
    *feerate* is an optional feerate used for the opening transaction and as
    initial feerate for commitment and HTLC transactions. It can be one of
    the strings *urgent* (aim for next block), *normal* (next 4 blocks or
    so) or *slow* (next 100 blocks or so) to use lightningd’s internal
    estimates: *normal* is the default.
    
    Otherwise, *feerate* is a number, with an optional suffix: *perkw* means
    the number is interpreted as satoshi-per-kilosipa (weight), and *perkb*
    means it is interpreted bitcoind-style as satoshi-per-kilobyte. Omitting
    the suffix is equivalent to *perkb*.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and niftynei committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    4683d09 View commit details
    Browse the repository at this point in the history
  2. plugins/fundchannel: try to connect to peer before funding

    Changelog-Added: RPC: The 'fundchannel' command now tries to connect to the peer before funding the channel, no need to 'connect' before 'fundchannel' anymore !
    darosior authored and niftynei committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    ff412a6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f6ff5e5 View commit details
    Browse the repository at this point in the history
  4. fundchannel: attempt to connect before funding channel

    Attempts to connect to peer before funding the channel
    niftynei committed Dec 4, 2019
    Configuration menu
    Copy the full SHA
    a30ee2b View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2019

  1. pytest: test rpc_command hook when it handles command to stop itself.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    d8fc533 View commit details
    Browse the repository at this point in the history
  2. plugin: handle corner case where rpc_command is to stop the plugin.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 6, 2019
    Configuration menu
    Copy the full SHA
    f6ed7f2 View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2019

  1. pytest: demonstrate failing rpc_command hook rewrite to plugin.

    lightningd: lightningd/plugin.c:648: plugin_rpcmethod_dispatch: Assertion `idtok != NULL' failed.
    lightningd: FATAL SIGNAL 6 (version v0.7.3-234-gf3aeb51-modded)
    0x557652363eb1 send_backtrace
    	common/daemon.c:41
    0x557652363f5b crashdump
    	common/daemon.c:54
    0x7f5b065a346f ???
    	???:0
    0x7f5b065a33eb ???
    	???:0
    0x7f5b06582898 ???
    	???:0
    0x7f5b06582768 ???
    	???:0
    0x7f5b06594005 ???
    	???:0
    0x557652355901 plugin_rpcmethod_dispatch
    	lightningd/plugin.c:648
    0x557652331836 command_exec
    	lightningd/jsonrpc.c:588
    0x557652331bad rpc_command_hook_callback
    	lightningd/jsonrpc.c:655
    0x557652358745 plugin_hook_callback
    	lightningd/plugin_hook.c:90
    0x55765235486a plugin_response_handle
    	lightningd/plugin.c:258
    0x557652354a16 plugin_read_json_one
    	lightningd/plugin.c:356
    0x557652354b6d plugin_read_json
    	lightningd/plugin.c:388
    0x5576523b5e6c next_plan
    	ccan/ccan/io/io.c:59
    0x5576523b6a51 do_plan
    	ccan/ccan/io/io.c:407
    0x5576523b6a93 io_ready
    	ccan/ccan/io/io.c:417
    0x5576523b8d2b io_loop
    	ccan/ccan/io/poll.c:445
    0x55765232dc6f io_loop_with_timers
    	lightningd/io_loop_with_timers.c:24
    0x557652334a6e main
    	lightningd/lightningd.c:848
    0x7f5b065841e2 ???
    	???:0
    0x5576523193ed ???
    	???:0
    0xffffffffffffffff ???
    	???:0
    Log dumped in crash.log.20191206093336
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 7, 2019
    Configuration menu
    Copy the full SHA
    e572b48 View commit details
    Browse the repository at this point in the history
  2. lightningd: make sure rpc_command replacement is well-formed.

    In particular:
    1. It must redirect to an existing command.
    2. It must contain method, params and id.
    
    And update the docs to show the id, which is vital.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 7, 2019
    Configuration menu
    Copy the full SHA
    30c8db1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    44c23ed View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bd369ed View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2019

  1. doc: add 'id' to rpc_command

    It's required, so at least hint about its presence!
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 8, 2019
    Configuration menu
    Copy the full SHA
    f8d8348 View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2019

  1. common: don't crash on bad sphinx payload.

    It's cleanest to eliminate the SPHINX_INVALID_PAYLOAD altogether.
    
    lightning_channeld: FATAL SIGNAL (version v0.7.3-242-gb1583bb-modded)
    0x55a8169eed08 send_backtrace
    	common/daemon.c:41
    0x55a8169fc3eb status_failed
    	common/status.c:206
    0x55a8169fc657 status_backtrace_exit
    	common/subdaemon.c:25
    0x55a8169eedbb crashdump
    	common/daemon.c:57
    0x7f0eaff8446f ???
    	???:0
    0x7f0eaff843eb ???
    	???:0
    0x7f0eaff63898 ???
    	???:0
    0x55a8169fb29f route_step_decode
    	common/sphinx.c:759
    0x55a8169fb60a process_onionpacket
    	common/sphinx.c:834
    0x55a8169d9b34 get_shared_secret
    	channeld/channeld.c:605
    0x55a8169d9d35 handle_peer_add_htlc
    	channeld/channeld.c:649
    0x55a8169dd88d peer_in
    	channeld/channeld.c:1838
    0x55a8169e11a8 main
    	channeld/channeld.c:3233
    0x7f0eaff651e2 ???
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    bb538a1 View commit details
    Browse the repository at this point in the history
  2. common: make sphinx code ignorant of payload format.

    Now "raw_payload" is always the complete string (including realm or length
    bytes at the front).
    
    This has several effects:
    1. We can receive an decrypt an onion which is grossly malformed.
    2. We can still hand this to the htlc_accepted hook.
    3. We then fail it unless the htlc_accepted accepts it manually.
    4. The createonion API now takes the raw payload, and does not know
       anything about "style".
    
    The only caveat is that the sphinx code needs to know the payload
    length: we have a call for that, which simply tells it to copy the
    entire onion (and treat us as the final node) if it's invalid.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    f7ebbb2 View commit details
    Browse the repository at this point in the history
  3. plugins/libplugin: notifications support

    Changelog-Added: plugins: libplugin now supports writing plugin which registers to notifications
    darosior authored and cdecker committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    3371f0c View commit details
    Browse the repository at this point in the history
  4. plugins/libplugin: hook support

    Changelog-Added: plugins: libplugin now supports writing plugins which register to hooks
    darosior authored and cdecker committed Dec 9, 2019
    Configuration menu
    Copy the full SHA
    fcbd11f View commit details
    Browse the repository at this point in the history

Commits on Dec 10, 2019

  1. build: fix ./configure options' descriptions

    The description of
    
    --enable/disable-experimental-features was a bogus "Developer mode, good
    for testing" and
    
    --enable/disable-valgrind was "Valgrind binary to use for tests" which
    gave the false impression that it should be set to something like
    /usr/local/bin/valgrind whereas it is a boolean option.
    vasild authored and cdecker committed Dec 10, 2019
    Configuration menu
    Copy the full SHA
    cd30f76 View commit details
    Browse the repository at this point in the history

Commits on Dec 11, 2019

  1. Configuration menu
    Copy the full SHA
    518c43a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    15f04d5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e1b1f47 View commit details
    Browse the repository at this point in the history
  4. sphinx: Return the error in parse_onionpacket

    As suggested by @niftynei here: ElementsProject#3260 (comment)
    
    Suggested-by: Lisa Neigut <@niftynei>
    Suggested-by: Rusty Russell <@rustyrussell>
    Signed-off-by: Christian Decker <@cdecker>
    cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    ff5f7b1 View commit details
    Browse the repository at this point in the history
  5. pytest: Parametrize test_gossip_query_channel_range for elements

    We were hardcoding the chainparams->chain_hash which caused the query to
    return an empty result. By parametrizing the test we can make it work on
    elements.
    cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    fc93787 View commit details
    Browse the repository at this point in the history
  6. pytest: Parametrize test_query_short_channel_id for elements

    Same as the previous commit.
    cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    d6a5b87 View commit details
    Browse the repository at this point in the history
  7. pytest: Parametrize test_config_in_subdir for elements

    Same as previous
    cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    843846f View commit details
    Browse the repository at this point in the history
  8. pytest: Skip some tests in elements if paratrization is convoluted

    These mainly use hard-coded addresses
    cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    301b634 View commit details
    Browse the repository at this point in the history
  9. pytest: Stabilize and parameterize closing_specified_destination

    This test was doing a few contortions, so I disentangled it a bit and
    parametrized it
    cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    43dfb4d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    6cc60f5 View commit details
    Browse the repository at this point in the history
  11. pytest: Stabilize the hsm_encryption test

    Tailing the log when we expect the process to exit can be racy (in this case
    we were waiting for the last line that'd be printed).
    cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    3def539 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    2986854 View commit details
    Browse the repository at this point in the history
  13. doc/lightningd-config: precise alias are 32 __bytes__ long.

    And not 32 characters long, as a character (for example 🐨) can be 4
    bytes long.
    
    Reported-By: Vasil Dimov <@vasild>
    darosior authored and cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    b4c18a1 View commit details
    Browse the repository at this point in the history
  14. doc: fix commit-time formatting

    vasild authored and cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    38d88f1 View commit details
    Browse the repository at this point in the history
  15. lightningd: don't always defer commitment_signed if we're not synced.

    Because my node runs under valgrind, it can take quite a while to
    sync; nodes tend to disconnect and reconnect if you block too long.
    
    This is particularly problematic since we often update fees: when the
    other side sends its commitment_signed we block.
    
    In particular, this triggers the corner case we have where we
    update_fee twice, disconnecting each time, and our state machine gets
    confused (which is why we never saw this exact corner case before this
    change in 0.7.3!).
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    d565133 View commit details
    Browse the repository at this point in the history
  16. hsmtool: fixup miscount on params

    assuming argv is zero indexed, we should check that the argc count
    is at least as big as the desired args
    niftynei authored and cdecker committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    dd34ccc View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    d449423 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    5ca9380 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    9660549 View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2019

  1. doc: correct wording in changelog

    m-schmoock authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    727d6a0 View commit details
    Browse the repository at this point in the history
  2. db: add partid, total_msat fields to payment entries.

    This is in preparation for partial payments.  For existing payments,
    partid is 0 (arbitrarity) and total_msat is msatoshi.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    2d18c3a View commit details
    Browse the repository at this point in the history
  3. db: add partid field to htlc_out.

    This is in preparation for partial payments.  For existing payments,
    partid is 0 (to match the corresponding payment).
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    345ca9b View commit details
    Browse the repository at this point in the history
  4. htlcs: remove origin_htlc_id from htlc_out.

    This is a transient field, so rework things so we don't leave it in
    struct htlc_out.  Instead, load htlc_in first and connect htlc_out to
    them as we go.
    
    This also changes one place where we use it instead of the am_origin
    flag.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    1298533 View commit details
    Browse the repository at this point in the history
  5. lightningd: share more code between sendpay and sendonion.

    In particular, we're about to do surgery on the detection-of-previous-payments
    logic, and we should not do this in two places.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    618c390 View commit details
    Browse the repository at this point in the history
  6. lightningd: change amount-in-flight check to be more nuanced.

    We currently refuse a payment if one is already in flight.  For parallel
    payments, it's a bit more subtle: we want to refuse if it we already have
    the total-amount-of-invoice in flight.
    
    So we get all the current payments, and sum the pending ones.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    ce4403d View commit details
    Browse the repository at this point in the history
  7. sendpay/sendonion: add optional partid arg, finesse msatoshi argument.

    msatoshi was used to indicate the amount the invoice asked for, but
    for parallel sendpay it's required, as it allows our sanity check of
    limiting the total payments in flight, ie. it becomes
    'total_msat'.
    
    There's a special case for sendonion, which always tells us the value is 0.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    cd35835 View commit details
    Browse the repository at this point in the history
  8. configure: make partid payments only available with EXPERIMENTAL_FEAT…

    …URES and payment_secret
    
    Explicit #if EXPERIMENTAL_FEATURES check in case we enable them at different
    times, but it requires a payment_secret since we put them in the same field.
    
    This incidently stops it working on legacy nodes.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    63fffd4 View commit details
    Browse the repository at this point in the history
  9. waitsendpay: add partid arg.

    We need to be able to wait for a unique payment, now payment_hash is not
    always unique.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    b670b51 View commit details
    Browse the repository at this point in the history
  10. pytest: Add tests to make sure received onion is as expected.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    280523e View commit details
    Browse the repository at this point in the history
  11. doc: update experimental bolt version quotes.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    0e4a30c View commit details
    Browse the repository at this point in the history
  12. lightningd: cleanup redundant args from handle_localpay

    The cltv_expiry and payment_hash are in hin, so no need to hand them
    in here.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    8b129b4 View commit details
    Browse the repository at this point in the history
  13. lightningd: split invoice check into separate function.

    We now return the same error for various "does not match this
    invoice", so it makes sense to encapsulate these checks.  We'll also
    want to expose this for multi-part payments.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    7f629e5 View commit details
    Browse the repository at this point in the history
  14. lightningd: implement htlc sets.

    This isn't plumbed in yet, but the idea is that every htlc gets put
    into a "set" and then we process them once the set is satisfied.  For
    the !EXPERIMENTAL_FEATURES, the set is simply always size 1.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    36b1e88 View commit details
    Browse the repository at this point in the history
  15. lightningd: wrap htlc replay in a database transaction.

    AFAICT this only "worked" previously because replay htlc simply failed
    them all (no peers are currently connected).  With upcoming changes
    (foreshadowed by the comment) this is no longer true:
    
    Attempting to prepare a db_stmt outside of a transaction: wallet/invoices.c:373
    lightningd: FATAL SIGNAL 6 (version v0.7.3-188-g45b0af4-modded)
    0x55b475590a73 send_backtrace
    	common/daemon.c:41
    0x55b475590b1d crashdump
    	common/daemon.c:54
    0x7f16c557b46f ???
    	???:0
    0x7f16c557b3eb ???
    	???:0
    0x7f16c555a898 ???
    	???:0
    0x55b475564c8f fatal
    	lightningd/log.c:814
    0x55b4755c3ed5 db_prepare_v2_
    	wallet/db.c:605
    0x55b4755c76b5 invoices_find_unpaid
    	wallet/invoices.c:373
    0x55b4755ce91c wallet_invoice_find_unpaid
    	wallet/wallet.c:1990
    0x55b47555861f invoice_check_payment
    	lightningd/invoice.c:257
    0x55b475557a7c htlc_add_set
    	lightningd/htlc_set.c:112
    0x55b47557b294 handle_localpay
    	lightningd/peer_htlcs.c:332
    0x55b47557c63c htlc_accepted_hook_callback
    	lightningd/peer_htlcs.c:857
    0x55b475585573 plugin_hook_call_
    	lightningd/plugin_hook.c:118
    0x55b47557c747 plugin_hook_call_htlc_accepted
    	lightningd/peer_htlcs.c:882
    0x55b47557ca3e peer_accepted_htlc
    	lightningd/peer_htlcs.c:991
    0x55b47557ffb9 htlcs_resubmit
    	lightningd/peer_htlcs.c:2131
    0x55b4755620f7 main
    	lightningd/lightningd.c:801
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    c2b357b View commit details
    Browse the repository at this point in the history
  16. lightningd: sew in htlc set.

    The invoice_try_pay code now takes a set, rather than a single htlc, but
    it's basically the same thing.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    8e3234e View commit details
    Browse the repository at this point in the history
  17. plugins: listpays ignores pre-0.7.0 or manual sendpay payments w/ no …

    …bolt11.
    
    The pay plugin has been supplying the bolt11 string since 0.7.0, so only
    ancient "pay" commands would be omitted by this change.
    
    You can create a no-bolt11 "sendpay" manually, but then you'll find it
    in 'listsendpays'.
    
    Changelog-Removed: JSON: `listpays` won't shown payments made via sendpay without a bolt11 string, or before 0.7.0.
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    f1bc0b2 View commit details
    Browse the repository at this point in the history
  18. plugins: listpays will now consolidate multi-part payments.

    This won't usually be visible to the end-user, since the pay plugin doesn't
    do multi-part yet (and mpp requires EXPERIMENTAL_FEATURES), but we're ready
    once it does.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    207689c View commit details
    Browse the repository at this point in the history
  19. common: offer option_basic_mpp for EXPERIMENTAL_FEATURES.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    5d413e0 View commit details
    Browse the repository at this point in the history
  20. pytest: add more multi-part-payment tests.

    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    326ceab View commit details
    Browse the repository at this point in the history
  21. lightningd: require payment_secret for MPP.

    It makes sense, and it's been proposed for addition to the spec to
    broad agreement:
    
    	lightning/bolts#712
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    7fb4efd View commit details
    Browse the repository at this point in the history
  22. lightningd: fix spurious "more than twice final" error.

    Bastien TEINTURIER <[email protected]> writes:
    > It looks like the split on c-lightning side is quite limited at the moment:
    > the only option is to split a payment in exactly its two halves,
    > otherwise I get rejected because of the rule of overpaying more than
    > twice the amount?
    
    We only tested exactly two equal-size payments; indeed, our finalhop
    test was backwards.  We only complain if the final hop pays more than
    twice msat (technically, this test is still too loose for mpp: the
    spec says we should sum to the exact amount).
    
    Reported-by: @t-bast
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    edab0df View commit details
    Browse the repository at this point in the history
  23. lightningd: fix failure message in waitsendpay with multi-part payments.

    Bastien TEINTURIER <[email protected]> writes:
    > One thing I noticed but didn't investigate much: after sending the two
    > payments, I tried using `waitsendpay` and it reported an error *208*
    > (*"Never attempted payment for
    > '98ee736d29d860948e436546a88b0cc84f267de8818531b0fdbe6ce3d080f22a'"*).
    > 
    > I was expecting the result to be something like: "payment succeeded for
    > that payment hash" (the HTLCs were correctly settled).
    
    Indeed, if you waitsendpay without specifying a partid, you are waiting
    for 0, which may not exist.  Clarify the error msg.
    
    Reported-by: @t-bast
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    ec15051 View commit details
    Browse the repository at this point in the history
  24. common: add fee_states state machine for update_fee.

    This uses the same state machine as HTLCs, but they're only
    ever added, not removed.  Since we can only have one in each
    state, we use a simple array; mostly NULL.
    
    We could make this more space-efficient by folding everything into the
    first 5 states, but that would be more complex than just using the
    identical state machine.
    
    One subtlety: we don't send uncommitted fee_states over the wire.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    b9d6e8b View commit details
    Browse the repository at this point in the history
  25. channeld: cleanup: use the channel_feerate() accessor everywhere.

    And also move it to initial_channel, so we can use it there.
    
    This saves churn in the next patch.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    8ffd9d5 View commit details
    Browse the repository at this point in the history
  26. channeld: generate revoke_and_ack before telling lightningd about com…

    …mitment.
    
    The `channel_got_commitsig` we send the lightningd also implies we sent
    the revoke_and_ack, as an optimization.  It doesn't currently matter,
    since channel_sending_revoke_and_ack doesn't do anything important to the
    state, but that changes once we start uploading the entire fee_states.
    
    So now we move our state machine *before* sending to lightningd, in
    preparation for sending fee_states too.
    
    Unfortunately, we need to marshall the info to send before we
    increment the state, as lightningd expects that.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    acb89de View commit details
    Browse the repository at this point in the history
  27. channeld: use fee_states internally.

    This is an intermediary step: we still don't save it to the database,
    but we do use the fee_states struct to track it internally.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    24d54f9 View commit details
    Browse the repository at this point in the history
  28. channeld: remove changes_pending flags.

    These used to be necessary as we could have feerate changes which
    we couldn't track: now we do, we don't need these flags.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    d2673a4 View commit details
    Browse the repository at this point in the history
  29. wallet: add per-channel feerate_state to the database.

    The upgrade here is a bit tricky: we map the two values into the
    feerate_state.  This is trivial if they're both the same, but if
    they're different we don't know exactly what state they're in (this
    being the source of the bug!).
    
    So, we assume that the have received the update and not acked it,
    as that would be the normal case.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    4270031 View commit details
    Browse the repository at this point in the history
  30. lightningd: save the fee_states into the database.

    This is the final step: we pass the complete fee_states to and from
    channeld.
    
    Changelog-Fixed: "Bad commitment signature" closing channels when we sent back-to-back update_fee messages across multiple reconnects.
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    72aa315 View commit details
    Browse the repository at this point in the history
  31. devtools: fix example at top of mkcommit.

    The norm for channels is a 1% reserve.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    e521aae View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    fb7c678 View commit details
    Browse the repository at this point in the history
  33. lightningd: remove htlc_set destruction timer once we head to invoice.

    Otherwise tests for hold_invoice fail on Travis (they use 180 / 2 as
    the timeout, and we free it after 70 seconds).
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    2e97afd View commit details
    Browse the repository at this point in the history
  34. Protocol: make var_onion, payment_secret and basic_mpp non-EXPERIMENTAL.

    Thanks to @t-bast, who made this possible by interop testing with Eclair!
    
    Changelog-Added: Protocol: can now send and receive TLV-style onion messages.
    Changelog-Added: Protocol: can now send and receive BOLT11 payment_secrets.
    Changelog-Added: Protocol: can now receive basic multi-part payments.
    Changelog-Added: RPC: low-level commands sendpay and waitsendpay can now be used to manually send multi-part payments.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 12, 2019
    Configuration menu
    Copy the full SHA
    839909d View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2019

  1. channeld: treat all incoming errors as "soft", so we retry.

    We still close the channel if we *send* an error, but we seem to have hit
    another case where LND sends an error which seems transient, so this will
    make a best-effort attempt to preserve our channel in that case.
    
    Some test have to be modified, since they don't terminate as they did
    previously :(
    
    Changelog-Changed: quirks: We'll now reconnect and retry if we get an error on an established channel. This works around lnd sending error messages that may be non-fatal.
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 13, 2019
    Configuration menu
    Copy the full SHA
    1d0c433 View commit details
    Browse the repository at this point in the history
  2. tools: don't use bytelength as array length for arrays in TLVs.

    This matters now we have an array in tlv_init_tlvs!  We were overallocating
    in fromwire by 32x!
    
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 13, 2019
    Configuration menu
    Copy the full SHA
    eb6a768 View commit details
    Browse the repository at this point in the history
  3. wire: perform corruption test on init_msg.

    Fixes: ElementsProject#3301
    Signed-off-by: Rusty Russell <[email protected]>
    rustyrussell authored and cdecker committed Dec 13, 2019
    Configuration menu
    Copy the full SHA
    b315a29 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    eb2b225 View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2019

  1. Configuration menu
    Copy the full SHA
    250fc79 View commit details
    Browse the repository at this point in the history
  2. doc: fix typos in doc/TOR.md

    vasild authored and cdecker committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    1fe8cd8 View commit details
    Browse the repository at this point in the history
  3. doc: fix the path to the sqlite database file

    The sqlite database location has been changed in aab83e7.
    
    Changelog-None
    vasild authored and cdecker committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    bf1f768 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c15169b View commit details
    Browse the repository at this point in the history

Commits on Dec 17, 2019

  1. Configuration menu
    Copy the full SHA
    7b15419 View commit details
    Browse the repository at this point in the history
  2. minor fixes after merge

    gruve-p committed Dec 17, 2019
    Configuration menu
    Copy the full SHA
    830dbb1 View commit details
    Browse the repository at this point in the history