Skip to content

Commit

Permalink
chore: docs proofreading (#883)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pan-chao authored Feb 12, 2024
1 parent 951c9de commit 9616f8e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/node/nodedb.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (ndb *nodeDB) deleteVersion(version int64) error {
}
```

##### Travesing Orphans
##### Traversing Orphans

The traverseOrphans algorithm is shown below:

Expand Down
8 changes: 4 additions & 4 deletions docs/proof/proof.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ proof can prove that the key `ab` is not in the tree, because if it was it would
ordered between `a` and `b` - it is clear from the proof that there is no such node, and if
there was it would cause the parent hashes to be different from what we see.

Range proofs can be generated for non-existant endpoints by including the nearest neighboring
Range proofs can be generated for non-existent endpoints by including the nearest neighboring
keys, which allows them to cover any arbitrary key range. This can also be used to generate an
absence proof for a _single_ non-existant key, by returning a range proof between the two nearest
absence proof for a _single_ non-existent key, by returning a range proof between the two nearest
neighbors. The range proof is therefore a complete proof for all existing and all absent key/value
pairs ordered between two arbitrary endpoints.

Expand Down Expand Up @@ -139,7 +139,7 @@ func main() {

### Tree Root Hash

Proofs are verified against the root hash of an IAVL tree. This root hash is retrived via
Proofs are verified against the root hash of an IAVL tree. This root hash is retrieved via
`MutableTree.Hash()` or `ImmutableTree.Hash()`, returning a `[]byte` hash. It is also returned by
`MutableTree.SaveVersion()`, as shown above.

Expand Down Expand Up @@ -297,7 +297,7 @@ type RangeProof struct {
`c=3` already traversed in `LeftPath`, and `[e]` contains data about the `e` inner node needed
to prove `d=4`.

* `Leaves` contains data about the leaf nodes in the range. For the range `a` to `e` (exluding
* `Leaves` contains data about the leaf nodes in the range. For the range `a` to `e` (excluding
`e=5`) this contains info about `a=1`, `b=2`, `c=3`, and `d=4` in left-to-right order.

Note that `Leaves` may contain additional leaf nodes outside the requested range, for example to
Expand Down
4 changes: 2 additions & 2 deletions docs/tree/mutable_tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ If `removeKey` does not exist in the IAVL tree, RemovedValue is `nil`.

Anytime a node is unbalanced such that the height of its left branch and the height of its right branch differs by more than 1, the IAVL tree will rebalance itself.

This is acheived by rotating the subtrees until there is no more than one height difference between two branches of any subtree in the IAVL.
This is achieved by rotating the subtrees until there is no more than one height difference between two branches of any subtree in the IAVL.

Since Balance is mutating the structure of the tree, any displaced nodes will be orphaned.

Expand Down Expand Up @@ -262,7 +262,7 @@ Orphaned: 6, 8
Orphaned: 6
```

Note: 6 got orphaned again, so omit list repitition
Note: 6 got orphaned again, so omit list repetition

#### Right Right Case

Expand Down

0 comments on commit 9616f8e

Please sign in to comment.