Skip to content

Commit

Permalink
Merge branch 'main' into update_native_erc20
Browse files Browse the repository at this point in the history
  • Loading branch information
fkrause98 committed Jan 17, 2024
2 parents b147906 + 78a3bf1 commit 9c82883
Show file tree
Hide file tree
Showing 25 changed files with 1,121 additions and 584 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 @@
{
"sdk/zksync-rs": "0.4.0",
"core": "19.1.1",
"core": "19.2.0",
"prover": "10.1.0"
}
2 changes: 1 addition & 1 deletion .github/workflows/build-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
description: 'JSON of required compilers and their versions'
type: string
required: false
default: '[{ "zksolc": ["1.3.14", "1.3.16", "1.3.17", "1.3.1", "1.3.7", "1.3.18", "1.3.19"] } , { "zkvyper": ["1.3.13"] }]'
default: '[{ "zksolc": ["1.3.14", "1.3.16", "1.3.17", "1.3.1", "1.3.7", "1.3.18", "1.3.19", "1.3.21"] } , { "zkvyper": ["1.3.13"] }]'

jobs:
build-images:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-local-node-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
description: 'JSON of required compilers and their versions'
type: string
required: false
default: '[{ "zksolc": ["1.3.14", "1.3.16", "1.3.17", "1.3.1", "1.3.7", "1.3.18", "1.3.19"] } , { "zkvyper": ["1.3.13"] }]'
default: '[{ "zksolc": ["1.3.14", "1.3.16", "1.3.17", "1.3.1", "1.3.7", "1.3.18", "1.3.19", "1.3.21"] } , { "zkvyper": ["1.3.13"] }]'

jobs:
build-images:
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/build-prover-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,41 @@ jobs:
run: |
ci_run sccache --show-stats
ci_run cat /tmp/sccache_log.txt
copy-images:
name: Copy images between docker registries
env:
IMAGE_TAG_SUFFIX: ${{ inputs.image_tag_suffix }}
runs-on: matterlabs-ci-runner
needs: build-images
if: ${{ inputs.action == 'push' }}
strategy:
matrix:
component:
- witness-vector-generator
steps:

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to us-central1 GAR
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: Login and push to Asia GAR
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://asia-docker.pkg.dev
docker buildx imagetools create \
--tag asia-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ inputs.image_tag_suffix }}
- name: Login and push to Europe GAR
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://europe-docker.pkg.dev
docker buildx imagetools create \
--tag europe-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ inputs.image_tag_suffix }} \
us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ matrix.component }}:2.0-${{ inputs.image_tag_suffix }}
30 changes: 19 additions & 11 deletions .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
description: 'JSON of required compilers and their versions'
type: string
required: false
default: '[{ "zksolc": ["1.3.14", "1.3.16", "1.3.17", "1.3.1", "1.3.7", "1.3.18", "1.3.19"] } , { "zkvyper": ["1.3.13"] }]'
default: '[{ "zksolc": ["1.3.14", "1.3.16", "1.3.17", "1.3.1", "1.3.7", "1.3.18", "1.3.19", "1.3.21"] } , { "zkvyper": ["1.3.13"] }]'

