-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
A-op-rethRelated to Optimism and op-rethRelated to Optimism and op-rethA-tx-poolRelated to the transaction mempoolRelated to the transaction mempoolC-debtA clean up/refactor of existing codeA clean up/refactor of existing codeD-good-first-issueNice and easy! A great choice to get startedNice and easy! A great choice to get startedOP-interopLabels for Optimism interop featuresLabels for Optimism interop features
Description
Describe the feature
we currently filter out stale interop txs and revalidate them
reth/crates/optimism/txpool/src/maintain.rs
Lines 161 to 197 in 5514dfe
| if !to_revalidate.is_empty() { | |
| let checks_stream = | |
| futures_util::stream::iter(to_revalidate.into_iter().map(|tx| { | |
| let supervisor_client = supervisor_client.clone(); | |
| async move { | |
| let check = supervisor_client | |
| .is_valid_cross_tx( | |
| tx.transaction.access_list(), | |
| tx.transaction.hash(), | |
| timestamp, | |
| Some(TRANSACTION_VALIDITY_WINDOW), | |
| // We could assume that interop is enabled, because | |
| // tx.transaction.interop() would be set only in | |
| // this case | |
| true, | |
| ) | |
| .await; | |
| (tx.clone(), check) | |
| } | |
| })) | |
| .buffered(MAX_SUPERVISOR_QUERIES); | |
| futures_util::pin_mut!(checks_stream); | |
| while let Some((tx, check)) = checks_stream.next().await { | |
| if let Some(Err(err)) = check { | |
| // We remove only bad transaction. If error caused by supervisor instability | |
| // or other fixable issues transaction would be validated on next state | |
| // change, so we ignore it | |
| if err.is_bad_transaction() { | |
| to_remove.push(*tx.transaction.hash()); | |
| } | |
| } else { | |
| tx.transaction.set_interop(TransactionInterop { | |
| timeout: timestamp + TRANSACTION_VALIDITY_WINDOW, | |
| }) | |
| } | |
| } | |
| } |
this section can be improved a bit and ideally moved into the supervisorclient that returns a new stream type that yields the results.
this would be cleaner and would allow us to easily add batch request shortly.
TODO
- move revalidation into SupervisorClient, ideally this new function returns a new
Streamtype that usesfutures::streamunder the hood
blocked by #15388
Additional context
No response
Metadata
Metadata
Assignees
Labels
A-op-rethRelated to Optimism and op-rethRelated to Optimism and op-rethA-tx-poolRelated to the transaction mempoolRelated to the transaction mempoolC-debtA clean up/refactor of existing codeA clean up/refactor of existing codeD-good-first-issueNice and easy! A great choice to get startedNice and easy! A great choice to get startedOP-interopLabels for Optimism interop featuresLabels for Optimism interop features
Type
Projects
Status
Done