Преглед изворни кода

dep 0001: add a version number to services field

x пре 2 година
родитељ
комит
f0e0935bd2
1 измењених фајлова са 13 додато и 9 уклоњено
  1. 13 9
      doc/src/dep/0001.md

+ 13 - 9
doc/src/dep/0001.md

@@ -16,17 +16,21 @@ easier.
 
 ## Proposal
 
-| Type          | Description       | Comment                                                                                                                |
-|---------------|-------------------|------------------------------------------------------------------------------------------------------------------------|
-| `u32`         | version           | Identifies protocol version being used by the node                                                                     |
-| `u64`         | timestamp         | UNIX timestamp                                                                                                         |
-| `u16`         | nonce             | Random nonce, randomly generated everytime a version packet is sent. This nonce is used to detect connections to self. |
-| `String`      | connect_recv_addr | Network address of the node receiving this message (before resolving)                                                  |
-| `String`      | resolv_recv_addr  | Network address of the node receiving this message (after resolving)                                                   |
-| `Vec<String>` | ext_send_addr     | External address of the node sending this message                                                                      |
-| `Vec<String>` | services          | List of features to be enabled for this connection                                                                     |
+| Type                 | Description         | Comment                                                                                                                |
+|----------------------|---------------------|------------------------------------------------------------------------------------------------------------------------|
+| `u32`                | version             | Identifies protocol version being used by the node                                                                     |
+| `u64`                | timestamp           | UNIX timestamp                                                                                                         |
+| `u16`                | nonce               | Random nonce, randomly generated everytime a version packet is sent. This nonce is used to detect connections to self. |
+| `String`             | connect_recv_addr   | Network address of the node receiving this message (before resolving)                                                  |
+| `String`             | resolv_recv_addr    | Network address of the node receiving this message (after resolving)                                                   |
+| `Vec<String>`        | ext_send_addr       | External address of the node sending this message                                                                      |
+| `Vec<(String, u32)>` | (services, version) | List of features to be enabled for this connection                                                                     |
 
 `resolv_recv_addr` is optional depending on some transports which may not have such an address.
 
 `ext_send_addr` is optional when no external address is set for the node.
 
+The `(services, version)` field can be used to enable certain features in protocols, or even to upgrade protocols to new versions.
+When protocols are first attached, they can add their own data to this field which will be communicated in the subsequent version exchange.
+Any further negotiation needed can be done using protocol specific messages afterwards.
+