Skip to content

Commit f19a7f3

Browse files
authored
feat: log config (#239)
* feat: log config * feat: use ScrollChainConfig for num l1 messages per block * fix: fmt
1 parent deae682 commit f19a7f3

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

crates/node/src/add_ons/rollup.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use reth_network_api::FullNetwork;
66
use reth_node_api::{FullNodeTypes, NodeTypes};
77
use reth_node_builder::{rpc::RpcHandle, AddOnsContext, FullNodeComponents};
88
use reth_rpc_eth_api::EthApiTypes;
9-
use reth_scroll_chainspec::ScrollChainSpec;
9+
use reth_scroll_chainspec::{ChainConfig, ScrollChainConfig, ScrollChainSpec};
1010
use reth_scroll_node::ScrollNetworkPrimitives;
1111
use rollup_node_manager::RollupManagerHandle;
1212
use rollup_node_watcher::L1Notification;
@@ -52,7 +52,8 @@ impl RollupManagerAddOn {
5252
rpc: RpcHandle<N, EthApi>,
5353
) -> eyre::Result<(RollupManagerHandle, Option<Sender<Arc<L1Notification>>>)>
5454
where
55-
<<N as FullNodeTypes>::Types as NodeTypes>::ChainSpec: ScrollHardforks + IsDevChain,
55+
<<N as FullNodeTypes>::Types as NodeTypes>::ChainSpec:
56+
ChainConfig<Config = ScrollChainConfig> + ScrollHardforks + IsDevChain,
5657
N::Network: NetworkProtocols + FullNetwork<Primitives = ScrollNetworkPrimitives>,
5758
{
5859
let (rnm, handle, l1_notification_tx) = self

crates/node/src/args.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use reth_network::NetworkProtocols;
1818
use reth_network_api::FullNetwork;
1919
use reth_node_builder::rpc::RethRpcServerHandles;
2020
use reth_node_core::primitives::BlockHeader;
21-
use reth_scroll_chainspec::SCROLL_FEE_VAULT_ADDRESS;
21+
use reth_scroll_chainspec::{ChainConfig, ScrollChainConfig, SCROLL_FEE_VAULT_ADDRESS};
2222
use reth_scroll_node::ScrollNetworkPrimitives;
2323
use rollup_node_manager::{
2424
Consensus, NoopConsensus, RollupManagerHandle, RollupNodeManager, SystemContractConsensus,
@@ -129,7 +129,11 @@ impl ScrollRollupNodeConfig {
129129
)>
130130
where
131131
N: FullNetwork<Primitives = ScrollNetworkPrimitives> + NetworkProtocols,
132-
CS: EthChainSpec<Header: BlockHeader> + ScrollHardforks + IsDevChain + 'static,
132+
CS: EthChainSpec<Header: BlockHeader>
133+
+ ChainConfig<Config = ScrollChainConfig>
134+
+ ScrollHardforks
135+
+ IsDevChain
136+
+ 'static,
133137
{
134138
tracing::info!(target: "rollup_node::args",
135139
"Building rollup node with config:\n{:#?}",
@@ -267,13 +271,14 @@ impl ScrollRollupNodeConfig {
267271
let l1_provider = FullL1Provider::new(blob_provider, l1_messages_provider.clone()).await;
268272

269273
// Construct the Sequencer.
274+
let chain_config = chain_spec.chain_config();
270275
let (sequencer, block_time) = if self.sequencer_args.sequencer_enabled {
271276
let args = &self.sequencer_args;
272277
let sequencer = Sequencer::new(
273278
Arc::new(l1_messages_provider),
274279
args.fee_recipient,
275280
ctx.block_gas_limit,
276-
args.max_l1_messages_per_block,
281+
chain_config.l1_config.num_l1_messages_per_block,
277282
0,
278283
self.sequencer_args.l1_message_inclusion_mode,
279284
);
@@ -479,9 +484,6 @@ pub struct SequencerArgs {
479484
/// The payload building duration for the sequencer (milliseconds)
480485
#[arg(long = "sequencer.payload-building-duration", id = "sequencer_payload_building_duration", value_name = "SEQUENCER_PAYLOAD_BUILDING_DURATION", default_value_t = constants::DEFAULT_PAYLOAD_BUILDING_DURATION)]
481486
pub payload_building_duration: u64,
482-
/// The max L1 messages per block for the sequencer.
483-
#[arg(long = "sequencer.max-l1-messages-per-block", id = "sequencer_max_l1_messages_per_block", value_name = "SEQUENCER_MAX_L1_MESSAGES_PER_BLOCK", default_value_t = constants::DEFAULT_MAX_L1_MESSAGES_PER_BLOCK)]
484-
pub max_l1_messages_per_block: u64,
485487
/// The fee recipient for the sequencer.
486488
#[arg(long = "sequencer.fee-recipient", id = "sequencer_fee_recipient", value_name = "SEQUENCER_FEE_RECIPIENT", default_value_t = SCROLL_FEE_VAULT_ADDRESS)]
487489
pub fee_recipient: Address,

crates/node/src/constants.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ pub(crate) const DEFAULT_PAYLOAD_BUILDING_DURATION: u64 = 800;
1818
/// The default payload size limit in bytes for the sequencer.
1919
pub(crate) const DEFAULT_PAYLOAD_SIZE_LIMIT: u64 = 122_880;
2020

21-
/// The default max L1 messages per block for the sequencer.
22-
pub(crate) const DEFAULT_MAX_L1_MESSAGES_PER_BLOCK: u64 = 4;
23-
2421
/// The gap in blocks between the P2P and EN which triggers sync.
2522
pub(crate) const BLOCK_GAP_TRIGGER: u64 = 500_000;
2623

crates/node/src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ fn main() {
2323
let handle = builder
2424
.node(ScrollRollupNode::new(args))
2525
.launch_with_fn(|builder| {
26+
info!(target: "reth::cli", config = ?builder.config().chain.config, "Running with config");
27+
2628
// We must use `always_process_payload_attributes_on_canonical_head` in order to
2729
// be able to build payloads with the forkchoice state API
2830
// on top of heads part of the canonical state. Not

crates/node/src/test_utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ pub fn default_sequencer_test_scroll_rollup_node_config() -> ScrollRollupNodeCon
168168
sequencer_enabled: true,
169169
block_time: 50,
170170
payload_building_duration: 40,
171-
max_l1_messages_per_block: 0,
172171
fee_recipient: Default::default(),
173172
l1_message_inclusion_mode: L1MessageInclusionMode::BlockDepth(0),
174173
},

crates/node/tests/e2e.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ async fn can_bridge_l1_messages() -> eyre::Result<()> {
4949
sequencer_args: SequencerArgs {
5050
sequencer_enabled: true,
5151
block_time: 0,
52-
max_l1_messages_per_block: 4,
5352
l1_message_inclusion_mode: L1MessageInclusionMode::BlockDepth(0),
5453
..SequencerArgs::default()
5554
},
@@ -119,7 +118,6 @@ async fn can_sequence_and_gossip_blocks() {
119118
sequencer_args: SequencerArgs {
120119
sequencer_enabled: true,
121120
block_time: 0,
122-
max_l1_messages_per_block: 4,
123121
l1_message_inclusion_mode: L1MessageInclusionMode::BlockDepth(0),
124122
payload_building_duration: 1000,
125123
..SequencerArgs::default()
@@ -831,7 +829,6 @@ async fn can_handle_reorgs_while_sequencing() -> eyre::Result<()> {
831829
.expect("valid url that will not be used as test batches use calldata"),
832830
);
833831
config.engine_driver_args.sync_at_startup = false;
834-
config.sequencer_args.max_l1_messages_per_block = 1;
835832

836833
let (_, events) = ScrollWireProtocolHandler::new(ScrollWireConfig::new(true));
837834
let (rnm, handle, l1_watcher_tx) = config

crates/sequencer/tests/e2e.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,6 @@ async fn can_sequence_blocks_with_private_key_file() -> eyre::Result<()> {
450450
sequencer_args: SequencerArgs {
451451
sequencer_enabled: true,
452452
block_time: 0,
453-
max_l1_messages_per_block: 4,
454453
l1_message_inclusion_mode: L1MessageInclusionMode::BlockDepth(0),
455454
payload_building_duration: 1000,
456455
..SequencerArgs::default()
@@ -541,7 +540,6 @@ async fn can_sequence_blocks_with_hex_key_file_without_prefix() -> eyre::Result<
541540
sequencer_args: SequencerArgs {
542541
sequencer_enabled: true,
543542
block_time: 0,
544-
max_l1_messages_per_block: 4,
545543
l1_message_inclusion_mode: L1MessageInclusionMode::BlockDepth(0),
546544
payload_building_duration: 1000,
547545
..SequencerArgs::default()

0 commit comments

Comments
 (0)