Skip to content

Commit 4cd54f4

Browse files
committed
Rebase bsp-v2.2.0 onto geth-v1.15.10
* update github workflows, linters, configs, docs and readme * repatch state-specimen, block-specimen, blob-specimen producer, workflows, linters & docs * upgrade block-specimen patch onto `geth-v1.15.5` (#247) Signed-off-by: Pranay Valson <[email protected]>
1 parent 36b2371 commit 4cd54f4

Some content is hidden

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

48 files changed

+2407
-84
lines changed

.github/workflows/build-test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: build-test
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
12+
jobs:
13+
audit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/[email protected]
18+
with:
19+
access_token: ${{ secrets.GITHUB_TOKEN }}
20+
- uses: actions/checkout@v2
21+
22+
- name: Set up Go
23+
uses: actions/setup-go@v2
24+
with:
25+
go-version: 1.24.0
26+
27+
- name: Checkout code
28+
uses: actions/checkout@v2
29+
30+
- name: Verify dependencies
31+
run: go mod verify
32+
33+
- name: Build all
34+
run: make all
35+
36+
- name: Run tests
37+
run: go test -short ./...
38+
39+
- name: Upload coverage to Codecov
40+
run: bash <(curl -s https://codecov.io/bash) -t ${{ secrets.CODECOV_TOKEN }}
41+
42+
- name: Clean
43+
run: make clean

.github/workflows/docker-image.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: docker-image-ci
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
12+
jobs:
13+
push-image:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/[email protected]
18+
with:
19+
access_token: ${{ secrets.GITHUB_TOKEN }}
20+
- name: Login to GitHub Container Registry
21+
if: ${{ !env.ACT }}
22+
uses: docker/login-action@v1
23+
with:
24+
registry: ghcr.io
25+
username: ${{ secrets.CR_USER }}
26+
password: ${{ secrets.CR_PAT }}
27+
28+
- uses: actions/checkout@v2
29+
- name: Build & Publish the Docker image
30+
if: ${{ !env.ACT }}
31+
run: |
32+
docker build . --file Dockerfile --tag ghcr.io/covalenthq/bsp-geth:latest
33+
docker push ghcr.io/covalenthq/bsp-geth:latest
34+
35+
# - name: Start containers
36+
# run: docker-compose -f "docker-compose.yml" up --build --remove-orphans --force-recreate --exit-code-from agent
37+
38+
# - name: Check running bsp-geth
39+
# run: docker inspect bsp-geth
40+
41+
# - name: Check running containers
42+
# run: docker ps
43+
44+
# - name: Stop containers
45+
# if: always()
46+
# run: docker-compose -f "docker-compose.yml" down

.github/workflows/gcr-image.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: gcr-image
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Cancel Previous Runs
17+
uses: styfle/[email protected]
18+
with:
19+
access_token: ${{ secrets.GITHUB_TOKEN }}
20+
- name: Login to GCR
21+
uses: docker/login-action@v2
22+
with:
23+
registry: us-docker.pkg.dev
24+
username: _json_key
25+
password: ${{ secrets.GCR_JSON_KEY }}
26+
27+
- uses: actions/checkout@v2
28+
# - uses: satackey/[email protected]
29+
- name: Build & Publish the Docker image
30+
run: |
31+
docker buildx create --name builder --use --platform=linux/amd64 && docker buildx build --platform=linux/amd64 . -t us-docker.pkg.dev/covalent-project/network/bsp-geth:latest --push

.github/workflows/go.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,42 @@ name: i386 linux tests
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
7-
branches: [ master ]
7+
branches: [master]
88
workflow_dispatch:
99

1010
jobs:
1111
lint:
1212
name: Lint
1313
runs-on: self-hosted
1414
steps:
15-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@v4
1616

17-
# Cache build tools to avoid downloading them each time
18-
- uses: actions/cache@v4
19-
with:
20-
path: build/cache
21-
key: ${{ runner.os }}-build-tools-cache-${{ hashFiles('build/checksums.txt') }}
17+
# Cache build tools to avoid downloading them each time
18+
- uses: actions/cache@v4
19+
with:
20+
path: build/cache
21+
key: ${{ runner.os }}-build-tools-cache-${{ hashFiles('build/checksums.txt') }}
2222

23-
- name: Set up Go
24-
uses: actions/setup-go@v5
25-
with:
26-
go-version: 1.23.0
27-
cache: false
23+
- name: Set up Go
24+
uses: actions/setup-go@v5
25+
with:
26+
go-version: 1.24.0
27+
cache: false
2828

29-
- name: Run linters
30-
run: |
31-
go run build/ci.go lint
32-
go run build/ci.go check_generate
33-
go run build/ci.go check_baddeps
29+
- name: Run linters
30+
run: |
31+
go run build/ci.go lint
32+
go run build/ci.go check_generate
33+
go run build/ci.go check_baddeps
3434
3535
build:
3636
runs-on: self-hosted
3737
steps:
38-
- uses: actions/checkout@v4
38+
- uses: actions/checkout@v2
3939
- name: Set up Go
40-
uses: actions/setup-go@v5
40+
uses: actions/setup-go@v2
4141
with:
4242
go-version: 1.24.0
4343
cache: false
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: golangci-lint
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
permissions:
12+
contents: read
13+
# Optional: allow read access to pull request. Use with `only-new-issues` option.
14+
# pull-requests: read
15+
jobs:
16+
golangci-build:
17+
name: Build
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-go@v3
22+
- name: Set up Go 1.24.0
23+
uses: actions/setup-go@v3
24+
with:
25+
go-version: 1.24.0
26+
id: go
27+
- run: go version
28+
29+
- name: Lint
30+
run: |
31+
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.51.2
32+
# ./bin/golangci-lint run
33+
34+
# Optional: working directory, useful for monorepos
35+
# working-directory: somedir
36+
37+
# Optional: golangci-lint command line arguments.
38+
# args: --issues-exit-code=0
39+
40+
# Optional: show only new issues if it's a pull request. The default value is `false`.
41+
# only-new-issues: true
42+
43+
# Optional: if set to true then the action will use pre-installed Go.
44+
# skip-go-installation: true
45+
46+
# Optional: if set to true then the action don't cache or restore ~/go/pkg.
47+
# skip-pkg-cache: true
48+
49+
# Optional: if set to true then the action don't cache or restore ~/.cache/go-build.
50+
# skip-build-cache: true

.github/workflows/hadolint.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: dockerfile-lint
2+
3+
on:
4+
push:
5+
branches:
6+
- "main"
7+
pull_request:
8+
branches:
9+
- "main"
10+
- "develop"
11+
12+
jobs:
13+
linter:
14+
name: lint-dockerfile
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- name: lint dockerfile
19+
uses: brpaz/hadolint-action@master
20+
with:
21+
dockerfile: "Dockerfile"

.github/workflows/tag-release.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: tag-release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
8+
jobs:
9+
tagged-release:
10+
name: Tagged Release
11+
runs-on: "ubuntu-latest"
12+
13+
steps:
14+
- name: Login to GCR
15+
uses: docker/login-action@v2
16+
with:
17+
registry: us-docker.pkg.dev
18+
username: _json_key
19+
password: ${{ secrets.GCR_JSON_KEY }}
20+
21+
- uses: actions/checkout@v2
22+
23+
# - uses: satackey/[email protected]
24+
25+
- name: Set env
26+
run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
27+
28+
- name: Build & Publish the Docker image
29+
run: |
30+
docker buildx create --name builder --use --platform=linux/amd64 && docker buildx build --platform=linux/amd64 . -t us-docker.pkg.dev/covalent-project/network/bsp-geth:stable -t us-docker.pkg.dev/covalent-project/network/bsp-geth:"${{ env.TAG }}" --push
31+
32+
- uses: "marvinpinto/action-automatic-releases@latest"
33+
with:
34+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
35+
draft: false
36+
prerelease: false
37+
files: |
38+
*.zip
39+
*.tar.gz

.gitignore

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,23 @@ profile.cov
4242
# VS Code
4343
.vscode
4444

45+
# dashboard
46+
/dashboard/assets/flow-typed
47+
/dashboard/assets/node_modules
48+
/dashboard/assets/stats.json
49+
/dashboard/assets/bundle.js
50+
/dashboard/assets/bundle.js.map
51+
/dashboard/assets/package-lock.json
52+
53+
**/yarn-error.log
54+
55+
data/
56+
ganache_data/
57+
.env
58+
scripts/
59+
logs/
60+
coverage.out
61+
coverage.txt
4562
tests/spec-tests/
4663

4764
# binaries
@@ -55,4 +72,6 @@ cmd/ethkey/ethkey
5572
cmd/evm/evm
5673
cmd/geth/geth
5774
cmd/rlpdump/rlpdump
58-
cmd/workload/workload
75+
cmd/workload/workload
76+
bin/
77+
out/

.hadolint.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ignored:
2+
- DL3018
3+
- DL3016
4+
- DL3059

Dockerfile

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
1-
# Support setting various labels on the final image
2-
ARG COMMIT=""
3-
ARG VERSION=""
4-
ARG BUILDNUM=""
1+
# # Support setting various labels on the final image
2+
# ARG COMMIT=""
3+
# ARG VERSION=""
4+
# ARG BUILDNUM=""
5+
ARG USER=$USER
6+
57

68
# Build Geth in a stock Go builder container
79
FROM golang:1.24-alpine AS builder
810

9-
RUN apk add --no-cache gcc musl-dev linux-headers git
11+
RUN apk add --no-cache gcc musl-dev linux-headers git make
1012

11-
# Get dependencies - will also be cached if we won't change go.mod/go.sum
12-
COPY go.mod /go-ethereum/
13-
COPY go.sum /go-ethereum/
14-
RUN cd /go-ethereum && go mod download
15-
16-
ADD . /go-ethereum
17-
RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth
13+
COPY . /go-ethereum
14+
WORKDIR /go-ethereum
15+
RUN go run build/ci.go install -static ./cmd/geth
1816

1917
# Pull Geth into a second stage deploy alpine container
20-
FROM alpine:latest
18+
FROM alpine:3.21
2119

2220
RUN apk add --no-cache ca-certificates
21+
2322
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
2423

2524
EXPOSE 8545 8546 30303 30303/udp
26-
ENTRYPOINT ["geth"]
2725

28-
# Add some metadata labels to help programmatic image consumption
26+
ENTRYPOINT ["geth", "--mainnet", "--syncmode", "full", "--datadir", "/root/.ethereum/covalent", "--replication.targets", "redis://localhost:6379/?topic=replication", "--replica.result", "true", "--replica.specimen", "true", "--replica.blob", "true"]
27+
28+
# Add some metadata labels to help programatic image consumption
2929
ARG COMMIT=""
3030
ARG VERSION=""
3131
ARG BUILDNUM=""

0 commit comments

Comments
 (0)