Skip to content

Commit

Permalink
Update from upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
slowli committed Oct 7, 2024
2 parents 71e3dbe + e984bfb commit f2532ec
Show file tree
Hide file tree
Showing 49 changed files with 1,115 additions and 577 deletions.
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"core": "24.27.0",
"core": "24.28.0",
"prover": "16.5.0",
"zk_toolbox": "0.1.2"
}
4 changes: 4 additions & 0 deletions .github/workflows/build-core-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,15 @@ jobs:
if [ $(jq length <<<"$tags") -eq 0 ]; then
echo "No tag found on all pages."
echo "BUILD_CONTRACTS=true" >> "$GITHUB_ENV"
# TODO Remove it when we migrate to foundry inside contracts repository
mkdir -p contracts/l1-contracts/artifacts/
exit 0
fi
filtered_tag=$(jq -r --arg commit_sha "$commit_sha" 'map(select(.commit.sha == $commit_sha)) | .[].name' <<<"$tags")
if [[ ! -z "$filtered_tag" ]]; then
echo "BUILD_CONTRACTS=false" >> "$GITHUB_ENV"
# TODO Remove it when we migrate to foundry inside contracts repository
mkdir -p contracts/l1-contracts/out
break
fi
((page++))
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,6 @@ jobs:
--deploy-ecosystem --l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_era \
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--prover-db-name=zksync_prover_localhost_era \
--ignore-prerequisites --verbose \
--observability=false
Expand Down Expand Up @@ -246,8 +244,6 @@ jobs:
--l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_validium \
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--prover-db-name=zksync_prover_localhost_validium \
--chain validium
- name: Create and initialize chain with Custom Token
Expand All @@ -269,8 +265,6 @@ jobs:
--l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_custom_token \
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--prover-db-name=zksync_prover_localhost_custom_token \
--chain custom_token
- name: Create and register chain with transactions signed "offline"
Expand Down Expand Up @@ -327,8 +321,6 @@ jobs:
--l1-rpc-url=http://localhost:8545 \
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--server-db-name=zksync_server_localhost_consensus \
--prover-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
--prover-db-name=zksync_prover_localhost_consensus \
--chain consensus
- name: Build test dependencies
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/zk-environment-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ on:
# Workflow dispatch, to allow building and pushing new environments.
# It will NOT mark them as latest.
workflow_dispatch:
inputs:
build_cuda:
description: "Build CUDA images or not"
type: boolean
required: false
default: false

push:
branches:
Expand Down Expand Up @@ -202,45 +208,45 @@ jobs:
echo "should_run=$changed_files_output" >> "$GITHUB_OUTPUT"
- name: Checkout code
if: steps.condition.outputs.should_run == 'true'
if: ${{ (steps.condition.outputs.should_run == 'true') || (github.event_name == 'workflow_dispatch' && inputs.build_cuda) }}
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: "recursive"

