feat(exex): add Pool to ExExContext (#7573)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Alexey Shekhirin
2024-04-12 17:34:18 +01:00
committed by GitHub
parent 7918759b2f
commit 2dcc01210c
6 changed files with 23 additions and 16 deletions

View File

@@ -1,6 +1,6 @@
use futures::Future;
use reth::builder::FullNodeTypes;
use reth_exex::ExExContext;
use reth_node_api::FullNodeComponents;
use reth_node_ethereum::EthereumNode;
use reth_provider::CanonStateNotification;
@@ -8,7 +8,7 @@ use reth_provider::CanonStateNotification;
///
/// During initialization you can wait for resources you need to be up for the ExEx to function,
/// like a database connection.
async fn exex_init<Node: FullNodeTypes>(
async fn exex_init<Node: FullNodeComponents>(
ctx: ExExContext<Node>,
) -> eyre::Result<impl Future<Output = eyre::Result<()>>> {
Ok(exex(ctx))
@@ -18,7 +18,7 @@ async fn exex_init<Node: FullNodeTypes>(
///
/// This ExEx just prints out whenever a state transition happens, either a new chain segment being
/// added, or a chain segment being re-orged.
async fn exex<Node: FullNodeTypes>(mut ctx: ExExContext<Node>) -> eyre::Result<()> {
async fn exex<Node: FullNodeComponents>(mut ctx: ExExContext<Node>) -> eyre::Result<()> {
while let Some(notification) = ctx.notifications.recv().await {
match &notification {
CanonStateNotification::Commit { new } => {

View File

@@ -1,7 +1,7 @@
use alloy_sol_types::{sol, SolEventInterface};
use futures::Future;
use reth::builder::FullNodeTypes;
use reth_exex::{ExExContext, ExExEvent};
use reth_node_api::FullNodeComponents;
use reth_node_ethereum::EthereumNode;
use reth_primitives::{Log, SealedBlockWithSenders, TransactionSigned};
use reth_provider::Chain;
@@ -14,7 +14,7 @@ use crate::L1StandardBridge::{ETHBridgeFinalized, ETHBridgeInitiated, L1Standard
/// Initializes the ExEx.
///
/// Opens up a SQLite database and creates the tables (if they don't exist).
async fn init<Node: FullNodeTypes>(
async fn init<Node: FullNodeComponents>(
ctx: ExExContext<Node>,
mut connection: Connection,
) -> eyre::Result<impl Future<Output = eyre::Result<()>>> {
@@ -88,7 +88,7 @@ fn create_tables(connection: &mut Connection) -> rusqlite::Result<()> {
/// An example of ExEx that listens to ETH bridging events from OP Stack chains
/// and stores deposits and withdrawals in a SQLite database.
async fn op_bridge_exex<Node: FullNodeTypes>(
async fn op_bridge_exex<Node: FullNodeComponents>(
mut ctx: ExExContext<Node>,
connection: Connection,
) -> eyre::Result<()> {