1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-01-18 21:35:13 +01:00

BIP 145: Update s/cost/weight/

This commit is contained in:
Luke Dashjr 2016-07-23 20:35:56 +00:00
parent c98859fe20
commit d8928eb85a

View File

@ -22,7 +22,7 @@ The template Object is revised to include a new key:
|- |-
! Key !! Required !! Type !! Description ! Key !! Required !! Type !! Description
|- |-
| costlimit || No || Number || total cost allowed in blocks | weightlimit || No || Number || total weight allowed in blocks
|} |}
The '!' rule prefix MUST be enabled on the "segwit" rule for templates including transactions with witness data. The '!' rule prefix MUST be enabled on the "segwit" rule for templates including transactions with witness data.
@ -40,7 +40,7 @@ The Objects listed in the response's "transactions" key is revised to include th
|- |-
| txid || String || transaction id encoded in hexadecimal; required for transactions with witness data | txid || String || transaction id encoded in hexadecimal; required for transactions with witness data
|- |-
| cost || Number || numeric cost of the transaction, as counted for purposes of the block's costlimit; if key is not present, cost is unknown and clients MUST NOT assume it is zero, although they MAY choose to calculate it themselves | weight || Number || numeric weight of the transaction, as counted for purposes of the block's weightlimit; if key is not present, weight is unknown and clients MUST NOT assume it is zero, although they MAY choose to calculate it themselves
|- |-
| hash || String || reversed hash of complete transaction (with witness data included) encoded in hexadecimal | hash || String || reversed hash of complete transaction (with witness data included) encoded in hexadecimal
|} |}
@ -66,12 +66,12 @@ It additionally also adds a new way of counting resource limits, and so GBT must
==Rationale== ==Rationale==
Why doesn't "costlimit" simply redefine the existing "sizelimit"? Why doesn't "weightlimit" simply redefine the existing "sizelimit"?
* "sizelimit" is already enforced by clients by counting the sum of bytes in transactions' "data" keys. * "sizelimit" is already enforced by clients by counting the sum of bytes in transactions' "data" keys.
* Servers may wish to limit the overall size of a block, independently from the "cost" of the block. * Servers may wish to limit the overall size of a block, independently from the "weight" of the block.
Why is "sigoplimit" redefined instead of a new "sigopcostlimit" being added? Why is "sigoplimit" redefined instead of a new "sigopweightlimit" being added?
* The old limit was already arbitrarily defined, and could not be counted by clients on their own anyway. The concept of "sigop cost" is merely a change in the arbitrary formula used. * The old limit was already arbitrarily defined, and could not be counted by clients on their own anyway. The concept of "sigop weight" is merely a change in the arbitrary formula used.
Why is "sigoplimit" divided by 4? Why is "sigoplimit" divided by 4?
* To resemble the previous values. (FIXME: is this a good reason? maybe we shouldn't divide it?) * To resemble the previous values. (FIXME: is this a good reason? maybe we shouldn't divide it?)