Skip to content
Merged
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
20 changes: 13 additions & 7 deletions crates/op-rbuilder/src/monitor_tx_pool.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use futures_util::StreamExt;
use reth_optimism_node::txpool::OpPooledTransaction;
use reth_transaction_pool::{AllTransactionsEvents, FullTransactionEvent};
use tracing::debug;
use tracing::info;

pub async fn monitor_tx_pool(mut new_transactions: AllTransactionsEvents<OpPooledTransaction>) {
while let Some(event) = new_transactions.next().await {
Expand All @@ -12,14 +12,16 @@ pub async fn monitor_tx_pool(mut new_transactions: AllTransactionsEvents<OpPoole
fn transaction_event_log(event: FullTransactionEvent<OpPooledTransaction>) {
match event {
FullTransactionEvent::Pending(hash) => {
debug!(
info!(
target = "monitoring",
tx_hash = hash.to_string(),
kind = "pending",
"Transaction event received"
)
}
FullTransactionEvent::Queued(hash) => {
debug!(
info!(
target = "monitoring",
tx_hash = hash.to_string(),
kind = "queued",
"Transaction event received"
Expand All @@ -28,7 +30,8 @@ fn transaction_event_log(event: FullTransactionEvent<OpPooledTransaction>) {
FullTransactionEvent::Mined {
tx_hash,
block_hash,
} => debug!(
} => info!(
target = "monitoring",
tx_hash = tx_hash.to_string(),
kind = "mined",
block_hash = block_hash.to_string(),
Expand All @@ -37,21 +40,24 @@ fn transaction_event_log(event: FullTransactionEvent<OpPooledTransaction>) {
FullTransactionEvent::Replaced {
transaction,
replaced_by,
} => debug!(
} => info!(
target = "monitoring",
tx_hash = transaction.hash().to_string(),
kind = "replaced",
replaced_by = replaced_by.to_string(),
"Transaction event received"
),
FullTransactionEvent::Discarded(hash) => {
debug!(
info!(
target = "monitoring",
tx_hash = hash.to_string(),
kind = "discarded",
"Transaction event received"
)
}
FullTransactionEvent::Invalid(hash) => {
debug!(
info!(
target = "monitoring",
tx_hash = hash.to_string(),
kind = "invalid",
"Transaction event received"
Expand Down
Loading