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 14, 2024
2 parents 9b6cb6d + 15fe5a6 commit bc1936b
Show file tree
Hide file tree
Showing 49 changed files with 1,415 additions and 328 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-core-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ jobs:
- name: Fee projection tests
run: |
ci_run killall -INT zksync_server || true
ci_run ./bin/run_on_all_chains.sh "zk_supervisor test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.INTEGRATION_TESTS_LOGS_DIR }}
ci_run ./bin/run_on_all_chains.sh "zk_supervisor test fees --no-deps --no-kill" ${{ env.CHAINS }} ${{ env.FEES_LOGS_DIR }}
- name: Run revert tests
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release-test-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ jobs:
if: needs.changed_files.outputs.prover == 'true' || needs.changed_files.outputs.all == 'true'
with:
image_tag_suffix: ${{ needs.setup.outputs.image_tag_suffix }}-avx512
ERA_BELLMAN_CUDA_RELEASE: ${{ vars.ERA_BELLMAN_CUDA_RELEASE }}
CUDA_ARCH: "60;70;75;80;89"
WITNESS_GENERATOR_RUST_FLAGS: "-Ctarget_feature=+avx512bw,+avx512cd,+avx512dq,+avx512f,+avx512vl "
secrets:
Expand Down
11 changes: 11 additions & 0 deletions 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 @@ -114,6 +114,7 @@ blake2 = "0.10"
chrono = "0.4"
clap = "4.2.2"
codegen = "0.2.0"
const-decoder = "0.4.0"
criterion = "0.4.0"
ctrlc = "3.1"
dashmap = "5.5.3"
Expand Down
1 change: 1 addition & 0 deletions core/lib/config/src/configs/consensus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ impl RpcConfig {
/// Config (shared between main node and external node).
#[derive(Clone, Debug, PartialEq)]
pub struct ConsensusConfig {
pub port: Option<u16>,
/// Local socket address to listen for the incoming connections.
pub server_addr: std::net::SocketAddr,
/// Public address of this node (should forward to `server_addr`)
Expand Down
1 change: 1 addition & 0 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -802,6 +802,7 @@ impl Distribution<configs::consensus::ConsensusConfig> for EncodeDist {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> configs::consensus::ConsensusConfig {
use configs::consensus::{ConsensusConfig, Host, NodePublicKey};
ConsensusConfig {
port: self.sample(rng),
server_addr: self.sample(rng),
public_addr: Host(self.sample(rng)),
max_payload_size: self.sample(rng),
Expand Down

This file was deleted.

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

20 changes: 16 additions & 4 deletions core/lib/dal/src/storage_web3_dal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ use zksync_utils::h256_to_u256;

use crate::{models::storage_block::ResolvedL1BatchForL2Block, Core, CoreDal};

/// Raw bytecode information returned by [`StorageWeb3Dal::get_contract_code_unchecked()`].
#[derive(Debug)]
pub struct RawBytecode {
pub bytecode_hash: H256,
pub bytecode: Vec<u8>,
}

#[derive(Debug)]
pub struct StorageWeb3Dal<'a, 'c> {
pub(crate) storage: &'a mut Connection<'c, Core>,
Expand Down Expand Up @@ -234,16 +241,17 @@ impl StorageWeb3Dal<'_, '_> {
&mut self,
address: Address,
block_number: L2BlockNumber,
) -> DalResult<Option<Vec<u8>>> {
) -> DalResult<Option<RawBytecode>> {
let hashed_key = get_code_key(&address).hashed_key();
let row = sqlx::query!(
r#"
SELECT
bytecode_hash,
bytecode
FROM
(
SELECT
*
value
FROM
storage_logs
WHERE
Expand All @@ -254,7 +262,7 @@ impl StorageWeb3Dal<'_, '_> {
storage_logs.operation_number DESC
LIMIT
1
) t
) deploy_log
JOIN factory_deps ON value = factory_deps.bytecode_hash
WHERE
value != $3
Expand All @@ -268,7 +276,11 @@ impl StorageWeb3Dal<'_, '_> {
.with_arg("block_number", &block_number)
.fetch_optional(self.storage)
.await?;
Ok(row.map(|row| row.bytecode))

Ok(row.map(|row| RawBytecode {
bytecode_hash: H256::from_slice(&row.bytecode_hash),
bytecode: row.bytecode,
}))
}

/// Given bytecode hash, returns bytecode and L2 block number at which it was inserted.
Expand Down
1 change: 1 addition & 0 deletions core/lib/multivm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ ethabi.workspace = true
[dev-dependencies]
assert_matches.workspace = true
pretty_assertions.workspace = true
test-casing.workspace = true
zksync_test_account.workspace = true
zksync_eth_signer.workspace = true
Loading

0 comments on commit bc1936b

Please sign in to comment.