Skip to content

Commit

Permalink
chore(exex):move maximum ExExManager capacity to a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
nkysg committed Sep 27, 2024
1 parent ea060fe commit 5db1936
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions crates/exex/exex/src/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ use tokio::sync::{
};
use tokio_util::sync::{PollSendError, PollSender, ReusableBoxFuture};

/// Default max size of the internal state notifications buffer
/// 1024 notifications in the buffer is 3.5 hours of mainnet blocks,
/// or 17 minutes of 1-second blocks. It should be enough for any use-case,
/// and we can make it configurable once there's a demand for that.
pub const DEFAULT_EXEX_MANAGER_CAPACITY: usize = 1024;

/// Metrics for an `ExEx`.
#[derive(Metrics)]
#[metrics(scope = "exex")]
Expand Down
6 changes: 4 additions & 2 deletions crates/node/builder/src/launch/exex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ use std::{fmt, fmt::Debug};
use futures::future;
use reth_chain_state::ForkChoiceSubscriptions;
use reth_chainspec::EthChainSpec;
use reth_exex::{ExExContext, ExExHandle, ExExManager, ExExManagerHandle, Wal};
use reth_exex::{
ExExContext, ExExHandle, ExExManager, ExExManagerHandle, Wal, DEFAULT_EXEX_MANAGER_CAPACITY,
};
use reth_node_api::{FullNodeComponents, NodeTypes};
use reth_primitives::Head;
use reth_provider::CanonStateSubscriptions;
Expand Down Expand Up @@ -108,7 +110,7 @@ impl<Node: FullNodeComponents + Clone> ExExLauncher<Node> {
// todo(onbjerg): rm magic number
let exex_manager = ExExManager::new(
exex_handles,
1024,
DEFAULT_EXEX_MANAGER_CAPACITY,
exex_wal,
components.provider().finalized_block_stream(),
);
Expand Down

0 comments on commit 5db1936

Please sign in to comment.