Skip to content

acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for testnet/regtest only#6329

Merged
laanwj merged 1 commit into
bitcoin:masterfrom
luke-jr:testnet_nonstdtxn
Jul 3, 2015
Merged

acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for testnet/regtest only#6329
laanwj merged 1 commit into
bitcoin:masterfrom
luke-jr:testnet_nonstdtxn

Conversation

@luke-jr

@luke-jr luke-jr commented Jun 24, 2015

Copy link
Copy Markdown
Member

Inspired by #6255, this makes it possible to enable IsStandard for regtest/testnet (but doesn't allow disabling it on mainnet), while remaining compatible with long-standing options in other node software.

@luke-jr
luke-jr force-pushed the testnet_nonstdtxn branch from cb5eb0b to 811bff3 Compare June 24, 2015 03:45
Comment thread src/init.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is confusing, as it doesn't make clear that the default is true on testnet and regtest.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How would you improve it?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One possibility: "Relay and mine \"non-standard\" transactions (testnet/regtest only, default: true)"

Edit: Want to clarify that a bit, I believe petertodd is confused by the default flag displayed ('0') when the actual flag setting code uses !Params().RequireStandard() defaulting true for testnet/regtest

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@faizkhan00 Yup, that's exactly the issue I'm worried about.

I think your wording is fine, modulo s/true/1/

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@luke-jr
luke-jr force-pushed the testnet_nonstdtxn branch 3 times, most recently from 811bff3 to f749607 Compare June 29, 2015 05:39
@petertodd

Copy link
Copy Markdown
Contributor

Modulo wording nit, tested ACK.

I'll close #6255 if this gets merged.

@luke-jr
luke-jr force-pushed the testnet_nonstdtxn branch from f749607 to ac76421 Compare June 30, 2015 23:34
@luke-jr

luke-jr commented Jun 30, 2015

Copy link
Copy Markdown
Member Author

Changed...

@luke-jr
luke-jr force-pushed the testnet_nonstdtxn branch 3 times, most recently from 953f36e to 35853d9 Compare July 1, 2015 03:09
Comment thread src/init.cpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be part of the debugging options (if(showDebug)). Consequently, also the message should be left un-translated.

@laanwj

laanwj commented Jul 3, 2015

Copy link
Copy Markdown
Member

utACK apart rom translation nits

@luke-jr
luke-jr force-pushed the testnet_nonstdtxn branch from 35853d9 to 81ec58c Compare July 3, 2015 07:45
@luke-jr

luke-jr commented Jul 3, 2015

Copy link
Copy Markdown
Member Author

Removed translation tags.

Comment thread src/init.cpp Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also add if(showDebug)

@luke-jr
luke-jr force-pushed the testnet_nonstdtxn branch from 81ec58c to 0c37634 Compare July 3, 2015 08:29
@luke-jr

luke-jr commented Jul 3, 2015

Copy link
Copy Markdown
Member Author

showDebug done

@laanwj
laanwj merged commit 0c37634 into bitcoin:master Jul 3, 2015
laanwj added a commit that referenced this pull request Jul 3, 2015
0c37634 acceptnonstdtxn option to skip (most) "non-standard transaction" checks, for testnet/regtest only (Luke Dashjr)
@jtimon

jtimon commented Jul 6, 2015

Copy link
Copy Markdown
Contributor

How did I missed this while being so insistent with @luke-jr and @petertodd about #5180 ...this is the wrong way to expose this...instead of -acceptnonstdtxn you would have just used -policy=test.

Comment thread src/init.cpp

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The semantics are wrong, why would the user be prevented from overrriding a particular chain's default?
This check is completely unnecessary.
Also, any reason to name the variable amd the option as opposites (instead of both RequireStandard or both acceptnonstdtxn)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually pretty dangerous to override the IsStandard() check on mainnet if you are a miner; you can end up creating blocks that take unreasonable amounts of time to verify, losing money.

Best go force people to edit the source code to so that.

