Skip to content

Rethink serialization #30

Closed
Closed

Description

@tnull

We started off reusing the same approach towards serialization as upstream LDK and planned to also reuse the macros in #23. However, as this is always a pain point upstream, we should rethink whether we really want to take the same approach.

In particular, can we create a different approach towards serialization in which:

  • All fields are not only length but version-prefixed
  • The type as which they are serialized is explicitly stated to make any difference to the data type transparent.
  • Migrations between versions have to be explicitly implemented for clarity and hopefully even type checked?

Activity

  1. tnull commented on Nov 3, 2022

    @tnull
    CollaboratorAuthor

    Matt gave some thoughts in #10 (comment). In particular, he brought up that we may not need/want forwards compatibility, which should make things quite a bit simpler

  2. TheBlueMatt commented on Nov 4, 2022

    @TheBlueMatt
    Contributor

    Yea, but it needs to be a deliberate decision - not allowing forwards-compat (ie not allowing users to downgrade to a previous LDK version if they have issues) is a big drawback for users, but we have to weigh that against the support complexity.

  3. TheBlueMatt commented on Jan 8, 2023

    @TheBlueMatt
    Contributor

    When we decide if ldk-node supports downgrades we should also revisit #10 (comment)

  4. tnull commented on Feb 10, 2023

    @tnull
    CollaboratorAuthor

    Our persister should allow to specify a secondary location for backups.

  5. added this to the 0.1 milestone on Mar 13, 2023
  6. tnull commented on Apr 27, 2023

    @tnull
    CollaboratorAuthor

    After a long time debating the pros and cons I ended up deciding that it's not worth the effort of reimplementing serialization in a different format. LDK Node post 0.1 will therefore stick with upstream's serialization framework, format, and forward+backwards compat guarantees.

    However, we should eventually offer optional serde support for public types (#75) and will document any compat changes in question explicitly in a doc (#74), which will should allow us to clean up the codebase when possible.

  7. added a commit that references this issue on Jan 28, 2026
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

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions