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

Disable Block request and State sync handler and make domain sync service always force_synced to enable transaction propagation #2173

Merged
merged 1 commit into from
Oct 27, 2023
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
6 changes: 4 additions & 2 deletions domains/service/src/domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ where
domain_created_at,
consensus_client: consensus_client.clone(),
consensus_offchain_tx_pool_factory,
consensus_network_sync_oracle,
consensus_network_sync_oracle: consensus_network_sync_oracle.clone(),
client: client.clone(),
transaction_pool: transaction_pool.clone(),
backend: backend.clone(),
Expand All @@ -463,7 +463,9 @@ where
let relayer_worker = domain_client_message_relayer::worker::relay_domain_messages(
consensus_client.clone(),
client.clone(),
sync_service.clone(),
// domain relayer will use consensus chain sync oracle instead of domain sync orcle
// since domain sync oracle will always return `synced` due to force sync being set.
consensus_network_sync_oracle,
gossip_message_sink,
);

Expand Down
25 changes: 10 additions & 15 deletions domains/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,8 @@ where
let protocol_id = config.protocol_id();

let (chain_sync_network_provider, chain_sync_network_handle) = NetworkServiceProvider::new();
let (mut block_server, block_downloader, block_request_protocol_config) = match block_relay {
Some(params) => (
params.server,
params.downloader,
params.request_response_config,
),
let (mut block_server, block_downloader) = match block_relay {
Some(params) => (params.server, params.downloader),
None => {
// Custom protocol was not specified, use the default block handler.
let params = BlockRequestHandler::new(
Expand All @@ -111,11 +107,7 @@ where
config.network.default_peers_set.in_peers as usize
+ config.network.default_peers_set.out_peers as usize,
);
(
params.server,
params.downloader,
params.request_response_config,
)
(params.server, params.downloader)
}
};
spawn_handle.spawn("block-request-handler", Some("networking"), async move {
Expand Down Expand Up @@ -154,7 +146,13 @@ where
state_request_protocol_config.name.clone(),
None,
rx,
config.network.force_synced,
// set to be force_synced always for domains since they relay on Consensus chain to derive and import domain blocks.
// If not set, each domain node will wait to be fully synced and as a result will not propagate the transactions over network.
// It would have been ideal to use `Consensus` chain sync service to respond to `is_major_sync` requests but this
// would require upstream changes and with some refactoring. This is not worth the effort at the moment since
// we are planning to enable domain's block request and state sync mechanism in the near future.
// Until such change has been made, domain's sync service needs to be in force_synced state.
true,
)?;
let sync_service_import_queue = sync_service.clone();
let sync_service = Arc::new(sync_service);
Expand All @@ -177,9 +175,6 @@ where
);
net_config.add_notification_protocol(transactions_handler_proto.set_config());

net_config.add_request_response_protocol(block_request_protocol_config);
net_config.add_request_response_protocol(state_request_protocol_config);

// Create `PeerStore` and initialize it with bootnode peer ids.
let peer_store = PeerStore::new(
net_config
Expand Down
Loading