-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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(op, txpool): add additional update routine for conditionals #14497
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.
cool,
pedantic nit, and a suggestion
otherwise this lgtm
let Some(event) = events.next().await else { break }; | ||
if let CanonStateNotification::Commit { new } = event { | ||
if !new.is_empty() { | ||
let header = new.tip().clone().into_header(); |
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.
I blieve there should be clone_header
if !new.is_empty() { | ||
let header = new.tip().clone().into_header(); | ||
let mut to_remove = Vec::new(); | ||
for tx in &pool.pooled_transactions() { |
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.
I think this should be fine, even with a low blocktime to run every 1-2s
@hai-rise is support for 4337 conditionals even relevant for you? if not you can just not spawn this task
} | ||
} | ||
} | ||
let _ = pool.remove_transactions(to_remove); |
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.
I think we also want some metrics for this
crates/optimism/node/src/node.rs
Outdated
let chain_events = ctx.provider().canonical_state_stream(); | ||
ctx.task_executor().spawn_critical( | ||
"Op txpool maintenance task", | ||
reth_optimism_txpool::maintain::maintain_transaction_pool_future( | ||
pool, | ||
chain_events, | ||
), | ||
); |
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.
ideally this also has access to the enable conditional setting so we can spawn this based on that, I believe we can pass this setting down
OpPoolBuilder::default() | ||
.with_enable_tx_conditional(self.args.enable_tx_conditional), |
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.
great that we can already propagate additional cli settings like this
Closes: #14196