Skip to content

Commit

Permalink
sync with main
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless committed Aug 1, 2024
2 parents ba395ec + 1d206c0 commit 8a9d0b4
Show file tree
Hide file tree
Showing 62 changed files with 2,040 additions and 1,191 deletions.
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"core": "24.12.0",
"core": "24.13.0",
"prover": "16.1.0"
}
6 changes: 6 additions & 0 deletions .github/workflows/ci-zk-toolbox-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ jobs:
run: |
ci_run zk_supervisor test revert --external-node --ignore-prerequisites --verbose
# This test should be the last one as soon as it
# finished bootloader will be different
- name: Run upgrade test
run: |
ci_run zk_supervisor test upgrade
- name: Show server.log logs
if: always()
run: ci_run cat server.log || true
Expand Down
16 changes: 15 additions & 1 deletion Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ opentelemetry = "0.24.0"
opentelemetry_sdk = "0.24.0"
opentelemetry-otlp = "0.17.0"
opentelemetry-semantic-conventions = "0.16.0"
opentelemetry-appender-tracing = "0.5"
pin-project-lite = "0.2.13"
pretty_assertions = "1"
prost = "0.12.1"
Expand Down
28 changes: 28 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# Changelog

## [24.13.0](https://github.com/matter-labs/zksync-era/compare/core-v24.12.0...core-v24.13.0) (2024-07-31)


### Features

