Varops: Two BIPs for Script Restoration: varops calculations and tapleaf version (0xc2).#2118
Varops: Two BIPs for Script Restoration: varops calculations and tapleaf version (0xc2).#2118rustyrussell wants to merge 12 commits intobitcoin:masterfrom
Conversation
…eaf version (0xc2). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
|
to fix the CI we should add |
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
murchandamus
left a comment
There was a problem hiding this comment.
I only made it to the Multiply and Divide Opcodes in this first read. I suspect that I’m missing something about how you are describing the opcodes. Please see my comments for details.
1cfb44f to
c4572fe
Compare
Great feedback from Murch: 1. Lots of markdown instead of mediawiki formatting fixed. 2. Input count max fixed (explanatory only, but still a good fix). 3. Justification for detailed by-byte nature of descriptions added to global Rationale. 4. Note on truncation moved earlier, and expanded. 5. OP_OR/OP_XOR clarified to make it clear that A is altered "in-place". 6. Clarification on early termination (and thus cost) of OR and XOR. 7. nee is spelled "née" (Julian suggested replacing it, but let's try to keep some culture alive!). 8. Murch is now thanked in the thanks section. In particular, Murch's confusion was enlightening. I had not appreciated that the reduction in script capability (removing all bitops and limiting operand size) made endian of stack objects very much an *implementation detail*, thus these descriptions are battling with people's head-canon of how Bitcoin's Stack Is Just Numbers. Mere words can only do so much to address this issue, but I've tried, and at least I'm now aware of this. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
c4572fe to
7d29c19
Compare
|
@murchandamus thankyou for your detailed review. Here's the comment on the fixup commit which I hope addresses it: |
murchandamus
left a comment
There was a problem hiding this comment.
Thanks, the additional explanation and additions to the abstract helped.
My first impression from the document titles was that "Restoration of disabled script functionality (Tapscript v2)" would be focused on explaining the functionality of the restored opcodes (and perhaps only maybe mention costs), whereas "Varops Budget For Script Runtime Constraint" would expound on the budget and how the costs were found. It seemed to me that you were splitting the content for users of script from the content for the implementers.
In hindsight, I should have first read "Varops Budget For Script Runtime Constraint", I think "Restoration of disabled script functionality (Tapscript v2)" would have made more sense to me after that. Either way, the title "Restoration of disabled script functionality (Tapscript v2)" does not set the expectation that the main focus of the document would be to provide Rationale for the costs of the restored opcodes.
Yes, the split is kind of awkward :(
If we were to put restoration first, that BIP would become trivial. But, also, kinda useless? The varops budget BIP would then have to re-describe the restored opcodes in precise detail, in order to derive their costs. I guess there are three parts:
Happy to do this. If so, would number 3 be a separate BIP, or a giant appendix? I think I'm too close to it to see it through fresh eyes, so I'll take your advice here? Help! |
minimum signature size fix from Murch. Co-authored-by: Mark "Murch" Erhardt <murch@murch.one>
More refinement from Murch: 1. v2 is bad, be explicit with 0xC2 Tapleaf. 2. Title was over 50 chars. 3. Footnote for normalization decisions (mainly, legacy) 4. Cleaner quote of bip-0342, for nice line-wrap. 5. OP_RIGHT clarification (esp. if offset > length). 6. OP_2MUL and OP_2DIV clarification (bit moves across bytes) to match how detailed we were in OP_ADD. 7. Use explicit language on what ops are cost 0. 8. Be consistent with "64-bit" vs "64 bit". Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
All fixes reported by Murch, who is slowly teaching me mediawiki. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
c45c5bc to
0c7e36a
Compare
0c7e36a to
1093247
Compare
murchandamus
left a comment
There was a problem hiding this comment.
Looks good, except for one more MediaWiki quirk and a potential issue in OP_RIGHT.
murchandamus
left a comment
There was a problem hiding this comment.
Noticed a few more minor things when scanning the changes from the last version I reviewed.
|
Note: I noticed that we used the marker ARITH on some costs. This is not present in the varops BIP: I'm consulting with @jmoik now to see if this is a simple omission, or requires deeper change :( |

The full revision history is available in a separate branch (https://github.com/rustyrussell/bips/tree/guilt/varops): this is a clean one to submit for merge.