Skip to content
Permalink
Tag: v0.4-2016-08-19
Commits on Aug 19, 2016
  1. 0.4: Wright's Cryptographic Proof

    rustyrussell committed Aug 19, 2016
    Christian Decker moved us to libbase58 and off openssl; he got to name
    this release.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  2. INSTALL: update requirements.

    rustyrussell committed Aug 19, 2016
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  3. json_commit: document usage correctly.

    rustyrussell committed Aug 19, 2016
    It's pretty horrible to hand the entire tx, but at least document it.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Commits on Aug 18, 2016
  1. daemon: --add-route option.

    rustyrussell committed Aug 18, 2016
    This allows hardcoded routes in the config file, which is required until
    we get route advertisements.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  2. peer: keep addresses separately from peers.

    rustyrussell committed Aug 18, 2016
    This makes more sense eventually: we may know the network addresses of
    many peers, not just those we're connecting to.  So keep a mapping, and
    update it when we successfully connect outwards.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  3. db: forget peer properly.

    rustyrussell committed Aug 18, 2016
    Otherwise, if they reconnect, we get a database error.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  4. peer: restart from the other side.

    rustyrussell committed Aug 18, 2016
    Testing this revealed that we can't just reconnect when we have something to
    send, as we might be NATed; we should try to reconnect anyway.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  5. daemon: test restarting.

    rustyrussell committed Aug 18, 2016
    We add a "dev-restart" command which causes the daemon to close fds
    and exec itself.  Then we do it after every command, with the caveat
    that we always send a commit before newhtlc, because if not committed,
    that is forgotten.  Fulfillhtlc and failhtlc get resent, since they're
    idempotent.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  6. peer: save/load results in database.

    rustyrussell committed Aug 18, 2016
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  7. db.c: database API.

    rustyrussell committed Aug 18, 2016
    These tables could use a rework, as they largely reflect our internal
    state.  But it's a start.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  8. Minor cleanups: things found while debugging the database code.

    rustyrussell committed Aug 18, 2016
    1. Fix #ifdef DEBUG code in signature.c so it compiles.
    2. Don't set peer->closing.our_script in queue_pkt_close_shutdown: it's
       assigned in caller already.
    3. Wrap setting of htlc's rval in set_htlc_rval() function.
    4. Log where we were when unexpected packet comes in.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  9. peer: split and expose new_peer function.

    rustyrussell committed Aug 18, 2016
    More of a pure allocator, for when we load peers from db.  Also moves
    shachain_init out of secrets and into new_peer where it logically
    belongs.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  10. peer: add flag to indicate whether we created anchor.

    rustyrussell committed Aug 18, 2016
    Useful for database.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  11. commit_tx: more debugging.

    rustyrussell committed Aug 18, 2016
    Sometimes you need a bigger hammer.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  12. peer: set up peer->nc only when in state NORMAL.

    rustyrussell committed Aug 18, 2016
    This ensures we don't try to route before we're set up, or once we're
    shutting down.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  13. routing: use ids, not nodes in interface.

    rustyrussell committed Aug 18, 2016
    Turns out to be more convenient.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  14. protocol: no signature in update_commit if receiver has no outputs.

    rustyrussell committed Aug 18, 2016
    So if there are no HTLCs, and the receiver can't spend anyway, don't
    sign.  This has the added benefit that no two signed commitment
    transactions will ever be identical (the revocation preimage changes).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  15. peer: use signed values for order.

    rustyrussell committed Aug 18, 2016
    This gives us a clear way to indicate "invalid", and also sqlite3 stores
    signed 64-bit numbers, so it's clearer this way.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  16. channel: use u64 for fee_rate everywhere.

    rustyrussell committed Aug 18, 2016
    It fits in a u32, but we mix it with other values which could cause
    overflow, so let's just use u64 everywhere.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  17. peer: save minimum possible depth for anchor.

    rustyrussell committed Aug 18, 2016
    We'll save this in the database so we know where to start the chain
    from when we reload.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  18. daemon: reconnect with timeout, try from both sides.

    rustyrussell committed Aug 18, 2016
    This is dumb, since one side will never succeed.  But in future when
    there is a method for nodes to broadcast their public address (or send
    their address inline to connected nodes), either side should try to
    connect.
    
    Importantly though, there are places which will queue packets at
    various times (eg. HTLC timeout), so we need to clear the queue just
    before re-transmitting, not when disconnecting.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  19. daemon: reconnect support.

    rustyrussell committed Aug 18, 2016
    To do this we keep an order counter so we know how to retransmit.  We
    could simply keep old packets, but this is a little clearer for now.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  20. protocol: rename clearing to shutdown.

    rustyrussell committed Aug 18, 2016
    As per lightning-rfc e277023be40f0dcc7ff7e818cef1e0d23547cb8c.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  21. peer: always initialize commit_info commit number, other fields.

    rustyrussell committed Aug 18, 2016
    We used to use talz, but that prevents valgrind from noticing when we use
    uninitialized fields.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  22. chaintopology: wait for full blockchain load before start.

    rustyrussell committed Aug 18, 2016
    Caught because we generated an HTLCs which had already expired, since
    we didn't know the latest block.  Other errors are certainly possible,
    so it's safest to load the entire thing before going live.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  23. bitcoind: keep running fee estimate.

    rustyrussell committed Aug 18, 2016
    This avoids us having to query it when we create anchor transaction, and
    lets us always use dynamic fee information.
    
    The config options for max and min are now percentages, rather than absolute.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  24. peer: rename closing_onchain to onchain.

    rustyrussell committed Aug 18, 2016
    The "closing" is implied.  Plus, it's too long.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  25. peer: remove commit_info's prev pointer.

    rustyrussell committed Aug 18, 2016
    This is the final step before removing old commit_infos entirely.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  26. channel: remove htlcs array.

    rustyrussell committed Aug 18, 2016
    We could put it back later for debugging, but we should be using the global
    state not this array.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  27. htlc: htlc_is_dead() helper.

    rustyrussell committed Aug 18, 2016
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  28. permute_tx: don't save permutation map.

    rustyrussell committed Aug 18, 2016
    We no longer need it anywhere.  This simplifies things to the point where
    we might as well just not include dust outputs as we go, rather than
    explicitly removing them, which gets rid of remove_dust.c as well.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  29. peer: don't use permutation map for their unilateral spends.

    rustyrussell committed Aug 18, 2016
    Similar to the way we derive which outputs are which for old transactions
    we steal, we derive them even for their current transaction.
    
    We keep track of this information in peer->closing.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  30. peer: make closing_onchain.resolved[] in tx-output order.

    rustyrussell committed Aug 18, 2016
    At the moment, for our or their unilateral close, we create a resolved[]
    entry for our output, their output, and each HTLC, in cstate order.  Some
    of these outputs might not exist (too small), so it's actually better
    to simply keep a resolved[] entry for each of the tx's actual outputs.
    
    (We already changed the steal resolved[] array to work like this, but
    these are trickier, since we rely on that order if we need to fulfill an
    on-chain HTLC).
    
    It also helps as we are weaning off knowing the cstate and permutation
    mapping for each commitment transaction.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  31. peer: explicitly store the previous revocation hash when sending new …

    rustyrussell committed Aug 18, 2016
    …update.
    
    We want to stop keeping old commitment information (except the minimal
    txid to commitment-number mapping).  One place we currently use it is
    after sending a commitment signature, and before we've received the
    revocation for the old commitment.  For this duration, there are two
    valid commitment transactions.
    
    So we store "their_prev_revocation_hash" explicitly for this duration.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  32. daemon: use htlc id for fulfillhtlc and failhtlc commands.

    rustyrussell committed Aug 18, 2016
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Older
You can’t perform that action at this time.