Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
chore: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdplm committed Mar 7, 2024
1 parent 97e8522 commit 6ef3aa4
Show file tree
Hide file tree
Showing 8 changed files with 484 additions and 451 deletions.
867 changes: 463 additions & 404 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions crates/topos-certificate-producer-subnet-runtime/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ use std::sync::Arc;
use tokio::sync::Mutex;
use tokio::sync::{mpsc, oneshot};
use tokio::time::Duration;
use topos_certificate_producer_subnet_client::{
self, BlockInfo, SubnetClient, SubnetClientListener,
};
use topos_certificate_producer_subnet_client::{BlockInfo, SubnetClient, SubnetClientListener};
use topos_core::api::grpc::checkpoints::TargetStreamPosition;
use topos_core::uci::{Certificate, CertificateId, SubnetId};
Expand Down
2 changes: 1 addition & 1 deletion crates/topos-config/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl NodeConfig {
base: base.clone(),
certificate_producer: base
.need_certificate_producer()
.then(|| load_config::<CertificateProducerConfig, ()>(home, None)),
.then(|| load_config::<CertificateProducerConfig, ()>(node_folder, None)),
tce: base
.need_tce()
.then(|| load_config::<TceConfig, ()>(node_folder, None)),
Expand Down
2 changes: 1 addition & 1 deletion crates/topos-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ workspace = true
topos-config = { path = "../topos-config/" }
topos-tce = { path = "../topos-tce/" }
topos-p2p = { path = "../topos-p2p" }
topos-sequencer = { path = "../topos-sequencer" }
topos-certificate-producer = { path = "../topos-certificate-producer" }
topos-core = { workspace = true, features = ["api"] }
topos-certificate-spammer = { path = "../topos-certificate-spammer" }
topos-tce-broadcast = { path = "../topos-tce-broadcast", optional = true }
Expand Down
23 changes: 12 additions & 11 deletions crates/topos-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ pub enum Error {
IO(#[from] std::io::Error),

#[error(
"The role in the config file expect to have a sequencer config defined, none was found"
"The role in the config file expects to have a Certificate Producer config defined, none \
was found"
)]
MissingSequencerConfig,
MissingCertificateProducerConfig,

#[error("An Edge config was expected to be found in the config file")]
MissingEdgeConfig,
Expand Down Expand Up @@ -179,19 +180,19 @@ fn spawn_processes(
));
}

// Sequencer
if matches!(config.base.role, NodeRole::Sequencer) {
let sequencer_config = config
.sequencer
// Certificate Producer
if matches!(config.base.role, NodeRole::CertificateProducer) {
let cert_prod_config = config
.certificate_producer
.take()
.ok_or(Error::MissingSequencerConfig)?;
.ok_or(Error::MissingCertificateProducerConfig)?;

info!(
"Running sequencer with configuration {:?}",
sequencer_config
"Running Certificate Producer with configuration {:?}",
cert_prod_config
);
processes.push(process::spawn_sequencer_process(
sequencer_config,
processes.push(process::spawn_certificate_producer_process(
cert_prod_config,
&keys,
(shutdown_token.clone(), shutdown_sender.clone()),
));
Expand Down
2 changes: 1 addition & 1 deletion crates/topos-tce-api/src/stream/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl Stream {
}
_ => {
// We are not handling specific errors for now.
// If the sequencer is closing the connection, we are receiving a
// If the Certificate Producer is closing the connection, we are receiving a
// StreamErrorKind::TransportError.
error!( "Stream error: {:?}", error);
return Err(StreamError::new(self.stream_id, error.kind));
Expand Down
23 changes: 0 additions & 23 deletions crates/topos/src/components/node/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,26 +169,3 @@ fn setup_console_tce_grpc(endpoint: &str) -> Arc<Mutex<ConsoleServiceClient<Chan
}
}
}

pub async fn shutdown(
basic_controller: Option<BasicController>,
trigger: CancellationToken,
mut termination: mpsc::Receiver<()>,
) {
trigger.cancel();
info!("Waiting for all components to stop");
// let _ = termination.recv().await;
match termination.recv().await {
Some(x) => info!("All good in the hood? {:?}", x),
None => tracing::warn!("Odd, got a None. What does that mean?"),
}
info!("Shutdown complete, exiting.");

// Shutdown tracing
global::shutdown_tracer_provider();
if let Some(basic_controller) = basic_controller {
if let Err(e) = basic_controller.stop(&tracing::Span::current().context()) {
error!("Error stopping tracing: {e}");
}
}
}
13 changes: 6 additions & 7 deletions crates/topos/tests/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,12 @@ mod serial_integration {
let pid = cmd.id().unwrap();
let _ = tokio::time::sleep(std::time::Duration::from_secs(10)).await;

println!("STDOUT: {}", stdout);
let reg = Regex::new(r#"Local node is listening on "\/ip4\/.*\/tcp\/9091\/p2p\/"#).unwrap();
assert!(
reg.is_match(&stdout),
"Expected node 'Local node is listening on…' but instead got:\n----\n{}\n----\n",
stdout
);
let s = System::new_all();
if let Some(process) = s.process(Pid::from_u32(pid)) {
if process.kill_with(Signal::Term).is_none() {
eprintln!("This signal isn't supported on this platform");
}
}

if let Ok(output) = cmd.wait_with_output().await {
assert!(output.status.success());
Expand Down

0 comments on commit 6ef3aa4

Please sign in to comment.