Repository navigation
Conversation
|
👋 Thanks for assigning @jkczyz as a reviewer! |
There was a problem hiding this comment.
Thanks, this LGTM.
I noticed ChannelOutputRole and SpliceKind have the same issue. Both are new this cycle and still use the plain impl_writeable_tlv_based_enum!, so adding a variant to either would break reading the store after a downgrade. Could we fix them here or in a follow-up before the release?
Nit: the docs on PaymentKind::Onchain::tx_type list the reasons it can be None. It would help to add: "the transaction was classified by a newer version of LDK Node using a type this version doesn't recognize."
8ad902d to
6793d00
Compare
Hmm, briefly considered it, but at least for @jkczyz Thoughts? Worth now, or just when something breaks in the future? |
FWIW, Regarding, |
Sounds good! |
|
@jkczyz Gentle ping here. |
Is the plan to open a PR upstream for the release? See below for details and additionally about 🤖 I'd do I looked at fixing the macro upstream. Two things are missing there:
I can add that macro upstream, but we'd need it backported to 0.3 before our release. So I'd write That's about 45 lines plus a test. Reading
|
TransactionType was serialized with impl_writeable_tlv_based_enum, which fails to read any variant it doesn't know, odd or even. A node reading a payment classified with a later variant would fail to decode the whole PaymentDetails, and with it the payment store. No release writes tx_type yet, so the reader can still change for free. Serialize TransactionType with impl_writeable_tlv_based_enum_upgradable and read both fields holding one, PaymentKind::Onchain's tx_type and ChannelTxFacts' self_role, as upgradable_option, as we already do for LDK's ClosureReason and PaymentFailureReason. An unknown odd variant now reads as no classification, while an unknown even one is still required. The written bytes are unchanged. Written with the help of Claude Code.
LeaseCacheTargetId was serialized with impl_writeable_tlv_based_enum, which fails on any variant it doesn't know. A downgraded node reading a cache target written with a later variant would fail to read all targets, and with it fail to build. No release writes cache targets yet, so the reader can still change. Serialize LeaseCacheTargetId as upgradable and persist targets through a private stored form whose id is read as upgradable_option, dropping targets with an unknown odd variant while an unknown even one still fails. This keeps the in-memory id non-optional without hand-writing serialization, and the written bytes are unchanged. Written with the help of Claude Code. Co-Authored-By: HAL 9000
6793d00 to
1dad1a3
Compare
Now added a commit for @jkczyz let me know if you prefer to take that one over though, given you might already have a new macro variant in mind that avoids breaking the serialization as we do in that PR rn. |
Closes #1226