Skip to content

Commit 3331927

Browse files
committed
Merge branch 'develop' into include-l1-message-with-insufficient-balance
2 parents 3885aea + ac8164f commit 3331927

File tree

291 files changed

+47125
-7867
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

291 files changed

+47125
-7867
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { URL } from "url";
2+
import { readFileSync, writeFileSync } from "fs";
3+
4+
const versionFilePath = new URL(
5+
"../../params/version.go",
6+
import.meta.url
7+
).pathname;
8+
9+
const versionFileContent = readFileSync(versionFilePath, { encoding: "utf-8" });
10+
11+
const currentVersionPatch = versionFileContent.match(
12+
/VersionPatch = (?<patch>\d+)/
13+
).groups.patch;
14+
15+
try {
16+
parseInt(currentVersionPatch);
17+
} catch (err) {
18+
console.error(new Error("Failed to parse version in version.go file"));
19+
throw err;
20+
}
21+
22+
// prettier-ignore
23+
const newVersionPatch = `${parseInt(currentVersionPatch) + 1}`;
24+
25+
console.log(
26+
`Bump version from ${currentVersionPatch} to ${newVersionPatch}`
27+
);
28+
29+
writeFileSync(
30+
versionFilePath,
31+
versionFileContent.replace(
32+
`VersionPatch = ${currentVersionPatch}`,
33+
`VersionPatch = ${newVersionPatch}`
34+
)
35+
);

.github/workflows/bump_version.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Bump version
2+
3+
on:
4+
pull_request:
5+
branches: [ develop ]
6+
types:
7+
- opened
8+
- reopened
9+
- synchronize
10+
- ready_for_review
11+
- labeled
12+
13+
jobs:
14+
try-to-bump:
15+
if: contains(github.event.pull_request.labels.*.name, 'bump-version')
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v3
20+
with:
21+
ref: ${{ github.head_ref }}
22+
- name: check diff
23+
id: check_diff
24+
run: |
25+
set -euo pipefail
26+
27+
# fetch develop branch so that we can diff against later
28+
git fetch origin develop
29+
30+
echo 'checking verion changes in diff...'
31+
32+
# check if version changed in version.go
33+
# note: the grep will fail if use \d instead of [0-9]
34+
git diff HEAD..origin/develop --text --no-ext-diff --unified=0 --no-prefix params/version.go | grep -E '^\+\s*VersionPatch' && true
35+
36+
exit_code=$?
37+
38+
# auto bump if version is not bumped manually
39+
echo '> require auto version bump?'
40+
41+
if [ $exit_code -eq 0 ]; then
42+
echo '> no, already bumped'
43+
echo "result=no-bump" >> "$GITHUB_OUTPUT"
44+
else
45+
echo '> yes'
46+
echo "result=bump" >> "$GITHUB_OUTPUT"
47+
fi
48+
- name: Install Node.js 16
49+
if: steps.check_diff.outputs.result == 'bump'
50+
uses: actions/setup-node@v3
51+
with:
52+
node-version: 16
53+
- name: bump version in params/version.go
54+
if: steps.check_diff.outputs.result == 'bump'
55+
run: node .github/scripts/bump_version_dot_go.mjs
56+
57+
# Commits made by this Action do not trigger new Workflow runs
58+
- uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a
59+
if: steps.check_diff.outputs.result == 'bump'
60+
with:
61+
skip_fetch: true # already did fetch in check diff
62+
file_pattern: "params/version.go"
63+
commit_message: "chore: auto version bump [bot]"
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Docker-arm64
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag:
7+
description: "tag of this image (suffix -arm64 is added automatically)"
8+
required: true
9+
type: string
10+
11+
jobs:
12+
build-and-push-arm64-image:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
arch:
17+
- aarch64
18+
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v2
22+
- name: Set up QEMU
23+
run: |
24+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
25+
docker buildx create --name multiarch --driver docker-container --use
26+
- name: Set up Docker Buildx
27+
id: buildx
28+
uses: docker/setup-buildx-action@v2
29+
- name: Login to Docker Hub
30+
uses: docker/login-action@v2
31+
with:
32+
username: ${{ secrets.DOCKERHUB_USERNAME }}
33+
password: ${{ secrets.DOCKERHUB_TOKEN }}
34+
- name: Build docker image
35+
uses: docker/build-push-action@v2
36+
with:
37+
platforms: linux/arm64
38+
context: .
39+
file: Dockerfile
40+
push: true
41+
tags: scrolltech/l2geth:${{inputs.tag}}-arm64

.github/workflows/docker.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,29 @@ on:
44
push:
55
tags:
66
- '*'
7+
release:
8+
types: [published]
79

