From 6c9c56dc9cf3cd8a7804dede4d8128f220256008 Mon Sep 17 00:00:00 2001 From: Keyao Shen Date: Mon, 21 Oct 2024 16:48:30 -0700 Subject: [PATCH] Remove unnecessary max_block_size param --- builder/src/bin/permissionless-builder.rs | 7 +++---- builder/src/lib.rs | 1 - builder/src/non_permissioned.rs | 5 ++--- marketplace-builder/src/bin/marketplace-builder.rs | 7 +++---- marketplace-builder/src/builder.rs | 5 +---- 5 files changed, 9 insertions(+), 16 deletions(-) diff --git a/builder/src/bin/permissionless-builder.rs b/builder/src/bin/permissionless-builder.rs index d73cdaffda..15b513fbaf 100644 --- a/builder/src/bin/permissionless-builder.rs +++ b/builder/src/bin/permissionless-builder.rs @@ -3,8 +3,8 @@ use std::{num::NonZeroUsize, path::PathBuf, time::Duration}; use builder::non_permissioned::{build_instance_state, BuilderConfig}; use clap::Parser; use espresso_types::{ - eth_signature_key::EthKeyPair, parse_duration, v0_3::ChainConfig, FeeVersion, - MarketplaceVersion, SequencerVersions, V0_0, V0_1, + eth_signature_key::EthKeyPair, parse_duration, FeeVersion, MarketplaceVersion, + SequencerVersions, V0_0, V0_1, }; use hotshot::traits::ValidatedState; use hotshot_types::{ @@ -156,13 +156,12 @@ async fn run( opt.tx_channel_capacity, opt.event_channel_capacity, opt.node_count, - instance_state, + instance_state.clone(), validated_state, opt.hotshot_event_streaming_url, builder_server_url, api_response_timeout_duration, opt.max_block_size_increment_period, - ChainConfig::default().max_block_size.into(), txn_timeout_duration, base_fee, ) diff --git a/builder/src/lib.rs b/builder/src/lib.rs index 924273fd1e..fe33f46e77 100755 --- a/builder/src/lib.rs +++ b/builder/src/lib.rs @@ -467,7 +467,6 @@ pub mod testing { hotshot_builder_api_url, Duration::from_millis(2000), Duration::from_secs(60), - ChainConfig::default().max_block_size.into(), Duration::from_millis(500), ChainConfig::default().base_fee, ) diff --git a/builder/src/non_permissioned.rs b/builder/src/non_permissioned.rs index 106d506d49..9011f0e527 100644 --- a/builder/src/non_permissioned.rs +++ b/builder/src/non_permissioned.rs @@ -92,7 +92,6 @@ impl BuilderConfig { hotshot_builder_apis_url: Url, max_api_timeout_duration: Duration, max_block_size_increment_period: Duration, - protocol_max_block_size: u64, maximize_txns_count_timeout_duration: Duration, base_fee: FeeAmount, ) -> anyhow::Result { @@ -102,7 +101,7 @@ impl BuilderConfig { %tx_channel_capacity, %event_channel_capacity, ?max_api_timeout_duration, - protocol_max_block_size, + ?instance_state.chain_config.max_block_size, ?maximize_txns_count_timeout_duration, "initializing builder", ); @@ -148,7 +147,7 @@ impl BuilderConfig { bootstrapped_view, bootstrapped_view, max_block_size_increment_period, - protocol_max_block_size, + instance_state.chain_config.max_block_size.into(), ); let global_state = Arc::new(RwLock::new(global_state)); diff --git a/marketplace-builder/src/bin/marketplace-builder.rs b/marketplace-builder/src/bin/marketplace-builder.rs index 9714f80bed..da9455745f 100644 --- a/marketplace-builder/src/bin/marketplace-builder.rs +++ b/marketplace-builder/src/bin/marketplace-builder.rs @@ -3,8 +3,8 @@ use std::{num::NonZeroUsize, path::PathBuf, time::Duration}; use async_compatibility_layer::logging::{setup_backtrace, setup_logging}; use clap::Parser; use espresso_types::{ - eth_signature_key::EthKeyPair, parse_duration, v0_3::ChainConfig, FeeAmount, FeeVersion, - MarketplaceVersion, NamespaceId, SequencerVersions, V0_0, V0_1, + eth_signature_key::EthKeyPair, parse_duration, FeeAmount, FeeVersion, MarketplaceVersion, + NamespaceId, SequencerVersions, V0_0, V0_1, }; use hotshot::traits::ValidatedState; use hotshot_types::{ @@ -183,12 +183,11 @@ async fn run( bootstrapped_view, opt.tx_channel_capacity, opt.event_channel_capacity, - instance_state, + instance_state.clone(), validated_state, opt.hotshot_event_streaming_url, builder_server_url, api_response_timeout_duration, - ChainConfig::default().max_block_size.into(), txn_timeout_duration, base_fee, bid_config, diff --git a/marketplace-builder/src/builder.rs b/marketplace-builder/src/builder.rs index 949017144f..60741b0960 100644 --- a/marketplace-builder/src/builder.rs +++ b/marketplace-builder/src/builder.rs @@ -148,7 +148,6 @@ impl BuilderConfig { events_api_url: Url, builder_api_url: Url, api_timeout: Duration, - protocol_max_block_size: u64, maximize_txns_count_timeout_duration: Duration, base_fee: FeeAmount, bid_config: Option, @@ -160,7 +159,7 @@ impl BuilderConfig { %tx_channel_capacity, %event_channel_capacity, ?api_timeout, - protocol_max_block_size, + ?instance_state.chain_config.max_block_size, ?maximize_txns_count_timeout_duration, "initializing builder", ); @@ -637,7 +636,6 @@ mod test { urls.event.clone(), urls.builder.clone(), Duration::from_secs(2), - ChainConfig::default().max_block_size.into(), Duration::from_secs(2), base_fee, Some(BidConfig { @@ -769,7 +767,6 @@ mod test { urls.event.clone(), urls.builder.clone(), Duration::from_secs(2), - ChainConfig::default().max_block_size.into(), Duration::from_secs(2), base_fee, None,