Anyway, this is mainly useful for testing applications, so no need IMO to make this into a complex game of policy stuff when a simple and intuitive flag works.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@petertodd Then miners shouldn't use this option and it can be documented. There's more users besides miners who may be interested in accepting non-std transactions and give the choice to the users instead of endlessly discuss the best default or how hard should it be to change it for less and more technical users.
This particularly surprises me because @luke-jr once said "the testing policy is actually a sane policy to run in production", supposedly as an argument in favor of "-acceptnonstdtxn=0/1" over "policy=standard/test".
Actually, prohibiting the option in certain chains adds more code complexity and couples CStandardPolicy to Params() forever.
I'm sure nobody would be in favor of prohibiting the -datacarriersize option for the main chain. master...jtimon:safe-configurable-policy
"Bitcoin core, now with configurable policy that is only configurable for testnet and regtest".

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtimon There's DoS attacks that IsStandard() prevents.

Anyway, without peers that also accept your non-default transactions, changing policy locally is pretty pointless; solve that issue first. One idea would be a hashcash-based relay network, maybe using Bitmessage if you want to get it implemented quickly.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jtimon There's DoS attacks that IsStandard() prevents.

There's DoS attacks that minRelayTxFee prevents, yet still -minrelaytxfee=1 is allowed (and -minrelaytxfee=0 should be allowed as well IMO).

Anyway, without peers that also accept your non-default transactions, changing policy locally is pretty pointless; solve that issue first.

No, I'm fixing this first. Solve that yourself if you want to.
I've been wanting to expose this option as -policy=test for very long (#5180). Then 2 competing PRs appear and one of them gets merged very fast. Nobody asked me for review (even though I had been very insistent demanding review for #5180 myself) and thus I wasn't able to nit the proposals and thus what was merged us wrong, and I can fix some of the mistakes for free in #6068. #5180 couldn't be fairly compared with #6329 without some previous steps (#6068 among them) that are taking forever to review, but whatever, what's done it's done.

Anyway, if "changing policy locally is pretty pointless" then nobody will do it and we don't need to maintain this additional stupid restriction, do we?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway, enough discussion. Please ack/nack jtimon@2d71478 in #6068 so that we can move on.

random-zebra referenced this pull request in PIVX-Project/PIVX May 4, 2021
…tx functional tests coverage.

2d994c4 qa: adding test case for output value > input value out of range (furszy)
6165c80 qa: update and enable p2p_invalid_tx.py functional test. (furszy)
bb62699 Backport chainparams and validation `fRequireStandard` flags functionality + init 'acceptnonstdtxn' option to skip (most) "non-standard transaction" checks, for testnet/regtest only. (furszy)
0280c39 New regression testing for CVE-2018-17144, CVE-2012-2459, and CVE-2010-5137. (lucash-dev)
ec7d0b0 [qa] Test for duplicate inputs within a transaction (Suhas Daftuar)
a501fe1 qa: update and enable p2p_invalid_block.py. (furszy)
f83d140 qa: Read reject reasons from debug log, not p2p messages (furszy)
8a50165 [tests] Add P2PDataStore class (furszy)
ebed910 qa: Correct coinbase input script height. (furszy)
cae2d43 [tests] Reduce NodeConn connection logging from info to debug (John Newbery)

Pull request description:

  Introduced the `P2PDataStore` class into the functional test suite and updated it up to a point where was able to enable the `p2p_invalid_block.py` and `p2p_invalid_tx.py` functional tests. Plus updated both tests to a much recent version, expanding its testing coverage as well.
  Now the test suite is covering the primary CVE that btc had in the past.

  As both tests were simply unusable before and we have a different synchronization process than upstream, plus we didn't have some params and init/global flags, this work isn't following a PR by PR back port path. Had to made my own way up to the complete tests support.

  Main pilar PRs from upstream from where this work was based:
  * dashpay#6329.
  * bitcoin#11771.
  * bitcoin#14119 (only `p2p_invalid_tx.py`, `p2p_invalid_block.py` and `mininode.py` changes).
  * bitcoin#14247 (only 9b4a36e).
  * bitcoin#14696.

ACKs for top commit:
  random-zebra:
    ACK 2d994c4

Tree-SHA512: 548830b5fbf8b7f383832a7eea96179d089a4c9c222ef34007846f53736b07c873e37084235f1575eac157b63308c00ab3be78b71d3ed6520f4f73f1c8de81a5
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants