Skip to content

Add signedPeerRecord and discussion of message sizes to identify - #709

Open
achingbrain wants to merge 2 commits into
masterfrom
docs/add-signed-peer-record-and-message-sizes-to-identify
Open

Add signedPeerRecord and discussion of message sizes to identify#709
achingbrain wants to merge 2 commits into
masterfrom
docs/add-signed-peer-record-and-message-sizes-to-identify

Conversation

@achingbrain

Copy link
Copy Markdown
Member

Adds the missing signedPeerRecord field and an implementation notes section to discuss max message sizes and how to send/receive multiple identify messages during one transaction.

Also updates the language around receiving messages to make it clear that multiple messages may be sent.

Adds the missing `signedPeerRecord` field and an implementation notes
section to discuss max message sizes and how to send/receive multiple
identify messages during one transaction.
Comment thread identify/README.md Outdated
Co-authored-by: Dennis Trautwein <dennis.trautwein@posteo.de>
Comment thread identify/README.md
should break it up into smaller chunks.

For optimum backwards compatibility the first message SHOULD NOT exceed 2KB.
Subsequent messages SHOULD NOT exceed 4KB.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Can signed peer records be subdivided? I suspect they can themselves exceed 4 KB.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

One possible issue is signature size of signed peer records if/when libp2p supports post quantum signatures - 4KB would be too small for ML-DSA-44 and ML-DSA-65, 8KB would be too small for ML-DSA-87

| Variant | Public key (bytes) | Signature (bytes) |
| --- | ---: | ---: | ---: |
| ML-DSA-44 | 1312 | 2420 |
| ML-DSA-65 | 1952 | 3309 |
| ML-DSA-87 | 2592 | 4627 |

@johannamoran

Copy link
Copy Markdown

@dozyio @tabcat - If you share your thoughts on this pls?

Comment thread identify/README.md
node.

It normally contains the same addresses as the `listenAddrs` field, but in a
form that lets us share authenticated addresses with other peers.

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.

Suggested change
form that lets us share authenticated addresses with other peers.
It normally contains the same addresses as the `listenAddrs` field, but in a
format that allows to share authenticated addresses with other peers.

Comment thread identify/README.md
Comment on lines +160 to +166
Early implementations of the Identify protocol limited the incoming message size
to 2KB and would reject any messages larger than this. Others have since
increased this limit to 4KB or 8KB.

With the addition of signed peer records, Circuit Relay addresses, multiaddrs
that contain certificate hashes, etc, it is now much more likely that this
threshold will be exceeded.

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.

I think this needs to reason about which is better in which case and why. As it's written rn it just seems like research on current state of implementations

Comment thread identify/README.md
Comment on lines +168 to +169
If a modern implementation's Identify message would exceed this limit, it
should break it up into smaller chunks.

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.

i think the past 2 paragraphs and this one could all be replaced by:

An Identify message that exceeds this limit SHOULD be broken up into smaller chunks [of size XYZ].

Comment thread identify/README.md
Comment on lines +174 to +175
Listen addresses SHOULD be ordered such that addresses that have a higher
likelihood of being dialed successfully (e.g. public, non-NAT or Circuit Relay)

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.

This spec should say which are more likely. This feels a bit too vague

Comment thread identify/README.md
Comment on lines +180 to +181
When multiple messages are received, all fields SHOULD be respected, with later
updates for fields with a cardinality of one taking priority.

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.

Suggested change
When multiple messages are received, all fields SHOULD be respected, with later
updates for fields with a cardinality of one taking priority.
When multiple messages are received, later updates for fields with a cardinality of one SHOULD take priority.

Comment thread identify/README.md
Where repeated fields encountered in subsequent messages, they SHOULD be
appended to the earlier occurrences of the field and deduplicated as necessary.

A maximum of 10 Identify messages SHOULD be accepted.

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.

Would be good to add a note on why 10 is the chosen number

Comment thread identify/README.md
Comment on lines +183 to +184
Where repeated fields encountered in subsequent messages, they SHOULD be
appended to the earlier occurrences of the field and deduplicated as necessary.

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.

Suggested change
Where repeated fields encountered in subsequent messages, they SHOULD be
appended to the earlier occurrences of the field and deduplicated as necessary.
Repeated fields encountered in subsequent messages SHOULD be deduplicated and
appended to earlier occurrences of the field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

7 participants