diff --git a/firewood/examples/rev.rs b/firewood/examples/rev.rs index 91402ddee..ce4463b2d 100644 --- a/firewood/examples/rev.rs +++ b/firewood/examples/rev.rs @@ -153,7 +153,7 @@ impl RevisionTracker { fn with_new_db(self, path: impl AsRef, cfg: &DbConfig) -> Self { let hashes = { - // must name db variable to explictly drop + // must name db variable to explicitly drop let Self { hashes, db: _db } = self; hashes }; diff --git a/firewood/src/db.rs b/firewood/src/db.rs index b2c31f257..f8bf18222 100644 --- a/firewood/src/db.rs +++ b/firewood/src/db.rs @@ -697,7 +697,7 @@ impl Db { &self.cfg, )?; - // Flip the reset flag after reseting the store headers. + // Flip the reset flag after resetting the store headers. if reset_store_headers { inner.reset_store_headers = false; } diff --git a/firewood/src/proof.rs b/firewood/src/proof.rs index a43aecc67..f5f25ea24 100644 --- a/firewood/src/proof.rs +++ b/firewood/src/proof.rs @@ -378,7 +378,7 @@ impl + Send> Proof { let cur_proof = proofs_map .get(&cur_hash) .ok_or(ProofError::ProofNodeMissing)?; - // TODO(Hao): (Optimization) If a node is alreay decode we don't need to decode again. + // TODO(Hao): (Optimization) If a node is already decode we don't need to decode again. let (mut chd_ptr, sub_proof, size) = self.decode_node(merkle, cur_key, cur_proof.as_ref(), false)?; @@ -673,7 +673,7 @@ fn build_branch_ptr + Send + Sync>( // It should be called after a trie is constructed with two edge paths. Also // the given boundary keys must be the one used to construct the edge paths. // -// It's the key step for range proof. The precalucated encoded value of all internal +// It's the key step for range proof. The precalculated encoded value of all internal // nodes should be removed. But if the proof is valid, // the missing children will be filled, otherwise it will be thrown anyway. // diff --git a/firewood/src/storage/buffer.rs b/firewood/src/storage/buffer.rs index 7f7de2996..8e4bcdbb4 100644 --- a/firewood/src/storage/buffer.rs +++ b/firewood/src/storage/buffer.rs @@ -109,7 +109,7 @@ impl Notifiers { } /// Responsible for processing [`BufferCmd`]s from the [`DiskBufferRequester`] -/// and managing the persistance of pages. +/// and managing the persistence of pages. pub struct DiskBuffer { inbound: mpsc::Receiver, aiomgr: AioManager, @@ -262,7 +262,7 @@ fn schedule_write( false } else { - // if `staging` is not empty, move all semaphors to `writing` and recurse + // if `staging` is not empty, move all semaphores to `writing` and recurse // to schedule the new writes. slot.notifiers.staging_to_writing(); @@ -432,7 +432,7 @@ async fn run_wal_queue( .await .peel(ring_ids, max.revisions) .await - .map_err(|_| "Wal errore while pruning") + .map_err(|_| "Wal errored while pruning") .unwrap() }; @@ -880,14 +880,14 @@ mod tests { let view = another_store.get_view(0, HASH_SIZE as u64).unwrap(); assert_eq!(view.as_deref(), hash); - // get RO view of the buffer from the second hash. Only the new store shoulde see the value. + // get RO view of the buffer from the second hash. Only the new store should see the value. let view = another_store.get_view(32, HASH_SIZE as u64).unwrap(); assert_eq!(view.as_deref(), another_hash); let empty: [u8; HASH_SIZE] = [0; HASH_SIZE]; let view = store.get_view(32, HASH_SIZE as u64).unwrap(); assert_eq!(view.as_deref(), empty); - // Overwrite the value from the beginning in the new store. Only the new store shoulde see the change. + // Overwrite the value from the beginning in the new store. Only the new store should see the change. another_store.write(0, &another_hash); let view = another_store.get_view(0, HASH_SIZE as u64).unwrap(); assert_eq!(view.as_deref(), another_hash); diff --git a/firewood/src/storage/mod.rs b/firewood/src/storage/mod.rs index d59e47a94..e0ceceb34 100644 --- a/firewood/src/storage/mod.rs +++ b/firewood/src/storage/mod.rs @@ -225,7 +225,7 @@ impl StoreDelta { let ep = (w.offset + w.data.len() as u64 - 1) >> PAGE_SIZE_NBIT; let wp = w.offset >> PAGE_SIZE_NBIT; if wp > tail { - // all following writes won't go back past w.offset, so the previous continous + // all following writes won't go back past w.offset, so the previous continuous // write area is determined create_dirty_pages!(head, tail); head = wp; @@ -430,7 +430,7 @@ struct StoreRevMutDelta { } #[derive(Clone, Debug)] -/// A mutable revision of the store. The view is constucted by applying the `deltas` to the +/// A mutable revision of the store. The view is constructed by applying the `deltas` to the /// `base space`. The `deltas` tracks both `undo` and `redo` to be able to rewind or reapply /// the changes. `StoreRevMut` supports basing on top of another `StoreRevMut`, by chaining /// `prev_deltas` (from based `StoreRevMut`) with current `deltas` from itself . In this way, diff --git a/firewood/tests/db.rs b/firewood/tests/db.rs index 715c388c5..d69f073e6 100644 --- a/firewood/tests/db.rs +++ b/firewood/tests/db.rs @@ -310,7 +310,7 @@ fn db_proposal() -> Result<(), DbError> { }); }); - // Recusrive commit + // Recursive commit let batch = vec![BatchOp::Put { key: b"k3", diff --git a/firewood/tests/merkle.rs b/firewood/tests/merkle.rs index 6eaa5ac43..6cf879035 100644 --- a/firewood/tests/merkle.rs +++ b/firewood/tests/merkle.rs @@ -1025,7 +1025,7 @@ fn test_range_proof_keys_with_shared_prefix() -> Result<(), ProofError> { #[test] // Tests a malicious proof, where the proof is more or less the -// whole trie. This is to match correpsonding test in geth. +// whole trie. This is to match corresponding test in geth. fn test_bloadted_range_proof() -> Result<(), ProofError> { // Use a small trie let mut items = Vec::new();