Skip to content

Commit

Permalink
Merge branch 'dev' into alekseysidorov-931-ci-acceptable-loadtests
Browse files Browse the repository at this point in the history
  • Loading branch information
popzxc authored Oct 20, 2020
2 parents 414593d + 5de003d commit 3172af9
Show file tree
Hide file tree
Showing 35 changed files with 2,693 additions and 2,374 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ jobs:
- name: zcli-tests
run: ci-zcli.sh

- name: integration-simple-full-exit
run: ci-integration-simple-fullexit.sh
- name: integration-tests
run: ci-integration-tests.sh

- name: data-restore
run: zksync data-restore check-existing
Expand Down
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,8 @@ ci-check:
integration-testkit:
@bin/integration-testkit.sh $(filter-out $@,$(MAKECMDGOALS))

integration-simple:
@cd core/tests/ts-tests && yarn && yarn simple $(filter-out $@,$(MAKECMDGOALS))

integration-full-exit:
@cd core/tests/ts-tests && yarn && yarn full-exit
integration-test:
@cd core/tests/ts-tests && yarn && yarn test

price:
@node contracts/scripts/check-price.js
Expand Down Expand Up @@ -292,5 +289,5 @@ image-dev-ticker:
push-image-dev-ticker: image-dev-ticker
@docker push "${DEV_TICKER_DOCKER_IMAGE}"

api-type-validate:
@cd core/tests/ts-tests && yarn && yarn api-type-validate --test
api-test:
@cd core/tests/ts-tests && yarn && yarn api-test
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function cat_logs() {
exitcode=$?
echo "Termination started"
# Wait for server to finish any ongoing jobs
sleep 30
sleep 5

set +e
pkill -P $SERVER_PID
Expand All @@ -34,7 +34,7 @@ function cat_logs() {
cat integration-prover.log

# Wait for server to be surely killed
sleep 10
sleep 5

exit $exitcode
}
Expand All @@ -53,11 +53,5 @@ zksync dummy-prover &> integration-prover.log &
PROVER_PID=$!

sleep 15
echo "Performing integration-simple test..."
zksync integration-simple
echo "Performing integration-simple test http provider..."
zksync integration-simple http
echo "Performing integration-full-exit test..."
zksync integration-full-exit
echo "Performing api-type-validate test..."
zksync api-type-validate
zksync integration-test
zksync api-test
4 changes: 2 additions & 2 deletions bin/ci-zcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ function cat_logs() {
echo Termination started

# Wait for server to finish any ongoing jobs
sleep 30
sleep 5

set +e
pkill -P $TIMEOUT_PID,$SERVER_PID
echo Server logs:
cat zcli-test-server.log

# Wait for server to be surely killed
sleep 10
sleep 5

exit $exitcode
}
Expand Down
11 changes: 9 additions & 2 deletions bin/rust-sdk-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function cat_logs() {
echo Termination started

# Wait for server to finish any ongoing jobs
sleep 30
sleep 5

set +e
pkill -P $SERVER_PID
Expand All @@ -34,15 +34,22 @@ function cat_logs() {
cat rust-sdk-prover.log

# Wait for server to be surely killed
sleep 10
sleep 5

exit $exitcode
}

zksync dummy-prover status | grep -q 'disabled' && zksync dummy-prover enable

# We have to compile binaries, because otherwise the time to compile it may exceed 15 seconds,
# and the test will start without an actually running server.
f cargo build --bin zksync_server --release
f cargo build --bin dummy_prover --release

zksync server &> rust-sdk-server.log &
SERVER_PID=$!
# Wait a bit, so server and prover won't have conflicts about the workspace lockfile.
sleep 1
zksync dummy-prover &> rust-sdk-prover.log &
PROVER_PID=$!

Expand Down
24 changes: 12 additions & 12 deletions core/lib/storage/src/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,32 +97,32 @@ impl Into<(u32, AccountUpdate)> for StorageAccountDiff {
}

impl StorageAccountDiff {
/// Compares updates by `block number` then by `update_order_id` (which is number within block).
pub fn cmp_order(&self, other: &Self) -> Ordering {
self.block_number()
.cmp(&other.block_number())
.then(self.update_order_id().cmp(&other.update_order_id()))
}

/// Returns the index of the operation within block.
pub fn update_order_id(&self) -> i32 {
*match self {
match self {
StorageAccountDiff::BalanceUpdate(StorageAccountUpdate {
update_order_id, ..
}) => update_order_id,
}) => *update_order_id,
StorageAccountDiff::Create(StorageAccountCreation {
update_order_id, ..
}) => update_order_id,
}) => *update_order_id,
StorageAccountDiff::Delete(StorageAccountCreation {
update_order_id, ..
}) => update_order_id,
}) => *update_order_id,
StorageAccountDiff::ChangePubKey(StorageAccountPubkeyUpdate {
update_order_id,
..
}) => update_order_id,
}) => *update_order_id,
}
}

/// Compares updates by `block number` then by `update_order_id` (which is number within block).
pub fn cmp_order(&self, other: &Self) -> Ordering {
self.block_number()
.cmp(&other.block_number())
.then(self.update_order_id().cmp(&other.update_order_id()))
}

/// Returns the block index to which the operation belongs.
pub fn block_number(&self) -> i64 {
*match self {
Expand Down
Loading

0 comments on commit 3172af9

Please sign in to comment.