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

Run with mutagen on travis. #453

Closed
wants to merge 33 commits into from

Commits on Jan 25, 2020

  1. Configuration menu
    Copy the full SHA
    bbeadbc View commit details
    Browse the repository at this point in the history
  2. Flatten OnionHopData struct with the Realm0 struct.

    Previously OnionHopData contained a OnionRealm0HopData field however
    instead of bumping the realm number, it has been replaced with a
    length, used to indicte the length of a TLV-formatted object.
    
    Because a TLV-formatted hop data can contain the same information as
    a realm-0 hop data, we flatten the field and simply keep track of
    what format it was in.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    b3dd229 View commit details
    Browse the repository at this point in the history
  3. Pull hmac out of OnionHopData.

    Its a bit awkward to have an hmac field covering the struct that
    its in, and there is little difference in removing it, so just pull
    it out and use a [u8; 32] where we care about the hmac.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    0b40b0c View commit details
    Browse the repository at this point in the history
  4. Move BogusHopData generation into test instead of OnionHopData.

    This, as it should be, restricts OnionHopData to only being able to
    represent valid states, while still allowing for tests to generate
    bogus hop data fields to test deserialization.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    32c245b View commit details
    Browse the repository at this point in the history
  5. Add a ChaChaReader adapter to read an encrypted stream & use it

    This prepares for variable-length per-hop-data by wrapping the full
    hop_data field in a decrypting stream, with a few minor
    optimizations and redundant allocations to boot.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    9552082 View commit details
    Browse the repository at this point in the history
  6. Add macros for building TLV (de)serializers.

    There's quite a bit of machinery included here, but it neatly
    avoids any dynamic allocation during TLV deserialization, and the
    calling side looks nice and simple. There's a few new state-tracking
    read/write streams, but they should be pretty cheap (just a few
    increments/decrements per read/write. The macro-generated code is
    pretty nice, though has some redundant if statements (I haven't
    checked if they get optimized out yet, but I can't imagine they
    don't).
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    12c7eba View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e7ce124 View commit details
    Browse the repository at this point in the history
  8. Use RouteHop's new node_features to send TLV-encoded onion hops

    This implements the new TLV variable-length encoding for onion hop
    data, opting to send it if the RouteHop's node_features indicates
    support. It also uses the new process_inline method in ChaCha20 to
    optimize a few things (though it grows a new TODO for a
    probably-important optimization).
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    b341d68 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    4cde6f4 View commit details
    Browse the repository at this point in the history
  10. Allow node_announcement timestamps of 0 in accordance with BOLT 7

    Unlike channel_update messages, node_announcement messages have no
    requirement that the timestamp is greater than 0.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    6883f9d View commit details
    Browse the repository at this point in the history
  11. Add ability to broadcast our own node_announcement.

    This is a somewhat-obvious oversight in the capabilities of
    rust-lightning, though not a particularly interesting one until we
    start relying on node_features (eg for variable-length-onions and
    Base AMP).
    
    Sadly its not fully automated as we don't really want to store the
    list of available addresses from the user. However, with a simple
    call to ChannelManager::broadcast_node_announcement and a sensible
    peer_handler, the announcement is made.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    06d2a07 View commit details
    Browse the repository at this point in the history
  12. Avoid treating option_upfront_shutdown (req) as unknown_required.

    This fixes the bitmask in requires_unknown_bits.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    7d68813 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    e36d78c View commit details
    Browse the repository at this point in the history
  14. Clarify the in-flight HTLC state-tracking structs a bit.

    This also renames PendingForwardHTLCInfo to PendingHTLCInfo since
    it now also encompasses Pending *Received* HTLCs.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    9cfc6e9 View commit details
    Browse the repository at this point in the history
  15. Split only-receive/forward data out of PendingHTLCInfo into an enum

    This should avoid blowing up the size of the struct when we add
    additional data that is only relevant for receive.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    ae3c878 View commit details
    Browse the repository at this point in the history
  16. Support (de)serializing payment_data in onion TLVs and track them

    This is the first step in Base AMP support, just tracking the
    relevant data in internal datastructures.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    8e82808 View commit details
    Browse the repository at this point in the history
  17. Refuse to deserialize OnionHopDatas with values > 21 million

    We should probably do this for all values (and define a newtype
    for msat values), but this will do for now.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    5894543 View commit details
    Browse the repository at this point in the history
  18. Impl Base AMP in the receive pipeline and expose payment_secret

    Sadly a huge diff here, but almost all of it is changing the method
    signatures for sending/receiving/failing HTLCs and the
    PaymentReceived event, which all now need to expose an
    Option<[u8; 32]> for the payment_secret.
    
    It doesn't yet properly fail back pending HTLCs when the full AMP
    payment is never received (which should result in accidental
    channel force-closures). Further, as sending AMP payments is not
    yet supported, the only test here is a simple single-path payment
    with a payment_secret in it.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    f24c725 View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    4c4d221 View commit details
    Browse the repository at this point in the history
  20. Expand the Route object to include multiple paths.

    Rather big diff, but its all mechanical and doesn't introduce any
    new features.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    2274482 View commit details
    Browse the repository at this point in the history
  21. Implement multipath sends using payment_secret.

    This rather dramatically changes the return type of send_payment
    making it much clearer when resending is safe and allowing us to
    return a list of Results since different paths may have different
    return values.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    4bc2b67 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    f7ef025 View commit details
    Browse the repository at this point in the history
  23. Time out incoming HTLCs when we reach cltv_expiry (+ test)

    We only do this for incoming HTLCs directly as we rely on channel
    closure and HTLC-Timeout broadcast to fail any HTLCs which we
    relayed onwards where our next-hop doesn't update_fail in time.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    87372e9 View commit details
    Browse the repository at this point in the history
  24. Time out AwatingRemoteRAA outgoing HTLCs when we reach cltv_expiry

    In case of committing out-of-time outgoing HTLCs, we force
    ourselves to close the channel to avoid remote peer claims on a
    non-backed HTLC
    Antoine Riard authored and TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    35350bc View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    367602f View commit details
    Browse the repository at this point in the history
  26. Fix EnforcingChannelKeys panic when our counterparty burns their $.

    If our counterparty burns their funds by revoking their current
    commitment transaction before we've sent them a new one, we'll step
    forward the remote commitment number. This would be otherwise fine
    (and may even encourage them to broadcast their revoked state(s) on
    chain), except that our new EnforcingChannelKeys expects us to not
    jump forward in time. Since it isn't too important that we punish
    our counterparty in such a corner-case, we opt to just close the
    channel in such a case and move on.
    TheBlueMatt committed Jan 25, 2020
    Configuration menu
    Copy the full SHA
    87091f0 View commit details
    Browse the repository at this point in the history

Commits on Jan 26, 2020

  1. Configuration menu
    Copy the full SHA
    1ed82b0 View commit details
    Browse the repository at this point in the history
  2. Fix deadlock in handle_error!() when we have HTLCs to fail-back.

    This partially reverts 933ae34,
    though note that 933ae34 fixed a
    similar deadlock while introducing this one.
    
    If we have HTLCs to fail backwards, handle_error!() will call
    finish_force_close() which will attempt to lock channel_state while
    it is locked at the original caller.
    TheBlueMatt committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    baab176 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e6719f1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    739badf View commit details
    Browse the repository at this point in the history
  5. Drop individual fuzz target duplicate_crash tests for file reader

    Previously, in each of our fuzz tests we had a dummy test which
    had a hard-coded hex string which it passed into the fuzz target
    so that when a failing test case was found, its hex could be
    copied into the test and you could run cargo test to analyze the
    failure. However, this was somewhat unwieldy as converting large
    tests back and forth between hex and raw files is quite annoying.
    
    Instead, we replace each of those tests with a test in each target
    that looks for files in fuzz/test_cases and runs each file it finds.
    
    Since we're editing every bin target anyway, we also automate adding
    no_main to libfuzzer builds with #![cfg_attr].
    TheBlueMatt committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    b8dbf27 View commit details
    Browse the repository at this point in the history
  6. Panic on txn with value > 21mill in ChannelMonitor::block_connected

    full_stack_target found a crash where we may overflow ruring fee
    calculation if a transaction appears on-chain with massive value
    available for us to claim. Since these transactions are clearly
    bogus, we shouldn't allow full_stack_target to connect them, but
    we also improve the error generated by explicitly panicing on them.
    TheBlueMatt committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    d5e93c6 View commit details
    Browse the repository at this point in the history

Commits on Jan 27, 2020

  1. Run with mutagen on travis.

    Sadly our test coverage isn't very good and I had to hunt for
    functions to mutate where we fail tests on every mutation mutagen
    creates, but committing the framework is a start.
    TheBlueMatt committed Jan 27, 2020
    Configuration menu
    Copy the full SHA
    f2f7e70 View commit details
    Browse the repository at this point in the history