810
jobs:
911
build-and-push:
1012
runs-on: ubuntu-latest
1113
steps:
1214
- name: Checkout code
1315
uses: actions/checkout@v2
16+
- name: Set up QEMU
17+
uses: docker/setup-qemu-action@v2
1418
- name: Set up Docker Buildx
1519
uses: docker/setup-buildx-action@v2
20+
- name: Extract docker metadata
21+
id: meta
22+
uses: docker/metadata-action@v3
23+
with:
24+
images: scrolltech/l2geth
25+
tags: |
26+
type=ref,event=tag,enable=${{ github.event_name == 'push' }}
27+
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
28+
flavor: |
29+
latest=false
1630
- name: Login to Docker Hub
1731
uses: docker/login-action@v2
1832
with:
@@ -25,6 +39,7 @@ jobs:
2539
file: Dockerfile
2640
# push: ${{ startsWith(github.ref, 'refs/tags/') }}
2741
push: true
28-
tags: scrolltech/l2geth:${{github.ref_name}}
42+
tags: ${{ steps.meta.outputs.tags }}
43+
labels: ${{ steps.meta.outputs.labels }}
2944
# cache-from: type=gha,scope=${{ github.workflow }}
3045
# cache-to: type=gha,scope=${{ github.workflow }}

.github/workflows/l2geth_ci.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
- name: Install Go
2121
uses: actions/setup-go@v2
2222
with:
23-
go-version: 1.18.x
23+
go-version: 1.21.x
2424
- name: Checkout code
2525
uses: actions/checkout@v2
2626
- name: Build
@@ -33,7 +33,7 @@ jobs:
3333
- name: Install Go
3434
uses: actions/setup-go@v2
3535
with:
36-
go-version: 1.19.x
36+
go-version: 1.21.x
3737
- name: Install rust
3838
uses: actions-rs/toolchain@v1
3939
with:
@@ -45,8 +45,7 @@ jobs:
4545
- name: Build
4646
run: |
4747
make libzkp
48-
sudo cp ./rollup/circuitcapacitychecker/libzkp/libzkp.so /usr/local/lib/
49-
sudo cp ./rollup/circuitcapacitychecker/libzkp/libzktrie.so /usr/local/lib/
48+
sudo cp ./rollup/ccc/libzkp/libzkp.so /usr/local/lib/
5049
make geth
5150
check:
5251
if: github.event.pull_request.draft == false
@@ -55,7 +54,7 @@ jobs:
5554
- name: Install Go
5655
uses: actions/setup-go@v2
5756
with:
58-
go-version: 1.18.x
57+
go-version: 1.21.x
5958
- name: Checkout code
6059
uses: actions/checkout@v2
6160
- name: Lint
@@ -71,13 +70,29 @@ jobs:
7170
with:
7271
go-version: 1.18.x
7372
- name: Install goimports
74-
run: go install golang.org/x/tools/cmd/goimports@latest
73+
run: go install golang.org/x/tools/cmd/goimports@v0.24.0
7574
- name: Checkout code
7675
uses: actions/checkout@v2
7776
- run: goimports -local github.com/scroll-tech/go-ethereum/ -w .
77+
# If there are any diffs from goimports, fail.
78+
- name: Verify no changes from goimports
79+
run: |
80+
if [ -n "$(git status --porcelain)" ]; then
81+
exit 1
82+
fi
83+
go-mod-tidy-lint:
84+
if: github.event.pull_request.draft == false
85+
runs-on: ubuntu-latest
86+
steps:
87+
- name: Install Go
88+
uses: actions/setup-go@v2
89+
with:
90+
go-version: 1.21.x
91+
- name: Checkout code
92+
uses: actions/checkout@v2
7893
- run: go mod tidy
79-
# If there are any diffs from goimports or go mod tidy, fail.
80-
- name: Verify no changes from goimports and go mod tidy
94+
# If there are any diffs from go mod tidy, fail.
95+
- name: Verify no changes from go mod tidy
8196
run: |
8297
if [ -n "$(git status --porcelain)" ]; then
8398
exit 1
@@ -89,12 +104,11 @@ jobs:
89104
- name: Install Go
90105
uses: actions/setup-go@v2
91106
with:
92-
go-version: 1.18.x
107+
go-version: 1.21.x
93108
- name: Checkout code
94109
uses: actions/checkout@v2
95110
- name: Test
96111
run: |
97-
go get ./...
98112
make test
99113
- name: Upload coverage report
100114
run: bash <(curl -s https://codecov.io/bash)

.github/workflows/semgrep.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
workflow_dispatch: {}
3+
pull_request: {}
4+
push:
5+
branches:
6+
- main
7+
- master
8+
paths:
9+
- .github/workflows/semgrep.yml
10+
schedule:
11+
# random HH:MM to avoid a load spike on GitHub Actions at 00:00
12+
- cron: 20 19 * * *
13+
name: Semgrep
14+
jobs:
15+
semgrep:
16+
name: semgrep/ci
17+
runs-on: ubuntu-20.04
18+
env:
19+
SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}
20+
container:
21+
image: returntocorp/semgrep
22+
steps:
23+
- uses: actions/checkout@v3
24+
- run: semgrep ci

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
shallow = true
55
[submodule "internal/utesting/blocktraces"]
66
path = internal/utesting/blocktraces
7-
url = git@github.com:scroll-tech/test-traces.git
7+
url = https://github.com/scroll-tech/test-traces.git

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ linters:
1313
disable-all: true
1414
enable:
1515
- deadcode
16-
- goconst
17-
- goimports
16+
# - goconst
17+
# - goimports
1818
- gosimple
1919
- govet
2020
- ineffassign

