Skip to content

Commit

Permalink
Merge branch 'dvush/split_mempool_and_state_keeper' into dvush/test-f…
Browse files Browse the repository at this point in the history
…ramework-init
  • Loading branch information
dvush committed Jan 9, 2020
2 parents 7991fa6 + e86ffb0 commit cec8ae1
Show file tree
Hide file tree
Showing 126 changed files with 4,540 additions and 8,240 deletions.
10 changes: 5 additions & 5 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# https://help.github.com/articles/about-codeowners/

# notify gluk64 about changes in codeowners file
/.github/ @gluk64
/.github/ @gluk64 @furkhat

# notify gluk64 about changes in docs
/docs/ @gluk64
*.md @gluk64

# notify dvush about any circuit, prover and server changes
/core/circuit/ @dvush
/core/server/ @dvush
/core/prover/ @dvush
/core/circuit/ @dvush @furkhat
/core/server/ @dvush @furkhat
/core/prover/ @dvush @furkhat

# notify BaldyAsh and dvush about contracts changes
/contracts/ @dvush @BaldyAsh @gluk64
/contracts/ @dvush @BaldyAsh gluk64
137 changes: 137 additions & 0 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ members = [
"core/prover",
"core/key_generator",
"core/spec_test",
"core/testhelper",
"core/test-kit",
]
36 changes: 22 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export CI_PIPELINE_ID ?= $(shell date +"%Y-%m-%d-%s")
export SERVER_DOCKER_IMAGE ?=matterlabs/server:latest
export PROVER_DOCKER_IMAGE ?=matterlabs/prover:latest
export SERVER_DOCKER_IMAGE ?=matterlabs/server:$(ZKSYNC_ENV)
export PROVER_DOCKER_IMAGE ?=matterlabs/prover:$(ZKSYNC_ENV)
export NGINX_DOCKER_IMAGE ?= matterlabs/nginx:$(ZKSYNC_ENV)
export GETH_DOCKER_IMAGE ?= matterlabs/geth:latest
export CI_DOCKER_IMAGE ?= matterlabs/ci
Expand All @@ -15,10 +15,10 @@ init:
@bin/init

yarn:
@cd js/franklin_lib && yarn
@cd js/client && yarn
@cd js/explorer && yarn
@cd contracts && yarn
@cd js/tests && yarn


# Helpers
Expand All @@ -44,10 +44,7 @@ db-setup:
db-insert-contract:
@bin/db-insert-contract.sh

update-frontend-contract:
@bin/update-frontend-contract.sh

db-reset: confirm_action db-wait db-drop db-setup db-insert-contract update-frontend-contract
db-reset: confirm_action db-wait db-drop db-setup db-insert-contract
@echo database is ready

db-migrate: confirm_action
Expand All @@ -62,7 +59,7 @@ db-drop: confirm_action
db-wait:
@bin/db-wait

genesis: confirm_action db-reset
genesis: confirm_action
@bin/genesis.sh

# Frontend clients
Expand Down Expand Up @@ -154,23 +151,35 @@ define flatten_file
endef

# Flatten contract source
flatten:
flatten: prepare-contracts
@mkdir -p contracts/flat
$(call flatten_file,Franklin.sol)
$(call flatten_file,Governance.sol)
$(call flatten_file,PriorityQueue.sol)
$(call flatten_file,Verifier.sol)

gen-keys-if-not-present:
# TODO: change compile-time contract reads in abi.rs
@mkdir -p contracts/build
@touch contracts/build/Franklin.json
@touch contracts/build/Governance.json
@touch contracts/build/PriorityQueue.json

test -f keys/${BLOCK_SIZE_CHUNKS}/${ACCOUNT_TREE_DEPTH}/franklin_pk.key || gen-keys

prepare-contracts:
@cp keys/${BLOCK_SIZE_CHUNKS}/${ACCOUNT_TREE_DEPTH}/VerificationKey.sol contracts/contracts/VerificationKey.sol || (echo "please run gen-keys" && exit 1)

# testing

loadtest: confirm_action
@bin/loadtest.sh

integration-simple:
@cd js/tests && yarn simple
@cd js/tests && yarn && yarn simple

integration-full-exit:
@cd js/tests && yarn full-exit
@cd js/tests && yarn && yarn full-exit

price:
@node contracts/scripts/check-price.js
Expand Down Expand Up @@ -293,13 +302,13 @@ nodes:
# Dev environment

