diff --git a/stackslib/src/chainstate/tests/mod.rs b/stackslib/src/chainstate/tests/mod.rs
index 5cc9d90523..1595f0ed5c 100644
--- a/stackslib/src/chainstate/tests/mod.rs
+++ b/stackslib/src/chainstate/tests/mod.rs
@@ -14,6 +14,7 @@
// along with this program. If not, see .
pub mod consensus;
mod parse_tests;
+mod static_analysis_tests;
use std::fs;
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_bad_match_input.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_bad_match_input.snap
new file mode 100644
index 0000000000..e7f9aa0056
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_bad_match_input.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "0263830e8d5e8a47c31382256d9608d41fb6d53b95ef85e3da06d70dc2cf5095",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-input-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: match requires an input of either a response or optional, found input: \'int\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 14,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1662,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 14,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1662,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "4b39ac7225cca66a1fb2df3e471a3178d9fa54063fa3957bb40b84199f4af98d",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-input-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: match requires an input of either a response or optional, found input: \'int\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 14,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1662,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 14,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1662,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "b936b54305cae864335b0b489fa4d6afb0001e7fed2f82df339bd1beca72af2a",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-input-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: match requires an input of either a response or optional, found input: \'int\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 14,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1662,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 14,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1662,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "016e673aebdbb7cc7370029c118a8f5216574b7d2d8b4310f172be7666811262",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-input-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: match requires an input of either a response or optional, found input: \'int\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 14,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1662,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 14,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1662,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_bad_match_option_syntax.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_bad_match_option_syntax.snap
new file mode 100644
index 0000000000..2d8ad9d8bb
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_bad_match_option_syntax.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "97bdd398cc2e587a4a544054de83f26b716c28ba576ce0b73baf59227bf34f95",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-option-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expecting 4 arguments, got 3) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1538,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1538,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "c534c204ed354f05c2959377e96d25477fdfff0dc8133c8fc2425af464f46f5c",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-option-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expecting 4 arguments, got 3) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1538,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1538,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "769e0f2174f193dcae9cdbb5e80e0d8c8162a618f95a8be0ce98430ddf55e935",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-option-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expecting 4 arguments, got 3) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1538,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1538,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "8650a9ad98ee134b8ccdbabab4742e07f7a0fb64e7bfadb8eddbbcb597367b4e",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-option-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expecting 4 arguments, got 3) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1538,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1538,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_bad_match_response_syntax.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_bad_match_response_syntax.snap
new file mode 100644
index 0000000000..1ccae8f3db
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_bad_match_response_syntax.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "5a73aac7831befd63163ac6f9a6ad5a0be69013687380f767e21afd1f0cac873",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-response-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: match on a result type uses the following syntax: (match input ok-name if-ok-expression err-name if-err-expression). Caused by: expecting 5 arguments, got 3) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1485,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1485,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "aaa3ebe5b7074a85bd68dc9bc9bb7d64bfeb8ea43916c35caecfa6804969c169",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-response-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: match on a result type uses the following syntax: (match input ok-name if-ok-expression err-name if-err-expression). Caused by: expecting 5 arguments, got 3) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1485,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1485,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "37e6347d1073a867b149d6dbb2093f29796d87d0a170762a261ca829248c6c4a",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-response-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: match on a result type uses the following syntax: (match input ok-name if-ok-expression err-name if-err-expression). Caused by: expecting 5 arguments, got 3) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1485,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1485,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "42b191d1207c0aa4a43f35887fbd7625df62f017bce9c016e74e5cad481b6971",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: bad-match-response-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: match on a result type uses the following syntax: (match input ok-name if-ok-expression err-name if-err-expression). Caused by: expecting 5 arguments, got 3) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1485,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 11,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1485,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_cost_balance_exceeded.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_cost_balance_exceeded.snap
new file mode 100644
index 0000000000..92c1690922
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_cost_balance_exceeded.snap
@@ -0,0 +1,10 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Failure("Invalid Stacks block a58fcb42e51e055d3c11754df7c62976f69a02e9e4ffd7c83033fa7f670f229b: CostOverflowError(ExecutionCost { write_length: 0, write_count: 0, read_length: 0, read_count: 0, runtime: 0 }, ExecutionCost { write_length: 75013, write_count: 1, read_length: 1020001, read_count: 15001, runtime: 135183501 }, ExecutionCost { write_length: 15000000, write_count: 15000, read_length: 100000000, read_count: 15000, runtime: 5000000000 })"),
+ Failure("Invalid Stacks block 0b0d94606ac3b7adb14e1ae8dd5efb49504774555b3984eced1ab733da004fac: CostOverflowError(ExecutionCost { write_length: 0, write_count: 0, read_length: 0, read_count: 0, runtime: 0 }, ExecutionCost { write_length: 75013, write_count: 1, read_length: 1020001, read_count: 15001, runtime: 135168502 }, ExecutionCost { write_length: 15000000, write_count: 15000, read_length: 100000000, read_count: 15000, runtime: 5000000000 })"),
+ Failure("Invalid Stacks block 99c326760a910f67d9695673b15cce43602a161b31362d9e2ef388ab444306e2: CostOverflowError(ExecutionCost { write_length: 0, write_count: 0, read_length: 0, read_count: 0, runtime: 0 }, ExecutionCost { write_length: 75013, write_count: 1, read_length: 1020001, read_count: 15001, runtime: 135168502 }, ExecutionCost { write_length: 15000000, write_count: 15000, read_length: 100000000, read_count: 15000, runtime: 5000000000 })"),
+ Failure("Invalid Stacks block 92bd5f026210bd6c018ac4761cd4fb3d3968dec0fbda129673338933512b78bc: CostOverflowError(ExecutionCost { write_length: 0, write_count: 0, read_length: 0, read_count: 0, runtime: 0 }, ExecutionCost { write_length: 75013, write_count: 1, read_length: 1020001, read_count: 15001, runtime: 135168502 }, ExecutionCost { write_length: 15000000, write_count: 15000, read_length: 100000000, read_count: 15000, runtime: 5000000000 })"),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_could_not_determine_match_types.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_could_not_determine_match_types.snap
new file mode 100644
index 0000000000..bb623fcbe1
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_could_not_determine_match_types.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "954cdd6cc322070faf8974b0c1a063eb36b4be04990b1361662633c16577896c",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: attempted to match on an (optional) or (response) type where either the some, ok, or err type is indeterminate. you may wish to use unwrap-panic or unwrap-err-panic instead.) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 13,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1379,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 13,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1379,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "c58564eb78da76552663f955a5ae0e3d6eef8fc90edefd3050dd6f9c5fce7d4b",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: attempted to match on an (optional) or (response) type where either the some, ok, or err type is indeterminate. you may wish to use unwrap-panic or unwrap-err-panic instead.) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 13,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1379,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 13,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1379,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "ef503aec95169851bab1414ad0bc5bacc45b9bff743a0eccb85516b54fbc0d7d",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: attempted to match on an (optional) or (response) type where either the some, ok, or err type is indeterminate. you may wish to use unwrap-panic or unwrap-err-panic instead.) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 13,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1379,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 13,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1379,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "c2fd156b3688b0d88cae2aee07b90e4a1adf3c050da9c1cde417b79afb5a65e4",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: attempted to match on an (optional) or (response) type where either the some, ok, or err type is indeterminate. you may wish to use unwrap-panic or unwrap-err-panic instead.) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 13,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1379,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 13,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1379,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_could_not_determine_response_err_type.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_could_not_determine_response_err_type.snap
new file mode 100644
index 0000000000..ba18cbcf3b
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_could_not_determine_response_err_type.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "fa4656f69845f7523a85714024f129a070763ab622082665f3b401353ba75d73",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: attempted to obtain \'err\' value from response, but \'err\' type is indeterminate) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 6,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 966,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 6,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 966,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "01a7a03c3a32f24795df89aaf615e8d7dc13a795fd58e81bed473cccce37e632",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: attempted to obtain \'err\' value from response, but \'err\' type is indeterminate) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 6,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 966,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 6,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 966,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "be87306b92cbd939270a2e06b455766828796c61727a7470c1fb005a21788d9c",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: attempted to obtain \'err\' value from response, but \'err\' type is indeterminate) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 6,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 966,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 6,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 966,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "7a0deeb7679f9e9787ec818cf7fa3b6cf52af1be68b2e14c23b3bc81cbbff3d3",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: attempted to obtain \'err\' value from response, but \'err\' type is indeterminate) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 6,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 966,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 6,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 966,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_could_not_determine_response_ok_type.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_could_not_determine_response_ok_type.snap
new file mode 100644
index 0000000000..de35340c73
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_could_not_determine_response_ok_type.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "7aa5421ea31c076be92d6d2bf4f1608833825ba6a84ddfb43da43b2ecfff9885",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: attempted to obtain \'ok\' value from response, but \'ok\' type is indeterminate) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 931,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 931,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "e0ada23c12afc1c2f25ed211e309246160fa12a4be20e1c42b43aeab2404edd2",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: attempted to obtain \'ok\' value from response, but \'ok\' type is indeterminate) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 931,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 931,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "72275024c896ea725c069a2eebb9e9c03495a17d12aa90eb3e71cca3a92bcf05",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: attempted to obtain \'ok\' value from response, but \'ok\' type is indeterminate) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 931,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 931,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "49f5b774d413397fd71e91e7061a332f8e341a872f394aa2100744d4b9185271",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: could-not-determine-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: attempted to obtain \'ok\' value from response, but \'ok\' type is indeterminate) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 931,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 931,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_expected_name.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_expected_name.snap
new file mode 100644
index 0000000000..32f45db9eb
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_expected_name.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "a896487ef5f6e69107c5ce347e3909e53679508f53ff12dec695ae166b11898c",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-name-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expected a name argument to this function) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1222,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1222,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "272c6f3dbf41a7cac354ccab90e3d6369081cf0183f40881ce442079d2e38dfb",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-name-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expected a name argument to this function) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1222,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1222,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "b60b964620c2a7a8a10fa3578b3082a78489894892d684a20d846f0af04042bc",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-name-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expected a name argument to this function) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1222,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1222,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "3f2933005a9713bacfa2a520f6cdc7d40ad57c154c80aab50246a133e3b3eb61",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-name-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: match on a optional type uses the following syntax: (match input some-name if-some-expression if-none-expression). Caused by: expected a name argument to this function) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1222,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1222,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_expected_optional_type.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_expected_optional_type.snap
new file mode 100644
index 0000000000..cd4f642312
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_expected_optional_type.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "959b74fa7723534df5d5822bfc6a4b65f94aecff60da6ee5fd2fe9e565266fd1",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-optional-type-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: expecting expression of type \'optional\', found \'int\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 824,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 824,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "299ada9b9df8a20acc3895bba99740b4a1f55c40bafff41d3fcc2bc87469ac08",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-optional-type-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: expecting expression of type \'optional\', found \'int\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 824,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 824,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "9f869da9b4cddcb13b9214b727c6715cb9cfa6e101cf36396ee529b8bb3c2c91",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-optional-type-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: expecting expression of type \'optional\', found \'int\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 824,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 824,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "ead4af54d4d2cce3be3334a07592964e4f54064fb530f707e19b68ed5516e51c",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-optional-type-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: expecting expression of type \'optional\', found \'int\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 824,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 824,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_expected_response_type.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_expected_response_type.snap
new file mode 100644
index 0000000000..09c2a127c2
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_expected_response_type.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "0db0c671e9d9e122004faa3ab548812b06af79f047959700cf0b74ca99d36091",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-response-type-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: expecting expression of type \'response\', found \'(optional int)\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1065,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1065,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "e4669542cf9220f48120e779ee482f5e201ce433881aa9fae0ef2e0bd80cf634",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-response-type-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: expecting expression of type \'response\', found \'(optional int)\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1065,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1065,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "b85f082b113f55268008117bdd4a73e80d8d14986aaa23ec18fbece7deec8809",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-response-type-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: expecting expression of type \'response\', found \'(optional int)\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1065,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1065,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "3834dd1bc59f2a8c4e9e8211cad2a4942a8e7c76e015d5384d77c56d2401c697",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: expected-response-type-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: expecting expression of type \'response\', found \'(optional int)\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1065,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1065,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_match_arms_must_match.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_match_arms_must_match.snap
new file mode 100644
index 0000000000..1ff66240c3
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_match_arms_must_match.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "257facc83360e41a51601e92526f69823d48139a90e47d674504120b11803e27",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: match-arms-must-match-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: expression types returned by the arms of \'match\' must match (got \'int\' and \'bool\')) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2512,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2512,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "995314a7f2e558076f23e4210eac2d2fa28bd8e3b52804a99d065ec01d5450d0",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: match-arms-must-match-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: expression types returned by the arms of \'match\' must match (got \'int\' and \'bool\')) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2512,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2512,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "535350244d63fce914e3c314c5833c7a9997bf5a75bd760f08b83ac6752005b1",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: match-arms-must-match-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: expression types returned by the arms of \'match\' must match (got \'int\' and \'bool\')) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2512,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2512,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "3b654e2918d60ce5ab94ec333f589f14cee77a6512610338b59f54b9a0a2b4cc",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: match-arms-must-match-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: expression types returned by the arms of \'match\' must match (got \'int\' and \'bool\')) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2512,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 15,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2512,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_requires_at_least_arguments.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_requires_at_least_arguments.snap
new file mode 100644
index 0000000000..5f054077ff
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_requires_at_least_arguments.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "f240ac1a69d29c82bb9555f0f510f05db577239e2d6310c8a6ec0ceab5915756",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: requires-at-least-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: expecting >= 1 arguments, got 0) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 3,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 441,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 3,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 441,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "3bf4c2df0a6d1fc9757a445f7c175b9a045393a437bd6efa1b271cbd12e998ea",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: requires-at-least-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: expecting >= 1 arguments, got 0) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 3,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 441,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 3,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 441,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "9ff1f34a5f5249dfb1a538c427dcfc55f26021a5fa2bc7eb9fb9bd2c83d49bf8",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: requires-at-least-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: expecting >= 1 arguments, got 0) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 3,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 441,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 3,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 441,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "c3ed84fbc892da10455ba6d46aeaad7406e504bea46d6b7245149789d71bdd8d",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: requires-at-least-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: expecting >= 1 arguments, got 0) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 3,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 441,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 3,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 441,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_requires_at_most_arguments.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_requires_at_most_arguments.snap
new file mode 100644
index 0000000000..1cce802216
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_requires_at_most_arguments.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "5846f21bff86ebad3b7e9d78cb3be7f9575ef65a556c9c741c793ed24d20a901",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: requires-at-most-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: use of unresolved function \'principal-construct?\') [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 0,
+ write_count: 0,
+ read_length: 0,
+ read_count: 0,
+ runtime: 2367,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 0,
+ write_count: 0,
+ read_length: 0,
+ read_count: 0,
+ runtime: 2367,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "1ae7afb71fadd1de202048a2f72deba0d0b81362fccc743328ab016f702109d4",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: requires-at-most-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: expecting < 3 arguments, got 4) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2474,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2474,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "16e2569aeda21ceadf50639f67d20b8c8040dc753f1d973a6570bbf9d8cbbb90",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: requires-at-most-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: expecting < 3 arguments, got 4) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2474,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2474,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "242ea632a189cf3a5b867c633833a71b3709a86650af72c1b321a11d1bf9b166",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: requires-at-most-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: expecting < 3 arguments, got 4) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2474,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 7,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2474,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_value_out_of_bounds.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_value_out_of_bounds.snap
new file mode 100644
index 0000000000..f25149658f
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_value_out_of_bounds.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "56c84c4dd86c9d8cc34a5af9d3f8db1096cbd2dd259a286f9b70b010b5f814e6",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: value-out-of-bounds-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: created a type which value size was out of defined bounds) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 16,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2200,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 16,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2200,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "e8bd04013f76b64e55f5bf9e4ed575688ce2bedde4848c643eb26d282c761933",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: value-out-of-bounds-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: created a type which value size was out of defined bounds) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 16,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2200,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 16,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2200,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "60f2a2b1c8dd2feb074b5a0a6eace53c4f462873e3073390134630227e57bc0f",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: value-out-of-bounds-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: created a type which value size was out of defined bounds) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 16,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2200,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 16,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2200,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "ad4948fe4e6f41e0b5dfc6e494711043ca6fab5dd09e18cfe45a6d99383a1368",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: value-out-of-bounds-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: created a type which value size was out of defined bounds) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 16,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2200,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 16,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 2200,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_value_too_large.snap b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_value_too_large.snap
new file mode 100644
index 0000000000..bfbfbc2daf
--- /dev/null
+++ b/stackslib/src/chainstate/tests/snapshots/blockstack_lib__chainstate__tests__static_analysis_tests__static_check_error_value_too_large.snap
@@ -0,0 +1,126 @@
+---
+source: stackslib/src/chainstate/tests/static_analysis_tests.rs
+expression: result
+---
+[
+ Success(ExpectedBlockOutput(
+ marf_hash: "4296ded2d2f435ea6fa30783861902675fd2415039ec1c5336bfbccd65906aae",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: value-too-large-Epoch3_3-Clarity1, code_body: [..], clarity_version: Some(Clarity1))",
+ vm_error: "Some(:0:0: created a type which was greater than maximum allowed value size) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1024,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1024,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "4c544b76fbe34401be9d93d4a8c604293b2201cdff20d4aad520b3ebd02e1cfa",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: value-too-large-Epoch3_3-Clarity2, code_body: [..], clarity_version: Some(Clarity2))",
+ vm_error: "Some(:0:0: created a type which was greater than maximum allowed value size) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1024,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1024,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "3cee67d778f3fe9025affaec65e39e73dcf546de6f7ffd63be1ed4f48ca45ea7",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: value-too-large-Epoch3_3-Clarity3, code_body: [..], clarity_version: Some(Clarity3))",
+ vm_error: "Some(:0:0: created a type which was greater than maximum allowed value size) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1024,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1024,
+ ),
+ )),
+ Success(ExpectedBlockOutput(
+ marf_hash: "5b1bb138d9ea2154ede1c456395483cc24dc62a5fb649845b9ef19c489625e03",
+ evaluated_epoch: Epoch33,
+ transactions: [
+ ExpectedTransactionOutput(
+ tx: "SmartContract(name: value-too-large-Epoch3_3-Clarity4, code_body: [..], clarity_version: Some(Clarity4))",
+ vm_error: "Some(:0:0: created a type which was greater than maximum allowed value size) [NON-CONSENSUS BREAKING]",
+ return_type: Response(ResponseData(
+ committed: false,
+ data: Optional(OptionalData(
+ data: None,
+ )),
+ )),
+ cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1024,
+ ),
+ ),
+ ],
+ total_block_cost: ExecutionCost(
+ write_length: 5,
+ write_count: 1,
+ read_length: 1,
+ read_count: 1,
+ runtime: 1024,
+ ),
+ )),
+]
diff --git a/stackslib/src/chainstate/tests/static_analysis_tests.rs b/stackslib/src/chainstate/tests/static_analysis_tests.rs
new file mode 100644
index 0000000000..c08b09d37e
--- /dev/null
+++ b/stackslib/src/chainstate/tests/static_analysis_tests.rs
@@ -0,0 +1,206 @@
+// Copyright (C) 2025 Stacks Open Internet Foundation
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see .
+
+//! This module contains consensus tests related to Clarity CheckErrorKind errors that happens during contract analysis.
+
+#[allow(unused_imports)]
+use clarity::vm::analysis::CheckErrorKind;
+
+use crate::chainstate::tests::consensus::contract_deploy_consensus_test;
+use crate::core::BLOCK_LIMIT_MAINNET_21;
+use crate::util_lib::boot::boot_code_test_addr;
+
+/// CheckErrorKind: [`CheckErrorKind::CostBalanceExceeded`]
+/// Caused by: exceeding the static-read analysis budget during contract deployment.
+/// The contract repeatedly performs static-dispatch `contract-call?` lookups against the boot
+/// `.costs-3` contract, forcing the type checker to fetch the remote function signature enough
+/// times to surpass the read-count limit in [`BLOCK_LIMIT_MAINNET_21`].
+/// Outcome: block rejected.
+/// Note: Takes a couple of minutes to run!
+#[ignore]
+#[test]
+fn static_check_error_cost_balance_exceeded() {
+ contract_deploy_consensus_test!(
+ contract_name: "cost-balance-exceeded",
+ contract_code: &{
+ let boot_addr = boot_code_test_addr();
+ let mut contract = String::from("(define-read-only (trigger)\n (begin\n");
+ let call_count = BLOCK_LIMIT_MAINNET_21.read_count as usize + 1;
+ let call_line = format!(
+ "(contract-call? '{boot_addr}.costs-3 cost_analysis_type_check u0)\n",
+ );
+ for _ in 0..call_count {
+ contract.push_str(&call_line);
+ }
+ contract.push_str("true))");
+ contract
+ },
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::ValueTooLarge`]
+/// Caused by: Value exceeds the maximum allowed size for type-checking
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_value_too_large() {
+ contract_deploy_consensus_test!(
+ contract_name: "value-too-large",
+ contract_code: "(as-max-len? 0x01 u1048577)",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::ValueOutOfBounds`]
+/// Caused by: Value is outside the acceptable range for its type
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_value_out_of_bounds() {
+ contract_deploy_consensus_test!(
+ contract_name: "value-out-of-bounds",
+ contract_code: "(define-private (func (x (buff -12))) (len x))
+ (func 0x00)",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::ExpectedName`]
+/// Caused by: Expected a name (e.g., variable) but found an different expression.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_expected_name() {
+ contract_deploy_consensus_test!(
+ contract_name: "expected-name",
+ contract_code: "(match (some 1) 2 (+ 1 1) (+ 3 4))",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::ExpectedResponseType`]
+/// Caused by: Expected a response type but found a different type.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_expected_response_type() {
+ contract_deploy_consensus_test!(
+ contract_name: "expected-response-type",
+ contract_code: "(unwrap-err! (some 2) 2)",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::CouldNotDetermineResponseOkType`]
+/// Caused by: `unwrap!` on literal `(err 3)` leaves the response `ok` type unknown.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_could_not_determine_response_ok_type() {
+ contract_deploy_consensus_test!(
+ contract_name: "could-not-determine",
+ contract_code: "(unwrap! (err 3) 2)",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::CouldNotDetermineResponseErrType`]
+/// Caused by: `unwrap-err-panic` on `(ok 3)` gives no way to infer the response `err` type.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_could_not_determine_response_err_type() {
+ contract_deploy_consensus_test!(
+ contract_name: "could-not-determine",
+ contract_code: "(unwrap-err-panic (ok 3))",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::CouldNotDetermineMatchTypes`]
+/// Caused by: matching a bare `none` provides no option type, leaving branch types ambiguous.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_could_not_determine_match_types() {
+ contract_deploy_consensus_test!(
+ contract_name: "could-not-determine",
+ contract_code: "(match none inner-value (/ 1 0) (+ 1 8))",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::MatchArmsMustMatch`]
+/// Caused by: the `some` arm yields an int while the `none` arm yields a bool.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_match_arms_must_match() {
+ contract_deploy_consensus_test!(
+ contract_name: "match-arms-must-match",
+ contract_code: "(match (some 1) inner-value (+ 1 inner-value) (> 1 28))",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::BadMatchOptionSyntax`]
+/// Caused by: option `match` expecting 4 arguments, got 3
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_bad_match_option_syntax() {
+ contract_deploy_consensus_test!(
+ contract_name: "bad-match-option",
+ contract_code: "(match (some 1) inner-value (+ 1 inner-value))",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::BadMatchResponseSyntax`]
+/// Caused by: response `match` expecting 5 arguments, got 3.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_bad_match_response_syntax() {
+ contract_deploy_consensus_test!(
+ contract_name: "bad-match-response",
+ contract_code: "(match (ok 1) inner-value (+ 1 inner-value))",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::RequiresAtLeastArguments`]
+/// Caused by: invoking `match` with no arguments.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_requires_at_least_arguments() {
+ contract_deploy_consensus_test!(
+ contract_name: "requires-at-least",
+ contract_code: "(match)",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::RequiresAtMostArguments`]
+/// Caused by: `principal-construct?` is called with too many arguments.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_requires_at_most_arguments() {
+ contract_deploy_consensus_test!(
+ contract_name: "requires-at-most",
+ contract_code: r#"(principal-construct? 0x22 0xfa6bf38ed557fe417333710d6033e9419391a320 "foo" "bar")"#,
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::BadMatchInput`]
+/// Caused by: `match` input is the integer `1`, not an option or response.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_bad_match_input() {
+ contract_deploy_consensus_test!(
+ contract_name: "bad-match-input",
+ contract_code: "(match 1 ok-val (/ ok-val 0) err-val (+ err-val 7))",
+ );
+}
+
+/// CheckErrorKind: [`CheckErrorKind::ExpectedOptionalType`]
+/// Caused by: `default-to` second argument `5` is not an optional value.
+/// Outcome: block accepted.
+#[test]
+fn static_check_error_expected_optional_type() {
+ contract_deploy_consensus_test!(
+ contract_name: "expected-optional-type",
+ contract_code: "(default-to 3 5)",
+ );
+}