mirror of
https://github.com/logos-storage/plonky2.git
synced 2026-01-03 06:13:07 +00:00
Missing review comments
This commit is contained in:
parent
ae4a720a74
commit
99a1eb5c85
@ -312,7 +312,6 @@ impl<F: Field> GenerationState<F> {
|
||||
self.jumpdest_proofs = Some(HashMap::new());
|
||||
return Ok(());
|
||||
};
|
||||
log::debug!("jumpdest_table = {:?}", jumpdest_table);
|
||||
|
||||
// Return to the state before starting the simulation
|
||||
self.rollback(checkpoint);
|
||||
@ -383,7 +382,7 @@ impl<F: Field> GenerationState<F> {
|
||||
}
|
||||
}
|
||||
|
||||
/// For all address in `jumpdest_table`, each bounded by larges_address,
|
||||
/// For all address in `jumpdest_table`, each bounded by `largest_address`,
|
||||
/// this function searches for a proof. A proof is the closest address
|
||||
/// for which none of the previous 32 bytes in the code (including opcodes
|
||||
/// and pushed bytes are PUSHXX and the address is in its range. It returns
|
||||
@ -403,11 +402,12 @@ fn get_proofs_and_jumpdests(
|
||||
.iter()
|
||||
.enumerate()
|
||||
.fold(true, |acc, (prefix_pos, &byte)| {
|
||||
acc && (byte > PUSH32_OPCODE
|
||||
|| (prefix_start + prefix_pos) as i32
|
||||
+ (byte as i32 - PUSH1_OPCODE as i32)
|
||||
+ 1
|
||||
< pos as i32)
|
||||
let cond1 = byte > PUSH32_OPCODE;
|
||||
let cond2 = (prefix_start + prefix_pos) as i32
|
||||
+ (byte as i32 - PUSH1_OPCODE as i32)
|
||||
+ 1
|
||||
< pos as i32;
|
||||
acc && (cond1 || cond2)
|
||||
})
|
||||
} else {
|
||||
false
|
||||
@ -425,6 +425,8 @@ fn get_proofs_and_jumpdests(
|
||||
proofs
|
||||
}
|
||||
|
||||
/// An iterator over the EVM code contained in `code`, which skips the bytes
|
||||
/// that are the arguments of a PUSHXX opcode.
|
||||
struct CodeIterator<'a> {
|
||||
code: &'a [u8],
|
||||
pos: usize,
|
||||
|
||||
@ -51,6 +51,10 @@ pub(crate) struct GenerationState<F: Field> {
|
||||
/// Pointers, within the `TrieData` segment, of the three MPTs.
|
||||
pub(crate) trie_root_ptrs: TrieRootPtrs,
|
||||
|
||||
/// A hash map where the key is a context in the user's code and the value is the set of
|
||||
/// jump destinations with its corresponding "proof". A "proof" for a jump destination is
|
||||
/// either 0 or an address i > 32 in the code (not necessarily pointing to an opcode) such that
|
||||
/// for every j in [i, i+32] it holds that code[j] < 0x7f - j + i.
|
||||
pub(crate) jumpdest_proofs: Option<HashMap<usize, Vec<usize>>>,
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user