Skip to content

Commit 2d2f688

Browse files
committed
Add ExpressionStackDepthTooDeep and VaryExpressionStackDepthTooDeep to rejectable()
Signed-off-by: Jacinta Ferrant <[email protected]>
1 parent fe6de8b commit 2d2f688

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

clarity-types/src/errors/ast.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ impl ParseError {
114114
}
115115

116116
pub fn rejectable(&self) -> bool {
117-
matches!(*self.err, ParseErrors::InterpreterFailure)
117+
matches!(
118+
*self.err,
119+
ParseErrors::InterpreterFailure
120+
| ParseErrors::ExpressionStackDepthTooDeep
121+
| ParseErrors::VaryExpressionStackDepthTooDeep
122+
)
118123
}
119124

120125
pub fn has_pre_expression(&self) -> bool {

stackslib/src/chainstate/stacks/db/transactions.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,19 +1288,6 @@ impl StacksChainState {
12881288
));
12891289
}
12901290
other_error => {
1291-
// a [Vary]ExpressionDepthTooDeep error in this situation
1292-
// invalidates the block, since this should have prevented the
1293-
// block from getting relayed in the first place
1294-
if let clarity_error::Parse(ref parse_error) = &other_error {
1295-
match *parse_error.err {
1296-
ParseErrors::ExpressionStackDepthTooDeep
1297-
| ParseErrors::VaryExpressionStackDepthTooDeep => {
1298-
info!("Transaction {} is problematic and should have prevented this block from being relayed", tx.txid());
1299-
return Err(Error::ClarityError(other_error));
1300-
}
1301-
_ => {}
1302-
}
1303-
}
13041291
if let clarity_error::Parse(err) = &other_error {
13051292
if err.rejectable() {
13061293
info!("Transaction {} is problematic and should have prevented this block from being relayed", tx.txid());

0 commit comments

Comments
 (0)