-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Ignore datacarrier limits for dataless OP_RETURN outputs #27261
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
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Is the use-case idea to be able to a little more compactly burn a dusty output to OP_RETURN? |
Yes. For example, my dust-b-gone script uses a bare OP_RETURN output without data: https://github.com/petertodd/dust-b-gone/blob/95020b4d0280d5ad2c8973b2e981e5dd966e2315/merge-dust-txs.py#L70 To be clear, bare OP_RETURN is currently standard with the default datacarrier settings. All this pull-req changes is it'll allow a bare OP_RETURN in the (rare) case that people are disabling datacarrier outputs, because a bare OP_RETURN carries no data. |
Concept ACK Some questions:
Minimum for
It is still OP_RETURN output, right? |
Honestly I think it's time to discuss removing the |
NACK. If someone wants to allow a bare OP_RETURN and nothing more they can set |
I'm not sure how this is being used in practice, so perhaps the safest thing to do is what @ajtowns suggests: document clearly that The current doc for
Maybe change it to:
|
Well, reading this 10 times, I am not sur to see what it has to do with #27043 |
I assume this was a test run for real pull request which will be controversial for sure. |
Like I said, bare Second, if you are going to take that attitude, why do we even have the @instagibbs Last time I checked a few months ago I could find examples of every single active mining pool mining data carrying OP_RETURN outputs. So yes, the |
What do you mean and what is your problem? Write things about me? |
@Ayms Edited. Sorry it wasn't for you. |
Agreed. But if you stick to this approach, please write a test. |
They don't carry any data, so the -datacarrier/-datacarriersize options should not apply to them. Previously a transaction containing an OP_RETURN without data would be rejected if datacarrier was set to false, or the datacarriersize was set to zero.
4b91859
to
baa2831
Compare
@Sjors Added a test. |
Would you mind submitting the test to test current |
I certainly don't mind if someone else does that. |
I must be brain damaged or something like this, still I don't get what it has to do with #27043 (and when it will happen) |
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.
Concept ACK, unless there's clear historical context somewhere (that I missed) showing that the folks who introduced -nodatacarrier
intended to prevent burning of coins (as distinct from "spam").
As far as I can tell the current behavior was implemented by accident in #5077. The goal of that PR was to make the limit configurable for miners. Specifically the limit at the time was 40 and some miners wanted 80. A side-effect of the change is that if you set it to 0 it would also stop an OP_RETURN
burn, but that's not even mentioned in the PR.
In other words, imo this PR fixes a bug.
utACK baa2831
@@ -83,7 +83,9 @@ bool IsStandard(const CScript& scriptPubKey, const std::optional<unsigned>& max_ | |||
if (m < 1 || m > n) | |||
return false; | |||
} else if (whichType == TxoutType::NULL_DATA) { | |||
if (!max_datacarrier_bytes || scriptPubKey.size() > *max_datacarrier_bytes) { |
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 to other reviewers: max_datacarrier_bytes
is nullptr when DEFAULT_ACCEPT_DATACARRIER
is (patched to) false
.
Not sure. I don't think it makes sense to change the behavior of the |
@MarcoFalke the I didn't check when that was changed and why though. |
Probably in da894ab, which added the Though, I still think |
That's fine by me as well (as an extra commit here or a followup). It would need a breaking change release note, because otherwise someone setting
Indeed, #6424 lost the distinction. That PR was a cleaner alternative to #5079. The latter did preserve the distinction, but didn't include a test for the just-an-OP_RETURN case (these tests were copied into the new PR). |
Someone should probably fix #15021 :) |
The presence of the output is itself data (debatable if 1-bit or more). If an exception is being made, perhaps it should at least require a value burned or absence of other outputs? |
On Thu, Jun 22, 2023 at 02:16:34PM -0700, Luke Dashjr wrote:
The presence of the output is itself data (debatable if 1-bit or more). If an exception is being made, perhaps it should at least require a value burned or absence of other outputs?
We already allow transactions to pick nSequence and nLocktime, allowing for far
more bits of data than the data embedded by the presence or absence of an
OP_Return. There is no reason to create such convoluted rules to prevent the
off chance of someone embedding a bit or two.
|
Agreed on removing the I could perhaps see an argument for moving all the const auto dc = args.GetBoolArg("-datacarrier");
if (dc.has_value()) {
if (args.IsArgSet("-datacarriersize")) {
LogPrintf("%s: parameter interaction: -datacarriersize set -> ignoring -datacarrier=%d\n", __func__, *dc);
} else if (!*dc) {
args.SoftSetArg("-datacarriersize", 1); // allow a single push-less OP_RETURN
LogPrintf("%s: parameter interaction: -datacarrier=%d -> setting -datacarriersize=%d\n", __func__, *dc, 1);
}
} in order to have an easy way of saying "no data thanks, but a dummy output for burning to fees is fine" other than the not at all obvious Even more so given we don't actually support creating a pushless OP_RETURN via |
It's not possible to omit them...
As far as actual data usage, the additional output requires at least 10 bytes (64-bit amount, length of script, and the actual OP_RETURN). |
Closing in favor of #28130 |
They don't carry any data, so the -datacarrier/-datacarriersize options should not apply to them. Previously a transaction containing an OP_RETURN without data would be rejected if datacarrier was set to false, or the datacarriersize was set to zero.