BIP-342 specifies that the initial stack resource checks happen after OP_SUCCESSx processing, and explicitly notes the checks "can be bypassed using OP_SUCCESSx". Core implements this correctly, but there are currently no tests covering this behavior. This means a consensus-breaking change to the ordering could pass the test suite undetected. Verified this on local commit https://github.com/ViniciusCestarii/bitcoin/commit/68d24d74301fe01ff612535878cb2ae864e8183f, which mutates to incorrectly implement the order and CI still turns green.
Add a new test at feature_taproot.py to cover OP_SUCCESSx bypassing the initial stack element size limit.
Verified that the new test catches the mutant: https://github.com/ViniciusCestarii/bitcoin/commit/f8f42a13a8142ac50ee24b33e814d4f4a48ee53d.