From 3bb87bc61b489911cf36e50f74ac8b6ee201b82b Mon Sep 17 00:00:00 2001 From: ViniciusCestarii Date: Thu, 20 Aug 2026 15:58:04 -0300 Subject: [PATCH 1/4] test: cover OP_FROMALTSTACK must pop the altstack https://bitcoincore.space/src/script/interpreter.cpp#3951 --- src/test/data/script_tests.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/data/script_tests.json b/src/test/data/script_tests.json index b88c6415472..d29c152b60a 100644 --- a/src/test/data/script_tests.json +++ b/src/test/data/script_tests.json @@ -1042,6 +1042,7 @@ ["NOP", "TOALTSTACK 1", "P2SH,STRICTENC", "INVALID_STACK_OPERATION", "but, hey, more is always better, right?"], ["1", "FROMALTSTACK", "P2SH,STRICTENC", "INVALID_ALTSTACK_OPERATION"], +["1", "2 TOALTSTACK FROMALTSTACK FROMALTSTACK", "P2SH,STRICTENC", "INVALID_ALTSTACK_OPERATION", "FROMALTSTACK must pop the altstack"], ["1", "2DROP 1", "P2SH,STRICTENC", "INVALID_STACK_OPERATION"], ["1", "2DUP", "P2SH,STRICTENC", "INVALID_STACK_OPERATION"], ["1 1", "3DUP", "P2SH,STRICTENC", "INVALID_STACK_OPERATION"], From 331bf798819ca4f2815450ba50d5920e2d2c2aa6 Mon Sep 17 00:00:00 2001 From: ViniciusCestarii Date: Thu, 20 Aug 2026 19:06:44 -0300 Subject: [PATCH 2/4] test: cover OP_WITHIN must pop all 3 elements https://bitcoincore.space/src/script/interpreter.cpp#4084 --- src/test/data/script_tests.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/data/script_tests.json b/src/test/data/script_tests.json index d29c152b60a..ea0ed8d7cbf 100644 --- a/src/test/data/script_tests.json +++ b/src/test/data/script_tests.json @@ -221,6 +221,7 @@ ["11 -100 100", "WITHIN", "P2SH,STRICTENC", "OK"], ["-2147483647 -100 100", "WITHIN NOT", "P2SH,STRICTENC", "OK"], ["2147483647 -100 100", "WITHIN NOT", "P2SH,STRICTENC", "OK"], +["0 0 1", "WITHIN DEPTH 1 EQUALVERIFY", "P2SH,STRICTENC", "OK", "WITHIN must pop all 3 elements"], ["2147483647 2147483647 SUB", "0 EQUAL", "P2SH,STRICTENC", "OK"], ["2147483647 DUP ADD", "4294967294 EQUAL", "P2SH,STRICTENC", "OK", ">32 bit EQUAL is valid"], From 86c7fb910d674c757c4829cd006b3732d3a5e78b Mon Sep 17 00:00:00 2001 From: ViniciusCestarii Date: Thu, 20 Aug 2026 19:47:32 -0300 Subject: [PATCH 3/4] test: cover OP_16 does not count towards the opcode limit https://bitcoincore.space/src/script/interpreter.cpp#3883 --- src/test/data/script_tests.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/data/script_tests.json b/src/test/data/script_tests.json index ea0ed8d7cbf..1b0d7c6906d 100644 --- a/src/test/data/script_tests.json +++ b/src/test/data/script_tests.json @@ -333,6 +333,10 @@ "0x616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161", "P2SH,STRICTENC", "OK", "201 opcodes executed. 0x61 is NOP"], +["1", +"0x60606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060606060", +"P2SH,STRICTENC", "OK", +"202 OP_16 do not count towards the 201 opcode limit."], ["1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "1 2 3 4 5 0x6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f6f", "P2SH,STRICTENC", "OK", From 4a12773f269742d2c655beb1b3f5ffe98e9beadb Mon Sep 17 00:00:00 2001 From: ViniciusCestarii Date: Fri, 21 Aug 2026 11:17:25 -0300 Subject: [PATCH 4/4] test: cover DERSIG rejects a non-compound signature type https://bitcoincore.space/src/script/interpreter.cpp#3808 --- src/test/data/script_tests.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/data/script_tests.json b/src/test/data/script_tests.json index 1b0d7c6906d..2eb02c40ca8 100644 --- a/src/test/data/script_tests.json +++ b/src/test/data/script_tests.json @@ -1292,6 +1292,7 @@ ["0x17 0x3014020002107777777777777777777777777777777701", "0 CHECKSIG NOT", "DERSIG", "SIG_DER", "Zero-length R is incorrectly encoded for DERSIG"], ["0x17 0x3014021077777777777777777777777777777777020001", "0 CHECKSIG NOT", "DERSIG", "SIG_DER", "Zero-length S is incorrectly encoded for DERSIG"], ["0x27 0x302402107777777777777777777777777777777702108777777777777777777777777777777701", "0 CHECKSIG NOT", "DERSIG", "SIG_DER", "Negative S is incorrectly encoded for DERSIG"], +["0x27 0x312402107777777777777777777777777777777702107777777777777777777777777777777701", "0 CHECKSIG NOT", "DERSIG", "SIG_DER", "Non-compound type is incorrectly encoded for DERSIG"], ["Some basic segwit checks"], [["00", 0.00000000 ], "", "0 0x206e340b9cffb37a989ca544e6bb780a2c78901d3fb33738768511a30617afa01d", "P2SH,WITNESS", "EVAL_FALSE", "Invalid witness script"],