Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: move bitflags to workspace #4220

Merged
merged 2 commits into from
Aug 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading