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

Drop address descriptor ordering/count limits #842

Closed
wants to merge 1 commit into from

Conversation

TheBlueMatt
Copy link
Collaborator

These aren't enforced in practice anyway so there's little value in
keeping them in the spec.

@TheBlueMatt
Copy link
Collaborator Author

Relatedly, should we have some suggested limit where we shouldn't relay a node_announcement if it has more than, say, 10 addresses?

TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request Feb 12, 2021
It seems many other nodes never bothered to enforce these
requirements, so there's little reason that we should either.

cc lightning/bolts#842
TheBlueMatt added a commit to TheBlueMatt/rust-lightning that referenced this pull request Feb 12, 2021
It seems many other nodes never bothered to enforce these
requirements, so there's little reason that we should either.

cc lightning/bolts#842
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

@rustyrussell
Copy link
Collaborator

Ordering is a requirement for parsing, if we ever add a new addr format. Existing implementations may be slack (since we've never added one), but we should fix them.

Agree we can allow dups though.

@TheBlueMatt
Copy link
Collaborator Author

Ordering is a requirement for parsing

Indeed, but only for types that you don't know. There was a long discussion about this issue in the meeting, but at least from our end, I don't think we're going to build a whole read/write API just to enforce ordering on sending if we cannot enforce it on receiving (which we cannot, currently, do). I'm not sure that its reasonable to fix this by telling people to upgrade, instead any newly-added address formats can be required to be after the current 4, which don't need an order.

These aren't enforced in practice anyway so there's little value in
keeping them in the spec.
@TheBlueMatt
Copy link
Collaborator Author

I updated the Rationale section to mention that future types need to be ordered in ascending order to allow for deserialization, but due to compatibility we can't enforce that on the current 4.

@t-bast
Copy link
Collaborator

t-bast commented Feb 17, 2021

ACK, I still think it's worth fixing implementations anyway, I'll ensure eclair writes these in order.

t-bast added a commit to ACINQ/eclair that referenced this pull request Feb 17, 2021
Addresses in node announcement should be sorted.
We accept node announcements that don't do this, but we should do it for
our own announcements.

See lightning/bolts#842
t-bast added a commit to ACINQ/eclair that referenced this pull request Feb 17, 2021
Addresses in node announcement should be sorted.
We accept node announcements that don't do this, but we should do it for
our own announcements.

See lightning/bolts#842
valentinewallace pushed a commit to valentinewallace/rust-lightning that referenced this pull request Feb 18, 2021
It seems many other nodes never bothered to enforce these
requirements, so there's little reason that we should either.

cc lightning/bolts#842
valentinewallace pushed a commit to valentinewallace/rust-lightning that referenced this pull request Feb 19, 2021
It seems many other nodes never bothered to enforce these
requirements, so there's little reason that we should either.

cc lightning/bolts#842
@rustyrussell
Copy link
Collaborator

Just leave the requirement there, please. It still applies, and is still the Right thing to do.

You can't put a requirement in a subnote like this. That makes things worse, not better, for future implementers. If you want, note that some implementations did not obey this ordering for the initially-defined types 1-4.

There's no requirement in the spec that readers enforce this (though it's always good to detect such sender fails and handle them gracefully).

@rustyrussell
Copy link
Collaborator

Huh, weird.

c-lightning removed the "only allow one addr per type" requirement back on 0.8.2 (a year ago) as ElementsProject/lightning@a430abf.

That commit msg refers to spec update 86c2ebc. Where did that change go?

@TheBlueMatt
Copy link
Collaborator Author

TheBlueMatt commented Feb 22, 2021 via email

@rustyrussell
Copy link
Collaborator

@TheBlueMatt The spec already says exactly this, though:

The origin node:
...
  - MUST place address descriptors in ascending order.

And the receiving side:

The receiving node:
...
  - SHOULD ignore the first `address descriptor` that does NOT match the types
  defined above.

(To be fair, it should explicitly say to stop parsing addresses if this happens, rather than implying it!).

But it does not say that the receiver should do any additional validation on addresses.

There are, indeed, some places where you need to read the writer requirements to intuit the reader requirements, but those are all spec flaws. They should be implementable separately, and definitely defined separately, since we use the tighter restrictions on writers than readers to let us enhance things in future.

Tests can definitely be stricter, but not live code on the network!

@TheBlueMatt
Copy link
Collaborator Author

Hmm, maybe I'm just still uncomfortable with the "undefined space" in between sending and receiving in so many places in the spec. This certainly isn't the venue to debate that, though, so I'll close it, noting only that, for API simplicity's sake, we'll definitely be taking advantage of the "undefined space" here and doing things we MUST NOT do, while still being guaranteed by the spec that we'll be able to talk to anyone...which just feels gross.

@TheBlueMatt TheBlueMatt closed this Mar 1, 2021
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