Skip to content

Commit 85ad2f8

Browse files
committed
all: Merge go-ethereum v1.16.2
2 parents dd1ebac + 00fce34 commit 85ad2f8

File tree

243 files changed

+20396
-872
lines changed

Some content is hidden

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

243 files changed

+20396
-872
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
DOCKER_REPO=$1
6+
GIT_TAG=$2
7+
GIT_SHA=$3
8+
9+
IMAGE_NAME="op-geth"
10+
IMAGE_TAG=$GIT_TAG
11+
12+
SOURCE_IMAGE_TAG="$DOCKER_REPO/$IMAGE_NAME:$GIT_SHA"
13+
TARGET_IMAGE_TAG="$DOCKER_REPO/$IMAGE_NAME:$IMAGE_TAG"
14+
TARGET_IMAGE_TAG_LATEST="$DOCKER_REPO/$IMAGE_NAME:latest"
15+
16+
echo "Checking if docker images exist for '$IMAGE_NAME'"
17+
echo ""
18+
tags=$(gcloud container images list-tags "$DOCKER_REPO/$IMAGE_NAME" --limit 1 --format json)
19+
if [ "$tags" = "[]" ]; then
20+
echo "No existing docker images were found for '$IMAGE_NAME'. The code tagged with '$GIT_TAG' may not have an associated dockerfile or docker build job."
21+
echo "If this service has a dockerfile, add a docker-publish job for it in the circleci config."
22+
echo ""
23+
echo "Exiting"
24+
exit 0
25+
fi
26+
27+
echo "Tagging $SOURCE_IMAGE_TAG with '$IMAGE_TAG'"
28+
gcloud container images add-tag -q "$SOURCE_IMAGE_TAG" "$TARGET_IMAGE_TAG"
29+
30+
# Only tag finalized releases with 'latest'
31+
if ! [[ "$IMAGE_TAG" =~ ^v1\.[0-9]+\.[0-9]+$ ]]; then
32+
echo "Not tagging with 'latest' because the release is not finalized."
33+
exit 0
34+
fi
35+
36+
echo "Tagging $SOURCE_IMAGE_TAG with 'latest'"
37+
gcloud container images add-tag -q "$SOURCE_IMAGE_TAG" "$TARGET_IMAGE_TAG_LATEST"

