Skip to content

Commit

Permalink
chore(papyrus_p2p_sync): add receiver for internal block to datastrea…
Browse files Browse the repository at this point in the history
…mbuilder
  • Loading branch information
eitanm-starkware committed Dec 9, 2024
1 parent cbd8129 commit 0321278
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/papyrus_p2p_sync/src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ impl P2PSyncClientChannels {
let header_stream = HeaderStreamBuilder::create_stream(
self.header_sender,
storage_reader.clone(),
None,
config.wait_period_for_new_data,
config.num_headers_per_query,
config.stop_sync_at_block_number,
Expand All @@ -192,6 +193,7 @@ impl P2PSyncClientChannels {
let state_diff_stream = StateDiffStreamBuilder::create_stream(
self.state_diff_sender,
storage_reader.clone(),
None,
config.wait_period_for_new_data,
config.num_block_state_diffs_per_query,
config.stop_sync_at_block_number,
Expand All @@ -200,6 +202,7 @@ impl P2PSyncClientChannels {
let transaction_stream = TransactionStreamFactory::create_stream(
self.transaction_sender,
storage_reader.clone(),
None,
config.wait_period_for_new_data,
config.num_block_transactions_per_query,
config.stop_sync_at_block_number,
Expand All @@ -208,6 +211,7 @@ impl P2PSyncClientChannels {
let class_stream = ClassStreamBuilder::create_stream(
self.class_sender,
storage_reader.clone(),
None,
config.wait_period_for_new_data,
config.num_block_classes_per_query,
config.stop_sync_at_block_number,
Expand Down
2 changes: 2 additions & 0 deletions crates/papyrus_p2p_sync/src/client/stream_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::cmp::min;
use std::time::Duration;

use async_stream::stream;
use futures::channel::mpsc::Receiver;
use futures::future::BoxFuture;
use futures::stream::BoxStream;
use futures::StreamExt;
Expand Down Expand Up @@ -55,6 +56,7 @@ where
fn create_stream<TQuery>(
mut sqmr_sender: SqmrClientSender<TQuery, DataOrFin<InputFromNetwork>>,
storage_reader: StorageReader,
_internal_block_receiver: Option<Receiver<(BlockNumber, Self::Output)>>,
wait_period_for_new_data: Duration,
num_blocks_per_query: u64,
stop_sync_at_block_number: Option<BlockNumber>,
Expand Down

0 comments on commit 0321278

Please sign in to comment.