-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: add no-local-exemptions settings to MaintainPoolConfig #15651
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
feat: add no-local-exemptions settings to MaintainPoolConfig #15651
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nits, we also need to configure this when we create it
reth/crates/ethereum/node/src/node.rs
Line 411 in d68dd40
reth_transaction_pool::maintain::MaintainPoolConfig { |
/// This includes: | ||
/// - no price exemptions | ||
/// - no eviction exemptions | ||
pub no_exemptions: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pub no_exemptions: bool, | |
pub no_local_exemptions: bool, |
// filter stale transactions based on config | ||
if config.no_exemptions { | ||
// if no exemptions, treat all transactions the same | ||
tx.timestamp.elapsed() > config.max_tx_lifetime | ||
} else { | ||
// only evict external transactions | ||
tx.origin.is_external() && tx.timestamp.elapsed() > config.max_tx_lifetime | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can simplify this a bit by combining the first tx.origin.is_external()
with config.no_exemptions
(config.no_exemptions || tx.origin.is_external())
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, ty
closes #15638