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

Merge with master #7

Merged
merged 20 commits into from
Sep 20, 2018
Merged

Merge with master #7

merged 20 commits into from
Sep 20, 2018

Commits on Sep 20, 2018

  1. json-rpc: Remove upper limit for percentage

    The `json_tok_percentage` parser is used for the `fuzzpercent` in `getroute` and
    `maxfeepercent` in `pay`. In both cases it seems reasonable to allow values
    larger than 100%. This has bitten users in the past when they transferred single
    satoshis to things like satoshis.place over a route longer than 2 hops.
    cdecker authored and rustyrussell committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    cf52b71 View commit details
    Browse the repository at this point in the history
  2. doc: Update docs to remove 100% upper bound

    Actual change is in the previous commit.
    cdecker authored and rustyrussell committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    674d176 View commit details
    Browse the repository at this point in the history
  3. openingd: prioritize incoming peer traffic over handling (and sending…

    … out) gossip
    
    - reduces probability for a deadlock where we block on sending data because
      the other peer cannot receive because it blocks on sending data etc.
    - when either side sends so much data that it fills up the kernel/network buffer
    - however sending out gossip can still block when (malicious) peer never receives
    SimonVrouwe authored and rustyrussell committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    94e42f2 View commit details
    Browse the repository at this point in the history
  4. CHANGELOG.md: catchup with changes so far.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    4198cb3 View commit details
    Browse the repository at this point in the history
  5. parse autotor: address before separate_address_and_port

    this enables addr like --addr=autotor:127.0.0.1 or
    --addr=autotor:localhost to just use the default tor service port
    
    Signed-off-by: Saibato <Saibato.naga@pm.me>
    Saibato authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    d5c3626 View commit details
    Browse the repository at this point in the history
  6. pytest: wait until mock is called for set_feerates.

    Got a spurious failure in test_no_fee_estimate; we fired too soon from the logs (presumably
    we raced in on the first response, but estimatesmartfee gets called 3 times).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    e41e1a1 View commit details
    Browse the repository at this point in the history
  7. hsmd: reorder functions (MOVEONLY).

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    72e7856 View commit details
    Browse the repository at this point in the history
  8. hsmd: rename per-peer to per-channel.

    And remove cut&paste of derive_peer_seed.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    3e63d88 View commit details
    Browse the repository at this point in the history
  9. hsmd: implement bitcoin_key() to subsume bitcoin_pubkey and bitcoin_k…

    …eypair.
    
    This mirrors the node_key() interface we already have.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    1e4e476 View commit details
    Browse the repository at this point in the history
  10. lightningd: accept hsmstatus_client_bad_request messages (and log!)

    We currently just ignore them.  This is one reason the hsm (in some places)
    explicitly calls log_broken so we get some idea.
    
    This was the only subdaemon which had a NULL msgcb and msgname, so eliminate
    those checks in subd.c.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    da9d929 View commit details
    Browse the repository at this point in the history
  11. hsmd: use status_conn to send bad_request messages, make handlers uni…

    …form.
    
    The current code sends hsmstatus_client_bad_request via the req fd;
    this won't work, since lightningd uses that synchronously and only
    expects a reply to its commands.  So send it via status_conn.
    
    We also enhance hsmstatus_client_bad_request to include details, and
    create convenience functions for it.  Our previous handling was ad-hoc;
    we sometimes just closed on the client without telling lightningd,
    and sometimes we didn't tell lightningd *which* client was broken.
    
    Also make every handler the exact same prototype, so they now use the
    exact same patterns (hsmd *only* handles requests, makes replies).
    
    I tested this manually by corrupting a request to hsmd.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    6b6b7ea View commit details
    Browse the repository at this point in the history
  12. hsmd: move HTLC TX signing next to commitment TX signing.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    f8df069 View commit details
    Browse the repository at this point in the history
  13. hsmd: remove hsmd/client.c

    It was only used by handshake.c.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    8f1f178 View commit details
    Browse the repository at this point in the history
  14. hsmd: rename hsm_client_wire_csv to hsm_wire.csv

    That matches the other CSV names (HSM was the first, so it was written
    before the pattern emerged).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    e012e94 View commit details
    Browse the repository at this point in the history
  15. hsmd: extract and use common sign_all_inputs() helper.

    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    cc48e79 View commit details
    Browse the repository at this point in the history
  16. lightningd: use hsm_get_client_fd() helper for global daemons too.

    We couldn't use it before because it asserted dbid was non-zero.  Remove
    assert and save some code.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    
    
    
    Header from folded patch 'fixup!_lightningd__use_hsm_get_client_fd()_helper_for_global_daemons_too.patch':
    
    fixup! lightningd: use hsm_get_client_fd() helper for global daemons too.
    
    Suggested-by: @ZmnSCPxj
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    04c77f4 View commit details
    Browse the repository at this point in the history
  17. hsmd: document as part II of our journey.

    Thanks greatly to the four people who I *know* have read this:
    
    	@wythe, @ZmnSCPxj, @SimonVrouwe, and @cdecker
    
    Your feedback will help future developers seeking enlightenment!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    573f2f0 View commit details
    Browse the repository at this point in the history
  18. hsmd: don't use daemon_conn for clients.

    It offers them a DoS vector, if they don't read the replies.  We really want
    to use raw ccan/io so we can avoid buffering for this.
    
    It makes the handing of fds for new clients a bit more complex
    (callback based), but it's not too bad.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    b0769d9 View commit details
    Browse the repository at this point in the history
  19. hsmd: reorder functions (MOVEONLY).

    We don't need to pre-declare any more, but I left it in the previous
    patch for review simplicity.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    019bc4f View commit details
    Browse the repository at this point in the history
  20. hsmd: remove master pointer.

    We used to use it to complain about bad requests, but we use the status conn
    now, so it's unused except for tests and asserts.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
    rustyrussell authored and cdecker committed Sep 20, 2018
    Configuration menu
    Copy the full SHA
    5b2e829 View commit details
    Browse the repository at this point in the history