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

identify: make identify delta use a new protobuf message #253

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions identify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,7 @@ peer dynamically changes its capabilites at runtime.
When a peer adds or removes support for one or more protocols, it may open a
stream to each remote peer that it wants to update using `/p2p/id/delta/1.0.0`
as the protocol id. When the remote peer accepts the stream, the local peer will
send an `Identify` message with only the `delta` field set. The value of the
`delta` field is a `Delta` message, which will include the protocol ids of added
or removed protocols in the `added_protocols` and `rm_protocols` fields,
respectively.
send an `IdentifyDelta` message listing the added and removed protocols.

## The Identify Message

Expand All @@ -108,20 +105,9 @@ message Identify {
repeated bytes listenAddrs = 2;
optional bytes observedAddr = 4;
repeated string protocols = 3;
optional Delta delta = 7;
}

message Delta {
repeated string added_protocols = 1;
repeated string rm_protocols = 2;
}
```

The `delta` field of the `Identify` message is only set when sending partial
updates as part of the [`identify/delta`](#identify-delta) protocol. When the
`delta` field is set, it MUST be the only field present in the `Identify`
message, with all other fields unset.

### protocolVersion

The protocol version identifies the family of protocols used by the peer.
Expand Down Expand Up @@ -159,3 +145,16 @@ observable source address.
### protocols

This is a list of protocols supported by the peer.

## The Identify Delta Message

```protobuf
message IdentifyDelta {
repeated string added_protocols = 1;
repeated string rm_protocols = 2;
}
```

`added_protocols` and `rm_protocols` MUST not intersect. When processing an
update with intersecting `added_protocols` and `rm_protocols`, the recipient
MUST process the removed protocols after the added protocols.