Skip to content

Commit

Permalink
Merge branch 'main' into full_config_in_cli
Browse files Browse the repository at this point in the history
  • Loading branch information
ElFantasma committed Mar 18, 2024
2 parents 8d70eec + e53872a commit 31db3aa
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 22 deletions.
8 changes: 7 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
# Contribution Guidelines

Hello! Thanks for your interest in joining the mission to accelerate the mass adoption of crypto for personal
sovereignty! We welcome contributions from anyone on the internet, and are grateful for even the smallest of fixes!
sovereignty! We welcome contributions from anyone on the internet.

Note, however, that all the contributions are subject to review, and not every contribution is guaranteed to be merged.
It is highly advised to reach out to developers (for example, by creating an issue) before preparing a significant
change in the codebase, and explicitly confirm that this contribution will be considered for merge. Otherwise, it is
possible to discover that a feature you have spent some time on does not align with the core team vision or capacity to
maintain a high quality of given submission long term.

## Ways to contribute

Expand Down
2 changes: 0 additions & 2 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,5 @@ wildcard_dependencies = "warn"
redundant_locals = "allow"
needless_pass_by_ref_mut = "allow"
box_default = "allow"
# remove once fix to https://github.com/rust-lang/rust-clippy/issues/11764 is available on CI.
map_identity = "allow"
# &*x is not equivalent to x, because it affects borrowing in closures.
borrow_deref_ref = "allow"
2 changes: 1 addition & 1 deletion node/actors/bft/src/replica/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ async fn leader_prepare_reproposal_invalid_block() {
.unwrap();
}

