libp2p / libp2p/specs

Create spec legend and terminology guideline

Open
#565 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
1.8k
Forks
320
Avg merge
11d 15h
Merged PRs (30d)
1

Description

Summary

To prevent the confusion of terminology when reading specs, we should use consistent language and provide a document similar to https://github.com/libp2p/specs/blob/master/00-framework-02-document-header.md that spec-writers can use to ensure language across specs is consistent and clear.

Description

I’ve only read two libp2p specs so far, but I think the specs could be clearer if we started using consistent terminology for peers and streams in our spec descriptions.

e.g.

  • “initiator” is okay, but “receiver” is confusing since the “initiator” frequently receives messages.
  • "initiator" can be confusing the more operations the spec has because there may be separate initiators of connections or streams within a protocol
  • in specs, “peer A” vs “peer B” — “stream A” vs “stream B” — “connection A” vs “connection B” can be very difficult to track while parsing a spec because there is no contextual definition.

I could not find existing guidelines or recommendations for writing legends or using terminology in libp2p specs. I think solidifying a guideline for the terminology in libp2p specs would help spec readers.

Proposal

We could create a single global legend (for naming of peers in a spec) but we will need individual legends per spec to define contextually relevant names for streams/connections/messages.

  • Create https://github.com/libp2p/specs/blob/master/00-framework-03-document-terminology-legend.md that contains global names that should be consistent across specs.
    • Global names should probably include standardized names for: Protocol initiators, Connection initiators, Stream initiators
    • provide guidance for each spec to add additional legends specific to their spec, for streams, connections, and any non-globally-relevant terms.
  • Prohibit any names that apply to both sides of a conversation. e.g. "receiver" quickly becomes confusing in a p2p conversation. "initiator" is also confusing because multiple things can be initiated: streams, connections, protocol handling, etc.
  • Advise against any "A", "B", "1", or "2" names
Example
Term Definition
Leader The Peer who begins/initiates the connection with the Participant peer
Participant The Peer who receives/acknowledges the connection and streams with the Leader peer
Negotiation-stream An initial stream created in an existing connection between Leader and Participant peers.
Goal-stream A new stream, using an "upgraded" transport when compared to the Negotiation stream, created on a new connection between leader and participant peers.

References to confusion/assumptions around terminology

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing 00-framework-02-document-header.md and the terminology discussions linked from issue 565, including issue 328 and pull request 406. Create 00-framework-03-document-terminology-legend.md with global peer, connection, and stream terminology, guidance for spec-specific legends, and the proposed naming recommendations; done means the checklist is addressed in a clear, usable document.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, networking
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.