Skip to content

Commit

Permalink
make kernel addresses much more likely
Browse files Browse the repository at this point in the history
  • Loading branch information
joonazan committed Jun 12, 2024
1 parent e5bd627 commit 4a28421
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/single_instruction_test/callframe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ impl<'a> Arbitrary<'a> for Flags {

impl<'a> Arbitrary<'a> for Callframe {
fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result<Self> {
let address = u.arbitrary()?;
let mut address: H160 = u.arbitrary()?;

// Make kernel addresses much more likely
if address.to_low_u64_be() % 1117 < 200 {
for i in 0..18 {
address.0[i] = 0;
}
}

// zk_evm requires a base page, which heap and aux heap are offset from
let base_page = u.int_in_range(1..=u32::MAX - 10)?;
Expand Down

0 comments on commit 4a28421

Please sign in to comment.