test and regtest mempool: not require standard, non-mandatory, input script verification flags #7748

pull mruddy wants to merge 1 commits into bitcoin:master from mruddy:nonstandard-sighash changing 1 files +1 −1
  1. mruddy commented at 1:52 PM on March 26, 2016: contributor

    I was testing non-standard signature hash flags on test and regtest and was getting these rejections: "non-mandatory-script-verify-flag (Signature hash type missing or not understood)"

    This change to AcceptToMemoryPoolWorker simply allows the mempool of nodes on the test and regtest networks to accept transactions containing signatures with non-standard signature hash types.

  2. AcceptToMemoryPoolWorker: allow test and regtest networks to not require standard, but not mandatory, input script verification flags 83af25fe82
  3. in src/main.cpp:None in 83af25fe82
    1351 | @@ -1352,7 +1352,7 @@ bool AcceptToMemoryPoolWorker(CTxMemPool& pool, CValidationState& state, const C
    1352 |  
    1353 |          // Check against previous transactions
    1354 |          // This is done last to help prevent CPU exhaustion denial-of-service attacks.
    1355 | -        if (!CheckInputs(tx, state, view, true, STANDARD_SCRIPT_VERIFY_FLAGS, true))
    1356 | +        if (fRequireStandard && !CheckInputs(tx, state, view, true, STANDARD_SCRIPT_VERIFY_FLAGS, true))
    


    laanwj commented at 2:37 PM on March 26, 2016:

    I'm fairly sure that this is not correct. You certainly shouldn't be skipping the inputs check when standard-ness is not required, it is part of consensus not standardness.


    sipa commented at 3:12 PM on March 26, 2016:

    There is a second invocation to CheckInputs below, with just mandatory checks.

  4. sipa commented at 3:16 PM on March 26, 2016: member

    It may make sense to disable the extra validation flags in some case for testing, but I don't think it should be done unconditionally.

    The standardness validation flags don't really disable any functionality (that's done through IsStandard), but some are for example used to roll out softforks safely. Disabling those entirely on testnet means that it can't be used to test whether such relay rules actually work.

  5. mruddy commented at 5:07 PM on March 26, 2016: contributor

    It's still changeable per node with "-acceptnonstdtxn" on test and regtest.

    The way I was looking at this commit was that it makes the application or non-application of standard-ness validation, as controlled by "-acceptnonstdtxn", more complete.

    I think fRequireStandard in the chain params is false for these two networks in order to not inhibit propagation and inclusion of possibly surprising valid stuff, and hopefully catch related bugs in non-prod testing.

    I see your point though too. On regtest this change was definitely helpful for my local testing. On testnet3, because standard-ness validation is the default for what I was testing in current nodes, it's kind of sterile. I was having trouble getting relay and I couldn't find good info on current testnet miner policies or where I could submit to a miner that accepted non-standard testnet transactions (which makes sense, but it was kind of a pain).

  6. laanwj added the label Validation on Mar 29, 2016
  7. mruddy commented at 2:38 PM on April 27, 2016: contributor

    Doesn't look like this is gaining any traction. I'll close it in a few days if nobody objects.

  8. mruddy closed this on Apr 29, 2016

  9. mruddy deleted the branch on Apr 29, 2016
  10. DrahtBot locked this on Sep 8, 2021
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-30 21:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me