-
Notifications
You must be signed in to change notification settings - Fork 38.8k
test: Require standard txs in regtest by default #15891
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
|
Sounds good to me. |
|
Yes, please. |
|
Concept ACK. FYI I found the title of the PR and the PR description a bit confusing, because it wasn't clear to me if this was going to make it so that we would be able to configure a regtest node to accept non-standard transactions, or if regtest would be treated the same as mainnet and it would not be allowed at all. |
|
Concept ACK |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. 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. |
Sjors
left a comment
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.
tACK faac8a2 on macOS 10.14.4 and Ubuntu 18.04
test/functional/feature_rbf.py
Outdated
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.
I can confirm this is needed to pass the test, but I'm confused why.
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.
The test spends from anyone-can-spend "padded" scriptPubKeys such as CScript([b'a' * 35])
|
Concept NACK. Tests affected by policy (other than tests for the policy itself) are broken. Not enforcing policy on such tests helps improve test quality. |
|
I don't particularly like re-introducing a chain type enumeration. The introduction of the ChainParams structure was supposed to make the entire chain information data-driven (with a possibility to add custom hybrid chain types for specific testing, for example, in the future), and this seems a step back from this by making it easier to match on "chain type" instead of add a bit/parameter to the structure for a specific property. |
|
Perhaps instead it should be toggled in the test framework's default options? |
|
In this case the property really is Personally, I don't see why an enumeration can not have an additional type |
jnewbery
left a comment
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.
tested ACK faac8a22faa62dcde3ded60063eff8beb042bafb
A few small suggestions inline
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.
Suggest you just remove this. We don't usually specify config in tests where it's the default.
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.
I think it is easier to read due to symmetry
test/functional/p2p_segwit.py
Outdated
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.
as above, I suggest you remove "-acceptnonstdtxn=0" from here since it's default config
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.
I think it is easier to read due to symmetry
faac8a2 to
faf3ba4
Compare
|
Remove the two intermediate |
faf3ba4 to
faa4cba
Compare
|
Sorry had to rebase due to silent merge conflicts in the tests |
faa4cba to
faa36e1
Compare
|
utACK cd338016f5663703cd6eb87bd4403a8fcb4f27a9 |
|
@jnewbery Looks like you posted this on the wrong repo? |
|
Oops. Sorry, I rebased this PR on a later master which is how I got the cd33801.. hash. utACK faa36e1303773bec382600cb70ccd65eb5bbd33b |
faa36e1 to
fa14bda
Compare
|
Rebased due to conflict in a test file |
fa14bda to
fa70308
Compare
test/functional/feature_block.py
Outdated
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.
Most tests shouldn't care about tx policy (only policy-specific tests should), so this should be set by default in the test framework.
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.
Disagree with the conclusion here -- most tests should be working with std transactions, so there should be an error reported when a non-std tx is accidently used. Having tests that do use non-std txs declare it explicitly seems right to me.
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.
Tests should not begin to fail just because the node policy changes (unless those tests are specifically covering policy code).
jnewbery
left a comment
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.
ACK fa70308485b2b8cca371581966f40dfcb7efd9fb modulo one requested change to the release notes.
fa2a0ce to
fad7722
Compare
|
ACK fad77227b2b5df547d59bc226b652663aa8bf185 |
ajtowns
left a comment
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.
Approach ACK, not keen on "user can change chain params" naming, but the rest looks good to me.
test/functional/feature_block.py
Outdated
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.
Disagree with the conclusion here -- most tests should be working with std transactions, so there should be an error reported when a non-std tx is accidently used. Having tests that do use non-std txs declare it explicitly seems right to me.
fad7722 to
fabf87d
Compare
fabf87d to
fa89bad
Compare
| /** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */ | ||
| bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; } | ||
| /** Whether it is possible to mine blocks on demand (no retargeting) */ | ||
| bool MineBlocksOnDemand() const { return consensus.fPowNoRetargeting; } |
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.
Not sure why the most newly introduced but redundant one is removed instead of the other way around, but not important.
|
|
||
| fRequireStandard = !gArgs.GetBoolArg("-acceptnonstdtxn", !chainparams.RequireStandard()); | ||
| if (chainparams.RequireStandard() && !fRequireStandard) | ||
| if (!chainparams.IsTestChain() && !fRequireStandard) { |
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.
I didn't even know it was forbidden to use -acceptnonstdtxn=1 on mainchain...
Anyway, I don't like IsTestChain much, it is not descriptive. What about forbid_nonstd?
Or Leave this at RequireStandard and separate another DefaultRequireStandard or DefaultAcceptNonStd like @sipa suggested?
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.
I am happy to extend the docstring of IsTestChain if it is not descriptive enough, but I'd like to keep it unless others agree that it should go.
I think it is useful to have a single boolean param to indicate whether the chain's purpose is test-only.
|
utACK beyond nits. |
|
ACK fa89bad |
|
This will be merged next week Wednesday, unless there are objections. |
fa89bad test: Require standard txs in regtest (MarcoFalke) fa9b419 test: Add test that mainnet requires standard txs (MarcoFalke) fa613ca chainparams: Remove unused fMineBlocksOnDemand (MarcoFalke) Pull request description: I don't see a reason why regtest should allow non-standard txs, as it makes testing mainnet behaviour such as bitcoin#15846 unnecessarily hard and unintuitive. Of course, testnet policy remains unchanged to allow propagation of non-standard txs. ACKs for top commit: ajtowns: ACK fa89bad Tree-SHA512: c4c675affb054868850bd2683aa07f4c741a448cbacb2ea8334191e105f426b0790fe6a468be61e9c5880d24154f7bf1c7075051697172dce92180c1bc3a1c90
fa89bad test: Require standard txs in regtest (MarcoFalke) fa9b419 test: Add test that mainnet requires standard txs (MarcoFalke) fa613ca chainparams: Remove unused fMineBlocksOnDemand (MarcoFalke) Pull request description: I don't see a reason why regtest should allow non-standard txs, as it makes testing mainnet behaviour such as bitcoin#15846 unnecessarily hard and unintuitive. Of course, testnet policy remains unchanged to allow propagation of non-standard txs. ACKs for top commit: ajtowns: ACK fa89bad Tree-SHA512: c4c675affb054868850bd2683aa07f4c741a448cbacb2ea8334191e105f426b0790fe6a468be61e9c5880d24154f7bf1c7075051697172dce92180c1bc3a1c90
Summary:
fa89badf887dcc01e5bdece248b5e7d234fee227 test: Require standard txs in regtest (MarcoFalke)
fa9b4191609c3ef75e69d391eb91e4d5c1e0bcf5 test: Add test that mainnet requires standard txs (MarcoFalke)
fa613ca0a8f99c4771859de9e571878530d3ecb5 chainparams: Remove unused fMineBlocksOnDemand (MarcoFalke)
Pull request description:
I don't see a reason why regtest should allow non-standard txs, as it makes testing mainnet behaviour such as #15846 unnecessarily hard and unintuitive.
Of course, testnet policy remains unchanged to allow propagation of non-standard txs.
ACKs for top commit:
ajtowns:
ACK fa89badf887dcc01e5bdece248b5e7d234fee227
Tree-SHA512: c4c675affb054868850bd2683aa07f4c741a448cbacb2ea8334191e105f426b0790fe6a468be61e9c5880d24154f7bf1c7075051697172dce92180c1bc3a1c90
---
This is a backport of Core [[bitcoin/bitcoin#15891 | PR15891]], plus changing our own tests to allow for non-standard transactions and prevent them from failing under the new rule.
Test Plan:
ninja check
./test_runner.py --extended
Reviewers: Fabien, #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D5764
Summary:
fa89badf887dcc01e5bdece248b5e7d234fee227 test: Require standard txs in regtest (MarcoFalke)
fa9b4191609c3ef75e69d391eb91e4d5c1e0bcf5 test: Add test that mainnet requires standard txs (MarcoFalke)
fa613ca0a8f99c4771859de9e571878530d3ecb5 chainparams: Remove unused fMineBlocksOnDemand (MarcoFalke)
Pull request description:
I don't see a reason why regtest should allow non-standard txs, as it makes testing mainnet behaviour such as #15846 unnecessarily hard and unintuitive.
Of course, testnet policy remains unchanged to allow propagation of non-standard txs.
ACKs for top commit:
ajtowns:
ACK fa89badf887dcc01e5bdece248b5e7d234fee227
Tree-SHA512: c4c675affb054868850bd2683aa07f4c741a448cbacb2ea8334191e105f426b0790fe6a468be61e9c5880d24154f7bf1c7075051697172dce92180c1bc3a1c90
---
This is a backport of Core [[bitcoin/bitcoin#15891 | PR15891]], plus changing our own tests to allow for non-standard transactions and prevent them from failing under the new rule.
Test Plan:
ninja check
./test_runner.py --extended
Reviewers: Fabien, #bitcoin_abc, deadalnix
Reviewed By: #bitcoin_abc, deadalnix
Subscribers: deadalnix
Differential Revision: https://reviews.bitcoinabc.org/D5764
I don't see a reason why regtest should allow non-standard txs, as it makes testing mainnet behaviour such as #15846 unnecessarily hard and unintuitive.
Of course, testnet policy remains unchanged to allow propagation of non-standard txs.