-
Notifications
You must be signed in to change notification settings - Fork 5
protocol 1.6: minimal update to get broadcast_package out #6
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
Changes from 4 commits
8e26c35
b774837
0466646
7b84d2a
9657730
a4f158c
e54c0e4
b269a8f
919df4f
c617d4d
394a8fd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| Protocol Changes | ||
| ================ | ||
|
|
||
| This documents lists changes made by protocol version. | ||
| This document lists changes made by protocol version. | ||
|
|
||
| Version 1.0 | ||
| =========== | ||
|
|
@@ -175,3 +175,42 @@ New methods | |
| ----------- | ||
|
|
||
| * :func:`blockchain.name.get_value_proof` to resolve a name (with proof). Name index coins (e.g. Namecoin) only. | ||
|
|
||
|
|
||
| Version 1.5 | ||
| =========== | ||
|
|
||
| (this version number was skipped, no corresponding protocol is defined) | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that I skipped 1.5.x as Fulcrum and https://github.com/cculianu/electrum-cash-protocol uses these version numbers. By design of From a quick read of "electrum-cash-protocol", I think all the changes in the interim versions are backwards compatible. So maybe this is all ~fine... Nevertheless, the situation is unfortunate. |
||
|
|
||
|
|
||
| .. _version 1.6: | ||
|
|
||
| Version 1.6 | ||
| =========== | ||
|
|
||
| Changes | ||
| ------- | ||
|
|
||
| * Breaking change for the version negotiation: we now mandate that | ||
| the :func:`server.version` message must be the first message sent. | ||
| That is, version negotiation must happen before any other messages. | ||
| * The status of a scripthash has its definition tightened in a | ||
| backwards-compatible way: mempool txs now have a canonical ordering | ||
| defined for the calculation (previously their order was undefined). | ||
| * :func:`blockchain.scripthash.get_mempool` previously did not define | ||
| an order for mempool transactions. We now mandate a specific ordering. | ||
| * Optional *mode* argument added to :func:`blockchain.estimatefee`. | ||
| * :func:`blockchain.block.headers` now returns headers as a list, | ||
| instead of a single concatenated hex string. | ||
|
|
||
| New methods | ||
| ----------- | ||
|
|
||
| * :func:`blockchain.transaction.broadcast_package` to broadcast a package of transactions (submitpackage). | ||
| * :func:`mempool.get_info` to get more detailed and general relayfee info. | ||
|
|
||
| Removed methods | ||
| --------------- | ||
|
|
||
| * :func:`blockchain.relayfee` is removed. The `minrelaytxfee` field | ||
| of the new :func:`mempool.get_info` RPC is a direct replacement. | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -76,7 +76,7 @@ With *cp_height* 8:: | |||||||||||||||||||||
| blockchain.block.headers | ||||||||||||||||||||||
| ======================== | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Return a concatenated chunk of block headers from the main chain. | ||||||||||||||||||||||
| Return a chunk of block headers from the main chain. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Signature** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -85,6 +85,8 @@ Return a concatenated chunk of block headers from the main chain. | |||||||||||||||||||||
| .. versionchanged:: 1.4 | ||||||||||||||||||||||
| *cp_height* parameter added | ||||||||||||||||||||||
| .. versionchanged:: 1.4.1 | ||||||||||||||||||||||
| .. versionchanged:: 1.6 | ||||||||||||||||||||||
| response contains *headers* field instead of *hex* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| *start_height* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -106,17 +108,16 @@ Return a concatenated chunk of block headers from the main chain. | |||||||||||||||||||||
| A dictionary with the following members: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| * *count* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The number of headers returned, between zero and the number | ||||||||||||||||||||||
| requested. If the chain has not extended sufficiently far, only | ||||||||||||||||||||||
| the available headers will be returned. If more headers than | ||||||||||||||||||||||
| *max* were requested at most *max* will be returned. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| * *hex* | ||||||||||||||||||||||
| * *headers* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The binary block headers concatenated together in-order as a | ||||||||||||||||||||||
| hexadecimal string. Starting with version 1.4.1, AuxPoW data (if present | ||||||||||||||||||||||
| in the original header) is truncated if *cp_height* is nonzero. | ||||||||||||||||||||||
| An array containing the binary block headers in-order; each header is a | ||||||||||||||||||||||
| hexadecimal string. AuxPoW data (if present in the original header) is | ||||||||||||||||||||||
| truncated if *cp_height* is nonzero. | ||||||||||||||||||||||
|
Comment on lines
+116
to
+120
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That change was originally asked for Namecoin as it has variable sized headers. The earliest non-IRC discussion about it is probably: I also think putting this small breaking change into the API serves as a sanity-check whether an implementation that bumps the version number really read and implemented the spec :) One of the main points of having a version number and negotiation is to allow making breaking changes.
I don't want the API to offer a choice between concatted str and a list. Would rather keep the API simple.
Sure, if you think that's better, we could rename the method to make the breaking change obvious. (i.e. rm the old method and add a new method with a different name) But then I would remove the current method (so just do a rename). I already gave this some thought in the context of Ultimately it's the least interesting change, so if controversial, we could also drop it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Ahh. Well that settles it, then. Yes, if the protocol is to support such coins, one needs this.
Ha ha.
No, it's fine. Since you prefer simplicity (as do I), it's ok. Yes, that is a good point about namecoin needing this and a good point as well about the entire point of version negotiation. I think it's fine as proposed, then. As for mempool.relayfee vs mempool.get_info.. I also think as proposed it's fine. No need to change anything. Stick to the proposal you have so you can get this out the door faster.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (it's nicer to keep discussions threaded)
Using JSON-RPC batching to fetch n single headers compared to a single RPC to fetch a list/concat increases the upstream bandwidth to around So yes, indeed requesting headers one-by-one is a workaround. Though there is a reason this separate RPC for requesting a chunk of headers exists in the first place - it is purely for efficiency.
Any change in the protocol creates some work for client/server devs, even more so if they want to support multiple protocol versions at the same time. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Fair enough. However I'd like to say that when one "breaks" an existing API, in order to avoid annoying people, it's nice to also "reward" the dev who now has extra work to do.. with some new feature or facility on account of the fact that he was asked to do some extra work. This is how one makes people happy, and keeps them from being resentful. In this case: an API nobody ever worries about (headers), now needs to be worried-about, with 0 or almost no benefit for 99.9% of code out there. Would have been less antagonistic to users of this protocol to just offer up a Anyway yeah I'm fine with moving ahead and not belaboring this point any further... let's get 1.6 out the door. |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| * *max* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -149,7 +150,11 @@ See :ref:`here <cp_height example>` for an example of *root* and | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "count": 2, | ||||||||||||||||||||||
| "hex": "0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e857233e0e61bc6649ffff001d01e36299" | ||||||||||||||||||||||
| "headers": | ||||||||||||||||||||||
| [ | ||||||||||||||||||||||
| "0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c", | ||||||||||||||||||||||
| "010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000982051fd1e4ba744bbbe680e1fee14677ba1a3c3540bf7b1cdb606e857233e0e61bc6649ffff001d01e36299" | ||||||||||||||||||||||
| ], | ||||||||||||||||||||||
| "max": 2016 | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -161,12 +166,21 @@ be confirmed within a certain number of blocks. | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Signature** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .. function:: blockchain.estimatefee(number) | ||||||||||||||||||||||
| .. function:: blockchain.estimatefee(number, mode=None) | ||||||||||||||||||||||
| .. versionchanged:: 1.6 | ||||||||||||||||||||||
| *mode* argument added | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| *number* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The number of blocks to target for confirmation. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| *mode* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| A string to pass to the bitcoind *estimatesmartfee* RPC as the | ||||||||||||||||||||||
| *estimate_mode* parameter. Optional. If omitted, the corresponding | ||||||||||||||||||||||
| parameter to the bitcoind RPC is also omitted, i.e. the default | ||||||||||||||||||||||
| value is determined by bitcoind. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Result** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The estimated transaction fee in whole coin units per kilobyte, as a | ||||||||||||||||||||||
|
|
@@ -179,6 +193,11 @@ be confirmed within a certain number of blocks. | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| 0.00101079 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .. note:: This estimate typically comes from the Bitcoin daemon, which only updates | ||||||||||||||||||||||
| its estimate when new blocks are mined. The server is free to cache this internally | ||||||||||||||||||||||
| for performance reasons, however it SHOULD avoid sending stale estimates | ||||||||||||||||||||||
| by e.g. invalidating the cache before notifying clients of a new block header. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| blockchain.headers.subscribe | ||||||||||||||||||||||
| ============================ | ||||||||||||||||||||||
|
|
@@ -234,31 +253,6 @@ Subscribe to receive block headers when a new block is found. | |||||||||||||||||||||
| block headers to acquire a consistent view of the chain state. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| blockchain.relayfee | ||||||||||||||||||||||
| =================== | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Feerates lower than this are considered zero fee and are not being | ||||||||||||||||||||||
| relayed to the bitcoin network by the server. | ||||||||||||||||||||||
| This feerate does not guarantee acceptance into the mempool of the server. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Signature** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .. function:: blockchain.relayfee() | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Result** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The feerate in BTC/kvB, as a floating point number. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Example Results** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| :: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| 1e-05 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| :: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| 0.0 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| blockchain.scripthash.get_balance | ||||||||||||||||||||||
| ================================= | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -359,15 +353,18 @@ hashes>`. | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| .. function:: blockchain.scripthash.get_mempool(scripthash) | ||||||||||||||||||||||
| .. versionadded:: 1.1 | ||||||||||||||||||||||
| .. versionchanged:: 1.6 | ||||||||||||||||||||||
| results must be sorted (previously undefined order) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| *scripthash* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The script hash as a hexadecimal string. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Result** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| A list of mempool transactions in arbitrary order. Each mempool | ||||||||||||||||||||||
| transaction is a dictionary with the following keys: | ||||||||||||||||||||||
| A list of mempool transactions. The order is the same as when computing the | ||||||||||||||||||||||
| :ref:`status <status>` of the script hash. | ||||||||||||||||||||||
| Each mempool transaction is a dictionary with the following keys: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| * *height* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -552,6 +549,92 @@ Protocol version 1.0 returning an error as the result: | |||||||||||||||||||||
|
|
||||||||||||||||||||||
| "258: txn-mempool-conflict" | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| blockchain.transaction.broadcast_package | ||||||||||||||||||||||
| ======================================== | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Broadcast a package of transactions to the network (submitpackage). The package must consist of a child with its parents, | ||||||||||||||||||||||
| and none of the parents may depend on one another. The package must be topologically sorted, | ||||||||||||||||||||||
| with the child being the last element in the array. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Signature** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .. function:: blockchain.transaction.broadcast_package(raw_txs, verbose=false) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| *raw_txs* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| An array of raw transactions, each as a hexadecimal string. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| *verbose* | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Whether a verbose coin-specific response is required. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Result** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| If *verbose* is :const:`false`: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| A dictionary with the following keys: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| * `success` | ||||||||||||||||||||||
|
SomberNight marked this conversation as resolved.
|
||||||||||||||||||||||
| * Type: bool | ||||||||||||||||||||||
| * Value: Indicating the result of the package submission | ||||||||||||||||||||||
| * `errors` | ||||||||||||||||||||||
| * Type: Optional[List[Dict]] | ||||||||||||||||||||||
| * Value: Error message and txid (NOT wtxid) of transactions that were not accepted | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| If *verbose* is :const:`true`: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| The bitcoind response according to its RPC API documentation. | ||||||||||||||||||||||
|
SomberNight marked this conversation as resolved.
Outdated
|
||||||||||||||||||||||
| Note that the exact structure and semantics can depend on the bitcoind version, | ||||||||||||||||||||||
| and hence the electrum protocol can make no guarantees about it. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Result Example** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| When *verbose* is :const:`false`:: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "success": true | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| With errors: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "success": false, | ||||||||||||||||||||||
| "errors": | ||||||||||||||||||||||
| [ | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "txid": "ec6f295cd4b1b91f59cabb0ab8fdc7c76580db08be6426e465f75a69d82b9659", | ||||||||||||||||||||||
| "error": "bad-txns-inputs-missingorspent" | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
| ] | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| When *verbose* is :const:`true`:: | ||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we really care that this endpoint could ever be implemented by something else than Bitcoin Core, it might make sense to simplify the return values (esp. the verbose one), as they are very specific to Bitcoin Core. However, the chances are rather slim that we'll see any other implementation supporting package relay/TRUC any time soon.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The This is similar to the existing electrum-protocol/docs/protocol-methods.rst Lines 576 to 585 in c366dc6
Clients are expected to use I have clarified this more now in a new commit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Btw., note that this instability for And independent of whether Core changes any return values, it can't be currently leaned on, as some implementation simply don't handle it (see for example |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| { (json object) | ||||||||||||||||||||||
| "package_msg" : "str", (string) The transaction package result message. "success" indicates all transactions were accepted into or are already in the mempool. | ||||||||||||||||||||||
| "tx-results" : { (json object) transaction results keyed by wtxid | ||||||||||||||||||||||
| "wtxid" : { (json object) transaction wtxid | ||||||||||||||||||||||
| "txid" : "hex", (string) The transaction hash in hex | ||||||||||||||||||||||
| "other-wtxid" : "hex", (string, optional) The wtxid of a different transaction with the same txid but different witness found in the mempool. This means the submitted transaction was ignored. | ||||||||||||||||||||||
| "vsize" : n, (numeric, optional) Sigops-adjusted virtual transaction size. | ||||||||||||||||||||||
| "fees" : { (json object, optional) Transaction fees | ||||||||||||||||||||||
| "base" : n, (numeric) transaction fee in BTC | ||||||||||||||||||||||
| "effective-feerate" : n, (numeric, optional) if the transaction was not already in the mempool, the effective feerate in BTC per KvB. For example, the package feerate and/or feerate with modified fees from prioritisetransaction. | ||||||||||||||||||||||
| "effective-includes" : [ (json array, optional) if effective-feerate is provided, the wtxids of the transactions whose fees and vsizes are included in effective-feerate. | ||||||||||||||||||||||
| "hex", (string) transaction wtxid in hex | ||||||||||||||||||||||
| ... | ||||||||||||||||||||||
| ] | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "error" : "str" (string, optional) The transaction error string, if it was rejected by the mempool | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| ... | ||||||||||||||||||||||
| }, | ||||||||||||||||||||||
| "replaced-transactions" : [ (json array, optional) List of txids of replaced transactions | ||||||||||||||||||||||
| "hex", (string) The transaction id | ||||||||||||||||||||||
| ... | ||||||||||||||||||||||
| ] | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| blockchain.transaction.get | ||||||||||||||||||||||
| ========================== | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -795,6 +878,42 @@ pool, weighted by transaction size. | |||||||||||||||||||||
| [[59.5, 30324], [40.1, 34305], [35.0, 38459], [29.3, 41270], [27.0, 45167], [24.3, 53512], [22.9, 53488], [21.8, 70279], [20.0, 65328], [18.2, 72180], [18.1, 5254], [18.0, 191579], [16.5, 103640], [15.7, 106715], [15.1, 141776], [14.0, 183261], [13.5, 166496], [11.8, 166050], [11.1, 242436], [9.2, 184043], [7.1, 202137], [5.2, 222011], [4.8, 344788], [4.6, 17101], [4.5, 1696864], [4.1, 598001], [4.0, 32688687], [3.9, 505192], [3.8, 38417], [3.7, 2944970], [3.3, 693364], [3.2, 726373], [3.1, 308878], [3.0, 11884957], [2.6, 996967], [2.3, 822802], [2.2, 9075547], [2.1, 12149801], [2.0, 16387874], [1.4, 873120], [1.3, 3493364], [1.1, 2302460], [1.0, 23204633]] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| mempool.get_info | ||||||||||||||||||||||
| ================ | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Returns details on the active state of the TX memory pool. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Signature** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| .. function:: mempool.get_info() | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Result** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| A dictionary with the following keys: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| * `mempoolminfee` | ||||||||||||||||||||||
| * Type: floating point number | ||||||||||||||||||||||
| * Value: | ||||||||||||||||||||||
| Dynamic minimum fee rate in BTC/kvB for tx to be accepted given current conditions. | ||||||||||||||||||||||
| The maximum of minrelaytxfee and minimum mempool fee, in BTC/kvB. | ||||||||||||||||||||||
| * `minrelaytxfee` | ||||||||||||||||||||||
| * Type: floating point number | ||||||||||||||||||||||
| * Value: Static operator-configurable minimum relay fee for transactions, in BTC/kvB. | ||||||||||||||||||||||
| * `incrementalrelayfee` | ||||||||||||||||||||||
| * Type: floating point number | ||||||||||||||||||||||
| * Value: Static operator-configurable minimum fee rate increment for mempool limiting or replacement, in BTC/kvB. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Example Result** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| :: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| { | ||||||||||||||||||||||
| "mempoolminfee": 0.00001000, | ||||||||||||||||||||||
| "minrelaytxfee": 0.00001000, | ||||||||||||||||||||||
| "incrementalrelayfee": 0.00001000 | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| server.add_peer | ||||||||||||||||||||||
| =============== | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
|
|
@@ -991,6 +1110,7 @@ server.version | |||||||||||||||||||||
| ============== | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Identify the client to the server and negotiate the protocol version. | ||||||||||||||||||||||
| This must be the first message sent on the wire. | ||||||||||||||||||||||
| Only the first :func:`server.version` message is accepted. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| **Signature** | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the byteorder used for the sorting is not the human-readable txid byteorder but the network one.
I chose this because it fits the existing internals of electrumx much nicer.
However in cculianu/electrum-cash-protocol#5 (comment) @cculianu expressed frustration about this choice.
I guess I don't mind either way though.
Any strong opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate your asking others for feedback on this.
Just to be annoying -- I'll smartly say that it can be argued the "network" order is only useful if you speak the p2p protocol. Otherwise it can be argued the true network order is the RPC order. :P
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Network byteorder makes sense to me for such an internal behavior, IMO. But, the most important thing is that it's well defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a detailed example in 919df4f, to try to avoid any misunderstanding.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You guys are seriously muddled in your thinking:
This latter thing you are calling "network" order. However the term is misleading because for our network, the network order is actually the other order! The big endian order!
Are we clear on that?
So what you are proposing is that this will be the only place anywhere within this protocol where we are to look at txn hashes as being in the opposite order from every other place.
Are we clear on what is happening here?
I strongly disagree with this approach since:
Please change this to what Fulcrum was already doing since 2020.
I won't comply with this in Fulcrum because it's dumb. Sorry. I already solved this problem in 2020 and it's doing the "natural" thing -- using the hash order for the hashes as they appear everywhere else in the protocol. That's what most people expect.
What you want to do here is just unexpected and creates more work for me. And all for no good reason. No can do. Sorry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a strong opinion, but Cormorant (Sparrow's EPS clone) is using big endian order as well. And I agree stating 'big endian' or 'little endian' is clearer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, I meant the bitcoin p2p network.
Is that really more precise? Unlike what you say, the output of sha256 is big-endian. :D
see page 12 (of 36) of https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf :
See also, https://en.wikipedia.org/wiki/SHA-256, where at least for the pseudo-code it states:
Or see e.g. https://learnmeabitcoin.com/technical/general/little-endian/ , which says little-endian is used for integers but big-endian is used for hashes in the bitcoin p2p protocol.
Even if you still disagree, at least please accept that it is not intuitive or clear what big-endian or little-endian is when thinking of the byte-vector output of a hash function. The output is not an integer.
Clearly it is not intuitive if what you thought is actually the opposite of what the standard says.
Ok, I changed the order to what you suggested.
I wish you had been clearer from the start that this is a complete blocker for you.
See 394a8fd
I disagree. I hope I illustrated how that would not be clear at all. :P
The updated text now says:
I think that should be clear. And in any case, there is an example.
I just spent an hour updating the server code, the client code, and writing a new example for the spec.
It was writing the new example that took most of that time.
Is it really that much work to add a reverse iterator or a minus sign to your comparator?
The diff was 6 characters in e-x:
spesmilo/electrumx@0f3e261