Skip to content

Conversation

@MarcoPolo
Copy link
Contributor

closes #700

An initial pass at specifying the abbreviation tree. There's still more to define like the wire format, how these protocol strings can be exchanged, and how to know if your peer supports multistream select v2.

@ppopth
Copy link
Contributor

ppopth commented Nov 16, 2025

Looks good to me

protocol strings (tombstoned protocol strings).

The client's abbreviation tree will differ from the server's abbreviation tree
only in that protocol strings will only exist at leaf nodes. This is because
Copy link
Contributor

Choose a reason for hiding this comment

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

Leaf nodes of the client's abbreviation tree, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I follow. Can you expand please?

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean the client's abbreviation tree will never have non-leaf protocol strings, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes. I've reworded it. Is it clearer now?

@MarcoPolo
Copy link
Contributor Author

Do we need the hash function at all? The hash function acts as a mapping from a protocol string to a byte string with high likelihood of distinct short prefixes. But we could also imagine just using the index of the protocol string from the server's list instead.

If a server returned protocols ["/a", "/b", "/c"] this would be mapped to abbreviations [0x00, 0x01, 0x02]. The tombstones would solve the remove-reintroduce problem without increasing the list size. New protocols are added to the end. The implementation would also be simpler as it's just a list.

Copy link
Contributor

@marten-seemann marten-seemann left a comment

Choose a reason for hiding this comment

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

Is it really necessary to support removing strings?

@MarcoPolo
Copy link
Contributor Author

Whether to remove support for a protocol is an application concern. At this level, MSSv1 does support it, so it makes sense that the next version also supports.

That said, If supporting removing strings makes the solution much more complicated, that's a tradeoff we should discuss. It would be good to understand the complexity of supporting it first.

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.

Protocol ID abbreviation to reduce overhead

4 participants