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

update with upstream #1

Merged
merged 39 commits into from
Sep 10, 2018
Merged

update with upstream #1

merged 39 commits into from
Sep 10, 2018

Commits on Aug 31, 2018

  1. TAGS: add python files.

    This is part of our new "Python programmers are people too" policy.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Aug 31, 2018
    Configuration menu
    Copy the full SHA
    a21f025 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2018

  1. Configuration menu
    Copy the full SHA
    6091e51 View commit details
    Browse the repository at this point in the history
  2. devtools: dump-gossipstore.

    Not very useful by itself, but when combined with decodemsg it can tell
    us quite a bit.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    317a830 View commit details
    Browse the repository at this point in the history
  3. param: json.c style improvements

    Suggested-by: @rustyrussell
    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    9c28f99 View commit details
    Browse the repository at this point in the history
  4. param: consistent callback format

    The `json_tok_X` functions now consistently check the success case first
    and call `command_fail` at the end.
    
    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    a79e64c View commit details
    Browse the repository at this point in the history
  5. param: return type consistency

    We were returning a pointer but expecting a bool.
    
    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    eb1a5b1 View commit details
    Browse the repository at this point in the history
  6. param: use param for json_pay routes

    Note: Unlike before, this will now accept positional parameters.
    
    Note: In case of error we no longer report the hop number.  Is this acceptable?
    We still report the name of the bad param and its value.
    
    One option is to log the hop number if param() returns false.  This would require
    a change to command_fail so it doesn't delete the cmd, so we can still
    access cmd->ld->log.
    
    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    4cef0d0 View commit details
    Browse the repository at this point in the history
  7. param: upgraded json_tok_label

    Added utility function json_tok_is_num so I would avoid using goto.
    
    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    c32f791 View commit details
    Browse the repository at this point in the history
  8. param: getroute fuzz now uses json_tok_percent

    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    c553bba View commit details
    Browse the repository at this point in the history
  9. param: added json_tok_msat

    This could have been a local static but its used by the run-param test,
    so putting it in json.c made things easier.
    
    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    4f81cd3 View commit details
    Browse the repository at this point in the history
  10. param: make json_tok_label non-static

    Needed to do this so I could remove the implementation in
    the run-param test.
    
    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    8590dbe View commit details
    Browse the repository at this point in the history
  11. param: upgraded json_tok_escaped_string

    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    aa60057 View commit details
    Browse the repository at this point in the history
  12. param: added json_tok_array

    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    0b26a17 View commit details
    Browse the repository at this point in the history
  13. param: added json_tok_string

    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    47510a8 View commit details
    Browse the repository at this point in the history
  14. param: listpayments now uses json_tok_sha256

    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    30e6471 View commit details
    Browse the repository at this point in the history
  15. param: updated comments in the spirit of #1899

    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    4ad16b6 View commit details
    Browse the repository at this point in the history
  16. param: feedback fixes

    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    721f77f View commit details
    Browse the repository at this point in the history
  17. param: started adding callback unit tests

    Well its about time.
    
    Signed-off-by: Mark Beckwith <wythe@intrig.com>
    wythe authored and rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    ca40cfa View commit details
    Browse the repository at this point in the history
  18. lightningd: remove unnecessary globals.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    1e91523 View commit details
    Browse the repository at this point in the history
  19. lightningd: rename 'daemons' to 'subdaemons'.

    We're a daemon.  They're subdaemons.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    c33c971 View commit details
    Browse the repository at this point in the history
  20. lightningd: remove gratuitous SIG_IGN: daemon_setup() does it already.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    c3ec5fc View commit details
    Browse the repository at this point in the history
  21. chaintopology: remove redundant wallet pointer.

    We already have access via the ld object, and we initialized this one
    twice anyway.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    2af94f1 View commit details
    Browse the repository at this point in the history
  22. wallet: do wallet_invoice init during preparation.

    We have a transaction anyway, and it's simpler.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    3e53a63 View commit details
    Browse the repository at this point in the history
  23. lightningd: move channel/peer/htlc load into own function.

    Also, wallet has no business wiring up HTLCs; move that code to
    peer_htlcs.c.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    168bec0 View commit details
    Browse the repository at this point in the history
  24. lightningd: inline overview documentation (part 1 of 8).

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    8bc845d View commit details
    Browse the repository at this point in the history
  25. Put the 'd' back in the daemons.

    @renepickhardt: why is it actually lightningd.c with a d but hsm.c without d ?
    
    And delete unused gossipd/gossip.h.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    0d46a3d View commit details
    Browse the repository at this point in the history
  26. lightningd: minor cleanups

    Code changes:
    1. Expose daemon_poll() so lightningd can call it directly, which avoids us
       having store a global and document it.
    2. Remove the (undocumented, unused, forgotten) --rpc-file="" option to disable
       JSON RPC.
    3. Move the ickiness of finding the executable path into subd.c, so it doesn't
       distract from lightningd.c overview.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    76f116d View commit details
    Browse the repository at this point in the history
  27. More documentation changes.

    Documentation changes:
    1. Lots of extra detail suggested by @renepickhardt.
    2. typo fixes from @practicalswift.
    3. A section on 'const' usage.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    dfc2a6b View commit details
    Browse the repository at this point in the history
  28. lightningd: more comment fixes.

    Suggested-by: @practicalswift and @cdecker.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    f2e0857 View commit details
    Browse the repository at this point in the history
  29. chaintopology: don't "fix" unknown feerate against known one.

    This was found because it means we have a non-zero feerate without
    filling in the history of that feerate:
    
    ==15895== Conditional jump or move depends on uninitialised value(s)
    ==15895==    at 0x408699: feerate_max (chaintopology.c:828)
    ==15895==    by 0x41BE49: peer_start_openingd (opening_control.c:733)
    ==15895==    by 0x425FE9: peer_connected (peer_control.c:515)
    ==15895==    by 0x40CB8F: connectd_msg (connect_control.c:304)
    ==15895==    by 0x42DB4E: sd_msg_read (subd.c:475)
    ==15895==    by 0x42D499: read_fds (subd.c:302)
    ==15895==    by 0x46EB18: next_plan (io.c:59)
    ==15895==    by 0x46F5E9: do_plan (io.c:387)
    ==15895==    by 0x46F627: io_ready (io.c:397)
    ==15895==    by 0x471187: io_loop (poll.c:310)
    ==15895==    by 0x41683D: main (lightningd.c:732)
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 3, 2018
    Configuration menu
    Copy the full SHA
    ae61f64 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2018

  1. subdaemon: better GDB support.

    It was annoying me, so I made it much nicer to use.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 4, 2018
    Configuration menu
    Copy the full SHA
    7b9341e View commit details
    Browse the repository at this point in the history
  2. pytest: support simple subdaemon debugging.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 4, 2018
    Configuration menu
    Copy the full SHA
    312209a View commit details
    Browse the repository at this point in the history
  3. gossipd: handle premature node_announcements in the store.

    These happen after we compact the store; every log I've seen of a
    restart on a real node has a message about truncating the store,
    because node_announcements predate channel_announcements.
    
    I extracted one such case from testnet, and reduced it to test here.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 4, 2018
    Configuration menu
    Copy the full SHA
    e2f4269 View commit details
    Browse the repository at this point in the history
  4. gossipd: fix reordering of node_announcements in presence of a unanno…

    …unced channel.
    
    If we receive a channel_announce but not a channel_update, we store the announce
    but don't put it in the broadcast map.
    
    When we delete a channel, we check if the node_announcement broadcast
    now preceeds all channel_announcements, and if so, we move it to the
    end of the map.  However, with a channel_announcement at index '0',
    this test fails.
    
    This is at least one potential cause of the node map getting out of order.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 4, 2018
    Configuration menu
    Copy the full SHA
    97c7ba2 View commit details
    Browse the repository at this point in the history
  5. pytest: reproduce problem with restarting and retransmitting multiple…

    … outgoing htlcs
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 4, 2018
    Configuration menu
    Copy the full SHA
    db12a14 View commit details
    Browse the repository at this point in the history
  6. db: save and restore last_sent_commit correctly.

    It's an array: we were only saving the single element; if there was more than
    one changed HTLC we'd get a bad signature!
    
    The report in #1907 is probably caused by the other side re-requesting
    something we considered already finalized; to avoid this particular error,
    we should set the field to NULL if there's no last_sent_commit.
    
    I'm increasingly of the opinion we want to just save all the update
    packets to the db and blast them out, instead of doing this
    second-guessing dance.
    
    Fixes: #1907
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 4, 2018
    Configuration menu
    Copy the full SHA
    cefb692 View commit details
    Browse the repository at this point in the history

Commits on Sep 5, 2018

  1. pytest: Fix configure to find pytest when installed using pip3.

    Installing pytest through pip3 (at least sometimes) doesn't create a script.
    This means calling `which` won't work.
    Changed configure so that it can also test if the module is present by calling python/python3.
    Change the error message for when pytest can't be found, so that it's clear to the user `configure` must be ran again after installing pytest.
    lucash-dev authored and rustyrussell committed Sep 5, 2018
    Configuration menu
    Copy the full SHA
    b52fb14 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2018

  1. doc: Spelling corrections

    laanwj authored and cdecker committed Sep 7, 2018
    Configuration menu
    Copy the full SHA
    6a4468e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    634f19a View commit details
    Browse the repository at this point in the history