Skip to content

Commit

Permalink
feat(starknet_state_sync): use real state sync client in sequencer co…
Browse files Browse the repository at this point in the history
…nsensus manager
  • Loading branch information
noamsp-starkware committed Dec 15, 2024
1 parent 8944f77 commit 0f62104
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
8 changes: 3 additions & 5 deletions crates/starknet_sequencer_node/src/components.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
use std::sync::Arc;

use starknet_batcher::batcher::{create_batcher, Batcher};
use starknet_consensus_manager::consensus_manager::ConsensusManager;
use starknet_gateway::gateway::{create_gateway, Gateway};
Expand All @@ -14,7 +12,6 @@ use starknet_monitoring_endpoint::monitoring_endpoint::{
};
use starknet_state_sync::runner::StateSyncRunner;
use starknet_state_sync::{create_state_sync_and_runner, StateSync};
use starknet_state_sync_types::communication::EmptyStateSyncClient;

use crate::clients::SequencerNodeClients;
use crate::config::component_execution_config::{
Expand Down Expand Up @@ -54,8 +51,9 @@ pub fn create_node_components(
ActiveComponentExecutionMode::Enabled => {
let batcher_client =
clients.get_batcher_shared_client().expect("Batcher Client should be available");
// TODO(shahak): Use the real client once we connect state sync to the node.
let state_sync_client = Arc::new(EmptyStateSyncClient);
let state_sync_client = clients
.get_state_sync_shared_client()
.expect("State Sync Client should be available");
Some(ConsensusManager::new(
config.consensus_manager_config.clone(),
batcher_client,
Expand Down
21 changes: 0 additions & 21 deletions crates/starknet_state_sync_types/src/communication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,3 @@ impl StateSyncClient for RemoteStateSyncClient {
)
}
}

// TODO(shahak): Remove this once we connect state sync to the node.
pub struct EmptyStateSyncClient;

#[async_trait]
impl StateSyncClient for EmptyStateSyncClient {
async fn get_block(
&self,
_block_number: BlockNumber,
) -> StateSyncClientResult<Option<SyncBlock>> {
Ok(None)
}

async fn add_new_block(
&self,
_block_number: BlockNumber,
_sync_block: SyncBlock,
) -> StateSyncClientResult<()> {
Ok(())
}
}

0 comments on commit 0f62104

Please sign in to comment.