Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bumped capability ID of the push_batch_votes rpc #176

Merged
merged 4 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions node/actors/executor/src/tests.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//! High-level tests for `Executor`.
use std::sync::{atomic::AtomicU64, Mutex};

use super::*;
use attestation::{AttestationStatusClient, AttestationStatusRunner};
use rand::Rng as _;
use std::sync::{atomic::AtomicU64, Mutex};
use tracing::Instrument as _;
use zksync_concurrency::{sync, testonly::abort_on_panic};
use zksync_consensus_bft as bft;
Expand Down
4 changes: 1 addition & 3 deletions node/actors/network/src/gossip/attestation_status.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use crate::watch::Watch;
use std::fmt;

use zksync_concurrency::sync;
use zksync_consensus_roles::attester;

use crate::watch::Watch;

/// Coordinate the attestation by showing the status as seen by the main node.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct AttestationStatus {
Expand Down
8 changes: 4 additions & 4 deletions node/actors/network/src/gossip/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
//! Static connections constitute a rigid "backbone" of the gossip network, which is insensitive to
//! eclipse attack. Dynamic connections are supposed to improve the properties of the gossip
//! network graph (minimize its diameter, increase connectedness).
pub use self::attestation_status::{
AttestationStatus, AttestationStatusReceiver, AttestationStatusWatch,
};
pub use self::batch_votes::BatchVotesPublisher;
use self::batch_votes::BatchVotesWatch;
pub use self::{
attestation_status::{AttestationStatus, AttestationStatusReceiver, AttestationStatusWatch},
batch_votes::BatchVotesPublisher,
};
use crate::{gossip::ValidatorAddrsWatch, io, pool::PoolWatch, Config, MeteredStreamStats};
use fetch::RequestItem;
use std::sync::{atomic::AtomicUsize, Arc};
Expand Down
12 changes: 11 additions & 1 deletion node/actors/network/src/rpc/push_batch_votes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,18 @@ use zksync_protobuf::ProtoFmt;
/// PushBatchVotes RPC.
pub(crate) struct Rpc;

/// Deprecated, because adding `genesis_hash` to `validator::Batch`
/// was not backward compatible - old binaries couldn't verify
/// signatures on messages with `genesis_hash` and were treating it
/// as malicious behavior.
#[allow(dead_code)]
pub(super) const V1: mux::CapabilityId = 5;

/// Current version.
pub(super) const V2: mux::CapabilityId = 8;

impl super::Rpc for Rpc {
const CAPABILITY_ID: mux::CapabilityId = 5;
const CAPABILITY_ID: mux::CapabilityId = V2;
const INFLIGHT: u32 = 1;
const METHOD: &'static str = "push_batch_votes";
type Req = Req;
Expand Down
3 changes: 2 additions & 1 deletion node/actors/network/src/rpc/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ fn test_capability_rpc_correspondence() {
push_block_store_state::Rpc::CAPABILITY_ID,
get_block::Rpc::CAPABILITY_ID,
ping::Rpc::CAPABILITY_ID,
push_batch_votes::Rpc::CAPABILITY_ID,
push_batch_votes::V1,
push_batch_votes::V2,
push_batch_store_state::Rpc::CAPABILITY_ID,
get_batch::Rpc::CAPABILITY_ID,
];
Expand Down
1 change: 1 addition & 0 deletions node/libs/concurrency/src/ctx/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
//! Note that channel disconnection is not observable by default:
//! * send() always succeeds, unless canceled
//! * recv() always succeeds, unless canceled
//!
//! This
//! * simplifies the channel interface
//! * prevents users from relying on send/recv failure
Expand Down
2 changes: 1 addition & 1 deletion node/libs/concurrency/src/sync/prunable_mpsc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub enum SelectionFunctionResult {
/// * [`T`]: The type of data that will be sent through the channel.
/// * [`filter_predicate`]: A predicate that checks the newly sent value and avoids adding to the queue if it returns false
/// * [`selection_function`]: A function that determines whether an unreceived, pending value in the buffer (represented by the first `T`) should be pruned
/// based on a newly sent value (represented by the second `T`) or the new value should be filtered out, or both should be kept.
/// based on a newly sent value (represented by the second `T`) or the new value should be filtered out, or both should be kept.
pub fn channel<T>(
filter_predicate: impl 'static + Sync + Send + Fn(&T) -> bool,
selection_function: impl 'static + Sync + Send + Fn(&T, &T) -> SelectionFunctionResult,
Expand Down
Loading