Skip to content

Commit

Permalink
chore: Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlinjin committed Dec 10, 2024
1 parent af92199 commit 1508ae3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/chain/src/canonical_iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl<'g, A: Anchor, C: ChainOracle> CanonicalIter<'g, A, C> {
Ok(())
}

/// Marks a transaction and it's ancestors as canoncial. Mark all conflicts of these as
/// Marks a transaction and it's ancestors as canonical. Mark all conflicts of these as
/// `not_canonical`.
fn mark_canonical(&mut self, txid: Txid, tx: Arc<Transaction>, reason: CanonicalReason<A>) {
let starting_txid = txid;
Expand Down
4 changes: 2 additions & 2 deletions docs/adr/0003_canonicalization_algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ The algorithm's premise is as follows:
5. A transaction with a higher last-seen has precedence.
6. Last-seen values are transitive. A transaction's real last-seen value is the max between it's last-seen value all of it's descendants.

Like Option 3's algorithm, we maintain two mutually-exclusive `txid` sets: `canoncial` and `not_canonical`.
Like Option 3's algorithm, we maintain two mutually-exclusive `txid` sets: `canonical` and `not_canonical`.

Imagine a method `mark_canonical(A)` that is based on premise 1 and 2. This method will mark transaction `A` and all of it's ancestors as canonical. For each transaction that is marked canonical, we can iterate all of it's conflicts and mark those as `non_canonical`. If a transaction already exists in `canoncial` or `not_canonical`, we can break early, avoiding duplicate work.
Imagine a method `mark_canonical(A)` that is based on premise 1 and 2. This method will mark transaction `A` and all of it's ancestors as canonical. For each transaction that is marked canonical, we can iterate all of it's conflicts and mark those as `non_canonical`. If a transaction already exists in `canonical` or `not_canonical`, we can break early, avoiding duplicate work.

This algorithm iterates transactions in 3 runs.

Expand Down

0 comments on commit 1508ae3

Please sign in to comment.