Skip to content
Permalink
Branch: master
Commits on Jun 18, 2019
  1. CHANGELOG.md: note the db_write hook and listtransactions command.

    rustyrussell committed Jun 17, 2019
    Reported-by: @cdecker
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Commits on Jun 17, 2019
  1. lightningd: restore ' ' before '}' for older pylightning.

    rustyrussell authored and cdecker committed Jun 17, 2019
    It needs this in compat mode to detect old (pre-0.6.3) end of JSON.
    But it always does the first command in compat mode.
    
    This was never really reliable, since the first command could be to
    a plugin for which we simply pass through the JSON (though, carefully
    appending the expected '\n\n' if not already there).
    
    Reported-by: @laanwj
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Commits on Jun 15, 2019
  1. gossipd: delete channel_amount from the store when we delete channel_…

    rustyrussell authored and cdecker committed Jun 14, 2019
    …announcement.
    
    Otherwise we slowly build up cruft: compaction simply moves them since
    they're not deleted.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  2. gossip_store: clean up a truncated store.

    rustyrussell authored and cdecker committed Jun 14, 2019
    We might have channel_announcements which have no channel_update: normally
    these don't get written into the store until there is one, but if the
    store was truncated it can happen.  We then get upset on compaction, since
    we don't have an in-memory representation of the channel_announcement.
    
    Similarly, we leave the node_announcement pending until after that
    channel_announcement, leading to a similar case.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  3. pytest: add test for dangling channel_announcement/node_announcement …

    rustyrussell authored and cdecker committed Jun 14, 2019
    …after gossip_store.
    
    This can happen if the store was truncated.
    
    Reported-by: @jb55
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  4. pytest: gossip_store test for channel_amount truncated.

    rustyrussell authored and cdecker committed Jun 14, 2019
    We pass, but this test should have been added a while ago with the
    original code.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  5. pytest: gossip_store test for node_announcement before update.

    rustyrussell authored and cdecker committed Jun 14, 2019
    We pass, but this test should have been added a while ago with the fix.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Commits on Jun 14, 2019
  1. CHANGELOG.md: v0.7.1rc2

    rustyrussell committed Jun 14, 2019
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  2. gossipd: gossip_store errors after rewrite are fatal.

    rustyrussell committed Jun 14, 2019
    We can't continue, since we've moved the indexes.  We'll just crash
    anyway, as seen from bugs #2742 and #2743.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  3. gossipd: count deleted records correctly when loading gossip_store.

    rustyrussell committed Jun 14, 2019
    The result of an incorrect count was that we failed on next compaction.
    
    Fixes: #2743
    Fixes: #2742
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  4. pytest: add (xfail) test for store load miscount.

    rustyrussell committed Jun 14, 2019
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Commits on Jun 13, 2019
  1. CHANGELOG: Unreleased -> rc1

    rustyrussell committed Jun 12, 2019
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  2. CHANGELOG.md: reorder with most impactful changes at top.

    rustyrussell committed Jun 12, 2019
    And reword a few for consistency.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  3. gossipd: don't catch pending node_announcements more than once.

    rustyrussell committed Jun 13, 2019
    We catch node_announcements for nodes where we haven't finished
    analyzing the channel_announcement yet (either because we're still
    checking UTXO, or in this case, because we're waiting for a channel_update).
    
    But we reference count the pending_node_announce, so if we have
    multiple channels pending, we might try to insert it twice.  Clear it
    so this doesn't happen.
    
    There's a second bug where we continue to catch node_announcements
    until *all* the channel_announcements are no longer pending; this is fixed
    by removing it from the map.
    
    Fixes: #2735
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  4. lightningd: fix bogus channel iteration on setchannelfee

    rustyrussell committed Jun 12, 2019
    Setting channel to NULL then iterating doesn't work!
    
    Fixes: #2733
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Commits on Jun 12, 2019
  1. openingd_control: fix merge error with json_stream_success.

    rustyrussell committed Jun 12, 2019
    That was changed to start the response object, which broke the openingd
    code once we merged.
    
    Of course, I should have *renamed it* when I changed the semantic!
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  2. openingd: fix compile error caused by merge.

    rustyrussell committed Jun 12, 2019
    Compile broke because we were using low-level JSON primitives here
    (which, incidentally, would produce bad JSON now, since we can't just
    put a raw string inside an object!).
    
    Use json_add_string, which also has the benefit of escaping JSON
    for us.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  3. plugin: don't call notification after free.

    rustyrussell committed Jun 12, 2019
    This is an old bug, where a plugin can get called while we're shutting
    down (and have freed plugins), but it's triggered more reliably by the
    new warning notification hook.
    
    For good measure, we also make freeing a plugin self-delete.
    
    Valgrind error file: valgrind-errors.16763
    ==16886== Invalid read of size 8
    ==16886==    at 0x422919: plugins_notify (plugin.c:1096)
    ==16886==    by 0x413919: notify_warning (notification.c:61)
    ==16886==    by 0x412BDE: logv (log.c:251)
    ==16886==    by 0x412A98: log_ (log.c:311)
    ==16886==    by 0x4044BE: bcli_finished (bitcoind.c:178)
    ==16886==    by 0x459480: destroy_conn (poll.c:244)
    ==16886==    by 0x459499: destroy_conn_close_fd (poll.c:250)
    ==16886==    by 0x4619E1: notify (tal.c:235)
    ==16886==    by 0x461A7E: del_tree (tal.c:397)
    ==16886==    by 0x461AB5: del_tree (tal.c:407)
    ==16886==    by 0x461AB5: del_tree (tal.c:407)
    ==16886==    by 0x461AB5: del_tree (tal.c:407)
    ==16886==  Address 0x634a578 is 40 bytes inside a block of size 352 free'd
    ==16886==    at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==16886==    by 0x461AFD: del_tree (tal.c:416)
    ==16886==    by 0x461FB7: tal_free (tal.c:481)
    ==16886==    by 0x411E0A: main (lightningd.c:841)
    ==16886==  Block was alloc'd at
    ==16886==    at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
    ==16886==    by 0x4617CE: allocate (tal.c:245)
    ==16886==    by 0x461E4C: tal_alloc_ (tal.c:423)
    ==16886==    by 0x42255E: plugins_new (plugin.c:106)
    ==16886==    by 0x41133D: new_lightningd (lightningd.c:218)
    ==16886==    by 0x411AD4: main (lightningd.c:649)
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  4. jsonrpc: don't return "stop" until we actually have freed resources.

    rustyrussell committed Jun 12, 2019
    This is a painpoint with testing, that there's a noticable delay between
    "Shutting down" from lightning-cli and being able to restart lightningd.
    
    This fixes that by creating a canned response for this case, which is
    simply written out immediately before exit.  At this point, the pidfile
    has been deleted, the sockets have been closed, and the database
    has been closed.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  5. lightningd: use ccan/json_out.

    rustyrussell committed Jun 12, 2019
    This is now a fairly simple transition, which only effects the internals
    of json_stream.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  6. lightningd: tighten interal json_stream API.

    rustyrussell committed Jun 12, 2019
    Move it closer to ccan/json_out, in preparation for using that as a
    replacement.
    
    In particular:
    
    1. Add a 'quote' field in json_add_member.
    2. json_add_member now always escapes if 'quote' is true.
    3. json_member_direct is exposed to allow avoiding of escaping.
    4. json_add_hex can use this, so no longer needs to be in json_stream.c.
    5. We don't make JSON manually, but always use helpers.
    6. We now flush the stream (wake reader) only when we close it, or mark
       command as pending.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  7. pylightning: remove 0.6.2 JSON compat wedge.

    rustyrussell committed Jun 12, 2019
    The next commit breaks it: `if b' }\n' not in buff:` is always true since
    we're about to clean up our JSON so there won't be a space.  I could have
    hacked the space in our JSON, but 6 months is long enough anyway.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  8. lightningd: have json_stream_success start the "result" object.

    rustyrussell committed Jun 12, 2019
    "result" should always be an object (so that we can add new fields),
    so make that implicit in json_stream_success.
    
    This makes our primitives well-formed: we previously used NULL as our
    fieldname when calling the first json_object_start, which is a hack
    since we're actually in an object and the fieldname is 'result' (which
    was already written by json_object_start).
    
    There were only two cases which didn't do this:
    1. dev-memdump returned an array.  No API guarantees on this.
    2. shutdown returned a string.
    
    I temporarily made shutdown return an empty object, which shouldn't
    break anything, but I want to fix that later anyway.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  9. plugins/pay: use proper JSON construction for failure paths.

    rustyrussell committed Jun 12, 2019
    The string cut & paste hack was nasty; make ->failure a json_out
    object so we can splice it in properly.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  10. libplugin: update API to use json_out.

    rustyrussell committed Jun 12, 2019
    We now hand around struct json_out members, rather than using formatted
    strings, so plugins need to construct them properly.
    
    There's no automatic conversion between ' and " any more, so those
    are eliminated too.  pay still uses some manual construction of elements.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  11. libplugin: use json_out internally.

    rustyrussell committed Jun 12, 2019
    Since this handles escaping for us, this automatically fixes our previous
    escaping issued.
    
    Fixes: #2612
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  12. ccan: import ccan/json_out and ccan/json_escape.

    rustyrussell committed Jun 12, 2019
    These are generalized from our internal implementations.
    
    The main difference is that 'struct json_escaped' is now 'struct
    json_escape', so we replace that immediately.
    
    The difference between lightningd's json-writing ringbuffer and the
    more generic ccan/json_out is that the latter has a better API and
    handles escaping transparently if something slips through (though
    it does offer direct accessors so you can mess things up yourself!).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  13. plugins/pay: don't retry routehint if it contains already-eliminated …

    rustyrussell committed Jun 12, 2019
    …channel.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  14. plugins/pay: fix attempt counter on failure message.

    rustyrussell committed Jun 12, 2019
    An "attempt" is when we actually try to send, not every route lookup
    we do.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  15. gossipd: adjust gossip filters if we discover we're missing gossip.

    rustyrussell committed Jun 11, 2019
    We pick up to three random peers and ask them to gossip more.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  16. gossipd: control gossip level so we don't get flooded by peers.

    rustyrussell committed Jun 11, 2019
    We seek a certain number of peers at each level of gossip; 3 "flood"
    if we're missing gossip, 2 at 24 hours past to catch recent gossip, and
    8 with current gossip.  The rest are given a filter which causes them
    not to gossip to us at all.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  17. gossipd: reset gossip_missing if no reports for 10 minutes.

    rustyrussell committed Jun 11, 2019
    An arbitrary timeout.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  18. gossipd: query unknown short_channel_ids, note if they were really mi…

    rustyrussell committed Jun 11, 2019
    …ssing.
    
    The first sign that we're missing gossip is that we get a channel_update
    for an unknown channel.  The peer might be wrong (or lying), but if it turns
    out to be a real channel, we were definitely missing something.
    
    This patch does two things: queries when we get an unknown channel_update,
    and then notes that a channel_announcement was from such an update when
    it's finally processed.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  19. gossipd: APIs return more information about routing message handling.

    rustyrussell committed Jun 11, 2019
    In particular, we'll need to know the short_channel_id if a
    channel_update is unknown (implies we're missing a channel), and whether
    processing a pending channel_announcement was successful (implies that
    the channel was real).
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  20. gossipd: prepare for internally-generated short-channel-id queries.

    rustyrussell committed Jun 11, 2019
    Up until now we only generated these in dev mode for testing.  Hoist
    into common code, turn counter into a flag (we're only allowed one!)
    and note if query is internal or not.
    
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Older
You can’t perform that action at this time.