Skip to content

Commit

Permalink
merge develop, fix conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
amoylan2 committed Sep 29, 2024
2 parents 91fe9c8 + a1d1cbc commit 229eef2
Show file tree
Hide file tree
Showing 85 changed files with 2,671 additions and 985 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
7 changes: 7 additions & 0 deletions bridge-history-api/internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"path/filepath"

"scroll-tech/common/database"
"scroll-tech/common/utils"
)

// FetcherConfig is the configuration of Layer1 or Layer2 fetcher.
Expand Down Expand Up @@ -66,5 +67,11 @@ func NewConfig(file string) (*Config, error) {
return nil, err
}

// Override config with environment variables
err = utils.OverrideConfigWithEnv(cfg, "SCROLL_BRIDGE_HISTORY")
if err != nil {
return nil, err
}

return cfg, nil
}
1 change: 0 additions & 1 deletion build/dockerfiles/bridgehistoryapi-api.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ RUN --mount=target=. \
FROM ubuntu:20.04

ENV CGO_LDFLAGS="-Wl,--no-as-needed -ldl"

COPY --from=builder /bin/bridgehistoryapi-api /bin/
WORKDIR /app
ENTRYPOINT ["bridgehistoryapi-api"]
3 changes: 2 additions & 1 deletion build/dockerfiles/bridgehistoryapi-fetcher.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ RUN --mount=target=. \
FROM ubuntu:20.04

ENV CGO_LDFLAGS="-Wl,--no-as-needed -ldl"

RUN apt update && apt install ca-certificates -y
RUN update-ca-certificates
COPY --from=builder /bin/bridgehistoryapi-fetcher /bin/
WORKDIR /app
ENTRYPOINT ["bridgehistoryapi-fetcher"]
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 229eef2

Please sign in to comment.