Skip to content

smite-ir: add LoadShortChannelId operation - #96

Merged
morehouse merged 1 commit into
lnfuzz:masterfrom
devvaansh:load-short-channel-id
May 28, 2026
Merged

morehouse merged 1 commit into
lnfuzz:masterfrom
devvaansh:load-short-channel-id

Conversation

@devvaansh

Copy link
Copy Markdown
Contributor

Short channel IDs are needed for BOLT 7 gossip messages such as
channel_announcement and channel_update.

A short channel ID encodes the block height, transaction index, and
output index of the funding transaction as a packed u64.

Part of #71.

@devvaansh devvaansh changed the title smite-ir: add LoadShortChannelId operation smite-ir: add LoadShortChannelId operation May 24, 2026
@devvaansh
devvaansh force-pushed the load-short-channel-id branch 3 times, most recently from 259fe5e to d5605a0 Compare May 24, 2026 20:19
@devvaansh
devvaansh force-pushed the load-short-channel-id branch 3 times, most recently from 629a759 to 5c3b42f Compare May 26, 2026 21:18
Comment thread smite-ir/src/operation.rs Resolved
Comment thread smite-ir/src/variable.rs Resolved
Comment thread smite-ir/src/operation.rs Resolved
@devvaansh
devvaansh force-pushed the load-short-channel-id branch from 5c3b42f to 1876e6c Compare May 27, 2026 16:40
Comment thread smite-ir/src/operation.rs Resolved
@devvaansh
devvaansh force-pushed the load-short-channel-id branch from ca9ce89 to 2480e5b Compare May 27, 2026 20:07
Comment thread smite-ir/src/operation.rs Resolved
Comment thread smite/src/bolt/types.rs Resolved
Comment thread smite-ir/src/builder.rs Outdated
Comment on lines +142 to +146
VariableType::BlockHeight => self.append(Operation::LoadBlockHeight(rng.random()), &[]),
VariableType::Timestamp => self.append(Operation::LoadTimestamp(rng.random()), &[]),
VariableType::ShortChannelId => {
self.append(Operation::LoadShortChannelId(rng.random()), &[])
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

VariableType::ShortChannelId comes right after VariableType::ChannelId in the enum order, So I think we should preserve that ordering here as well

Comment thread smite-ir/src/tests.rs
@@ -1297,6 +1297,39 @@ fn param_mutator_changes_mined_num_blocks() {
);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit: could also add LoadShortChannelId to the postcard_roundtrip tests as well

Comment on lines +460 to +461
/// Interesting boundary values for the 16-bit SCID `output_index` component.
const INTERESTING_SCID_OUTPUT_INDEX: &[u16] = &[0, 1, u16::MAX / 2, u16::MAX - 1, u16::MAX];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This does not look very useful to me. Isn’t this already covered by INTERESTING_U16?

@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

Copy link
Copy Markdown
Collaborator

Please squash before merging.

@devvaansh
devvaansh force-pushed the load-short-channel-id branch from 2b840cf to 10497b1 Compare May 28, 2026 16:54
@devvaansh

devvaansh commented May 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Please squash before merging.

done

@morehouse
morehouse merged commit 7e932f2 into lnfuzz:master May 28, 2026
5 checks passed
@devvaansh
devvaansh deleted the load-short-channel-id branch May 28, 2026 17:06
@devvaansh
devvaansh restored the load-short-channel-id branch May 28, 2026 17:06
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