Skip to content

Commit

Permalink
Merge branch 'main' into igor/quint-timeout-qc-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
konnov committed Jul 27, 2024
2 parents 6bd71a0 + 0d27fcf commit c07f3ea
Show file tree
Hide file tree
Showing 25 changed files with 376 additions and 216 deletions.
28 changes: 14 additions & 14 deletions node/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,23 @@ homepage = "https://matter-labs.io/"
repository = "https://github.com/matter-labs/era-consensus"
license = "MIT OR Apache-2.0"
keywords = ["blockchain", "zksync"]
version = "0.1.0-rc.2"
version = "0.1.0-rc.4"

[workspace.dependencies]
# Crates from this repo.
zksync_consensus_bft = { version = "=0.1.0-rc.2", path = "actors/bft" }
zksync_consensus_crypto = { version = "=0.1.0-rc.2", path = "libs/crypto" }
zksync_consensus_executor = { version = "=0.1.0-rc.2", path = "actors/executor" }
zksync_consensus_network = { version = "=0.1.0-rc.2", path = "actors/network" }
zksync_consensus_roles = { version = "=0.1.0-rc.2", path = "libs/roles" }
zksync_consensus_storage = { version = "=0.1.0-rc.2", path = "libs/storage" }
zksync_consensus_tools = { version = "=0.1.0-rc.2", path = "tools" }
zksync_consensus_utils = { version = "=0.1.0-rc.2", path = "libs/utils" }
zksync_consensus_bft = { version = "=0.1.0-rc.4", path = "actors/bft" }
zksync_consensus_crypto = { version = "=0.1.0-rc.4", path = "libs/crypto" }
zksync_consensus_executor = { version = "=0.1.0-rc.4", path = "actors/executor" }
zksync_consensus_network = { version = "=0.1.0-rc.4", path = "actors/network" }
zksync_consensus_roles = { version = "=0.1.0-rc.4", path = "libs/roles" }
zksync_consensus_storage = { version = "=0.1.0-rc.4", path = "libs/storage" }
zksync_consensus_tools = { version = "=0.1.0-rc.4", path = "tools" }
zksync_consensus_utils = { version = "=0.1.0-rc.4", path = "libs/utils" }

# Crates from this repo that might become independent in the future.
zksync_concurrency = { version = "=0.1.0-rc.2", path = "libs/concurrency" }
zksync_protobuf = { version = "=0.1.0-rc.2", path = "libs/protobuf" }
zksync_protobuf_build = { version = "=0.1.0-rc.2", path = "libs/protobuf_build" }
zksync_concurrency = { version = "=0.1.0-rc.4", path = "libs/concurrency" }
zksync_protobuf = { version = "=0.1.0-rc.4", path = "libs/protobuf" }
zksync_protobuf_build = { version = "=0.1.0-rc.4", path = "libs/protobuf_build" }

# Crates from Matter Labs.
pairing = { package = "pairing_ce", version = "=0.28.6" }
Expand Down
10 changes: 3 additions & 7 deletions node/actors/executor/src/attestation.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
//! Module to publish attestations over batches.

use std::sync::Arc;

use crate::Attester;
use anyhow::Context;
use zksync_concurrency::ctx;
use zksync_concurrency::time;
use std::sync::Arc;
use zksync_concurrency::{ctx, time};
use zksync_consensus_network::gossip::BatchVotesPublisher;
use zksync_consensus_roles::attester;
use zksync_consensus_storage::{BatchStore, BlockStore};

use crate::Attester;

const POLL_INTERVAL: time::Duration = time::Duration::seconds(1);

/// Polls the database for new batches to be signed and publishes them to the gossip channel.
Expand Down Expand Up @@ -56,7 +53,6 @@ impl AttesterRunner {
.await
.context("wait_until_persisted")?
.last
.map(|b| b.number)
.unwrap_or_default();

// Determine the batch to start signing from.
Expand Down
9 changes: 4 additions & 5 deletions node/actors/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use std::{
};
use zksync_concurrency::{ctx, limiter, net, scope, time};
use zksync_consensus_bft as bft;
use zksync_consensus_network::{self as network};
use zksync_consensus_network as network;
use zksync_consensus_roles::{attester, node, validator};
use zksync_consensus_storage::{BatchStore, BlockStore, ReplicaStore};
use zksync_consensus_utils::pipe;
Expand Down Expand Up @@ -50,7 +50,7 @@ pub struct Config {
/// Maximal size of the block payload.
pub max_payload_size: usize,
/// Maximal size of a batch, which includes `max_payload_size` per block in the batch,
/// plus the size of the Merkle proof of the commitment being included on L1 (should be ~1kB).
/// plus the size of the Merkle proof of the commitment being included on L1.
pub max_batch_size: usize,
/// Key of this node. It uniquely identifies the node.
/// It should match the secret key provided in the `node_key` file.
Expand Down Expand Up @@ -132,15 +132,14 @@ impl Executor {

tracing::debug!("Starting actors in separate threads.");
scope::run!(ctx, |ctx, s| async {
s.spawn(async { dispatcher.run(ctx).await.context("IO Dispatcher stopped") });
let (net, runner) = network::Network::new(
network_config,
self.block_store.clone(),
self.batch_store.clone(),
network_actor_pipe,
);
net.register_metrics();

s.spawn(async { dispatcher.run(ctx).await.context("IO Dispatcher stopped") });
s.spawn(async { runner.run(ctx).await.context("Network stopped") });

if let Some(attester) = self.attester {
Expand All @@ -151,7 +150,7 @@ impl Executor {
attester,
net.batch_vote_publisher(),
);
s.spawn::<()>(async {
s.spawn(async {
runner.run(ctx).await?;
Ok(())
});
Expand Down
Loading

0 comments on commit c07f3ea

Please sign in to comment.