/// Check that replica provides expecte high_vote and high_qc after finalizing a block.
/// Check that replica provides expected high_vote and high_qc after finalizing a block.
#[tokio::test]
async fn leader_commit_sanity_yield_replica_prepare() {
zksync_concurrency::testonly::abort_on_panic();
Expand Down
4 changes: 2 additions & 2 deletions node/actors/network/src/mux/reusable_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ pub(crate) struct StreamQueue {
}

impl StreamQueue {
/// Constructs a new StreamQueue with the specificied number of reusable streams.
/// Constructs a new StreamQueue with the specified number of reusable streams.
/// During multiplexer handshake, peers exchange information about
/// how many reusable streams they support per capability.
pub(crate) fn new(max_streams: u32) -> Arc<Self> {
Expand Down Expand Up @@ -289,7 +289,7 @@ impl ReusableStream {
read_receiver = new_read_receiver;
let (write_lock, new_write_receiver) = sync::ExclusiveLock::new(write);
write_receiver = new_write_receiver;
// Sending may fail because the requestor is not interested in the stream any more.
// Sending may fail because the requester is not interested in the stream any more.
// In this case we just close the transient stream immediately.
let _ = reservation.send(Stream {
read: ReadStream(read_lock),
Expand Down
2 changes: 1 addition & 1 deletion node/libs/concurrency/src/ctx/clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use std::{
};
use tokio::sync::watch;

// Instant doesn't have a deterministic contructor.
// Instant doesn't have a deterministic constructor.
// However since Instant is not convertible to an unix timestamp,
// we can snapshot Instant::now() once and treat it as a constant.
// All observable effects will be then deterministic.
Expand Down
2 changes: 1 addition & 1 deletion node/libs/concurrency/src/limiter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl Limiter {
}

/// Acquires reservation for `permits` permits from the rate limiter.
/// It blocks until enought permits are available.
/// It blocks until enough permits are available.
/// It is fair in a sense that in case a later acquire() call is
/// executed, but for a smaller number of permits, it has to wait
/// until the previous call (for a larger number of permits) completes.
Expand Down
2 changes: 1 addition & 1 deletion node/libs/concurrency/src/limiter/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ async fn immediate_permit_consumption() {
}

#[tokio::test]
async fn inifinite_refresh_rate() {
async fn infinite_refresh_rate() {
testonly::abort_on_panic();
let clock = &ctx::ManualClock::new();
let ctx = &ctx::test_root(clock);
Expand Down
4 changes: 2 additions & 2 deletions node/libs/concurrency/src/scope/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
//! Task can be either async or blocking:
//! * Async tasks are Futures executed via `Task::run`. They MUSN'T call blocking operations,
//! because they are executed on a shared thread pool.
//! * Blocking tasks are `FnOnce()` functions/closures exeucted via `Task::run_blocking`. Blocking
//! * Blocking tasks are `FnOnce()` functions/closures executed via `Task::run_blocking`. Blocking
//! task MUST be executed on a dedicated thread rather than a shared thread pool.
//! * All functions which perform blocking calls should be documented as blocking.
//! If a function has multiple versions and the async version is called `<f>`, then the sync
Expand Down Expand Up @@ -117,7 +117,7 @@ impl<E: 'static + Send> Task<E> {
}

/// Runs an sync blocking task in the scope. MUST be executed on a dedicated thread.
/// See `Task::run` for behavior. See module docs for desciption of blocking tasks.
/// See `Task::run` for behavior. See module docs for description of blocking tasks.
pub(super) fn run_blocking<T>(self, f: impl FnOnce() -> Result<T, E>) -> Result<T, Terminated> {
let panic_reporter = PanicReporter::new(self);
let res = f();
Expand Down
2 changes: 1 addition & 1 deletion node/libs/protobuf/src/proto_fmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub(super) fn read_fields(
}

/// Converts an encoded protobuf message to its canonical form, given the descriptor of the message
/// type. Retuns an error if:
/// type. Returns an error if:
/// * an unknown field is detected
/// * the message type doesn't support canonical encoding (implicit presence, map fields)
pub fn canonical_raw(
Expand Down
2 changes: 1 addition & 1 deletion node/libs/roles/src/proto/validator.proto
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ message NetAddress {
// Currently the IP of the validator is static, but this scheme might also
// be used to provide dynamic IP support (if validator discovers that its
// own IP has changed - by pinging a trusted STUN server for example - it can
// broadcast a new discovery message), or (mutli)proxy support (a validator
// broadcast a new discovery message), or (multi)proxy support (a validator
// may maintain a dynamic set of trusted proxy servers which forward traffic
// to it - this way validator wouldn't have to have a public IP at all).
optional uint64 version = 2; // required
Expand Down
3 changes: 1 addition & 2 deletions node/tests/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//! This is a simple test for the RPC server. It checks if the server is running and can respond to.
use std::{fs, io::Write, net::SocketAddr, path::PathBuf, str::FromStr};

use anyhow::{ensure, Context};
use clap::{Parser, Subcommand};
use jsonrpsee::{core::client::ClientT, http_client::HttpClientBuilder, rpc_params, types::Params};
use std::{fs, io::Write, net::SocketAddr, path::PathBuf, str::FromStr};
use zksync_consensus_tools::{
k8s,
rpc::methods::{health_check::HealthCheck, RPCMethod},
Expand Down
5 changes: 2 additions & 3 deletions node/tools/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
use crate::{proto, store};
use anyhow::Context as _;
use serde_json::{ser::Formatter, Serializer};
use std::net::Ipv4Addr;
use std::str::FromStr;
use std::{
collections::{HashMap, HashSet},
fs,
net::SocketAddr,
net::{Ipv4Addr, SocketAddr},
path::{Path, PathBuf},
str::FromStr,
};
use zksync_concurrency::ctx;
use zksync_consensus_bft as bft;
Expand Down
3 changes: 1 addition & 2 deletions node/tools/src/rpc/methods/config.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Peers method for RPC server.
use crate::{config::encode_json, decode_json, AppConfig};

use super::RPCMethod;
use crate::{config::encode_json, decode_json, AppConfig};
use jsonrpsee::types::{error::ErrorCode, Params};
use std::fs::{self};
use zksync_protobuf::serde::Serde;
Expand Down
3 changes: 1 addition & 2 deletions node/tools/src/rpc/server.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use crate::AppConfig;

use super::methods::{config::ConfigInfo, health_check::HealthCheck, peers::PeersInfo, RPCMethod};
use crate::AppConfig;
use jsonrpsee::server::{middleware::http::ProxyGetRequestLayer, RpcModule, Server};
use std::net::SocketAddr;
use zksync_concurrency::{ctx, scope};
Expand Down

0 comments on commit 31db3aa

Please sign in to comment.