From beac0a85bb1535b05c395057171f197cd976bf82 Mon Sep 17 00:00:00 2001 From: Dustin Brickwood Date: Wed, 29 Nov 2023 10:00:27 -0600 Subject: [PATCH] feat: adds spellchecker workflow, and corrects misspelled words (#559) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## What ❔ - Finishes the work started by @Deniallugo in https://github.com/matter-labs/zksync-era/pull/437 - Adds spellchecker workflow to prevent further misspellings - Corrects existing misspelled words ## Why ❔ - Ensures comments and inline documentation does not contain misspelled words for improved readability ## Checklist - [x] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [x] Documentation comments have been added / updated. - [x] Code has been formatted via `zk fmt` and `zk lint`. --------- Signed-off-by: Danil Co-authored-by: Danil --- .github/pull_request_template.md | 1 + .github/workflows/check-spelling.yml | 24 + core/CHANGELOG.md | 2 +- core/bin/block_reverter/src/main.rs | 2 +- core/bin/external_node/src/config/mod.rs | 2 +- core/lib/basic_types/src/lib.rs | 2 +- core/lib/config/src/configs/api.rs | 2 +- core/lib/config/src/configs/chain.rs | 2 +- core/lib/constants/src/crypto.rs | 2 +- core/lib/constants/src/ethereum.rs | 2 +- core/lib/contracts/src/lib.rs | 6 +- core/lib/dal/src/connection/mod.rs | 8 +- core/lib/dal/src/contract_verification_dal.rs | 2 +- core/lib/dal/src/lib.rs | 2 +- core/lib/dal/src/storage_dal.rs | 2 +- core/lib/dal/src/transactions_dal.rs | 2 +- core/lib/dal/src/witness_generator_dal.rs | 2 +- core/lib/eth_client/src/lib.rs | 10 +- core/lib/eth_signer/src/json_rpc_signer.rs | 6 +- core/lib/eth_signer/src/pk_signer.rs | 2 +- core/lib/mempool/src/mempool_store.rs | 2 +- core/lib/merkle_tree/src/pruning.rs | 2 +- core/lib/merkle_tree/src/recovery.rs | 2 +- core/lib/merkle_tree/src/storage/patch.rs | 4 +- core/lib/merkle_tree/src/types/mod.rs | 6 +- core/lib/multivm/src/glue/mod.rs | 2 +- core/lib/multivm/src/glue/tracers/mod.rs | 20 +- .../types/errors/vm_revert_reason.rs | 2 +- core/lib/multivm/src/lib.rs | 2 +- .../src/versions/vm_1_3_2/bootloader_state.rs | 2 +- .../vm_1_3_2/errors/vm_revert_reason.rs | 2 +- .../src/versions/vm_1_3_2/oracle_tools.rs | 2 +- .../versions/vm_1_3_2/oracles/decommitter.rs | 4 +- .../vm_1_3_2/oracles/tracer/bootloader.rs | 2 +- .../versions/vm_1_3_2/oracles/tracer/call.rs | 2 +- .../versions/vm_1_3_2/oracles/tracer/utils.rs | 2 +- .../src/versions/vm_1_3_2/test_utils.rs | 4 +- .../src/versions/vm_1_3_2/transaction_data.rs | 56 +- .../src/versions/vm_1_3_2/vm_instance.rs | 2 +- .../vm_latest/bootloader_state/snapshot.rs | 6 +- .../versions/vm_latest/bootloader_state/tx.rs | 2 +- .../src/versions/vm_latest/constants.rs | 6 +- .../vm_latest/implementation/statistics.rs | 2 +- .../vm_latest/old_vm/oracles/decommitter.rs | 4 +- .../vm_latest/tests/tester/inner_state.rs | 4 +- .../src/versions/vm_latest/tracers/utils.rs | 2 +- .../types/internals/transaction_data.rs | 6 +- .../src/versions/vm_latest/utils/fee.rs | 2 +- .../src/versions/vm_latest/utils/overhead.rs | 54 +- core/lib/multivm/src/versions/vm_latest/vm.rs | 2 +- .../src/versions/vm_m5/bootloader_state.rs | 2 +- .../versions/vm_m5/errors/vm_revert_reason.rs | 2 +- .../src/versions/vm_m5/oracles/tracer.rs | 4 +- .../multivm/src/versions/vm_m5/test_utils.rs | 4 +- .../multivm/src/versions/vm_m5/vm_instance.rs | 2 +- .../src/versions/vm_m6/bootloader_state.rs | 2 +- .../versions/vm_m6/errors/vm_revert_reason.rs | 2 +- .../src/versions/vm_m6/oracle_tools.rs | 2 +- .../src/versions/vm_m6/oracles/decommitter.rs | 4 +- .../vm_m6/oracles/tracer/bootloader.rs | 2 +- .../src/versions/vm_m6/oracles/tracer/call.rs | 2 +- .../versions/vm_m6/oracles/tracer/utils.rs | 2 +- .../multivm/src/versions/vm_m6/test_utils.rs | 4 +- .../src/versions/vm_m6/transaction_data.rs | 56 +- .../multivm/src/versions/vm_m6/vm_instance.rs | 2 +- .../bootloader_state/snapshot.rs | 6 +- .../bootloader_state/tx.rs | 2 +- .../vm_refunds_enhancement/constants.rs | 4 +- .../implementation/statistics.rs | 2 +- .../old_vm/oracles/decommitter.rs | 4 +- .../tests/tester/inner_state.rs | 4 +- .../vm_refunds_enhancement/tracers/utils.rs | 2 +- .../types/internals/transaction_data.rs | 8 +- .../vm_refunds_enhancement/utils/fee.rs | 2 +- .../vm_refunds_enhancement/utils/overhead.rs | 54 +- .../src/versions/vm_refunds_enhancement/vm.rs | 2 +- .../bootloader_state/snapshot.rs | 6 +- .../vm_virtual_blocks/bootloader_state/tx.rs | 2 +- .../versions/vm_virtual_blocks/constants.rs | 4 +- .../implementation/statistics.rs | 2 +- .../old_vm/oracles/decommitter.rs | 4 +- .../tests/tester/inner_state.rs | 4 +- .../vm_virtual_blocks/tracers/utils.rs | 2 +- .../types/internals/transaction_data.rs | 6 +- .../versions/vm_virtual_blocks/utils/fee.rs | 2 +- .../vm_virtual_blocks/utils/overhead.rs | 54 +- .../src/versions/vm_virtual_blocks/vm.rs | 2 +- core/lib/state/src/cache/metrics.rs | 2 +- core/lib/state/src/in_memory.rs | 2 +- core/lib/state/src/lib.rs | 2 +- core/lib/storage/src/db.rs | 4 +- core/lib/storage/src/metrics.rs | 2 +- core/lib/types/src/api/mod.rs | 6 +- core/lib/types/src/block.rs | 2 +- core/lib/types/src/storage/writes/mod.rs | 4 +- core/lib/types/src/transaction_request.rs | 8 +- .../eip712_signature/typed_structure.rs | 2 +- .../src/tx/primitives/packed_eth_signature.rs | 8 +- core/lib/utils/src/bytecode.rs | 2 +- core/lib/utils/src/convert.rs | 2 +- core/lib/vlog/src/lib.rs | 2 +- .../contract_verification/api_decl.rs | 2 +- .../api_server/execution_sandbox/execute.rs | 2 +- .../api_server/execution_sandbox/tracers.rs | 4 +- .../api_server/execution_sandbox/validate.rs | 2 +- .../src/api_server/tx_sender/mod.rs | 8 +- .../src/eth_sender/eth_tx_manager.rs | 2 +- .../lib/zksync_core/src/eth_sender/metrics.rs | 2 +- .../house_keeper/fri_prover_queue_monitor.rs | 2 +- core/lib/zksync_core/src/lib.rs | 2 +- .../src/metadata_calculator/helpers.rs | 2 +- core/lib/zksync_core/src/metrics.rs | 4 +- .../lib/zksync_core/src/reorg_detector/mod.rs | 10 +- .../src/state_keeper/batch_executor/mod.rs | 2 +- .../zksync_core/src/state_keeper/io/mod.rs | 2 +- .../zksync_core/src/state_keeper/metrics.rs | 6 +- .../zksync_core/src/witness_generator/mod.rs | 8 +- core/tests/loadnext/src/account/mod.rs | 2 +- core/tests/loadnext/src/account_pool.rs | 2 +- core/tests/loadnext/src/command/api.rs | 2 +- docs/advanced/pubdata.md | 2 +- prover/witness_generator/README.md | 4 +- spellcheck/era.cfg | 69 ++ spellcheck/era.dic | 605 ++++++++++++++++++ 124 files changed, 1029 insertions(+), 328 deletions(-) create mode 100644 .github/workflows/check-spelling.yml create mode 100644 spellcheck/era.cfg create mode 100644 spellcheck/era.dic diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index dba6efd2fdff..7b828d1ca895 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -18,3 +18,4 @@ - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted via `zk fmt` and `zk lint`. +- [ ] Spellcheck has been run via `cargo spellcheck --cfg=./spellcheck/era.cfg --code 1`. diff --git a/.github/workflows/check-spelling.yml b/.github/workflows/check-spelling.yml new file mode 100644 index 000000000000..76fd6352c8e7 --- /dev/null +++ b/.github/workflows/check-spelling.yml @@ -0,0 +1,24 @@ +name: Check Spelling + +on: + push: + branches: + - main + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + spellcheck: + runs-on: ubuntu-latest + steps: + - name: Install cargo-spellcheck + uses: taiki-e/install-action@v2 + with: + tool: cargo-spellcheck + + - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4 + + - name: Run cargo-spellcheck + run: cargo spellcheck --cfg=./spellcheck/era.cfg --code 1 diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index 6999f1448d6b..d34f9d4faf58 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -244,7 +244,7 @@ * **prover-fri:** added picked-by column in prover fri related tables ([#2600](https://github.com/matter-labs/zksync-2-dev/issues/2600)) ([9e604ab](https://github.com/matter-labs/zksync-2-dev/commit/9e604abf3bae11b6f583f2abd39c07a85dc20f0a)) * update verification keys, protocol version 15 ([#2602](https://github.com/matter-labs/zksync-2-dev/issues/2602)) ([2fff59b](https://github.com/matter-labs/zksync-2-dev/commit/2fff59bab00849996864b68e932739135337ebd7)) * **vlog:** Rework the observability configuration subsystem ([#2608](https://github.com/matter-labs/zksync-2-dev/issues/2608)) ([377f0c5](https://github.com/matter-labs/zksync-2-dev/commit/377f0c5f734c979bc990b429dff0971466872e71)) -* **vm:** Multivm tracer support ([#2601](https://github.com/matter-labs/zksync-2-dev/issues/2601)) ([4a7467b](https://github.com/matter-labs/zksync-2-dev/commit/4a7467b1b1556bfd795792dbe280bcf28c93a58f)) +* **vm:** MultiVM tracer support ([#2601](https://github.com/matter-labs/zksync-2-dev/issues/2601)) ([4a7467b](https://github.com/matter-labs/zksync-2-dev/commit/4a7467b1b1556bfd795792dbe280bcf28c93a58f)) ## [8.7.0](https://github.com/matter-labs/zksync-2-dev/compare/core-v8.6.0...core-v8.7.0) (2023-09-19) diff --git a/core/bin/block_reverter/src/main.rs b/core/bin/block_reverter/src/main.rs index 3958f4dec11b..bc49b731d149 100644 --- a/core/bin/block_reverter/src/main.rs +++ b/core/bin/block_reverter/src/main.rs @@ -33,7 +33,7 @@ enum Command { /// L1 batch number used to rollback to. #[arg(long)] l1_batch_number: u32, - /// Priority fee used for rollback ethereum transaction. + /// Priority fee used for rollback Ethereum transaction. // We operate only by priority fee because we want to use base fee from ethereum // and send transaction as soon as possible without any resend logic #[arg(long)] diff --git a/core/bin/external_node/src/config/mod.rs b/core/bin/external_node/src/config/mod.rs index 00ae9d1da1b5..3f26a334ea3c 100644 --- a/core/bin/external_node/src/config/mod.rs +++ b/core/bin/external_node/src/config/mod.rs @@ -105,7 +105,7 @@ pub struct OptionalENConfig { /// Max possible size of an ABI encoded tx (in bytes). #[serde(default = "OptionalENConfig::default_max_tx_size")] pub max_tx_size: usize, - /// Max number of cache misses during one VM execution. If the number of cache misses exceeds this value, the api server panics. + /// Max number of cache misses during one VM execution. If the number of cache misses exceeds this value, the API server panics. /// This is a temporary solution to mitigate API request resulting in thousands of DB queries. pub vm_execution_cache_misses_limit: Option, /// Inbound transaction limit used for throttling. diff --git a/core/lib/basic_types/src/lib.rs b/core/lib/basic_types/src/lib.rs index 86cc8c592212..6c6223fbb177 100644 --- a/core/lib/basic_types/src/lib.rs +++ b/core/lib/basic_types/src/lib.rs @@ -77,7 +77,7 @@ impl TryFrom for AccountTreeId { } } -/// ChainId in the ZkSync network. +/// ChainId in the zkSync network. #[derive(Copy, Clone, Debug, Serialize, PartialEq, Eq, PartialOrd, Ord, Hash)] pub struct L2ChainId(u64); diff --git a/core/lib/config/src/configs/api.rs b/core/lib/config/src/configs/api.rs index 3b23abea43c5..14b3d81520c1 100644 --- a/core/lib/config/src/configs/api.rs +++ b/core/lib/config/src/configs/api.rs @@ -57,7 +57,7 @@ pub struct Web3JsonRpcConfig { pub estimate_gas_acceptable_overestimation: u32, /// Max possible size of an ABI encoded tx (in bytes). pub max_tx_size: usize, - /// Max number of cache misses during one VM execution. If the number of cache misses exceeds this value, the api server panics. + /// Max number of cache misses during one VM execution. If the number of cache misses exceeds this value, the API server panics. /// This is a temporary solution to mitigate API request resulting in thousands of DB queries. pub vm_execution_cache_misses_limit: Option, /// Max number of VM instances to be concurrently spawned by the API server. diff --git a/core/lib/config/src/configs/chain.rs b/core/lib/config/src/configs/chain.rs index 95392c8df839..f09b5bb292c5 100644 --- a/core/lib/config/src/configs/chain.rs +++ b/core/lib/config/src/configs/chain.rs @@ -76,7 +76,7 @@ pub struct StateKeeperConfig { pub close_block_at_geometry_percentage: f64, /// Denotes the percentage of L1 params used in L2 block that triggers L2 block seal. pub close_block_at_eth_params_percentage: f64, - /// Denotes the percentage of L1 gas used in l2 block that triggers L2 block seal. + /// Denotes the percentage of L1 gas used in L2 block that triggers L2 block seal. pub close_block_at_gas_percentage: f64, pub fee_account_addr: Address, diff --git a/core/lib/constants/src/crypto.rs b/core/lib/constants/src/crypto.rs index e9ed44ff3081..53a5bb98b796 100644 --- a/core/lib/constants/src/crypto.rs +++ b/core/lib/constants/src/crypto.rs @@ -26,7 +26,7 @@ pub const MAX_NEW_FACTORY_DEPS: usize = 32; pub const PAD_MSG_BEFORE_HASH_BITS_LEN: usize = 736; /// The size of the bootloader memory in bytes which is used by the protocol. -/// While the maximal possible size is a lot higher, we restric ourselves to a certain limit to reduce +/// While the maximal possible size is a lot higher, we restrict ourselves to a certain limit to reduce /// the requirements on RAM. pub const USED_BOOTLOADER_MEMORY_BYTES: usize = 1 << 24; pub const USED_BOOTLOADER_MEMORY_WORDS: usize = USED_BOOTLOADER_MEMORY_BYTES / 32; diff --git a/core/lib/constants/src/ethereum.rs b/core/lib/constants/src/ethereum.rs index 13cdd32d5c1a..299b08e3d0d2 100644 --- a/core/lib/constants/src/ethereum.rs +++ b/core/lib/constants/src/ethereum.rs @@ -12,7 +12,7 @@ pub const GUARANTEED_PUBDATA_PER_L1_BATCH: u64 = 4000; /// The maximum number of pubdata per L1 batch. This limit is due to the fact that the Ethereum /// nodes do not accept transactions that have more than 128kb of pubdata. -/// The 18kb margin is left in case of any inpreciseness of the pubdata calculation. +/// The 18kb margin is left in case of any impreciseness of the pubdata calculation. pub const MAX_PUBDATA_PER_L1_BATCH: u64 = 110000; // TODO: import from zkevm_opcode_defs once VM1.3 is supported diff --git a/core/lib/contracts/src/lib.rs b/core/lib/contracts/src/lib.rs index 01dce6a98f9f..766d2464d343 100644 --- a/core/lib/contracts/src/lib.rs +++ b/core/lib/contracts/src/lib.rs @@ -194,7 +194,7 @@ pub struct SystemContractsRepo { } impl SystemContractsRepo { - /// Returns the default system contracts repo with directory based on the ZKSYNC_HOME environment variable. + /// Returns the default system contracts repository with directory based on the ZKSYNC_HOME environment variable. pub fn from_env() -> Self { let zksync_home = std::env::var("ZKSYNC_HOME").unwrap_or_else(|_| ".".into()); let zksync_home = PathBuf::from(zksync_home); @@ -336,7 +336,7 @@ impl BaseSystemContracts { BaseSystemContracts::load_with_bootloader(bootloader_bytecode) } - /// BaseSystemContracts with playground bootloader - used for handling 'eth_calls'. + /// BaseSystemContracts with playground bootloader - used for handling eth_calls. pub fn playground() -> Self { let bootloader_bytecode = read_playground_batch_bootloader_bytecode(); BaseSystemContracts::load_with_bootloader(bootloader_bytecode) @@ -364,7 +364,7 @@ impl BaseSystemContracts { BaseSystemContracts::load_with_bootloader(bootloader_bytecode) } - /// BaseSystemContracts with playground bootloader - used for handling 'eth_calls'. + /// BaseSystemContracts with playground bootloader - used for handling eth_calls. pub fn estimate_gas() -> Self { let bootloader_bytecode = read_bootloader_code("fee_estimate"); BaseSystemContracts::load_with_bootloader(bootloader_bytecode) diff --git a/core/lib/dal/src/connection/mod.rs b/core/lib/dal/src/connection/mod.rs index ad761a7edf01..845dbc64dc4c 100644 --- a/core/lib/dal/src/connection/mod.rs +++ b/core/lib/dal/src/connection/mod.rs @@ -72,13 +72,13 @@ impl<'a> ConnectionPoolBuilder<'a> { } } -/// Constructucts a new temporary database (with a randomized name) +/// Constructs a new temporary database (with a randomized name) /// by cloning the database template pointed by TEST_DATABASE_URL env var. /// The template is expected to have all migrations from dal/migrations applied. -/// For efficiency, the postgres container of TEST_DATABASE_URL should be +/// For efficiency, the Postgres container of TEST_DATABASE_URL should be /// configured with option "fsync=off" - it disables waiting for disk synchronization -/// whenever you write to the DBs, therefore making it as fast as an inmem postgres instance. -/// The database is not cleaned up automatically, but rather the whole postgres +/// whenever you write to the DBs, therefore making it as fast as an in-memory Postgres instance. +/// The database is not cleaned up automatically, but rather the whole Postgres /// container is recreated whenever you call "zk test rust". pub(super) async fn create_test_db() -> anyhow::Result { use rand::Rng as _; diff --git a/core/lib/dal/src/contract_verification_dal.rs b/core/lib/dal/src/contract_verification_dal.rs index 59e0c6996f96..a6c549f482bc 100644 --- a/core/lib/dal/src/contract_verification_dal.rs +++ b/core/lib/dal/src/contract_verification_dal.rs @@ -91,7 +91,7 @@ impl ContractVerificationDal<'_, '_> { /// Returns the next verification request for processing. /// Considering the situation where processing of some request /// can be interrupted (panic, pod restart, etc..), - /// `processing_timeout` parameter is added to avoid stucking of requests. + /// `processing_timeout` parameter is added to avoid stuck requests. pub async fn get_next_queued_verification_request( &mut self, processing_timeout: Duration, diff --git a/core/lib/dal/src/lib.rs b/core/lib/dal/src/lib.rs index 788ce2d98bd1..9dfc9458202d 100644 --- a/core/lib/dal/src/lib.rs +++ b/core/lib/dal/src/lib.rs @@ -85,7 +85,7 @@ mod tests; /// Storage processor is the main storage interaction point. /// It holds down the connection (either direct or pooled) to the database -/// and provide methods to obtain different storage schemas. +/// and provide methods to obtain different storage schema. #[derive(Debug)] pub struct StorageProcessor<'a> { conn: ConnectionHolder<'a>, diff --git a/core/lib/dal/src/storage_dal.rs b/core/lib/dal/src/storage_dal.rs index fdaaea386171..8ec6d9164938 100644 --- a/core/lib/dal/src/storage_dal.rs +++ b/core/lib/dal/src/storage_dal.rs @@ -43,7 +43,7 @@ impl StorageDal<'_, '_> { .unwrap(); } - /// Returns bytecode for a factory dep with the specified bytecode `hash`. + /// Returns bytecode for a factory dependency with the specified bytecode `hash`. pub async fn get_factory_dep(&mut self, hash: H256) -> Option> { sqlx::query!( "SELECT bytecode FROM factory_deps WHERE bytecode_hash = $1", diff --git a/core/lib/dal/src/transactions_dal.rs b/core/lib/dal/src/transactions_dal.rs index 5b2356899619..cbca986b16c0 100644 --- a/core/lib/dal/src/transactions_dal.rs +++ b/core/lib/dal/src/transactions_dal.rs @@ -969,7 +969,7 @@ impl TransactionsDal<'_, '_> { } } - /// Returns miniblocks with their transactions that state_keeper needs to reexecute on restart. + /// Returns miniblocks with their transactions that state_keeper needs to re-execute on restart. /// These are the transactions that are included to some miniblock, /// but not included to L1 batch. The order of the transactions is the same as it was /// during the previous execution. diff --git a/core/lib/dal/src/witness_generator_dal.rs b/core/lib/dal/src/witness_generator_dal.rs index ab73c525c767..983112ab35cc 100644 --- a/core/lib/dal/src/witness_generator_dal.rs +++ b/core/lib/dal/src/witness_generator_dal.rs @@ -527,7 +527,7 @@ impl WitnessGeneratorDal<'_, '_> { /// Saves artifacts in node_aggregation_job /// and advances it to `waiting_for_proofs` status /// it will be advanced to `queued` by the prover when all the dependency proofs are computed. - /// If the node aggregation job was already `queued` in case of connrecunt run of same leaf aggregation job + /// If the node aggregation job was already `queued` in case of connector run of same leaf aggregation job /// we keep the status as is to prevent data race. pub async fn save_leaf_aggregation_artifacts( &mut self, diff --git a/core/lib/eth_client/src/lib.rs b/core/lib/eth_client/src/lib.rs index 2291f7214706..a03503683255 100644 --- a/core/lib/eth_client/src/lib.rs +++ b/core/lib/eth_client/src/lib.rs @@ -21,7 +21,7 @@ use zksync_types::{ }; /// Common Web3 interface, as seen by the core applications. -/// Encapsulates the raw Web3 interction, providing a high-level interface. +/// Encapsulates the raw Web3 interaction, providing a high-level interface. /// /// ## Trait contents /// @@ -34,7 +34,7 @@ use zksync_types::{ /// /// Most of the trait methods support the `component` parameter. This parameter is used to /// describe the caller of the method. It may be useful to find the component that makes an -/// unnecessary high amount of Web3 calls. Implementations are advices to count invocations +/// unnecessary high amount of Web3 calls. Implementations are advice to count invocations /// per component and expose them to Prometheus. #[async_trait] pub trait EthInterface: Sync + Send { @@ -139,7 +139,7 @@ pub trait EthInterface: Sync + Send { /// An extension of `EthInterface` trait, which is used to perform queries that are bound to /// a certain contract and account. /// -/// THe example use cases for this trait would be: +/// The example use cases for this trait would be: /// - An operator that sends transactions and interacts with zkSync contract. /// - A wallet implementation in the SDK that is tied to a user's account. /// @@ -149,10 +149,10 @@ pub trait EthInterface: Sync + Send { /// implementation that invokes `contract` / `contract_addr` / `sender_account` methods. #[async_trait] pub trait BoundEthInterface: EthInterface { - /// ABI of the contract that is used by the implementor. + /// ABI of the contract that is used by the implementer. fn contract(&self) -> ðabi::Contract; - /// Address of the contract that is used by the implementor. + /// Address of the contract that is used by the implementer. fn contract_addr(&self) -> H160; /// Chain ID of the L1 network the client is *configured* to connected to. diff --git a/core/lib/eth_signer/src/json_rpc_signer.rs b/core/lib/eth_signer/src/json_rpc_signer.rs index da81ff51dba7..b6619f5e831f 100644 --- a/core/lib/eth_signer/src/json_rpc_signer.rs +++ b/core/lib/eth_signer/src/json_rpc_signer.rs @@ -85,7 +85,7 @@ impl EthereumSigner for JsonRpcSigner { } } - /// Signs typed struct using ethereum private key by EIP-712 signature standard. + /// Signs typed struct using Ethereum private key by EIP-712 signature standard. /// Result of this function is the equivalent of RPC calling `eth_signTypedData`. async fn sign_typed_data( &self, @@ -192,7 +192,7 @@ impl JsonRpcSigner { self.address.ok_or(SignerError::DefineAddress) } - /// Specifies the Ethreum address which sets the address for which all other requests will be processed. + /// Specifies the Ethereum address which sets the address for which all other requests will be processed. /// If the address has already been set, then it will all the same change to a new one. pub async fn detect_address( &mut self, @@ -376,7 +376,7 @@ mod messages { Self::create("eth_sign", params) } - /// Signs typed struct using ethereum private key by EIP-712 signature standard. + /// Signs typed struct using Ethereum private key by EIP-712 signature standard. /// The address to sign with must be unlocked. pub fn sign_typed_data( address: Address, diff --git a/core/lib/eth_signer/src/pk_signer.rs b/core/lib/eth_signer/src/pk_signer.rs index 4a5bfb838def..680d87d62d0e 100644 --- a/core/lib/eth_signer/src/pk_signer.rs +++ b/core/lib/eth_signer/src/pk_signer.rs @@ -41,7 +41,7 @@ impl EthereumSigner for PrivateKeySigner { Ok(signature) } - /// Signs typed struct using ethereum private key by EIP-712 signature standard. + /// Signs typed struct using Ethereum private key by EIP-712 signature standard. /// Result of this function is the equivalent of RPC calling `eth_signTypedData`. async fn sign_typed_data( &self, diff --git a/core/lib/mempool/src/mempool_store.rs b/core/lib/mempool/src/mempool_store.rs index f900523517cc..a8b02bee0cb8 100644 --- a/core/lib/mempool/src/mempool_store.rs +++ b/core/lib/mempool/src/mempool_store.rs @@ -29,7 +29,7 @@ pub struct MempoolStore { /// Next priority operation next_priority_id: PriorityOpId, stashed_accounts: Vec
, - /// Number of l2 transactions in the mempool. + /// Number of L2 transactions in the mempool. size: u64, capacity: u64, } diff --git a/core/lib/merkle_tree/src/pruning.rs b/core/lib/merkle_tree/src/pruning.rs index bf60b8cf956b..21a3e8712fd7 100644 --- a/core/lib/merkle_tree/src/pruning.rs +++ b/core/lib/merkle_tree/src/pruning.rs @@ -89,7 +89,7 @@ impl MerkleTreePruner { /// Sets the sleep duration when the pruner cannot progress. This time should be enough /// for the tree to produce enough stale keys. /// - /// The default value is 60s. + /// The default value is 60 seconds. pub fn set_poll_interval(&mut self, poll_interval: Duration) { self.poll_interval = poll_interval; } diff --git a/core/lib/merkle_tree/src/recovery.rs b/core/lib/merkle_tree/src/recovery.rs index 6f57b64ee81f..85ac578cc0a1 100644 --- a/core/lib/merkle_tree/src/recovery.rs +++ b/core/lib/merkle_tree/src/recovery.rs @@ -8,7 +8,7 @@ //! afterwards will have the same outcome as if they were applied to the original tree. //! //! Importantly, a recovered tree is only *observably* identical to the original tree; it differs -//! in (currently unobservable) node versions. In a recovered tree, all nodes will initially have +//! in (currently un-observable) node versions. In a recovered tree, all nodes will initially have //! the same version (the snapshot version), while in the original tree, node versions are distributed //! from 0 to the snapshot version (both inclusive). //! diff --git a/core/lib/merkle_tree/src/storage/patch.rs b/core/lib/merkle_tree/src/storage/patch.rs index 9e251bf01782..6d0c38d6c9fb 100644 --- a/core/lib/merkle_tree/src/storage/patch.rs +++ b/core/lib/merkle_tree/src/storage/patch.rs @@ -344,7 +344,7 @@ impl WorkingPatchSet { } } - /// Computes hashes and serializes this changeset. + /// Computes hashes and serializes this change set. pub(super) fn finalize( self, manifest: Manifest, @@ -597,7 +597,7 @@ impl WorkingPatchSet { Some(Node::Internal(node)) => { let (next_nibble, child_ref) = node.last_child_ref(); nibbles = nibbles.push(next_nibble).unwrap(); - // ^ `unwrap()` is safe; there can be no internal nodes on the bottommost tree level + // ^ `unwrap()` is safe; there can be no internal nodes on the bottom-most tree level let child_key = nibbles.with_version(child_ref.version); let child_node = db.tree_node(&child_key, child_ref.is_leaf).unwrap(); // ^ `unwrap()` is safe by construction diff --git a/core/lib/merkle_tree/src/types/mod.rs b/core/lib/merkle_tree/src/types/mod.rs index 6988735ec021..de35d9024b7b 100644 --- a/core/lib/merkle_tree/src/types/mod.rs +++ b/core/lib/merkle_tree/src/types/mod.rs @@ -42,7 +42,7 @@ impl TreeEntry { } } - /// Returns `true` iff this entry encodes lack of a value. + /// Returns `true` if and only if this entry encodes lack of a value. pub fn is_empty(&self) -> bool { self.leaf_index == 0 && self.value_hash.is_zero() } @@ -63,7 +63,7 @@ pub struct TreeEntryWithProof { /// Proof of the value authenticity. /// /// If specified, a proof is the Merkle path consisting of up to 256 hashes - /// ordered starting the bottommost level of the tree (one with leaves) and ending before + /// ordered starting the bottom-most level of the tree (one with leaves) and ending before /// the root level. /// /// If the path is not full (contains <256 hashes), it means that the hashes at the beginning @@ -152,7 +152,7 @@ pub struct TreeLogEntryWithProof

> { /// Log entry about an atomic operation on the tree. pub base: TreeLogEntry, /// Merkle path to prove log authenticity. The path consists of up to 256 hashes - /// ordered starting the bottommost level of the tree (one with leaves) and ending before + /// ordered starting the bottom-most level of the tree (one with leaves) and ending before /// the root level. /// /// If the path is not full (contains <256 hashes), it means that the hashes at the beginning diff --git a/core/lib/multivm/src/glue/mod.rs b/core/lib/multivm/src/glue/mod.rs index 0904661a73cf..299093532bd4 100644 --- a/core/lib/multivm/src/glue/mod.rs +++ b/core/lib/multivm/src/glue/mod.rs @@ -11,7 +11,7 @@ pub(crate) mod history_mode; pub mod tracers; mod types; -/// This trait is a workaround on the Rust'c [orphan rule](orphan_rule). +/// This trait is a workaround on the Rust's [orphan rule](orphan_rule). /// We need to convert a lot of types that come from two different versions of some crate, /// and `From`/`Into` traits are natural way of doing so. Unfortunately, we can't implement an /// external trait on a pair of external types, so we're unable to use these traits. diff --git a/core/lib/multivm/src/glue/tracers/mod.rs b/core/lib/multivm/src/glue/tracers/mod.rs index b9c0e083b84c..a504d5d2c8ff 100644 --- a/core/lib/multivm/src/glue/tracers/mod.rs +++ b/core/lib/multivm/src/glue/tracers/mod.rs @@ -1,4 +1,4 @@ -//! # Multivm Tracing +//! # MultiVM Tracing //! //! The MultiVM tracing module enables support for Tracers in different versions of virtual machines. //! @@ -7,7 +7,7 @@ //! Different VM versions may have distinct requirements and types for Tracers. To accommodate these differences, //! this module defines one primary trait: //! -//! - `MultivmTracer`: This trait represents a tracer that can be converted into a tracer for +//! - `MultiVMTracer`: This trait represents a tracer that can be converted into a tracer for //! a specific VM version. //! //! Specific traits for each VM version, which support Custom Tracers: @@ -19,23 +19,23 @@ //! into a form compatible with the vm_virtual_blocks version. //! It defines a method `vm_virtual_blocks` for obtaining a boxed tracer. //! -//! For `MultivmTracer` to be implemented, the Tracer must implement all N currently +//! For `MultiVMTracer` to be implemented, the Tracer must implement all N currently //! existing sub-traits. //! //! ## Adding a new VM version //! -//! To add support for one more VM version to MultivmTracer, one needs to: +//! To add support for one more VM version to MultiVMTracer, one needs to: //! - Create a new trait performing conversion to the specified VM tracer, e.g., `IntoTracer`. -//! - Add this trait as a trait bound to the `MultivmTracer`. -//! - Add this trait as a trait bound for `T` in `MultivmTracer` implementation. -//! — Implement the trait for `T` with a bound to `VmTracer` for a specific version. +//! - Add this trait as a trait bound to the `MultiVMTracer`. +//! - Add this trait as a trait bound for `T` in `MultiVMTracer` implementation. +//! - Implement the trait for `T` with a bound to `VmTracer` for a specific version. //! use crate::HistoryMode; use zksync_state::WriteStorage; -pub type MultiVmTracerPointer = Box>; +pub type MultiVmTracerPointer = Box>; -pub trait MultivmTracer: +pub trait MultiVMTracer: IntoLatestTracer + IntoVmVirtualBlocksTracer + IntoVmRefundsEnhancementTracer { fn into_tracer_pointer(self) -> MultiVmTracerPointer @@ -102,7 +102,7 @@ where } } -impl MultivmTracer for T +impl MultiVMTracer for T where S: WriteStorage, H: HistoryMode, diff --git a/core/lib/multivm/src/interface/types/errors/vm_revert_reason.rs b/core/lib/multivm/src/interface/types/errors/vm_revert_reason.rs index 531d8b5507f6..4a6457491264 100644 --- a/core/lib/multivm/src/interface/types/errors/vm_revert_reason.rs +++ b/core/lib/multivm/src/interface/types/errors/vm_revert_reason.rs @@ -12,7 +12,7 @@ pub enum VmRevertReasonParsingError { IncorrectStringLength(Vec), } -/// Rich Revert Reasons https://github.com/0xProject/ZEIPs/issues/32 +/// Rich Revert Reasons `https://github.com/0xProject/ZEIPs/issues/32` #[derive(Debug, Clone, PartialEq)] pub enum VmRevertReason { General { diff --git a/core/lib/multivm/src/lib.rs b/core/lib/multivm/src/lib.rs index 1e45443c0f27..adb9358980fd 100644 --- a/core/lib/multivm/src/lib.rs +++ b/core/lib/multivm/src/lib.rs @@ -6,7 +6,7 @@ pub use crate::{ glue::{ history_mode::HistoryMode, - tracers::{MultiVmTracerPointer, MultivmTracer}, + tracers::{MultiVMTracer, MultiVmTracerPointer}, }, vm_instance::VmInstance, }; diff --git a/core/lib/multivm/src/versions/vm_1_3_2/bootloader_state.rs b/core/lib/multivm/src/versions/vm_1_3_2/bootloader_state.rs index a55846623239..f0324137bdcb 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/bootloader_state.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/bootloader_state.rs @@ -5,7 +5,7 @@ use crate::vm_1_3_2::vm_with_bootloader::TX_DESCRIPTION_OFFSET; /// Required to process transactions one by one (since we intercept the VM execution to execute /// transactions and add new ones to the memory on the fly). /// Think about it like a two-pointer scheme: one pointer (`free_tx_index`) tracks the end of the -/// initialized memory; while another (`tx_to_execute`) tracks our progess in this initialized memory. +/// initialized memory; while another (`tx_to_execute`) tracks our progress in this initialized memory. /// This is required since it's possible to push several transactions to the bootloader memory and then /// execute it one by one. /// diff --git a/core/lib/multivm/src/versions/vm_1_3_2/errors/vm_revert_reason.rs b/core/lib/multivm/src/versions/vm_1_3_2/errors/vm_revert_reason.rs index e1d50f724481..c127a9e6f2df 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/errors/vm_revert_reason.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/errors/vm_revert_reason.rs @@ -15,7 +15,7 @@ pub enum VmRevertReasonParsingError { IncorrectStringLength(Vec), } -/// Rich Revert Reasons https://github.com/0xProject/ZEIPs/issues/32 +/// Rich Revert Reasons `https://github.com/0xProject/ZEIPs/issues/32` #[derive(Debug, Clone, PartialEq)] pub enum VmRevertReason { General { diff --git a/core/lib/multivm/src/versions/vm_1_3_2/oracle_tools.rs b/core/lib/multivm/src/versions/vm_1_3_2/oracle_tools.rs index 0f1feef4f94c..9f0f2600c5bb 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/oracle_tools.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/oracle_tools.rs @@ -12,7 +12,7 @@ use zksync_state::{StoragePtr, WriteStorage}; /// zkEVM requires a bunch of objects implementing given traits to work. /// For example: Storage, Memory, PrecompilerProcessor etc -/// (you can find all these traites in zk_evm crate -> src/abstractions/mod.rs) +/// (you can find all these traits in zk_evm crate -> src/abstractions/mod.rs) /// For each of these traits, we have a local implementation (for example StorageOracle) /// that also support additional features (like rollbacks & history). /// The OracleTools struct, holds all these things together in one place. diff --git a/core/lib/multivm/src/versions/vm_1_3_2/oracles/decommitter.rs b/core/lib/multivm/src/versions/vm_1_3_2/oracles/decommitter.rs index e5c30c305bc8..17583b70dc9f 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/oracles/decommitter.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/oracles/decommitter.rs @@ -68,7 +68,7 @@ impl DecommitterOracle } } - /// Adds additional bytecodes. They will take precendent over the bytecodes from storage. + /// Adds additional bytecodes. They will take precedent over the bytecodes from storage. pub fn populate(&mut self, bytecodes: Vec<(U256, Vec)>, timestamp: Timestamp) { for (hash, bytecode) in bytecodes { self.known_bytecodes.insert(hash, bytecode, timestamp); @@ -178,7 +178,7 @@ impl DecommittmentProcessor > { self.decommitment_requests.push((), partial_query.timestamp); // First - check if we didn't fetch this bytecode in the past. - // If we did - we can just return the page that we used before (as the memory is read only). + // If we did - we can just return the page that we used before (as the memory is readonly). if let Some(memory_page) = self .decommitted_code_hashes .inner() diff --git a/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/bootloader.rs b/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/bootloader.rs index 20d8621e8291..16b1efdff54b 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/bootloader.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/bootloader.rs @@ -16,7 +16,7 @@ use zk_evm_1_3_3::{ zkevm_opcode_defs::{Opcode, RetOpcode}, }; -/// Tells the VM to end the execution before `ret` from the booloader if there is no panic or revert. +/// Tells the VM to end the execution before `ret` from the bootloader if there is no panic or revert. /// Also, saves the information if this `ret` was caused by "out of gas" panic. #[derive(Debug, Clone, Default)] pub struct BootloaderTracer { diff --git a/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/call.rs b/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/call.rs index b50ee5f925cf..72701f6e0f29 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/call.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/call.rs @@ -94,7 +94,7 @@ impl Tracer for CallTracer { } impl CallTracer { - /// We use parent gas for propery calculation of gas used in the trace. + /// We use parent gas for property calculation of gas used in the trace. /// This method updates parent gas for the current call. fn update_parent_gas(&mut self, state: &VmLocalStateData<'_>, current_call: &mut Call) { let current = state.vm_local_state.callstack.current; diff --git a/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/utils.rs b/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/utils.rs index 2914faf5120d..9c9e87c065d0 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/utils.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/oracles/tracer/utils.rs @@ -99,7 +99,7 @@ pub(crate) fn get_debug_log( } /// Reads the memory slice represented by the fat pointer. -/// Note, that the fat pointer must point to the accesible memory (i.e. not cleared up yet). +/// Note, that the fat pointer must point to the accessible memory (i.e. not cleared up yet). pub(crate) fn read_pointer( memory: &SimpleMemory, pointer: FatPointer, diff --git a/core/lib/multivm/src/versions/vm_1_3_2/test_utils.rs b/core/lib/multivm/src/versions/vm_1_3_2/test_utils.rs index 6738b0704825..e697e3b310d8 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/test_utils.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/test_utils.rs @@ -59,7 +59,7 @@ impl PartialEq for ModifiedKeysMap { #[derive(Clone, PartialEq, Debug)] pub struct DecommitterTestInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub modified_storage_keys: ModifiedKeysMap, pub known_bytecodes: HistoryRecorder>, H>, @@ -68,7 +68,7 @@ pub struct DecommitterTestInnerState { #[derive(Clone, PartialEq, Debug)] pub struct StorageOracleInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub modified_storage_keys: ModifiedKeysMap, diff --git a/core/lib/multivm/src/versions/vm_1_3_2/transaction_data.rs b/core/lib/multivm/src/versions/vm_1_3_2/transaction_data.rs index fc931f2ad9af..2d9dd1cb7aa1 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/transaction_data.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/transaction_data.rs @@ -212,12 +212,12 @@ impl TransactionData { self.reserved_dynamic.len() as u64, ); - let coeficients = OverheadCoeficients::from_tx_type(self.tx_type); + let coefficients = OverheadCoefficients::from_tx_type(self.tx_type); get_amortized_overhead( total_gas_limit, gas_price_per_pubdata, encoded_len, - coeficients, + coefficients, ) } @@ -231,7 +231,7 @@ pub fn derive_overhead( gas_limit: u32, gas_price_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Even if the gas limit is greater than the MAX_TX_ERGS_LIMIT, we assume that everything beyond MAX_TX_ERGS_LIMIT // will be spent entirely on publishing bytecodes and so we derive the overhead solely based on the capped value @@ -268,31 +268,31 @@ pub fn derive_overhead( // ); vec![ - (coeficients.ergs_limit_overhead_coeficient + (coefficients.ergs_limit_overhead_coeficient * overhead_for_single_instance_circuits.as_u32() as f64) .floor() as u32, - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) .floor() as u32, - (coeficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, + (coefficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, ] .into_iter() .max() .unwrap() } -/// Contains the coeficients with which the overhead for transactions will be calculated. -/// All of the coeficients should be <= 1. There are here to provide a certain "discount" for normal transactions +/// Contains the coefficients with which the overhead for transactions will be calculated. +/// All of the coefficients should be <= 1. There are here to provide a certain "discount" for normal transactions /// at the risk of malicious transactions that may close the block prematurely. -/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coeficients.ergs_limit_overhead_coeficient` MUST +/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coefficients.ergs_limit_overhead_coeficient` MUST /// result in an integer number #[derive(Debug, Clone, Copy)] -pub struct OverheadCoeficients { +pub struct OverheadCoefficients { slot_overhead_coeficient: f64, bootloader_memory_overhead_coeficient: f64, ergs_limit_overhead_coeficient: f64, } -impl OverheadCoeficients { +impl OverheadCoefficients { // This method ensures that the parameters keep the required invariants fn new_checked( slot_overhead_coeficient: f64, @@ -314,11 +314,11 @@ impl OverheadCoeficients { // L1->L2 do not receive any discounts fn new_l1() -> Self { - OverheadCoeficients::new_checked(1.0, 1.0, 1.0) + OverheadCoefficients::new_checked(1.0, 1.0, 1.0) } fn new_l2() -> Self { - OverheadCoeficients::new_checked( + OverheadCoefficients::new_checked( 1.0, 1.0, // For L2 transactions we allow a certain default discount with regard to the number of ergs. // Multiinstance circuits can in theory be spawned infinite times, while projected future limitations @@ -342,7 +342,7 @@ pub fn get_amortized_overhead( total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Using large U256 type to prevent overflows. let overhead_for_block_gas = U256::from(block_overhead_gas(gas_per_pubdata_byte_limit)); @@ -379,7 +379,7 @@ pub fn get_amortized_overhead( let tx_slot_overhead = { let tx_slot_overhead = ceil_div_u256(overhead_for_block_gas, MAX_TXS_IN_BLOCK.into()).as_u32(); - (coeficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 + (coefficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 }; // 2. The overhead for occupying the bootloader memory can be derived from encoded_len @@ -390,7 +390,7 @@ pub fn get_amortized_overhead( ) .as_u32(); - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() as u32 }; @@ -435,7 +435,7 @@ pub fn get_amortized_overhead( let overhead_for_gas = { let numerator = overhead_for_block_gas * total_gas_limit + U256::from(MAX_TX_ERGS_LIMIT); let denominator: U256 = U256::from( - (MAX_TX_ERGS_LIMIT as f64 / coeficients.ergs_limit_overhead_coeficient) as u64, + (MAX_TX_ERGS_LIMIT as f64 / coefficients.ergs_limit_overhead_coeficient) as u64, ) + overhead_for_block_gas; let overhead_for_gas = (numerator - 1) / denominator; @@ -460,7 +460,7 @@ pub fn get_amortized_overhead( MAX_L2_TX_GAS_LIMIT as u32, gas_per_pubdata_byte_limit, encoded_len.as_usize(), - coeficients, + coefficients, ) } else { overhead @@ -483,7 +483,7 @@ mod tests { total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { let mut left_bound = if MAX_TX_ERGS_LIMIT < total_gas_limit { total_gas_limit - MAX_TX_ERGS_LIMIT @@ -501,7 +501,7 @@ mod tests { total_gas_limit - suggested_overhead, gas_per_pubdata_byte_limit, encoded_len, - coeficients, + coefficients, ); derived_overhead >= suggested_overhead @@ -530,41 +530,41 @@ mod tests { let test_params = |total_gas_limit: u32, gas_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients| { + coefficients: OverheadCoefficients| { let result_by_efficient_search = - get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coeficients); + get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coefficients); let result_by_binary_search = get_maximal_allowed_overhead_bin_search( total_gas_limit, gas_per_pubdata, encoded_len, - coeficients, + coefficients, ); assert_eq!(result_by_efficient_search, result_by_binary_search); }; // Some arbitrary test - test_params(60_000_000, 800, 2900, OverheadCoeficients::new_l2()); + test_params(60_000_000, 800, 2900, OverheadCoefficients::new_l2()); // Very small parameters - test_params(0, 1, 12, OverheadCoeficients::new_l2()); + test_params(0, 1, 12, OverheadCoefficients::new_l2()); // Relatively big parameters let max_tx_overhead = derive_overhead( MAX_TX_ERGS_LIMIT, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); test_params( MAX_TX_ERGS_LIMIT + max_tx_overhead, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); - test_params(115432560, 800, 2900, OverheadCoeficients::new_l1()); + test_params(115432560, 800, 2900, OverheadCoefficients::new_l1()); } #[test] diff --git a/core/lib/multivm/src/versions/vm_1_3_2/vm_instance.rs b/core/lib/multivm/src/versions/vm_1_3_2/vm_instance.rs index d84cd1cc7b6e..3e157e74c02f 100644 --- a/core/lib/multivm/src/versions/vm_1_3_2/vm_instance.rs +++ b/core/lib/multivm/src/versions/vm_1_3_2/vm_instance.rs @@ -364,7 +364,7 @@ impl VmInstance { } } - /// Removes the latest snapshot without rollbacking to it. + /// Removes the latest snapshot without rolling it back. /// This function expects that there is at least one snapshot present. pub fn pop_snapshot_no_rollback(&mut self) { self.snapshots.pop().unwrap(); diff --git a/core/lib/multivm/src/versions/vm_latest/bootloader_state/snapshot.rs b/core/lib/multivm/src/versions/vm_latest/bootloader_state/snapshot.rs index 683fc28a69e9..8f1cec3cb7f1 100644 --- a/core/lib/multivm/src/versions/vm_latest/bootloader_state/snapshot.rs +++ b/core/lib/multivm/src/versions/vm_latest/bootloader_state/snapshot.rs @@ -4,9 +4,9 @@ use zksync_types::H256; pub(crate) struct BootloaderStateSnapshot { /// ID of the next transaction to be executed. pub(crate) tx_to_execute: usize, - /// Stored l2 blocks in bootloader memory + /// Stored L2 blocks in bootloader memory pub(crate) l2_blocks_len: usize, - /// Snapshot of the last l2 block. Only this block could be changed during the rollback + /// Snapshot of the last L2 block. Only this block could be changed during the rollback pub(crate) last_l2_block: L2BlockSnapshot, /// The number of 32-byte words spent on the already included compressed bytecodes. pub(crate) compressed_bytecodes_encoding: usize, @@ -20,6 +20,6 @@ pub(crate) struct BootloaderStateSnapshot { pub(crate) struct L2BlockSnapshot { /// The rolling hash of all the transactions in the miniblock pub(crate) txs_rolling_hash: H256, - /// The number of transactions in the last l2 block + /// The number of transactions in the last L2 block pub(crate) txs_len: usize, } diff --git a/core/lib/multivm/src/versions/vm_latest/bootloader_state/tx.rs b/core/lib/multivm/src/versions/vm_latest/bootloader_state/tx.rs index 6d322e5877d6..dce0ecce3fbc 100644 --- a/core/lib/multivm/src/versions/vm_latest/bootloader_state/tx.rs +++ b/core/lib/multivm/src/versions/vm_latest/bootloader_state/tx.rs @@ -14,7 +14,7 @@ pub(super) struct BootloaderTx { pub(super) refund: u32, /// Gas overhead pub(super) gas_overhead: u32, - /// Gas Limit for this transaction. It can be different from the gaslimit inside the transaction + /// Gas Limit for this transaction. It can be different from the gas limit inside the transaction pub(super) trusted_gas_limit: U256, /// Offset of the tx in bootloader memory pub(super) offset: usize, diff --git a/core/lib/multivm/src/versions/vm_latest/constants.rs b/core/lib/multivm/src/versions/vm_latest/constants.rs index c67156681a0b..4d1c77054237 100644 --- a/core/lib/multivm/src/versions/vm_latest/constants.rs +++ b/core/lib/multivm/src/versions/vm_latest/constants.rs @@ -60,7 +60,7 @@ pub const OPERATOR_PROVIDED_L1_MESSENGER_PUBDATA_OFFSET: usize = /// One of "worst case" scenarios for the number of state diffs in a batch is when 120kb of pubdata is spent /// on repeated writes, that are all zeroed out. In this case, the number of diffs is 120k / 5 = 24k. This means that they will have /// accommodate 6528000 bytes of calldata for the uncompressed state diffs. Adding 120k on top leaves us with -/// roughly 6650000 bytes needed for calldata. 207813 slots are needed to accomodate this amount of data. +/// roughly 6650000 bytes needed for calldata. 207813 slots are needed to accommodate this amount of data. /// We round up to 208000 slots just in case. /// /// In theory though much more calldata could be used (if for instance 1 byte is used for enum index). It is the responsibility of the @@ -92,10 +92,10 @@ pub const BLOCK_OVERHEAD_L1_GAS: u32 = 1000000; pub const BLOCK_OVERHEAD_PUBDATA: u32 = BLOCK_OVERHEAD_L1_GAS / L1_GAS_PER_PUBDATA_BYTE; /// VM Hooks are used for communication between bootloader and tracers. -/// The 'type'/'opcode' is put into VM_HOOK_POSITION slot, +/// The 'type' / 'opcode' is put into VM_HOOK_POSITION slot, /// and VM_HOOKS_PARAMS_COUNT parameters (each 32 bytes) are put in the slots before. /// So the layout looks like this: -/// [param 0][param 1][vmhook opcode] +/// `[param 0][param 1][vmhook opcode]` pub const VM_HOOK_POSITION: u32 = RESULT_SUCCESS_FIRST_SLOT - 1; pub const VM_HOOK_PARAMS_COUNT: u32 = 2; pub const VM_HOOK_PARAMS_START_POSITION: u32 = VM_HOOK_POSITION - VM_HOOK_PARAMS_COUNT; diff --git a/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs index ddbc7aec2f73..92604479a88e 100644 --- a/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_latest/implementation/statistics.rs @@ -43,7 +43,7 @@ impl Vm { } } - /// Returns the hashes the bytecodes that have been decommitted by the decomittment processor. + /// Returns the hashes the bytecodes that have been decommitted by the decommitment processor. pub(crate) fn get_used_contracts(&self) -> Vec { self.state .decommittment_processor diff --git a/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/decommitter.rs b/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/decommitter.rs index fe5416cd1201..c679532fa763 100644 --- a/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/decommitter.rs +++ b/core/lib/multivm/src/versions/vm_latest/old_vm/oracles/decommitter.rs @@ -70,7 +70,7 @@ impl DecommitterOracle { } } - /// Adds additional bytecodes. They will take precendent over the bytecodes from storage. + /// Adds additional bytecodes. They will take precedent over the bytecodes from storage. pub fn populate(&mut self, bytecodes: Vec<(U256, Vec)>, timestamp: Timestamp) { for (hash, bytecode) in bytecodes { self.known_bytecodes.insert(hash, bytecode, timestamp); @@ -180,7 +180,7 @@ impl DecommittmentProcess > { self.decommitment_requests.push((), partial_query.timestamp); // First - check if we didn't fetch this bytecode in the past. - // If we did - we can just return the page that we used before (as the memory is read only). + // If we did - we can just return the page that we used before (as the memory is readonly). if let Some(memory_page) = self .decommitted_code_hashes .inner() diff --git a/core/lib/multivm/src/versions/vm_latest/tests/tester/inner_state.rs b/core/lib/multivm/src/versions/vm_latest/tests/tester/inner_state.rs index ec9ffe785f95..4767f9344795 100644 --- a/core/lib/multivm/src/versions/vm_latest/tests/tester/inner_state.rs +++ b/core/lib/multivm/src/versions/vm_latest/tests/tester/inner_state.rs @@ -34,7 +34,7 @@ impl PartialEq for ModifiedKeysMap { #[derive(Clone, PartialEq, Debug)] pub(crate) struct DecommitterTestInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub(crate) modified_storage_keys: ModifiedKeysMap, pub(crate) known_bytecodes: HistoryRecorder>, H>, @@ -43,7 +43,7 @@ pub(crate) struct DecommitterTestInnerState { #[derive(Clone, PartialEq, Debug)] pub(crate) struct StorageOracleInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub(crate) modified_storage_keys: ModifiedKeysMap, diff --git a/core/lib/multivm/src/versions/vm_latest/tracers/utils.rs b/core/lib/multivm/src/versions/vm_latest/tracers/utils.rs index 5b34eee4742a..c91d2f3ce0c1 100644 --- a/core/lib/multivm/src/versions/vm_latest/tracers/utils.rs +++ b/core/lib/multivm/src/versions/vm_latest/tracers/utils.rs @@ -109,7 +109,7 @@ pub(crate) fn get_debug_log( } /// Reads the memory slice represented by the fat pointer. -/// Note, that the fat pointer must point to the accesible memory (i.e. not cleared up yet). +/// Note, that the fat pointer must point to the accessible memory (i.e. not cleared up yet). pub(crate) fn read_pointer( memory: &SimpleMemory, pointer: FatPointer, diff --git a/core/lib/multivm/src/versions/vm_latest/types/internals/transaction_data.rs b/core/lib/multivm/src/versions/vm_latest/types/internals/transaction_data.rs index f81741d2a431..3c7b9bcac035 100644 --- a/core/lib/multivm/src/versions/vm_latest/types/internals/transaction_data.rs +++ b/core/lib/multivm/src/versions/vm_latest/types/internals/transaction_data.rs @@ -11,7 +11,7 @@ use zksync_types::{ use zksync_utils::address_to_h256; use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256}; -use crate::vm_latest::utils::overhead::{get_amortized_overhead, OverheadCoeficients}; +use crate::vm_latest::utils::overhead::{get_amortized_overhead, OverheadCoefficients}; /// This structure represents the data that is used by /// the Bootloader to describe the transaction. @@ -212,12 +212,12 @@ impl TransactionData { self.reserved_dynamic.len() as u64, ); - let coeficients = OverheadCoeficients::from_tx_type(self.tx_type); + let coefficients = OverheadCoefficients::from_tx_type(self.tx_type); get_amortized_overhead( total_gas_limit, gas_price_per_pubdata, encoded_len, - coeficients, + coefficients, ) } diff --git a/core/lib/multivm/src/versions/vm_latest/utils/fee.rs b/core/lib/multivm/src/versions/vm_latest/utils/fee.rs index bbf09a75f3fc..23b744a348f7 100644 --- a/core/lib/multivm/src/versions/vm_latest/utils/fee.rs +++ b/core/lib/multivm/src/versions/vm_latest/utils/fee.rs @@ -4,7 +4,7 @@ use zksync_utils::ceil_div; use crate::vm_latest::old_vm::utils::eth_price_per_pubdata_byte; -/// Calcluates the amount of gas required to publish one byte of pubdata +/// Calculates the amount of gas required to publish one byte of pubdata pub fn base_fee_to_gas_per_pubdata(l1_gas_price: u64, base_fee: u64) -> u64 { let eth_price_per_pubdata_byte = eth_price_per_pubdata_byte(l1_gas_price); diff --git a/core/lib/multivm/src/versions/vm_latest/utils/overhead.rs b/core/lib/multivm/src/versions/vm_latest/utils/overhead.rs index 2541c7d7037c..a4012e540ed1 100644 --- a/core/lib/multivm/src/versions/vm_latest/utils/overhead.rs +++ b/core/lib/multivm/src/versions/vm_latest/utils/overhead.rs @@ -12,7 +12,7 @@ pub fn derive_overhead( gas_limit: u32, gas_price_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Even if the gas limit is greater than the MAX_TX_ERGS_LIMIT, we assume that everything beyond MAX_TX_ERGS_LIMIT // will be spent entirely on publishing bytecodes and so we derive the overhead solely based on the capped value @@ -49,31 +49,31 @@ pub fn derive_overhead( // ); vec![ - (coeficients.ergs_limit_overhead_coeficient + (coefficients.ergs_limit_overhead_coeficient * overhead_for_single_instance_circuits.as_u32() as f64) .floor() as u32, - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) .floor() as u32, - (coeficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, + (coefficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, ] .into_iter() .max() .unwrap() } -/// Contains the coeficients with which the overhead for transactions will be calculated. -/// All of the coeficients should be <= 1. There are here to provide a certain "discount" for normal transactions +/// Contains the coefficients with which the overhead for transactions will be calculated. +/// All of the coefficients should be <= 1. There are here to provide a certain "discount" for normal transactions /// at the risk of malicious transactions that may close the block prematurely. -/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coeficients.ergs_limit_overhead_coeficient` MUST +/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coefficients.ergs_limit_overhead_coeficient` MUST /// result in an integer number #[derive(Debug, Clone, Copy)] -pub struct OverheadCoeficients { +pub struct OverheadCoefficients { slot_overhead_coeficient: f64, bootloader_memory_overhead_coeficient: f64, ergs_limit_overhead_coeficient: f64, } -impl OverheadCoeficients { +impl OverheadCoefficients { // This method ensures that the parameters keep the required invariants fn new_checked( slot_overhead_coeficient: f64, @@ -95,11 +95,11 @@ impl OverheadCoeficients { // L1->L2 do not receive any discounts fn new_l1() -> Self { - OverheadCoeficients::new_checked(1.0, 1.0, 1.0) + OverheadCoefficients::new_checked(1.0, 1.0, 1.0) } fn new_l2() -> Self { - OverheadCoeficients::new_checked( + OverheadCoefficients::new_checked( 1.0, 1.0, // For L2 transactions we allow a certain default discount with regard to the number of ergs. // Multiinstance circuits can in theory be spawned infinite times, while projected future limitations @@ -109,7 +109,7 @@ impl OverheadCoeficients { ) } - /// Return the coeficients for the given transaction type + /// Return the coefficients for the given transaction type pub fn from_tx_type(tx_type: u8) -> Self { if is_l1_tx_type(tx_type) { Self::new_l1() @@ -124,7 +124,7 @@ pub(crate) fn get_amortized_overhead( total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Using large U256 type to prevent overflows. let overhead_for_block_gas = U256::from(block_overhead_gas(gas_per_pubdata_byte_limit)); @@ -161,7 +161,7 @@ pub(crate) fn get_amortized_overhead( let tx_slot_overhead = { let tx_slot_overhead = ceil_div_u256(overhead_for_block_gas, MAX_TXS_IN_BLOCK.into()).as_u32(); - (coeficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 + (coefficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 }; // 2. The overhead for occupying the bootloader memory can be derived from encoded_len @@ -172,7 +172,7 @@ pub(crate) fn get_amortized_overhead( ) .as_u32(); - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() as u32 }; @@ -217,7 +217,7 @@ pub(crate) fn get_amortized_overhead( let overhead_for_gas = { let numerator = overhead_for_block_gas * total_gas_limit + U256::from(MAX_TX_ERGS_LIMIT); let denominator: U256 = U256::from( - (MAX_TX_ERGS_LIMIT as f64 / coeficients.ergs_limit_overhead_coeficient) as u64, + (MAX_TX_ERGS_LIMIT as f64 / coefficients.ergs_limit_overhead_coeficient) as u64, ) + overhead_for_block_gas; let overhead_for_gas = (numerator - 1) / denominator; @@ -242,7 +242,7 @@ pub(crate) fn get_amortized_overhead( MAX_L2_TX_GAS_LIMIT as u32, gas_per_pubdata_byte_limit, encoded_len.as_usize(), - coeficients, + coefficients, ) } else { overhead @@ -263,7 +263,7 @@ mod tests { total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { let mut left_bound = if MAX_TX_ERGS_LIMIT < total_gas_limit { total_gas_limit - MAX_TX_ERGS_LIMIT @@ -281,7 +281,7 @@ mod tests { total_gas_limit - suggested_overhead, gas_per_pubdata_byte_limit, encoded_len, - coeficients, + coefficients, ); derived_overhead >= suggested_overhead @@ -310,40 +310,40 @@ mod tests { let test_params = |total_gas_limit: u32, gas_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients| { + coefficients: OverheadCoefficients| { let result_by_efficient_search = - get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coeficients); + get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coefficients); let result_by_binary_search = get_maximal_allowed_overhead_bin_search( total_gas_limit, gas_per_pubdata, encoded_len, - coeficients, + coefficients, ); assert_eq!(result_by_efficient_search, result_by_binary_search); }; // Some arbitrary test - test_params(60_000_000, 800, 2900, OverheadCoeficients::new_l2()); + test_params(60_000_000, 800, 2900, OverheadCoefficients::new_l2()); // Very small parameters - test_params(0, 1, 12, OverheadCoeficients::new_l2()); + test_params(0, 1, 12, OverheadCoefficients::new_l2()); // Relatively big parameters let max_tx_overhead = derive_overhead( MAX_TX_ERGS_LIMIT, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); test_params( MAX_TX_ERGS_LIMIT + max_tx_overhead, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); - test_params(115432560, 800, 2900, OverheadCoeficients::new_l1()); + test_params(115432560, 800, 2900, OverheadCoefficients::new_l1()); } } diff --git a/core/lib/multivm/src/versions/vm_latest/vm.rs b/core/lib/multivm/src/versions/vm_latest/vm.rs index e63b6438dc9d..20d74e39093f 100644 --- a/core/lib/multivm/src/versions/vm_latest/vm.rs +++ b/core/lib/multivm/src/versions/vm_latest/vm.rs @@ -138,7 +138,7 @@ impl VmInterface for Vm { } } -/// Methods of vm, which required some history manipullations +/// Methods of vm, which required some history manipulations impl VmInterfaceHistoryEnabled for Vm { /// Create snapshot of current vm state and push it into the memory fn make_snapshot(&mut self) { diff --git a/core/lib/multivm/src/versions/vm_m5/bootloader_state.rs b/core/lib/multivm/src/versions/vm_m5/bootloader_state.rs index 518d999b6ea5..4bb51c7a8395 100644 --- a/core/lib/multivm/src/versions/vm_m5/bootloader_state.rs +++ b/core/lib/multivm/src/versions/vm_m5/bootloader_state.rs @@ -5,7 +5,7 @@ use crate::vm_m5::vm_with_bootloader::TX_DESCRIPTION_OFFSET; /// Required to process transactions one by one (since we intercept the VM execution to execute /// transactions and add new ones to the memory on the fly). /// Think about it like a two-pointer scheme: one pointer (`free_tx_index`) tracks the end of the -/// initialized memory; while another (`tx_to_execute`) tracks our progess in this initialized memory. +/// initialized memory; while another (`tx_to_execute`) tracks our progress in this initialized memory. /// This is required since it's possible to push several transactions to the bootloader memory and then /// execute it one by one. /// diff --git a/core/lib/multivm/src/versions/vm_m5/errors/vm_revert_reason.rs b/core/lib/multivm/src/versions/vm_m5/errors/vm_revert_reason.rs index 1997336c3a4e..5d1a075f6a53 100644 --- a/core/lib/multivm/src/versions/vm_m5/errors/vm_revert_reason.rs +++ b/core/lib/multivm/src/versions/vm_m5/errors/vm_revert_reason.rs @@ -15,7 +15,7 @@ pub enum VmRevertReasonParsingError { IncorrectStringLength(Vec), } -/// Rich Revert Reasons https://github.com/0xProject/ZEIPs/issues/32 +/// Rich Revert Reasons `https://github.com/0xProject/ZEIPs/issues/32` #[derive(Debug, Clone, PartialEq)] pub enum VmRevertReason { General { diff --git a/core/lib/multivm/src/versions/vm_m5/oracles/tracer.rs b/core/lib/multivm/src/versions/vm_m5/oracles/tracer.rs index d8a70bdaf644..96ba04e85aa5 100644 --- a/core/lib/multivm/src/versions/vm_m5/oracles/tracer.rs +++ b/core/lib/multivm/src/versions/vm_m5/oracles/tracer.rs @@ -651,7 +651,7 @@ impl OneTxTracer { } } -/// Tells the VM to end the execution before `ret` from the booloader if there is no panic or revert. +/// Tells the VM to end the execution before `ret` from the bootloader if there is no panic or revert. /// Also, saves the information if this `ret` was caused by "out of gas" panic. #[derive(Debug, Clone, Default)] pub struct BootloaderTracer { @@ -816,7 +816,7 @@ fn get_debug_log(state: &VmLocalStateData<'_>, memory: &SimpleMemory) -> String } /// Reads the memory slice represented by the fat pointer. -/// Note, that the fat pointer must point to the accesible memory (i.e. not cleared up yet). +/// Note, that the fat pointer must point to the accessible memory (i.e. not cleared up yet). pub(crate) fn read_pointer(memory: &SimpleMemory, pointer: FatPointer) -> Vec { let FatPointer { offset, diff --git a/core/lib/multivm/src/versions/vm_m5/test_utils.rs b/core/lib/multivm/src/versions/vm_m5/test_utils.rs index 590579be6d8a..36c1d60dfdac 100644 --- a/core/lib/multivm/src/versions/vm_m5/test_utils.rs +++ b/core/lib/multivm/src/versions/vm_m5/test_utils.rs @@ -58,7 +58,7 @@ impl PartialEq for ModifiedKeysMap { #[derive(Clone, PartialEq, Debug)] pub struct DecommitterTestInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub modified_storage_keys: ModifiedKeysMap, pub known_bytecodes: HistoryRecorder>>, @@ -67,7 +67,7 @@ pub struct DecommitterTestInnerState { #[derive(Clone, PartialEq, Debug)] pub struct StorageOracleInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub modified_storage_keys: ModifiedKeysMap, diff --git a/core/lib/multivm/src/versions/vm_m5/vm_instance.rs b/core/lib/multivm/src/versions/vm_m5/vm_instance.rs index 1df40c8a0b86..e92305003c72 100644 --- a/core/lib/multivm/src/versions/vm_m5/vm_instance.rs +++ b/core/lib/multivm/src/versions/vm_m5/vm_instance.rs @@ -108,7 +108,7 @@ pub struct VmExecutionResult { /// available to VM before and after execution. /// /// It means, that depending on the context, `gas_used` may represent different things. - /// If VM is continously invoked and interrupted after each tx, this field may represent the + /// If VM is continuously invoked and interrupted after each tx, this field may represent the /// amount of gas spent by a single transaction. /// /// To understand, which value does `gas_used` represent, see the documentation for the method diff --git a/core/lib/multivm/src/versions/vm_m6/bootloader_state.rs b/core/lib/multivm/src/versions/vm_m6/bootloader_state.rs index 5dce7e1c6a96..1328d0dd7017 100644 --- a/core/lib/multivm/src/versions/vm_m6/bootloader_state.rs +++ b/core/lib/multivm/src/versions/vm_m6/bootloader_state.rs @@ -5,7 +5,7 @@ use crate::vm_m6::vm_with_bootloader::TX_DESCRIPTION_OFFSET; /// Required to process transactions one by one (since we intercept the VM execution to execute /// transactions and add new ones to the memory on the fly). /// Think about it like a two-pointer scheme: one pointer (`free_tx_index`) tracks the end of the -/// initialized memory; while another (`tx_to_execute`) tracks our progess in this initialized memory. +/// initialized memory; while another (`tx_to_execute`) tracks our progress in this initialized memory. /// This is required since it's possible to push several transactions to the bootloader memory and then /// execute it one by one. /// diff --git a/core/lib/multivm/src/versions/vm_m6/errors/vm_revert_reason.rs b/core/lib/multivm/src/versions/vm_m6/errors/vm_revert_reason.rs index d954f0779535..9025ee9f3781 100644 --- a/core/lib/multivm/src/versions/vm_m6/errors/vm_revert_reason.rs +++ b/core/lib/multivm/src/versions/vm_m6/errors/vm_revert_reason.rs @@ -15,7 +15,7 @@ pub enum VmRevertReasonParsingError { IncorrectStringLength(Vec), } -/// Rich Revert Reasons https://github.com/0xProject/ZEIPs/issues/32 +/// Rich Revert Reasons `https://github.com/0xProject/ZEIPs/issues/32` #[derive(Debug, Clone, PartialEq)] pub enum VmRevertReason { General { diff --git a/core/lib/multivm/src/versions/vm_m6/oracle_tools.rs b/core/lib/multivm/src/versions/vm_m6/oracle_tools.rs index 6650752da27b..4acc2fe68e57 100644 --- a/core/lib/multivm/src/versions/vm_m6/oracle_tools.rs +++ b/core/lib/multivm/src/versions/vm_m6/oracle_tools.rs @@ -13,7 +13,7 @@ use zk_evm_1_3_1::witness_trace::DummyTracer; /// zkEVM requires a bunch of objects implementing given traits to work. /// For example: Storage, Memory, PrecompilerProcessor etc -/// (you can find all these traites in zk_evm crate -> src/abstractions/mod.rs) +/// (you can find all these traits in zk_evm crate -> src/abstractions/mod.rs) /// For each of these traits, we have a local implementation (for example StorageOracle) /// that also support additional features (like rollbacks & history). /// The OracleTools struct, holds all these things together in one place. diff --git a/core/lib/multivm/src/versions/vm_m6/oracles/decommitter.rs b/core/lib/multivm/src/versions/vm_m6/oracles/decommitter.rs index 3917063422aa..48948827c3dd 100644 --- a/core/lib/multivm/src/versions/vm_m6/oracles/decommitter.rs +++ b/core/lib/multivm/src/versions/vm_m6/oracles/decommitter.rs @@ -66,7 +66,7 @@ impl DecommitterOracle { } } - /// Adds additional bytecodes. They will take precendent over the bytecodes from storage. + /// Adds additional bytecodes. They will take precedent over the bytecodes from storage. pub fn populate(&mut self, bytecodes: Vec<(U256, Vec)>, timestamp: Timestamp) { for (hash, bytecode) in bytecodes { self.known_bytecodes.insert(hash, bytecode, timestamp); @@ -170,7 +170,7 @@ impl DecommittmentProcessor ) -> (DecommittmentQuery, Option>) { self.decommitment_requests.push((), partial_query.timestamp); // First - check if we didn't fetch this bytecode in the past. - // If we did - we can just return the page that we used before (as the memory is read only). + // If we did - we can just return the page that we used before (as the memory is readonly). if let Some(memory_page) = self .decommitted_code_hashes .inner() diff --git a/core/lib/multivm/src/versions/vm_m6/oracles/tracer/bootloader.rs b/core/lib/multivm/src/versions/vm_m6/oracles/tracer/bootloader.rs index fc2a62374dbf..81902f330a55 100644 --- a/core/lib/multivm/src/versions/vm_m6/oracles/tracer/bootloader.rs +++ b/core/lib/multivm/src/versions/vm_m6/oracles/tracer/bootloader.rs @@ -16,7 +16,7 @@ use zk_evm_1_3_1::{ zkevm_opcode_defs::{Opcode, RetOpcode}, }; -/// Tells the VM to end the execution before `ret` from the booloader if there is no panic or revert. +/// Tells the VM to end the execution before `ret` from the bootloader if there is no panic or revert. /// Also, saves the information if this `ret` was caused by "out of gas" panic. #[derive(Debug, Clone, Default)] pub struct BootloaderTracer { diff --git a/core/lib/multivm/src/versions/vm_m6/oracles/tracer/call.rs b/core/lib/multivm/src/versions/vm_m6/oracles/tracer/call.rs index 4b61c9fcc15a..f2ddd2762adb 100644 --- a/core/lib/multivm/src/versions/vm_m6/oracles/tracer/call.rs +++ b/core/lib/multivm/src/versions/vm_m6/oracles/tracer/call.rs @@ -95,7 +95,7 @@ impl Tracer for CallTracer { } impl CallTracer { - /// We use parent gas for propery calculation of gas used in the trace. + /// We use parent gas for property calculation of gas used in the trace. /// This method updates parent gas for the current call. fn update_parent_gas(&mut self, state: &VmLocalStateData<'_>, current_call: &mut Call) { let current = state.vm_local_state.callstack.current; diff --git a/core/lib/multivm/src/versions/vm_m6/oracles/tracer/utils.rs b/core/lib/multivm/src/versions/vm_m6/oracles/tracer/utils.rs index e2f1652e9b76..87aa81d69db5 100644 --- a/core/lib/multivm/src/versions/vm_m6/oracles/tracer/utils.rs +++ b/core/lib/multivm/src/versions/vm_m6/oracles/tracer/utils.rs @@ -99,7 +99,7 @@ pub(crate) fn get_debug_log( } /// Reads the memory slice represented by the fat pointer. -/// Note, that the fat pointer must point to the accesible memory (i.e. not cleared up yet). +/// Note, that the fat pointer must point to the accessible memory (i.e. not cleared up yet). pub(crate) fn read_pointer( memory: &SimpleMemory, pointer: FatPointer, diff --git a/core/lib/multivm/src/versions/vm_m6/test_utils.rs b/core/lib/multivm/src/versions/vm_m6/test_utils.rs index 8b022c008a78..6cce779362da 100644 --- a/core/lib/multivm/src/versions/vm_m6/test_utils.rs +++ b/core/lib/multivm/src/versions/vm_m6/test_utils.rs @@ -58,7 +58,7 @@ impl PartialEq for ModifiedKeysMap { #[derive(Clone, PartialEq, Debug)] pub struct DecommitterTestInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub modified_storage_keys: ModifiedKeysMap, pub known_bytecodes: HistoryRecorder>, H>, @@ -67,7 +67,7 @@ pub struct DecommitterTestInnerState { #[derive(Clone, PartialEq, Debug)] pub struct StorageOracleInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub modified_storage_keys: ModifiedKeysMap, diff --git a/core/lib/multivm/src/versions/vm_m6/transaction_data.rs b/core/lib/multivm/src/versions/vm_m6/transaction_data.rs index f41afee3a40f..bdecb9bf4547 100644 --- a/core/lib/multivm/src/versions/vm_m6/transaction_data.rs +++ b/core/lib/multivm/src/versions/vm_m6/transaction_data.rs @@ -213,12 +213,12 @@ impl TransactionData { self.reserved_dynamic.len() as u64, ); - let coeficients = OverheadCoeficients::from_tx_type(self.tx_type); + let coefficients = OverheadCoefficients::from_tx_type(self.tx_type); get_amortized_overhead( total_gas_limit, gas_price_per_pubdata, encoded_len, - coeficients, + coefficients, ) } @@ -232,7 +232,7 @@ pub fn derive_overhead( gas_limit: u32, gas_price_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Even if the gas limit is greater than the MAX_TX_ERGS_LIMIT, we assume that everything beyond MAX_TX_ERGS_LIMIT // will be spent entirely on publishing bytecodes and so we derive the overhead solely based on the capped value @@ -269,31 +269,31 @@ pub fn derive_overhead( // ); vec![ - (coeficients.ergs_limit_overhead_coeficient + (coefficients.ergs_limit_overhead_coeficient * overhead_for_single_instance_circuits.as_u32() as f64) .floor() as u32, - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) .floor() as u32, - (coeficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, + (coefficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, ] .into_iter() .max() .unwrap() } -/// Contains the coeficients with which the overhead for transactions will be calculated. -/// All of the coeficients should be <= 1. There are here to provide a certain "discount" for normal transactions +/// Contains the coefficients with which the overhead for transactions will be calculated. +/// All of the coefficients should be <= 1. There are here to provide a certain "discount" for normal transactions /// at the risk of malicious transactions that may close the block prematurely. -/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coeficients.ergs_limit_overhead_coeficient` MUST +/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coefficients.ergs_limit_overhead_coeficient` MUST /// result in an integer number #[derive(Debug, Clone, Copy)] -pub struct OverheadCoeficients { +pub struct OverheadCoefficients { slot_overhead_coeficient: f64, bootloader_memory_overhead_coeficient: f64, ergs_limit_overhead_coeficient: f64, } -impl OverheadCoeficients { +impl OverheadCoefficients { // This method ensures that the parameters keep the required invariants fn new_checked( slot_overhead_coeficient: f64, @@ -315,11 +315,11 @@ impl OverheadCoeficients { // L1->L2 do not receive any discounts fn new_l1() -> Self { - OverheadCoeficients::new_checked(1.0, 1.0, 1.0) + OverheadCoefficients::new_checked(1.0, 1.0, 1.0) } fn new_l2() -> Self { - OverheadCoeficients::new_checked( + OverheadCoefficients::new_checked( 1.0, 1.0, // For L2 transactions we allow a certain default discount with regard to the number of ergs. // Multiinstance circuits can in theory be spawned infinite times, while projected future limitations @@ -343,7 +343,7 @@ pub fn get_amortized_overhead( total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Using large U256 type to prevent overflows. let overhead_for_block_gas = U256::from(block_overhead_gas(gas_per_pubdata_byte_limit)); @@ -380,7 +380,7 @@ pub fn get_amortized_overhead( let tx_slot_overhead = { let tx_slot_overhead = ceil_div_u256(overhead_for_block_gas, MAX_TXS_IN_BLOCK.into()).as_u32(); - (coeficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 + (coefficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 }; // 2. The overhead for occupying the bootloader memory can be derived from encoded_len @@ -391,7 +391,7 @@ pub fn get_amortized_overhead( ) .as_u32(); - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() as u32 }; @@ -436,7 +436,7 @@ pub fn get_amortized_overhead( let overhead_for_gas = { let numerator = overhead_for_block_gas * total_gas_limit + U256::from(MAX_TX_ERGS_LIMIT); let denominator: U256 = U256::from( - (MAX_TX_ERGS_LIMIT as f64 / coeficients.ergs_limit_overhead_coeficient) as u64, + (MAX_TX_ERGS_LIMIT as f64 / coefficients.ergs_limit_overhead_coeficient) as u64, ) + overhead_for_block_gas; let overhead_for_gas = (numerator - 1) / denominator; @@ -461,7 +461,7 @@ pub fn get_amortized_overhead( MAX_L2_TX_GAS_LIMIT as u32, gas_per_pubdata_byte_limit, encoded_len.as_usize(), - coeficients, + coefficients, ) } else { overhead @@ -484,7 +484,7 @@ mod tests { total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { let mut left_bound = if MAX_TX_ERGS_LIMIT < total_gas_limit { total_gas_limit - MAX_TX_ERGS_LIMIT @@ -502,7 +502,7 @@ mod tests { total_gas_limit - suggested_overhead, gas_per_pubdata_byte_limit, encoded_len, - coeficients, + coefficients, ); derived_overhead >= suggested_overhead @@ -531,41 +531,41 @@ mod tests { let test_params = |total_gas_limit: u32, gas_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients| { + coefficients: OverheadCoefficients| { let result_by_efficient_search = - get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coeficients); + get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coefficients); let result_by_binary_search = get_maximal_allowed_overhead_bin_search( total_gas_limit, gas_per_pubdata, encoded_len, - coeficients, + coefficients, ); assert_eq!(result_by_efficient_search, result_by_binary_search); }; // Some arbitrary test - test_params(60_000_000, 800, 2900, OverheadCoeficients::new_l2()); + test_params(60_000_000, 800, 2900, OverheadCoefficients::new_l2()); // Very small parameters - test_params(0, 1, 12, OverheadCoeficients::new_l2()); + test_params(0, 1, 12, OverheadCoefficients::new_l2()); // Relatively big parameters let max_tx_overhead = derive_overhead( MAX_TX_ERGS_LIMIT, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); test_params( MAX_TX_ERGS_LIMIT + max_tx_overhead, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); - test_params(115432560, 800, 2900, OverheadCoeficients::new_l1()); + test_params(115432560, 800, 2900, OverheadCoefficients::new_l1()); } #[test] diff --git a/core/lib/multivm/src/versions/vm_m6/vm_instance.rs b/core/lib/multivm/src/versions/vm_m6/vm_instance.rs index cfb5bac806d9..468dd3fc72da 100644 --- a/core/lib/multivm/src/versions/vm_m6/vm_instance.rs +++ b/core/lib/multivm/src/versions/vm_m6/vm_instance.rs @@ -383,7 +383,7 @@ impl VmInstance { } } - /// Removes the latest snapshot without rollbacking to it. + /// Removes the latest snapshot without rolling back to it. /// This function expects that there is at least one snapshot present. pub fn pop_snapshot_no_rollback(&mut self) { self.snapshots.pop().unwrap(); diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/snapshot.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/snapshot.rs index e417a3b9ee69..2c5990928699 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/snapshot.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/snapshot.rs @@ -4,9 +4,9 @@ use zksync_types::H256; pub(crate) struct BootloaderStateSnapshot { /// ID of the next transaction to be executed. pub(crate) tx_to_execute: usize, - /// Stored l2 blocks in bootloader memory + /// Stored L2 blocks in bootloader memory pub(crate) l2_blocks_len: usize, - /// Snapshot of the last l2 block. Only this block could be changed during the rollback + /// Snapshot of the last L2 block. Only this block could be changed during the rollback pub(crate) last_l2_block: L2BlockSnapshot, /// The number of 32-byte words spent on the already included compressed bytecodes. pub(crate) compressed_bytecodes_encoding: usize, @@ -18,6 +18,6 @@ pub(crate) struct BootloaderStateSnapshot { pub(crate) struct L2BlockSnapshot { /// The rolling hash of all the transactions in the miniblock pub(crate) txs_rolling_hash: H256, - /// The number of transactions in the last l2 block + /// The number of transactions in the last L2 block pub(crate) txs_len: usize, } diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/tx.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/tx.rs index c1551dcf6cd4..3bd10e9374b0 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/tx.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/bootloader_state/tx.rs @@ -14,7 +14,7 @@ pub(super) struct BootloaderTx { pub(super) refund: u32, /// Gas overhead pub(super) gas_overhead: u32, - /// Gas Limit for this transaction. It can be different from the gaslimit inside the transaction + /// Gas Limit for this transaction. It can be different from the gas limit inside the transaction pub(super) trusted_gas_limit: U256, /// Offset of the tx in bootloader memory pub(super) offset: usize, diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/constants.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/constants.rs index ef3b09299fd5..0dca7a6ce265 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/constants.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/constants.rs @@ -75,10 +75,10 @@ pub const BLOCK_OVERHEAD_L1_GAS: u32 = 1000000; pub const BLOCK_OVERHEAD_PUBDATA: u32 = BLOCK_OVERHEAD_L1_GAS / L1_GAS_PER_PUBDATA_BYTE; /// VM Hooks are used for communication between bootloader and tracers. -/// The 'type'/'opcode' is put into VM_HOOK_POSITION slot, +/// The 'type' / 'opcode' is put into VM_HOOK_POSITION slot, /// and VM_HOOKS_PARAMS_COUNT parameters (each 32 bytes) are put in the slots before. /// So the layout looks like this: -/// [param 0][param 1][vmhook opcode] +/// `[param 0][param 1][vmhook opcode]` pub const VM_HOOK_POSITION: u32 = RESULT_SUCCESS_FIRST_SLOT - 1; pub const VM_HOOK_PARAMS_COUNT: u32 = 2; pub const VM_HOOK_PARAMS_START_POSITION: u32 = VM_HOOK_POSITION - VM_HOOK_PARAMS_COUNT; diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs index 48bbd64ecf2e..a49ce2a67464 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/implementation/statistics.rs @@ -43,7 +43,7 @@ impl Vm { } } - /// Returns the hashes the bytecodes that have been decommitted by the decomittment processor. + /// Returns the hashes the bytecodes that have been decommitted by the decommitment processor. pub(crate) fn get_used_contracts(&self) -> Vec { self.state .decommittment_processor diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/old_vm/oracles/decommitter.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/old_vm/oracles/decommitter.rs index 0f335cabf398..a39be0ba93b9 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/old_vm/oracles/decommitter.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/old_vm/oracles/decommitter.rs @@ -70,7 +70,7 @@ impl DecommitterOracle { } } - /// Adds additional bytecodes. They will take precendent over the bytecodes from storage. + /// Adds additional bytecodes. They will take precedent over the bytecodes from storage. pub fn populate(&mut self, bytecodes: Vec<(U256, Vec)>, timestamp: Timestamp) { for (hash, bytecode) in bytecodes { self.known_bytecodes.insert(hash, bytecode, timestamp); @@ -180,7 +180,7 @@ impl DecommittmentProcess > { self.decommitment_requests.push((), partial_query.timestamp); // First - check if we didn't fetch this bytecode in the past. - // If we did - we can just return the page that we used before (as the memory is read only). + // If we did - we can just return the page that we used before (as the memory is readonly). if let Some(memory_page) = self .decommitted_code_hashes .inner() diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/tests/tester/inner_state.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/tests/tester/inner_state.rs index c4c6ec05bd7f..5af50ee0d91f 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/tests/tester/inner_state.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/tests/tester/inner_state.rs @@ -35,7 +35,7 @@ impl PartialEq for ModifiedKeysMap { #[derive(Clone, PartialEq, Debug)] pub(crate) struct DecommitterTestInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub(crate) modified_storage_keys: ModifiedKeysMap, pub(crate) known_bytecodes: HistoryRecorder>, H>, @@ -44,7 +44,7 @@ pub(crate) struct DecommitterTestInnerState { #[derive(Clone, PartialEq, Debug)] pub(crate) struct StorageOracleInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub(crate) modified_storage_keys: ModifiedKeysMap, diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/tracers/utils.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/tracers/utils.rs index 654c7300e4ad..a9170c5a442a 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/tracers/utils.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/tracers/utils.rs @@ -109,7 +109,7 @@ pub(crate) fn get_debug_log( } /// Reads the memory slice represented by the fat pointer. -/// Note, that the fat pointer must point to the accesible memory (i.e. not cleared up yet). +/// Note, that the fat pointer must point to the accessible memory (i.e. not cleared up yet). pub(crate) fn read_pointer( memory: &SimpleMemory, pointer: FatPointer, diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/transaction_data.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/transaction_data.rs index 1b589146a298..1ad2ce0f9774 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/transaction_data.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/types/internals/transaction_data.rs @@ -11,7 +11,9 @@ use zksync_types::{ use zksync_utils::address_to_h256; use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256}; -use crate::vm_refunds_enhancement::utils::overhead::{get_amortized_overhead, OverheadCoeficients}; +use crate::vm_refunds_enhancement::utils::overhead::{ + get_amortized_overhead, OverheadCoefficients, +}; /// This structure represents the data that is used by /// the Bootloader to describe the transaction. @@ -212,12 +214,12 @@ impl TransactionData { self.reserved_dynamic.len() as u64, ); - let coeficients = OverheadCoeficients::from_tx_type(self.tx_type); + let coefficients = OverheadCoefficients::from_tx_type(self.tx_type); get_amortized_overhead( total_gas_limit, gas_price_per_pubdata, encoded_len, - coeficients, + coefficients, ) } diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/utils/fee.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/utils/fee.rs index 02ea1c4a5618..cc6081d7a229 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/utils/fee.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/utils/fee.rs @@ -4,7 +4,7 @@ use zksync_utils::ceil_div; use crate::vm_refunds_enhancement::old_vm::utils::eth_price_per_pubdata_byte; -/// Calcluates the amount of gas required to publish one byte of pubdata +/// Calculates the amount of gas required to publish one byte of pubdata pub fn base_fee_to_gas_per_pubdata(l1_gas_price: u64, base_fee: u64) -> u64 { let eth_price_per_pubdata_byte = eth_price_per_pubdata_byte(l1_gas_price); diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/utils/overhead.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/utils/overhead.rs index 671ff0e05722..cce2f2914e33 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/utils/overhead.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/utils/overhead.rs @@ -12,7 +12,7 @@ pub fn derive_overhead( gas_limit: u32, gas_price_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Even if the gas limit is greater than the MAX_TX_ERGS_LIMIT, we assume that everything beyond MAX_TX_ERGS_LIMIT // will be spent entirely on publishing bytecodes and so we derive the overhead solely based on the capped value @@ -49,31 +49,31 @@ pub fn derive_overhead( // ); vec![ - (coeficients.ergs_limit_overhead_coeficient + (coefficients.ergs_limit_overhead_coeficient * overhead_for_single_instance_circuits.as_u32() as f64) .floor() as u32, - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) .floor() as u32, - (coeficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, + (coefficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, ] .into_iter() .max() .unwrap() } -/// Contains the coeficients with which the overhead for transactions will be calculated. -/// All of the coeficients should be <= 1. There are here to provide a certain "discount" for normal transactions +/// Contains the coefficients with which the overhead for transactions will be calculated. +/// All of the coefficients should be <= 1. There are here to provide a certain "discount" for normal transactions /// at the risk of malicious transactions that may close the block prematurely. -/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coeficients.ergs_limit_overhead_coeficient` MUST +/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coefficients.ergs_limit_overhead_coeficient` MUST /// result in an integer number #[derive(Debug, Clone, Copy)] -pub struct OverheadCoeficients { +pub struct OverheadCoefficients { slot_overhead_coeficient: f64, bootloader_memory_overhead_coeficient: f64, ergs_limit_overhead_coeficient: f64, } -impl OverheadCoeficients { +impl OverheadCoefficients { // This method ensures that the parameters keep the required invariants fn new_checked( slot_overhead_coeficient: f64, @@ -95,11 +95,11 @@ impl OverheadCoeficients { // L1->L2 do not receive any discounts fn new_l1() -> Self { - OverheadCoeficients::new_checked(1.0, 1.0, 1.0) + OverheadCoefficients::new_checked(1.0, 1.0, 1.0) } fn new_l2() -> Self { - OverheadCoeficients::new_checked( + OverheadCoefficients::new_checked( 1.0, 1.0, // For L2 transactions we allow a certain default discount with regard to the number of ergs. // Multiinstance circuits can in theory be spawned infinite times, while projected future limitations @@ -109,7 +109,7 @@ impl OverheadCoeficients { ) } - /// Return the coeficients for the given transaction type + /// Return the coefficients for the given transaction type pub fn from_tx_type(tx_type: u8) -> Self { if is_l1_tx_type(tx_type) { Self::new_l1() @@ -124,7 +124,7 @@ pub(crate) fn get_amortized_overhead( total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Using large U256 type to prevent overflows. let overhead_for_block_gas = U256::from(block_overhead_gas(gas_per_pubdata_byte_limit)); @@ -161,7 +161,7 @@ pub(crate) fn get_amortized_overhead( let tx_slot_overhead = { let tx_slot_overhead = ceil_div_u256(overhead_for_block_gas, MAX_TXS_IN_BLOCK.into()).as_u32(); - (coeficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 + (coefficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 }; // 2. The overhead for occupying the bootloader memory can be derived from encoded_len @@ -172,7 +172,7 @@ pub(crate) fn get_amortized_overhead( ) .as_u32(); - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() as u32 }; @@ -217,7 +217,7 @@ pub(crate) fn get_amortized_overhead( let overhead_for_gas = { let numerator = overhead_for_block_gas * total_gas_limit + U256::from(MAX_TX_ERGS_LIMIT); let denominator: U256 = U256::from( - (MAX_TX_ERGS_LIMIT as f64 / coeficients.ergs_limit_overhead_coeficient) as u64, + (MAX_TX_ERGS_LIMIT as f64 / coefficients.ergs_limit_overhead_coeficient) as u64, ) + overhead_for_block_gas; let overhead_for_gas = (numerator - 1) / denominator; @@ -242,7 +242,7 @@ pub(crate) fn get_amortized_overhead( MAX_L2_TX_GAS_LIMIT as u32, gas_per_pubdata_byte_limit, encoded_len.as_usize(), - coeficients, + coefficients, ) } else { overhead @@ -263,7 +263,7 @@ mod tests { total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { let mut left_bound = if MAX_TX_ERGS_LIMIT < total_gas_limit { total_gas_limit - MAX_TX_ERGS_LIMIT @@ -281,7 +281,7 @@ mod tests { total_gas_limit - suggested_overhead, gas_per_pubdata_byte_limit, encoded_len, - coeficients, + coefficients, ); derived_overhead >= suggested_overhead @@ -310,40 +310,40 @@ mod tests { let test_params = |total_gas_limit: u32, gas_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients| { + coefficients: OverheadCoefficients| { let result_by_efficient_search = - get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coeficients); + get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coefficients); let result_by_binary_search = get_maximal_allowed_overhead_bin_search( total_gas_limit, gas_per_pubdata, encoded_len, - coeficients, + coefficients, ); assert_eq!(result_by_efficient_search, result_by_binary_search); }; // Some arbitrary test - test_params(60_000_000, 800, 2900, OverheadCoeficients::new_l2()); + test_params(60_000_000, 800, 2900, OverheadCoefficients::new_l2()); // Very small parameters - test_params(0, 1, 12, OverheadCoeficients::new_l2()); + test_params(0, 1, 12, OverheadCoefficients::new_l2()); // Relatively big parameters let max_tx_overhead = derive_overhead( MAX_TX_ERGS_LIMIT, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); test_params( MAX_TX_ERGS_LIMIT + max_tx_overhead, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); - test_params(115432560, 800, 2900, OverheadCoeficients::new_l1()); + test_params(115432560, 800, 2900, OverheadCoefficients::new_l1()); } } diff --git a/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs b/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs index 4056d709a9bb..11eea1206a81 100644 --- a/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs +++ b/core/lib/multivm/src/versions/vm_refunds_enhancement/vm.rs @@ -131,7 +131,7 @@ impl VmInterface for Vm { } } -/// Methods of vm, which required some history manipullations +/// Methods of vm, which required some history manipulations impl VmInterfaceHistoryEnabled for Vm { /// Create snapshot of current vm state and push it into the memory fn make_snapshot(&mut self) { diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/snapshot.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/snapshot.rs index e417a3b9ee69..2c5990928699 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/snapshot.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/snapshot.rs @@ -4,9 +4,9 @@ use zksync_types::H256; pub(crate) struct BootloaderStateSnapshot { /// ID of the next transaction to be executed. pub(crate) tx_to_execute: usize, - /// Stored l2 blocks in bootloader memory + /// Stored L2 blocks in bootloader memory pub(crate) l2_blocks_len: usize, - /// Snapshot of the last l2 block. Only this block could be changed during the rollback + /// Snapshot of the last L2 block. Only this block could be changed during the rollback pub(crate) last_l2_block: L2BlockSnapshot, /// The number of 32-byte words spent on the already included compressed bytecodes. pub(crate) compressed_bytecodes_encoding: usize, @@ -18,6 +18,6 @@ pub(crate) struct BootloaderStateSnapshot { pub(crate) struct L2BlockSnapshot { /// The rolling hash of all the transactions in the miniblock pub(crate) txs_rolling_hash: H256, - /// The number of transactions in the last l2 block + /// The number of transactions in the last L2 block pub(crate) txs_len: usize, } diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/tx.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/tx.rs index 73825312b5e1..3b53c918fda6 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/tx.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/bootloader_state/tx.rs @@ -14,7 +14,7 @@ pub(super) struct BootloaderTx { pub(super) refund: u32, /// Gas overhead pub(super) gas_overhead: u32, - /// Gas Limit for this transaction. It can be different from the gaslimit inside the transaction + /// Gas Limit for this transaction. It can be different from the gas limit inside the transaction pub(super) trusted_gas_limit: U256, /// Offset of the tx in bootloader memory pub(super) offset: usize, diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/constants.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/constants.rs index ed462581cb79..5535be903812 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/constants.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/constants.rs @@ -75,10 +75,10 @@ pub(crate) const BLOCK_OVERHEAD_L1_GAS: u32 = 1000000; pub const BLOCK_OVERHEAD_PUBDATA: u32 = BLOCK_OVERHEAD_L1_GAS / L1_GAS_PER_PUBDATA_BYTE; /// VM Hooks are used for communication between bootloader and tracers. -/// The 'type'/'opcode' is put into VM_HOOK_POSITION slot, +/// The 'type' / 'opcode' is put into VM_HOOK_POSITION slot, /// and VM_HOOKS_PARAMS_COUNT parameters (each 32 bytes) are put in the slots before. /// So the layout looks like this: -/// [param 0][param 1][vmhook opcode] +/// `[param 0][param 1][vmhook opcode]` pub const VM_HOOK_POSITION: u32 = RESULT_SUCCESS_FIRST_SLOT - 1; pub const VM_HOOK_PARAMS_COUNT: u32 = 2; pub const VM_HOOK_PARAMS_START_POSITION: u32 = VM_HOOK_POSITION - VM_HOOK_PARAMS_COUNT; diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs index 14570f154539..dd4a5ad55b21 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/implementation/statistics.rs @@ -43,7 +43,7 @@ impl Vm { } } - /// Returns the hashes the bytecodes that have been decommitted by the decomittment processor. + /// Returns the hashes the bytecodes that have been decommitted by the decommitment processor. pub(crate) fn get_used_contracts(&self) -> Vec { self.state .decommittment_processor diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/old_vm/oracles/decommitter.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/old_vm/oracles/decommitter.rs index 050b244736ff..12c3ffd403d0 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/old_vm/oracles/decommitter.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/old_vm/oracles/decommitter.rs @@ -70,7 +70,7 @@ impl DecommitterOracle { } } - /// Adds additional bytecodes. They will take precendent over the bytecodes from storage. + /// Adds additional bytecodes. They will take precedent over the bytecodes from storage. pub fn populate(&mut self, bytecodes: Vec<(U256, Vec)>, timestamp: Timestamp) { for (hash, bytecode) in bytecodes { self.known_bytecodes.insert(hash, bytecode, timestamp); @@ -180,7 +180,7 @@ impl DecommittmentProcess > { self.decommitment_requests.push((), partial_query.timestamp); // First - check if we didn't fetch this bytecode in the past. - // If we did - we can just return the page that we used before (as the memory is read only). + // If we did - we can just return the page that we used before (as the memory is readonly). if let Some(memory_page) = self .decommitted_code_hashes .inner() diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/tests/tester/inner_state.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/tests/tester/inner_state.rs index 8105ca244d34..83ad0b9044b5 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/tests/tester/inner_state.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/tests/tester/inner_state.rs @@ -36,7 +36,7 @@ impl PartialEq for ModifiedKeysMap { #[derive(Clone, PartialEq, Debug)] pub(crate) struct DecommitterTestInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub(crate) modified_storage_keys: ModifiedKeysMap, pub(crate) known_bytecodes: HistoryRecorder>, H>, @@ -45,7 +45,7 @@ pub(crate) struct DecommitterTestInnerState { #[derive(Clone, PartialEq, Debug)] pub(crate) struct StorageOracleInnerState { - /// There is no way to "trully" compare the storage pointer, + /// There is no way to "truly" compare the storage pointer, /// so we just compare the modified keys. This is reasonable enough. pub(crate) modified_storage_keys: ModifiedKeysMap, diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/utils.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/utils.rs index abf8714bbe9a..0b6c7ebcfa8a 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/utils.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/tracers/utils.rs @@ -106,7 +106,7 @@ pub(crate) fn get_debug_log( } /// Reads the memory slice represented by the fat pointer. -/// Note, that the fat pointer must point to the accesible memory (i.e. not cleared up yet). +/// Note, that the fat pointer must point to the accessible memory (i.e. not cleared up yet). pub(crate) fn read_pointer( memory: &SimpleMemory, pointer: FatPointer, diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/transaction_data.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/transaction_data.rs index 55f942d99283..add3d829d800 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/transaction_data.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/types/internals/transaction_data.rs @@ -11,7 +11,7 @@ use zksync_types::{ use zksync_utils::address_to_h256; use zksync_utils::{bytecode::hash_bytecode, bytes_to_be_words, h256_to_u256}; -use crate::vm_virtual_blocks::utils::overhead::{get_amortized_overhead, OverheadCoeficients}; +use crate::vm_virtual_blocks::utils::overhead::{get_amortized_overhead, OverheadCoefficients}; /// This structure represents the data that is used by /// the Bootloader to describe the transaction. @@ -212,12 +212,12 @@ impl TransactionData { self.reserved_dynamic.len() as u64, ); - let coeficients = OverheadCoeficients::from_tx_type(self.tx_type); + let coefficients = OverheadCoefficients::from_tx_type(self.tx_type); get_amortized_overhead( total_gas_limit, gas_price_per_pubdata, encoded_len, - coeficients, + coefficients, ) } diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/utils/fee.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/utils/fee.rs index d4808e91bf4f..6753e8197813 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/utils/fee.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/utils/fee.rs @@ -4,7 +4,7 @@ use zksync_utils::ceil_div; use crate::vm_virtual_blocks::old_vm::utils::eth_price_per_pubdata_byte; -/// Calcluates the amount of gas required to publish one byte of pubdata +/// Calculates the amount of gas required to publish one byte of pubdata pub fn base_fee_to_gas_per_pubdata(l1_gas_price: u64, base_fee: u64) -> u64 { let eth_price_per_pubdata_byte = eth_price_per_pubdata_byte(l1_gas_price); diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/utils/overhead.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/utils/overhead.rs index 85446534a2ec..59b54888ee18 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/utils/overhead.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/utils/overhead.rs @@ -12,7 +12,7 @@ pub fn derive_overhead( gas_limit: u32, gas_price_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Even if the gas limit is greater than the MAX_TX_ERGS_LIMIT, we assume that everything beyond MAX_TX_ERGS_LIMIT // will be spent entirely on publishing bytecodes and so we derive the overhead solely based on the capped value @@ -49,31 +49,31 @@ pub fn derive_overhead( // ); vec![ - (coeficients.ergs_limit_overhead_coeficient + (coefficients.ergs_limit_overhead_coeficient * overhead_for_single_instance_circuits.as_u32() as f64) .floor() as u32, - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64) .floor() as u32, - (coeficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, + (coefficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32, ] .into_iter() .max() .unwrap() } -/// Contains the coeficients with which the overhead for transactions will be calculated. -/// All of the coeficients should be <= 1. There are here to provide a certain "discount" for normal transactions +/// Contains the coefficients with which the overhead for transactions will be calculated. +/// All of the coefficients should be <= 1. There are here to provide a certain "discount" for normal transactions /// at the risk of malicious transactions that may close the block prematurely. -/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coeficients.ergs_limit_overhead_coeficient` MUST +/// IMPORTANT: to perform correct computations, `MAX_TX_ERGS_LIMIT / coefficients.ergs_limit_overhead_coeficient` MUST /// result in an integer number #[derive(Debug, Clone, Copy)] -pub struct OverheadCoeficients { +pub struct OverheadCoefficients { slot_overhead_coeficient: f64, bootloader_memory_overhead_coeficient: f64, ergs_limit_overhead_coeficient: f64, } -impl OverheadCoeficients { +impl OverheadCoefficients { // This method ensures that the parameters keep the required invariants fn new_checked( slot_overhead_coeficient: f64, @@ -95,11 +95,11 @@ impl OverheadCoeficients { // L1->L2 do not receive any discounts fn new_l1() -> Self { - OverheadCoeficients::new_checked(1.0, 1.0, 1.0) + OverheadCoefficients::new_checked(1.0, 1.0, 1.0) } fn new_l2() -> Self { - OverheadCoeficients::new_checked( + OverheadCoefficients::new_checked( 1.0, 1.0, // For L2 transactions we allow a certain default discount with regard to the number of ergs. // Multiinstance circuits can in theory be spawned infinite times, while projected future limitations @@ -109,7 +109,7 @@ impl OverheadCoeficients { ) } - /// Return the coeficients for the given transaction type + /// Return the coefficients for the given transaction type pub fn from_tx_type(tx_type: u8) -> Self { if is_l1_tx_type(tx_type) { Self::new_l1() @@ -124,7 +124,7 @@ pub(crate) fn get_amortized_overhead( total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { // Using large U256 type to prevent overflows. let overhead_for_block_gas = U256::from(block_overhead_gas(gas_per_pubdata_byte_limit)); @@ -161,7 +161,7 @@ pub(crate) fn get_amortized_overhead( let tx_slot_overhead = { let tx_slot_overhead = ceil_div_u256(overhead_for_block_gas, MAX_TXS_IN_BLOCK.into()).as_u32(); - (coeficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 + (coefficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32 }; // 2. The overhead for occupying the bootloader memory can be derived from encoded_len @@ -172,7 +172,7 @@ pub(crate) fn get_amortized_overhead( ) .as_u32(); - (coeficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() + (coefficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor() as u32 }; @@ -217,7 +217,7 @@ pub(crate) fn get_amortized_overhead( let overhead_for_gas = { let numerator = overhead_for_block_gas * total_gas_limit + U256::from(MAX_TX_ERGS_LIMIT); let denominator: U256 = U256::from( - (MAX_TX_ERGS_LIMIT as f64 / coeficients.ergs_limit_overhead_coeficient) as u64, + (MAX_TX_ERGS_LIMIT as f64 / coefficients.ergs_limit_overhead_coeficient) as u64, ) + overhead_for_block_gas; let overhead_for_gas = (numerator - 1) / denominator; @@ -242,7 +242,7 @@ pub(crate) fn get_amortized_overhead( MAX_L2_TX_GAS_LIMIT as u32, gas_per_pubdata_byte_limit, encoded_len.as_usize(), - coeficients, + coefficients, ) } else { overhead @@ -263,7 +263,7 @@ mod tests { total_gas_limit: u32, gas_per_pubdata_byte_limit: u32, encoded_len: usize, - coeficients: OverheadCoeficients, + coefficients: OverheadCoefficients, ) -> u32 { let mut left_bound = if MAX_TX_ERGS_LIMIT < total_gas_limit { total_gas_limit - MAX_TX_ERGS_LIMIT @@ -281,7 +281,7 @@ mod tests { total_gas_limit - suggested_overhead, gas_per_pubdata_byte_limit, encoded_len, - coeficients, + coefficients, ); derived_overhead >= suggested_overhead @@ -310,40 +310,40 @@ mod tests { let test_params = |total_gas_limit: u32, gas_per_pubdata: u32, encoded_len: usize, - coeficients: OverheadCoeficients| { + coefficients: OverheadCoefficients| { let result_by_efficient_search = - get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coeficients); + get_amortized_overhead(total_gas_limit, gas_per_pubdata, encoded_len, coefficients); let result_by_binary_search = get_maximal_allowed_overhead_bin_search( total_gas_limit, gas_per_pubdata, encoded_len, - coeficients, + coefficients, ); assert_eq!(result_by_efficient_search, result_by_binary_search); }; // Some arbitrary test - test_params(60_000_000, 800, 2900, OverheadCoeficients::new_l2()); + test_params(60_000_000, 800, 2900, OverheadCoefficients::new_l2()); // Very small parameters - test_params(0, 1, 12, OverheadCoeficients::new_l2()); + test_params(0, 1, 12, OverheadCoefficients::new_l2()); // Relatively big parameters let max_tx_overhead = derive_overhead( MAX_TX_ERGS_LIMIT, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); test_params( MAX_TX_ERGS_LIMIT + max_tx_overhead, 5000, 10000, - OverheadCoeficients::new_l2(), + OverheadCoefficients::new_l2(), ); - test_params(115432560, 800, 2900, OverheadCoeficients::new_l1()); + test_params(115432560, 800, 2900, OverheadCoefficients::new_l1()); } } diff --git a/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs b/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs index e96c326b2191..4110825a260e 100644 --- a/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs +++ b/core/lib/multivm/src/versions/vm_virtual_blocks/vm.rs @@ -132,7 +132,7 @@ impl VmInterface for Vm { } } -/// Methods of vm, which required some history manipullations +/// Methods of vm, which required some history manipulations impl VmInterfaceHistoryEnabled for Vm { /// Create snapshot of current vm state and push it into the memory fn make_snapshot(&mut self) { diff --git a/core/lib/state/src/cache/metrics.rs b/core/lib/state/src/cache/metrics.rs index 7198d4339475..13bc8c94aa97 100644 --- a/core/lib/state/src/cache/metrics.rs +++ b/core/lib/state/src/cache/metrics.rs @@ -18,7 +18,7 @@ pub(super) enum RequestOutcome { Miss, } -/// Buckets for small latencies: from 10ns to 1ms. +/// Buckets for small latencies: from 10 ns to 1 ms. const SMALL_LATENCIES: Buckets = Buckets::values(&[ 1e-8, 2.5e-8, 5e-8, 1e-7, 2.5e-7, 5e-7, 1e-6, 2.5e-6, 5e-6, 1e-5, 2.5e-5, 5e-5, 1e-4, 1e-3, ]); diff --git a/core/lib/state/src/in_memory.rs b/core/lib/state/src/in_memory.rs index 87a26b238f23..fcb69affea85 100644 --- a/core/lib/state/src/in_memory.rs +++ b/core/lib/state/src/in_memory.rs @@ -8,7 +8,7 @@ use zksync_types::{ }; use zksync_utils::u256_to_h256; -/// Network ID we use by defailt for in memory storage. +/// Network ID we use by default for in memory storage. pub const IN_MEMORY_STORAGE_DEFAULT_NETWORK_ID: u32 = 270; /// In-memory storage. diff --git a/core/lib/state/src/lib.rs b/core/lib/state/src/lib.rs index c943e48dbc1d..3d54967c9ad6 100644 --- a/core/lib/state/src/lib.rs +++ b/core/lib/state/src/lib.rs @@ -43,7 +43,7 @@ pub trait ReadStorage: fmt::Debug { /// Checks whether a write to this storage at the specified `key` would be an initial write. /// Roughly speaking, this is the case when the storage doesn't contain `key`, although - /// in case of mutable storages, the caveats apply (a write to a key that is present + /// in case of mutable storage, the caveats apply (a write to a key that is present /// in the storage but was not committed is still an initial write). fn is_write_initial(&mut self, key: &StorageKey) -> bool; diff --git a/core/lib/storage/src/db.rs b/core/lib/storage/src/db.rs index 3280183abf99..617d14d272d0 100644 --- a/core/lib/storage/src/db.rs +++ b/core/lib/storage/src/db.rs @@ -553,7 +553,7 @@ impl RocksDB { } impl RocksDB<()> { - /// Awaits termination of all running rocksdb instances. + /// Awaits termination of all running RocksDB instances. /// /// This method is blocking and should be wrapped in `spawn_blocking(_)` if run in the async context. pub fn await_rocksdb_termination() { @@ -570,7 +570,7 @@ impl RocksDB<()> { } } -/// Empty struct used to register rocksdb instance +/// Empty struct used to register RocksDB instance #[derive(Debug)] struct RegistryEntry; diff --git a/core/lib/storage/src/metrics.rs b/core/lib/storage/src/metrics.rs index 0c26bd749d5a..928e735a30ca 100644 --- a/core/lib/storage/src/metrics.rs +++ b/core/lib/storage/src/metrics.rs @@ -96,7 +96,7 @@ pub(crate) struct RocksdbSizeMetrics { pub live_data_size: Family>, /// Total size of all SST files in the column family of a RocksDB instance. pub total_sst_size: Family>, - /// Total size of all mem tables in the column family of a RocksDB instance. + /// Total size of all memory tables in the column family of a RocksDB instance. pub total_mem_table_size: Family>, /// Total size of block cache in the column family of a RocksDB instance. pub block_cache_size: Family>, diff --git a/core/lib/types/src/api/mod.rs b/core/lib/types/src/api/mod.rs index f0cc71328313..24ac74ab335e 100644 --- a/core/lib/types/src/api/mod.rs +++ b/core/lib/types/src/api/mod.rs @@ -89,7 +89,7 @@ impl<'de> Deserialize<'de> for BlockNumber { } } -/// Block unified identifier in terms of ZKSync +/// Block unified identifier in terms of zkSync /// /// This is an utility structure that cannot be (de)serialized, it has to be created manually. /// The reason is because Web3 API provides multiple methods for referring block either by hash or number, @@ -271,7 +271,7 @@ pub struct Block { /// Hash of the uncles #[serde(rename = "sha3Uncles")] pub uncles_hash: H256, - /// Miner/author's address + /// Miner / author's address #[serde(rename = "miner", default, deserialize_with = "null_to_default")] pub author: H160, /// State root hash @@ -463,7 +463,7 @@ pub struct Transaction { pub from: Option

, /// Recipient (None when contract creation) pub to: Option
, - /// Transfered value + /// Transferred value pub value: U256, /// Gas Price #[serde(rename = "gasPrice")] diff --git a/core/lib/types/src/block.rs b/core/lib/types/src/block.rs index 762733f8e214..80a4d131e21b 100644 --- a/core/lib/types/src/block.rs +++ b/core/lib/types/src/block.rs @@ -64,7 +64,7 @@ pub struct L1BatchHeader { /// The L2 gas price that the operator agrees on. pub l2_fair_gas_price: u64, pub base_system_contracts_hashes: BaseSystemContractsHashes, - /// System logs are those emitted as part of the Vm excecution. + /// System logs are those emitted as part of the Vm execution. pub system_logs: Vec, /// Version of protocol used for the L1 batch. pub protocol_version: Option, diff --git a/core/lib/types/src/storage/writes/mod.rs b/core/lib/types/src/storage/writes/mod.rs index 6a17afb7d15f..54393f417856 100644 --- a/core/lib/types/src/storage/writes/mod.rs +++ b/core/lib/types/src/storage/writes/mod.rs @@ -41,7 +41,7 @@ pub struct RepeatedStorageWrite { #[derive(Clone, Debug, Deserialize, Serialize, Default, Eq, PartialEq)] pub struct StateDiffRecord { - /// address state diff occured at + /// address state diff occurred at pub address: Address, /// storage slot key updated pub key: U256, @@ -115,7 +115,7 @@ impl StateDiffRecord { } } - /// compression follows the following algo: + /// compression follows the following algorithm: /// 1. if repeated write: /// entry <- enumeration_index || compressed value /// 2. if initial write: diff --git a/core/lib/types/src/transaction_request.rs b/core/lib/types/src/transaction_request.rs index 3c450e77c89b..85194902e323 100644 --- a/core/lib/types/src/transaction_request.rs +++ b/core/lib/types/src/transaction_request.rs @@ -60,7 +60,7 @@ pub struct CallRequest { /// Access list #[serde(default, skip_serializing_if = "Option::is_none")] pub access_list: Option, - /// Eip712 meta + /// EIP712 meta #[serde(default, skip_serializing_if = "Option::is_none")] pub eip712_meta: Option, } @@ -97,7 +97,7 @@ impl CallRequestBuilder { self } - /// Set transfered value (None for no transfer) + /// Set transferred, value (None for no transfer) pub fn gas_price(mut self, gas_price: U256) -> Self { self.call_request.gas_price = Some(gas_price); self @@ -113,7 +113,7 @@ impl CallRequestBuilder { self } - /// Set transfered value (None for no transfer) + /// Set transferred, value (None for no transfer) pub fn value(mut self, value: U256) -> Self { self.call_request.value = Some(value); self @@ -177,7 +177,7 @@ pub enum SerializationTransactionError { AccessListsNotSupported, #[error("nonce has max value")] TooBigNonce, - /// TooHighGas is a sanity error to avoid extremely big numbers specified + /// Sanity check error to avoid extremely big numbers specified /// to gas and pubdata price. #[error("{0}")] TooHighGas(String), diff --git a/core/lib/types/src/tx/primitives/eip712_signature/typed_structure.rs b/core/lib/types/src/tx/primitives/eip712_signature/typed_structure.rs index 999afbbe604d..28e9d27f0a68 100644 --- a/core/lib/types/src/tx/primitives/eip712_signature/typed_structure.rs +++ b/core/lib/types/src/tx/primitives/eip712_signature/typed_structure.rs @@ -29,7 +29,7 @@ impl EncodedStructureMember { } } - /// Encodes the structure as `name ‖ "(" ‖ member₁ ‖ "," ‖ member₂ ‖ "," ‖ … ‖ memberₙ ")". + /// Encodes the structure as `name ‖ "(" ‖ member₁ ‖ "," ‖ member₂ ‖ "," ‖ … ‖ memberₙ ")"`. pub fn get_encoded_type(&self) -> String { let mut encoded_type = String::new(); encoded_type.push_str(&self.member_type); diff --git a/core/lib/types/src/tx/primitives/packed_eth_signature.rs b/core/lib/types/src/tx/primitives/packed_eth_signature.rs index b249d151ef56..32564829ad88 100644 --- a/core/lib/types/src/tx/primitives/packed_eth_signature.rs +++ b/core/lib/types/src/tx/primitives/packed_eth_signature.rs @@ -14,7 +14,7 @@ use thiserror::Error; use zksync_basic_types::{Address, H256}; use zksync_utils::ZeroPrefixHexSerde; -/// Struct used for working with ethereum signatures created using eth_sign (using geth, ethers.js, etc) +/// Struct used for working with Ethereum signatures created using eth_sign (using geth, ethers.js, etc) /// message is serialized as 65 bytes long `0x` prefixed string. /// /// Some notes on implementation of methods of this structure: @@ -66,7 +66,7 @@ impl PackedEthSignature { Ok(PackedEthSignature(ETHSignature::from(signature))) } - /// Signs message using ethereum private key, results are identical to signature created + /// Signs message using Ethereum private key, results are identical to signature created /// using `geth`, `ethers.js`, etc. No hashing and prefixes required. pub fn sign(private_key: &H256, msg: &[u8]) -> Result { let signed_bytes = Self::message_to_signed_bytes(msg); @@ -85,7 +85,7 @@ impl PackedEthSignature { Ok(PackedEthSignature(signature)) } - /// Signs typed struct using ethereum private key by EIP-712 signature standard. + /// Signs typed struct using Ethereum private key by EIP-712 signature standard. /// Result of this function is the equivalent of RPC calling `eth_signTypedData`. pub fn sign_typed_data( private_key: &H256, @@ -115,7 +115,7 @@ impl PackedEthSignature { msg.keccak256().into() } - /// Checks signature and returns ethereum address of the signer. + /// Checks signature and returns Ethereum address of the signer. /// message should be the same message that was passed to `eth.sign`(or similar) method /// as argument. No hashing and prefixes required. pub fn signature_recover_signer( diff --git a/core/lib/utils/src/bytecode.rs b/core/lib/utils/src/bytecode.rs index 66101da4f5bc..4a9d1cd2475b 100644 --- a/core/lib/utils/src/bytecode.rs +++ b/core/lib/utils/src/bytecode.rs @@ -27,7 +27,7 @@ pub enum FailedToCompressBytecodeError { InvalidBytecode(#[from] InvalidBytecodeError), } -/// Implelements a simple compression algorithm for the bytecode. +/// Implements, a simple compression algorithm for the bytecode. pub fn compress_bytecode(code: &[u8]) -> Result, FailedToCompressBytecodeError> { validate_bytecode(code)?; diff --git a/core/lib/utils/src/convert.rs b/core/lib/utils/src/convert.rs index bcaa6c68f1ff..973b28cc613a 100644 --- a/core/lib/utils/src/convert.rs +++ b/core/lib/utils/src/convert.rs @@ -154,7 +154,7 @@ pub fn h256_to_u32(value: H256) -> u32 { u32::from_be_bytes(be_u32_bytes) } -/// Converts u32 into the h256 as BE bytes +/// Converts u32 into the H256 as BE bytes pub fn u32_to_h256(value: u32) -> H256 { let mut result = [0u8; 32]; result[28..].copy_from_slice(&value.to_be_bytes()); diff --git a/core/lib/vlog/src/lib.rs b/core/lib/vlog/src/lib.rs index 173770beecea..2c6702ede960 100644 --- a/core/lib/vlog/src/lib.rs +++ b/core/lib/vlog/src/lib.rs @@ -153,7 +153,7 @@ pub fn log_format_from_env() -> LogFormat { } /// Loads the Sentry URL from the environment variable according to the existing zkSync configuration scheme. -/// If the environemnt value is present but the value is `unset`, `None` will be returned for compatibility with the +/// If the environment value is present but the value is `unset`, `None` will be returned for compatibility with the /// existing configuration setup. /// /// This is a deprecated function existing for compatibility with the old configuration scheme. diff --git a/core/lib/zksync_core/src/api_server/contract_verification/api_decl.rs b/core/lib/zksync_core/src/api_server/contract_verification/api_decl.rs index 1b7d07b42767..5f9730d458e1 100644 --- a/core/lib/zksync_core/src/api_server/contract_verification/api_decl.rs +++ b/core/lib/zksync_core/src/api_server/contract_verification/api_decl.rs @@ -19,7 +19,7 @@ impl RestApi { } } - /// Creates an actix-web `Scope`, which can be mounted to the Http server. + /// Creates an actix-web `Scope`, which can be mounted to the HTTP server. pub fn into_scope(self) -> actix_web::Scope { web::scope("") .app_data(web::Data::new(self)) diff --git a/core/lib/zksync_core/src/api_server/execution_sandbox/execute.rs b/core/lib/zksync_core/src/api_server/execution_sandbox/execute.rs index d1ac41553df2..9621adae2d87 100644 --- a/core/lib/zksync_core/src/api_server/execution_sandbox/execute.rs +++ b/core/lib/zksync_core/src/api_server/execution_sandbox/execute.rs @@ -5,7 +5,7 @@ use tracing::{span, Level}; use multivm::interface::{TxExecutionMode, VmExecutionMode, VmExecutionResultAndLogs, VmInterface}; use multivm::tracers::StorageInvocations; use multivm::vm_latest::constants::ETH_CALL_GAS_LIMIT; -use multivm::MultivmTracer; +use multivm::MultiVMTracer; use zksync_dal::ConnectionPool; use zksync_types::{ diff --git a/core/lib/zksync_core/src/api_server/execution_sandbox/tracers.rs b/core/lib/zksync_core/src/api_server/execution_sandbox/tracers.rs index ac675eee707f..9f987a150da8 100644 --- a/core/lib/zksync_core/src/api_server/execution_sandbox/tracers.rs +++ b/core/lib/zksync_core/src/api_server/execution_sandbox/tracers.rs @@ -1,13 +1,13 @@ use multivm::tracers::CallTracer; use multivm::vm_latest::HistoryMode; -use multivm::{MultiVmTracerPointer, MultivmTracer}; +use multivm::{MultiVMTracer, MultiVmTracerPointer}; use once_cell::sync::OnceCell; use std::sync::Arc; use zksync_state::WriteStorage; use zksync_types::vm_trace::Call; -/// Custom tracers supported by our api +/// Custom tracers supported by our API #[derive(Debug)] pub(crate) enum ApiTracer { CallTracer(Arc>>), diff --git a/core/lib/zksync_core/src/api_server/execution_sandbox/validate.rs b/core/lib/zksync_core/src/api_server/execution_sandbox/validate.rs index 119d6423ba21..4b9e13084efd 100644 --- a/core/lib/zksync_core/src/api_server/execution_sandbox/validate.rs +++ b/core/lib/zksync_core/src/api_server/execution_sandbox/validate.rs @@ -1,5 +1,5 @@ use multivm::interface::{ExecutionResult, VmExecutionMode, VmInterface}; -use multivm::MultivmTracer; +use multivm::MultiVMTracer; use std::collections::HashSet; use multivm::tracers::{ diff --git a/core/lib/zksync_core/src/api_server/tx_sender/mod.rs b/core/lib/zksync_core/src/api_server/tx_sender/mod.rs index b994fbff8824..12c738004151 100644 --- a/core/lib/zksync_core/src/api_server/tx_sender/mod.rs +++ b/core/lib/zksync_core/src/api_server/tx_sender/mod.rs @@ -18,7 +18,7 @@ use multivm::vm_latest::{ constants::{BLOCK_GAS_LIMIT, MAX_PUBDATA_PER_BLOCK}, utils::{ fee::derive_base_fee_and_gas_per_pubdata, - overhead::{derive_overhead, OverheadCoeficients}, + overhead::{derive_overhead, OverheadCoefficients}, }, }; @@ -111,7 +111,7 @@ pub struct ApiContracts { pub(crate) estimate_gas: MultiVMBaseSystemContracts, /// Contracts to be used when performing `eth_call` requests. /// These contracts (mainly, bootloader) normally should be tuned to provide better UX - /// exeprience (e.g. revert messages). + /// experience (e.g. revert messages). pub(crate) eth_call: MultiVMBaseSystemContracts, } @@ -600,7 +600,7 @@ impl TxSender { tx_gas_limit, gas_per_pubdata_byte as u32, tx.encoding_len(), - OverheadCoeficients::from_tx_type(tx.tx_format() as u8), + OverheadCoefficients::from_tx_type(tx.tx_format() as u8), ); match &mut tx.common_data { @@ -832,7 +832,7 @@ impl TxSender { suggested_gas_limit, gas_per_pubdata_byte as u32, tx.encoding_len(), - OverheadCoeficients::from_tx_type(tx.tx_format() as u8), + OverheadCoefficients::from_tx_type(tx.tx_format() as u8), ); let full_gas_limit = diff --git a/core/lib/zksync_core/src/eth_sender/eth_tx_manager.rs b/core/lib/zksync_core/src/eth_sender/eth_tx_manager.rs index da11e9056474..98e75702a4c8 100644 --- a/core/lib/zksync_core/src/eth_sender/eth_tx_manager.rs +++ b/core/lib/zksync_core/src/eth_sender/eth_tx_manager.rs @@ -43,7 +43,7 @@ pub(super) struct L1BlockNumbers { /// The component is responsible for managing sending eth_txs attempts: /// Based on eth_tx queue the component generates new attempt with the minimum possible fee, -/// save it to the database, and send it to ethereum. +/// save it to the database, and send it to Ethereum. /// Based on eth_tx_history queue the component can mark txs as stuck and create the new attempt /// with higher gas price #[derive(Debug)] diff --git a/core/lib/zksync_core/src/eth_sender/metrics.rs b/core/lib/zksync_core/src/eth_sender/metrics.rs index 2f4a225e570e..950ff8bf6f79 100644 --- a/core/lib/zksync_core/src/eth_sender/metrics.rs +++ b/core/lib/zksync_core/src/eth_sender/metrics.rs @@ -78,7 +78,7 @@ pub(super) struct EthSenderMetrics { pub used_priority_fee_per_gas: Histogram, /// Last L1 block observed by the Ethereum sender. pub last_known_l1_block: Gauge, - /// Number of inflight txs produced by the Ethereum sender. + /// Number of in-flight txs produced by the Ethereum sender. pub number_of_inflight_txs: Gauge, #[metrics(buckets = GAS_BUCKETS)] pub l1_gas_used: Family>, diff --git a/core/lib/zksync_core/src/house_keeper/fri_prover_queue_monitor.rs b/core/lib/zksync_core/src/house_keeper/fri_prover_queue_monitor.rs index ba731ede944f..9d3264b679ec 100644 --- a/core/lib/zksync_core/src/house_keeper/fri_prover_queue_monitor.rs +++ b/core/lib/zksync_core/src/house_keeper/fri_prover_queue_monitor.rs @@ -24,7 +24,7 @@ impl FriProverStatsReporter { } } -/// Invoked periodically to push prover queued/inprogress job statistics +/// Invoked periodically to push prover queued/in-progress job statistics #[async_trait] impl PeriodicJob for FriProverStatsReporter { const SERVICE_NAME: &'static str = "FriProverStatsReporter"; diff --git a/core/lib/zksync_core/src/lib.rs b/core/lib/zksync_core/src/lib.rs index d52fd76661f2..3b00d7cffda1 100644 --- a/core/lib/zksync_core/src/lib.rs +++ b/core/lib/zksync_core/src/lib.rs @@ -251,7 +251,7 @@ pub enum Component { WitnessGenerator(Option, AggregationRound), /// Component for housekeeping task such as cleaning blobs from GCS, reporting metrics etc. Housekeeper, - /// Component for exposing API's to prover for providing proof generation data and accepting proofs. + /// Component for exposing APIs to prover for providing proof generation data and accepting proofs. ProofDataHandler, } diff --git a/core/lib/zksync_core/src/metadata_calculator/helpers.rs b/core/lib/zksync_core/src/metadata_calculator/helpers.rs index ffd87b92d164..32f39276a1e5 100644 --- a/core/lib/zksync_core/src/metadata_calculator/helpers.rs +++ b/core/lib/zksync_core/src/metadata_calculator/helpers.rs @@ -42,7 +42,7 @@ impl From for Health { /// /// Async methods provided by this wrapper are not cancel-safe! This is probably not an issue; /// `ZkSyncTree` is only indirectly available via `MetadataCalculator::run()` entrypoint -/// which consumes `self`. That is, if `MetadataCalculator::run()` is cancelled (which we don't currently do, +/// which consumes `self`. That is, if `MetadataCalculator::run()` is canceled (which we don't currently do, /// at least not explicitly), all `MetadataCalculator` data including `ZkSyncTree` is discarded. /// In the unlikely case you get a "`ZkSyncTree` is in inconsistent state" panic, /// cancellation is most probably the reason. diff --git a/core/lib/zksync_core/src/metrics.rs b/core/lib/zksync_core/src/metrics.rs index fdb043e211fc..539cbbbb2fbb 100644 --- a/core/lib/zksync_core/src/metrics.rs +++ b/core/lib/zksync_core/src/metrics.rs @@ -180,9 +180,9 @@ pub(crate) struct ExternalNodeMetrics { pub synced: Gauge, /// Current sync lag of the external node. pub sync_lag: Gauge, - /// Number of the last L1 batch checked by the reorg detector or consistency checker. + /// Number of the last L1 batch checked by the re-org detector or consistency checker. pub last_correct_batch: Family>, - /// Number of the last miniblock checked by the reorg detector or consistency checker. + /// Number of the last miniblock checked by the re-org detector or consistency checker. pub last_correct_miniblock: Family>, } diff --git a/core/lib/zksync_core/src/reorg_detector/mod.rs b/core/lib/zksync_core/src/reorg_detector/mod.rs index 4f7b8eb55035..16137d40af67 100644 --- a/core/lib/zksync_core/src/reorg_detector/mod.rs +++ b/core/lib/zksync_core/src/reorg_detector/mod.rs @@ -14,19 +14,19 @@ use crate::metrics::{CheckerComponent, EN_METRICS}; const SLEEP_INTERVAL: Duration = Duration::from_secs(5); -/// This is a component that is responsible for detecting the batch reorgs. -/// Batch reorg is a rare event of manual intervention, when the node operator +/// This is a component that is responsible for detecting the batch re-orgs. +/// Batch re-org is a rare event of manual intervention, when the node operator /// decides to revert some of the not yet finalized batches for some reason /// (e.g. inability to generate a proof), and then potentially /// re-organize transactions in them to fix the problem. /// /// To detect them, we constantly check the latest sealed batch root hash, -/// and in the event of mismatch, we know that there has been a reorg. +/// and in the event of mismatch, we know that there has been a re-org. /// We then perform a binary search to find the latest correct block /// and revert all batches after it, to keep being consistent with the main node. /// /// This is the only component that is expected to finish its execution -/// in the even of reorg, since we have to restart the node after a rollback is performed, +/// in the even of re-org, since we have to restart the node after a rollback is performed, /// and is special-cased in the `zksync_external_node` crate. #[derive(Debug)] pub struct ReorgDetector { @@ -113,7 +113,7 @@ impl ReorgDetector { Ok(hash == local_hash) } - /// Localizes a reorg: performs binary search to determine the last non-diverged block. + /// Localizes a re-org: performs binary search to determine the last non-diverged block. async fn detect_reorg(&self, diverged_l1_batch: L1BatchNumber) -> RpcResult { // TODO (BFT-176, BFT-181): We have to look through the whole history, since batch status updater may mark // a block as executed even if the state diverges for it. diff --git a/core/lib/zksync_core/src/state_keeper/batch_executor/mod.rs b/core/lib/zksync_core/src/state_keeper/batch_executor/mod.rs index fffabe0b7e2e..389677b04397 100644 --- a/core/lib/zksync_core/src/state_keeper/batch_executor/mod.rs +++ b/core/lib/zksync_core/src/state_keeper/batch_executor/mod.rs @@ -5,7 +5,7 @@ use tokio::{ task::JoinHandle, }; -use multivm::MultivmTracer; +use multivm::MultiVMTracer; use std::{fmt, sync::Arc}; use multivm::{ diff --git a/core/lib/zksync_core/src/state_keeper/io/mod.rs b/core/lib/zksync_core/src/state_keeper/io/mod.rs index 06397c3cd17e..858c46b2e704 100644 --- a/core/lib/zksync_core/src/state_keeper/io/mod.rs +++ b/core/lib/zksync_core/src/state_keeper/io/mod.rs @@ -143,7 +143,7 @@ impl MiniblockSealerHandle { /// Submits a new sealing `command` to the sealer that this handle is attached to. /// /// If there are currently too many unprocessed commands, this method will wait until - /// enough of them are processed (i.e., there is backpressure). + /// enough of them are processed (i.e., there is back pressure). pub async fn submit(&mut self, command: MiniblockSealCommand) { let miniblock_number = command.miniblock_number; tracing::debug!( diff --git a/core/lib/zksync_core/src/state_keeper/metrics.rs b/core/lib/zksync_core/src/state_keeper/metrics.rs index f16b311e8056..f3f433243209 100644 --- a/core/lib/zksync_core/src/state_keeper/metrics.rs +++ b/core/lib/zksync_core/src/state_keeper/metrics.rs @@ -175,7 +175,7 @@ pub(super) enum L1BatchSealStage { const COUNT_BUCKETS: Buckets = Buckets::values(&[ 10.0, 20.0, 50.0, 100.0, 200.0, 500.0, 1_000.0, 2_000.0, 5_000.0, 10_000.0, 20_000.0, 50_000.0, ]); -/// Buckets for sealing deltas for L1 batches (in seconds). The expected delta is ~1 minute. +/// Buckets for sealing deltas for L1 batches (in seconds). The expected delta is approximately 1 minute. const L1_BATCH_SEAL_DELTA_BUCKETS: Buckets = Buckets::values(&[ 0.1, 0.5, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 60.0, 90.0, 120.0, 180.0, 240.0, 300.0, ]); @@ -205,7 +205,7 @@ pub(crate) struct L1BatchMetrics { /// Number of entities stored in Postgres during a specific stage of sealing an L1 batch. #[metrics(buckets = COUNT_BUCKETS)] sealed_entity_count: Family>, - /// Latency of sealing an L1 batch split by the stage and divided by the number of entiries + /// Latency of sealing an L1 batch split by the stage and divided by the number of entries /// stored in the stage. #[metrics(buckets = Buckets::LATENCIES)] sealed_entity_per_unit: Family>, @@ -285,7 +285,7 @@ pub(super) struct MiniblockMetrics { /// Number of entities stored in Postgres during a specific stage of sealing a miniblock. #[metrics(buckets = COUNT_BUCKETS)] sealed_entity_count: Family>, - /// Latency of sealing a miniblock split by the stage and divided by the number of entiries + /// Latency of sealing a miniblock split by the stage and divided by the number of entries /// stored in the stage. #[metrics(buckets = Buckets::LATENCIES)] sealed_entity_per_unit: Family>, diff --git a/core/lib/zksync_core/src/witness_generator/mod.rs b/core/lib/zksync_core/src/witness_generator/mod.rs index 10a7ff861bd8..5dcebadf6a81 100644 --- a/core/lib/zksync_core/src/witness_generator/mod.rs +++ b/core/lib/zksync_core/src/witness_generator/mod.rs @@ -9,7 +9,7 @@ //! each of them starts with an invocation of `WitnessGenerator` with a corresponding `WitnessGeneratorJobType`: //! * `WitnessGeneratorJobType::BasicCircuits`: //! generates basic circuits (circuits like `Main VM` - up to 50 * 48 = 2400 circuits): -//! input table: `basic_circuit_witness_jobs` (todo SMA-1362: will be renamed from `witness_inputs`) +//! input table: `basic_circuit_witness_jobs` (TODO SMA-1362: will be renamed from `witness_inputs`) //! artifact/output table: `leaf_aggregation_jobs` (also creates job stubs in `node_aggregation_jobs` and `scheduler_aggregation_jobs`) //! value in `aggregation_round` field of `prover_jobs` table: 0 //! * `WitnessGeneratorJobType::LeafAggregation`: @@ -28,14 +28,14 @@ //! //! One round of prover generation consists of: //! * `WitnessGenerator` picks up the next `queued` job in its input table and processes it -//! (invoking the corresponding helper function in `zkevm_test_harness` repo) -//! * it saves the generated circuis to `prover_jobs` table and the other artifacts to its output table +//! (invoking the corresponding helper function in `zkevm_test_harness` repository) +//! * it saves the generated circuits to `prover_jobs` table and the other artifacts to its output table //! * the individual proofs are picked up by the provers, processed, and marked as complete. //! * when the last proof for this round is computed, the prover updates the row in the output table //! setting its status to `queued` //! * `WitnessGenerator` picks up such job and proceeds to the next round //! -//! Note that the very first input table (`basic_circuit_witness_jobs` (todo SMA-1362: will be renamed from `witness_inputs`)) +//! Note that the very first input table (`basic_circuit_witness_jobs` (TODO SMA-1362: will be renamed from `witness_inputs`)) //! is populated by the tree (as the input artifact for the `WitnessGeneratorJobType::BasicCircuits` is the merkle proofs) use vise::{Buckets, Counter, EncodeLabelSet, EncodeLabelValue, Family, Histogram, Metrics}; diff --git a/core/tests/loadnext/src/account/mod.rs b/core/tests/loadnext/src/account/mod.rs index bead354cdeaa..14aa23b50315 100644 --- a/core/tests/loadnext/src/account/mod.rs +++ b/core/tests/loadnext/src/account/mod.rs @@ -59,7 +59,7 @@ pub struct AccountLifespan { contract_execution_params: LoadnextContractExecutionParams, /// Pool of account addresses, used to generate commands. addresses: AddressPool, - /// Successful transactions, required for requesting api + /// Successful transactions, required for requesting API successfully_sent_txs: Arc>>, /// L1 ERC-20 token used in the test. main_l1_token: Address, diff --git a/core/tests/loadnext/src/account_pool.rs b/core/tests/loadnext/src/account_pool.rs index 556bee7f402f..e4ded62dcf14 100644 --- a/core/tests/loadnext/src/account_pool.rs +++ b/core/tests/loadnext/src/account_pool.rs @@ -76,7 +76,7 @@ pub struct TestWallet { } /// Pool of accounts to be used in the test. -/// Each account is represented as `zksync::Wallet` in order to provide convenient interface of interation with zkSync. +/// Each account is represented as `zksync::Wallet` in order to provide convenient interface of interaction with zkSync. #[derive(Debug)] pub struct AccountPool { /// Main wallet that will be used to initialize all the test wallets. diff --git a/core/tests/loadnext/src/command/api.rs b/core/tests/loadnext/src/command/api.rs index e865ab000318..1e520d7c195a 100644 --- a/core/tests/loadnext/src/command/api.rs +++ b/core/tests/loadnext/src/command/api.rs @@ -54,7 +54,7 @@ impl AllWeighted for ApiRequestType { pub struct ApiRequest { /// Type of the request to be performed. pub request_type: ApiRequestType, - /// ZkSync block number, generated randomly. + /// zkSync block number, generated randomly. pub block_number: api::BlockNumber, } diff --git a/docs/advanced/pubdata.md b/docs/advanced/pubdata.md index 6bab6a85a46d..d34033d0a5ef 100644 --- a/docs/advanced/pubdata.md +++ b/docs/advanced/pubdata.md @@ -53,7 +53,7 @@ In pre-boojum era the superset of pubdata fields and input to the `commitBlocks` /// @param repeatedStorageChanges Storage write access as a concatenation index-value /// @param l2Logs concatenation of all L2 -> L1 logs in the block /// @param l2ArbitraryLengthMessages array of hash preimages that were sent as value of L2 logs by special system L2 contract -/// @param factoryDeps (contract bytecodes) array of l2 bytecodes that were deployed +/// @param factoryDeps (contract bytecodes) array of L2 bytecodes that were deployed struct CommitBlockInfo { uint64 blockNumber; uint64 timestamp; diff --git a/prover/witness_generator/README.md b/prover/witness_generator/README.md index 9d35fe7e054a..dc476ca44fc3 100644 --- a/prover/witness_generator/README.md +++ b/prover/witness_generator/README.md @@ -15,7 +15,7 @@ aggregation. That is, every aggregation round needs two sets of input: ## BasicCircuitsWitnessGenerator - generates basic circuits (circuits like `Main VM` - up to 50 \* 48 = 2400 circuits): -- input table: `basic_circuit_witness_jobs` (todo SMA-1362: will be renamed from `witness_inputs`) +- input table: `basic_circuit_witness_jobs` (TODO SMA-1362: will be renamed from `witness_inputs`) - artifact/output table: `leaf_aggregation_jobs` (also creates job stubs in `node_aggregation_jobs` and `scheduler_aggregation_jobs`) value in `aggregation_round` field of `prover_jobs` table: 0 @@ -42,7 +42,7 @@ One round of prover generation consists of: - `WitnessGenerator` picks up the next `queued` job in its input table and processes it (invoking the corresponding helper function in `zkevm_test_harness` repo) -- it saves the generated circuis to `prover_jobs` table and the other artifacts to its output table +- it saves the generated circuits to `prover_jobs` table and the other artifacts to its output table - the individual proofs are picked up by the provers, processed, and marked as complete. - when the last proof for this round is computed, the prover updates the row in the output table setting its status to `queued` diff --git a/spellcheck/era.cfg b/spellcheck/era.cfg new file mode 100644 index 000000000000..c00c2d7a64ce --- /dev/null +++ b/spellcheck/era.cfg @@ -0,0 +1,69 @@ +# Project settings where a Cargo.toml exists and is passed +# ${CARGO_MANIFEST_DIR}/.config/spellcheck.toml + +# Also take into account developer comments +dev_comments = false + +# Skip the README.md file as defined in the cargo manifest +skip_readme = false + +[Hunspell] +# lang and name of `.dic` file +lang = "en_US" +# OS specific additives +# Linux: [ /usr/share/myspell ] +# Windows: [] +# macOS [ /home/alice/Libraries/hunspell, /Libraries/hunspell ] + +# Additional search paths, which take presedence over the default +# os specific search dirs, searched in order, defaults last +search_dirs = ["."] + +# Adds additional dictionaries, can be specified as +# absolute paths or relative in the search dirs (in this order). +# Relative paths are resolved relative to the configuration file +# which is used. +# Refer to `man 5 hunspell` +# or https://www.systutorials.com/docs/linux/man/4-hunspell/#lbAE +# on how to define a custom dictionary file. +extra_dictionaries = ["era.dic"] + +# If set to `true`, the OS specific default search paths +# are skipped and only explicitly specified ones are used. +skip_os_lookups = false + +# Use the builtin dictionaries if none were found in +# in the configured lookup paths. +# Usually combined with `skip_os_lookups=true` +# to enforce the `builtin` usage for consistent +# results across distributions and CI runs. +# Setting this will still use the dictionaries +# specified in `extra_dictionaries = [..]` +# for topic specific lingo. +use_builtin = true + + +[Hunspell.quirks] +# Transforms words that are provided by the tokenizer +# into word fragments based on the capture groups which are to +# be checked. +# If no capture groups are present, the matched word is whitelisted. +transform_regex = ["^'([^\\s])'$", "^[0-9]+x$"] +# Accepts `alphabeta` variants if the checker provides a replacement suggestion +# of `alpha-beta`. +allow_concatenation = true +# And the counterpart, which accepts words with dashes, when the suggestion has +# recommendations without the dashes. This is less common. +allow_dashed = false + +[NlpRules] +# Allows the user to override the default included +# exports of LanguageTool, with other custom +# languages + +# override_rules = "/path/to/rules_binencoded.bin" +# override_tokenizer = "/path/to/tokenizer_binencoded.bin" + +[Reflow] +# Reflows doc comments to adhere to a given maximum line width limit. +max_line_length = 80 diff --git a/spellcheck/era.dic b/spellcheck/era.dic new file mode 100644 index 000000000000..214efbcd595f --- /dev/null +++ b/spellcheck/era.dic @@ -0,0 +1,605 @@ +42 +<= +=> +== +-> +<- ++ +- +* +\ += +/ +|| +< +> +% +0x00 +0x01 +0x02 +~10x +u32 +u64 +H256 +10e18 +10^9 +U256 +k +M +kb +50M +– +18kb +128kb +10k +100k +120k +24k +500k +120kb +500B +100M +~100us +10ms +1us +~100 + +ABI +vlog +L2 +L1 +json +l1 +SystemConfig +TODO +se +ZKSYNC_HOME +MultiVMTracer +vm_virtual_blocks +eth_node +BaseSystemContracts +eth_calls +refactor +WS +env +url +GasAdjuster +base_fee +base_fee_per_gas +ERC20 +Finalizer +Backoff +middleware +parallelization +precompute +precomputed +Postgres +parallelized +parallelize +job_id +API +APIs +async +pointwise +observability +atomics +integrations +stdout +GCS +websocket +struct +localhost +TOML +config +finalizer +boolean +prover +timestamp +H160 +zkSync +AccessList +miniblock +member₁ +member₂ +memberₙ +merkle +eth +Ethereum +deployer +RPC +tx +txs +subtrees +subtree +unfinalizable +meterer +Timedout +bootloader +testkit +Sepolia +Goerli +miniblock +miniblocks +MempoolIO +mempool +latencies +OracleTools +StorageOracle +zk_evm +zkEVM +src +utils +ptr +RefCell +Rc +StorageView +VM_HOOK_POSITION +VM_HOOKS_PARAMS_COUNT +PAYMASTER_CONTEXT_SLOTS +PrecompilerProcessor +MAX_POSTOP_SLOTS +postOp +type +opcode +KnownCodesStorage +param +HistoryDisabled +HistoryEnabled +sorted_timestamps +DecommiterOracle +DecommittmentProcessor +encodings +DecommittmentProcessor +decommitment +known_bytecodes +returndata +namespaces +StateDiffRecord +BYTES_PER_ENUMERATION_INDEX +derived_key + +// zkSync-related words +matterlabs +zkweb +zksync +blockchain +zkscan +zkscrypto +PubSub +loadtest +BigUint +radix +state_keeper +MIN_PAYMASTER_BALANCE +PrometheusCollector +RetryCollector +ScriptCollector +MetricsCollector +OperationResultsCollector +ReportCollector +filesystem +hasher +Hasher +grafana +prometheus +serializer +serializable +deserializer +Deserializes +serializing +deserializing +deserialization +configs +operation_number +hashed_key +deduplication +mutexes +mutex +Blake2s +Blake2 +web3 +Testnets +miniblock_number +hashed_key +tuples +\x19Ethereum +libzkscrypto +EOA +MultiVM +nonces +fri +rollup +pubkey +JSON +keccak256 +pubdata +timestamps +keccak +musig +len +calldata +DApp +metadata +boojum +deps +Precalculated +decommitted +WASM +DefaultPrecompilesProcessor +LSB +DDoS +refactored +tuple +HistoryMode +vm +VM +VMs +VM's +MSB +Enum +PublishProof +jsrpc +backends +ethsig +ethop +decentralization +rollups +zkrollup +unencrypted +permissionless +trustlessness +IERC +Schnorr +MuSig +Merkle +decentralised +mainchain +offchain +processed +zcli +blockchains +sidechain +sidechains +tokenomics +validator's +CHAINID +PREVRANDAO +ECDSA +EIP712 +EIP1559 +EIPs +eth_estimateGas +eth_call +versa +blake2 +AR16MT +Preimages + +// Names +Vyper +stimate +samount +Stichting +Kingsfordweg +RSIN +ABDK +Alef +Zcon +Paypal +Numio +MLTT +USDCs +dapi +validiums +validium +Validium +sharded +pepe +Arweave +Streamr +dutterbutter + +// Used libraries +numberish +arrayify +hexlify +markdownlint +ethersproject +nomicfoundation +nomiclabs +Consensys +zkforge +zkcast +Eigen +IPFS + +// Used programming language words +printf +charsets +println +fatalf +allowfullscreen +inttypes +zbin +Panicf +Deri +DERI +Furucombo +kwargs +scaleb +isinstance +RocksDB +mload +secp +porco +rosso +insize +MLOAD + +// ETC +gitter +signup +signups +precompiled +checkmark +Vitalik +Buterin +roadmap +majeure +conveniens +reimplementing +subsecond +supermajority +gemeente +unauthorised +Ethereum's +SDKs +EVM's +EVM +Göerli +ETHUSDC +USDCUSD +ETHUS +USDCUS +ETHUSD +Arbitrum +Adamantium +Immunefi +Winternitz +ewasm +Evmla +UUPS +Uups +TLDR +BLAKE2s +bytes32 +enumeration_index +backend +enum +num_initial +to_check_storage +source_storage +prepend +deduplicated +user_l2_to_l1_logs +L1Messeger +params +provers +zk +substring +reverter +wei +deduplicate +testnet +mainnet +performant +opcodes +USDC +USD +DBs +unexecutable +RLP +DAL +zkSync's +l2_to_l1 + +// crypto events +Edcon + +// Famous crypto people +Gluchowski +Vitalik's +Buterin's +multisignature +onchain +convertion +Keyhash +Armeabi +scijava +gluk +@Deniallugo's + +// Programming related words +bytecode +bytecodes +timeframe +mkdir +zksolc +zksyncrobot +precompiles +vyper +zkvyper +undol +applyl +Upgradability +Initializable +Hola +mundo +ISTN +Zerion +Maverik +zk_evm_1_3_3 +vk +verifier +crypto +callee +Subcalls +Vec +vecs +L1Messenger +SystemL2ToL1Log +witness_inputs +StateKeeper +enum_index +virtual_block_start_batch +virtual_block_finish_l2_block +maxFeePerGas +maxPriorityFeePerGas +structs +all_circuit +OversizedData +M5 +eth_sign +geth +ethers +js +recovery_id +&self +ETHSignature +recover_signer +BlockNumber +(de) +{result +DebugCall} +CREATE2 +memtables +memtable +PostgreSQL +OneTx +DefaultTracer +Tx1 +Tx2 +TxN +VmStopped +Unversioned +versioned +l2_block +submodule +enums +deserialized +hashmap +vm_m5 +SDK +1M +dir +SSD +getter +Getters +WebSocket +gasLimit +MiBs +MiB +GiB +GiBs +pubsub +\x19Ethereum +nibbles–node +ZkSyncTree +invariants +LEB128 +workflow +L1Batch +runtime +Tokio +Blobstore +S3 +AWS +ExternalIO +ClosedFormInputWrapper +AggregationWrapper +(de)serializer +typesafe +LRU +ns +Q3 +loadnext +args +with_arg +node_aggregation_job +scheduler_job +leaf_aggregation_job +MAX_ATTEMPTs +fsync +TEST_DATABASE_URL +newest_block +block_count +contracts_verification_info +RNG +jsonrpsee +l1_batch +Namespace +ExecutionStatus +VmStarted +reproducibility +CFs +key–value +enum_index_migration_cursor +block_number +initial_writes +errored +FactoryDeps +de +StorageView's +Yul +eth_txs +eth_tx +ExecuteBlock +PublishProofBlocksOnchain +CommitBlocks +entrypoint +gas_limit +TxSender +UX +BasicWitnessInputProducer +eth_tx_history +PENDING_BLOCK +from_block +namespace +PriorityQueue +Görli +Ropsten +Rinkeby +tokio +threadpool +IntrinsicGas +InsufficientFundsForTransfer +ChainId +eth_getLogs +façade +virtual_blocks_per_miniblock +virtual_block_interval +cloneable +timestamped +healthcheck +readonly +upgrader +startup + +AUTOGENERATED +x19Ethereum +block_timestamp +SYSTEM_BLOCK_INFO_BLOCK_NUMBER_MULTIPLIER +OneTxTracer +multicall +Multicall3 +updatable +instantiation +unexecuted +transactional +benchmarking +virtual_blocks_interval +dal +codebase +compactions +M6 +compiler_common \ No newline at end of file