Skip to content

Commit

Permalink
chore: move bitflags to workspace (#4220)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Aug 16, 2023
1 parent 7cd7859 commit 43601e3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ ethers-middleware = { version = "2.0.8", default-features = false }

## misc
bytes = "1.4"
bitflags = "2.3"
tracing = "0.1.0"
tracing-appender = "0.2"
thiserror = "1.0.37"
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/libmdbx-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repository.workspace = true
name = "reth_libmdbx"

[dependencies]
bitflags = "2"
bitflags.workspace = true
byteorder = "1"
derive_more = "0.99"
indexmap = "1"
Expand Down
2 changes: 1 addition & 1 deletion crates/transaction-pool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ thiserror.workspace = true
tracing.workspace = true
serde = { workspace = true, features = ["derive", "rc"], optional = true }
fnv = "1.0.7"
bitflags = "1.3"
bitflags.workspace = true
auto_impl = "1.0"

# testing
Expand Down
8 changes: 4 additions & 4 deletions crates/transaction-pool/src/pool/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(Default)]
#[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 = 0b100000;
Expand All @@ -20,11 +20,11 @@ bitflags::bitflags! {
/// Set to 1 if `feeCap` of the transaction meets the requirement of the pending block.
const ENOUGH_FEE_CAP_BLOCK = 0b000010;

const PENDING_POOL_BITS = Self::NO_PARKED_ANCESTORS.bits | Self::NO_NONCE_GAPS.bits | Self::ENOUGH_BALANCE.bits | Self::NOT_TOO_MUCH_GAS.bits | Self::ENOUGH_FEE_CAP_BLOCK.bits;
const PENDING_POOL_BITS = Self::NO_PARKED_ANCESTORS.bits()| Self::NO_NONCE_GAPS.bits() | Self::ENOUGH_BALANCE.bits() | Self::NOT_TOO_MUCH_GAS.bits() | Self::ENOUGH_FEE_CAP_BLOCK.bits();

const BASE_FEE_POOL_BITS = Self::NO_PARKED_ANCESTORS.bits | Self::NO_NONCE_GAPS.bits | Self::ENOUGH_BALANCE.bits | Self::NOT_TOO_MUCH_GAS.bits;
const BASE_FEE_POOL_BITS = Self::NO_PARKED_ANCESTORS.bits() | Self::NO_NONCE_GAPS.bits() | Self::ENOUGH_BALANCE.bits() | Self::NOT_TOO_MUCH_GAS.bits();

const QUEUED_POOL_BITS = Self::NO_PARKED_ANCESTORS.bits;
const QUEUED_POOL_BITS = Self::NO_PARKED_ANCESTORS.bits();

}
}
Expand Down

0 comments on commit 43601e3

Please sign in to comment.