mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
config cache from cli (#6767)
This commit is contained in:
7
book/cli/reth/node.md
vendored
7
book/cli/reth/node.md
vendored
@ -344,10 +344,15 @@ TxPool:
|
||||
[default: 100]
|
||||
|
||||
--txpool.max_tx_input_bytes <MAX_TX_INPUT_BYTES>
|
||||
Maximum size a single transaction can have
|
||||
Maximum size a single transaction can have
|
||||
|
||||
[default: 131072]
|
||||
|
||||
--txpool.max_cached_entries <MAX_CACHED_ENTRIES>
|
||||
The maximum number of blobs to keep in the in memory blob cache
|
||||
|
||||
[default: 100]
|
||||
|
||||
--txpool.nolocals
|
||||
Flag to disable local transaction exemptions
|
||||
|
||||
|
||||
@ -4,8 +4,9 @@ use crate::cli::config::RethTransactionPoolConfig;
|
||||
use clap::Args;
|
||||
use reth_primitives::Address;
|
||||
use reth_transaction_pool::{
|
||||
validate::DEFAULT_MAX_TX_INPUT_BYTES, LocalTransactionConfig, PoolConfig, PriceBumpConfig,
|
||||
SubPoolLimit, DEFAULT_PRICE_BUMP, REPLACE_BLOB_PRICE_BUMP, TXPOOL_MAX_ACCOUNT_SLOTS_PER_SENDER,
|
||||
blobstore::disk::DEFAULT_MAX_CACHED_BLOBS, validate::DEFAULT_MAX_TX_INPUT_BYTES,
|
||||
LocalTransactionConfig, PoolConfig, PriceBumpConfig, SubPoolLimit, DEFAULT_PRICE_BUMP,
|
||||
REPLACE_BLOB_PRICE_BUMP, TXPOOL_MAX_ACCOUNT_SLOTS_PER_SENDER,
|
||||
TXPOOL_SUBPOOL_MAX_SIZE_MB_DEFAULT, TXPOOL_SUBPOOL_MAX_TXS_DEFAULT,
|
||||
};
|
||||
/// Parameters for debugging purposes
|
||||
@ -49,6 +50,10 @@ pub struct TxPoolArgs {
|
||||
#[arg(long = "txpool.max_tx_input_bytes", default_value_t = DEFAULT_MAX_TX_INPUT_BYTES)]
|
||||
pub max_tx_input_bytes: usize,
|
||||
|
||||
/// The maximum number of blobs to keep in the in memory blob cache.
|
||||
#[arg(long = "txpool.max_cached_entries", default_value_t = DEFAULT_MAX_CACHED_BLOBS)]
|
||||
pub max_cached_entries: u32,
|
||||
|
||||
/// Flag to disable local transaction exemptions.
|
||||
#[arg(long = "txpool.nolocals")]
|
||||
pub no_locals: bool,
|
||||
@ -73,6 +78,7 @@ impl Default for TxPoolArgs {
|
||||
price_bump: DEFAULT_PRICE_BUMP,
|
||||
blob_transaction_price_bump: REPLACE_BLOB_PRICE_BUMP,
|
||||
max_tx_input_bytes: DEFAULT_MAX_TX_INPUT_BYTES,
|
||||
max_cached_entries: DEFAULT_MAX_CACHED_BLOBS,
|
||||
no_locals: false,
|
||||
locals: Default::default(),
|
||||
no_local_transactions_propagation: false,
|
||||
|
||||
@ -63,8 +63,8 @@ use reth_stages::{
|
||||
};
|
||||
use reth_tasks::TaskExecutor;
|
||||
use reth_transaction_pool::{
|
||||
blobstore::DiskFileBlobStore, EthTransactionPool, TransactionPool,
|
||||
TransactionValidationTaskExecutor,
|
||||
blobstore::{DiskFileBlobStore, DiskFileBlobStoreConfig},
|
||||
EthTransactionPool, TransactionPool, TransactionValidationTaskExecutor,
|
||||
};
|
||||
use revm_inspectors::stack::Hook;
|
||||
use secp256k1::SecretKey;
|
||||
@ -467,7 +467,11 @@ impl NodeConfig {
|
||||
+ Clone
|
||||
+ 'static,
|
||||
{
|
||||
let blob_store = DiskFileBlobStore::open(data_dir.blobstore_path(), Default::default())?;
|
||||
let blob_store = DiskFileBlobStore::open(
|
||||
data_dir.blobstore_path(),
|
||||
DiskFileBlobStoreConfig::default()
|
||||
.with_max_cached_entries(self.txpool.max_cached_entries),
|
||||
)?;
|
||||
let validator = TransactionValidationTaskExecutor::eth_builder(Arc::clone(&self.chain))
|
||||
.with_head_timestamp(head.timestamp)
|
||||
.kzg_settings(self.kzg_settings()?)
|
||||
|
||||
@ -400,6 +400,14 @@ impl Default for DiskFileBlobStoreConfig {
|
||||
}
|
||||
}
|
||||
|
||||
impl DiskFileBlobStoreConfig {
|
||||
/// Set maximum number of blobs to keep in the in memory blob cache.
|
||||
pub const fn with_max_cached_entries(mut self, max_cached_entries: u32) -> Self {
|
||||
self.max_cached_entries = max_cached_entries;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// How to open a disk file blob store.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
|
||||
pub enum OpenDiskFileBlobStore {
|
||||
|
||||
Reference in New Issue
Block a user