Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
"state_sync_config.storage_config.mmap_file_config.growth_step": 2147483648,
"state_sync_config.storage_config.mmap_file_config.max_object_size": 1073741824,
"state_sync_config.storage_config.mmap_file_config.max_size": 1099511627776,
"state_sync_config.storage_config.scope": "FullArchive"
"state_sync_config.storage_config.scope": "FullArchive",
"state_sync_config.storage_reader_server_config.enable": false,
"state_sync_config.storage_reader_server_config.ip": "0.0.0.0",
"state_sync_config.storage_reader_server_config.port": "$$$_STATE_SYNC_CONFIG-STORAGE_READER_SERVER_CONFIG-PORT_$$$"
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@
"state_sync_config.storage_config.mmap_file_config.growth_step": 2147483648,
"state_sync_config.storage_config.mmap_file_config.max_object_size": 1073741824,
"state_sync_config.storage_config.mmap_file_config.max_size": 1099511627776,
"state_sync_config.storage_config.scope": "FullArchive"
"state_sync_config.storage_config.scope": "FullArchive",
"state_sync_config.storage_reader_server_config.enable": false,
"state_sync_config.storage_reader_server_config.ip": "0.0.0.0",
"state_sync_config.storage_reader_server_config.port": 8080
}
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 @@ -3124,6 +3124,21 @@
"privacy": "Public",
"value": "FullArchive"
},
"state_sync_config.storage_reader_server_config.enable": {
"description": "Whether to enable the storage reader HTTP server.",
"privacy": "Public",
"value": false
},
"state_sync_config.storage_reader_server_config.ip": {
"description": "The IP address for the storage reader HTTP server.",
"privacy": "Public",
"value": "0.0.0.0"
},
"state_sync_config.storage_reader_server_config.port": {
"description": "The port for the storage reader HTTP server.",
"privacy": "Public",
"value": 8080
},
"strk_fee_token_address": {
"description": "Address of the STRK fee token.",
"privacy": "TemporaryValue",
Expand Down
1 change: 1 addition & 0 deletions crates/apollo_state_sync/src/runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ impl StateSyncRunner {
network_config,
revert_config,
rpc_config,
storage_reader_server_config: _,
} = config;

let StateSyncResources {
Expand Down
8 changes: 8 additions & 0 deletions crates/apollo_state_sync_config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use apollo_p2p_sync_config::config::P2pSyncClientConfig;
use apollo_reverts::RevertConfig;
use apollo_rpc::RpcConfig;
use apollo_storage::db::DbConfig;
use apollo_storage::storage_reader_server::ServerConfig;
use apollo_storage::StorageConfig;
use serde::{Deserialize, Serialize};
use validator::{Validate, ValidationError};
Expand All @@ -32,6 +33,8 @@ pub struct StateSyncConfig {
pub revert_config: RevertConfig,
#[validate(nested)]
pub rpc_config: RpcConfig,
#[validate(nested)]
pub storage_reader_server_config: ServerConfig,
}

impl SerializeConfig for StateSyncConfig {
Expand All @@ -41,6 +44,10 @@ impl SerializeConfig for StateSyncConfig {
config.extend(ser_optional_sub_config(&self.network_config, "network_config"));
config.extend(prepend_sub_config_name(self.revert_config.dump(), "revert_config"));
config.extend(prepend_sub_config_name(self.rpc_config.dump(), "rpc_config"));
config.extend(prepend_sub_config_name(
self.storage_reader_server_config.dump(),
"storage_reader_server_config",
));
config.extend(ser_optional_sub_config(
&self.p2p_sync_client_config,
"p2p_sync_client_config",
Expand Down Expand Up @@ -80,6 +87,7 @@ impl Default for StateSyncConfig {
network_config: Some(NetworkConfig { port: STATE_SYNC_PORT, ..Default::default() }),
revert_config: RevertConfig::default(),
rpc_config: RpcConfig::default(),
storage_reader_server_config: ServerConfig::default(),
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion crates/apollo_storage/src/storage_reader_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use axum::{Json, Router};
use serde::de::DeserializeOwned;
use serde::{Deserialize, Serialize};
use tracing::{error, info};
use validator::Validate;

use crate::{StorageError, StorageReader};

Expand All @@ -22,7 +23,7 @@ use crate::{StorageError, StorageReader};
mod storage_reader_server_test;

/// Configuration for the storage reader server.
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Validate)]
pub struct ServerConfig {
/// The socket address for the server.
pub ip: IpAddr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ config:
state_sync_config_network_config_is_none: "$$$_STATE_SYNC_CONFIG-NETWORK_CONFIG-IS_NONE_$$$"
state_sync_config_p2p_sync_client_config_is_none: "$$$_STATE_SYNC_CONFIG-P2P_SYNC_CLIENT_CONFIG-IS_NONE_$$$"
state_sync_config_rpc_config_port: "$$$_STATE_SYNC_CONFIG-RPC_CONFIG-PORT_$$$"
state_sync_config_storage_reader_server_config_port: "$$$_STATE_SYNC_CONFIG-STORAGE_READER_SERVER_CONFIG-PORT_$$$"
strk_fee_token_address: "$$$_STRK_FEE_TOKEN_ADDRESS_$$$"
validator_id: "$$$_VALIDATOR_ID_$$$"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ config:
components_state_sync_port: 55009
components_state_sync_url: "sequencer-core-service"
state_sync_config_network_config_port: 55010
state_sync_config_storage_reader_server_config_port: 55012

# StatefulSet Configuration
# See docs/STATEFULSET_CONFIGURATION.md for all available options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ config:
state_sync_config_network_config_port: 55010
state_sync_config_p2p_sync_client_config_is_none: false
state_sync_config_rpc_config_port: 8090
state_sync_config_storage_reader_server_config_port: 55012

service:
enabled: true
Expand Down
Loading