x 2 лет назад
Родитель
Сommit
4256a2fdef
2 измененных файлов с 36 добавлено и 0 удалено
  1. 4 0
      doc/src/SUMMARY.md
  2. 32 0
      doc/src/dep/0001.md

+ 4 - 0
doc/src/SUMMARY.md

@@ -64,6 +64,10 @@
 - [Key Recovery Scheme](crypto/key-recovery.md)
 - [Key Recovery Scheme](crypto/key-recovery.md)
 - [Reading maths books](crypto/reading-maths-books.md)
 - [Reading maths books](crypto/reading-maths-books.md)
 
 
+# DEP
+
+- [DEP 0001](dep/0001.md)
+
 # Specs
 # Specs
 
 
 - [Payment](spec/payment/payment.md)
 - [Payment](spec/payment/payment.md)

+ 32 - 0
doc/src/dep/0001.md

@@ -0,0 +1,32 @@
+# DEP 0001: Version Message Info
+
+```
+status: draft
+```
+
+## Motivation
+
+Currently `version` messages are empty, but before releasing in order to anticipate protocol
+upgrades, we should include the protocol version. This is for the moment inside `verack`,
+but should be moved to `version` since it allows immediately dropping the connection if the
+protocol version is incorrect (and indeed is the main purpose of the version message).
+
+Additionally it should include further info which makes debugging connections and negotiation
+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                                                                     |
+
+`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.
+