diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index d297169519..d2a2cb4067 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -21,10 +21,5 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y protobuf-compiler capnproto - - name: Audit Dependencies run: cargo audit diff --git a/.github/workflows/build-and-test-self-hosted.yml b/.github/workflows/build-and-test-self-hosted.yml index 579d04ebfa..896988f692 100644 --- a/.github/workflows/build-and-test-self-hosted.yml +++ b/.github/workflows/build-and-test-self-hosted.yml @@ -19,11 +19,6 @@ jobs: runs-on: [self-hosted] container: ghcr.io/espressosystems/devops-rust:stable steps: - - name: Install Cap'n'Proto - run: | - apt-get update - apt-get install -y capnproto - - uses: actions/checkout@v4 name: Checkout Repository diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0ffd7c10e4..9a40d2e405 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -34,11 +34,6 @@ jobs: shared-key: "" prefix-key: ${{ matrix.just_variants }} - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y protobuf-compiler capnproto - - name: Install Just run: | wget https://github.com/casey/just/releases/download/1.14.0/just-1.14.0-x86_64-unknown-linux-musl.tar.gz @@ -84,11 +79,6 @@ jobs: steps: - uses: actions/checkout@v4 name: Checkout Repository - - - name: Install Cap'n'Proto - run: | - apt-get update - apt-get install -y capnproto - uses: Swatinem/rust-cache@v2 name: Enable Rust Caching @@ -262,10 +252,6 @@ jobs: shared-key: "" prefix-key: ${{ matrix.just_variants }} - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y protobuf-compiler capnproto - name: Install Just run: | wget https://github.com/casey/just/releases/download/1.14.0/just-1.14.0-x86_64-unknown-linux-musl.tar.gz diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index e2520b52dc..51e79302f9 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -21,11 +21,6 @@ jobs: - name: Checkout Repository uses: actions/checkout@v4 - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y protobuf-compiler capnproto - - name: Install Just run: | wget https://github.com/casey/just/releases/download/1.14.0/just-1.14.0-x86_64-unknown-linux-musl.tar.gz diff --git a/.github/workflows/lint-self-hosted.yml b/.github/workflows/lint-self-hosted.yml index 12dd0f47d5..34f4c91123 100644 --- a/.github/workflows/lint-self-hosted.yml +++ b/.github/workflows/lint-self-hosted.yml @@ -19,11 +19,6 @@ jobs: runs-on: [self-hosted] container: ghcr.io/espressosystems/devops-rust:stable steps: - - name: Install Cap'n'Proto - run: | - apt-get update - apt-get install -y capnproto - - uses: actions/checkout@v4 name: Checkout Repository diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f07c5aca52..a2c3390421 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -34,11 +34,6 @@ jobs: shared-key: "" prefix-key: ${{ matrix.just_variants }} - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y protobuf-compiler capnproto - - name: Install Just run: | wget https://github.com/casey/just/releases/download/1.14.0/just-1.14.0-x86_64-unknown-linux-musl.tar.gz diff --git a/Cargo.lock b/Cargo.lock index 1890c3ef2a..e0818c196e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1289,20 +1289,18 @@ checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" [[package]] name = "cdn-broker" version = "0.1.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.1.9#8f9cc2d56e725a6cc29a792c6ed67e2e9efee756" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.1.11#c854b7c106f72f21c94a1235e8222f76f78e47e6" dependencies = [ "async-std", "cdn-proto", "clap", "dashmap", - "delegate", "derivative", "derive_builder 0.13.1", "jf-primitives", "lazy_static", "local-ip-address 0.5.7", "parking_lot", - "paste", "prometheus", "rkyv", "tokio", @@ -1313,7 +1311,7 @@ dependencies = [ [[package]] name = "cdn-client" version = "0.1.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.1.9#8f9cc2d56e725a6cc29a792c6ed67e2e9efee756" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.1.11#c854b7c106f72f21c94a1235e8222f76f78e47e6" dependencies = [ "async-std", "cdn-proto", @@ -1329,7 +1327,7 @@ dependencies = [ [[package]] name = "cdn-marshal" version = "0.1.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.1.9#8f9cc2d56e725a6cc29a792c6ed67e2e9efee756" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.1.11#c854b7c106f72f21c94a1235e8222f76f78e47e6" dependencies = [ "async-std", "cdn-proto", @@ -1344,7 +1342,7 @@ dependencies = [ [[package]] name = "cdn-proto" version = "0.1.0" -source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.1.9#8f9cc2d56e725a6cc29a792c6ed67e2e9efee756" +source = "git+https://github.com/EspressoSystems/Push-CDN?tag=0.1.11#c854b7c106f72f21c94a1235e8222f76f78e47e6" dependencies = [ "anyhow", "ark-serialize", @@ -2109,17 +2107,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "delegate" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e018fccbeeb50ff26562ece792ed06659b9c2dae79ece77c4456bb10d9bf79b" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.53", -] - [[package]] name = "der" version = "0.7.8" @@ -3208,6 +3195,7 @@ dependencies = [ "hotshot-task-impls", "hotshot-types", "hotshot-web-server", + "jf-primitives", "libp2p-identity", "libp2p-networking", "lru", diff --git a/Cargo.toml b/Cargo.toml index 394857659b..f4f0bb7f80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -132,9 +132,9 @@ anyhow = "1.0.81" # Push CDN imports -cdn-client = { git = "https://github.com/EspressoSystems/Push-CDN", tag = "0.1.9" } -cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", tag = "0.1.9" } -cdn-marshal = { git = "https://github.com/EspressoSystems/Push-CDN", tag = "0.1.9" } +cdn-client = { git = "https://github.com/EspressoSystems/Push-CDN", tag = "0.1.11" } +cdn-broker = { git = "https://github.com/EspressoSystems/Push-CDN", tag = "0.1.11" } +cdn-marshal = { git = "https://github.com/EspressoSystems/Push-CDN", tag = "0.1.11" } ### Profiles ### diff --git a/crates/examples/Cargo.toml b/crates/examples/Cargo.toml index fb21ed3a64..0ca6d4cd82 100644 --- a/crates/examples/Cargo.toml +++ b/crates/examples/Cargo.toml @@ -96,6 +96,10 @@ path = "push-cdn/broker.rs" name = "marshal-push-cdn" path = "push-cdn/marshal.rs" +[[example]] +name = "whitelist-push-cdn" +path = "push-cdn/whitelist-adapter.rs" + [dependencies] async-broadcast = { workspace = true } async-compatibility-layer = { workspace = true } @@ -137,7 +141,6 @@ cdn-broker = { workspace = true, features = [ "insecure", "runtime-tokio", "strong_consistency", - "local_discovery", ] } cdn-marshal = { workspace = true, features = ["insecure", "runtime-tokio"] } @@ -148,7 +151,6 @@ cdn-broker = { workspace = true, features = [ "insecure", "runtime-async-std", "strong_consistency", - "local_discovery", ] } cdn-marshal = { workspace = true, features = ["insecure", "runtime-async-std"] } diff --git a/crates/examples/push-cdn/all.rs b/crates/examples/push-cdn/all.rs index e513319947..0f9b7e09f3 100644 --- a/crates/examples/push-cdn/all.rs +++ b/crates/examples/push-cdn/all.rs @@ -5,11 +5,10 @@ pub mod types; use crate::infra::{read_orchestrator_init_config, run_orchestrator, OrchestratorArgs}; use crate::types::{DANetwork, NodeImpl, QuorumNetwork, ThisRun}; use async_compatibility_layer::art::async_spawn; -use cdn_broker::reexports::connection::protocols::{Quic, Tcp}; use cdn_broker::reexports::crypto::signature::KeyPair; use cdn_broker::Broker; use cdn_marshal::Marshal; -use hotshot::traits::implementations::WrappedSignatureKey; +use hotshot::traits::implementations::{TestingDef, WrappedSignatureKey}; use hotshot::types::SignatureKey; use hotshot_example_types::state_types::TestTypes; use hotshot_orchestrator::client::ValidatorArgs; @@ -79,12 +78,8 @@ async fn main() { // Create and spawn the broker async_spawn(async move { - let broker: Broker< - WrappedSignatureKey<::SignatureKey>, - WrappedSignatureKey<::SignatureKey>, - Tcp, - Quic, - > = Broker::new(config).await.expect("broker failed to start"); + let broker: Broker> = + Broker::new(config).await.expect("broker failed to start"); // Error if we stopped unexpectedly if let Err(err) = broker.start().await { @@ -106,10 +101,9 @@ async fn main() { // Spawn the marshal async_spawn(async move { - let marshal: Marshal::SignatureKey>, Quic> = - Marshal::new(marshal_config) - .await - .expect("failed to spawn marshal"); + let marshal: Marshal> = Marshal::new(marshal_config) + .await + .expect("failed to spawn marshal"); // Error if we stopped unexpectedly if let Err(err) = marshal.start().await { diff --git a/crates/examples/push-cdn/broker.rs b/crates/examples/push-cdn/broker.rs index 2c545b1ba4..cc83d7ea2b 100644 --- a/crates/examples/push-cdn/broker.rs +++ b/crates/examples/push-cdn/broker.rs @@ -2,10 +2,9 @@ //! a `Broker` object. use anyhow::{Context, Result}; -use cdn_broker::reexports::connection::protocols::{Quic, Tcp}; use cdn_broker::{reexports::crypto::signature::KeyPair, Broker, Config, ConfigBuilder}; use clap::Parser; -use hotshot::traits::implementations::WrappedSignatureKey; +use hotshot::traits::implementations::{ProductionDef, WrappedSignatureKey}; use hotshot::types::SignatureKey; use hotshot_example_types::node_types::TestTypes; use hotshot_types::traits::node_implementation::NodeType; @@ -80,13 +79,7 @@ async fn main() -> Result<()> { // Create new `Broker` // Uses TCP from broker connections and Quic for user connections. - let broker = Broker::< - WrappedSignatureKey<::SignatureKey>, - WrappedSignatureKey<::SignatureKey>, - Tcp, - Quic, - >::new(broker_config) - .await?; + let broker = Broker::>::new(broker_config).await?; // Start the main loop, consuming it broker.start().await?; diff --git a/crates/examples/push-cdn/marshal.rs b/crates/examples/push-cdn/marshal.rs index 22472abe09..6150542a78 100644 --- a/crates/examples/push-cdn/marshal.rs +++ b/crates/examples/push-cdn/marshal.rs @@ -2,12 +2,10 @@ //! a `Marshal` object with the `HotShot` types. //! use anyhow::{Context, Result}; -use cdn_broker::reexports::connection::protocols::Quic; use cdn_marshal::{ConfigBuilder, Marshal}; use clap::Parser; -use hotshot::traits::implementations::WrappedSignatureKey; +use hotshot::traits::implementations::ProductionDef; use hotshot_example_types::node_types::TestTypes; -use hotshot_types::traits::node_implementation::NodeType; #[derive(Parser, Debug)] #[command(author, version, about, long_about = None)] @@ -41,9 +39,7 @@ async fn main() -> Result<()> { .with_context(|| "failed to build Marshal config")?; // Create new `Marshal` from the config - let marshal = - Marshal::::SignatureKey>, Quic>::new(config) - .await?; + let marshal = Marshal::>::new(config).await?; // Start the main loop, consuming it marshal.start().await?; diff --git a/crates/examples/push-cdn/types.rs b/crates/examples/push-cdn/types.rs index 404b3f0b4b..5f488d740c 100644 --- a/crates/examples/push-cdn/types.rs +++ b/crates/examples/push-cdn/types.rs @@ -1,7 +1,6 @@ use crate::infra::PushCdnDaRun; -use hotshot::traits::implementations::PushCdnNetwork; +use hotshot::traits::{implementations::PushCdnNetwork, NodeImplementation}; use hotshot_example_types::{state_types::TestTypes, storage_types::TestStorage}; -use hotshot_types::traits::node_implementation::NodeImplementation; use serde::{Deserialize, Serialize}; #[derive(Clone, Deserialize, Serialize, Hash, PartialEq, Eq)] diff --git a/crates/examples/push-cdn/whitelist-adapter.rs b/crates/examples/push-cdn/whitelist-adapter.rs new file mode 100644 index 0000000000..9ecd134b96 --- /dev/null +++ b/crates/examples/push-cdn/whitelist-adapter.rs @@ -0,0 +1,91 @@ +//! The whitelist is an adaptor that is able to update the allowed public keys for +//! all brokers. Right now, we do this by asking the orchestrator for the list of +//! allowed public keys. In the future, we will pull the stake table from the L1. + +use std::str::FromStr; +use std::sync::Arc; + +use anyhow::Context; +use anyhow::Result; +use cdn_broker::reexports::discovery::DiscoveryClient; +use cdn_broker::reexports::discovery::{Embedded, Redis}; +use clap::Parser; +use hotshot_example_types::node_types::TestTypes; +use hotshot_orchestrator::client::OrchestratorClient; +use hotshot_orchestrator::client::ValidatorArgs; +use hotshot_orchestrator::config::NetworkConfig; +use hotshot_types::traits::node_implementation::NodeType; +use hotshot_types::traits::signature_key::SignatureKey; +use surf_disco::Url; + +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +/// The main component of the push CDN. +struct Args { + /// The discovery client endpoint (including scheme) to connect to. + /// With the local discovery feature, this is a file path. + /// With the remote (redis) discovery feature, this is a redis URL (e.g. `redis://127.0.0.1:6789`). + #[arg(short, long)] + discovery_endpoint: String, + + /// The URL the orchestrator is running on. This should be something like `http://localhost:5555` + #[arg(short, long)] + orchestrator_url: String, + + /// Whether or not to use the local discovery client + #[arg(short, long)] + local_discovery: bool, +} + +#[cfg_attr(async_executor_impl = "tokio", tokio::main)] +#[cfg_attr(async_executor_impl = "async-std", async_std::main)] +async fn main() -> Result<()> { + // Parse the command line arguments + let args = Args::parse(); + + // Initialize tracing + tracing_subscriber::fmt::init(); + + // Create a new `OrchestratorClient` from the supplied URL + let orchestrator_client = OrchestratorClient::new( + ValidatorArgs { + url: Url::from_str(&args.orchestrator_url).with_context(|| "Invalid URL")?, + public_ip: None, + network_config_file: None, + }, + "whitelist-adapter".to_string(), + ); + + // Attempt to get the config from the orchestrator. + // Loops internally until the config is received. + let config: NetworkConfig< + ::SignatureKey, + ::ElectionConfigType, + > = orchestrator_client.get_config_after_collection().await; + + tracing::info!("Received config from orchestrator"); + + // Extrapolate the state_ver_keys from the config and convert them to a compatible format + let whitelist = config + .config + .known_nodes_with_stake + .iter() + .map(|k| Arc::from(k.stake_table_entry.stake_key.to_bytes())) + .collect(); + + if args.local_discovery { + ::new(args.discovery_endpoint, None) + .await? + .set_whitelist(whitelist) + .await?; + } else { + ::new(args.discovery_endpoint, None) + .await? + .set_whitelist(whitelist) + .await?; + } + + tracing::info!("Posted config to discovery endpoint"); + + Ok(()) +} diff --git a/crates/hotshot/Cargo.toml b/crates/hotshot/Cargo.toml index 21e1d81e92..ea4fbd6d76 100644 --- a/crates/hotshot/Cargo.toml +++ b/crates/hotshot/Cargo.toml @@ -51,6 +51,7 @@ surf-disco = { workspace = true } time = { workspace = true } tracing = { workspace = true } versioned-binary-serialization = { workspace = true } +jf-primitives.workspace = true [target.'cfg(all(async_executor_impl = "tokio"))'.dependencies] tokio = { workspace = true } @@ -59,7 +60,6 @@ cdn-broker = { workspace = true, features = [ "insecure", "runtime-tokio", "strong_consistency", - "local_discovery", ] } cdn-marshal = { workspace = true, features = ["insecure", "runtime-tokio"] } @@ -70,7 +70,6 @@ cdn-broker = { workspace = true, features = [ "insecure", "runtime-async-std", "strong_consistency", - "local_discovery", ] } cdn-marshal = { workspace = true, features = ["insecure", "runtime-async-std"] } diff --git a/crates/hotshot/src/traits.rs b/crates/hotshot/src/traits.rs index c4d493acb4..d37ed8938f 100644 --- a/crates/hotshot/src/traits.rs +++ b/crates/hotshot/src/traits.rs @@ -13,7 +13,7 @@ pub mod implementations { combined_network::{CombinedNetworks, UnderlyingCombinedNetworks}, libp2p_network::{Libp2pNetwork, PeerInfoVec}, memory_network::{MasterMap, MemoryNetwork}, - push_cdn_network::{PushCdnNetwork, WrappedSignatureKey}, + push_cdn_network::{ProductionDef, PushCdnNetwork, TestingDef, WrappedSignatureKey}, web_server_network::WebServerNetwork, NetworkingMetricsValue, }; diff --git a/crates/hotshot/src/traits/networking/push_cdn_network.rs b/crates/hotshot/src/traits/networking/push_cdn_network.rs index 8933583439..fcc254e511 100644 --- a/crates/hotshot/src/traits/networking/push_cdn_network.rs +++ b/crates/hotshot/src/traits/networking/push_cdn_network.rs @@ -3,6 +3,8 @@ use async_compatibility_layer::art::{async_block_on, async_spawn}; use async_compatibility_layer::channel::UnboundedSendError; use async_trait::async_trait; use bincode::config::Options; +use cdn_broker::reexports::def::RunDef; +use cdn_broker::reexports::discovery::{Embedded, Redis}; use cdn_broker::{ reexports::connection::protocols::Tcp, Broker, Config, ConfigBuilder as BrokerConfigBuilder, }; @@ -34,6 +36,7 @@ use hotshot_types::{ }; use rand::rngs::StdRng; use rand::{RngCore, SeedableRng}; +use std::marker::PhantomData; use std::{collections::BTreeSet, path::Path, sync::Arc, time::Duration}; use tracing::{error, warn}; use versioned_binary_serialization::{ @@ -81,6 +84,40 @@ impl Serializable for WrappedSignatureKey { } } +/// The testing run definition for the Push CDN. +/// Uses the real protocols, but with an embedded discovery client. +pub struct TestingDef { + /// Phantom data to hold the type + pd: PhantomData, +} + +impl RunDef for TestingDef { + type BrokerScheme = WrappedSignatureKey; + type BrokerProtocol = Tcp; + + type UserScheme = WrappedSignatureKey; + type UserProtocol = Quic; + + type DiscoveryClientType = Embedded; +} + +/// The production run definition for the Push CDN. +/// Uses the real protocols and a Redis discovery client. +pub struct ProductionDef { + /// Phantom data to hold the type + pd: PhantomData, +} + +impl RunDef for ProductionDef { + type BrokerScheme = WrappedSignatureKey; + type BrokerProtocol = Tcp; + + type UserScheme = WrappedSignatureKey; + type UserProtocol = Quic; + + type DiscoveryClientType = Redis; +} + /// A communication channel to the Push CDN, which is a collection of brokers and a marshal /// that helps organize them all. #[derive(Clone)] @@ -211,12 +248,8 @@ impl TestableNetworkingImplementation for PushCdnNetwork // Create and spawn the broker async_spawn(async move { - let broker: Broker< - WrappedSignatureKey, - WrappedSignatureKey, - Tcp, - Quic, - > = Broker::new(config).await.expect("broker failed to start"); + let broker: Broker> = + Broker::new(config).await.expect("broker failed to start"); // Error if we stopped unexpectedly if let Err(err) = broker.start().await { @@ -238,10 +271,9 @@ impl TestableNetworkingImplementation for PushCdnNetwork // Spawn the marshal async_spawn(async move { - let marshal: Marshal, Quic> = - Marshal::new(marshal_config) - .await - .expect("failed to spawn marshal"); + let marshal: Marshal> = Marshal::new(marshal_config) + .await + .expect("failed to spawn marshal"); // Error if we stopped unexpectedly if let Err(err) = marshal.start().await { diff --git a/crates/orchestrator/run-config.toml b/crates/orchestrator/run-config.toml index 51197939c4..905184591d 100644 --- a/crates/orchestrator/run-config.toml +++ b/crates/orchestrator/run-config.toml @@ -40,9 +40,9 @@ start_delay_seconds = 0 cdn_marshal_address = "127.0.0.1:9000" [config] -num_nodes_with_stake = 100 +num_nodes_with_stake = 10 num_nodes_without_stake = 0 -staked_committee_nodes = 100 +staked_committee_nodes = 10 non_staked_committee_nodes = 0 max_transactions = 1 min_transactions = 1 @@ -83,6 +83,11 @@ nanos = 100000000 # 10 ms secs = 0 nanos = 100000000 # 10 ms + +[config.data_request_delay] +secs = 0 +nanos = 2000000000 # 200 ms + [config.propose_min_round_time] secs = 0 nanos = 0 diff --git a/crates/orchestrator/src/client.rs b/crates/orchestrator/src/client.rs index 7c36bf2a36..bac6d08af9 100644 --- a/crates/orchestrator/src/client.rs +++ b/crates/orchestrator/src/client.rs @@ -185,9 +185,10 @@ impl OrchestratorClient { OrchestratorClient { client, identity } } - /// Sends an identify message to the orchestrator and attempts to get its config - /// Returns both the `node_index` and the run configuration without peer's public config from the orchestrator - /// Will block until both are returned + /// Get the config from the orchestrator. + /// If the identity is provided, register the identity with the orchestrator. + /// If not, just retrieving the config (for passive observers) + /// /// # Panics /// if unable to convert the node index from usize into u64 /// (only applicable on 32 bit systems) @@ -244,6 +245,29 @@ impl OrchestratorClient { self.wait_for_fn_from_orchestrator(cur_node_index).await } + /// Requests the configuration from the orchestrator with the stipulation that + /// a successful call requires all nodes to be registered. + /// + /// Does not fail, retries internally until success. + pub async fn get_config_after_collection( + &self, + ) -> NetworkConfig { + // Define the request for post-register configurations + let get_config_after_collection = |client: Client| { + async move { + client + .get("api/get_config_after_peer_collected") + .send() + .await + } + .boxed() + }; + + // Loop until successful + self.wait_for_fn_from_orchestrator(get_config_after_collection) + .await + } + /// Sends my public key to the orchestrator so that it can collect all public keys /// And get the updated config /// Blocks until the orchestrator collects all peer's public keys/configs @@ -270,12 +294,7 @@ impl OrchestratorClient { self.wait_for_fn_from_orchestrator::<_, _, ()>(wait_for_all_nodes_pub_key) .await; - // get the newest updated config - self.client - .get("api/get_config_after_peer_collected") - .send() - .await - .expect("Unable to get the updated config") + self.get_config_after_collection().await } /// Tells the orchestrator this validator is ready to start diff --git a/crates/orchestrator/src/lib.rs b/crates/orchestrator/src/lib.rs index 5424bc2864..03b8ea98b5 100644 --- a/crates/orchestrator/src/lib.rs +++ b/crates/orchestrator/src/lib.rs @@ -267,7 +267,7 @@ where self.pub_posted.insert(node_index); // The guess is the first extra 8 bytes are from orchestrator serialization - pubkey.drain(..8); + pubkey.drain(..12); let register_pub_key_with_stake = PeerConfig::::from_bytes(pubkey).unwrap(); self.config.config.known_nodes_with_stake[node_index as usize] = register_pub_key_with_stake; diff --git a/docker/cdn-broker.Dockerfile b/docker/cdn-broker.Dockerfile index 05255ecfa6..08a8605190 100644 --- a/docker/cdn-broker.Dockerfile +++ b/docker/cdn-broker.Dockerfile @@ -5,9 +5,6 @@ FROM docker.io/rust:1.76-bookworm as BUILDER WORKDIR /build COPY . . -# Install necessary dependencies -RUN apt-get update && apt-get install -y capnproto - # Build our example RUN RUSTFLAGS='--cfg async_executor_impl="tokio" --cfg async_channel_impl="tokio"' cargo build --profile release-lto --example broker-push-cdn diff --git a/docker/cdn-marshal.Dockerfile b/docker/cdn-marshal.Dockerfile index 7dbe708179..e7daca51fe 100644 --- a/docker/cdn-marshal.Dockerfile +++ b/docker/cdn-marshal.Dockerfile @@ -5,9 +5,6 @@ FROM docker.io/rust:1.76-bookworm as BUILDER WORKDIR /build COPY . . -# Install necessary dependencies -RUN apt-get update && apt-get install -y capnproto - # Build our example RUN RUSTFLAGS='--cfg async_executor_impl="tokio" --cfg async_channel_impl="tokio"' cargo build --profile release-lto --example marshal-push-cdn