Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: last_update_message should not be none #188

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

quake
Copy link
Member

@quake quake commented Sep 24, 2024

No description provided.

Copy link
Collaborator

@contrun contrun left a comment

Choose a reason for hiding this comment

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

    /// Mostly redundant with the data we store in fields explicitly.
    /// Everything else is useful only for sending out for initial routing sync.
    /// Not stored if contains excess data to prevent DoS.
    pub last_update_message: ChannelUpdate,

The comment here shows that we copied some code from rust-lightning.

https://github.com/lightningdevkit/rust-lightning/blob/a0d0f02ed06f667cab29950c5019b1bb830b98f0/lightning/src/ln/msgs.rs#L1248-L1251

	/// Excess data which was signed as a part of the message which we do not (yet) understand how
	/// to decode.
	///
	/// This is stored to ensure forward-compatibility as new fields are added to the lightning gossip protocol.
	pub excess_data: Vec<u8>,

I didn't see bolt 07 mentioned the excess data here. I think this may be a feature of lightning network that any later field of the message are appended to the wire message. So the author of rust-lightning tried to make this message future-proof by saving the unknown fields to excess data. Since we have no notion of excess data. I am in favor of removing this. But we also need to update the comment.

@quake quake merged commit 6c5463c into nervosnetwork:main Sep 24, 2024
13 of 14 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.

2 participants