.circleci/config.yml

Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
version: 2.1
2+
3+
orbs:
4+
gcp-cli: circleci/[email protected]
5+
slack: circleci/[email protected]
6+
utils: ethereum-optimism/[email protected]
7+
8+
parameters:
9+
go_version:
10+
type: string
11+
default: 1.23.8 # update CI Go version here
12+
13+
commands:
14+
gcp-oidc-authenticate:
15+
description: "Authenticate with GCP using a CircleCI OIDC token."
16+
parameters:
17+
project_id:
18+
type: env_var_name
19+
default: GCP_PROJECT_ID
20+
workload_identity_pool_id:
21+
type: env_var_name
22+
default: GCP_WIP_ID
23+
workload_identity_pool_provider_id:
24+
type: env_var_name
25+
default: GCP_WIP_PROVIDER_ID
26+
service_account_email:
27+
type: env_var_name
28+
default: GCP_SERVICE_ACCOUNT_EMAIL
29+
gcp_cred_config_file_path:
30+
type: string
31+
default: /home/circleci/gcp_cred_config.json
32+
oidc_token_file_path:
33+
type: string
34+
default: /home/circleci/oidc_token.json
35+
steps:
36+
- run:
37+
name: "Create OIDC credential configuration"
38+
command: |
39+
# Store OIDC token in temp file
40+
echo $CIRCLE_OIDC_TOKEN > << parameters.oidc_token_file_path >>
41+
# Create a credential configuration for the generated OIDC ID Token
42+
gcloud iam workload-identity-pools create-cred-config \
43+
"projects/${<< parameters.project_id >>}/locations/global/workloadIdentityPools/${<< parameters.workload_identity_pool_id >>}/providers/${<< parameters.workload_identity_pool_provider_id >>}"\
44+
--output-file="<< parameters.gcp_cred_config_file_path >>" \
45+
--service-account="${<< parameters.service_account_email >>}" \
46+
--credential-source-file=<< parameters.oidc_token_file_path >>
47+
- run:
48+
name: "Authenticate with GCP using OIDC"
49+
command: |
50+
# Configure gcloud to leverage the generated credential configuration
51+
gcloud auth login --brief --cred-file "<< parameters.gcp_cred_config_file_path >>"
52+
# Configure ADC
53+
echo "export GOOGLE_APPLICATION_CREDENTIALS='<< parameters.gcp_cred_config_file_path >>'" | tee -a "$BASH_ENV"
54+
55+
jobs:
56+
build-and-deploy:
57+
machine:
58+
image: ubuntu-2004:current
59+
steps:
60+
- checkout
61+
# Fetch more history for diffing
62+
- run:
63+
name: Fetch git history
64+
command: |
65+
git fetch --depth 1000
66+
67+
# Build forkdiff using Docker
68+
- run:
69+
name: Build forkdiff
70+
command: |
71+
docker run --volume $(pwd):/workspace \
72+
protolambda/forkdiff:0.1.0 \
73+
-repo=/workspace \
74+
-fork=/workspace/fork.yaml \
75+
-out=/workspace/index.html
76+
77+
# Prepare pages directory
78+
- run:
79+
name: Build pages
80+
command: |
81+
mkdir -p /tmp/pages
82+
mv index.html /tmp/pages/index.html
83+
touch /tmp/pages/.nojekyll
84+
if [ "$CIRCLE_PROJECT_REPONAME" == "op-geth" ] && [ "$CIRCLE_PROJECT_USERNAME" == "ethereum-optimism" ]; then
85+
echo "op-geth.optimism.io" > /tmp/pages/CNAME
86+
fi
87+
- utils/github-pages-deploy:
88+
src-pages-dir: /tmp/pages
89+
docker-release:
90+
environment:
91+
DOCKER_BUILDKIT: 1
92+
parameters:
93+
docker_name:
94+
description: Docker image name
95+
type: string
96+
default: "op-geth"
97+
docker_tags:
98+
description: Docker image tags as csv
99+
type: string
100+
registry:
101+
description: Docker registry
102+
type: string
103+
default: "us-docker.pkg.dev"
104+
repo:
105+
description: Docker repo
106+
type: string
107+
default: "oplabs-tools-artifacts/images"
108+
push_tags:
109+
description: Push release push tags
110+
type: boolean
111+
default: false
112+
machine:
113+
image: default
114+
resource_class: xlarge
115+
steps:
116+
- gcp-cli/install
117+
- gcp-oidc-authenticate
118+
- checkout
119+
- run:
120+
name: Configure Docker
121+
command: |
122+
gcloud auth configure-docker <<parameters.registry>>
123+
- run:
124+
name: Build and push
125+
command: |
126+
RAW_TAGS="<<parameters.docker_tags>>"
127+
if [ "$CIRCLE_BRANCH" = "optimism" ]; then
128+
RAW_TAGS="$RAW_TAGS,optimism"
129+
fi
130+
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
131+
DOCKER_TAGS=$(echo -ne "$RAW_TAGS" | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n.]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
132+
docker context create buildx-build
133+
docker buildx create --use buildx-build
134+
docker buildx build --push \
135+
$(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
136+
--platform=linux/arm64,linux/amd64 \
137+
--build-arg VERSION=$CIRCLE_TAG \
138+
--build-arg COMMIT=$CIRCLE_SHA \
139+
--build-arg BUILDNUM=$CIRCLE_BUILD_NUM \
140+
--progress plain \
141+
-f Dockerfile .
142+
- when:
143+
condition:
144+
equal: [true, <<parameters.push_tags>>]
145+
steps:
146+
- run:
147+
name: Tag
148+
command: |
149+
./.circleci/ci-docker-tag-op-geth-release.sh <<parameters.registry>>/<<parameters.repo>> $CIRCLE_TAG $CIRCLE_SHA1
150+
- when:
151+
condition:
152+
equal: [optimism, << pipeline.git.branch >>]
153+
steps:
154+
- gcp-oidc-authenticate:
155+
service_account_email: GCP_SERVICE_ATTESTOR_ACCOUNT_EMAIL
156+
- run:
157+
name: Sign
158+
command: |
159+
git clone --branch v1.0.3 --depth 1 https://github.com/ethereum-optimism/binary_signer
160+
cd binary_signer/signer
161+
162+
IMAGE_PATH="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>:<<pipeline.git.revision>>"
163+
echo $IMAGE_PATH
164+
pip3 install -r requirements.txt
165+
166+
python3 ./sign_image.py --command="sign"\
167+
--attestor-project-name="$ATTESTOR_PROJECT_NAME"\
168+
--attestor-name="$ATTESTOR_NAME"\
169+
--image-path="$IMAGE_PATH"\
170+
--signer-logging-level="INFO"\
171+
--attestor-key-id="//cloudkms.googleapis.com/v1/projects/$ATTESTOR_PROJECT_NAME/locations/global/keyRings/$ATTESTOR_NAME-key-ring/cryptoKeys/$ATTESTOR_NAME-key/cryptoKeyVersions/1"
172+
173+
build-geth:
174+
docker:
175+
- image: cimg/go:<<pipeline.parameters.go_version>>
176+
resource_class: xlarge
177+
steps:
178+
- checkout
179+
- run:
180+
command: go run build/ci.go install
181+
unit-test:
182+
resource_class: xlarge
183+
docker:
184+
- image: cimg/go:<<pipeline.parameters.go_version>>
185+
steps:
186+
- checkout
187+
- run:
188+
command: go run build/ci.go test
189+
lint-geth:
190+
resource_class: medium
191+
docker:
192+
- image: cimg/go:<<pipeline.parameters.go_version>>
193+
steps:
194+
- checkout
195+
- run:
196+
command: go run build/ci.go lint
197+
tidy-geth:
198+
resource_class: small
199+
docker:
200+
- image: cimg/go:<<pipeline.parameters.go_version>>
201+
steps:
202+
- checkout
203+
- run:
204+
command: go mod tidy && git diff --exit-code
205+
check-sr-diff:
206+
docker:
207+
- image: cimg/go:<<pipeline.parameters.go_version>>
208+
steps:
209+
- checkout
210+
- run:
211+
name: install dasel
212+
command: go install github.com/tomwright/dasel/v2/cmd/[email protected]
213+
- run:
214+
name: generate artifact and check diff
215+
command: |
216+
bash ./sync-superchain.sh
217+
git diff --exit-code
218+
219+
workflows:
220+
main:
221+
jobs:
222+
- build-geth:
223+
name: Build geth
224+
- unit-test:
225+
name: Run unit tests for geth
226+
- lint-geth:
227+
name: Run linter over geth
228+
- tidy-geth:
229+
name: Check geth go.mod file has been tidied
230+
- docker-release:
231+
name: Push to Docker
232+
docker_tags: <<pipeline.git.revision>>
233+
context:
234+
- oplabs-gcr
235+
- check-sr-diff:
236+
name: Check superchain registry bundle diff
237+
release:
238+
jobs:
239+
- hold:
240+
type: approval
241+
filters:
242+
tags:
243+
only: /^v.*/
244+
branches:
245+
ignore: /.*/
246+
- docker-release:
247+
name: Push to Docker (release)
248+
filters:
249+
tags:
250+
only: /^v.*/
251+
branches:
252+
ignore: /.*/
253+
docker_tags: <<pipeline.git.revision>>,<<pipeline.git.tag>>
254+
push_tags: true
255+
context:
256+
- oplabs-gcr-release
257+
requires:
258+
- hold
259+
260+
merge:
261+
jobs:
262+
- build-and-deploy:
263+
context: circleci-repo-op-geth
264+
filters:
265+
branches:
266+
only: optimism

.github/CODEOWNERS

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1 @@
1-
# Lines starting with '#' are comments.
2-
# Each line is a file pattern followed by one or more owners.
3-
4-
accounts/usbwallet/ @gballet
5-
accounts/scwallet/ @gballet
6-
accounts/abi/ @gballet @MariusVanDerWijden
7-
beacon/engine/ @MariusVanDerWijden @lightclient @fjl
8-
beacon/light/ @zsfelfoldi
9-
beacon/merkle/ @zsfelfoldi
10-
beacon/types/ @zsfelfoldi @fjl
11-
beacon/params/ @zsfelfoldi @fjl
12-
cmd/evm/ @MariusVanDerWijden @lightclient
13-
core/state/ @rjl493456442
14-
crypto/ @gballet @jwasinger @fjl
15-
core/ @rjl493456442
16-
eth/ @rjl493456442
17-
eth/catalyst/ @MariusVanDerWijden @lightclient @fjl @jwasinger
18-
eth/tracers/ @s1na
19-
ethclient/ @fjl
20-
ethdb/ @rjl493456442
21-
event/ @fjl
22-
trie/ @rjl493456442
23-
triedb/ @rjl493456442
24-
core/tracing/ @s1na
25-
graphql/ @s1na
26-
internal/ethapi/ @fjl @s1na @lightclient
27-
internal/era/ @lightclient
28-
miner/ @MariusVanDerWijden @fjl @rjl493456442
29-
node/ @fjl
30-
p2p/ @fjl @zsfelfoldi
31-
rlp/ @fjl
32-
params/ @fjl @gballet @rjl493456442 @zsfelfoldi
33-
rpc/ @fjl
1+
* @ethereum-optimism/op-geth-maintainers

.github/workflows/go.yml

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)