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

Make impl_writeable_tlv_based_enum* actually upgradable #3160

Commits on Jul 17, 2024

  1. Make impl_writeable_tlv_based_enum* actually upgradable

    In cc78b77 it was discovered that
    `impl_writeable_tlv_based_enum_upgradable` wasn't actually
    upgradable - tuple variants weren't written with length-prefixes,
    causing downgrades with new tuple variants to be unreadable by
    older clients as they wouldn't know where to stop reading.
    
    This was fixed by simply assuming that any new variants will be
    non-tuple variants with a length prefix, but no code write-side
    changes were made, allowing new code to freely continue to use the
    broken tuple-variant serialization.
    
    Here we address this be defining yet more serialization macros
    which aren't broken, and convert existing usage of the existing
    macros using non-length-prefixed tuple variants to renamed
    `*_legacy` macros.
    
    Note that this changes the serialization format of
    `impl_writeable_tlv_based_enum[_upgradable]` when tuple fields are
    written, and as such deliberately changes the call semantics for
    such tuples.
    
    Only the serialization format of `MessageContext` is changed here
    which is fine as it has not yet reached a release of LDK.
    TheBlueMatt committed Jul 17, 2024
    Configuration menu
    Copy the full SHA
    72f883e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1d1f47c View commit details
    Browse the repository at this point in the history