Skip to content

Commit

Permalink
fix: disable parlia task if running with debug.tip (#48)
Browse files Browse the repository at this point in the history
* fix: disable parlia task if running with debug.tip

* chore: fix lint

* chore: fix lint
  • Loading branch information
j75689 authored Jun 28, 2024
1 parent d75b979 commit 2df0754
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
24 changes: 13 additions & 11 deletions crates/bsc/consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ where

/// Consumes the type and returns all components
#[track_caller]
pub fn build(self) -> ParliaClient {
pub fn build(self, start_engine_task: bool) -> ParliaClient {
let Self {
chain_spec,
cfg,
Expand All @@ -648,16 +648,18 @@ where
client,
} = self;
let parlia_client = ParliaClient::new(storage.clone(), fetch_client);
ParliaEngineTask::start(
chain_spec.clone(),
Parlia::new(chain_spec, cfg.clone()),
client,
to_engine,
network_block_event_rx,
storage,
parlia_client.clone(),
cfg.period,
);
if start_engine_task {
ParliaEngineTask::start(
chain_spec.clone(),
Parlia::new(chain_spec, cfg.clone()),
client,
to_engine,
network_block_event_rx,
storage,
parlia_client.clone(),
cfg.period,
);
}
parlia_client
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/node/builder/src/launch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ where
engine_rx,
network_client.clone(),
)
.build();
.build(ctx.node_config().debug.tip.is_none());
(pipeline, Either::Right(client))
}
#[cfg(not(feature = "bsc"))]
Expand Down

0 comments on commit 2df0754

Please sign in to comment.