Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(starknet_state_sync): use real state sync client in sequencer consensus manager #2662

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
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 @@ -15,7 +13,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 @@ -59,8 +56,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(())
}
}