Skip to content

smite: name the temporary_channel_id with a type alias - #226

Merged
morehouse merged 1 commit into
lnfuzz:masterfrom
erickcestari:temporary-channel-id-alias
Sep 2, 2026
Merged

smite: name the temporary_channel_id with a type alias#226
morehouse merged 1 commit into
lnfuzz:masterfrom
erickcestari:temporary-channel-id-alias

Conversation

@erickcestari

Copy link
Copy Markdown
Contributor

open_channel and its replies carry a temporary_channel_id that is a plain ChannelId on the wire, so every field and map keyed by it read as just another channel id. In particular, a signature such as HashMap<ChannelId, PendingChannel> did not say which of the two ids it was keyed by.

Add TemporaryChannelId as an alias rather than a newtype: the wire format is identical and the compiler still treats both as one type, so this only documents which id a value holds, at no cost to the callers.

@ekzyis ekzyis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

utACK 6a92930

@morehouse morehouse left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We also should convert Violation::InvalidAcceptChannel.

Comment thread smite/src/bolt.rs
`open_channel` and its replies carry a `temporary_channel_id` that is a
plain `ChannelId` on the wire, so every field and map keyed by it read
as just another channel id. In particular, a signature such as
`HashMap<ChannelId, PendingChannel>` did not say which of the two ids
it was keyed by.

Add `TemporaryChannelId` as an alias rather than a newtype: the wire
format is identical and the compiler still treats both as one type, so
this only documents which id a value holds, at no cost to the callers.
@erickcestari
erickcestari force-pushed the temporary-channel-id-alias branch from 6a92930 to abe835b Compare September 2, 2026 18:02

@morehouse morehouse left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@morehouse
morehouse merged commit d0b2679 into lnfuzz:master Sep 2, 2026
5 checks passed
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