* Add recovery tests to zk_supervisor ([#2444](https://github.com/matter-labs/zksync-era/issues/2444)) ([0c0d10a](https://github.com/matter-labs/zksync-era/commit/0c0d10af703d3f8958c49d0ed46d6cda64945fa1))
* Added a JSON RPC to simulating L1 for consensus attestation ([#2480](https://github.com/matter-labs/zksync-era/issues/2480)) ([c6b3adf](https://github.com/matter-labs/zksync-era/commit/c6b3adf3f29d3a89daa2cfffa1c0e5cb9770eb0d))
* added dropping all attester certificates when doing hard fork ([#2529](https://github.com/matter-labs/zksync-era/issues/2529)) ([5acd686](https://github.com/matter-labs/zksync-era/commit/5acd68640da6b22897185d76101180bcd838ac67))
* **configs:** Do not panic if config is only partially filled ([#2545](https://github.com/matter-labs/zksync-era/issues/2545)) ([db13fe3](https://github.com/matter-labs/zksync-era/commit/db13fe3550598c69f59cd66b4bb9618ebea041ca))
* **eth-sender:** Make eth-sender tests use blob txs + refactor of eth-sender tests ([#2316](https://github.com/matter-labs/zksync-era/issues/2316)) ([c8c8334](https://github.com/matter-labs/zksync-era/commit/c8c83349c10710d75c0030409f926db313c9660d))
* Introduce more tracing instrumentation ([#2523](https://github.com/matter-labs/zksync-era/issues/2523)) ([79d407a](https://github.com/matter-labs/zksync-era/commit/79d407ac47ac51667196aa2cd028d05b1622130f))
* Remove unused VKs, add docs for BWG ([#2468](https://github.com/matter-labs/zksync-era/issues/2468)) ([2fa6bf0](https://github.com/matter-labs/zksync-era/commit/2fa6bf0ffa5d7a5ff62d595a0efeff9dcd9e5a1a))
* Revisit base config values ([#2532](https://github.com/matter-labs/zksync-era/issues/2532)) ([3fac8ac](https://github.com/matter-labs/zksync-era/commit/3fac8ac62cc9ac14845f32240af9241386f4034d))
* Server 10k gwei limit on gas price and 1M limit on pubdata price ([#2460](https://github.com/matter-labs/zksync-era/issues/2460)) ([be238cc](https://github.com/matter-labs/zksync-era/commit/be238ccb35e4581de22156f76903211bd85526b7))
* **vlog:** Implement otlp guard with force flush on drop ([#2536](https://github.com/matter-labs/zksync-era/issues/2536)) ([c9f76e5](https://github.com/matter-labs/zksync-era/commit/c9f76e571e5570d2c4194feee03bb260b24c378f))
* **vlog:** New vlog interface + opentelemtry improvements ([#2472](https://github.com/matter-labs/zksync-era/issues/2472)) ([c0815cd](https://github.com/matter-labs/zksync-era/commit/c0815cdaf878afcd9c41dddd9fe56bcf8d910633))
* **zk_toolbox:** add test upgrade subcommand to zk_toolbox ([#2515](https://github.com/matter-labs/zksync-era/issues/2515)) ([1a12f5f](https://github.com/matter-labs/zksync-era/commit/1a12f5f908add42c090170a2f4fb26b731d6971b))
* **zk_toolbox:** use configs from the main repo ([#2470](https://github.com/matter-labs/zksync-era/issues/2470)) ([4222d13](https://github.com/matter-labs/zksync-era/commit/4222d135b62eb4de103c4aebb35e9c302d94ad63))


### Bug Fixes

* **contract verifier:** Fix config values ([#2510](https://github.com/matter-labs/zksync-era/issues/2510)) ([3729468](https://github.com/matter-labs/zksync-era/commit/3729468436114642e62ce8a531533921015455a7))
* fixed panic propagation ([#2525](https://github.com/matter-labs/zksync-era/issues/2525)) ([e0fc58b](https://github.com/matter-labs/zksync-era/commit/e0fc58b536debf804920887e3eb4bc050a9fe9d6))
* **proof_data_handler:** Unlock jobs on transient errors ([#2486](https://github.com/matter-labs/zksync-era/issues/2486)) ([7c336b1](https://github.com/matter-labs/zksync-era/commit/7c336b1e180b9d5ba1ba74169c61ce27a251e2fc))
* **prover:** Parallelize circuit metadata uploading for BWG ([#2520](https://github.com/matter-labs/zksync-era/issues/2520)) ([f49720f](https://github.com/matter-labs/zksync-era/commit/f49720fbafdab8f102d908b2be3fa869482a92fa))
* VM performance diff: don't show 0 as N/A ([#2276](https://github.com/matter-labs/zksync-era/issues/2276)) ([2fa2249](https://github.com/matter-labs/zksync-era/commit/2fa2249dca15b1968fceec11e485850395f03c9d))

## [24.12.0](https://github.com/matter-labs/zksync-era/compare/core-v24.11.0...core-v24.12.0) (2024-07-25)


Expand Down
2 changes: 1 addition & 1 deletion core/bin/external_node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "zksync_external_node"
description = "Non-validator ZKsync node"
version = "24.12.0" # x-release-please-version
version = "24.13.0" # x-release-please-version
edition.workspace = true
authors.workspace = true
homepage.workspace = true
Expand Down
8 changes: 7 additions & 1 deletion core/lib/config/src/configs/observability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ pub struct ObservabilityConfig {
pub struct OpentelemetryConfig {
/// Enables export of span data of specified level (and above) using opentelemetry exporters.
pub level: String,
/// Opentelemetry HTTP collector endpoint.
/// Opentelemetry HTTP traces collector endpoint.
pub endpoint: String,
/// Opentelemetry HTTP logs collector endpoing.
/// This is optional, since right now the primary way to collect logs is via stdout.
///
/// Important: sending logs via OTLP has only been tested locally, and the performance may be
/// suboptimal in production environments.
pub logs_endpoint: Option<String>,
}
8 changes: 7 additions & 1 deletion core/lib/config/src/observability_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ impl TryFrom<ObservabilityConfig> for Option<zksync_vlog::OpenTelemetry> {
fn try_from(config: ObservabilityConfig) -> Result<Self, Self::Error> {
Ok(config
.opentelemetry
.map(|config| zksync_vlog::OpenTelemetry::new(&config.level, config.endpoint))
.map(|config| {
zksync_vlog::OpenTelemetry::new(
&config.level,
Some(config.endpoint),
config.logs_endpoint,
)
})
.transpose()?)
}
}
1 change: 1 addition & 0 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ impl Distribution<configs::OpentelemetryConfig> for EncodeDist {
configs::OpentelemetryConfig {
level: self.sample(rng),
endpoint: self.sample(rng),
logs_endpoint: self.sample(rng),
}
}
}
Expand Down

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

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

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

2 changes: 1 addition & 1 deletion core/lib/dal/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ fn main() {
zksync_protobuf_build::Config {
input_root: "src/consensus/proto".into(),
proto_root: "zksync/dal".into(),
dependencies: vec![],
dependencies: vec!["::zksync_consensus_roles::proto".parse().unwrap()],
protobuf_crate: "::zksync_protobuf".parse().unwrap(),
is_public: true,
}
Expand Down
34 changes: 32 additions & 2 deletions core/lib/dal/src/consensus/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
pub mod proto;

#[cfg(test)]
mod testonly;
#[cfg(test)]
mod tests;

use anyhow::{anyhow, Context as _};
use zksync_consensus_roles::validator;
use zksync_protobuf::{required, ProtoFmt, ProtoRepr};
use zksync_consensus_roles::{attester, validator};
use zksync_protobuf::{read_required, required, ProtoFmt, ProtoRepr};
use zksync_types::{
abi, ethabi,
fee::Fee,
Expand All @@ -20,6 +22,34 @@ use zksync_utils::{h256_to_u256, u256_to_h256};

use crate::models::{parse_h160, parse_h256};

/// Global attestation status served by
/// `attestationStatus` RPC.
#[derive(Debug, PartialEq, Clone)]
pub struct AttestationStatus {
pub genesis: validator::GenesisHash,
pub next_batch_to_attest: attester::BatchNumber,
}

impl ProtoFmt for AttestationStatus {
type Proto = proto::AttestationStatus;

fn read(r: &Self::Proto) -> anyhow::Result<Self> {
Ok(Self {
genesis: read_required(&r.genesis).context("genesis")?,
next_batch_to_attest: attester::BatchNumber(
*required(&r.next_batch_to_attest).context("next_batch_to_attest")?,
),
})
}

fn build(&self) -> Self::Proto {
Self::Proto {
genesis: Some(self.genesis.build()),
next_batch_to_attest: Some(self.next_batch_to_attest.0),
}
}
}

/// L2 block (= miniblock) payload.
#[derive(Debug, PartialEq)]
pub struct Payload {
Expand Down
7 changes: 7 additions & 0 deletions core/lib/dal/src/consensus/proto/mod.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ syntax = "proto3";

package zksync.dal;

import "zksync/roles/validator.proto";

message Payload {
// zksync-era ProtocolVersionId
optional uint32 protocol_version = 9; // required; u16
Expand Down Expand Up @@ -114,3 +116,8 @@ message PaymasterParams {
optional bytes paymaster_address = 1; // required; H160
optional bytes paymaster_input = 2; // required
}

message AttestationStatus {
optional roles.validator.GenesisHash genesis = 1; // required
optional uint64 next_batch_to_attest = 2; // required
}
15 changes: 15 additions & 0 deletions core/lib/dal/src/consensus/testonly.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use rand::{
distributions::{Distribution, Standard},
Rng,
};

use super::AttestationStatus;

impl Distribution<AttestationStatus> for Standard {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> AttestationStatus {
AttestationStatus {
genesis: rng.gen(),
next_batch_to_attest: rng.gen(),
}
}
}
5 changes: 3 additions & 2 deletions core/lib/dal/src/consensus/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ use rand::Rng;
use zksync_concurrency::ctx;
use zksync_protobuf::{
repr::{decode, encode},
testonly::test_encode,
testonly::{test_encode, test_encode_random},
ProtoRepr,
};
use zksync_test_account::Account;
use zksync_types::{
web3::Bytes, Execute, ExecuteTransactionCommon, L1BatchNumber, ProtocolVersionId, Transaction,
};

use super::{proto, Payload};
use super::{proto, AttestationStatus, Payload};
use crate::tests::mock_protocol_upgrade_transaction;

fn execute(rng: &mut impl Rng) -> Execute {
Expand Down Expand Up @@ -59,6 +59,7 @@ fn payload(rng: &mut impl Rng, protocol_version: ProtocolVersionId) -> Payload {
fn test_encoding() {
let ctx = &ctx::test_root(&ctx::RealClock);
let rng = &mut ctx.rng();
test_encode_random::<AttestationStatus>(rng);
encode_decode::<proto::TransactionV25, ComparableTransaction>(l1_transaction(rng));
encode_decode::<proto::TransactionV25, ComparableTransaction>(l2_transaction(rng));
encode_decode::<proto::Transaction, ComparableTransaction>(l1_transaction(rng));
Expand Down
Loading

0 comments on commit 8a9d0b4

Please sign in to comment.