Skip to content

Commit

Permalink
Merge branch 'dev' into sb-update-data-restore
Browse files Browse the repository at this point in the history
  • Loading branch information
StanislavBreadless authored Feb 8, 2022
2 parents 99b5fb8 + 565e867 commit f89b6ae
Show file tree
Hide file tree
Showing 54 changed files with 3,045 additions and 2,425 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

jobs:
lint:
runs-on: [self-hosted, CI-worker]
runs-on: [self-hosted, ci-runner]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:
ci_run zk lint --check
unit-tests:
runs-on: [self-hosted, CI-worker]
runs-on: [self-hosted, ci-runner]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
run: ci_run zk test server-rust

integration:
runs-on: [self-hosted, FAST]
runs-on: [self-hosted, ci-runner]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
ci_run cat dummy_prover.log
circuit-tests:
runs-on: [self-hosted, CI-worker]
runs-on: [self-hosted, ci-runner]

steps:
- uses: actions/checkout@v2
Expand All @@ -147,6 +147,13 @@ jobs:
run: |
echo ZKSYNC_HOME=$(pwd) >> $GITHUB_ENV
echo $(pwd)/bin >> $GITHUB_PATH
- name: start-services
run: |
docker-compose -f docker-compose-runner.yml down
docker-compose -f docker-compose-runner.yml pull
docker-compose -f docker-compose-runner.yml up --build -d geth postgres zk
ci_run sccache --start-server
- name: init
run: |
Expand All @@ -155,10 +162,10 @@ jobs:
ci_run zk run verify-keys unpack
- name: circuit-tests
run: ci_run zk test crypto-rust
run: ci_run zk test circuit 20

testkit:
runs-on: [self-hosted, CI-worker]
runs-on: [self-hosted, ci-runner]

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -187,12 +194,13 @@ jobs:
run: ci_run zk test integration testkit --offline

notify:
if: failure()
if: always()
name: Notify on failures
runs-on: ubuntu-latest
needs: [lint, unit-tests, integration, circuit-tests, testkit]
steps:
-
if: failure()
name: Notify to Mattermost (on incidents)
uses: tferreira/matterfy@releases/v1
with:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/npm.publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
jobs:
publish-zksync:
name: Publish zksync.js
uses: matter-labs/zksync-dev/.github/workflows/npm.publish.yml@devops/publish-npm-zksync
uses: matter-labs/zksync-dev/.github/workflows/npm.publish.yml@dev
with:
working-directory: sdk/zksync.js
build-command: |
Expand All @@ -19,3 +19,4 @@ jobs:
ref: ${{ github.event.inputs.ref }}
secrets:
notify-webhook: ${{ secrets.MATTERMOST_WEBHOOK }}
token: ${{ secrets.NPM_TOKEN }}
6 changes: 4 additions & 2 deletions .github/workflows/npm.publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ on:
notify-webhook:
description: Chat notification webhook
required: true

token:
description: NPM token
required: true
jobs:
local-call-publish:
name: Build NPM package
Expand Down Expand Up @@ -53,7 +55,7 @@ jobs:
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.token }}
-
if: failure()
name: Notify to Mattermost (on incidents)
Expand Down
35 changes: 8 additions & 27 deletions Cargo.lock

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

7 changes: 5 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ members = [
"core/bin/parse_pub_data",
"core/bin/block_revert",
"core/bin/remove_proofs",
"core/bin/update_sequnce_number",

"core/bin/remove_outstanding_tx_filters",
# Server micro-services
"core/bin/zksync_api",
"core/bin/zksync_core",
Expand Down Expand Up @@ -41,10 +39,15 @@ members = [
"core/lib/balancer",

# Test infrastructure
"core/tests/flamegraph_target",
"core/tests/test_account",
"core/tests/testkit",
"core/tests/loadnext",

# SDK section
"sdk/zksync-rs"
]

[profile.release.package.flamegraph_target]
# We need both performance and debug info to analyze.
debug = true
26 changes: 0 additions & 26 deletions core/bin/remove_outstanding_tx_filters/Cargo.toml

This file was deleted.

12 changes: 0 additions & 12 deletions core/bin/remove_outstanding_tx_filters/src/main.rs

This file was deleted.

24 changes: 0 additions & 24 deletions core/bin/update_sequnce_number/Cargo.toml

This file was deleted.

42 changes: 0 additions & 42 deletions core/bin/update_sequnce_number/src/main.rs

This file was deleted.

4 changes: 2 additions & 2 deletions core/bin/zksync_api/src/api_server/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub fn try_parse_hash(query: &str) -> Result<H256, hex::FromHexError> {
Ok(H256::from_slice(&slice))
}

async fn depositing_from_pending_ops(
pub(crate) async fn depositing_from_pending_ops(
storage: &mut StorageProcessor<'_>,
tokens: &TokenDBCache,
pending_ops: OngoingDepositsResp,
Expand Down Expand Up @@ -72,7 +72,7 @@ async fn depositing_from_pending_ops(
Ok(DepositingAccountBalances { balances })
}

async fn get_pending_ops(
pub(crate) async fn get_pending_ops(
core_api_client: &CoreApiClient,
address: Address,
) -> Result<OngoingDepositsResp, Error> {
Expand Down
16 changes: 11 additions & 5 deletions core/bin/zksync_api/src/api_server/rest/v02/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ use super::{
response::ApiResult,
};
use crate::{
api_server::helpers::get_depositing, api_try, core_api_client::CoreApiClient,
fee_ticker::PriceError, utils::token_db_cache::TokenDBCache,
api_try, core_api_client::CoreApiClient, fee_ticker::PriceError,
utils::token_db_cache::TokenDBCache,
};

/// Shared data between `api/v02/accounts` endpoints.
Expand Down Expand Up @@ -242,17 +242,23 @@ impl ApiAccountData {
address: Address,
account_id: Option<AccountId>,
) -> Result<AccountState, Error> {
// **Important**: We should get ongoing deposits *before* acquiring connection to the database.
// Otherwise we can starve the pool.
let pending_ops =
crate::api_server::helpers::get_pending_ops(&self.core_api_client, address).await?; // TODO: add timeout.

// Only acquire connection *after* we got info on deposits.
let mut storage = self.pool.access_storage().await.map_err(Error::storage)?;
let mut transaction = storage.start_transaction().await.map_err(Error::storage)?;

let depositing = get_depositing(
let depositing = crate::api_server::helpers::depositing_from_pending_ops(
&mut transaction,
&self.core_api_client,
&self.tokens,
address,
pending_ops,
self.confirmations_for_eth_event,
)
.await?;

let (committed, finalized) = if let Some(account_id) = account_id {
let (finalized_state, committed_state) = transaction
.chain()
Expand Down
Loading

0 comments on commit f89b6ae

Please sign in to comment.