Apply suggestions from code review

Co-authored-by: Linda Guiga <101227802+LindaGuiga@users.noreply.github.com>
This commit is contained in:
Alonso González 2024-01-11 10:55:04 +01:00 committed by GitHub
parent 99a1eb5c85
commit 6ef0a3c738
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -154,7 +154,7 @@ global write_table_if_jumpdest:
// - (0xFF|X)³² for the first 15 bytes
// - (has_prefix => is_0_at_4 |X)³² for the next 15 bytes
// - (~has_prefix|X)³² for the last byte
// Compute also ~has_prefix = ~has_prefix OR is_0_at_4 for all bytes. We don't need to update ~hash_prefix
// Compute also ~has_prefix = ~has_prefix OR is_0_at_4 for all bytes. We don't need to update ~has_prefix
// for the second half but it takes less cycles if we do it.
DUP2 %shl_const(3)
NOT
@ -283,7 +283,7 @@ return:
// addresses used during program execution within the current context.
// For each jumpdest address we also non-deterministically guess
// a proof, which is another address in the code such that
// is_jumpdest don't abort, when the proof is at the top of the stack
// is_jumpdest doesn't abort, when the proof is at the top of the stack
// an the jumpdest address below. If that's the case we set the
// corresponding bit in @SEGMENT_JUMPDEST_BITS to 1.
//
@ -297,7 +297,7 @@ global jumpdest_analysis:
// If proof == 0 there are no more jump destinations to check
POP
// This is just a hook used for avoiding verification of the jumpdest
// table in another contexts. It is useful during proof generation,
// table in another context. It is useful during proof generation,
// allowing the avoidance of table verification when simulating user code.
global jumpdest_analysis_end:
%pop2

View File

@ -240,7 +240,7 @@ impl<F: Field> GenerationState<F> {
}
}
/// Generate the either the next used jump address or the the proof for the last jump address.
/// Generate either the next used jump address or the proof for the last jump address.
fn run_jumpdest_table(&mut self, input_fn: &ProverInputFn) -> Result<U256, ProgramError> {
match input_fn.0[1].as_str() {
"next_address" => self.run_next_jumpdest_table_address(),
@ -385,7 +385,7 @@ impl<F: Field> GenerationState<F> {
/// 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
/// and pushed bytes) are PUSHXX and the address is in its range. It returns
/// a vector of even size containing proofs followed by their addresses.
fn get_proofs_and_jumpdests(
code: &[u8],