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

Fix typos #1780

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bin/mpt-test/src/circuit/state_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ pub struct StateUpdateCircuitConfig<F: Field> {
/// The MPT table, where the state updates are stored
pub pi_mpt: MptTable,

/// Intance column, used to check public inputs
/// Instance column, used to check public inputs
pub instance: Column<Instance>,

/// ONE if the first row, ZERO otherwise
pub is_first: Column<Fixed>,

/// ONE if row is paddding, ZERO otherwise
/// ONE if row is padding, ZERO otherwise
pub is_padding: IsZeroConfig<F>,

/// ONE is the last used row, ZERO otherwise
Expand Down Expand Up @@ -465,7 +465,7 @@ impl<F: Field> Circuit<F> for StateUpdateCircuit<F> {
).unwrap()
);

// at beggining, set the old root and number of proofs
// at beginning, set the old root and number of proofs

if offset == 0 {
pi.push(Some(old_root_lo));
Expand Down
2 changes: 1 addition & 1 deletion bus-mapping/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ On that way, we would get something like this for the Memory ops:
| `key` | `val` | `rw` | `gc` | Note |
|:------:| ------------- | ------- | ---- | ---------------------------------------- |
| `0x40` | `0` | `Write` | | Init |
| `0x40` | `0x80` | `Write` | 0 | Assume written at the begining of `code` |
| `0x40` | `0x80` | `Write` | 0 | Assume written at the beginning of `code`|
| `0x40` | `0x80` | `Read` | 4 | `56 MLOAD` |
| - | | | | |
| `0x80` | `0` | `Write` | | Init |
Expand Down
6 changes: 3 additions & 3 deletions bus-mapping/src/circuit_input_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ impl FeatureConfig {
#[derive(Debug, Clone, Copy)]
pub struct FixedCParams {
/// 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
Expand Down Expand Up @@ -190,7 +190,7 @@ pub struct CircuitInputBuilder<C: CircuitsParams> {
pub code_db: CodeDB,
/// Block
pub block: Block,
/// Circuits Setup Paramteres
/// Circuits Setup Parameters
pub circuits_params: C,
/// Block Context
pub block_ctx: BlockContext,
Expand Down Expand Up @@ -544,7 +544,7 @@ pub fn keccak_inputs(block: &Block, code_db: &CodeDB) -> Result<Vec<Vec<u8>>, Er
}

/// Generate the keccak inputs required by the SignVerify Chip from the
/// signature datas.
/// signature data.
pub fn keccak_inputs_sign_verify(sigs: &[SignData]) -> Vec<Vec<u8>> {
let mut inputs = Vec::new();
for sig in sigs {
Expand Down
2 changes: 1 addition & 1 deletion bus-mapping/src/circuit_input_builder/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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
2 changes: 1 addition & 1 deletion bus-mapping/src/circuit_input_builder/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct Call {
pub kind: CallKind,
/// This call is being executed without write access (STATIC)
pub is_static: bool,
/// This call generated implicity by a Transaction.
/// This call generated implicitly by a Transaction.
pub is_root: bool,
/// This call is persistent or call stack reverts at some point
pub is_persistent: bool,
Expand Down
2 changes: 1 addition & 1 deletion bus-mapping/src/circuit_input_builder/execution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl From<(Word, Word, Word)> for ExpStep {
}
}

/// Event representating an exponentiation `a ^ b == d (mod 2^256)`.
/// Event representing an exponentiation `a ^ b == d (mod 2^256)`.
#[derive(Clone, Debug)]
pub struct ExpEvent {
/// Identifier for the exponentiation trace.
Expand Down
2 changes: 1 addition & 1 deletion bus-mapping/src/circuit_input_builder/tracer_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ fn check_err_depth(step: &GethExecStep, next_step: Option<&GethExecStep>) -> boo

#[test]
fn tracer_err_depth() {
// Recursive CALL will exaust the call depth
// Recursive CALL will exhaust the call depth
let code = bytecode! {
PUSH1(0x0) // retLength
PUSH1(0x0) // retOffset
Expand Down
2 changes: 1 addition & 1 deletion bus-mapping/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub enum OogError {
SelfDestruct,
}

// Given OpCodeId, returns correponding OogError.
// Given OpCodeId, returns corresponding OogError.
impl From<&OpcodeId> for OogError {
fn from(op: &OpcodeId) -> Self {
match op {
Expand Down
2 changes: 1 addition & 1 deletion bus-mapping/src/evm/opcodes/callop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ impl<const N_ARGS: usize> Opcode for CallOpcode<N_ARGS> {
// read balance of caller to compare to value for insufficient_balance checking
// in circuit, also use for callcode successful case check balance is
// indeed larger than transfer value. for call opcode, it does in
// tranfer gadget implicitly.
// transfer gadget implicitly.
state.account_read(
&mut exec_step,
call.caller_address,
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
4 changes: 2 additions & 2 deletions bus-mapping/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
//! | `key` | `val` | `rw` | `gc` | Note |
//! |:------:| ------------- | ------- | ---- | ---------------------------------------- |
//! | `0x40` | `0` | `Write` | | Init |
//! | `0x40` | `0x80` | `Write` | 0 | Assume written at the begining of `code` |
//! | `0x40` | `0x80` | `Write` | 0 | Assume written at the beginning of `code`|
//! | `0x40` | `0x80` | `Read` | 4 | `56 MLOAD` |
//! | - | | | | |
//! | `0x80` | `0` | `Write` | | Init |
Expand All @@ -213,7 +213,7 @@
//! See: <https://hackmd.io/@liangcc/zkvmbook/https%3A%2F%2Fhackmd.io%2FAmhZ2ryITxicmhYFyQ0DEw#Bus-Mapping>

#![cfg_attr(docsrs, feature(doc_cfg))]
// We want to have UPPERCASE idents sometimes.
// We want to have UPPERCASE indents sometimes.
#![allow(non_snake_case)]
// Catch documentation errors caused by code changes.
#![deny(rustdoc::broken_intra_doc_links)]
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 @@ -20,7 +20,7 @@ pub struct BlockData<C: CircuitsParams> {
/// 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
4 changes: 2 additions & 2 deletions bus-mapping/src/operation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl RWCounter {
}
}

/// Enum used to differenciate between EVM Stack, Memory and Storage operations.
/// Enum used to differentiate between EVM Stack, Memory and Storage operations.
/// This is also used as the RwTableTag for the RwTable.
#[derive(Debug, Clone, PartialEq, Eq, Copy, EnumIter, Hash)]
pub enum Target {
Expand Down Expand Up @@ -1038,7 +1038,7 @@ impl<T: Op> Operation<T> {
&mut self.op
}

// /// Matches over an `Operation` returning the [`Target`] of the iternal
// /// Matches over an `Operation` returning the [`Target`] of the internal
// op /// it stores inside.
// pub const fn target(&self) -> Target {
// self.op.target()
Expand Down
2 changes: 1 addition & 1 deletion bus-mapping/src/operation/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use itertools::Itertools;
/// [`ExecStep`](crate::circuit_input_builder::ExecStep).
///
/// Finally, the container also provides the capability of retrieving all of the
/// `Stack`, `Memory` or `Storage` operations ordered according to the criterias
/// `Stack`, `Memory` or `Storage` operations ordered according to the criteria
/// they have specified.
/// That serves as a way to get an input with which is easy to work with in
/// order to construct the State proof.
Expand Down
4 changes: 2 additions & 2 deletions eth-types/src/geth_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ pub struct Transaction {
/// Gas Limit / Supplied gas
/// U64 type is required to serialize into proper hex with 0x prefix
pub gas_limit: U64,
/// Transfered value
/// Transferred value
pub value: Word,
/// Gas Price
pub gas_price: Word,
Expand Down Expand Up @@ -359,7 +359,7 @@ impl Transaction {
..response::Transaction::default()
}
}
/// Convinient method for gas limit
/// Convenient method for gas limit
pub fn gas(&self) -> u64 {
self.gas_limit.as_u64()
}
Expand Down
2 changes: 1 addition & 1 deletion eth-types/src/keccak.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ impl Sponge {
}
}

/// Convinient method to get 32 bytes digest
/// Convenient method to get 32 bytes digest
pub fn keccak256(msg: &[u8]) -> [u8; 32] {
let mut keccak = Keccak::default();
keccak.update(msg);
Expand Down
2 changes: 1 addition & 1 deletion eth-types/src/sign_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ pub fn recover_pk(
}

lazy_static! {
/// Secp256k1 Curve Scalar. Referece: Section 2.4.1 (parameter `n`) in "SEC 2: Recommended
/// Secp256k1 Curve Scalar. Reference: Section 2.4.1 (parameter `n`) in "SEC 2: Recommended
/// Elliptic Curve Domain Parameters" document at http://www.secg.org/sec2-v2.pdf
pub static ref SECP256K1_Q: BigUint = BigUint::from_bytes_le(&(secp256k1::Fq::ZERO - secp256k1::Fq::ONE).to_repr()) + 1u64;
}
Expand Down
2 changes: 1 addition & 1 deletion gadgets/src/is_zero.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ impl<F: Field> IsZeroConfig<F> {
}

#[derive(Debug, Clone)]
/// Wrapper arround [`IsZeroConfig`] for which [`Chip`] is implemented.
/// Wrapper around [`IsZeroConfig`] for which [`Chip`] is implemented.
pub struct IsZeroChip<F> {
config: IsZeroConfig<F>,
}
Expand Down
4 changes: 2 additions & 2 deletions geth-utils/gethutil/mpt/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ func (s *StateDB) Copy() *StateDB {
// nil
if object, exist := s.stateObjects[addr]; exist {
// Even though the original object is dirty, we are not copying the journal,
// so we need to make sure that anyside effect the journal would have caused
// so we need to make sure that any side effect the journal would have caused
// during a commit (or similar op) is already applied to the copy.
state.stateObjects[addr] = object.deepCopy(state)

Expand Down Expand Up @@ -816,7 +816,7 @@ func (s *StateDB) Copy() *StateDB {
}
if s.snaps != nil {
// In order for the miner to be able to use and make additions
// to the snapshot tree, we need to copy that aswell.
// to the snapshot tree, we need to copy that as well.
// Otherwise, any block mined by ourselves will cause gaps in the tree,
// and force the miner to operate trie-backed only
state.snaps = s.snaps
Expand Down
4 changes: 2 additions & 2 deletions geth-utils/gethutil/mpt/trie/hasher.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (b *sliceBuffer) Reset() {
type hasher struct {
sha crypto.KeccakState
tmp sliceBuffer
parallel bool // Whether to use paralallel threads when hashing
parallel bool // Whether to use parallel threads when hashing
}

// hasherPool holds pureHashers
Expand Down Expand Up @@ -189,7 +189,7 @@ func (h *hasher) HashData(data []byte) HashNode {
}

// ProofHash is used to construct trie proofs, and returns the 'collapsed'
// node (for later RLP encoding) aswell as the hashed node -- unless the
// node (for later RLP encoding) as well as the hashed node -- unless the
// node is smaller than 32 bytes, in which case it will be returned as is.
// This method does not do anything on value- or hash-nodes.
func (h *hasher) ProofHash(original Node) (collapsed, hashed Node) {
Expand Down
2 changes: 1 addition & 1 deletion geth-utils/gethutil/mpt/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func (b *Block) Header() *Header { return CopyHeader(b.header) }
func (b *Block) Body() *Body { return &Body{b.transactions, b.uncles} }

// Size returns the true RLP encoded storage size of the block, either by encoding
// and returning it, or returning a previsouly cached value.
// and returning it, or returning a previously cached value.
func (b *Block) Size() common.StorageSize {
if size := b.size.Load(); size != nil {
return size.(common.StorageSize)
Expand Down
2 changes: 1 addition & 1 deletion geth-utils/gethutil/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ type Transaction struct {
type TraceConfig struct {
ChainID *hexutil.Big `json:"chain_id"`
// HistoryHashes contains most recent 256 block hashes in history,
// where the lastest one is at HistoryHashes[len(HistoryHashes)-1].
// where the latest one is at HistoryHashes[len(HistoryHashes)-1].
HistoryHashes []*hexutil.Big `json:"history_hashes"`
Block Block `json:"block_constants"`
Accounts map[common.Address]Account `json:"accounts"`
Expand Down
2 changes: 1 addition & 1 deletion geth-utils/src/mpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ pub fn get_witness(block_no: u64, mods: &[TrieModification], node_url: &str) ->
unsafe { go::FreeString(c_str.as_ptr()) };

// Note: previously this function returned a Vec of Nodes, but now returning a JSON string
// to avoid imporing zkEVM circuit here (that will create a circular dependency).
// to avoid importing zkEVM circuit here (that will create a circular dependency).
// TODO: consider defining Node types in another crate.

json
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ enum BuildError {
/// Vec<CompilerInput> is empty
#[error("ArtifactError")]
ArtifactError,
/// Functon compile_output failed to encode CompilerInput to Vec<u8>
/// Function compile_output failed to encode CompilerInput to Vec<u8>
#[error("CompileOutputFailure({0:})")]
CompileOutputFailure(String),
/// Could not convert Vec<u8> to CompilerOutput
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/src/bin/gen_blockchain_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ async fn dump_tx_trace(prov: Provider<Http>, receipt: TransactionReceipt, name:
.expect("Failed to get transaction debug trace");
let filename = format!("{}_trace.json", name);
serde_json::to_writer(&File::create(filename).expect("cannot create file"), &trace)
.expect("Could not seralize trace as json data");
.expect("Could not serialize trace as json data");
}

fn erc20_transfer<M>(
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/src/integration_test_circuits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ fn test_actual_circuit<C: Circuit<Fr>>(

let mut transcript = PoseidonTranscript::new(Vec::new());

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

log::info!("gen circuit proof");
Expand Down Expand Up @@ -214,7 +214,7 @@ fn test_actual_root_circuit<C: Circuit<Fr>>(

let mut transcript = EvmTranscript::<_, NativeLoader, _, _>::new(vec![]);

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

log::info!("gen root circuit proof");
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/tests/circuit_input_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ macro_rules! declare_tests {
}

// This test builds the complete circuit inputs for the block where 1 ETH is
// transfered.
// transferred.
declare_tests!(test_circuit_input_builder_block_transfer_0, "Transfer 0");
// This test builds the complete circuit inputs for the block where the Greeter
// contract is deployed.
Expand Down
4 changes: 2 additions & 2 deletions mock/src/test_ctx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub struct TestContext<const NACC: usize, const NTX: usize> {
/// Account list
pub accounts: [Account; NACC],
/// 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 Expand Up @@ -172,7 +172,7 @@ impl<const NACC: usize, const NTX: usize> TestContext<NACC, NTX> {
}
}

/// Collection of helper functions which contribute to specific rutines on the
/// Collection of helper functions which contribute to specific routines on the
/// builder pattern used to construct [`TestContext`]s.
pub mod helpers {
use super::*;
Expand Down
2 changes: 1 addition & 1 deletion testool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Sometimes there are some files or specific tests that we want to disable at all.
When the command line parameter `--report` is defined, it automatically:

- After the execution, a two files are created in the `report` folder. They are
- `<timestamp>-<git_commit>.hml` with the browseable results of the execution.
- `<timestamp>-<git_commit>.hml` with the browsable results of the execution.
- `<timestamp>-<git_commit>.csv` with the raw results of the execution
- The HTML file also contains the diff with the previous result. The previous result file is the more recent csv file with different commit from the current one

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/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ fn go() -> Result<()> {
env_logger::Builder::from_env(env_logger::Env::default().default_filter_or("info")).init();

log::info!("Using suite '{}'", args.suite);
log::info!("Parsing and compliling tests...");
log::info!("Parsing and compiling tests...");
let compiler = Compiler::new(true, Some(PathBuf::from(CODEHASH_FILE)))?;
let suite = config.suite(&args.suite)?.clone();
let state_tests = load_statetests_suite(&suite.path, config, compiler)?;
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/bin/stats/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ pub(crate) fn print_circuit_stats_by_states(
assert_eq!(ExecState::Op(opcode), step.exec_state);
let height = fn_height(&builder.block, state, step_index);

// Substract 1 to step_index to remove the `BeginTx` step, which doesn't appear
// Subtract 1 to step_index to remove the `BeginTx` step, which doesn't appear
// in the geth trace.
let geth_step = &block.geth_traces[0].struct_logs[step_index - 1];
assert_eq!(opcode, geth_step.op);
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/bytecode_circuit/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ fn bytecode_invalid_is_code() {
})
.verify(false);
}
// Mark the 4rd byte as data (is code)
// Mark the 4th byte as data (is code)
{
BytecodeCircuit::<Fr>::from_bytes(bytecodes.clone(), k)
.mut_rows(|rows| {
Expand Down
Loading
Loading