From 281486c552356e3712fce9b0806559546da3e939 Mon Sep 17 00:00:00 2001 From: Delweng Date: Thu, 8 Feb 2024 09:57:32 +0800 Subject: [PATCH] chore(txpool): fix some format and typo (#6481) Signed-off-by: jsvisa --- crates/transaction-pool/docs/mermaid/txpool.mmd | 4 ++-- crates/transaction-pool/src/identifier.rs | 4 ++-- crates/transaction-pool/src/pool/state.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/transaction-pool/docs/mermaid/txpool.mmd b/crates/transaction-pool/docs/mermaid/txpool.mmd index 2f0e740bb..94f3abda3 100644 --- a/crates/transaction-pool/docs/mermaid/txpool.mmd +++ b/crates/transaction-pool/docs/mermaid/txpool.mmd @@ -28,5 +28,5 @@ graph TB B1 --> |increased base fee| B2 B2 --> |decreased base fee| B1 B3 --> |promote| B1 - B3 --> |promote| B2 - new --> |apply state changes| pool + B3 --> |promote| B2 + new --> |apply state changes| pool diff --git a/crates/transaction-pool/src/identifier.rs b/crates/transaction-pool/src/identifier.rs index 108c514ca..6ec1527bd 100644 --- a/crates/transaction-pool/src/identifier.rs +++ b/crates/transaction-pool/src/identifier.rs @@ -91,7 +91,7 @@ impl TransactionId { /// Returns the `TransactionId` this transaction depends on. /// /// This returns `transaction_nonce - 1` if `transaction_nonce` is higher than the - /// `on_chain_none` + /// `on_chain_nonce` pub fn ancestor( transaction_nonce: u64, on_chain_nonce: u64, @@ -114,7 +114,7 @@ impl TransactionId { TransactionId::new(self.sender, self.nonce + 1) } - /// Returns the nonce the follows directly after this. + /// Returns the nonce that follows immediately after this one. #[inline] pub(crate) const fn next_nonce(&self) -> u64 { self.nonce + 1 diff --git a/crates/transaction-pool/src/pool/state.rs b/crates/transaction-pool/src/pool/state.rs index 2e6a54123..5c2f20bfd 100644 --- a/crates/transaction-pool/src/pool/state.rs +++ b/crates/transaction-pool/src/pool/state.rs @@ -2,7 +2,7 @@ bitflags::bitflags! { /// Marker to represents the current state of a transaction in the pool and from which the corresponding sub-pool is derived, depending on what bits are set. /// /// This mirrors [erigon's ephemeral state field](https://github.com/ledgerwatch/erigon/wiki/Transaction-Pool-Design#ordering-function). - #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, PartialOrd, Ord)] + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, PartialOrd, Ord)] pub(crate) struct TxState: u8 { /// Set to `1` if all ancestor transactions are pending. const NO_PARKED_ANCESTORS = 0b10000000;