jobs:
lint:
Expand All @@ -27,7 +27,7 @@ jobs:
echo IN_DOCKER=1 >> .env
# TODO: Remove when we after upgrade of hardhat-plugins
- name: pre-download compiilers
- name: pre-download compilers
run: |
# Download needed versions of vyper compiler
# Not sanitized due to unconventional path and tags
Expand Down Expand Up @@ -141,11 +141,15 @@ jobs:
wget https://github.com/ethereum/solc-bin/raw/gh-pages/linux-amd64/solc-linux-amd64-v0.8.23%2Bcommit.f704f362
mv solc-linux-amd64-v0.8.23+commit.f704f362 $(pwd)/etc/solc-bin/0.8.23/solc
chmod +x $(pwd)/etc/solc-bin/0.8.23/solc
mkdir -p $(pwd)/etc/solc-bin/zkVM-0.8.23-1.0.0
wget https://github.com/matter-labs/era-solidity/releases/download/0.8.23-1.0.0/solc-linux-amd64-0.8.23-1.0.0 -O $(pwd)/etc/solc-bin/zkVM-0.8.23-1.0.0/solc
chmod +x $(pwd)/etc/solc-bin/zkVM-0.8.23-1.0.0/solc
mkdir -p $(pwd)/etc/zksolc-bin/v1.3.19
wget https://github.com/matter-labs/zksolc-bin/raw/main/linux-amd64/zksolc-linux-amd64-musl-v1.3.19
mv zksolc-linux-amd64-musl-v1.3.19 $(pwd)/etc/zksolc-bin/v1.3.19/zksolc
chmod +x $(pwd)/etc/zksolc-bin/v1.3.19/zksolc
mkdir -p $(pwd)/etc/zksolc-bin/v1.3.21
wget https://github.com/matter-labs/zksolc-bin/raw/main/linux-amd64/zksolc-linux-amd64-musl-v1.3.21
mv zksolc-linux-amd64-musl-v1.3.21 $(pwd)/etc/zksolc-bin/v1.3.21/zksolc
chmod +x $(pwd)/etc/zksolc-bin/v1.3.21/zksolc
mkdir -p $(pwd)/etc/vyper-bin/0.3.10
wget -O vyper0.3.10 https://github.com/vyperlang/vyper/releases/download/v0.3.10/vyper.0.3.10%2Bcommit.91361694.linux
Expand Down Expand Up @@ -250,11 +254,15 @@ jobs:
wget https://github.com/ethereum/solc-bin/raw/gh-pages/linux-amd64/solc-linux-amd64-v0.8.23%2Bcommit.f704f362
mv solc-linux-amd64-v0.8.23+commit.f704f362 $(pwd)/etc/solc-bin/0.8.23/solc
chmod +x $(pwd)/etc/solc-bin/0.8.23/solc
mkdir -p $(pwd)/etc/zksolc-bin/v1.3.19
wget https://github.com/matter-labs/zksolc-bin/raw/main/linux-amd64/zksolc-linux-amd64-musl-v1.3.19
mv zksolc-linux-amd64-musl-v1.3.19 $(pwd)/etc/zksolc-bin/v1.3.19/zksolc
chmod +x $(pwd)/etc/zksolc-bin/v1.3.19/zksolc
mkdir -p $(pwd)/etc/solc-bin/zkVM-0.8.23-1.0.0
wget https://github.com/matter-labs/era-solidity/releases/download/0.8.23-1.0.0/solc-linux-amd64-0.8.23-1.0.0 -O $(pwd)/etc/solc-bin/zkVM-0.8.23-1.0.0/solc
chmod +x $(pwd)/etc/solc-bin/zkVM-0.8.23-1.0.0/solc
mkdir -p $(pwd)/etc/zksolc-bin/v1.3.21
wget https://github.com/matter-labs/zksolc-bin/raw/main/linux-amd64/zksolc-linux-amd64-musl-v1.3.21
mv zksolc-linux-amd64-musl-v1.3.21 $(pwd)/etc/zksolc-bin/v1.3.21/zksolc
chmod +x $(pwd)/etc/zksolc-bin/v1.3.21/zksolc
mkdir -p $(pwd)/etc/vyper-bin/0.3.10
wget -O vyper0.3.10 https://github.com/vyperlang/vyper/releases/download/v0.3.10/vyper.0.3.10%2Bcommit.91361694.linux
Expand Down
10 changes: 10 additions & 0 deletions core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [19.2.0](https://github.com/matter-labs/zksync-era/compare/core-v19.1.1...core-v19.2.0) (2024-01-17)


### Features

* adds `zk linkcheck` to zk tool and updates zk env for `zk linkcheck` ci usage ([#868](https://github.com/matter-labs/zksync-era/issues/868)) ([d64f584](https://github.com/matter-labs/zksync-era/commit/d64f584f6d505b19cd6424928e9dc68e370e17fd))
* **contract-verifier:** Support zkVM solc contract verification ([#854](https://github.com/matter-labs/zksync-era/issues/854)) ([1ed5a95](https://github.com/matter-labs/zksync-era/commit/1ed5a95462dbd73151acd8afbc4ab6158a2aecda))
* **en:** Make batch status updater work with pruned data ([#863](https://github.com/matter-labs/zksync-era/issues/863)) ([3a07890](https://github.com/matter-labs/zksync-era/commit/3a07890dacebf6179636c44d7cce1afd21ab49eb))
* rewritten gossip sync to be async from block processing ([#711](https://github.com/matter-labs/zksync-era/issues/711)) ([3af4644](https://github.com/matter-labs/zksync-era/commit/3af4644f428af0328cdea0fbae8a8f965489c6c4))

## [19.1.1](https://github.com/matter-labs/zksync-era/compare/core-v19.1.0...core-v19.1.1) (2024-01-12)


Expand Down
6 changes: 6 additions & 0 deletions core/bin/contract-verifier/src/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ impl ContractVerifier {
);

if artifacts.bytecode != deployed_bytecode {
tracing::info!(
"Bytecode mismatch req {}, deployed: 0x{}, compiled 0x{}",
request.id,
hex::encode(deployed_bytecode),
hex::encode(artifacts.bytecode)
);
return Err(ContractVerifierError::BytecodeMismatch);
}

Expand Down
2 changes: 1 addition & 1 deletion core/bin/external_node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ async fn init_tasks(
.await
.context("failed to build a connection pool for BatchStatusUpdater")?,
)
.await;
.context("failed initializing batch status updater")?;

// Run the components.
let tree_stop_receiver = stop_receiver.clone();
Expand Down

This file was deleted.

40 changes: 0 additions & 40 deletions core/lib/dal/src/blocks_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1746,46 +1746,6 @@ impl BlocksDal<'_, '_> {
Ok(Some((H256::from_slice(&hash), row.timestamp as u64)))
}

pub async fn get_newest_l1_batch_header(&mut self) -> sqlx::Result<L1BatchHeader> {
let last_l1_batch = sqlx::query_as!(
StorageL1BatchHeader,
r#"
SELECT
number,
l1_tx_count,
l2_tx_count,
timestamp,
is_finished,
fee_account_address,
l2_to_l1_logs,
l2_to_l1_messages,
bloom,
priority_ops_onchain_data,
used_contract_hashes,
base_fee_per_gas,
l1_gas_price,
l2_fair_gas_price,
bootloader_code_hash,
default_aa_code_hash,
protocol_version,
compressed_state_diffs,
system_logs,
pubdata_input
FROM
l1_batches
ORDER BY
number DESC
LIMIT
1
"#
)
.instrument("get_newest_l1_batch_header")
.fetch_one(self.storage.conn())
.await?;

Ok(last_l1_batch.into())
}

pub async fn get_l1_batch_metadata(
&mut self,
number: L1BatchNumber,
Expand Down
25 changes: 15 additions & 10 deletions core/lib/zksync_core/src/consensus/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,20 @@ impl StateKeeper {
.await
.context("ensure_genesis_state()")?;
}
let last_batch = storage

let last_l1_batch_number = storage
.blocks_dal()
.get_sealed_l1_batch_number()
.await
.context("get_sealed_l1_batch_number()")?
.context("no L1 batches in storage")?;
let last_miniblock_header = storage
.blocks_dal()
.get_newest_l1_batch_header()
.get_last_sealed_miniblock_header()
.await
.context("get_newest_l1_batch_header()")?;
.context("get_last_sealed_miniblock_header()")?
.context("no miniblocks in storage")?;

let pending_batch = storage
.blocks_dal()
.pending_batch_exists()
Expand All @@ -196,13 +205,9 @@ impl StateKeeper {
let (actions_sender, actions_queue) = ActionQueue::new();
Ok((
Self {
last_batch: last_batch.number + if pending_batch { 1 } else { 0 },
last_block: storage
.blocks_dal()
.get_sealed_miniblock_number()
.await
.context("get_sealed_miniblock_number()")?,
last_timestamp: last_batch.timestamp,
last_batch: last_l1_batch_number + if pending_batch { 1 } else { 0 },
last_block: last_miniblock_header.number,
last_timestamp: last_miniblock_header.timestamp,
batch_sealed: !pending_batch,
fee_per_gas: 10,
gas_per_pubdata: 100,
Expand Down
Loading

0 comments on commit 9c82883

Please sign in to comment.