BIP 141 and 145: GBT updates for SegWit #365
pull luke-jr wants to merge 20 commits into bitcoin:master from luke-jr:segwit_gbt_updates_20160330 changing 2 files +18 −11-
luke-jr commented at 10:49 PM on March 30, 2016: member
-
BIP 141 & 145: Clarify sigop interaction a5447e0c4b
-
BIP 9: Clarify nVersion interpretation and bit order b8467dfb7c
-
BIP 9: Add softfork deployment "name" b0b65ceede
-
BIP 9: GBT specification 12a2131bb4
-
BIP 145: Update for BIP 9 161b39fa68
-
BIP 141: Specify VB name 2fa7fb9b5c
- luke-jr added the label Proposed BIP modification on Mar 30, 2016
-
BIP141: Sigop clarification cacf39b057
-
Update bip-0141.mediawiki a6cc319846
-
5bf411856e
Merge pull request #1 from jl2012/patch-13
BIP141: Sigop clarification
-
in bip-0009.mediawiki:None in 2fa7fb9b5c outdated
23 | @@ -24,6 +24,7 @@ In addition, BIP 34 made the integer comparison (nVersion >= 2) a consensus rule 24 | 25 | Each soft fork deployment is specified by the following per-chain parameters (further elaborated below): 26 | 27 | +# The '''name''' specifies a very brief description of the soft fork, reasonable for use as an identifier.
btcdrak commented at 10:58 AM on March 31, 2016:I would suggest the for most of the time, most softforks will role out one consensus BIP so the sensible name would be
bipxxxxunless you have a case like with the bip68+112+113 softfork, in which case we labelled thatcsv. Therefore I would suggest default ofbipxxxxunless it's a bundle.Thinking more, we probably need a table of soft forks somewhere with name, bip(s), starttime, timeout.
luke-jr commented at 11:36 PM on April 4, 2016:This is outside the scope of this PR, IMO.
sipa commented at 10:42 AM on April 5, 2016: memberThe nVersion field of a block never affects the rules applied, so a miner can always be free to set the nVersion to anything.
sipa commented at 11:04 AM on April 5, 2016: memberI had interpreted "the server requires support for" as rules the server demanded you to enforce, rather than rules the server demands you to set bits for. It's a bit confusing that rules and rulesenforced are about consensus rules, and rulesrequires is about nVersion bits to be set. Perhaps replace rulesrequired with versionrequired, with an integer of bits the server requires you to set in nversion?
luke-jr commented at 11:21 AM on April 5, 2016: memberI would have grouped "rules" and "rulesrequired" together, since they deal with bits available/allowed and required; vs "rulesenforced" which is the actual consensus rules being used. Maybe "vbits" and "vbitsrequired"?
jl2012 commented at 3:12 PM on April 5, 2016: contributorACK BIP141
sipa commented at 10:31 PM on April 5, 2016: member@luke-jr Why does that matter? If the bits are not active, they have no relevance for mining the block, as there are never any consensus rules in BIP9 that prevent you from setting any combination at all of version bits. The server may insist that you set some to vote for, but apart from that, that information is not relevant to the client.
luke-jr commented at 10:52 PM on April 5, 2016: memberThe client needs the information to know which bits it wants to or doesn't want to set.
sipa commented at 10:58 PM on April 5, 2016: memberThey can find that in the BIP.
If they need to rely on the server for that, the server can claim anything, including claiming that there is nothing to vote for.
luke-jr commented at 11:03 PM on April 5, 2016: memberSo put each and every BIP into the GBT client, even before it has activated?
Consider that the server trusted for name:bit mappings could very well be your own local bitcoind.
luke-jr commented at 11:04 PM on April 5, 2016: memberAlso, even if each BIP were put into the GBT client, the client doesn't have the required blockchain context to determine if the BIP has activated or is still pending.
sipa commented at 11:06 PM on April 5, 2016: memberIf the client software doesn't know about a BIP, why does it care?
How does it help that the server says "these arbitrary string names exist", if the client doesn't know what protocol changes they correspond to? If they care about the rules, they know the rule's name too.
luke-jr commented at 12:19 AM on April 6, 2016: memberFor example, a miner might want to use --veto-vbits=bip109 to instruct their software to automatically unset the BIP 109 bit, and reject pools that require it. Or --require-vbits=bip109 for the opposite.
luke-jr commented at 10:12 AM on April 6, 2016: memberIf the server doesn't support it, it shouldn't be indicating it does regardless.
sipa commented at 10:15 AM on April 6, 2016: memberWell by default nVersion will always be setting bits for everything that it supports. The miner is always free to unset bits from it, but I don't think it's the server's job to explain the consensus rules to the miner.
sipa cross-referenced this on Apr 19, 2016 from issue Segregated witness by sipaMerge branch 'master' into segwit_gbt_updates_20160330 5f697ea543bip-0009: Recommend name "bipN" 7e99bbf958BIP 9 (& 145): Switch to rules/vbavailable/vbrequired GBT interface 4683a9b714Merge remote-tracking branch 'personal-github/segwit_gbt_updates_20160330' into segwit_gbt_updates_20160330 2e5533849eluke-jr commented at 8:23 PM on April 23, 2016: member@sipa @petertodd @gmaxwell @rustyrussell @CodeShark @jl2012
This has been revised per discussion. Please re-check and ACK if acceptable.
luke-jr force-pushed on Apr 23, 2016BIP 9, 22 & 145: Use simple Yes/No rather than templates (which don't work on GitHub) 31c45b611dluke-jr force-pushed on Apr 23, 2016BIP 9: Clarify GBT "version" 3cfa48d1e0BIP 9 & 145: rules/force mutation cc4a94c1c0luke-jr cross-referenced this on Apr 25, 2016 from issue Versionbits: GBT support by luke-jrsipa commented at 5:42 AM on April 25, 2016: memberThe changes in BIP22 are just formatting?
luke-jr commented at 6:30 AM on April 25, 2016: memberYes, someone noticed the {{templates}} were not rendering on GitHub.
jl2012 commented at 8:20 AM on April 25, 2016: contributorACK 141
jl2012 cross-referenced this on Apr 26, 2016 from issue Sigops are in witnessScript, not witness program by instagibbstheuni commented at 5:13 PM on May 5, 2016: memberConcept ACK on GBT changes. It's a bit hazy though as to what the server should do if a softfork rule is missing from the request, and there's the possibility of altering the block (potentially in a nasty way, like coinbase-only) to make it compatible. In segwit's case, would the lack of a "segwit" rule in the request cause an error post-activation, or would witness transactions be filtered out?
luke-jr commented at 4:04 AM on May 6, 2016: memberIt's a bit hazy though as to what the server should do if a softfork rule is missing from the request, and there's the possibility of altering the block (potentially in a nasty way, like coinbase-only) to make it compatible. In segwit's case, would the lack of a "segwit" rule in the request cause an error post-activation, or would witness transactions be filtered out?
The server has a few options:
- Filter out witness transactions and use rules/force
- Produce the full witness-enabled template, and do not use rules/force. The client in this case must refuse to proceed unless it can handle segwit (listed in "rules")
- Throw an error
theuni commented at 3:10 AM on May 7, 2016: memberRight, and that ambiguity is kinda nasty without a proposed implementation. I'd go as far as saying that it should never throw an error if there's the possibility of somehow creating a valid block. Maybe another input flag could be added for "fail for degraded blocks".
Regardless, this needs to be laid out in the BIP.
luke-jr commented at 3:28 AM on May 7, 2016: memberWhich method a server uses in this situation is implementation-specific, not part of the standard. In any case, it is already documented clearly here: https://github.com/bitcoin/bips/pull/365/files#diff-6a9961b118279d111faf86ad6ebbfedbR204
Please feel free to proposed improved language.
theuni commented at 4:01 AM on May 7, 2016: memberNACK that. Where preferences can be communicated, they should be, and they should be respected by the server. Otherwise what ends up being "part of the standard" is the default behavior of the leading implementation.
luke-jr commented at 4:05 AM on May 7, 2016: memberI don't understand what you're NACKing.
theuni commented at 5:14 PM on May 7, 2016: memberI'm NACKing the language that makes the behavior implementation-specific. I'm suggest changes to either:
- Add a
rules/degradedvalue to the template, so that the miner is aware that the block has been downgraded in some way as a result of a missing input rule. This is different from therules/forcekey, in that the latter does not necessarily mean that the block has been degraded. or - Add an optional "error_degraded" key to the request that signals that the server should not try to degrade the block as a result of a missing input rule, but throw an error instead.
Along with the addition of text along the lines of
Unless signaled (by whichever mechanism above), the server should always attempt to provide the client with a template that will allow the client to create a valid block, degraded only as much as is necessary. Only in the case where no solution from the client would be valid should the server return an error.With those changes, it would be clear what the implementation for Core should look like.
luke-jr commented at 5:29 PM on May 7, 2016: memberAny item in "rules" the client does not understand implies it must error or (if "rules/force" is allowed) "is degraded".
theuni commented at 5:53 PM on May 7, 2016: memberForce (as I read it) doesn't necessarily mean degraded. It could simply mean that a serialization change would break the block, but that transactions haven't been removed. For example some future soft-fork that specifies a required order for transactions.
More importantly though, the text above guarantees backwards-compatibility when possible, as opposed to letting the implementation decide.
luke-jr commented at 9:44 PM on May 7, 2016: memberA softfork requiring ordered transactions would necessarily need to a new "rules" entry. When there are no rules that the client doesn't understand, "rules/force" is a no-op.
It's not the business of the spec to force backward compatibility. Implementations that don't want to provide it should be free not to.
Replace "rules/force" mutation with a "cannot be ignored" prefix to rule names 162e2e0025bip-0009: Remove n/a paragraph 5e6f3ba3bein bip-0009.mediawiki:None in 162e2e0025 outdated
195 | +Without this prefix, GBT clients may assume the rule will not impact usage of the template as-is; typical examples of this would be when previously valid transactions cease to be valid, such as BIPs 16, 65, 66, 68, 112, and 113. 196 | +If a client does not understand a rule without the prefix, it may use it unmodified for mining. 197 | +On the other hand, when this prefix is used, it indicates a more subtle change to the block structure or generation transaction; examples of this would be BIP 34 (because it modifies coinbase construction) and 141 (since it modifies the txid hashing and adds a commitment to the generation transaction). 198 | +A client that does not understand a rule prefixed by '!' must not attempt to process the template, and must not attempt to use it for mining even unmodified. 199 | + 200 | +Servers should only signal this mutation when they have verified a client behaving this way will not produce invalid blocks.
sipa commented at 6:45 PM on May 11, 2016:Does this section still match the text before?
luke-jr commented at 9:54 PM on May 11, 2016:No, it was left over. Removed.
in bip-0141.mediawiki:None in e8e5d5bc04 outdated
119 | @@ -120,9 +120,11 @@ The new rule is ''block cost'' ≤ 4,000,000. 120 | 121 | Sigops per block is currently limited to 20,000. We change this restriction as follows: 122 | 123 | -''Sigop cost'' is defined. The cost of a sigop in traditional script is 4, while the cost of a sigop in witness program is 1. 124 | +Sigops in the current pubkey script, signature script, and P2SH check script are counted at 4 times their previous value.
sipa commented at 11:13 PM on May 13, 2016:Any reason for removing the sigop cost terminology? I thought it was useful to distinguish from the original sigops definition.
luke-jr commented at 11:20 PM on May 13, 2016:I don't see how the original sigops definition is relevant post-segwit. ie, what's the point?
sipa commented at 11:39 PM on May 13, 2016:Avoiding confusion :)
luke-jr commented at 12:04 AM on May 14, 2016:I personally find it more confusing to have two terms for essentially the same thing of different versions... should GBT be changed to remove sigops/sigoplimit and add sigopcost/sigopcostlimit as well?
Merge remote-tracking branch 'origin/master' into segwit_gbt_updates_20160330 ce426ab4e1luke-jr force-pushed on May 15, 2016luke-jr cross-referenced this on May 22, 2016 from issue BIP 9: GBT updates for versionbits by luke-jrMerge branch 'master' into segwit_gbt_updates_20160330 8324bc512eluke-jr renamed this:BIP 9, 141, and 145: GBT updates for VB & SW
BIP 141 and 145: GBT updates for SegWit
on May 31, 2016sipa commented at 5:51 PM on June 1, 2016: memberACK
luke-jr merged this on Jun 1, 2016luke-jr closed this on Jun 1, 2016luke-jr deleted the branch on Apr 21, 2017dgenr8 cross-referenced this on Sep 28, 2018 from issue Bip135 3 by dagurval
This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-14 11:10 UTC
More mirrored repositories can be found on mirror.b10c.me