From 17e69d978b51f254176e0903b5260bf965f9f20f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Fran=C3=A7a?= Date: Fri, 8 Nov 2024 16:53:05 +0000 Subject: [PATCH] Renaming. Also deleted an empty file. --- node/Cargo.toml | 12 ++++++------ node/actors/network/src/state.rs | 1 - node/{actors => components}/bft/Cargo.toml | 2 +- .../bft/src/chonky_bft/block.rs | 0 .../bft/src/chonky_bft/commit.rs | 0 .../{actors => components}/bft/src/chonky_bft/mod.rs | 2 +- .../bft/src/chonky_bft/new_view.rs | 0 .../bft/src/chonky_bft/proposal.rs | 0 .../bft/src/chonky_bft/proposer.rs | 0 .../bft/src/chonky_bft/testonly.rs | 0 .../bft/src/chonky_bft/tests/commit.rs | 0 .../bft/src/chonky_bft/tests/mod.rs | 0 .../bft/src/chonky_bft/tests/new_view.rs | 0 .../bft/src/chonky_bft/tests/proposal.rs | 0 .../bft/src/chonky_bft/tests/timeout.rs | 0 .../bft/src/chonky_bft/timeout.rs | 0 node/{actors => components}/bft/src/config.rs | 2 +- node/{actors => components}/bft/src/lib.rs | 6 +++--- node/{actors => components}/bft/src/metrics.rs | 0 node/{actors => components}/bft/src/testonly/make.rs | 0 node/{actors => components}/bft/src/testonly/mod.rs | 0 node/{actors => components}/bft/src/testonly/node.rs | 6 +++--- node/{actors => components}/bft/src/testonly/run.rs | 2 +- .../bft/src/testonly/twins/mod.rs | 0 .../bft/src/testonly/twins/partition.rs | 0 .../bft/src/testonly/twins/scenario.rs | 0 .../bft/src/testonly/twins/tests.rs | 0 node/{actors => components}/bft/src/tests/mod.rs | 0 node/{actors => components}/bft/src/tests/twins.rs | 0 node/{actors => components}/executor/Cargo.toml | 2 +- node/{actors => components}/executor/src/lib.rs | 8 ++++---- node/{actors => components}/executor/src/tests.rs | 0 node/{actors => components}/network/Cargo.toml | 2 +- node/{actors => components}/network/build.rs | 0 node/{actors => components}/network/src/config.rs | 6 +++--- .../network/src/consensus/handshake/mod.rs | 0 .../network/src/consensus/handshake/testonly.rs | 0 .../network/src/consensus/handshake/tests.rs | 0 .../network/src/consensus/mod.rs | 2 +- .../network/src/consensus/tests.rs | 0 .../network/src/debug_page/mod.rs | 0 .../network/src/debug_page/style.css | 0 node/{actors => components}/network/src/frame.rs | 0 .../network/src/gossip/attestation/metrics.rs | 0 .../network/src/gossip/attestation/mod.rs | 0 .../network/src/gossip/attestation/tests.rs | 0 .../network/src/gossip/fetch.rs | 0 .../network/src/gossip/handshake/mod.rs | 0 .../network/src/gossip/handshake/testonly.rs | 0 .../network/src/gossip/handshake/tests.rs | 0 .../network/src/gossip/loadtest/mod.rs | 0 .../network/src/gossip/loadtest/tests.rs | 0 .../{actors => components}/network/src/gossip/mod.rs | 2 +- .../network/src/gossip/runner.rs | 0 .../network/src/gossip/testonly.rs | 0 .../network/src/gossip/tests/fetch_blocks.rs | 0 .../network/src/gossip/tests/mod.rs | 0 .../network/src/gossip/tests/syncing.rs | 0 .../network/src/gossip/validator_addrs.rs | 0 node/{actors => components}/network/src/io.rs | 4 ++-- node/{actors => components}/network/src/lib.rs | 10 +++++----- node/{actors => components}/network/src/metrics.rs | 0 .../{actors => components}/network/src/mux/config.rs | 0 .../network/src/mux/handshake.rs | 0 .../{actors => components}/network/src/mux/header.rs | 0 node/{actors => components}/network/src/mux/mod.rs | 0 .../network/src/mux/reusable_stream.rs | 0 .../network/src/mux/tests/mod.rs | 0 .../network/src/mux/tests/proto/mod.proto | 0 .../network/src/mux/tests/proto/mod.rs | 0 .../network/src/mux/transient_stream.rs | 0 .../network/src/noise/bytes.rs | 0 node/{actors => components}/network/src/noise/mod.rs | 0 .../network/src/noise/stream.rs | 0 .../network/src/noise/testonly.rs | 0 .../network/src/noise/tests.rs | 0 node/{actors => components}/network/src/pool.rs | 0 node/{actors => components}/network/src/preface.rs | 0 .../network/src/proto/consensus.proto | 0 .../network/src/proto/gossip.proto | 0 node/{actors => components}/network/src/proto/mod.rs | 0 .../network/src/proto/mux.proto | 0 .../network/src/proto/ping.proto | 0 .../network/src/proto/preface.proto | 0 .../network/src/proto/rpc.proto | 0 .../network/src/rpc/consensus.rs | 0 .../network/src/rpc/get_block.rs | 0 .../network/src/rpc/metrics.rs | 0 node/{actors => components}/network/src/rpc/mod.rs | 0 node/{actors => components}/network/src/rpc/ping.rs | 0 .../network/src/rpc/push_batch_votes.rs | 0 .../network/src/rpc/push_block_store_state.rs | 0 .../network/src/rpc/push_validator_addrs.rs | 0 .../network/src/rpc/testonly.rs | 0 node/{actors => components}/network/src/rpc/tests.rs | 0 node/{actors => components}/network/src/testonly.rs | 2 +- node/{actors => components}/network/src/tests.rs | 0 node/{actors => components}/network/src/watch.rs | 0 node/libs/roles/src/validator/messages/genesis.rs | 2 +- node/tools/src/main.rs | 2 +- 100 files changed, 37 insertions(+), 38 deletions(-) delete mode 100644 node/actors/network/src/state.rs rename node/{actors => components}/bft/Cargo.toml (94%) rename node/{actors => components}/bft/src/chonky_bft/block.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/commit.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/mod.rs (99%) rename node/{actors => components}/bft/src/chonky_bft/new_view.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/proposal.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/proposer.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/testonly.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/tests/commit.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/tests/mod.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/tests/new_view.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/tests/proposal.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/tests/timeout.rs (100%) rename node/{actors => components}/bft/src/chonky_bft/timeout.rs (100%) rename node/{actors => components}/bft/src/config.rs (95%) rename node/{actors => components}/bft/src/lib.rs (93%) rename node/{actors => components}/bft/src/metrics.rs (100%) rename node/{actors => components}/bft/src/testonly/make.rs (100%) rename node/{actors => components}/bft/src/testonly/mod.rs (100%) rename node/{actors => components}/bft/src/testonly/node.rs (93%) rename node/{actors => components}/bft/src/testonly/run.rs (99%) rename node/{actors => components}/bft/src/testonly/twins/mod.rs (100%) rename node/{actors => components}/bft/src/testonly/twins/partition.rs (100%) rename node/{actors => components}/bft/src/testonly/twins/scenario.rs (100%) rename node/{actors => components}/bft/src/testonly/twins/tests.rs (100%) rename node/{actors => components}/bft/src/tests/mod.rs (100%) rename node/{actors => components}/bft/src/tests/twins.rs (100%) rename node/{actors => components}/executor/Cargo.toml (93%) rename node/{actors => components}/executor/src/lib.rs (95%) rename node/{actors => components}/executor/src/tests.rs (100%) rename node/{actors => components}/network/Cargo.toml (96%) rename node/{actors => components}/network/build.rs (100%) rename node/{actors => components}/network/src/config.rs (97%) rename node/{actors => components}/network/src/consensus/handshake/mod.rs (100%) rename node/{actors => components}/network/src/consensus/handshake/testonly.rs (100%) rename node/{actors => components}/network/src/consensus/handshake/tests.rs (100%) rename node/{actors => components}/network/src/consensus/mod.rs (99%) rename node/{actors => components}/network/src/consensus/tests.rs (100%) rename node/{actors => components}/network/src/debug_page/mod.rs (100%) rename node/{actors => components}/network/src/debug_page/style.css (100%) rename node/{actors => components}/network/src/frame.rs (100%) rename node/{actors => components}/network/src/gossip/attestation/metrics.rs (100%) rename node/{actors => components}/network/src/gossip/attestation/mod.rs (100%) rename node/{actors => components}/network/src/gossip/attestation/tests.rs (100%) rename node/{actors => components}/network/src/gossip/fetch.rs (100%) rename node/{actors => components}/network/src/gossip/handshake/mod.rs (100%) rename node/{actors => components}/network/src/gossip/handshake/testonly.rs (100%) rename node/{actors => components}/network/src/gossip/handshake/tests.rs (100%) rename node/{actors => components}/network/src/gossip/loadtest/mod.rs (100%) rename node/{actors => components}/network/src/gossip/loadtest/tests.rs (100%) rename node/{actors => components}/network/src/gossip/mod.rs (98%) rename node/{actors => components}/network/src/gossip/runner.rs (100%) rename node/{actors => components}/network/src/gossip/testonly.rs (100%) rename node/{actors => components}/network/src/gossip/tests/fetch_blocks.rs (100%) rename node/{actors => components}/network/src/gossip/tests/mod.rs (100%) rename node/{actors => components}/network/src/gossip/tests/syncing.rs (100%) rename node/{actors => components}/network/src/gossip/validator_addrs.rs (100%) rename node/{actors => components}/network/src/io.rs (80%) rename node/{actors => components}/network/src/lib.rs (95%) rename node/{actors => components}/network/src/metrics.rs (100%) rename node/{actors => components}/network/src/mux/config.rs (100%) rename node/{actors => components}/network/src/mux/handshake.rs (100%) rename node/{actors => components}/network/src/mux/header.rs (100%) rename node/{actors => components}/network/src/mux/mod.rs (100%) rename node/{actors => components}/network/src/mux/reusable_stream.rs (100%) rename node/{actors => components}/network/src/mux/tests/mod.rs (100%) rename node/{actors => components}/network/src/mux/tests/proto/mod.proto (100%) rename node/{actors => components}/network/src/mux/tests/proto/mod.rs (100%) rename node/{actors => components}/network/src/mux/transient_stream.rs (100%) rename node/{actors => components}/network/src/noise/bytes.rs (100%) rename node/{actors => components}/network/src/noise/mod.rs (100%) rename node/{actors => components}/network/src/noise/stream.rs (100%) rename node/{actors => components}/network/src/noise/testonly.rs (100%) rename node/{actors => components}/network/src/noise/tests.rs (100%) rename node/{actors => components}/network/src/pool.rs (100%) rename node/{actors => components}/network/src/preface.rs (100%) rename node/{actors => components}/network/src/proto/consensus.proto (100%) rename node/{actors => components}/network/src/proto/gossip.proto (100%) rename node/{actors => components}/network/src/proto/mod.rs (100%) rename node/{actors => components}/network/src/proto/mux.proto (100%) rename node/{actors => components}/network/src/proto/ping.proto (100%) rename node/{actors => components}/network/src/proto/preface.proto (100%) rename node/{actors => components}/network/src/proto/rpc.proto (100%) rename node/{actors => components}/network/src/rpc/consensus.rs (100%) rename node/{actors => components}/network/src/rpc/get_block.rs (100%) rename node/{actors => components}/network/src/rpc/metrics.rs (100%) rename node/{actors => components}/network/src/rpc/mod.rs (100%) rename node/{actors => components}/network/src/rpc/ping.rs (100%) rename node/{actors => components}/network/src/rpc/push_batch_votes.rs (100%) rename node/{actors => components}/network/src/rpc/push_block_store_state.rs (100%) rename node/{actors => components}/network/src/rpc/push_validator_addrs.rs (100%) rename node/{actors => components}/network/src/rpc/testonly.rs (100%) rename node/{actors => components}/network/src/rpc/tests.rs (100%) rename node/{actors => components}/network/src/testonly.rs (99%) rename node/{actors => components}/network/src/tests.rs (100%) rename node/{actors => components}/network/src/watch.rs (100%) diff --git a/node/Cargo.toml b/node/Cargo.toml index 52f8bc3a..bdcc75f6 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,8 +1,8 @@ [workspace] members = [ - "actors/bft", - "actors/executor", - "actors/network", + "components/bft", + "components/executor", + "components/network", "libs/concurrency", "libs/crypto", "libs/protobuf", @@ -26,10 +26,10 @@ version = "0.5.0" [workspace.dependencies] # Crates from this repo. -zksync_consensus_bft = { version = "=0.5.0", path = "actors/bft" } +zksync_consensus_bft = { version = "=0.5.0", path = "components/bft" } zksync_consensus_crypto = { version = "=0.5.0", path = "libs/crypto" } -zksync_consensus_executor = { version = "=0.5.0", path = "actors/executor" } -zksync_consensus_network = { version = "=0.5.0", path = "actors/network" } +zksync_consensus_executor = { version = "=0.5.0", path = "components/executor" } +zksync_consensus_network = { version = "=0.5.0", path = "components/network" } zksync_consensus_roles = { version = "=0.5.0", path = "libs/roles" } zksync_consensus_storage = { version = "=0.5.0", path = "libs/storage" } zksync_consensus_tools = { version = "=0.5.0", path = "tools" } diff --git a/node/actors/network/src/state.rs b/node/actors/network/src/state.rs deleted file mode 100644 index 529b999a..00000000 --- a/node/actors/network/src/state.rs +++ /dev/null @@ -1 +0,0 @@ -//! Network actor maintaining a pool of outbound and inbound connections to other nodes. diff --git a/node/actors/bft/Cargo.toml b/node/components/bft/Cargo.toml similarity index 94% rename from node/actors/bft/Cargo.toml rename to node/components/bft/Cargo.toml index 70d09bd3..202c0657 100644 --- a/node/actors/bft/Cargo.toml +++ b/node/components/bft/Cargo.toml @@ -1,6 +1,6 @@ [package] authors.workspace = true -description = "ZKsync consensus bft actor" +description = "ZKsync consensus BFT component" edition.workspace = true homepage.workspace = true keywords.workspace = true diff --git a/node/actors/bft/src/chonky_bft/block.rs b/node/components/bft/src/chonky_bft/block.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/block.rs rename to node/components/bft/src/chonky_bft/block.rs diff --git a/node/actors/bft/src/chonky_bft/commit.rs b/node/components/bft/src/chonky_bft/commit.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/commit.rs rename to node/components/bft/src/chonky_bft/commit.rs diff --git a/node/actors/bft/src/chonky_bft/mod.rs b/node/components/bft/src/chonky_bft/mod.rs similarity index 99% rename from node/actors/bft/src/chonky_bft/mod.rs rename to node/components/bft/src/chonky_bft/mod.rs index 2bdb4481..71340dbb 100644 --- a/node/actors/bft/src/chonky_bft/mod.rs +++ b/node/components/bft/src/chonky_bft/mod.rs @@ -263,7 +263,7 @@ impl StateMachine { }; metrics::METRICS.message_processing_latency[&label].observe_latency(ctx.now() - now); - // Notify network actor that the message has been processed. + // Notify network component that the message has been processed. // Ignore sending error. let _ = req.ack.send(()); } diff --git a/node/actors/bft/src/chonky_bft/new_view.rs b/node/components/bft/src/chonky_bft/new_view.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/new_view.rs rename to node/components/bft/src/chonky_bft/new_view.rs diff --git a/node/actors/bft/src/chonky_bft/proposal.rs b/node/components/bft/src/chonky_bft/proposal.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/proposal.rs rename to node/components/bft/src/chonky_bft/proposal.rs diff --git a/node/actors/bft/src/chonky_bft/proposer.rs b/node/components/bft/src/chonky_bft/proposer.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/proposer.rs rename to node/components/bft/src/chonky_bft/proposer.rs diff --git a/node/actors/bft/src/chonky_bft/testonly.rs b/node/components/bft/src/chonky_bft/testonly.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/testonly.rs rename to node/components/bft/src/chonky_bft/testonly.rs diff --git a/node/actors/bft/src/chonky_bft/tests/commit.rs b/node/components/bft/src/chonky_bft/tests/commit.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/tests/commit.rs rename to node/components/bft/src/chonky_bft/tests/commit.rs diff --git a/node/actors/bft/src/chonky_bft/tests/mod.rs b/node/components/bft/src/chonky_bft/tests/mod.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/tests/mod.rs rename to node/components/bft/src/chonky_bft/tests/mod.rs diff --git a/node/actors/bft/src/chonky_bft/tests/new_view.rs b/node/components/bft/src/chonky_bft/tests/new_view.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/tests/new_view.rs rename to node/components/bft/src/chonky_bft/tests/new_view.rs diff --git a/node/actors/bft/src/chonky_bft/tests/proposal.rs b/node/components/bft/src/chonky_bft/tests/proposal.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/tests/proposal.rs rename to node/components/bft/src/chonky_bft/tests/proposal.rs diff --git a/node/actors/bft/src/chonky_bft/tests/timeout.rs b/node/components/bft/src/chonky_bft/tests/timeout.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/tests/timeout.rs rename to node/components/bft/src/chonky_bft/tests/timeout.rs diff --git a/node/actors/bft/src/chonky_bft/timeout.rs b/node/components/bft/src/chonky_bft/timeout.rs similarity index 100% rename from node/actors/bft/src/chonky_bft/timeout.rs rename to node/components/bft/src/chonky_bft/timeout.rs diff --git a/node/actors/bft/src/config.rs b/node/components/bft/src/config.rs similarity index 95% rename from node/actors/bft/src/config.rs rename to node/components/bft/src/config.rs index 77938549..ea83d2fe 100644 --- a/node/actors/bft/src/config.rs +++ b/node/components/bft/src/config.rs @@ -4,7 +4,7 @@ use std::sync::Arc; use zksync_consensus_roles::validator; use zksync_consensus_storage as storage; -/// Configuration of the bft actor. +/// Configuration of the bft component. #[derive(Debug)] pub struct Config { /// The validator's secret key. diff --git a/node/actors/bft/src/lib.rs b/node/components/bft/src/lib.rs similarity index 93% rename from node/actors/bft/src/lib.rs rename to node/components/bft/src/lib.rs index bd9e1b64..7771222d 100644 --- a/node/actors/bft/src/lib.rs +++ b/node/components/bft/src/lib.rs @@ -1,4 +1,4 @@ -//! This crate contains the consensus actor, which is responsible for handling the logic that allows us to reach agreement on blocks. +//! This crate contains the consensus component, which is responsible for handling the logic that allows us to reach agreement on blocks. //! It uses a new cosnensus algorithm developed at Matter Labs, called ChonkyBFT. You can find the specification of the algorithm [here](../../../../spec). use anyhow::Context; @@ -48,7 +48,7 @@ pub trait PayloadManager: std::fmt::Debug + Send + Sync { } impl Config { - /// Starts the bft actor. It will start running, processing incoming messages and + /// Starts the bft component. It will start running, processing incoming messages and /// sending output messages. pub async fn run( self, @@ -79,7 +79,7 @@ impl Config { .await?; let res = scope::run!(ctx, |ctx, s| async { - tracing::info!("Starting consensus actor {:?}", cfg.secret_key.public()); + tracing::info!("Starting consensus component {:?}", cfg.secret_key.public()); s.spawn(async { replica.run(ctx).await.wrap("replica.run()") }); s.spawn_bg(async { diff --git a/node/actors/bft/src/metrics.rs b/node/components/bft/src/metrics.rs similarity index 100% rename from node/actors/bft/src/metrics.rs rename to node/components/bft/src/metrics.rs diff --git a/node/actors/bft/src/testonly/make.rs b/node/components/bft/src/testonly/make.rs similarity index 100% rename from node/actors/bft/src/testonly/make.rs rename to node/components/bft/src/testonly/make.rs diff --git a/node/actors/bft/src/testonly/mod.rs b/node/components/bft/src/testonly/mod.rs similarity index 100% rename from node/actors/bft/src/testonly/mod.rs rename to node/components/bft/src/testonly/mod.rs diff --git a/node/actors/bft/src/testonly/node.rs b/node/components/bft/src/testonly/node.rs similarity index 93% rename from node/actors/bft/src/testonly/node.rs rename to node/components/bft/src/testonly/node.rs index cba4c705..45696136 100644 --- a/node/actors/bft/src/testonly/node.rs +++ b/node/components/bft/src/testonly/node.rs @@ -45,12 +45,12 @@ impl Node { consensus_sender: channel::UnboundedSender, ) -> anyhow::Result<()> { scope::run!(ctx, |ctx, s| async { - // Create a channel for consensus actor to send messages to the network. + // Create a channel for the consensus component to send messages to the network. // We will use this extra channel to filter messages depending on the nodes // behavior. let (net_send, mut net_recv) = channel::unbounded(); - // Run the consensus actor + // Run the consensus component s.spawn(async { let validator_key = self.net.validator_key.clone().unwrap(); crate::Config { @@ -65,7 +65,7 @@ impl Node { .context("consensus.run()") }); - // Forward output messages from the actor to the network; + // Forward output messages from the consensus to the network; // turns output from this to inputs for others. // Get the next message from the channel. Our response depends on what type of replica we are. while let Ok(msg) = net_recv.recv(ctx).await { diff --git a/node/actors/bft/src/testonly/run.rs b/node/components/bft/src/testonly/run.rs similarity index 99% rename from node/actors/bft/src/testonly/run.rs rename to node/components/bft/src/testonly/run.rs index e283d41b..3546ae3c 100644 --- a/node/actors/bft/src/testonly/run.rs +++ b/node/components/bft/src/testonly/run.rs @@ -318,7 +318,7 @@ async fn run_nodes_twins( .await } -/// Receive input messages from the consensus actor and send them to the others +/// Receive input messages from the consensus component and send them to the others /// according to the partition schedule of the port associated with this instance. /// /// We have to simulate the gossip layer which isn't instantiated by these tests. diff --git a/node/actors/bft/src/testonly/twins/mod.rs b/node/components/bft/src/testonly/twins/mod.rs similarity index 100% rename from node/actors/bft/src/testonly/twins/mod.rs rename to node/components/bft/src/testonly/twins/mod.rs diff --git a/node/actors/bft/src/testonly/twins/partition.rs b/node/components/bft/src/testonly/twins/partition.rs similarity index 100% rename from node/actors/bft/src/testonly/twins/partition.rs rename to node/components/bft/src/testonly/twins/partition.rs diff --git a/node/actors/bft/src/testonly/twins/scenario.rs b/node/components/bft/src/testonly/twins/scenario.rs similarity index 100% rename from node/actors/bft/src/testonly/twins/scenario.rs rename to node/components/bft/src/testonly/twins/scenario.rs diff --git a/node/actors/bft/src/testonly/twins/tests.rs b/node/components/bft/src/testonly/twins/tests.rs similarity index 100% rename from node/actors/bft/src/testonly/twins/tests.rs rename to node/components/bft/src/testonly/twins/tests.rs diff --git a/node/actors/bft/src/tests/mod.rs b/node/components/bft/src/tests/mod.rs similarity index 100% rename from node/actors/bft/src/tests/mod.rs rename to node/components/bft/src/tests/mod.rs diff --git a/node/actors/bft/src/tests/twins.rs b/node/components/bft/src/tests/twins.rs similarity index 100% rename from node/actors/bft/src/tests/twins.rs rename to node/components/bft/src/tests/twins.rs diff --git a/node/actors/executor/Cargo.toml b/node/components/executor/Cargo.toml similarity index 93% rename from node/actors/executor/Cargo.toml rename to node/components/executor/Cargo.toml index a652df00..c8feec5f 100644 --- a/node/actors/executor/Cargo.toml +++ b/node/components/executor/Cargo.toml @@ -1,6 +1,6 @@ [package] authors.workspace = true -description = "ZKsync consensus executor actor" +description = "ZKsync consensus executor component" edition.workspace = true homepage.workspace = true keywords.workspace = true diff --git a/node/actors/executor/src/lib.rs b/node/components/executor/src/lib.rs similarity index 95% rename from node/actors/executor/src/lib.rs rename to node/components/executor/src/lib.rs index 956dc310..afe998c5 100644 --- a/node/actors/executor/src/lib.rs +++ b/node/components/executor/src/lib.rs @@ -71,7 +71,7 @@ impl Config { } } -/// Executor allowing to spin up all actors necessary for a consensus node. +/// Executor allowing to spin up all components necessary for a consensus node. #[derive(Debug)] pub struct Executor { /// General-purpose executor configuration. @@ -110,11 +110,11 @@ impl Executor { pub async fn run(self, ctx: &ctx::Ctx) -> anyhow::Result<()> { let network_config = self.network_config(); - // Generate the communication pipes. We have one for each actor. + // Generate the communication channels. We have one for each component. let (consensus_send, consensus_recv) = bft::Config::create_input_channel(); let (network_send, network_recv) = ctx::channel::unbounded(); - tracing::debug!("Starting actors in separate threads."); + tracing::debug!("Starting components in separate threads."); scope::run!(ctx, |ctx, s| async { let (net, runner) = network::Network::new( network_config, @@ -135,7 +135,7 @@ impl Executor { }); } - // Run the bft actor iff this node is an active validator. + // Run the bft component iff this node is an active validator. let Some(validator) = self.validator else { tracing::info!("Running the node in non-validator mode."); return Ok(()); diff --git a/node/actors/executor/src/tests.rs b/node/components/executor/src/tests.rs similarity index 100% rename from node/actors/executor/src/tests.rs rename to node/components/executor/src/tests.rs diff --git a/node/actors/network/Cargo.toml b/node/components/network/Cargo.toml similarity index 96% rename from node/actors/network/Cargo.toml rename to node/components/network/Cargo.toml index 439ff197..74e0bcd5 100644 --- a/node/actors/network/Cargo.toml +++ b/node/components/network/Cargo.toml @@ -1,6 +1,6 @@ [package] authors.workspace = true -description = "ZKsync consensus network actor" +description = "ZKsync consensus network component" edition.workspace = true homepage.workspace = true keywords.workspace = true diff --git a/node/actors/network/build.rs b/node/components/network/build.rs similarity index 100% rename from node/actors/network/build.rs rename to node/components/network/build.rs diff --git a/node/actors/network/src/config.rs b/node/components/network/src/config.rs similarity index 97% rename from node/actors/network/src/config.rs rename to node/components/network/src/config.rs index 3a25be62..973c3f91 100644 --- a/node/actors/network/src/config.rs +++ b/node/components/network/src/config.rs @@ -1,4 +1,4 @@ -//! Network actor configs. +//! Network component configs. use std::collections::{HashMap, HashSet}; use zksync_concurrency::{limiter, net, time}; use zksync_consensus_roles::{node, validator}; @@ -82,7 +82,7 @@ pub struct GossipConfig { pub static_outbound: HashMap, } -/// Network actor config. +/// Network component config. #[derive(Debug, Clone)] pub struct Config { /// Label identifying the build version of the binary that this node is running. @@ -116,7 +116,7 @@ pub struct Config { /// Set it to `false` in tests to simulate node behavior before pre-genesis support. pub enable_pregenesis: bool, /// Maximum number of not-yet-persisted blocks fetched from the network. - /// If reached, network actor will wait for more blocks to get persisted + /// If reached, network component will wait for more blocks to get persisted /// before fetching the next ones. It is useful for limiting memory consumption /// when the block persisting rate is low. pub max_block_queue_size: usize, diff --git a/node/actors/network/src/consensus/handshake/mod.rs b/node/components/network/src/consensus/handshake/mod.rs similarity index 100% rename from node/actors/network/src/consensus/handshake/mod.rs rename to node/components/network/src/consensus/handshake/mod.rs diff --git a/node/actors/network/src/consensus/handshake/testonly.rs b/node/components/network/src/consensus/handshake/testonly.rs similarity index 100% rename from node/actors/network/src/consensus/handshake/testonly.rs rename to node/components/network/src/consensus/handshake/testonly.rs diff --git a/node/actors/network/src/consensus/handshake/tests.rs b/node/components/network/src/consensus/handshake/tests.rs similarity index 100% rename from node/actors/network/src/consensus/handshake/tests.rs rename to node/components/network/src/consensus/handshake/tests.rs diff --git a/node/actors/network/src/consensus/mod.rs b/node/components/network/src/consensus/mod.rs similarity index 99% rename from node/actors/network/src/consensus/mod.rs rename to node/components/network/src/consensus/mod.rs index 13794944..8e912079 100644 --- a/node/actors/network/src/consensus/mod.rs +++ b/node/components/network/src/consensus/mod.rs @@ -139,7 +139,7 @@ impl rpc::Handler for &Network { ack: send, }); // TODO(gprusak): disconnection means that there message was rejected OR - // that bft actor is missing (in tests), which leads to unnecessary disconnects. + // that bft component is missing (in tests), which leads to unnecessary disconnects. let _ = recv.recv_or_disconnected(ctx).await?; Ok(rpc::consensus::Resp) } diff --git a/node/actors/network/src/consensus/tests.rs b/node/components/network/src/consensus/tests.rs similarity index 100% rename from node/actors/network/src/consensus/tests.rs rename to node/components/network/src/consensus/tests.rs diff --git a/node/actors/network/src/debug_page/mod.rs b/node/components/network/src/debug_page/mod.rs similarity index 100% rename from node/actors/network/src/debug_page/mod.rs rename to node/components/network/src/debug_page/mod.rs diff --git a/node/actors/network/src/debug_page/style.css b/node/components/network/src/debug_page/style.css similarity index 100% rename from node/actors/network/src/debug_page/style.css rename to node/components/network/src/debug_page/style.css diff --git a/node/actors/network/src/frame.rs b/node/components/network/src/frame.rs similarity index 100% rename from node/actors/network/src/frame.rs rename to node/components/network/src/frame.rs diff --git a/node/actors/network/src/gossip/attestation/metrics.rs b/node/components/network/src/gossip/attestation/metrics.rs similarity index 100% rename from node/actors/network/src/gossip/attestation/metrics.rs rename to node/components/network/src/gossip/attestation/metrics.rs diff --git a/node/actors/network/src/gossip/attestation/mod.rs b/node/components/network/src/gossip/attestation/mod.rs similarity index 100% rename from node/actors/network/src/gossip/attestation/mod.rs rename to node/components/network/src/gossip/attestation/mod.rs diff --git a/node/actors/network/src/gossip/attestation/tests.rs b/node/components/network/src/gossip/attestation/tests.rs similarity index 100% rename from node/actors/network/src/gossip/attestation/tests.rs rename to node/components/network/src/gossip/attestation/tests.rs diff --git a/node/actors/network/src/gossip/fetch.rs b/node/components/network/src/gossip/fetch.rs similarity index 100% rename from node/actors/network/src/gossip/fetch.rs rename to node/components/network/src/gossip/fetch.rs diff --git a/node/actors/network/src/gossip/handshake/mod.rs b/node/components/network/src/gossip/handshake/mod.rs similarity index 100% rename from node/actors/network/src/gossip/handshake/mod.rs rename to node/components/network/src/gossip/handshake/mod.rs diff --git a/node/actors/network/src/gossip/handshake/testonly.rs b/node/components/network/src/gossip/handshake/testonly.rs similarity index 100% rename from node/actors/network/src/gossip/handshake/testonly.rs rename to node/components/network/src/gossip/handshake/testonly.rs diff --git a/node/actors/network/src/gossip/handshake/tests.rs b/node/components/network/src/gossip/handshake/tests.rs similarity index 100% rename from node/actors/network/src/gossip/handshake/tests.rs rename to node/components/network/src/gossip/handshake/tests.rs diff --git a/node/actors/network/src/gossip/loadtest/mod.rs b/node/components/network/src/gossip/loadtest/mod.rs similarity index 100% rename from node/actors/network/src/gossip/loadtest/mod.rs rename to node/components/network/src/gossip/loadtest/mod.rs diff --git a/node/actors/network/src/gossip/loadtest/tests.rs b/node/components/network/src/gossip/loadtest/tests.rs similarity index 100% rename from node/actors/network/src/gossip/loadtest/tests.rs rename to node/components/network/src/gossip/loadtest/tests.rs diff --git a/node/actors/network/src/gossip/mod.rs b/node/components/network/src/gossip/mod.rs similarity index 98% rename from node/actors/network/src/gossip/mod.rs rename to node/components/network/src/gossip/mod.rs index d266237d..41e07973 100644 --- a/node/actors/network/src/gossip/mod.rs +++ b/node/components/network/src/gossip/mod.rs @@ -56,7 +56,7 @@ pub(crate) struct Network { pub(crate) validator_addrs: ValidatorAddrsWatch, /// Block store to serve `get_block` requests from. pub(crate) block_store: Arc, - /// Sender of the channel to the consensus actor. + /// Sender of the channel to the consensus component. pub(crate) consensus_sender: sync::prunable_mpsc::Sender, /// Queue of block fetching requests. /// diff --git a/node/actors/network/src/gossip/runner.rs b/node/components/network/src/gossip/runner.rs similarity index 100% rename from node/actors/network/src/gossip/runner.rs rename to node/components/network/src/gossip/runner.rs diff --git a/node/actors/network/src/gossip/testonly.rs b/node/components/network/src/gossip/testonly.rs similarity index 100% rename from node/actors/network/src/gossip/testonly.rs rename to node/components/network/src/gossip/testonly.rs diff --git a/node/actors/network/src/gossip/tests/fetch_blocks.rs b/node/components/network/src/gossip/tests/fetch_blocks.rs similarity index 100% rename from node/actors/network/src/gossip/tests/fetch_blocks.rs rename to node/components/network/src/gossip/tests/fetch_blocks.rs diff --git a/node/actors/network/src/gossip/tests/mod.rs b/node/components/network/src/gossip/tests/mod.rs similarity index 100% rename from node/actors/network/src/gossip/tests/mod.rs rename to node/components/network/src/gossip/tests/mod.rs diff --git a/node/actors/network/src/gossip/tests/syncing.rs b/node/components/network/src/gossip/tests/syncing.rs similarity index 100% rename from node/actors/network/src/gossip/tests/syncing.rs rename to node/components/network/src/gossip/tests/syncing.rs diff --git a/node/actors/network/src/gossip/validator_addrs.rs b/node/components/network/src/gossip/validator_addrs.rs similarity index 100% rename from node/actors/network/src/gossip/validator_addrs.rs rename to node/components/network/src/gossip/validator_addrs.rs diff --git a/node/actors/network/src/io.rs b/node/components/network/src/io.rs similarity index 80% rename from node/actors/network/src/io.rs rename to node/components/network/src/io.rs index 8c4d205e..f3c16fc1 100644 --- a/node/actors/network/src/io.rs +++ b/node/components/network/src/io.rs @@ -2,7 +2,7 @@ use zksync_concurrency::oneshot; use zksync_consensus_roles::validator; -/// Message types from the Consensus actor. +/// Message types from the Consensus component. #[derive(Debug, PartialEq)] pub struct ConsensusInputMessage { pub message: validator::Signed, @@ -13,7 +13,7 @@ pub struct ConsensusInputMessage { pub struct ConsensusReq { /// Payload. pub msg: validator::Signed, - /// Channel that should be used to notify network actor that + /// Channel that should be used to notify the network component that /// processing of this message has been completed. /// Used for rate limiting. pub ack: oneshot::Sender<()>, diff --git a/node/actors/network/src/lib.rs b/node/components/network/src/lib.rs similarity index 95% rename from node/actors/network/src/lib.rs rename to node/components/network/src/lib.rs index 979ac81e..df045f72 100644 --- a/node/actors/network/src/lib.rs +++ b/node/components/network/src/lib.rs @@ -1,4 +1,4 @@ -//! Network actor maintaining a pool of outbound and inbound connections to other nodes. +//! Network component maintaining a pool of outbound and inbound connections to other nodes. use anyhow::Context as _; use gossip::attestation; use std::sync::Arc; @@ -31,7 +31,7 @@ mod watch; pub use config::*; pub use metrics::MeteredStreamStats; -/// State of the network actor observable outside of the actor. +/// State of the network component observable outside of the component. pub struct Network { /// Consensus network state. pub(crate) consensus: Option>, @@ -49,8 +49,8 @@ pub struct Runner { } impl Network { - /// Constructs a new network actor state. - /// Call `run_network` to run the actor. + /// Constructs a new network component state. + /// Call `run_network` to run the component. pub fn new( cfg: Config, block_store: Arc, @@ -93,7 +93,7 @@ impl Network { } impl Runner { - /// Runs the network actor. + /// Runs the network component. pub async fn run(mut self, ctx: &ctx::Ctx) -> anyhow::Result<()> { let res: ctx::Result<()> = scope::run!(ctx, |ctx, s| async { let mut listener = self diff --git a/node/actors/network/src/metrics.rs b/node/components/network/src/metrics.rs similarity index 100% rename from node/actors/network/src/metrics.rs rename to node/components/network/src/metrics.rs diff --git a/node/actors/network/src/mux/config.rs b/node/components/network/src/mux/config.rs similarity index 100% rename from node/actors/network/src/mux/config.rs rename to node/components/network/src/mux/config.rs diff --git a/node/actors/network/src/mux/handshake.rs b/node/components/network/src/mux/handshake.rs similarity index 100% rename from node/actors/network/src/mux/handshake.rs rename to node/components/network/src/mux/handshake.rs diff --git a/node/actors/network/src/mux/header.rs b/node/components/network/src/mux/header.rs similarity index 100% rename from node/actors/network/src/mux/header.rs rename to node/components/network/src/mux/header.rs diff --git a/node/actors/network/src/mux/mod.rs b/node/components/network/src/mux/mod.rs similarity index 100% rename from node/actors/network/src/mux/mod.rs rename to node/components/network/src/mux/mod.rs diff --git a/node/actors/network/src/mux/reusable_stream.rs b/node/components/network/src/mux/reusable_stream.rs similarity index 100% rename from node/actors/network/src/mux/reusable_stream.rs rename to node/components/network/src/mux/reusable_stream.rs diff --git a/node/actors/network/src/mux/tests/mod.rs b/node/components/network/src/mux/tests/mod.rs similarity index 100% rename from node/actors/network/src/mux/tests/mod.rs rename to node/components/network/src/mux/tests/mod.rs diff --git a/node/actors/network/src/mux/tests/proto/mod.proto b/node/components/network/src/mux/tests/proto/mod.proto similarity index 100% rename from node/actors/network/src/mux/tests/proto/mod.proto rename to node/components/network/src/mux/tests/proto/mod.proto diff --git a/node/actors/network/src/mux/tests/proto/mod.rs b/node/components/network/src/mux/tests/proto/mod.rs similarity index 100% rename from node/actors/network/src/mux/tests/proto/mod.rs rename to node/components/network/src/mux/tests/proto/mod.rs diff --git a/node/actors/network/src/mux/transient_stream.rs b/node/components/network/src/mux/transient_stream.rs similarity index 100% rename from node/actors/network/src/mux/transient_stream.rs rename to node/components/network/src/mux/transient_stream.rs diff --git a/node/actors/network/src/noise/bytes.rs b/node/components/network/src/noise/bytes.rs similarity index 100% rename from node/actors/network/src/noise/bytes.rs rename to node/components/network/src/noise/bytes.rs diff --git a/node/actors/network/src/noise/mod.rs b/node/components/network/src/noise/mod.rs similarity index 100% rename from node/actors/network/src/noise/mod.rs rename to node/components/network/src/noise/mod.rs diff --git a/node/actors/network/src/noise/stream.rs b/node/components/network/src/noise/stream.rs similarity index 100% rename from node/actors/network/src/noise/stream.rs rename to node/components/network/src/noise/stream.rs diff --git a/node/actors/network/src/noise/testonly.rs b/node/components/network/src/noise/testonly.rs similarity index 100% rename from node/actors/network/src/noise/testonly.rs rename to node/components/network/src/noise/testonly.rs diff --git a/node/actors/network/src/noise/tests.rs b/node/components/network/src/noise/tests.rs similarity index 100% rename from node/actors/network/src/noise/tests.rs rename to node/components/network/src/noise/tests.rs diff --git a/node/actors/network/src/pool.rs b/node/components/network/src/pool.rs similarity index 100% rename from node/actors/network/src/pool.rs rename to node/components/network/src/pool.rs diff --git a/node/actors/network/src/preface.rs b/node/components/network/src/preface.rs similarity index 100% rename from node/actors/network/src/preface.rs rename to node/components/network/src/preface.rs diff --git a/node/actors/network/src/proto/consensus.proto b/node/components/network/src/proto/consensus.proto similarity index 100% rename from node/actors/network/src/proto/consensus.proto rename to node/components/network/src/proto/consensus.proto diff --git a/node/actors/network/src/proto/gossip.proto b/node/components/network/src/proto/gossip.proto similarity index 100% rename from node/actors/network/src/proto/gossip.proto rename to node/components/network/src/proto/gossip.proto diff --git a/node/actors/network/src/proto/mod.rs b/node/components/network/src/proto/mod.rs similarity index 100% rename from node/actors/network/src/proto/mod.rs rename to node/components/network/src/proto/mod.rs diff --git a/node/actors/network/src/proto/mux.proto b/node/components/network/src/proto/mux.proto similarity index 100% rename from node/actors/network/src/proto/mux.proto rename to node/components/network/src/proto/mux.proto diff --git a/node/actors/network/src/proto/ping.proto b/node/components/network/src/proto/ping.proto similarity index 100% rename from node/actors/network/src/proto/ping.proto rename to node/components/network/src/proto/ping.proto diff --git a/node/actors/network/src/proto/preface.proto b/node/components/network/src/proto/preface.proto similarity index 100% rename from node/actors/network/src/proto/preface.proto rename to node/components/network/src/proto/preface.proto diff --git a/node/actors/network/src/proto/rpc.proto b/node/components/network/src/proto/rpc.proto similarity index 100% rename from node/actors/network/src/proto/rpc.proto rename to node/components/network/src/proto/rpc.proto diff --git a/node/actors/network/src/rpc/consensus.rs b/node/components/network/src/rpc/consensus.rs similarity index 100% rename from node/actors/network/src/rpc/consensus.rs rename to node/components/network/src/rpc/consensus.rs diff --git a/node/actors/network/src/rpc/get_block.rs b/node/components/network/src/rpc/get_block.rs similarity index 100% rename from node/actors/network/src/rpc/get_block.rs rename to node/components/network/src/rpc/get_block.rs diff --git a/node/actors/network/src/rpc/metrics.rs b/node/components/network/src/rpc/metrics.rs similarity index 100% rename from node/actors/network/src/rpc/metrics.rs rename to node/components/network/src/rpc/metrics.rs diff --git a/node/actors/network/src/rpc/mod.rs b/node/components/network/src/rpc/mod.rs similarity index 100% rename from node/actors/network/src/rpc/mod.rs rename to node/components/network/src/rpc/mod.rs diff --git a/node/actors/network/src/rpc/ping.rs b/node/components/network/src/rpc/ping.rs similarity index 100% rename from node/actors/network/src/rpc/ping.rs rename to node/components/network/src/rpc/ping.rs diff --git a/node/actors/network/src/rpc/push_batch_votes.rs b/node/components/network/src/rpc/push_batch_votes.rs similarity index 100% rename from node/actors/network/src/rpc/push_batch_votes.rs rename to node/components/network/src/rpc/push_batch_votes.rs diff --git a/node/actors/network/src/rpc/push_block_store_state.rs b/node/components/network/src/rpc/push_block_store_state.rs similarity index 100% rename from node/actors/network/src/rpc/push_block_store_state.rs rename to node/components/network/src/rpc/push_block_store_state.rs diff --git a/node/actors/network/src/rpc/push_validator_addrs.rs b/node/components/network/src/rpc/push_validator_addrs.rs similarity index 100% rename from node/actors/network/src/rpc/push_validator_addrs.rs rename to node/components/network/src/rpc/push_validator_addrs.rs diff --git a/node/actors/network/src/rpc/testonly.rs b/node/components/network/src/rpc/testonly.rs similarity index 100% rename from node/actors/network/src/rpc/testonly.rs rename to node/components/network/src/rpc/testonly.rs diff --git a/node/actors/network/src/rpc/tests.rs b/node/components/network/src/rpc/tests.rs similarity index 100% rename from node/actors/network/src/rpc/tests.rs rename to node/components/network/src/rpc/tests.rs diff --git a/node/actors/network/src/testonly.rs b/node/components/network/src/testonly.rs similarity index 99% rename from node/actors/network/src/testonly.rs rename to node/components/network/src/testonly.rs index 603437b2..29c2bb14 100644 --- a/node/actors/network/src/testonly.rs +++ b/node/components/network/src/testonly.rs @@ -78,7 +78,7 @@ pub(crate) async fn forward( let _ = io::shutdown(ctx, &mut write).await; } -/// Node instance, wrapping the network actor state and the +/// Node instance, wrapping the network component state and the /// events channel. pub struct Instance { /// State of the instance. diff --git a/node/actors/network/src/tests.rs b/node/components/network/src/tests.rs similarity index 100% rename from node/actors/network/src/tests.rs rename to node/components/network/src/tests.rs diff --git a/node/actors/network/src/watch.rs b/node/components/network/src/watch.rs similarity index 100% rename from node/actors/network/src/watch.rs rename to node/components/network/src/watch.rs diff --git a/node/libs/roles/src/validator/messages/genesis.rs b/node/libs/roles/src/validator/messages/genesis.rs index 9f126409..19d6daeb 100644 --- a/node/libs/roles/src/validator/messages/genesis.rs +++ b/node/libs/roles/src/validator/messages/genesis.rs @@ -140,7 +140,7 @@ impl TryFrom for ProtocolVersion { fn try_from(value: u32) -> Result { // Currently, consensus doesn't define restrictions on the possible version. Unsupported - // versions are filtered out on the BFT actor level instead. + // versions are filtered out on the BFT component level instead. Ok(Self(value)) } } diff --git a/node/tools/src/main.rs b/node/tools/src/main.rs index bf79a9bd..a80bb6b9 100644 --- a/node/tools/src/main.rs +++ b/node/tools/src/main.rs @@ -1,5 +1,5 @@ //! Main binary for the consensus node. It reads the configuration, initializes all parts of the node and -//! manages communication between the actors. It is the main executable in this workspace. +//! manages communication between the components. It is the main executable in this workspace. use anyhow::Context as _; use clap::Parser; use std::{fs, fs::Permissions, io::IsTerminal as _, os::unix::fs::PermissionsExt, path::PathBuf};