Skip to content
This repository has been archived by the owner on May 3, 2024. It is now read-only.

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-six committed Mar 1, 2024
1 parent 7f750aa commit 3251cb9
Show file tree
Hide file tree
Showing 29 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions bus-mapping/src/circuit_input_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ pub use transaction::{Transaction, TransactionContext};
#[derive(Debug, Clone, Copy)]
pub struct CircuitsParams {
/// Maximum number of rw operations in the state circuit (RwTable length /
/// nummber of rows). This must be at least the number of rw operations
/// number of rows). This must be at least the number of rw operations
/// + 1, in order to allocate at least a Start row.
pub max_rws: usize,
// TODO: evm_rows: Maximum number of rows in the EVM Circuit
/// Maximum number of txs in the Tx Circuit
pub max_txs: usize,
/// Maximum number of bytes from all txs calldata in the Tx Circuit
pub max_calldata: usize,
/// Max ammount of rows that the CopyCircuit can have.
/// Max amount of rows that the CopyCircuit can have.
pub max_copy_rows: usize,
/// Max number of steps that the ExpCircuit can have. Each step is further
/// expressed in 7 rows
Expand Down
4 changes: 2 additions & 2 deletions bus-mapping/src/circuit_input_builder/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub struct Block {
/// chain id
pub chain_id: Word,
/// history hashes contains most recent 256 block hashes in history, where
/// the lastest one is at history_hashes[history_hashes.len() - 1].
/// the latest one is at history_hashes[history_hashes.len() - 1].
pub history_hashes: Vec<Word>,
/// coinbase
pub coinbase: Address,
Expand Down Expand Up @@ -86,7 +86,7 @@ pub struct Block {
pub sha3_inputs: Vec<Vec<u8>>,
/// Exponentiation events in the block.
pub exp_events: Vec<ExpEvent>,
/// Circuits Setup Paramteres
/// Circuits Setup Parameters
pub circuits_params: CircuitsParams,
/// Original block from geth
pub eth_block: eth_types::Block<eth_types::Transaction>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl Opcode for ErrorReturnDataOutOfBound {

let remainder_end = data_offset.overflowing_add(length).0;
// check data_offset or end is u64 overflow, or
// last_callee_return_data_length < reaminder_end
// last_callee_return_data_length < reminder_end
let data_offset_overflow = data_offset > Word::from(u64::MAX);
let remainder_end_overflow = remainder_end > Word::from(u64::MAX);
let remainder_end_exceed_length =
Expand Down
2 changes: 1 addition & 1 deletion bus-mapping/src/evm/opcodes/error_write_protection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ impl Opcode for ErrorWriteProtection {
.contains(&geth_step.op));

if geth_step.op == OpcodeId::CALL {
// get only the frist three stack elements since the third one is the value we
// get only the first three stack elements since the third one is the value we
// want to check.
for i in 0..3 {
state.stack_read(
Expand Down
2 changes: 1 addition & 1 deletion bus-mapping/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct BlockData {
/// chain id
pub chain_id: Word,
/// history hashes contains most recent 256 block hashes in history, where
/// the lastest one is at history_hashes[history_hashes.len() - 1].
/// the latest one is at history_hashes[history_hashes.len() - 1].
pub history_hashes: Vec<Word>,
/// Block from geth
pub eth_block: eth_types::Block<eth_types::Transaction>,
Expand Down
2 changes: 1 addition & 1 deletion external-tracer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct TraceConfig {
/// chain id
pub chain_id: Word,
/// history hashes contains most recent 256 block hashes in history, where
/// the lastest one is at history_hashes[history_hashes.len() - 1].
/// the latest one is at history_hashes[history_hashes.len() - 1].
pub history_hashes: Vec<Word>,
/// block constants
pub block_constants: BlockConstants,
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/src/integration_test_circuits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl<C: SubCircuit<Fr> + Circuit<Fr>> IntegrationTest<C> {

let transcript = Blake2bWrite::<_, G1Affine, Challenge255<_>>::init(vec![]);

// change instace to slice
// change instance to slice
let instance: Vec<&[Fr]> = instance.iter().map(|v| v.as_slice()).collect();

let proof = test_gen_proof(
Expand Down
2 changes: 1 addition & 1 deletion testool/src/abi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn encode_funccall(spec: &str) -> Result<Bytes> {
let func_name = func_name_params[0];
let func_params = &func_name_params[1..func_name_params.len() - 1];

// transform func_params and args into the appropiate types
// transform func_params and args into the appropriate types

let map_type = |t| match t {
"uint" => ParamType::Uint(256),
Expand Down
2 changes: 1 addition & 1 deletion testool/src/statetest/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl<'a> JsonStateTestBuilder<'a> {
Self { compiler }
}

/// generates `StateTest` vectors from a ethereum josn test specification
/// generates `StateTest` vectors from a ethereum json test specification
pub fn load_json(&mut self, path: &str, source: &str) -> Result<Vec<StateTest>> {
let mut state_tests = Vec::new();
let tests: HashMap<String, JsonStateTest> = serde_json::from_str(source)?;
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/calldatacopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ impl<F: Field> ExecutionGadget<F> for CallDataCopyGadget<F> {
CopyDataType::Memory.expr(),
);
cb.condition(memory_address.has_length(), |cb| {
// Set source start to the minimun value of data offset and call data length.
// Set source start to the minimum value of data offset and call data length.
let src_addr = call_data_offset.expr()
+ select::expr(
data_offset.lt_cap(),
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/calldataload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl<F: Field> ExecutionGadget<F> for CallDataLoadGadget<F> {
},
);

// Set source start to the minimun value of data offset and call data length.
// Set source start to the minimum value of data offset and call data length.
let src_addr = call_data_offset.expr()
+ select::expr(
data_offset.lt_cap(),
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/codecopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<F: Field> ExecutionGadget<F> for CodeCopyGadget<F> {
cb.stack_pop(code_offset.original_word());
cb.stack_pop(size.expr());

// Construct memory address in the destionation (memory) to which we copy code.
// Construct memory address in the destination (memory) to which we copy code.
let dst_memory_addr = MemoryAddressGadget::construct(cb, dst_memory_offset, size);

// Fetch the hash of bytecode running in current environment.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorWriteProtectionGadget<F> {
let value = cb.query_word_rlc();
let is_value_zero = IsZeroGadget::construct(cb, value.expr());

// require_in_set method will spilit into more low degree expressions if exceed
// require_in_set method will split into more low degree expressions if exceed
// max_degree. otherwise need to do fixed lookup for these opcodes
// checking.
cb.require_in_set(
Expand Down Expand Up @@ -72,7 +72,7 @@ impl<F: Field> ExecutionGadget<F> for ErrorWriteProtectionGadget<F> {
// current call context is readonly
cb.call_context_lookup(false.expr(), None, CallContextFieldTag::IsStatic, 1.expr());

// constrain not root call as at least one previous staticcall preset.
// constrain not root call as at least one previous statical preset.
cb.require_zero(
"ErrorWriteProtection only happen in internal call",
cb.curr.state.is_root.expr(),
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/extcodecopy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl<F: Field> ExecutionGadget<F> for ExtcodecopyGadget<F> {

let copy_rwc_inc = cb.query_cell();
cb.condition(memory_address.has_length(), |cb| {
// Set source start to the minimun value of code offset and code size.
// Set source start to the minimum value of code offset and code size.
let src_addr = select::expr(
code_offset.lt_cap(),
code_offset.valid_value(),
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl<F: Field> ExecutionGadget<F> for OriginGadget<F> {
) -> Result<(), Error> {
let origin = block.get_rws(step, 1).stack_value();

// Assing TxId.
// Assign TxId.
self.tx_id
.assign(region, offset, Value::known(F::from(tx.id as u64)))?;

Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/execution/sar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl<F: Field> ExecutionGadget<F> for SarGadget<F> {
lt
});

// Merge contraints
// Merge constraints
let shf_lo_div64_eq0 = IsZeroGadget::construct(cb, shf_div64.expr());
let shf_lo_div64_eq1 = IsEqualGadget::construct(cb, shf_div64.expr(), 1.expr());
let shf_lo_div64_eq2 = IsEqualGadget::construct(cb, shf_div64.expr(), 2.expr());
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ impl<F: Field> RwValues<F> {

#[derive(Clone, Debug)]
pub(crate) enum Lookup<F> {
/// Lookup to fixed table, which contains serveral pre-built tables such as
/// Lookup to fixed table, which contains several pre-built tables such as
/// range tables or bitwise tables.
Fixed {
/// Tag to specify which table to lookup.
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ impl<'r, 'b, F: Field> CachedRegion<'r, 'b, F> {
// Actually set the value
let res = self.region.assign_advice(annotation, column, offset, &to);
// Cache the value
// Note that the `value_field` in `AssignedCell` might be `Value::unkonwn` if
// Note that the `value_field` in `AssignedCell` might be `Value::unknown` if
// the column has different phase than current one, so we call to `to`
// again here to cache the value.
if res.is_ok() {
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/evm_circuit/util/instrumentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl From<&ExecutionState> for ExecStateReport {
}
}

/// Struct that contains all of the measurament values required to evaluate the
/// Struct that contains all of the measurement values required to evaluate the
/// costs of a particular `ColumnType` of an `ExecStateReport`
#[derive(Debug, Clone, Default)]
pub struct StateReportRow {
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/keccak_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ impl<F: Field> SubCircuitConfig<F> for KeccakCircuitConfig<F> {
// that allows reusing the same parts in an optimal way for the chi step.
// We can save quite a few columns by not recombining the parts after rho/pi and
// re-splitting the words again before chi. Instead we do chi directly
// on the output parts of rho/pi. For rho/pi specically we do
// on the output parts of rho/pi. For rho/pi specially we do
// `s[j][2 * i + 3 * j) % 5] = normalize(rot(s[i][j], RHOM[i][j]))`.
cell_manager.start_region();
let mut lookup_counter = 0;
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/keccak_circuit/keccak_packed_multi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ pub(crate) mod transform {
}
}

// Transfroms values to cells
// Transforms values to cells
pub(crate) mod transform_to {
use super::{Cell, KeccakRegion, Part, PartValue};
use crate::{
Expand Down
6 changes: 3 additions & 3 deletions zkevm-circuits/src/pi_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub struct ExtraValues {
prev_state_root: H256,
}

/// PublicData contains all the values that the PiCircuit recieves as input
/// PublicData contains all the values that the PiCircuit receives as input
#[derive(Debug, Clone)]
pub struct PublicData {
/// chain id
Expand Down Expand Up @@ -1110,7 +1110,7 @@ impl<F: Field> PiCircuitConfig<F> {
pub struct PiCircuit<F: Field> {
max_txs: usize,
max_calldata: usize,
/// Randomness for RLC encdoing
/// Randomness for RLC encoding
pub randomness: F,
/// Randomness for PI encoding
pub rand_rpi: F,
Expand Down Expand Up @@ -1209,7 +1209,7 @@ impl<F: Field> SubCircuit<F> for PiCircuit<F> {
BLOCK_LEN + 1 + EXTRA_LEN + 3 * (TX_LEN * self.max_txs + 1) + self.max_calldata
);

// Computation of raw_pulic_inputs
// Computation of raw_public_inputs
let rlc_rpi = rlc_rpi_col
.iter()
.rev()
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/super_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ impl<F: Field> SubCircuitConfig<F> for SuperCircuitConfig<F> {
let exp_table = ExpTable::construct(meta);
let keccak_table = KeccakTable::construct(meta);

// Use a mock randomness instead of the randomness derived from the challange
// Use a mock randomness instead of the randomness derived from the challenge
// (either from mock or real prover) to help debugging assignments.
let power_of_randomness: [Expression<F>; 31] =
array::from_fn(|i| Expression::Constant(mock_randomness.pow([1 + i as u64, 0, 0, 0])));
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/table/bytecode_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl BytecodeTable {
}
}

/// Assign the `BytecodeTable` from a list of bytecodes, followig the same
/// Assign the `BytecodeTable` from a list of bytecodes, following the same
/// table layout that the Bytecode Circuit uses.
pub fn load<'a, F: Field>(
&self,
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/table/keccak_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ impl KeccakTable {
}

/// returns matchings between the circuit columns passed as parameters and
/// the table collumns
/// the table columns
pub fn match_columns(
&self,
value_rlc: Column<Advice>,
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/table/pi_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl PiTable {
}
}

/// Assign the `TxTable` from a list of block `Transaction`s, followig the
/// Assign the `TxTable` from a list of block `Transaction`s, following the
/// same layout that the Tx Circuit uses.
pub fn load<F: Field>(
&self,
Expand Down
4 changes: 2 additions & 2 deletions zkevm-circuits/src/table/tx_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ impl TxTable {
}
}

/// Assign the `TxTable` from a list of block `Transaction`s, followig the
/// Assign the `TxTable` from a list of block `Transaction`s, following the
/// same layout that the Tx Circuit uses.
pub fn load<F: Field>(
&self,
Expand All @@ -109,7 +109,7 @@ impl TxTable {
)
}

/// Assign the `TxTable` from a list of block `Transaction`s, followig the
/// Assign the `TxTable` from a list of block `Transaction`s, following the
/// same layout that the Tx Circuit uses.
/// NOTE: This function is used by passing the region directly
pub fn load_with_region<F: Field>(
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/test_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const NUM_BLINDING_ROWS: usize = 64;
/// builder pattern provides functions that allow to pass different functions
/// that the prover should execute when verifying the CTB correctness.
///
/// The CTB also includes a mechanism to recieve calls that will modify the
/// The CTB also includes a mechanism to receive calls that will modify the
/// block produced from the [`TestContext`] and apply them before starting to
/// compute the proof.
///
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/witness/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub struct BlockContext {
pub number: Word,
/// The timestamp of the block
pub timestamp: Word,
/// The difficulty of the blcok
/// The difficulty of the block
pub difficulty: Word,
/// The base fee, the minimum amount of gas fee for a transaction
pub base_fee: Word,
Expand Down

0 comments on commit 3251cb9

Please sign in to comment.