Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/apollo_batcher_config/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ apollo_config.workspace = true
apollo_storage.workspace = true
blockifier.workspace = true
serde = { workspace = true, features = ["derive"] }
starknet_api.workspace = true
url.workspace = true
validator.workspace = true

Expand Down
41 changes: 41 additions & 0 deletions crates/apollo_batcher_config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use blockifier::blockifier_versioned_constants::VersionedConstantsOverrides;
use blockifier::bouncer::BouncerConfig;
use blockifier::context::ChainInfo;
use serde::{Deserialize, Serialize};
use starknet_api::block::{BlockHash, BlockNumber};
use url::Url;
use validator::{Validate, ValidationError};

Expand Down Expand Up @@ -137,6 +138,39 @@ impl SerializeConfig for PreconfirmedCendeConfig {
}
}

#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Default)]
pub struct FirstBlockWithPartialBlockHash {
pub block_number: BlockNumber,
pub block_hash: BlockHash,
pub parent_block_hash: BlockHash,
}

impl SerializeConfig for FirstBlockWithPartialBlockHash {
fn dump(&self) -> BTreeMap<ParamPath, SerializedParam> {
BTreeMap::from([
ser_param(
"block_number",
&self.block_number,
"The number of the first block with a partial block hash components.",
ParamPrivacyInput::Public,
),
ser_param(
"block_hash",
&self.block_hash,
"The hash of the first block with a partial block hash components.",
ParamPrivacyInput::Public,
),
ser_param(
"parent_block_hash",
&self.parent_block_hash,
"The hash of the parent block of the first block with a partial block hash \
components.",
ParamPrivacyInput::Public,
),
])
}
}

/// The batcher related configuration.
#[derive(Clone, Debug, Serialize, Deserialize, Validate, PartialEq)]
#[validate(schema(function = "validate_batcher_config"))]
Expand All @@ -150,6 +184,7 @@ pub struct BatcherConfig {
pub max_l1_handler_txs_per_block_proposal: usize,
pub pre_confirmed_cende_config: PreconfirmedCendeConfig,
pub propose_l1_txs_every: u64,
pub first_block_with_partial_block_hash: FirstBlockWithPartialBlockHash,
}

impl SerializeConfig for BatcherConfig {
Expand Down Expand Up @@ -199,6 +234,10 @@ impl SerializeConfig for BatcherConfig {
self.pre_confirmed_cende_config.dump(),
"pre_confirmed_cende_config",
));
dump.append(&mut prepend_sub_config_name(
self.first_block_with_partial_block_hash.dump(),
"first_block_with_partial_block_hash",
));
dump
}
}
Expand All @@ -224,6 +263,8 @@ impl Default for BatcherConfig {
max_l1_handler_txs_per_block_proposal: 3,
pre_confirmed_cende_config: PreconfirmedCendeConfig::default(),
propose_l1_txs_every: 1, // Default is to propose L1 transactions every proposal.
// TODO(Rotem): set a more reasonable default value.
first_block_with_partial_block_hash: FirstBlockWithPartialBlockHash::default(),
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,8 @@
"batcher_config.storage.mmap_file_config.max_object_size": 1073741824,
"batcher_config.storage.mmap_file_config.max_size": 1099511627776,
"batcher_config.storage.scope": "StateOnly",
"batcher_config.propose_l1_txs_every": 10
"batcher_config.propose_l1_txs_every": 10,
"batcher_config.first_block_with_partial_block_hash.block_number": 0,
"batcher_config.first_block_with_partial_block_hash.block_hash": "0x0",
"batcher_config.first_block_with_partial_block_hash.parent_block_hash": "0x0"
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"batcher_config.contract_class_manager_config.native_compiler_config.max_memory_usage": 16106127360,
"batcher_config.contract_class_manager_config.native_compiler_config.max_memory_usage.#is_none": false,
"batcher_config.contract_class_manager_config.native_compiler_config.optimization_level": 2,
"batcher_config.first_block_with_partial_block_hash.block_hash": "0x0",
"batcher_config.first_block_with_partial_block_hash.block_number": 0,
"batcher_config.first_block_with_partial_block_hash.parent_block_hash": "0x0",
"batcher_config.input_stream_content_buffer_size": 4000,
"batcher_config.max_l1_handler_txs_per_block_proposal": 200,
"batcher_config.outstream_content_buffer_size": 64,
Expand Down
15 changes: 15 additions & 0 deletions crates/apollo_node/resources/config_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,21 @@
"privacy": "Public",
"value": 2
},
"batcher_config.first_block_with_partial_block_hash.block_hash": {
"description": "The hash of the first block with a partial block hash components.",
"privacy": "Public",
"value": "0x0"
},
"batcher_config.first_block_with_partial_block_hash.block_number": {
"description": "The number of the first block with a partial block hash components.",
"privacy": "Public",
"value": 0
},
"batcher_config.first_block_with_partial_block_hash.parent_block_hash": {
"description": "The hash of the parent block of the first block with a partial block hash components.",
"privacy": "Public",
"value": "0x0"
},
"batcher_config.input_stream_content_buffer_size": {
"description": "Sets the buffer size for the input transaction channel. Adding more transactions beyond this limit will block until space is available.",
"privacy": "Public",
Expand Down
Loading