test: properly check for per-tx sigops limit

Currently the per-tx sigops limit standardness check (bounded by
`MAX_STANDARD_TX_SIGOPS_COST`, throwing "bad-txns-too-many-sigops"
if exceeded) is only indirectly tested with the much higher per-block
consensus limit (`MAX_BLOCK_SIGOPS_COST`), i.e. an increase in the
limit would still pass all tests. Refine that by splitting up the invalid
tx template `TooManySigops` in a per-block and a per-tx one.

The involved functional tests taking use of these templates are
`feature_block.py` and `p2p_invalid_txs.py`.
This commit is contained in:
Sebastian Falbesoner
2025-05-16 16:27:28 +02:00
parent 3f83c744ac
commit 7bc64a8859
2 changed files with 21 additions and 2 deletions

View File

@@ -49,6 +49,7 @@ from .util import assert_equal
MAX_BLOCK_SIGOPS = 20000
MAX_BLOCK_SIGOPS_WEIGHT = MAX_BLOCK_SIGOPS * WITNESS_SCALE_FACTOR
MAX_STANDARD_TX_SIGOPS = 4000
MAX_STANDARD_TX_WEIGHT = 400000
# Genesis block time (regtest)