chore(exex):move maximum ExExManager capacity to a constant (#11293)

Co-authored-by: Oliver <onbjerg@users.noreply.github.com>
This commit is contained in:
nk_ysg
2024-09-28 02:18:04 +08:00
committed by GitHub
parent 49f044f6e1
commit 9863a17d2d
2 changed files with 10 additions and 2 deletions

View File

@ -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.
pub const DEFAULT_EXEX_MANAGER_CAPACITY: usize = 1024;
/// Metrics for an `ExEx`.
#[derive(Metrics)]
#[metrics(scope = "exex")]

View File

@ -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;
@ -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(),
);