Skip to content

Make TransactionType upgradable before it ships #1226

Open

Description

@xstoicunicornx

TransactionType is decoded with impl_writeable_tlv_based_enum!, which rejects any variant it doesn't know. Once a release ships, any variant added later makes payment records unreadable for nodes on that release. Switching to impl_writeable_tlv_based_enum_upgradable! and reading tx_type and self_role as upgradable_option changes four lines and leaves the bytes on disk the same. With that change, an older node reads an unknown odd variant as None and still rejects an unknown even one.

Proposed change is implemented here: 9ad2849

Precedent

  • ldk-node already reads LDK's ClosureReason and PaymentFailureReason this way (src/event.rs:343, :369).
  • LDK defines both of those types with impl_writeable_tlv_based_enum_upgradable!, and uses that macro for 19 types in all.

Activity

  1. added this to the 0.8 milestone on Nov 10, 2026
  2. tnull commented on Nov 10, 2026

    @tnull
    Collaborator

    Yeah, probably makes sense/doesn't hurt. Will put up PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions