From 72617938ce43ec882403c10f2c4b964b9b51e4f4 Mon Sep 17 00:00:00 2001 From: Jon-Becker Date: Tue, 26 Dec 2023 18:20:51 -0600 Subject: [PATCH] fix(sym-exec): increase similarity threshhold for jump detection --- common/src/ether/evm/ext/exec/util.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/src/ether/evm/ext/exec/util.rs b/common/src/ether/evm/ext/exec/util.rs index 8db1ecbc..2e5c9047 100644 --- a/common/src/ether/evm/ext/exec/util.rs +++ b/common/src/ether/evm/ext/exec/util.rs @@ -144,8 +144,11 @@ pub fn jump_condition_historical_diffs_approximately_equal( ); } - // check if all stack diffs are exactly length 1 - if !stack_diffs.iter().all(|diff| diff.len() == 1) { + // get stack length / 10, rounded up as threshold + let threshold = (stack.size() as f64 / 10f64).ceil() as usize; + + // check if all stack diffs are similar + if !stack_diffs.iter().all(|diff| diff.len() <= threshold) { return false; }