Skip to content

fix: remove backward compatibility heuristic for DlcOffer protocol version#237

Merged
matthewjablack merged 1 commit intomasterfrom
fix/dlc-offer-protocol-version-parsing
Apr 8, 2026
Merged

fix: remove backward compatibility heuristic for DlcOffer protocol version#237
matthewjablack merged 1 commit intomasterfrom
fix/dlc-offer-protocol-version-parsing

Conversation

@matthewjablack
Copy link
Copy Markdown
Contributor

@matthewjablack matthewjablack commented Apr 4, 2026

Summary

  • Removes backward compatibility heuristic from DlcOffer deserialization
  • Protocol version is now always read as 4-byte u32 per dlcspecs PR fix: remove expiration parameter #163
  • Eliminates complex detection logic that attempted to differentiate old vs new formats

Changes

The previous implementation used a heuristic to detect whether a DlcOffer message contained a protocol_version field by peeking at the next 5 bytes and checking if they
looked like a reasonable protocol version (1-10) followed by a zero contract_flags byte.

This change removes that complexity and always expects the protocol_version field to be present as a 4-byte u32, which aligns with the current dlcspecs specification.

Test plan

  • Existing DlcOffer serialization/deserialization tests pass
  • Integration tests with current DLC implementations work correctly
  • No regression in parsing valid DlcOffer messages

…rsion

Remove the heuristic-based backward compatibility logic that was attempting to
differentiate between old and new DlcOffer formats. The protocol_version field
is now always read as a 4-byte u32 as specified in dlcspecs PR #163.

This simplifies the parsing logic and ensures consistent handling of the
protocol version field across all DlcOffer messages.
@matthewjablack matthewjablack merged commit 57eeebc into master Apr 8, 2026
2 checks passed
@matthewjablack matthewjablack deleted the fix/dlc-offer-protocol-version-parsing branch April 8, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant