Skip to content

Commit

Permalink
fix(sym-exec): increase similarity threshhold for jump detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Becker committed Dec 27, 2023
1 parent 7b70f72 commit 7261793
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions common/src/ether/evm/ext/exec/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7261793

Please sign in to comment.