From 1508ae3db4b0595e61136d4d28e10777c92a7273 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=BF=97=E5=AE=87?= Date: Tue, 10 Dec 2024 22:53:12 +1100 Subject: [PATCH] chore: Fix typos --- crates/chain/src/canonical_iter.rs | 2 +- docs/adr/0003_canonicalization_algorithm.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/chain/src/canonical_iter.rs b/crates/chain/src/canonical_iter.rs index 6a12bbf2..99550ab7 100644 --- a/crates/chain/src/canonical_iter.rs +++ b/crates/chain/src/canonical_iter.rs @@ -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, reason: CanonicalReason) { let starting_txid = txid; diff --git a/docs/adr/0003_canonicalization_algorithm.md b/docs/adr/0003_canonicalization_algorithm.md index 503e857e..c3062cbc 100644 --- a/docs/adr/0003_canonicalization_algorithm.md +++ b/docs/adr/0003_canonicalization_algorithm.md @@ -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. -- 2.49.0