From 793e8a427dc1c6dac6059d120c2c325a9ebe07a9 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:40:20 +0000 Subject: [PATCH 01/12] chore: update go version to 1.21.11 --- .github/workflows/ante-benchmark.yml | 2 +- .github/workflows/build.yml | 2 +- .github/workflows/dependencies.yml | 2 +- .github/workflows/goreleaser.yml | 2 +- .github/workflows/lint.yml | 2 +- .golangci.yml | 2 +- Dockerfile | 2 +- Makefile | 2 +- go.mod | 2 +- networks/local/exocore/Dockerfile | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ante-benchmark.yml b/.github/workflows/ante-benchmark.yml index 54036daa5..aa40533ba 100644 --- a/.github/workflows/ante-benchmark.yml +++ b/.github/workflows/ante-benchmark.yml @@ -29,7 +29,7 @@ jobs: - name: Setup Golang uses: actions/setup-go@v4 with: - go-version: '1.21.9' + go-version: '1.21.11' check-latest: true - name: Run benchmark tests diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c3dfb697..eaa39e5e3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v4 with: - go-version: '1.21.9' + go-version: '1.21.11' check-latest: true - uses: technote-space/get-diff-action@v6.1.2 id: git_diff diff --git a/.github/workflows/dependencies.yml b/.github/workflows/dependencies.yml index 1e846db7c..5c613edab 100644 --- a/.github/workflows/dependencies.yml +++ b/.github/workflows/dependencies.yml @@ -11,7 +11,7 @@ jobs: steps: - uses: actions/setup-go@v4 with: - go-version: '1.21.9' + go-version: '1.21.11' check-latest: true - name: "Checkout Repository" uses: actions/checkout@v4 diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index 7419114ea..3c451f402 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -19,7 +19,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: '1.21.9' + go-version: '1.21.11' check-latest: true - name: release dry run run: make release-dry-run diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9c9154031..ed0476abd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -21,7 +21,7 @@ jobs: # Required: setup-go, for all versions v3.0.0+ of golangci-lint - uses: actions/setup-go@v5 with: - go-version: '1.21.9' + go-version: '1.21.11' # Use pinned versions, not git versions check-latest: false # Match `golangci-lint-action` recommendation diff --git a/.golangci.yml b/.golangci.yml index fe4c5c5e3..b31d2cb00 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -2,7 +2,7 @@ run: tests: false timeout: 5m concurrency: 4 - go: "1.21.9" + go: "1.21.11" linters: enable: diff --git a/Dockerfile b/Dockerfile index 4a64abccc..3c0fd350e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # This is the published docker image for exocore. -FROM golang:1.21.9-alpine3.18 AS build-env +FROM golang:1.21.11-alpine3.18 AS build-env WORKDIR /go/src/github.com/ExocoreNetwork/exocore diff --git a/Makefile b/Makefile index 653c3663c..943e9a275 100644 --- a/Makefile +++ b/Makefile @@ -525,7 +525,7 @@ localnet-show-logstream: ############################################################################### PACKAGE_NAME:=github.com/ExocoreNetwork/exocore -GOLANG_CROSS_VERSION = v1.21.9 +GOLANG_CROSS_VERSION = v1.21.11 GOPATH ?= '$(HOME)/go' release-dry-run: docker run \ diff --git a/go.mod b/go.mod index 81e9db711..35933663c 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/ExocoreNetwork/exocore -go 1.21.9 +go 1.21.11 require ( cosmossdk.io/errors v1.0.1 diff --git a/networks/local/exocore/Dockerfile b/networks/local/exocore/Dockerfile index 26042357a..5d6a67b70 100644 --- a/networks/local/exocore/Dockerfile +++ b/networks/local/exocore/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.21.9-alpine3.18 AS build +FROM golang:1.21.11-alpine3.18 AS build RUN apk add --no-cache build-base=0.5-r3 linux-headers=6.3-r0 git=2.40.1-r0 # Set working directory for the build WORKDIR /go/work From bc31f067db4b7e23a48e8e2a7f4dfc60afbe500f Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:45:40 +0000 Subject: [PATCH 02/12] fix(ci): disable buggy workflows till they can be fixed --- .github/workflows/proto-comment.yml | 3 ++- .github/workflows/test-comment.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/proto-comment.yml b/.github/workflows/proto-comment.yml index 596243c10..bdb58cc6c 100644 --- a/.github/workflows/proto-comment.yml +++ b/.github/workflows/proto-comment.yml @@ -18,7 +18,8 @@ jobs: download-artifact-and-comment: runs-on: ubuntu-latest if: > - github.event.workflow_run.conclusion == 'success' + github.event.workflow_run.conclusion == 'success' && + ${{ false }} steps: - name: 'Download artifact' uses: actions/github-script@v7.0.1 diff --git a/.github/workflows/test-comment.yml b/.github/workflows/test-comment.yml index 9fc63ddca..cbe7a5722 100644 --- a/.github/workflows/test-comment.yml +++ b/.github/workflows/test-comment.yml @@ -20,7 +20,8 @@ jobs: runs-on: ubuntu-latest if: > github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' + github.event.workflow_run.conclusion == 'success' && + ${{ false }} steps: - name: Download artifact uses: actions/github-script@v7.0.1 From e5a6ddc33b8f9d9eee3268e3436cd023096dfdf2 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Wed, 12 Jun 2024 09:35:49 +0000 Subject: [PATCH 03/12] fix(app): reorder the EndBlockers The `EndBlockers` do the following jobs: - `x/operator` saves the USD value for delegations, indexed by operator. - `x/dogfood` uses the USD value obtained from `x/operator` to calculate the new voting power and forwards the new validator set to Tendermint. It also decreases the hold count on pending undelegations maturing at that epoch, from the perspective of the dogfood-AVS. - `x/delegation` releases any matured undelegations and makes assets available for withdrawal. - `x/oracle` fetches the new voting power from `x/dogfood` and prepares for the next round. The new order is updated to reflect the above functions. As a consequence, delegations made during blocks just before the epoch ends will also accurately update the vote power of the validators. --- app/app.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/app.go b/app/app.go index fcf0ab5a0..cca9e7c28 100644 --- a/app/app.go +++ b/app/app.go @@ -939,12 +939,12 @@ func NewExocoreApp( app.mm.SetOrderEndBlockers( capabilitytypes.ModuleName, - crisistypes.ModuleName, // easy quit - stakingtypes.ModuleName, - operatorTypes.ModuleName, // after staking keeper - delegationTypes.ModuleName, // after operator keeper + crisistypes.ModuleName, // easy quit + operatorTypes.ModuleName, // first, so that USD value is recorded + stakingtypes.ModuleName, // uses the USD value recorded in operator to calculate vote power + delegationTypes.ModuleName, // process the undelegations matured by dogfood govtypes.ModuleName, // after staking keeper to ensure new vote powers - oracleTypes.ModuleName, // after staking keeper to ensure new vote powers + oracleTypes.ModuleName, // prepares for next round with new vote powers from staking keeper evmtypes.ModuleName, // can be anywhere feegrant.ModuleName, // can be anywhere // no-op modules From 543649c45291dd8ac66631c86aa1f59ac798f991 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Mon, 10 Jun 2024 22:57:07 +0000 Subject: [PATCH 04/12] chore: lint --- .github/workflows/proto-comment.yml | 4 +--- .github/workflows/test-comment.yml | 5 +---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/proto-comment.yml b/.github/workflows/proto-comment.yml index bdb58cc6c..8c727c076 100644 --- a/.github/workflows/proto-comment.yml +++ b/.github/workflows/proto-comment.yml @@ -17,9 +17,7 @@ on: jobs: download-artifact-and-comment: runs-on: ubuntu-latest - if: > - github.event.workflow_run.conclusion == 'success' && - ${{ false }} + if: ${{ false }} steps: - name: 'Download artifact' uses: actions/github-script@v7.0.1 diff --git a/.github/workflows/test-comment.yml b/.github/workflows/test-comment.yml index cbe7a5722..eac81ec3f 100644 --- a/.github/workflows/test-comment.yml +++ b/.github/workflows/test-comment.yml @@ -18,10 +18,7 @@ on: jobs: download-artifact-and-comment: runs-on: ubuntu-latest - if: > - github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' && - ${{ false }} + if: ${{ false }} steps: - name: Download artifact uses: actions/github-script@v7.0.1 From 89f8d77c8fd2c5f8f0c758ce772bc57cc176e685 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:08:31 +0000 Subject: [PATCH 05/12] fix(docker): update to new alpine --- Dockerfile | 8 ++++---- networks/local/exocore/Dockerfile | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3c0fd350e..e07e0d824 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ # This is the published docker image for exocore. -FROM golang:1.21.11-alpine3.18 AS build-env +FROM golang:1.21.11-alpine3.19 AS build-env WORKDIR /go/src/github.com/ExocoreNetwork/exocore COPY go.mod go.sum ./ -RUN apk add --no-cache ca-certificates=20230506-r0 build-base=0.5-r3 git=2.40.1-r0 linux-headers=6.3-r0 +RUN apk add --no-cache ca-certificates=20240226-r0 build-base=0.5-r3 git=2.43.4-r0 linux-headers=6.5-r0 RUN --mount=type=bind,target=. --mount=type=secret,id=GITHUB_TOKEN \ git config --global url."https://$(cat /run/secrets/GITHUB_TOKEN)@github.com/".insteadOf "https://github.com/"; \ @@ -16,14 +16,14 @@ COPY . . RUN make build && go install github.com/MinseokOh/toml-cli@latest -FROM alpine:3.18 +FROM alpine:3.19 WORKDIR /root COPY --from=build-env /go/src/github.com/ExocoreNetwork/exocore/build/exocored /usr/bin/exocored COPY --from=build-env /go/bin/toml-cli /usr/bin/toml-cli -RUN apk add --no-cache ca-certificates=20230506-r0 libstdc++=12.2.1_git20220924-r10 jq=1.6-r4 curl=8.5.0-r0 bash=5.2.15-r5 vim=9.0.2073-r0 lz4=1.9.4-r4 rclone=1.62.2-r6 \ +RUN apk add --no-cache ca-certificates=20240226-r0 libstdc++=13.2.1_git20231014-r0 jq=1.7.1-r0 curl=8.5.0-r0 bash=5.2.21-r0 vim=9.0.2127-r0 lz4=1.9.4-r5 rclone=1.65.0-r3 \ && addgroup -g 1000 exocore \ && adduser -S -h /home/exocore -D exocore -u 1000 -G exocore diff --git a/networks/local/exocore/Dockerfile b/networks/local/exocore/Dockerfile index 5d6a67b70..d995356dc 100644 --- a/networks/local/exocore/Dockerfile +++ b/networks/local/exocore/Dockerfile @@ -1,5 +1,5 @@ -FROM golang:1.21.11-alpine3.18 AS build -RUN apk add --no-cache build-base=0.5-r3 linux-headers=6.3-r0 git=2.40.1-r0 +FROM golang:1.21.11-alpine3.19 AS build +RUN apk add --no-cache build-base=0.5-r3 git=2.43.4-r0 linux-headers=6.5-r0 # Set working directory for the build WORKDIR /go/work # Add source files @@ -9,8 +9,8 @@ COPY . ./ RUN LEDGER_ENABLED=false make build ##################################### -FROM alpine:3.18 AS run -RUN apk add --no-cache libstdc++=12.2.1_git20220924-r10 bash=5.2.15-r5 curl=8.5.0-r0 jq=1.6-r4 \ +FROM alpine:3.19 AS run +RUN apk add --no-cache libstdc++=13.2.1_git20231014-r0 bash=5.2.21-r0 curl=8.5.0-r0 jq=1.7.1-r0 \ && addgroup -g 1000 exocore \ && adduser -S -h /home/exocore -D exocore -u 1000 -G exocore EXPOSE 26656 26657 1317 9090 8545 8546 From 6af69d504a7a9e3cb7247e7343a9c53f97164c63 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:08:58 +0000 Subject: [PATCH 06/12] feat(ci): add `docker build` CI --- .github/workflows/docker-localnet.yml | 23 +++++++++++++++++++++++ .github/workflows/docker.yml | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 .github/workflows/docker-localnet.yml create mode 100644 .github/workflows/docker.yml diff --git a/.github/workflows/docker-localnet.yml b/.github/workflows/docker-localnet.yml new file mode 100644 index 000000000..00874ace6 --- /dev/null +++ b/.github/workflows/docker-localnet.yml @@ -0,0 +1,23 @@ +name: Docker Build `./local/exocore/Dockerfile` +on: + pull_request: + push: + branches: + - develop + - main + - master + - release/** + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + run: make -C ./networks diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 000000000..30f1fd8c3 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,23 @@ +name: Docker Build `./Dockerfile` +on: + pull_request: + push: + branches: + - develop + - main + - master + - release/** + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build Docker image + run: docker build . From 47de9cfd96fb61a8c0e4dad416163e1bc504d223 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:14:16 +0000 Subject: [PATCH 07/12] chore(ci): run `lint` on workflows --- .github/workflows/docker-localnet.yml | 3 +++ .github/workflows/docker.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/docker-localnet.yml b/.github/workflows/docker-localnet.yml index 00874ace6..df2978564 100644 --- a/.github/workflows/docker-localnet.yml +++ b/.github/workflows/docker-localnet.yml @@ -8,6 +8,9 @@ on: - master - release/** +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 30f1fd8c3..ac6a10eca 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,6 +8,9 @@ on: - master - release/** +permissions: + contents: read + jobs: build: runs-on: ubuntu-latest From 731ffde697170b769f036ef3b9ed62ae0b0700b7 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:17:59 +0000 Subject: [PATCH 08/12] chore(ci): run `lint` on workflows again --- .github/workflows/docker-localnet.yml | 2 +- .github/workflows/docker.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-localnet.yml b/.github/workflows/docker-localnet.yml index df2978564..55ab749f3 100644 --- a/.github/workflows/docker-localnet.yml +++ b/.github/workflows/docker-localnet.yml @@ -9,7 +9,7 @@ on: - release/** permissions: - contents: read + contents: read jobs: build: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index ac6a10eca..7b139f12d 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -9,7 +9,7 @@ on: - release/** permissions: - contents: read + contents: read jobs: build: From 67486748b4bb45d423398c125b1961074e578cf9 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:30:14 +0000 Subject: [PATCH 09/12] fix(ci): trigger Dockerbuild only if file changes --- .github/workflows/docker-localnet.yml | 6 ++++++ .github/workflows/docker.yml | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/docker-localnet.yml b/.github/workflows/docker-localnet.yml index 55ab749f3..33c3c957d 100644 --- a/.github/workflows/docker-localnet.yml +++ b/.github/workflows/docker-localnet.yml @@ -1,7 +1,13 @@ name: Docker Build `./local/exocore/Dockerfile` on: pull_request: + paths: + - local/exocore/Dockerfile + - networks/Makefile push: + paths: + - local/exocore/Dockerfile + - networks/Makefile branches: - develop - main diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7b139f12d..a07189902 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,7 +1,11 @@ name: Docker Build `./Dockerfile` on: pull_request: + paths: + - Dockerfile push: + paths: + - Dockerfile branches: - develop - main From 979d6a3c7cd3f6081f8f36ec3c08e24dbf416f65 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:32:19 +0000 Subject: [PATCH 10/12] fix(ci): remove backticks from workflow name --- .github/workflows/docker-localnet.yml | 2 +- .github/workflows/docker.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-localnet.yml b/.github/workflows/docker-localnet.yml index 33c3c957d..2a69f7533 100644 --- a/.github/workflows/docker-localnet.yml +++ b/.github/workflows/docker-localnet.yml @@ -1,4 +1,4 @@ -name: Docker Build `./local/exocore/Dockerfile` +name: Docker build for localnet on: pull_request: paths: diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index a07189902..4fdd9e68a 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,4 +1,4 @@ -name: Docker Build `./Dockerfile` +name: Docker build in root directory on: pull_request: paths: From a3dd3640846574b6baa90059198aa5d432805cd7 Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:38:03 +0000 Subject: [PATCH 11/12] fix(ci): lint the workflow again --- .github/workflows/docker-localnet.yml | 12 ++++++------ .github/workflows/docker.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docker-localnet.yml b/.github/workflows/docker-localnet.yml index 2a69f7533..25c164ab5 100644 --- a/.github/workflows/docker-localnet.yml +++ b/.github/workflows/docker-localnet.yml @@ -22,11 +22,11 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Build Docker image - run: make -C ./networks + - name: Build Docker image + run: make -C ./networks diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4fdd9e68a..9ed7fc649 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,11 +20,11 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Build Docker image - run: docker build . + - name: Build Docker image + run: docker build . From 3489d117af471c3312b8c963ebe3112d6135102b Mon Sep 17 00:00:00 2001 From: MaxMustermann2 <82761650+MaxMustermann2@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:41:04 +0000 Subject: [PATCH 12/12] fix(ci): use correct path to trigger --- .github/workflows/docker-localnet.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/docker-localnet.yml b/.github/workflows/docker-localnet.yml index 25c164ab5..b4e82e365 100644 --- a/.github/workflows/docker-localnet.yml +++ b/.github/workflows/docker-localnet.yml @@ -2,11 +2,11 @@ name: Docker build for localnet on: pull_request: paths: - - local/exocore/Dockerfile + - networks/local/exocore/Dockerfile - networks/Makefile push: paths: - - local/exocore/Dockerfile + - networks/local/exocore/Dockerfile - networks/Makefile branches: - develop