diff --git a/.circleci/check-releases.sh b/.circleci/check-releases.sh deleted file mode 100755 index f3595e132..000000000 --- a/.circleci/check-releases.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -set -euo pipefail - -LATEST_RELEASE=$(curl -s --fail -L \ - -H "Accept: application/vnd.github+json" \ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/ethereum/go-ethereum/releases \ - | jq -r '(.[] | select(.draft==false) | select(.prerelease==false)).tag_name' | head -n 1) - -echo "Detected latest go-ethereum release as ${LATEST_RELEASE}" - -git remote add upstream https://github.com/ethereum/go-ethereum -git fetch upstream > /dev/null - -if git branch --contains "${LATEST_RELEASE}" 2>&1 | grep -e '^[ *]*optimism$' > /dev/null -then - echo "Up to date with latest release. Great job! 🎉" -else - echo "Release has not been merged" - exit 1 -fi diff --git a/.circleci/ci-docker-tag-op-geth-release.sh b/.circleci/ci-docker-tag-op-geth-release.sh deleted file mode 100755 index 7b66e789a..000000000 --- a/.circleci/ci-docker-tag-op-geth-release.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -DOCKER_REPO=$1 -GIT_TAG=$2 -GIT_SHA=$3 - -IMAGE_NAME="op-geth" -IMAGE_TAG=$GIT_TAG - -SOURCE_IMAGE_TAG="$DOCKER_REPO/$IMAGE_NAME:$GIT_SHA" -TARGET_IMAGE_TAG="$DOCKER_REPO/$IMAGE_NAME:$IMAGE_TAG" -TARGET_IMAGE_TAG_LATEST="$DOCKER_REPO/$IMAGE_NAME:latest" - -echo "Checking if docker images exist for '$IMAGE_NAME'" -echo "" -tags=$(gcloud container images list-tags "$DOCKER_REPO/$IMAGE_NAME" --limit 1 --format json) -if [ "$tags" = "[]" ]; then - 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." - echo "If this service has a dockerfile, add a docker-publish job for it in the circleci config." - echo "" - echo "Exiting" - exit 0 -fi - -echo "Tagging $SOURCE_IMAGE_TAG with '$IMAGE_TAG'" -gcloud container images add-tag -q "$SOURCE_IMAGE_TAG" "$TARGET_IMAGE_TAG" - -# Do not tag with latest if the release is a release candidate. -if [[ "$IMAGE_TAG" == *"rc"* ]]; then - echo "Not tagging with 'latest' because the release is a release candidate." - exit 0 -fi - -echo "Tagging $SOURCE_IMAGE_TAG with 'latest'" -gcloud container images add-tag -q "$SOURCE_IMAGE_TAG" "$TARGET_IMAGE_TAG_LATEST" - diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 374313392..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,198 +0,0 @@ -version: 2.1 - -orbs: - gcp-cli: circleci/gcp-cli@3.0.1 - slack: circleci/slack@4.10.1 - -commands: - gcp-oidc-authenticate: - description: "Authenticate with GCP using a CircleCI OIDC token." - parameters: - project_id: - type: env_var_name - default: GCP_PROJECT_ID - workload_identity_pool_id: - type: env_var_name - default: GCP_WIP_ID - workload_identity_pool_provider_id: - type: env_var_name - default: GCP_WIP_PROVIDER_ID - service_account_email: - type: env_var_name - default: GCP_SERVICE_ACCOUNT_EMAIL - gcp_cred_config_file_path: - type: string - default: /home/circleci/gcp_cred_config.json - oidc_token_file_path: - type: string - default: /home/circleci/oidc_token.json - steps: - - run: - name: "Create OIDC credential configuration" - command: | - # Store OIDC token in temp file - echo $CIRCLE_OIDC_TOKEN > << parameters.oidc_token_file_path >> - # Create a credential configuration for the generated OIDC ID Token - gcloud iam workload-identity-pools create-cred-config \ - "projects/${<< parameters.project_id >>}/locations/global/workloadIdentityPools/${<< parameters.workload_identity_pool_id >>}/providers/${<< parameters.workload_identity_pool_provider_id >>}"\ - --output-file="<< parameters.gcp_cred_config_file_path >>" \ - --service-account="${<< parameters.service_account_email >>}" \ - --credential-source-file=<< parameters.oidc_token_file_path >> - - run: - name: "Authenticate with GCP using OIDC" - command: | - # Configure gcloud to leverage the generated credential configuration - gcloud auth login --brief --cred-file "<< parameters.gcp_cred_config_file_path >>" - # Configure ADC - echo "export GOOGLE_APPLICATION_CREDENTIALS='<< parameters.gcp_cred_config_file_path >>'" | tee -a "$BASH_ENV" - -jobs: - docker-release: - environment: - DOCKER_BUILDKIT: 1 - parameters: - docker_name: - description: Docker image name - type: string - default: "op-geth" - docker_tags: - description: Docker image tags as csv - type: string - registry: - description: Docker registry - type: string - default: "us-docker.pkg.dev" - repo: - description: Docker repo - type: string - default: "oplabs-tools-artifacts/images" - push_tags: - description: Push release push tags - type: boolean - default: false - machine: - image: ubuntu-2204:2022.07.1 - resource_class: xlarge - steps: - - gcp-cli/install - - gcp-oidc-authenticate - - checkout - - run: - name: Configure Docker - command: | - gcloud auth configure-docker <> - - run: - name: Build and push - command: | - RAW_TAGS="<>" - if [ "$CIRCLE_BRANCH" = "optimism" ]; then - RAW_TAGS="$RAW_TAGS,optimism" - fi - IMAGE_BASE="<>/<>/<>" - DOCKER_TAGS=$(echo -ne "$RAW_TAGS" | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n.]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|") - docker context create buildx-build - docker buildx create --use buildx-build - docker buildx build --push \ - $(echo -ne $DOCKER_TAGS | tr '\n' ' ') \ - --platform=linux/arm64,linux/amd64 \ - --build-arg VERSION=$CIRCLE_TAG \ - --build-arg COMMIT=$CIRCLE_SHA \ - --build-arg BUILDNUM=$CIRCLE_BUILD_NUM \ - --progress plain \ - -f Dockerfile . - - when: - condition: - equal: [ true, <> ] - steps: - - run: - name: Tag - command: | - ./.circleci/ci-docker-tag-op-geth-release.sh <>/<> $CIRCLE_TAG $CIRCLE_SHA1 - - - build-geth: - docker: - - image: cimg/go:1.20 - resource_class: xlarge - steps: - - checkout - - run: - command: go run build/ci.go install - unit-test: - resource_class: xlarge - docker: - - image: cimg/go:1.20 - steps: - - checkout - - run: - command: go run build/ci.go test - lint-geth: - resource_class: medium - docker: - - image: cimg/go:1.20 - steps: - - checkout - - run: - command: go run build/ci.go lint - check-releases: - docker: - - image: cimg/go:1.20 - steps: - - checkout - - run: - command: .circleci/check-releases.sh - - slack/notify: - channel: C03N11M0BBN - branch_pattern: optimism - event: fail - template: basic_fail_1 - - -workflows: - main: - jobs: - - build-geth: - name: Build geth - - unit-test: - name: Run unit tests for geth - - lint-geth: - name: Run linter over geth - - docker-release: - name: Push to Docker - docker_tags: <> - context: - - oplabs-gcr - release: - jobs: - - hold: - type: approval - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - - docker-release: - name: Push to Docker (release) - filters: - tags: - only: /^v.*/ - branches: - ignore: /.*/ - docker_tags: <>,<> - push_tags: true - context: - - oplabs-gcr-release - requires: - - hold - scheduled: - triggers: - - schedule: - # run daily - cron: "0 0 * * *" - filters: - branches: - only: [ "optimism" ] - jobs: - - check-releases: - name: Check for new upstream releases - context: slack diff --git a/.dockerignore b/.dockerignore index 0c013d18b..930806ea3 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,8 @@ +.github +Dockerfile +docker-bake.hcl +Makefile + **/*_test.go build/_workspace diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index faf922df0..000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,22 +0,0 @@ -# Lines starting with '#' are comments. -# Each line is a file pattern followed by one or more owners. - -accounts/usbwallet @karalabe -accounts/scwallet @gballet -accounts/abi @gballet @MariusVanDerWijden -cmd/clef @holiman -consensus @karalabe -core/ @karalabe @holiman @rjl493456442 -eth/ @karalabe @holiman @rjl493456442 -eth/catalyst/ @gballet -eth/tracers/ @s1na -graphql/ @s1na -les/ @zsfelfoldi @rjl493456442 -light/ @zsfelfoldi @rjl493456442 -node/ @fjl -p2p/ @fjl @zsfelfoldi -rpc/ @fjl @holiman -p2p/simulations @fjl -p2p/protocols @fjl -p2p/testing @fjl -signer/ @holiman diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md deleted file mode 100644 index 969b7f8f9..000000000 --- a/.github/CONTRIBUTING.md +++ /dev/null @@ -1,40 +0,0 @@ -# Contributing - -Thank you for considering to help out with the source code! We welcome -contributions from anyone on the internet, and are grateful for even the -smallest of fixes! - -If you'd like to contribute to go-ethereum, please fork, fix, commit and send a -pull request for the maintainers to review and merge into the main code base. If -you wish to submit more complex changes though, please check up with the core -devs first on [our gitter channel](https://gitter.im/ethereum/go-ethereum) to -ensure those changes are in line with the general philosophy of the project -and/or get some early feedback which can make both your efforts much lighter as -well as our review and merge procedures quick and simple. - -## Coding guidelines - -Please make sure your contributions adhere to our coding guidelines: - - * Code must adhere to the official Go -[formatting](https://golang.org/doc/effective_go.html#formatting) guidelines -(i.e. uses [gofmt](https://golang.org/cmd/gofmt/)). - * Code must be documented adhering to the official Go -[commentary](https://golang.org/doc/effective_go.html#commentary) guidelines. - * Pull requests need to be based on and opened against the `master` branch. - * Commit messages should be prefixed with the package(s) they modify. - * E.g. "eth, rpc: make trace configs optional" - -## Can I have feature X - -Before you submit a feature request, please check and make sure that it isn't -possible through some other means. The JavaScript-enabled console is a powerful -feature in the right hands. Please check our -[Geth documentation page](https://geth.ethereum.org/docs/) for more info -and help. - -## Configuration, dependencies, and tests - -Please see the [Developers' Guide](https://geth.ethereum.org/docs/developers/geth-developer/dev-guide) -for more details on configuring your environment, managing project dependencies -and testing procedures. diff --git a/.github/ISSUE_TEMPLATE/bug.md b/.github/ISSUE_TEMPLATE/bug.md deleted file mode 100644 index 45bfd986a..000000000 --- a/.github/ISSUE_TEMPLATE/bug.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -name: Report a bug -about: Something with go-ethereum is not working as expected -title: '' -labels: 'type:bug' -assignees: '' ---- - -#### System information - -Geth version: `geth version` -CL client & version: e.g. lighthouse/nimbus/prysm@v1.0.0 -OS & Version: Windows/Linux/OSX -Commit hash : (if `develop`) - -#### Expected behaviour - - -#### Actual behaviour - - -#### Steps to reproduce the behaviour - - -#### Backtrace - -```` -[backtrace] -```` - -When submitting logs: please submit them as text and not screenshots. diff --git a/.github/ISSUE_TEMPLATE/feature.md b/.github/ISSUE_TEMPLATE/feature.md deleted file mode 100644 index aacd885f9..000000000 --- a/.github/ISSUE_TEMPLATE/feature.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Request a feature -about: Report a missing feature - e.g. as a step before submitting a PR -title: '' -labels: 'type:feature' -assignees: '' ---- - -# Rationale - -Why should this feature exist? -What are the use-cases? - -# Implementation - -Do you have ideas regarding the implementation of this feature? -Are you willing to implement this feature? \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.md b/.github/ISSUE_TEMPLATE/question.md deleted file mode 100644 index 8f460ab55..000000000 --- a/.github/ISSUE_TEMPLATE/question.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: Ask a question -about: Something is unclear -title: '' -labels: 'type:docs' -assignees: '' ---- - -This should only be used in very rare cases e.g. if you are not 100% sure if something is a bug or asking a question that leads to improving the documentation. For general questions please use [discord](https://discord.gg/nthXNEv) or the Ethereum stack exchange at https://ethereum.stackexchange.com. diff --git a/.github/no-response.yml b/.github/no-response.yml deleted file mode 100644 index 903d4ce85..000000000 --- a/.github/no-response.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Number of days of inactivity before an Issue is closed for lack of response -daysUntilClose: 30 -# Label requiring a response -responseRequiredLabel: "need:more-information" -# Comment to post when closing an Issue for lack of response. Set to `false` to disable -closeComment: > - This issue has been automatically closed because there has been no response - to our request for more information from the original author. With only the - information that is currently in the issue, we don't have enough information - to take action. Please reach out if you have more relevant information or - answers to our questions so that we can investigate further. diff --git a/.github/stale.yml b/.github/stale.yml deleted file mode 100644 index 6d921cc79..000000000 --- a/.github/stale.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Number of days of inactivity before an issue becomes stale -daysUntilStale: 366 -# Number of days of inactivity before a stale issue is closed -daysUntilClose: 42 -# Issues with these labels will never be considered stale -exemptLabels: - - pinned - - security -# Label to use when marking an issue as stale -staleLabel: "status:inactive" -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/.github/workflows/pages.yaml b/.github/workflows/pages.yaml deleted file mode 100644 index 6973b227c..000000000 --- a/.github/workflows/pages.yaml +++ /dev/null @@ -1,36 +0,0 @@ -name: Build and publish forkdiff github-pages -permissions: - contents: write -on: - push: - branches: - - optimism -jobs: - deploy: - concurrency: ci-${{ github.ref }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 1000 # make sure to fetch the old commit we diff against - - - name: Build forkdiff - uses: "docker://protolambda/forkdiff:latest" - with: - args: -repo=/github/workspace -fork=/github/workspace/fork.yaml -out=/github/workspace/index.html - - - name: Build pages - run: | - mkdir -p tmp/pages - mv index.html tmp/pages/index.html - touch tmp/pages/.nojekyll - if [ "$GITHUB_REPOSITORY" == "ethereum-optimism/op-geth" ]; then - echo "op-geth.optimism.io" > tmp/pages/CNAME - fi; - - - name: Deploy - uses: JamesIves/github-pages-deploy-action@v4 - with: - folder: tmp/pages - clean: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..6c07e20de --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v3 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push + uses: docker/bake-action@v4 + env: + REGISTRY: ghcr.io + REPOSITORY: ${{ github.repository }} + GIT_COMMIT: ${{ github.sha }} + GIT_VERSION: ${{ github.ref_name }} + GIT_BUILDNUM: ${{ github.run_id }} + IMAGE_TAGS: ${{ github.ref_name }} + with: + files: docker-bake.hcl + set: '*.platform=linux/amd64,linux/arm64' + push: true diff --git a/.mailmap b/.mailmap deleted file mode 100644 index aa074b76d..000000000 --- a/.mailmap +++ /dev/null @@ -1,237 +0,0 @@ -Aaron Buchwald - -Aaron Kumavis - -Abel Nieto -Abel Nieto - -Afri Schoedon <58883403+q9f@users.noreply.github.com> -Afri Schoedon <5chdn@users.noreply.github.com> <58883403+q9f@users.noreply.github.com> - -Alec Perseghin - -Aleksey Smyrnov - -Alex Leverington -Alex Leverington - -Alex Pozhilenkov -Alex Pozhilenkov - -Alexey Akhunov - -Alon Muroch - -Andrey Petrov -Andrey Petrov - -Arkadiy Paronyan - -Armin Braun - -Aron Fischer - -Austin Roberts -Austin Roberts - -Bas van Kervel -Bas van Kervel -Bas van Kervel -Bas van Kervel - -Boqin Qin -Boqin Qin - -Casey Detrio - -Cheng Li - -Chris Ziogas -Chris Ziogas - -Christoph Jentzsch - -Diederik Loerakker - -Dimitry Khokhlov - -Domino Valdano -Domino Valdano - -Edgar Aroutiounian - -Elliot Shepherd - -Enrique Fynn - -Enrique Fynn -Enrique Fynn - -Ernesto del Toro -Ernesto del Toro - -Everton Fraga - -Felix Lange -Felix Lange - -Frank Wang - -Gary Rong - -Gavin Wood - -Gregg Dourgarian - -Guillaume Ballet -Guillaume Ballet <3272758+gballet@users.noreply.github.com> - -Guillaume Nicolas - -Hanjiang Yu -Hanjiang Yu <42531996+de1acr0ix@users.noreply.github.com> - -Heiko Hees - -Henning Diedrich -Henning Diedrich Drake Burroughs - -Hwanjo Heo <34005989+hwanjo@users.noreply.github.com> - -Iskander (Alex) Sharipov -Iskander (Alex) Sharipov - -Jae Kwon - -Janoš Guljaš -Janoš Guljaš Janos Guljas - -Jared Wasinger - -Jason Carver -Jason Carver - -Javier Peletier -Javier Peletier - -Jeffrey Wilcke -Jeffrey Wilcke -Jeffrey Wilcke -Jeffrey Wilcke - -Jens Agerberg - -Joseph Chow -Joseph Chow ethers - - -Joseph Goulden - -Justin Drake - -Kenso Trabing -Kenso Trabing - -Liang Ma -Liang Ma - -Louis Holbrook -Louis Holbrook - -Maran Hidskes - -Marian Oancea - -Martin Becze -Martin Becze - -Martin Lundfall - -Matt Garnett <14004106+lightclient@users.noreply.github.com> - -Matthew Halpern -Matthew Halpern - -Michael Riabzev - -Nchinda Nchinda - -Nick Dodson - -Nick Johnson - -Nick Savers - -Nishant Das -Nishant Das - -Olivier Hervieu - -Pascal Dierich -Pascal Dierich - -RJ Catalano -RJ Catalano - -Ralph Caraveo - -Rene Lubov <41963722+renaynay@users.noreply.github.com> - -Robert Zaremba -Robert Zaremba - -Roman Mandeleil - -Sorin Neacsu -Sorin Neacsu - -Sven Ehlert - -Taylor Gerring -Taylor Gerring - -Thomas Bocek - -Tim Cooijmans - -Valentin Wüstholz -Valentin Wüstholz - -Victor Tran - -Viktor Trón - -Ville Sundell - -Vincent G - -Vitalik Buterin - -Vlad Gluhovsky -Vlad Gluhovsky - -Wenshao Zhong -Wenshao Zhong <11510383@mail.sustc.edu.cn> -Wenshao Zhong <374662347@qq.com> - -Will Villanueva - -Xiaobing Jiang - -Xudong Liu <33193253+r1cs@users.noreply.github.com> - -Yohann Léon - -Zachinquarantine -Zachinquarantine - -Ziyuan Zhong - -Zsolt Felföldi - -meowsbits -meowsbits <45600330+meowsbits@users.noreply.github.com> - -nedifi <103940716+nedifi@users.noreply.github.com> - -Максим Чусовлянов diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c2bfc3f2b..000000000 --- a/.travis.yml +++ /dev/null @@ -1,180 +0,0 @@ -language: go -go_import_path: github.com/ethereum/go-ethereum -sudo: false -jobs: - allow_failures: - - stage: build - os: osx - env: - - azure-osx - - include: - # This builder only tests code linters on latest version of Go - - stage: lint - os: linux - dist: bionic - go: 1.21.x - env: - - lint - git: - submodules: false # avoid cloning ethereum/tests - script: - - go run build/ci.go lint - - # These builders create the Docker sub-images for multi-arch push and each - # will attempt to push the multi-arch image if they are the last builder - - stage: build - if: type = push - os: linux - arch: amd64 - dist: bionic - go: 1.21.x - env: - - docker - services: - - docker - git: - submodules: false # avoid cloning ethereum/tests - before_install: - - export DOCKER_CLI_EXPERIMENTAL=enabled - script: - - go run build/ci.go docker -image -manifest amd64,arm64 -upload ethereum/client-go - - - stage: build - if: type = push - os: linux - arch: arm64 - dist: bionic - go: 1.21.x - env: - - docker - services: - - docker - git: - submodules: false # avoid cloning ethereum/tests - before_install: - - export DOCKER_CLI_EXPERIMENTAL=enabled - script: - - go run build/ci.go docker -image -manifest amd64,arm64 -upload ethereum/client-go - - # This builder does the Linux Azure uploads - - stage: build - if: type = push - os: linux - dist: bionic - sudo: required - go: 1.21.x - env: - - azure-linux - git: - submodules: false # avoid cloning ethereum/tests - addons: - apt: - packages: - - gcc-multilib - script: - # Build for the primary platforms that Trusty can manage - - go run build/ci.go install -dlgo - - go run build/ci.go archive -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds - - go run build/ci.go install -dlgo -arch 386 - - go run build/ci.go archive -arch 386 -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds - - # Switch over GCC to cross compilation (breaks 386, hence why do it here only) - - sudo -E apt-get -yq --no-install-suggests --no-install-recommends --force-yes install gcc-arm-linux-gnueabi libc6-dev-armel-cross gcc-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross - - sudo ln -s /usr/include/asm-generic /usr/include/asm - - - GOARM=5 go run build/ci.go install -dlgo -arch arm -cc arm-linux-gnueabi-gcc - - GOARM=5 go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds - - GOARM=6 go run build/ci.go install -dlgo -arch arm -cc arm-linux-gnueabi-gcc - - GOARM=6 go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds - - GOARM=7 go run build/ci.go install -dlgo -arch arm -cc arm-linux-gnueabihf-gcc - - GOARM=7 go run build/ci.go archive -arch arm -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds - - go run build/ci.go install -dlgo -arch arm64 -cc aarch64-linux-gnu-gcc - - go run build/ci.go archive -arch arm64 -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds - - # This builder does the OSX Azure uploads - - stage: build - if: type = push - os: osx - osx_image: xcode14.2 - go: 1.21.x - env: - - azure-osx - git: - submodules: false # avoid cloning ethereum/tests - script: - - go run build/ci.go install -dlgo - - go run build/ci.go archive -type tar -signer OSX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds - - go run build/ci.go install -dlgo -arch arm64 - - go run build/ci.go archive -arch arm64 -type tar -signer OSX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds - - # These builders run the tests - - stage: build - os: linux - arch: amd64 - dist: bionic - go: 1.21.x - script: - - travis_wait 30 go run build/ci.go test $TEST_PACKAGES - - - stage: build - if: type = pull_request - os: linux - arch: arm64 - dist: bionic - go: 1.20.x - script: - - travis_wait 30 go run build/ci.go test $TEST_PACKAGES - - - stage: build - os: linux - dist: bionic - go: 1.20.x - script: - - travis_wait 30 go run build/ci.go test $TEST_PACKAGES - - # This builder does the Ubuntu PPA nightly uploads - - stage: build - if: type = cron || (type = push && tag ~= /^v[0-9]/) - os: linux - dist: bionic - go: 1.21.x - env: - - ubuntu-ppa - git: - submodules: false # avoid cloning ethereum/tests - addons: - apt: - packages: - - devscripts - - debhelper - - dput - - fakeroot - - python-bzrlib - - python-paramiko - script: - - echo '|1|7SiYPr9xl3uctzovOTj4gMwAC1M=|t6ReES75Bo/PxlOPJ6/GsGbTrM0= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0aKz5UTUndYgIGG7dQBV+HaeuEZJ2xPHo2DS2iSKvUL4xNMSAY4UguNW+pX56nAQmZKIZZ8MaEvSj6zMEDiq6HFfn5JcTlM80UwlnyKe8B8p7Nk06PPQLrnmQt5fh0HmEcZx+JU9TZsfCHPnX7MNz4ELfZE6cFsclClrKim3BHUIGq//t93DllB+h4O9LHjEUsQ1Sr63irDLSutkLJD6RXchjROXkNirlcNVHH/jwLWR5RcYilNX7S5bIkK8NlWPjsn/8Ua5O7I9/YoE97PpO6i73DTGLh5H9JN/SITwCKBkgSDWUt61uPK3Y11Gty7o2lWsBjhBUm2Y38CBsoGmBw==' >> ~/.ssh/known_hosts - - go run build/ci.go debsrc -upload ethereum/ethereum -sftp-user geth-ci -signer "Go Ethereum Linux Builder " - - # This builder does the Azure archive purges to avoid accumulating junk - - stage: build - if: type = cron - os: linux - dist: bionic - go: 1.21.x - env: - - azure-purge - git: - submodules: false # avoid cloning ethereum/tests - script: - - go run build/ci.go purge -store gethstore/builds -days 14 - - # This builder executes race tests - - stage: build - if: type = cron - os: linux - dist: bionic - go: 1.21.x - script: - - travis_wait 30 go run build/ci.go test -race $TEST_PACKAGES - diff --git a/Dockerfile b/Dockerfile index ed69a0478..e9d733424 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,20 @@ +# Note: Do not place `ARG` above `FROM`. +# It will not be able to be referenced by RUN. + +# Build Geth in a stock Go builder container +FROM golang:1.21.3-bullseye as builder + # Support setting various labels on the final image ARG COMMIT="" ARG VERSION="" ARG BUILDNUM="" -# Build Geth in a stock Go builder container -FROM golang:1.21-alpine as builder +# automatically set by buildkit, can be changed with --platform flag +ARG TARGETOS +ARG TARGETARCH +ARG TARGETVARIANT -RUN apk add --no-cache gcc musl-dev linux-headers git +RUN apt update && apt install -y git # Get dependencies - will also be cached if we won't change go.mod/go.sum COPY go.mod /go-ethereum/ @@ -14,12 +22,18 @@ COPY go.sum /go-ethereum/ RUN cd /go-ethereum && go mod download ADD . /go-ethereum -RUN cd /go-ethereum && go run build/ci.go install -static ./cmd/geth +RUN cd /go-ethereum && \ + GOOS=$TARGETOS GOARCH=$TARGETARCH GOARM="$(echo $TARGETVARIANT | cut -c2-)" \ + go run build/ci.go install -static -arch $TARGETARCH ./cmd/geth + +# Pull Geth into a second stage deploy debian container +FROM debian:11.9-slim -# Pull Geth into a second stage deploy alpine container -FROM alpine:latest +RUN apt update && \ + apt install -y ca-certificates && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -RUN apk add --no-cache ca-certificates COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/ EXPOSE 8545 8546 30303 30303/udp diff --git a/Makefile b/Makefile index 226bac2d1..f0e836634 100644 --- a/Makefile +++ b/Makefile @@ -42,3 +42,8 @@ forkdiff: --mount src=$(shell pwd),target=/host-pwd,type=bind \ protolambda/forkdiff:latest \ -repo /host-pwd/ -fork /host-pwd/fork.yaml -out /host-pwd/forkdiff.html + +geth-docker: + GIT_COMMIT=$$(git rev-parse HEAD) \ + IMAGE_TAGS=latest,$$(git rev-parse HEAD) \ + docker buildx bake -f docker-bake.hcl --progress plain --load diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 000000000..7a8d577a5 --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,49 @@ +variable "REGISTRY" { + default = "localhost" +} + +variable "REPOSITORY" { + default = "oasysgames/oasys-op-geth" +} + +variable "GIT_COMMIT" { + default = "dev" +} + +// The default version to embed in the built images. +// During CI release builds this is set to <> +variable "GIT_VERSION" { + default = "v0.0.0" +} + +variable "GIT_BUILDNUM" { + default = "0" +} + +variable "IMAGE_TAGS" { + default = "${GIT_COMMIT}" // split by "," +} + +variable "PLATFORMS" { + // You can override this as "linux/amd64,linux/arm64". + // Only a specify a single platform when `--load` ing into docker. + // Multi-platform is supported when outputting to disk or pushing to a registry. + // Multi-platform builds can be tested locally with: --set="*.output=type=image,push=false" + default = "" +} + +group "default" { + targets = ["op-geth"] +} + +target "op-geth" { + dockerfile = "Dockerfile" + context = "." + args = { + COMMIT = "${GIT_COMMIT}" + VERSION = "${GIT_VERSION}" + BUILDNUM = "${GIT_BUILDNUM}" + } + platforms = split(",", PLATFORMS) + tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}:${tag}"] +}