Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: lightningdevkit/rust-lightning
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: optout21/rust-lightning
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 10 commits
  • 14 files changed
  • 2 contributors

Commits on Apr 8, 2024

  1. Fix unknown handling in impl_writeable_tlv_based_enum_upgradable

    `impl_writeable_tlv_based_enum_upgradable` professed to supporting
    upgrades by returning `None` from `MaybeReadable` when unknown
    variants written by newer versions of LDK were read. However, it
    generally didn't support this as it didn't discard bytes for
    unknown types, resulting in corrupt reading.
    
    This is fixed here for enum variants written as a TLV stream,
    however we don't have a length prefix for tuple enum variants, so
    the documentation on the macro is updated to mention that
    downgrades are not supported for tuple variants.
    TheBlueMatt committed Apr 8, 2024
    Copy the full SHA
    499ca93 View commit details
  2. Ensure we read the full TLV stream length when maybe-reading None

    If we are reading an object that is `MaybeReadable` in a TLV stream
    using `upgradable_required`, it may return early with `Ok(None)`.
    In this case, it will not read any further TLVs from the TLV
    stream. This is fine, except that we generally expect
    `MaybeReadable` always consume the correct number of bytes for the
    full object, even if it doesn't understand it.
    
    This could pose a problem, for example, in cases where we're
    reading a TLV-stream `MaybeReadable` object inside another
    TLV-stream object. In that case, the `MaybeReadable` object may
    return `Ok(None)` and not consume all the available bytes, causing
    the outer TLV read to fail as the TLV length does not match.
    TheBlueMatt committed Apr 8, 2024
    Copy the full SHA
    bdf5a6f View commit details
  3. Allow MaybeReadable to not fully read in upgradable_option

    Whils this is generally not supported, issues in our
    `MaybeReadable` implementations may occur, and we should try to be
    robust against them.
    TheBlueMatt committed Apr 8, 2024
    Copy the full SHA
    f8b0800 View commit details

Commits on Apr 9, 2024

  1. Fix blinded path serialization in Route

    `Route`'s blinded_path serialization logic writes a blinded path
    `Option` per path hop, however on read we (correctly) only read one
    blinded path `Option` per path. This causes serialization of
    `Route`s with blinded paths to fail to round-trip.
    
    Here we fix this by writing blinded paths per path.
    TheBlueMatt committed Apr 9, 2024
    Copy the full SHA
    d429065 View commit details
  2. Fix Route serialization round-trip

    When the `max_total_routing_fee_msat` parameter was added to
    `RouteParameters`, the serialization used `map` to get the max fee,
    accidentally writing an `Option<Option<u64>>`, but then read it as
    an `Option<u64>`. Thus, any `Route`s with a `route_params` written
    will fail to be read back.
    
    Luckily, this is an incredibly rarely-used bit of code, so only one
    user managed to hit it.
    TheBlueMatt committed Apr 9, 2024
    Copy the full SHA
    72c4eb8 View commit details
  3. Avoid writing ChannelManager when hitting lnd bug 6039

    When we hit lnd bug 6039, we end up sending error messages to peers
    in a loop. This should be fine, but because we used the generic
    `PersistenceNotifierGuard::notify_on_drop` lock above the specific
    handling, we end up writing `ChannelManager` every time we manage a
    round-trip to our peer.
    
    This can add up quite quickly, and isn't actually changing, so we
    really need to avoid writing the `ChannelManager` in this case.
    TheBlueMatt committed Apr 9, 2024
    Copy the full SHA
    271103d View commit details
  4. Copy the full SHA
    84bc535 View commit details
  5. Copy the full SHA
    bcea4fa View commit details
  6. Copy the full SHA
    66ebe7e View commit details
  7. Merge pull request #2985 from TheBlueMatt/2024-03-fix-upgradable-enum…

    …-121
    
    Cut 0.0.122 with just #2969, #2897, and #2937
    TheBlueMatt authored Apr 9, 2024
    Copy the full SHA
    27e5519 View commit details
Loading