Skip to content

Commit

Permalink
Corrected various typographical errors in code comments (#288)
Browse files Browse the repository at this point in the history
  • Loading branch information
gubatron authored Sep 28, 2023
1 parent cfc5aa5 commit 44850d1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion firewood/examples/rev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl RevisionTracker {

fn with_new_db(self, path: impl AsRef<Path>, 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
};
Expand Down
2 changes: 1 addition & 1 deletion firewood/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions firewood/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ impl<N: AsRef<[u8]> + Send> Proof<N> {
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)?;

Expand Down Expand Up @@ -673,7 +673,7 @@ fn build_branch_ptr<S: ShaleStore<Node> + 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.
//
Expand Down
10 changes: 5 additions & 5 deletions firewood/src/storage/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<BufferCmd>,
aiomgr: AioManager,
Expand Down Expand Up @@ -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();

Expand Down Expand Up @@ -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()
};

Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions firewood/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion firewood/tests/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ fn db_proposal() -> Result<(), DbError> {
});
});

// Recusrive commit
// Recursive commit

let batch = vec![BatchOp::Put {
key: b"k3",
Expand Down
2 changes: 1 addition & 1 deletion firewood/tests/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 44850d1

Please sign in to comment.