Dockerfile

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,40 @@
22
ARG COMMIT=""
33
ARG VERSION=""
44
ARG BUILDNUM=""
5+
ARG SCROLL_LIB_PATH=/scroll/lib
56

67
# Build libzkp dependency
7-
FROM scrolltech/go-rust-builder:go-1.19-rust-nightly-2022-12-10 as chef
8+
FROM scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 as chef
89
WORKDIR app
910

1011
FROM chef as planner
11-
COPY ./rollup/circuitcapacitychecker/libzkp/ .
12+
COPY ./rollup/ccc/libzkp/ .
1213
RUN cargo chef prepare --recipe-path recipe.json
1314

1415
FROM chef as zkp-builder
15-
COPY ./rollup/circuitcapacitychecker/libzkp/rust-toolchain ./
16+
COPY ./rollup/ccc/libzkp/rust-toolchain ./
1617
COPY --from=planner /app/recipe.json recipe.json
1718
RUN cargo chef cook --release --recipe-path recipe.json
1819

19-
COPY ./rollup/circuitcapacitychecker/libzkp .
20+
COPY ./rollup/ccc/libzkp .
21+
RUN cargo clean
2022
RUN cargo build --release
21-
RUN find ./ | grep libzktrie.so | xargs -I{} cp {} /app/target/release/
2223

2324
# Build Geth in a stock Go builder container
24-
FROM scrolltech/go-rust-builder:go-1.19-rust-nightly-2022-12-10 as builder
25+
FROM scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 as builder
2526

2627
ADD . /go-ethereum
27-
COPY --from=zkp-builder /app/target/release/libzkp.so /usr/local/lib/
28-
COPY --from=zkp-builder /app/target/release/libzktrie.so /usr/local/lib/
29-
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
28+
29+
ARG SCROLL_LIB_PATH
30+
31+
RUN apt update && apt install vim netcat-openbsd net-tools curl -y
32+
RUN mkdir -p $SCROLL_LIB_PATH
33+
34+
COPY --from=zkp-builder /app/target/release/libzkp.so $SCROLL_LIB_PATH
35+
36+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SCROLL_LIB_PATH
37+
ENV CGO_LDFLAGS="-L$SCROLL_LIB_PATH -Wl,-rpath,$SCROLL_LIB_PATH"
38+
3039
RUN cd /go-ethereum && env GO111MODULE=on go run build/ci.go install -buildtags circuit_capacity_checker ./cmd/geth
3140

3241
# Pull Geth into a second stage deploy alpine container
@@ -36,9 +45,15 @@ RUN apt-get -qq update \
3645
&& apt-get -qq install -y --no-install-recommends ca-certificates
3746

3847
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
39-
COPY --from=zkp-builder /app/target/release/libzkp.so /usr/local/lib/
40-
COPY --from=zkp-builder /app/target/release/libzktrie.so /usr/local/lib/
41-
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
48+
49+
ARG SCROLL_LIB_PATH
50+
51+
RUN mkdir -p $SCROLL_LIB_PATH
52+
53+
COPY --from=zkp-builder /app/target/release/libzkp.so $SCROLL_LIB_PATH
54+
55+
ENV LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SCROLL_LIB_PATH
56+
ENV CGO_LDFLAGS="-ldl -L$SCROLL_LIB_PATH -Wl,-rpath,$SCROLL_LIB_PATH"
4257

4358
EXPOSE 8545 8546 30303 30303/udp
4459
ENTRYPOINT ["geth"]

Dockerfile.alltools

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG VERSION=""
44
ARG BUILDNUM=""
55

66
# Build Geth in a stock Go builder container
7-
FROM golang:1.19-alpine as builder
7+
FROM golang:1.21-alpine as builder
88

99
RUN apk add --no-cache gcc musl-dev linux-headers git
1010

0 commit comments

Comments
 (0)