Skip to content

Commit

Permalink
chore: Warnings & obsolete code removal (#122)
Browse files Browse the repository at this point in the history
* Cleaned up warnings
* Removed obsolete code (binaries and files that are no longer used)
* Fixed 2 cases, where we should be using u8_iter()
  • Loading branch information
mm-zk authored Feb 12, 2025
1 parent e23d4a8 commit cac1ef5
Show file tree
Hide file tree
Showing 18 changed files with 15 additions and 704 deletions.
6 changes: 3 additions & 3 deletions crates/zkEVM-assembly/src/assembly/parse/addressing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ fn parse_brackets_content<'a>(input: &'a str) -> IResult<&'a str, &'a str> {

pub(crate) fn parse_absolute_addressing_single<'a>(
input: &'a str,
) -> IResult<&str, (RegisterOperand, u64)> {
) -> IResult<&'a str, (RegisterOperand, u64)> {
// we want either rX +/- imm

// so we want may be space | may be rX | may be space | may be + or - | may be space | may be immediate
Expand Down Expand Up @@ -541,12 +541,12 @@ pub(crate) fn parse_arith_separated<'a>(
Ok(("", results))
}

fn parse_immediate<'a>(input: &'a str) -> IResult<&str, u64> {
fn parse_immediate<'a>(input: &'a str) -> IResult<&'a str, u64> {
let (rest, _) = nom::bytes::complete::tag::<_, _, nom::error::Error<_>>("#")(input)?;
parse_immediate_value(rest)
}

fn parse_immediate_value<'a>(input: &'a str) -> IResult<&str, u64> {
fn parse_immediate_value<'a>(input: &'a str) -> IResult<&'a str, u64> {
let rest = input;
let mut hex_parser = nom::sequence::tuple::<_, _, nom::error::Error<_>, _>((
all_from_tag_until_1_noconsume(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::assembly::mnemonic::all_until1_include_terminator;

use crate::assembly::operand::ConstantOperand;

pub(crate) fn parse_constant_operand<'a>(input: &'a str) -> IResult<&str, FullOperand> {
pub(crate) fn parse_constant_operand<'a>(input: &'a str) -> IResult<&'a str, FullOperand> {
// we try to parse something like @label[reg + imm],
// so we first do try to take @|label|[.... and we do not consume []

Expand Down
6 changes: 3 additions & 3 deletions crates/zkEVM-assembly/src/assembly/parse/data_element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ fn parse_label_name(input: &str) -> IResult<&str, Vec<DataElement>> {
Ok(("", vec![DataElement::LabelName(label_name.to_string())]))
}

fn parse_zeroes<'a>(input: &'a str) -> IResult<&str, usize> {
fn parse_zeroes<'a>(input: &'a str) -> IResult<&'a str, usize> {
// we want to parse something `.cell signed_integer`
// and transform it into the unsigned 32 byte

Expand Down Expand Up @@ -113,7 +113,7 @@ fn serialize_biguint(input: BigUint) -> Option<[u8; 32]> {
Some(result)
}

fn parse_cell<'a>(input: &'a str) -> IResult<&str, BigUint> {
fn parse_cell<'a>(input: &'a str) -> IResult<&'a str, BigUint> {
// we want to parse something `.cell signed_integer`
// and transform it into the unsigned 32 byte

Expand Down Expand Up @@ -161,7 +161,7 @@ fn parse_cell<'a>(input: &'a str) -> IResult<&str, BigUint> {
Ok(("", unsigned))
}

fn parse_name<'a>(input: &'a str) -> IResult<&str, &str> {
fn parse_name<'a>(input: &'a str) -> IResult<&'a str, &'a str> {
let mut parser = nom::sequence::tuple::<_, _, nom::error::Error<_>, _>((
nom::character::complete::space0,
nom::bytes::complete::tag(".cell"),
Expand Down
2 changes: 1 addition & 1 deletion crates/zk_evm/src/opcodes/execution/far_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ impl<const N: usize, E: VmEncodingMode<N>> DecodedOpcode<N, E> {
#[allow(dropping_references)]
drop(current_stack_mut);

let (mut callee_stipend, mut extra_ergs_from_caller_to_callee) =
let (callee_stipend, mut extra_ergs_from_caller_to_callee) =
get_stipend_and_extra_cost(&called_address, far_call_abi.to_system);

let remaining_ergs_of_caller_frame =
Expand Down
16 changes: 0 additions & 16 deletions crates/zk_evm/src/reference_impls/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,22 +505,6 @@ mod tests {
.value
}

fn read_code_query(&mut self, location: MemoryLocation) -> U256 {
assert!(location.memory_type == MemoryType::Code);
self.memory
.specialized_code_query(
0,
MemoryQuery {
timestamp: Timestamp(0),
location,
value: U256::zero(),
rw_flag: false,
value_is_pointer: false,
},
)
.value
}

fn get_heap_location(&self, index: u32) -> MemoryLocation {
MemoryLocation {
index: MemoryIndex(index),
Expand Down
8 changes: 0 additions & 8 deletions crates/zkevm_test_harness/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ keywords.workspace = true
categories.workspace = true
description = "ZKsync Era proving utilities"

# [[bin]]
# name = "circuit_limit_estimator"
# path = "src/circuit_limit_estimator/main.rs"

# [[bin]]
# name = "circuit_synthesis_performance_test"
# path = "src/circuit_synthesis_performance_test/main.rs"

[[bin]]
name = "geometry_config_generator"
path = "src/geometry_config_generator/main.rs"
Expand Down
31 changes: 0 additions & 31 deletions crates/zkevm_test_harness/src/circuit_limit_estimator/main.rs

This file was deleted.

200 changes: 0 additions & 200 deletions crates/zkevm_test_harness/src/circuit_limit_estimator/mod.rs

This file was deleted.

This file was deleted.

Loading

0 comments on commit cac1ef5

Please sign in to comment.