Skip to content

Commit e54c0e4

Browse files
committed
server.version: server must ignore extraneous args, to allow future ext
1 parent a4f158c commit e54c0e4

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

docs/protocol-changes.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,8 @@ Changes
194194
* Breaking change for the version negotiation: we now mandate that
195195
the :func:`server.version` message must be the first message sent.
196196
That is, version negotiation must happen before any other messages.
197+
* Also for :func:`server.version`, the server must tolerate and ignore
198+
extraneous arguments, to allow for extensions in future protocol versions.
197199
* The status of a scripthash has its definition tightened in a
198200
backwards-compatible way: mempool txs now have a canonical ordering
199201
defined for the calculation (previously their order was undefined).

docs/protocol-methods.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,6 +1122,8 @@ Only the first :func:`server.version` message is accepted.
11221122
**Signature**
11231123

11241124
.. function:: server.version(client_name="", protocol_version="1.4")
1125+
.. versionchanged:: 1.6
1126+
server must tolerate and ignore extraneous args
11251127

11261128
* *client_name*
11271129

@@ -1134,6 +1136,9 @@ Only the first :func:`server.version` message is accepted.
11341136
they can be passed as a single string rather than as an array of
11351137
two strings, as for the default value.
11361138

1139+
Extraneous unknown args MUST be tolerated and ignored by the server,
1140+
to allow for future extensions.
1141+
11371142
The server should use the highest protocol version both support::
11381143

11391144
version = min(client.protocol_max, server.protocol_max)
@@ -1163,6 +1168,16 @@ Only the first :func:`server.version` message is accepted.
11631168

11641169
["ElectrumX 1.2.1", "1.2"]
11651170

1171+
**Example**
1172+
1173+
Redundant unknown arguments MUST be ignored and tolerated by the server::
1174+
1175+
server.version("electrum/4.6.2", ["1.4", "1.6"], "trailing_garbage1", 9999.9, "dd": {})
1176+
1177+
**Example Result**::
1178+
1179+
["ElectrumX 1.18.0", "1.4"]
1180+
11661181

11671182
Some more stuff for altcoins
11681183
============================

0 commit comments

Comments
 (0)