Skip to content

Commit

Permalink
feat: darwinv2 (#1484)
Browse files Browse the repository at this point in the history
Co-authored-by: Xi Lin <[email protected]>
Co-authored-by: Zhang Zhuo <[email protected]>
Co-authored-by: Mengran Lan <[email protected]>
Co-authored-by: georgehao <[email protected]>
Co-authored-by: colinlyguo <[email protected]>
  • Loading branch information
6 people authored Aug 23, 2024
1 parent e09b98f commit fa80b3e
Show file tree
Hide file tree
Showing 67 changed files with 1,717 additions and 798 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.PHONY: fmt dev_docker build_test_docker run_test_docker clean update

L2GETH_TAG=scroll-v5.5.1
L2GETH_TAG=scroll-v5.6.3

help: ## Display this help message
@grep -h \
Expand Down Expand Up @@ -40,8 +40,8 @@ fmt: ## Format the code

dev_docker: ## Build docker images for development/testing usages
docker pull postgres
docker build -t scroll_l1geth ./common/testcontainers/docker/l1geth/
docker build -t scroll_l2geth ./common/testcontainers/docker/l2geth/
docker build -t scroll_l1geth --platform linux/amd64 ./common/testcontainers/docker/l1geth/
docker build -t scroll_l2geth --platform linux/amd64 ./common/testcontainers/docker/l2geth/

clean: ## Empty out the bin folder
@rm -rf build/bin
10 changes: 8 additions & 2 deletions common/forks/forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ func GetHardforkName(config *params.ChainConfig, blockHeight, blockTimestamp uin
return "bernoulli"
} else if !config.IsDarwin(blockTimestamp) {
return "curie"
} else {
} else if !config.IsDarwinV2(blockTimestamp) {
return "darwin"
} else {
return "darwinV2"
}
}

Expand All @@ -30,8 +32,10 @@ func GetCodecVersion(config *params.ChainConfig, blockHeight, blockTimestamp uin
return encoding.CodecV1
} else if !config.IsDarwin(blockTimestamp) {
return encoding.CodecV2
} else {
} else if !config.IsDarwinV2(blockTimestamp) {
return encoding.CodecV3
} else {
return encoding.CodecV4
}
}

Expand All @@ -44,6 +48,8 @@ func GetMaxChunksPerBatch(config *params.ChainConfig, blockHeight, blockTimestam
return 15
} else if !config.IsDarwin(blockTimestamp) {
return 45
} else if !config.IsDarwinV2(blockTimestamp) {
return 45
} else {
return 45
}
Expand Down
26 changes: 6 additions & 20 deletions common/libzkp/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,25 @@ export RUST_BACKTRACE=full
export RUST_LOG=debug
export RUST_MIN_STACK=100000000
export PROVER_OUTPUT_DIR=test_zkp_test
export SCROLL_PROVER_ASSETS_DIR=/assets/test_assets
export DARWIN_V2_TEST_DIR=/assets
#export LD_LIBRARY_PATH=/:/usr/local/cuda/lib64

mkdir -p $PROVER_OUTPUT_DIR

REPO=$(realpath ../..)

function build_test_bins() {
cd impl
cargo build --release
ln -f -s $(realpath target/release/libzkp.so) $REPO/prover/core/lib
ln -f -s $(realpath target/release/libzkp.so) $REPO/coordinator/internal/logic/verifier/lib
cd $REPO/prover
go test -tags="gpu ffi" -timeout 0 -c core/prover_test.go
make tests_binary
cd $REPO/coordinator
go test -tags="gpu ffi" -timeout 0 -c ./internal/logic/verifier
cd $REPO/common/libzkp
}

function build_test_bins_old() {
cd $REPO
cd prover
make libzkp
go test -tags="gpu ffi" -timeout 0 -c core/prover_test.go
cd ..
cd coordinator
make libzkp
go test -tags="gpu ffi" -timeout 0 -c ./internal/logic/verifier
cd ..
cd common/libzkp
cd $REPO/common/libzkp
}

build_test_bins
#rm -rf test_zkp_test/*
rm -rf $PROVER_OUTPUT_DIR/*
#rm -rf prover.log verifier.log
#$REPO/prover/core.test -test.v 2>&1 | tee prover.log
$REPO/prover/prover.test --exact zk_circuits_handler::darwin_v2::tests::test_circuits 2>&1 | tee prover.log
$REPO/coordinator/verifier.test -test.v 2>&1 | tee verifier.log
Loading

0 comments on commit fa80b3e

Please sign in to comment.