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

bolt7 typo: "newest" channel_update, not "oldest". #1006

Merged
merged 2 commits into from
Jun 29, 2022
Merged

bolt7 typo: "newest" channel_update, not "oldest". #1006

merged 2 commits into from
Jun 29, 2022

Conversation

fiatjaf
Copy link
Contributor

@fiatjaf fiatjaf commented Jun 28, 2022

No description provided.

Copy link
Collaborator

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

Good catch, thanks!

Co-authored-by: Bastien Teinturier <[email protected]>
Copy link
Collaborator

@t-bast t-bast left a comment

Choose a reason for hiding this comment

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

ACK 81cdeaa

@t-bast t-bast merged commit 2ecc091 into lightning:master Jun 29, 2022
@rustyrussell
Copy link
Collaborator

Um, no, this was wrong (or, at least, a change):

From our code:

		/* BOLT #7:
		 *   - if a channel's latest `channel_update`s `timestamp` is
		 *     older than two weeks (1209600 seconds):
		 *    - MAY prune the channel.
		 */
		/* This is a fancy way of saying "both ends must refresh!" */
		if (!is_halfchan_defined(&chan->half[0])
		    || chan->half[0].bcast.timestamp < highwater
		    || !is_halfchan_defined(&chan->half[1])
		    || chan->half[1].bcast.timestamp < highwater) {
			status_debug(
			    "Pruning channel %s from network view (ages %"PRIu64" and %"PRIu64"s)",
			    type_to_string(tmpctx, struct short_channel_id,

i.e. one side can't keep a channel alive unilaterally, both sides must send every 2 weeks.

@fiatjaf fiatjaf deleted the patch-1 branch July 31, 2022 08:24
@t-bast
Copy link
Collaborator

t-bast commented Aug 1, 2022

I see what you mean, and our code does this as well, but I thought the confusion fixed here was a different one, let me try to explain. Let's say we have a channel Alice <-> Bob.

Alice creates a first channel update, channel_update_ab_1 then another one, channel_update_ab_2. The "oldest" channel update could be understood as being channel_update_ab_1, whereas we only want to consider the latest channel_update_ab_2. That's the confusion I thought we were fixing here.

I think we should clarify it further by saying that we consider the latest channel update in each direction, and if the oldest of those two is older than two weeks, ...

I'll open a PR.

t-bast added a commit to t-bast/bolts that referenced this pull request Aug 1, 2022
This is a follow-up on lightning#1006, which actually created more confusion.
Roasbeef pushed a commit that referenced this pull request Aug 15, 2022
This is a follow-up on #1006, which actually created more confusion.
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