Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: typos in documentation files #3623

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions core/lib/multivm/src/versions/vm_virtual_blocks/utils/overhead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ pub(crate) fn derive_overhead(
// ```

vec![
(coefficients.ergs_limit_overhead_coeficient
(coefficients.ergs_limit_overhead_coefficient
* overhead_for_single_instance_circuits.as_u32() as f64)
.floor() as u32,
(coefficients.bootloader_memory_overhead_coeficient * overhead_for_length.as_u32() as f64)
(coefficients.bootloader_memory_overhead_coefficient * overhead_for_length.as_u32() as f64)
.floor() as u32,
(coefficients.slot_overhead_coeficient * tx_slot_overhead.as_u32() as f64) as u32,
(coefficients.slot_overhead_coefficient * tx_slot_overhead.as_u32() as f64) as u32,
]
.into_iter()
.max()
Expand All @@ -69,28 +69,28 @@ pub(crate) fn derive_overhead(
/// result in an integer number
#[derive(Debug, Clone, Copy)]
pub struct OverheadCoefficients {
slot_overhead_coeficient: f64,
bootloader_memory_overhead_coeficient: f64,
ergs_limit_overhead_coeficient: f64,
slot_overhead_coefficient: f64,
bootloader_memory_overhead_coefficient: f64,
ergs_limit_overhead_coefficient: f64,
}

impl OverheadCoefficients {
// This method ensures that the parameters keep the required invariants
fn new_checked(
slot_overhead_coeficient: f64,
bootloader_memory_overhead_coeficient: f64,
ergs_limit_overhead_coeficient: f64,
slot_overhead_coefficient: f64,
bootloader_memory_overhead_coefficient: f64,
ergs_limit_overhead_coefficient: f64,
) -> Self {
assert!(
(MAX_TX_ERGS_LIMIT as f64 / ergs_limit_overhead_coeficient).round()
== MAX_TX_ERGS_LIMIT as f64 / ergs_limit_overhead_coeficient,
"MAX_TX_ERGS_LIMIT / ergs_limit_overhead_coeficient must be an integer"
(MAX_TX_ERGS_LIMIT as f64 / ergs_limit_overhead_coefficient).round()
== MAX_TX_ERGS_LIMIT as f64 / ergs_limit_overhead_coefficient,
"MAX_TX_ERGS_LIMIT / ergs_limit_overhead_coefficient must be an integer"
);

Self {
slot_overhead_coeficient,
bootloader_memory_overhead_coeficient,
ergs_limit_overhead_coeficient,
slot_overhead_coefficient,
bootloader_memory_overhead_coefficient,
ergs_limit_overhead_coefficient,
}
}

Expand Down Expand Up @@ -162,7 +162,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();
(coefficients.slot_overhead_coeficient * tx_slot_overhead as f64).floor() as u32
(coefficients.slot_overhead_coefficient * tx_slot_overhead as f64).floor() as u32
};

// 2. The overhead for occupying the bootloader memory can be derived from `encoded_len`
Expand All @@ -173,7 +173,7 @@ pub(crate) fn get_amortized_overhead(
)
.as_u32();

(coefficients.bootloader_memory_overhead_coeficient * overhead_for_length as f64).floor()
(coefficients.bootloader_memory_overhead_coefficient * overhead_for_length as f64).floor()
as u32
};

Expand Down Expand Up @@ -222,7 +222,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 / coefficients.ergs_limit_overhead_coeficient) as u64,
(MAX_TX_ERGS_LIMIT as f64 / coefficients.ergs_limit_overhead_coefficient) as u64,
) + overhead_for_block_gas;

let overhead_for_gas = (numerator - 1) / denominator;
Expand Down
2 changes: 1 addition & 1 deletion core/lib/object_store/src/objects.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ mod tests {
use crate::MockObjectStore;

#[test]
fn test_storage_logs_filesnames_generate_corretly() {
fn test_storage_logs_filenames_generate_correctly() {
let filename1 = <SnapshotStorageLogsChunk>::encode_key(SnapshotStorageLogsStorageKey {
l1_batch_number: L1BatchNumber(42),
chunk_id: 97,
Expand Down
4 changes: 2 additions & 2 deletions core/lib/types/src/fee_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ fn clip_batch_fee_model_input_v2(
fee_model.fair_l2_gas_price
} else {
tracing::warn!(
"Fair l2 gas price {} exceeds maximum. Limitting to {}",
"Fair l2 gas price {} exceeds maximum. Limiting to {}",
fee_model.fair_l2_gas_price,
MAXIMUM_L2_GAS_PRICE
);
Expand All @@ -472,7 +472,7 @@ fn clip_batch_fee_model_input_v2(
fee_model.fair_pubdata_price
} else {
tracing::warn!(
"Fair pubdata price {} exceeds maximum. Limitting to {}",
"Fair pubdata price {} exceeds maximum. Limiting to {}",
fee_model.fair_pubdata_price,
MAXIMUM_PUBDATA_PRICE
);
Expand Down