- name: Log in to US GAR
if: steps.condition.outputs.should_run == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
if: ${{ (steps.condition.outputs.should_run == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.build_cuda) }}
run: |
gcloud auth print-access-token --lifetime=7200 --impersonate-service-account=gha-ci-runners@matterlabs-infra.iam.gserviceaccount.com | docker login -u oauth2accesstoken --password-stdin https://us-docker.pkg.dev
- name: Log in to Docker Hub
if: steps.condition.outputs.should_run == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
if: ${{ (steps.condition.outputs.should_run == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.build_cuda) }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
if: steps.condition.outputs.should_run == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main'
if: ${{ (steps.condition.outputs.should_run == 'true' && github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && inputs.build_cuda) }}
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up QEMU
if: steps.condition.outputs.should_run == 'true'
if: ${{ (steps.condition.outputs.should_run == 'true') || (github.event_name == 'workflow_dispatch' && inputs.build_cuda) }}
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- name: Set up Docker Buildx
if: steps.condition.outputs.should_run == 'true'
if: ${{ (steps.condition.outputs.should_run == 'true') || (github.event_name == 'workflow_dispatch' && inputs.build_cuda) }}
uses: docker/setup-buildx-action@aa33708b10e362ff993539393ff100fa93ed6a27 # v3.5.0

- name: Build and optionally push
if: steps.condition.outputs.should_run == 'true'
if: ${{ (steps.condition.outputs.should_run == 'true') || (github.event_name == 'workflow_dispatch' && inputs.build_cuda) }}
uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
with:
file: docker/zk-environment/20.04_amd64_cuda_${{ matrix.cuda_version }}.Dockerfile
push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
push: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/main' ) || (github.event_name == 'workflow_dispatch' && inputs.build_cuda) }}
tags: |
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/zk-environment-cuda-${{ matrix.cuda_version }}:latest
matterlabs/zk-environment:cuda-${{ matrix.cuda_version }}-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ prover/data/keys/setup_*

# Zk Toolbox
chains/era/configs/*
chains/gateway/*
configs/*
era-observability/
core/tests/ts-integration/deployments-zk
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

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

25 changes: 25 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
# Changelog

## [24.28.0](https://github.com/matter-labs/zksync-era/compare/core-v24.27.0...core-v24.28.0) (2024-10-02)


### Features

* **da-clients:** add secrets ([#2954](https://github.com/matter-labs/zksync-era/issues/2954)) ([f4631e4](https://github.com/matter-labs/zksync-era/commit/f4631e4466de620cc1401b326d864cdb8b48a05d))
* **eth-sender:** add a cap to time_in_mempool ([#2978](https://github.com/matter-labs/zksync-era/issues/2978)) ([650d42f](https://github.com/matter-labs/zksync-era/commit/650d42fea6124d80b60a8270a303d72ad6ac741e))
* **eth-watch:** redesign to support multiple chains ([#2867](https://github.com/matter-labs/zksync-era/issues/2867)) ([aa72d84](https://github.com/matter-labs/zksync-era/commit/aa72d849c24a664acd083eba73795ddc5d31d55f))
* Expose http debug page ([#2952](https://github.com/matter-labs/zksync-era/issues/2952)) ([e0b6488](https://github.com/matter-labs/zksync-era/commit/e0b64888aae7324aec2d40fa0cd51ea7e1450cd9))
* **zk_toolbox:** add fees integration test to toolbox ([#2898](https://github.com/matter-labs/zksync-era/issues/2898)) ([e7ead76](https://github.com/matter-labs/zksync-era/commit/e7ead760ce0417dd36af3839ac557f7e9ab238a4))
* **zk_toolbox:** Add SQL format for zk supervisor ([#2950](https://github.com/matter-labs/zksync-era/issues/2950)) ([540e5d7](https://github.com/matter-labs/zksync-era/commit/540e5d7554f54e80d52f1bfae37e03ca8f787baf))


### Bug Fixes

* **api:** Fix batch fee input for `debug` namespace ([#2948](https://github.com/matter-labs/zksync-era/issues/2948)) ([79b6fcf](https://github.com/matter-labs/zksync-era/commit/79b6fcf8b5d10a0ccdceb846370dd6870b6a32b5))
* chainstack block limit exceeded ([#2974](https://github.com/matter-labs/zksync-era/issues/2974)) ([4ffbf42](https://github.com/matter-labs/zksync-era/commit/4ffbf426de166c11aaf5d7b5ed7d199644fba229))
* **eth-watch:** add missing check that from_block is not larger than finalized_block ([#2969](https://github.com/matter-labs/zksync-era/issues/2969)) ([3f406c7](https://github.com/matter-labs/zksync-era/commit/3f406c7d0c0e76d798c2d838abde57ca692822c0))
* ignore unknown fields in rpc json response ([#2962](https://github.com/matter-labs/zksync-era/issues/2962)) ([692ea73](https://github.com/matter-labs/zksync-era/commit/692ea73f75a5fb9db2b4ac33ad24d20568638742))


### Performance Improvements

* **api:** More efficient gas estimation ([#2937](https://github.com/matter-labs/zksync-era/issues/2937)) ([3b69e37](https://github.com/matter-labs/zksync-era/commit/3b69e37e470dab859a55787f6cc971e7083de2fd))

## [24.27.0](https://github.com/matter-labs/zksync-era/compare/core-v24.26.0...core-v24.27.0) (2024-09-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.27.0" # x-release-please-version
version = "24.28.0" # x-release-please-version
edition.workspace = true
authors.workspace = true
homepage.workspace = true
Expand Down
8 changes: 8 additions & 0 deletions core/bin/external_node/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ pub(crate) struct OptionalENConfig {
/// Gateway RPC URL, needed for operating during migration.
#[allow(dead_code)]
pub gateway_url: Option<SensitiveUrl>,
/// Interval for bridge addresses refreshing in seconds.
bridge_addresses_refresh_interval_sec: Option<NonZeroU64>,
}

impl OptionalENConfig {
Expand Down Expand Up @@ -675,6 +677,7 @@ impl OptionalENConfig {
api_namespaces,
contracts_diamond_proxy_addr: None,
gateway_url: enconfig.gateway_url.clone(),
bridge_addresses_refresh_interval_sec: enconfig.bridge_addresses_refresh_interval_sec,
})
}

Expand Down Expand Up @@ -901,6 +904,11 @@ impl OptionalENConfig {
Duration::from_secs(self.pruning_data_retention_sec)
}

pub fn bridge_addresses_refresh_interval(&self) -> Option<Duration> {
self.bridge_addresses_refresh_interval_sec
.map(|n| Duration::from_secs(n.get()))
}

#[cfg(test)]
fn mock() -> Self {
// Set all values to their defaults
Expand Down
4 changes: 4 additions & 0 deletions core/bin/external_node/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,10 @@ impl ExternalNodeBuilder {
response_body_size_limit: Some(self.config.optional.max_response_body_size()),
with_extended_tracing: self.config.optional.extended_rpc_tracing,
pruning_info_refresh_interval: Some(pruning_info_refresh_interval),
bridge_addresses_refresh_interval: self
.config
.optional
.bridge_addresses_refresh_interval(),
polling_interval: Some(self.config.optional.polling_interval()),
websocket_requests_per_minute_limit: None, // To be set by WS server layer method if required.
replication_lag_limit: None, // TODO: Support replication lag limit
Expand Down
3 changes: 2 additions & 1 deletion core/lib/config/src/configs/en_config.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::num::NonZeroUsize;
use std::num::{NonZeroU64, NonZeroUsize};

use serde::Deserialize;
use zksync_basic_types::{
Expand All @@ -19,4 +19,5 @@ pub struct ENConfig {
pub main_node_rate_limit_rps: Option<NonZeroUsize>,

pub gateway_url: Option<SensitiveUrl>,
pub bridge_addresses_refresh_interval_sec: Option<NonZeroU64>,
}
1 change: 1 addition & 0 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ impl Distribution<configs::en_config::ENConfig> for EncodeDist {
main_node_rate_limit_rps: self.sample_opt(|| rng.gen()),
gateway_url: self
.sample_opt(|| format!("localhost:{}", rng.gen::<u16>()).parse().unwrap()),
bridge_addresses_refresh_interval_sec: self.sample_opt(|| rng.gen()),
}
}
}
Expand Down
11 changes: 10 additions & 1 deletion core/lib/protobuf_config/src/en.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::{num::NonZeroUsize, str::FromStr};
use std::{
num::{NonZeroU64, NonZeroUsize},
str::FromStr,
};

use anyhow::Context;
use zksync_basic_types::{url::SensitiveUrl, L1ChainId, L2ChainId};
Expand Down Expand Up @@ -36,6 +39,9 @@ impl ProtoRepr for proto::ExternalNode {
.as_ref()
.map(|a| a.parse().context("gateway_url"))
.transpose()?,
bridge_addresses_refresh_interval_sec: self
.bridge_addresses_refresh_interval_sec
.and_then(NonZeroU64::new),
})
}

Expand All @@ -55,6 +61,9 @@ impl ProtoRepr for proto::ExternalNode {
.gateway_url
.as_ref()
.map(|a| a.expose_str().to_string()),
bridge_addresses_refresh_interval_sec: this
.bridge_addresses_refresh_interval_sec
.map(|a| a.get()),
}
}
}
1 change: 1 addition & 0 deletions core/lib/protobuf_config/src/proto/config/en.proto
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ message ExternalNode {
optional uint64 main_node_rate_limit_rps = 6; // optional
optional config.genesis.L1BatchCommitDataGeneratorMode l1_batch_commit_data_generator_mode = 7; // optional, default to rollup
optional string gateway_url = 8; // optional
optional uint64 bridge_addresses_refresh_interval_sec = 9; // optional
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl ZksNamespaceServer for ZksNamespace {
}

async fn get_bridge_contracts(&self) -> RpcResult<BridgeAddresses> {
Ok(self.get_bridge_contracts_impl())
Ok(self.get_bridge_contracts_impl().await)
}

async fn l1_chain_id(&self) -> RpcResult<U64> {
Expand Down
Loading

0 comments on commit f2532ec

Please sign in to comment.