Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

A few small cleanups to channel read. I'm sure there's more that can be cleaned up.

e23d32d removed support for
reading ancient `Channel`s but left a bit of cleanup for later.

Here we clean up deserialization a bit by removing old v1 channel
read logic.
e23d32d removed support for
reading ancient `Channel`s but left a bit of cleanup for later.

Here we mark a few TLVs as `required` which were always written
in 0.0.113.
21ed477 got rewritten a few times before it landed and ended up
with a spurious set call which is redaundant against the parameter
passed in to `ReadableArgs`. This removes that set.
let user_id_low: u64 = Readable::read(reader)?;

let mut config = Some(LegacyChannelConfig::default());
if ver == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a few more of these further down this method

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TheBlueMatt Yeah, see #3632. Didn't see this PR before opening that. Happy to close it if you prefer.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cherry-picked the extra commit on that branch in case you want to take it.

let ver = read_ver_prefix!(reader, SERIALIZATION_VERSION);

if ver <= 2 {
return Err(DecodeError::InvalidValue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, #3632 uses UnknownVersion instead. Not sure which you'd prefer.

let user_id_low: u64 = Readable::read(reader)?;

let mut config = Some(LegacyChannelConfig::default());
if ver == 1 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cherry-picked the extra commit on that branch in case you want to take it.

@TheBlueMatt TheBlueMatt closed this Mar 3, 2025
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.

3 participants