dev-up:
@{ docker ps | grep -q "$(GETH_DOCKER_IMAGE)" && echo "Dev env already running" && exit 1; } || echo -n
@docker-compose up -d postgres geth
@docker-compose up -d tesseracts


dev-down:
@docker-compose stop postgres geth
@docker-compose stop tesseracts
@docker-compose stop postgres geth

geth-up: geth
@docker-compose up geth
Expand Down Expand Up @@ -332,4 +341,3 @@ data-restore-restart: confirm_action data-restore-db-prepare

data-restore-continue:
@./target/release/data_restore

5 changes: 2 additions & 3 deletions bin/.gen_js_config
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

# Generates a json config file with current env var configuration for production

JS_CONFIG="API_SERVER TX_BATCH_SIZE SENDER_ACCOUNT CONTRACT_ADDR ETH_NETWORK"
JS_CONFIG="API_SERVER TX_BATCH_SIZE SENDER_ACCOUNT CONTRACT_ADDR ETH_NETWORK WS_API_ADDR HTTP_RPC_API_ADDR"

echo "export default {"

for VAR in $JS_CONFIG; do
echo " \"$VAR\":\"${!VAR}\","
done

echo " \"trailing\": null"
echo "}"
echo "}"
13 changes: 7 additions & 6 deletions bin/.load_keys
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash

DIR=$KEY_DIR$BLOCK_SIZE_CHUNKS
DIR=$KEY_DIR$BLOCK_SIZE_CHUNKS/$ACCOUNT_TREE_DEPTH
echo "Checking keys in $DIR"
mkdir -p $DIR
#cd $KEY_DIR

SPACE_LINK=$KEYS_SPACE_URL/$BLOCK_SIZE_CHUNKS/$ACCOUNT_TREE_DEPTH

KEY_FILES="franklin_pk.key"
for i in $KEY_FILES; do
if ! [ -f $DIR/$i ]; then
echo "Downloading file $SPACE_URL/$i"
axel -o $DIR/$i -a $SPACE_URL/$i 2>&1
echo axel -o $DIR/$i -a $SPACE_URL/$i 2>&1
#curl -o $KEY_DIR/$i $SPACE_URL/$i 2>&1
echo "Downloading file $SPACE_LINK/$i"
axel -o $DIR/$i -a $SPACE_LINK/$i 2>&1
echo axel -o $DIR/$i -a $SPACE_LINK/$i 2>&1
fi
done
5 changes: 0 additions & 5 deletions bin/.setup_env
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,5 @@ then
eval $(grep -v '^#' $ENV_FILE | sed 's/^/export /')
set +o allexport

if [ "dev" != "$ZKSYNC_ENV" ]
then
export KUBECONFIG=etc/kube/clusters/kubeconfig-main.yaml
fi

popd > /dev/null
fi
5 changes: 2 additions & 3 deletions bin/gen-keys
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

. .setup_env

ZKSYNC_HOME=`dirname $0`/..


mkdir -p $ZKSYNC_HOME/$KEY_DIR/$BLOCK_SIZE_CHUNKS
mkdir -p $ZKSYNC_HOME/$KEY_DIR/$BLOCK_SIZE_CHUNKS/$ACCOUNT_TREE_DEPTH
cargo run --bin key_generator --release

cp $ZKSYNC_HOME/$KEY_DIR/$BLOCK_SIZE_CHUNKS/VerificationKey.sol $ZKSYNC_HOME/contracts/contracts
cp $ZKSYNC_HOME/$KEY_DIR/$BLOCK_SIZE_CHUNKS/$ACCOUNT_TREE_DEPTH/VerificationKey.sol $ZKSYNC_HOME/contracts/contracts
2 changes: 2 additions & 0 deletions bin/init
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ check-environment.sh
zksync dev-up
zksync env
zksync yarn || true # It can fail.
zksync gen-keys-if-not-present
zksync db-wait
zksync db-setup
zksync build-contracts
zksync db-reset
zksync genesis
zksync redeploy
echo done.
2 changes: 1 addition & 1 deletion bin/prepare-test-contracts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

cd $ZKSYNC_HOME

IN_DIR=./contracts/contracts/
IN_DIR=./contracts/contracts
OUT_DIR=./contracts/contracts/generated

rm -rf $OUT_DIR
Expand Down
9 changes: 0 additions & 9 deletions bin/update-frontend-contract.sh

This file was deleted.

1 change: 1 addition & 0 deletions contracts/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/flat
/flat_build
/contracts/generated
/contracts/VerificationKey.sol
Loading

0 comments on commit cec8ae1

Please sign in to comment.