From 34fcd603a9d9419adfb3c7cbd026487809152b4c Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 11:51:55 -0400 Subject: [PATCH 01/43] WIP --- .github/actions/cache_go/action.yml | 12 ++++ .github/actions/changed_files/action.yml | 11 +++ .github/actions/setup_go/action.yml | 32 +++++++++ .github/workflows/go.yml | 88 ++++++++++++++++++++++++ .golangci-version | 1 + 5 files changed, 144 insertions(+) create mode 100644 .github/actions/cache_go/action.yml create mode 100644 .github/actions/changed_files/action.yml create mode 100644 .github/actions/setup_go/action.yml create mode 100644 .github/workflows/go.yml create mode 100644 .golangci-version diff --git a/.github/actions/cache_go/action.yml b/.github/actions/cache_go/action.yml new file mode 100644 index 0000000000..d126596167 --- /dev/null +++ b/.github/actions/cache_go/action.yml @@ -0,0 +1,12 @@ +name: Cache Go +description: Cache Go imports and modules +runs: + using: composite + steps: + - name: Cache Go + uses: actions/cache@v4 + with: + key: gomod-k-${{ hashFiles('**/go.mod', '**/go.sum') }} + path: | + /go/bin/goimports + /go/pkg/mod diff --git a/.github/actions/changed_files/action.yml b/.github/actions/changed_files/action.yml new file mode 100644 index 0000000000..5d4eb27ba1 --- /dev/null +++ b/.github/actions/changed_files/action.yml @@ -0,0 +1,11 @@ +name: Changed Files +description: Get changed files +runs: + using: composite + steps: + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v42 + with: + files: | + **/*.go \ No newline at end of file diff --git a/.github/actions/setup_go/action.yml b/.github/actions/setup_go/action.yml new file mode 100644 index 0000000000..7c4bc9f735 --- /dev/null +++ b/.github/actions/setup_go/action.yml @@ -0,0 +1,32 @@ +name: Setup Go +description: Install Go +runs: + using: composite + steps: + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version: ${{ env.GO_VERSION }} + go-version-file: go.mod + cache-dependency-path: go.sum + cache: true + - name: Set Cache Path + id: paths + run: | + echo "GOBUILD_PATH=$(go env GOCACHE)" >> "$GITHUB_OUTPUT" + echo "GOMOD_PATH=$(go env GOMODCACHE)" >> "$GITHUB_OUTPUT" + shell: bash + - name: Go Build Cache + uses: actions/cache@v4 + with: + path: ${{ steps.paths.outputs.GOBUILD_PATH }} + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} + - name: Go Mod Cache + uses: actions/cache@v4 + with: + path: ${{ steps.paths.outputs.GOMOD_PATH }} + key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.mod') }} + - name: Run go mod download + run: | + go mod download + shell: bash \ No newline at end of file diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000000..b46c995bbf --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,88 @@ +name: Golang CI + +on: + merge_group: + pull_request: + branches: + - '*' +env: + GO_VERSION: '1.21' + +jobs: + changed_files: + name: Changed Files + runs-on: ubutnu-latest + outputs: + changed_files: ${{ steps.changed_files.outputs.all_changed_files }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Changed Files + id: changed_files + uses: ./.github/actions/changed_files + + golang-ci: + needs: + - changed_files + if: | + contains(needs.changed_files.outputs.changed_files, '.go') + name: golangci-lint + runs-on: + labels: 16-cores + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup + uses: ./.github/actions/setup_go + with: + cache: false + - name: Load Version + id: load-version + run: | + echo "GOLANGCI_VERSION=v$(cat .golangci-version)" + - name: golangci-ling + uses: golangci/golangci-lint-action@v6 + with: + version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }} + args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 + working-directory: ${{ github.workspace }} + + golang-test: + needs: + - changed_files + if: | + contains(needs.changed_files.outputs.changed_files, '.go') || + contains(needs.changed_files.outputs.changed_files, 'go.sum') || + ( + contains(needs.changed_files.outputs.changed_files, '.yml') || + contains(needs.changed_files.outputs.changed_files, '.yaml') + ) + && + ( + contains(needs.changed_files.outputs.changed_files, 'app') || + contains(needs.changed_files.outputs.changed_files, 'client') || + contains(needs.changed_files.outputs.changed_files, 'cmd') || + contains(needs.changed_files.outputs.changed_files, 'migrate') || + contains(needs.changed_files.outputs.changed_files, 'tests') || + contains(needs.changed_files.outputs.changed_files, 'x') + ) + name: go test + runs-on: + labels: 16-cores + env: + COVERAGE_DIR: out/coverage/unit/go + COVERAGE_PATH: out/coverage/unit/go/cover.out + FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out + HTML_REPORT: out/coverage/unit/go/go-unit-cover.html + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup + uses: ./.github/actions/setup_go + - name: Go Test + run: | + mkdir -p ${{ env.COVERAGE_DIR }} + readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') + half_nproc=$(( $(nproc --all) / 2 )) + printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race + diff --git a/.golangci-version b/.golangci-version new file mode 100644 index 0000000000..4060f1571d --- /dev/null +++ b/.golangci-version @@ -0,0 +1 @@ +v1.59 \ No newline at end of file From 32e6c4255723a50a443d1eb412a963405bf1013a Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 11:56:47 -0400 Subject: [PATCH 02/43] temp --- .../cd-internal-testnet-manual.yml | 0 .../cd-internal-testnet.yml | 0 .../cd-protonet-manual.yml | 0 .../{workflows => workflows2}/cd-protonet.yml | 0 .../cd-reset-internal-testnet.yml | 0 .../cd-seed-chain.yml | 0 .../cd-start-chain.yml | 0 .../{workflows => workflows2}/ci-commit.yml | 0 .../{workflows => workflows2}/ci-default.yml | 0 .../{workflows => workflows2}/ci-docker.yml | 0 .github/{workflows => workflows2}/ci-lint.yml | 0 .../{workflows => workflows2}/ci-master.yml | 0 .github/{workflows => workflows2}/ci-pr.yml | 0 .../{workflows => workflows2}/ci-release.yml | 0 .../ci-rocksdb-build.yml | 0 .github/workflows2/go.yml | 88 +++++++++++++++++++ .../metric-pipeline.yml | 0 .github/{workflows => workflows2}/proto.yml | 0 18 files changed, 88 insertions(+) rename .github/{workflows => workflows2}/cd-internal-testnet-manual.yml (100%) rename .github/{workflows => workflows2}/cd-internal-testnet.yml (100%) rename .github/{workflows => workflows2}/cd-protonet-manual.yml (100%) rename .github/{workflows => workflows2}/cd-protonet.yml (100%) rename .github/{workflows => workflows2}/cd-reset-internal-testnet.yml (100%) rename .github/{workflows => workflows2}/cd-seed-chain.yml (100%) rename .github/{workflows => workflows2}/cd-start-chain.yml (100%) rename .github/{workflows => workflows2}/ci-commit.yml (100%) rename .github/{workflows => workflows2}/ci-default.yml (100%) rename .github/{workflows => workflows2}/ci-docker.yml (100%) rename .github/{workflows => workflows2}/ci-lint.yml (100%) rename .github/{workflows => workflows2}/ci-master.yml (100%) rename .github/{workflows => workflows2}/ci-pr.yml (100%) rename .github/{workflows => workflows2}/ci-release.yml (100%) rename .github/{workflows => workflows2}/ci-rocksdb-build.yml (100%) create mode 100644 .github/workflows2/go.yml rename .github/{workflows => workflows2}/metric-pipeline.yml (100%) rename .github/{workflows => workflows2}/proto.yml (100%) diff --git a/.github/workflows/cd-internal-testnet-manual.yml b/.github/workflows2/cd-internal-testnet-manual.yml similarity index 100% rename from .github/workflows/cd-internal-testnet-manual.yml rename to .github/workflows2/cd-internal-testnet-manual.yml diff --git a/.github/workflows/cd-internal-testnet.yml b/.github/workflows2/cd-internal-testnet.yml similarity index 100% rename from .github/workflows/cd-internal-testnet.yml rename to .github/workflows2/cd-internal-testnet.yml diff --git a/.github/workflows/cd-protonet-manual.yml b/.github/workflows2/cd-protonet-manual.yml similarity index 100% rename from .github/workflows/cd-protonet-manual.yml rename to .github/workflows2/cd-protonet-manual.yml diff --git a/.github/workflows/cd-protonet.yml b/.github/workflows2/cd-protonet.yml similarity index 100% rename from .github/workflows/cd-protonet.yml rename to .github/workflows2/cd-protonet.yml diff --git a/.github/workflows/cd-reset-internal-testnet.yml b/.github/workflows2/cd-reset-internal-testnet.yml similarity index 100% rename from .github/workflows/cd-reset-internal-testnet.yml rename to .github/workflows2/cd-reset-internal-testnet.yml diff --git a/.github/workflows/cd-seed-chain.yml b/.github/workflows2/cd-seed-chain.yml similarity index 100% rename from .github/workflows/cd-seed-chain.yml rename to .github/workflows2/cd-seed-chain.yml diff --git a/.github/workflows/cd-start-chain.yml b/.github/workflows2/cd-start-chain.yml similarity index 100% rename from .github/workflows/cd-start-chain.yml rename to .github/workflows2/cd-start-chain.yml diff --git a/.github/workflows/ci-commit.yml b/.github/workflows2/ci-commit.yml similarity index 100% rename from .github/workflows/ci-commit.yml rename to .github/workflows2/ci-commit.yml diff --git a/.github/workflows/ci-default.yml b/.github/workflows2/ci-default.yml similarity index 100% rename from .github/workflows/ci-default.yml rename to .github/workflows2/ci-default.yml diff --git a/.github/workflows/ci-docker.yml b/.github/workflows2/ci-docker.yml similarity index 100% rename from .github/workflows/ci-docker.yml rename to .github/workflows2/ci-docker.yml diff --git a/.github/workflows/ci-lint.yml b/.github/workflows2/ci-lint.yml similarity index 100% rename from .github/workflows/ci-lint.yml rename to .github/workflows2/ci-lint.yml diff --git a/.github/workflows/ci-master.yml b/.github/workflows2/ci-master.yml similarity index 100% rename from .github/workflows/ci-master.yml rename to .github/workflows2/ci-master.yml diff --git a/.github/workflows/ci-pr.yml b/.github/workflows2/ci-pr.yml similarity index 100% rename from .github/workflows/ci-pr.yml rename to .github/workflows2/ci-pr.yml diff --git a/.github/workflows/ci-release.yml b/.github/workflows2/ci-release.yml similarity index 100% rename from .github/workflows/ci-release.yml rename to .github/workflows2/ci-release.yml diff --git a/.github/workflows/ci-rocksdb-build.yml b/.github/workflows2/ci-rocksdb-build.yml similarity index 100% rename from .github/workflows/ci-rocksdb-build.yml rename to .github/workflows2/ci-rocksdb-build.yml diff --git a/.github/workflows2/go.yml b/.github/workflows2/go.yml new file mode 100644 index 0000000000..b46c995bbf --- /dev/null +++ b/.github/workflows2/go.yml @@ -0,0 +1,88 @@ +name: Golang CI + +on: + merge_group: + pull_request: + branches: + - '*' +env: + GO_VERSION: '1.21' + +jobs: + changed_files: + name: Changed Files + runs-on: ubutnu-latest + outputs: + changed_files: ${{ steps.changed_files.outputs.all_changed_files }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Changed Files + id: changed_files + uses: ./.github/actions/changed_files + + golang-ci: + needs: + - changed_files + if: | + contains(needs.changed_files.outputs.changed_files, '.go') + name: golangci-lint + runs-on: + labels: 16-cores + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup + uses: ./.github/actions/setup_go + with: + cache: false + - name: Load Version + id: load-version + run: | + echo "GOLANGCI_VERSION=v$(cat .golangci-version)" + - name: golangci-ling + uses: golangci/golangci-lint-action@v6 + with: + version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }} + args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 + working-directory: ${{ github.workspace }} + + golang-test: + needs: + - changed_files + if: | + contains(needs.changed_files.outputs.changed_files, '.go') || + contains(needs.changed_files.outputs.changed_files, 'go.sum') || + ( + contains(needs.changed_files.outputs.changed_files, '.yml') || + contains(needs.changed_files.outputs.changed_files, '.yaml') + ) + && + ( + contains(needs.changed_files.outputs.changed_files, 'app') || + contains(needs.changed_files.outputs.changed_files, 'client') || + contains(needs.changed_files.outputs.changed_files, 'cmd') || + contains(needs.changed_files.outputs.changed_files, 'migrate') || + contains(needs.changed_files.outputs.changed_files, 'tests') || + contains(needs.changed_files.outputs.changed_files, 'x') + ) + name: go test + runs-on: + labels: 16-cores + env: + COVERAGE_DIR: out/coverage/unit/go + COVERAGE_PATH: out/coverage/unit/go/cover.out + FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out + HTML_REPORT: out/coverage/unit/go/go-unit-cover.html + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup + uses: ./.github/actions/setup_go + - name: Go Test + run: | + mkdir -p ${{ env.COVERAGE_DIR }} + readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') + half_nproc=$(( $(nproc --all) / 2 )) + printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race + diff --git a/.github/workflows/metric-pipeline.yml b/.github/workflows2/metric-pipeline.yml similarity index 100% rename from .github/workflows/metric-pipeline.yml rename to .github/workflows2/metric-pipeline.yml diff --git a/.github/workflows/proto.yml b/.github/workflows2/proto.yml similarity index 100% rename from .github/workflows/proto.yml rename to .github/workflows2/proto.yml From 6e0f3bc7b4242a3a05c4b84727240df5060d0e2a Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 11:57:40 -0400 Subject: [PATCH 03/43] change file --- app/app.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/app.go b/app/app.go index 77c7928563..2e1597a6c9 100644 --- a/app/app.go +++ b/app/app.go @@ -966,6 +966,7 @@ func NewApp( consensusparamtypes.ModuleName, packetforwardtypes.ModuleName, precisebanktypes.ModuleName, + ) // Warning: Some init genesis methods must run before others. Ensure the dependencies are understood before modifying this list From e3ae9efc9c5784a1c569bade381b6828e011759d Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 12:00:20 -0400 Subject: [PATCH 04/43] try again --- .../cd-internal-testnet-manual.yml | 0 .../cd-internal-testnet.yml | 0 .../cd-protonet-manual.yml | 0 .../{workflows2 => workflows}/cd-protonet.yml | 0 .../cd-reset-internal-testnet.yml | 0 .../cd-seed-chain.yml | 0 .../cd-start-chain.yml | 0 .../{workflows2 => workflows}/ci-commit.yml | 0 .../{workflows2 => workflows}/ci-default.yml | 0 .../{workflows2 => workflows}/ci-docker.yml | 0 .github/workflows/ci-lint.yml | 21 +++++ .../{workflows2 => workflows}/ci-master.yml | 0 .github/{workflows2 => workflows}/ci-pr.yml | 0 .../{workflows2 => workflows}/ci-release.yml | 0 .../ci-rocksdb-build.yml | 0 .../metric-pipeline.yml | 0 .github/{workflows2 => workflows}/proto.yml | 0 .github/workflows2/ci-lint.yml | 17 ---- .github/workflows2/go.yml | 88 ------------------- 19 files changed, 21 insertions(+), 105 deletions(-) rename .github/{workflows2 => workflows}/cd-internal-testnet-manual.yml (100%) rename .github/{workflows2 => workflows}/cd-internal-testnet.yml (100%) rename .github/{workflows2 => workflows}/cd-protonet-manual.yml (100%) rename .github/{workflows2 => workflows}/cd-protonet.yml (100%) rename .github/{workflows2 => workflows}/cd-reset-internal-testnet.yml (100%) rename .github/{workflows2 => workflows}/cd-seed-chain.yml (100%) rename .github/{workflows2 => workflows}/cd-start-chain.yml (100%) rename .github/{workflows2 => workflows}/ci-commit.yml (100%) rename .github/{workflows2 => workflows}/ci-default.yml (100%) rename .github/{workflows2 => workflows}/ci-docker.yml (100%) create mode 100644 .github/workflows/ci-lint.yml rename .github/{workflows2 => workflows}/ci-master.yml (100%) rename .github/{workflows2 => workflows}/ci-pr.yml (100%) rename .github/{workflows2 => workflows}/ci-release.yml (100%) rename .github/{workflows2 => workflows}/ci-rocksdb-build.yml (100%) rename .github/{workflows2 => workflows}/metric-pipeline.yml (100%) rename .github/{workflows2 => workflows}/proto.yml (100%) delete mode 100644 .github/workflows2/ci-lint.yml delete mode 100644 .github/workflows2/go.yml diff --git a/.github/workflows2/cd-internal-testnet-manual.yml b/.github/workflows/cd-internal-testnet-manual.yml similarity index 100% rename from .github/workflows2/cd-internal-testnet-manual.yml rename to .github/workflows/cd-internal-testnet-manual.yml diff --git a/.github/workflows2/cd-internal-testnet.yml b/.github/workflows/cd-internal-testnet.yml similarity index 100% rename from .github/workflows2/cd-internal-testnet.yml rename to .github/workflows/cd-internal-testnet.yml diff --git a/.github/workflows2/cd-protonet-manual.yml b/.github/workflows/cd-protonet-manual.yml similarity index 100% rename from .github/workflows2/cd-protonet-manual.yml rename to .github/workflows/cd-protonet-manual.yml diff --git a/.github/workflows2/cd-protonet.yml b/.github/workflows/cd-protonet.yml similarity index 100% rename from .github/workflows2/cd-protonet.yml rename to .github/workflows/cd-protonet.yml diff --git a/.github/workflows2/cd-reset-internal-testnet.yml b/.github/workflows/cd-reset-internal-testnet.yml similarity index 100% rename from .github/workflows2/cd-reset-internal-testnet.yml rename to .github/workflows/cd-reset-internal-testnet.yml diff --git a/.github/workflows2/cd-seed-chain.yml b/.github/workflows/cd-seed-chain.yml similarity index 100% rename from .github/workflows2/cd-seed-chain.yml rename to .github/workflows/cd-seed-chain.yml diff --git a/.github/workflows2/cd-start-chain.yml b/.github/workflows/cd-start-chain.yml similarity index 100% rename from .github/workflows2/cd-start-chain.yml rename to .github/workflows/cd-start-chain.yml diff --git a/.github/workflows2/ci-commit.yml b/.github/workflows/ci-commit.yml similarity index 100% rename from .github/workflows2/ci-commit.yml rename to .github/workflows/ci-commit.yml diff --git a/.github/workflows2/ci-default.yml b/.github/workflows/ci-default.yml similarity index 100% rename from .github/workflows2/ci-default.yml rename to .github/workflows/ci-default.yml diff --git a/.github/workflows2/ci-docker.yml b/.github/workflows/ci-docker.yml similarity index 100% rename from .github/workflows2/ci-docker.yml rename to .github/workflows/ci-docker.yml diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml new file mode 100644 index 0000000000..d1cd97e2e0 --- /dev/null +++ b/.github/workflows/ci-lint.yml @@ -0,0 +1,21 @@ +name: Lint Checks +on: + workflow_call: +# run per commit ci checks against this commit +jobs: + proto-lint: + uses: ./.github/workflows/proto.yml + golangci-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Load Version + id: load-version + run: | + echo "GOLANGCI_VERSION=v$(cat .golangci-version)" + - name: golangci-lint + uses: golangci/golangci-lint-action@v6 + with: + version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }} + args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 + working-directory: ${{ github.workspace }} diff --git a/.github/workflows2/ci-master.yml b/.github/workflows/ci-master.yml similarity index 100% rename from .github/workflows2/ci-master.yml rename to .github/workflows/ci-master.yml diff --git a/.github/workflows2/ci-pr.yml b/.github/workflows/ci-pr.yml similarity index 100% rename from .github/workflows2/ci-pr.yml rename to .github/workflows/ci-pr.yml diff --git a/.github/workflows2/ci-release.yml b/.github/workflows/ci-release.yml similarity index 100% rename from .github/workflows2/ci-release.yml rename to .github/workflows/ci-release.yml diff --git a/.github/workflows2/ci-rocksdb-build.yml b/.github/workflows/ci-rocksdb-build.yml similarity index 100% rename from .github/workflows2/ci-rocksdb-build.yml rename to .github/workflows/ci-rocksdb-build.yml diff --git a/.github/workflows2/metric-pipeline.yml b/.github/workflows/metric-pipeline.yml similarity index 100% rename from .github/workflows2/metric-pipeline.yml rename to .github/workflows/metric-pipeline.yml diff --git a/.github/workflows2/proto.yml b/.github/workflows/proto.yml similarity index 100% rename from .github/workflows2/proto.yml rename to .github/workflows/proto.yml diff --git a/.github/workflows2/ci-lint.yml b/.github/workflows2/ci-lint.yml deleted file mode 100644 index 7c36c83587..0000000000 --- a/.github/workflows2/ci-lint.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Lint Checks -on: - workflow_call: -# run per commit ci checks against this commit -jobs: - proto-lint: - uses: ./.github/workflows/proto.yml - golangci-lint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: golangci-lint - uses: reviewdog/action-golangci-lint@v2 - with: - github_token: ${{ secrets.github_token }} - reporter: github-pr-review - golangci_lint_flags: --timeout 10m diff --git a/.github/workflows2/go.yml b/.github/workflows2/go.yml deleted file mode 100644 index b46c995bbf..0000000000 --- a/.github/workflows2/go.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Golang CI - -on: - merge_group: - pull_request: - branches: - - '*' -env: - GO_VERSION: '1.21' - -jobs: - changed_files: - name: Changed Files - runs-on: ubutnu-latest - outputs: - changed_files: ${{ steps.changed_files.outputs.all_changed_files }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Changed Files - id: changed_files - uses: ./.github/actions/changed_files - - golang-ci: - needs: - - changed_files - if: | - contains(needs.changed_files.outputs.changed_files, '.go') - name: golangci-lint - runs-on: - labels: 16-cores - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup - uses: ./.github/actions/setup_go - with: - cache: false - - name: Load Version - id: load-version - run: | - echo "GOLANGCI_VERSION=v$(cat .golangci-version)" - - name: golangci-ling - uses: golangci/golangci-lint-action@v6 - with: - version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }} - args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 - working-directory: ${{ github.workspace }} - - golang-test: - needs: - - changed_files - if: | - contains(needs.changed_files.outputs.changed_files, '.go') || - contains(needs.changed_files.outputs.changed_files, 'go.sum') || - ( - contains(needs.changed_files.outputs.changed_files, '.yml') || - contains(needs.changed_files.outputs.changed_files, '.yaml') - ) - && - ( - contains(needs.changed_files.outputs.changed_files, 'app') || - contains(needs.changed_files.outputs.changed_files, 'client') || - contains(needs.changed_files.outputs.changed_files, 'cmd') || - contains(needs.changed_files.outputs.changed_files, 'migrate') || - contains(needs.changed_files.outputs.changed_files, 'tests') || - contains(needs.changed_files.outputs.changed_files, 'x') - ) - name: go test - runs-on: - labels: 16-cores - env: - COVERAGE_DIR: out/coverage/unit/go - COVERAGE_PATH: out/coverage/unit/go/cover.out - FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out - HTML_REPORT: out/coverage/unit/go/go-unit-cover.html - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup - uses: ./.github/actions/setup_go - - name: Go Test - run: | - mkdir -p ${{ env.COVERAGE_DIR }} - readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') - half_nproc=$(( $(nproc --all) / 2 )) - printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race - From a6eb47cac1403841367e3e4ba254f44ff38bfb4a Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 12:01:17 -0400 Subject: [PATCH 05/43] fix --- .github/workflows/ci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index d1cd97e2e0..1c0195b3ad 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -16,6 +16,6 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: - version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }} + version: ${{ steps.load-version.outputs.GOLANGCI_VERSION }} args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 working-directory: ${{ github.workspace }} From e5e444a88dbbe8adbf204a9956e18efa6f0f52ea Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 12:25:32 -0400 Subject: [PATCH 06/43] trying again --- .github/workflows/ci-lint.yml | 8 ++++++++ app/app.go | 2 +- cmd/kava/main.go | 1 + x/bep3/genesis.go | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 1c0195b3ad..3f7871b056 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -9,6 +9,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v42 + with: + files: | + **/*.go - name: Load Version id: load-version run: | @@ -19,3 +25,5 @@ jobs: version: ${{ steps.load-version.outputs.GOLANGCI_VERSION }} args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 working-directory: ${{ github.workspace }} + if: | + contains(needs.changed_files.outputs.changed_files, '.go') diff --git a/app/app.go b/app/app.go index 2e1597a6c9..536bf6b1c9 100644 --- a/app/app.go +++ b/app/app.go @@ -966,11 +966,11 @@ func NewApp( consensusparamtypes.ModuleName, packetforwardtypes.ModuleName, precisebanktypes.ModuleName, - ) // Warning: Some init genesis methods must run before others. Ensure the dependencies are understood before modifying this list app.mm.SetOrderInitGenesis( + capabilitytypes.ModuleName, // initialize capabilities, run before any module creating or claiming capabilities in InitGenesis authtypes.ModuleName, // loads all accounts, run before any module with a module account banktypes.ModuleName, diff --git a/cmd/kava/main.go b/cmd/kava/main.go index 155b5a4228..a29b75bc5a 100644 --- a/cmd/kava/main.go +++ b/cmd/kava/main.go @@ -15,6 +15,7 @@ func main() { if err := svrcmd.Execute(rootCmd, cmd.EnvPrefix, app.DefaultNodeHome); err != nil { switch e := err.(type) { + case server.ErrorCode: os.Exit(e.Code) diff --git a/x/bep3/genesis.go b/x/bep3/genesis.go index d14e78df31..079b95dbe1 100644 --- a/x/bep3/genesis.go +++ b/x/bep3/genesis.go @@ -24,6 +24,7 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, accountKeeper types.Acco if perm == authtypes.Burner { hasBurnPermissions = true } + if perm == authtypes.Minter { hasMintPermissions = true } From a257433ce4c04ee29efd31e93d45e562171738ad Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 12:40:17 -0400 Subject: [PATCH 07/43] trying again --- .github/workflows/ci-lint.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 3f7871b056..66ba6a45ca 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -9,16 +9,24 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Get changed files id: changed-files uses: tj-actions/changed-files@v42 with: files: | **/*.go + + - name: Debug Changed Files + run: | + echo "Changed files:" + echo "${{ steps.changed-files.outputs.all_changed_files }}" + - name: Load Version id: load-version run: | echo "GOLANGCI_VERSION=v$(cat .golangci-version)" + - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: From 473bab3b88b2ad7de31810a7d7a5787b0bf950f7 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 12:45:39 -0400 Subject: [PATCH 08/43] try again? --- .github/workflows/ci-lint.yml | 2 +- .github/workflows/proto.yml | 3 +++ app/app.go | 1 + app/genesis.go | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 66ba6a45ca..e7190681eb 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -15,7 +15,7 @@ jobs: uses: tj-actions/changed-files@v42 with: files: | - **/*.go + *.go - name: Debug Changed Files run: | diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index b1dc2051ee..07ab7caac4 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -3,6 +3,9 @@ name: Protobuf Checks on: workflow_call: +# fix this too + + jobs: check-proto: name: "Check Proto" diff --git a/app/app.go b/app/app.go index 536bf6b1c9..b71f595518 100644 --- a/app/app.go +++ b/app/app.go @@ -981,6 +981,7 @@ func NewApp( minttypes.ModuleName, ibcexported.ModuleName, evidencetypes.ModuleName, + authz.ModuleName, ibctransfertypes.ModuleName, evmtypes.ModuleName, diff --git a/app/genesis.go b/app/genesis.go index 87596284ef..ae68c6e2a1 100644 --- a/app/genesis.go +++ b/app/genesis.go @@ -10,5 +10,6 @@ type GenesisState map[string]json.RawMessage // NewDefaultGenesisState generates the default state for the application. func NewDefaultGenesisState() GenesisState { encCfg := MakeEncodingConfig() + return ModuleBasics.DefaultGenesis(encCfg.Marshaler) } From 93c1ad909f4db1cc3e5b09242c9afdde446b809f Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 12:58:49 -0400 Subject: [PATCH 09/43] try again? --- .github/workflows/ci-lint.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index e7190681eb..4d1876f574 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -9,18 +9,23 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - + with: + fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v42 + uses: tj-actions/changed-files@v44 with: files: | - *.go + **.go - - name: Debug Changed Files + - name: List all changed files + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | - echo "Changed files:" - echo "${{ steps.changed-files.outputs.all_changed_files }}" + for file in ${ALL_CHANGED_FILES}; do + echo "$file was changed" + done + - name: Load Version id: load-version From 64206da1df2072a4cf73ddd44be08032ee0c839c Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:01:23 -0400 Subject: [PATCH 10/43] try again? --- .github/workflows/ci-lint.yml | 3 - .github/workflows/go.yml | 174 +++++++++++++++++----------------- 2 files changed, 87 insertions(+), 90 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 4d1876f574..e20661258b 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -14,9 +14,6 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 - with: - files: | - **.go - name: List all changed files env: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index b46c995bbf..682194e0d0 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,88 +1,88 @@ name: Golang CI - -on: - merge_group: - pull_request: - branches: - - '*' -env: - GO_VERSION: '1.21' - -jobs: - changed_files: - name: Changed Files - runs-on: ubutnu-latest - outputs: - changed_files: ${{ steps.changed_files.outputs.all_changed_files }} - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Changed Files - id: changed_files - uses: ./.github/actions/changed_files - - golang-ci: - needs: - - changed_files - if: | - contains(needs.changed_files.outputs.changed_files, '.go') - name: golangci-lint - runs-on: - labels: 16-cores - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup - uses: ./.github/actions/setup_go - with: - cache: false - - name: Load Version - id: load-version - run: | - echo "GOLANGCI_VERSION=v$(cat .golangci-version)" - - name: golangci-ling - uses: golangci/golangci-lint-action@v6 - with: - version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }} - args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 - working-directory: ${{ github.workspace }} - - golang-test: - needs: - - changed_files - if: | - contains(needs.changed_files.outputs.changed_files, '.go') || - contains(needs.changed_files.outputs.changed_files, 'go.sum') || - ( - contains(needs.changed_files.outputs.changed_files, '.yml') || - contains(needs.changed_files.outputs.changed_files, '.yaml') - ) - && - ( - contains(needs.changed_files.outputs.changed_files, 'app') || - contains(needs.changed_files.outputs.changed_files, 'client') || - contains(needs.changed_files.outputs.changed_files, 'cmd') || - contains(needs.changed_files.outputs.changed_files, 'migrate') || - contains(needs.changed_files.outputs.changed_files, 'tests') || - contains(needs.changed_files.outputs.changed_files, 'x') - ) - name: go test - runs-on: - labels: 16-cores - env: - COVERAGE_DIR: out/coverage/unit/go - COVERAGE_PATH: out/coverage/unit/go/cover.out - FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out - HTML_REPORT: out/coverage/unit/go/go-unit-cover.html - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup - uses: ./.github/actions/setup_go - - name: Go Test - run: | - mkdir -p ${{ env.COVERAGE_DIR }} - readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') - half_nproc=$(( $(nproc --all) / 2 )) - printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race - +# +#on: +# merge_group: +# pull_request: +# branches: +# - '*' +#env: +# GO_VERSION: '1.21' +# +#jobs: +# changed_files: +# name: Changed Files +# runs-on: ubutnu-latest +# outputs: +# changed_files: ${{ steps.changed_files.outputs.all_changed_files }} +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Changed Files +# id: changed_files +# uses: ./.github/actions/changed_files +# +# golang-ci: +# needs: +# - changed_files +# if: | +# contains(needs.changed_files.outputs.changed_files, '.go') +# name: golangci-lint +# runs-on: +# labels: 16-cores +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Setup +# uses: ./.github/actions/setup_go +# with: +# cache: false +# - name: Load Version +# id: load-version +# run: | +# echo "GOLANGCI_VERSION=v$(cat .golangci-version)" +# - name: golangci-ling +# uses: golangci/golangci-lint-action@v6 +# with: +# version: $${{ steps.load-version.outputs.GOLANGCI_VERSION }} +# args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 +# working-directory: ${{ github.workspace }} +# +# golang-test: +# needs: +# - changed_files +# if: | +# contains(needs.changed_files.outputs.changed_files, '.go') || +# contains(needs.changed_files.outputs.changed_files, 'go.sum') || +# ( +# contains(needs.changed_files.outputs.changed_files, '.yml') || +# contains(needs.changed_files.outputs.changed_files, '.yaml') +# ) +# && +# ( +# contains(needs.changed_files.outputs.changed_files, 'app') || +# contains(needs.changed_files.outputs.changed_files, 'client') || +# contains(needs.changed_files.outputs.changed_files, 'cmd') || +# contains(needs.changed_files.outputs.changed_files, 'migrate') || +# contains(needs.changed_files.outputs.changed_files, 'tests') || +# contains(needs.changed_files.outputs.changed_files, 'x') +# ) +# name: go test +# runs-on: +# labels: 16-cores +# env: +# COVERAGE_DIR: out/coverage/unit/go +# COVERAGE_PATH: out/coverage/unit/go/cover.out +# FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out +# HTML_REPORT: out/coverage/unit/go/go-unit-cover.html +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Setup +# uses: ./.github/actions/setup_go +# - name: Go Test +# run: | +# mkdir -p ${{ env.COVERAGE_DIR }} +# readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') +# half_nproc=$(( $(nproc --all) / 2 )) +# printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race +# From e947133f229327c91003d9edb41b206399a25c2b Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:04:06 -0400 Subject: [PATCH 11/43] .. --- app/app.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index b71f595518..6d74a270da 100644 --- a/app/app.go +++ b/app/app.go @@ -970,7 +970,6 @@ func NewApp( // Warning: Some init genesis methods must run before others. Ensure the dependencies are understood before modifying this list app.mm.SetOrderInitGenesis( - capabilitytypes.ModuleName, // initialize capabilities, run before any module creating or claiming capabilities in InitGenesis authtypes.ModuleName, // loads all accounts, run before any module with a module account banktypes.ModuleName, @@ -981,7 +980,6 @@ func NewApp( minttypes.ModuleName, ibcexported.ModuleName, evidencetypes.ModuleName, - authz.ModuleName, ibctransfertypes.ModuleName, evmtypes.ModuleName, @@ -1018,6 +1016,7 @@ func NewApp( app.mm.RegisterInvariants(&app.crisisKeeper) app.configurator = module.NewConfigurator(app.appCodec, app.MsgServiceRouter(), app.GRPCQueryRouter()) + app.RegisterServices(app.configurator) // RegisterUpgradeHandlers is used for registering any on-chain upgrades. From 40d8dbb1424d78ea0a89e0b4ff1f3cc12814be27 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:08:47 -0400 Subject: [PATCH 12/43] fix --- .github/workflows/ci-lint.yml | 2 +- cmd/kava/main.go | 1 - x/bep3/client/cli/query.go | 2 -- 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index e20661258b..0838ab15bf 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -36,4 +36,4 @@ jobs: args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 working-directory: ${{ github.workspace }} if: | - contains(needs.changed_files.outputs.changed_files, '.go') + contains(steps.changed-files.outputs.all_changed_files, '.go') diff --git a/cmd/kava/main.go b/cmd/kava/main.go index a29b75bc5a..155b5a4228 100644 --- a/cmd/kava/main.go +++ b/cmd/kava/main.go @@ -15,7 +15,6 @@ func main() { if err := svrcmd.Execute(rootCmd, cmd.EnvPrefix, app.DefaultNodeHome); err != nil { switch e := err.(type) { - case server.ErrorCode: os.Exit(e.Code) diff --git a/x/bep3/client/cli/query.go b/x/bep3/client/cli/query.go index fe7bdecc4e..5b7cc7cc2f 100644 --- a/x/bep3/client/cli/query.go +++ b/x/bep3/client/cli/query.go @@ -44,13 +44,11 @@ func GetQueryCmd(queryRoute string) *cobra.Command { QueryGetAtomicSwapsCmd(queryRoute), QueryParamsCmd(queryRoute), } - for _, cmd := range cmds { flags.AddQueryFlagsToCmd(cmd) } bep3QueryCmd.AddCommand(cmds...) - return bep3QueryCmd } From 0978b60a07693019e206bb9e7f250259406f887b Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:23:57 -0400 Subject: [PATCH 13/43] try try --- .github/workflows/ci-lint.yml | 16 ++++++++++++++++ app/app.go | 1 + cmd/kava/cmd/rocksdb/compact.go | 1 + 3 files changed, 18 insertions(+) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 0838ab15bf..b12d7e8cde 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -1,6 +1,15 @@ name: Lint Checks on: workflow_call: + +permissions: + # Required: allow read access to the content for analysis. + contents: read + # Optional: allow read access to pull request. Use with `only-new-issues` option. + pull-requests: read + # Optional: allow write access to checks to allow the action to annotate code in the PR. + checks: write + # run per commit ci checks against this commit jobs: proto-lint: @@ -11,9 +20,16 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache-dependency-path: go.sum + cache: true - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 + files: | + *.go - name: List all changed files env: diff --git a/app/app.go b/app/app.go index 6d74a270da..35ab87a290 100644 --- a/app/app.go +++ b/app/app.go @@ -676,6 +676,7 @@ func NewApp( app.stakingKeeper, &app.distrKeeper, ) + savingsKeeper := savingskeeper.NewKeeper( appCodec, keys[savingstypes.StoreKey], diff --git a/cmd/kava/cmd/rocksdb/compact.go b/cmd/kava/cmd/rocksdb/compact.go index a784ada765..62bdec83c3 100644 --- a/cmd/kava/cmd/rocksdb/compact.go +++ b/cmd/kava/cmd/rocksdb/compact.go @@ -32,6 +32,7 @@ var allowedDBs = []string{"application", "blockstore", "state"} func CompactRocksDBCmd() *cobra.Command { cmd := &cobra.Command{ + Use: fmt.Sprintf( "compact <%s>", strings.Join(allowedDBs, "|"), From 046a8be63c1b043e63f27c40032cf7704252c171 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:25:59 -0400 Subject: [PATCH 14/43] fix --- .github/workflows/ci-lint.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index b12d7e8cde..8d3379d0bb 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -3,10 +3,6 @@ on: workflow_call: permissions: - # Required: allow read access to the content for analysis. - contents: read - # Optional: allow read access to pull request. Use with `only-new-issues` option. - pull-requests: read # Optional: allow write access to checks to allow the action to annotate code in the PR. checks: write From b8ba99a7b2dbf576b354be4ae7e3f038da625ab1 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:29:11 -0400 Subject: [PATCH 15/43] fix --- .github/workflows/ci-lint.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 8d3379d0bb..ec258ae10d 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -15,12 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. - - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - cache-dependency-path: go.sum - cache: true + fetch-depth: 0 - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 From c9e334e32a8508b3111d84c7caa4d4abfc66f81b Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:32:02 -0400 Subject: [PATCH 16/43] fix --- .github/workflows/ci-lint.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index ec258ae10d..e27595d70b 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -19,8 +19,9 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 - files: | - *.go + with: + files: | + *.go - name: List all changed files env: From 93dcbaaa3cd76133677f967f82da32dd476f5103 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:32:47 -0400 Subject: [PATCH 17/43] try again --- .github/workflows/ci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index e27595d70b..924ef85a55 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: 1 - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 From f89b54de1e3569ae17de2b898a43c695591a993e Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:33:45 -0400 Subject: [PATCH 18/43] what? --- .github/workflows/ci-lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 924ef85a55..1700b431df 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 1 + fetch-depth: 2 - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 From 7f4f9e731771a4bf9d841ce8a7907217d57ded3d Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:35:52 -0400 Subject: [PATCH 19/43] what...? --- .github/workflows/ci-lint.yml | 40 ++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 1700b431df..5d7c075d77 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 2 + fetch-depth: 0 - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 @@ -24,24 +24,44 @@ jobs: *.go - name: List all changed files - env: - ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | - for file in ${ALL_CHANGED_FILES}; do + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do echo "$file was changed" done - - - - name: Load Version - id: load-version + - name: Prepare Lint Args + id: prepare-lint-args run: | - echo "GOLANGCI_VERSION=v$(cat .golangci-version)" + # Extract changed Go files and format them for golangci-lint + changed_files="${{ steps.changed-files.outputs.all_changed_files }}" + if [ -z "$changed_files" ]; then + echo "No Go files changed, skipping golangci-lint." + exit 0 + fi + echo "Changed Go files:" + echo "$changed_files" + # Prepare arguments for golangci-lint + lint_args=$(echo "$changed_files" | tr '\n' ' ') + echo "lint_args=$lint_args" >> $GITHUB_ENV - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: version: ${{ steps.load-version.outputs.GOLANGCI_VERSION }} - args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 + args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 ${{ env.lint_args }} working-directory: ${{ github.workspace }} if: | contains(steps.changed-files.outputs.all_changed_files, '.go') + +# - name: Load Version +# id: load-version +# run: | +# echo "GOLANGCI_VERSION=v$(cat .golangci-version)" +# +# - name: golangci-lint +# uses: golangci/golangci-lint-action@v6 +# with: +# version: ${{ steps.load-version.outputs.GOLANGCI_VERSION }} +# args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 +# working-directory: ${{ github.workspace }} +# if: | +# contains(steps.changed-files.outputs.all_changed_files, '.go') From 8b7447744bc4a0c79982cfbf49cd2483f0e29a65 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:37:41 -0400 Subject: [PATCH 20/43] hm? --- app/app.go | 1 - 1 file changed, 1 deletion(-) diff --git a/app/app.go b/app/app.go index 35ab87a290..6d74a270da 100644 --- a/app/app.go +++ b/app/app.go @@ -676,7 +676,6 @@ func NewApp( app.stakingKeeper, &app.distrKeeper, ) - savingsKeeper := savingskeeper.NewKeeper( appCodec, keys[savingstypes.StoreKey], From aacd007626d0b043e4b63188f2bc3ce2d6f34f80 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:39:25 -0400 Subject: [PATCH 21/43] hm? --- .github/workflows/ci-lint.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 5d7c075d77..7d6157b452 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -20,8 +20,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v44 with: - files: | - *.go + files: '**/*.go' # Ensure the pattern is correct - name: List all changed files run: | From 43507bbb23bf33f6f855e7125a85b1bb71966daa Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:41:02 -0400 Subject: [PATCH 22/43] hm? --- .github/workflows/ci-lint.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 7d6157b452..c60a0dfbff 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -19,8 +19,6 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 - with: - files: '**/*.go' # Ensure the pattern is correct - name: List all changed files run: | @@ -39,8 +37,9 @@ jobs: echo "Changed Go files:" echo "$changed_files" # Prepare arguments for golangci-lint - lint_args=$(echo "$changed_files" | tr '\n' ' ') - echo "lint_args=$lint_args" >> $GITHUB_ENV + # Filter only Go files + go_files=$(echo "$changed_files" | grep '\.go$' | tr '\n' ' ') + echo "go_files=$go_files" >> $GITHUB_ENV - name: golangci-lint uses: golangci/golangci-lint-action@v6 From c9d10879e59bca1723a40c4f7ab069a923c11817 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:42:31 -0400 Subject: [PATCH 23/43] refactor --- .github/workflows/ci-lint.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index c60a0dfbff..e12141826a 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -18,18 +18,26 @@ jobs: fetch-depth: 0 - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v44 + run: | + # Fetch the full history to ensure we can compare commits + git fetch --prune --unshallow + # List changed files in the last commit + changed_files=$(git diff --name-only HEAD^ HEAD | grep '\.go$') + echo "Changed Go files:" + echo "$changed_files" + # Set the changed files as an output + echo "changed_go_files=$changed_files" >> $GITHUB_ENV + echo "::set-output name=changed_go_files::$changed_files" - name: List all changed files run: | - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + for file in ${{ env.changed_go_files }}; do echo "$file was changed" done - name: Prepare Lint Args id: prepare-lint-args run: | - # Extract changed Go files and format them for golangci-lint - changed_files="${{ steps.changed-files.outputs.all_changed_files }}" + changed_files="${{ env.changed_go_files }}" if [ -z "$changed_files" ]; then echo "No Go files changed, skipping golangci-lint." exit 0 @@ -37,9 +45,8 @@ jobs: echo "Changed Go files:" echo "$changed_files" # Prepare arguments for golangci-lint - # Filter only Go files - go_files=$(echo "$changed_files" | grep '\.go$' | tr '\n' ' ') - echo "go_files=$go_files" >> $GITHUB_ENV + lint_args=$(echo "$changed_files" | tr '\n' ' ') + echo "lint_args=$lint_args" >> $GITHUB_ENV - name: golangci-lint uses: golangci/golangci-lint-action@v6 @@ -48,7 +55,7 @@ jobs: args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 ${{ env.lint_args }} working-directory: ${{ github.workspace }} if: | - contains(steps.changed-files.outputs.all_changed_files, '.go') + contains(env.changed_go_files, '.go') # - name: Load Version # id: load-version From 157baba91bae8ee016d0fa1887777a00cadb2c81 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:45:07 -0400 Subject: [PATCH 24/43] werid --- .github/workflows/ci-lint.yml | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index e12141826a..13d1dae3c7 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -13,31 +13,26 @@ jobs: golangci-lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 with: fetch-depth: 0 - name: Get changed files id: changed-files - run: | - # Fetch the full history to ensure we can compare commits - git fetch --prune --unshallow - # List changed files in the last commit - changed_files=$(git diff --name-only HEAD^ HEAD | grep '\.go$') - echo "Changed Go files:" - echo "$changed_files" - # Set the changed files as an output - echo "changed_go_files=$changed_files" >> $GITHUB_ENV - echo "::set-output name=changed_go_files::$changed_files" - + uses: tj-actions/changed-files@v44 + with: + files: | + **/*.go - name: List all changed files run: | - for file in ${{ env.changed_go_files }}; do + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do echo "$file was changed" done - name: Prepare Lint Args id: prepare-lint-args run: | - changed_files="${{ env.changed_go_files }}" + # Extract changed Go files and format them for golangci-lint + changed_files="${{ steps.changed-files.outputs.all_changed_files }}" if [ -z "$changed_files" ]; then echo "No Go files changed, skipping golangci-lint." exit 0 @@ -55,7 +50,7 @@ jobs: args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 ${{ env.lint_args }} working-directory: ${{ github.workspace }} if: | - contains(env.changed_go_files, '.go') + contains(steps.changed-files.outputs.all_changed_files, '.go') # - name: Load Version # id: load-version From 632c7b57d9bf54f874fc726d15547eb69234568e Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:47:05 -0400 Subject: [PATCH 25/43] ok --- .github/workflows/ci-lint.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 13d1dae3c7..f392a5ca2d 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -20,9 +20,6 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 - with: - files: | - **/*.go - name: List all changed files run: | for file in ${{ steps.changed-files.outputs.all_changed_files }}; do @@ -40,14 +37,15 @@ jobs: echo "Changed Go files:" echo "$changed_files" # Prepare arguments for golangci-lint - lint_args=$(echo "$changed_files" | tr '\n' ' ') - echo "lint_args=$lint_args" >> $GITHUB_ENV + # Filter only Go files + go_files=$(echo "$changed_files" | grep '\.go$' | tr '\n' ' ') + echo "go_files=$go_files" >> $GITHUB_ENV - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: version: ${{ steps.load-version.outputs.GOLANGCI_VERSION }} - args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 ${{ env.lint_args }} + args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 ${{ env.go_files }} working-directory: ${{ github.workspace }} if: | contains(steps.changed-files.outputs.all_changed_files, '.go') From 6848324d09fb65a423c1960addfa15d445e2daab Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:49:38 -0400 Subject: [PATCH 26/43] go go go --- .github/workflows/ci-lint.yml | 2 +- app/app.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index f392a5ca2d..53a8bd153e 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: 0 + fetch-depth: '0' - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 diff --git a/app/app.go b/app/app.go index 6d74a270da..35ab87a290 100644 --- a/app/app.go +++ b/app/app.go @@ -676,6 +676,7 @@ func NewApp( app.stakingKeeper, &app.distrKeeper, ) + savingsKeeper := savingskeeper.NewKeeper( appCodec, keys[savingstypes.StoreKey], From 482236615e4d06a59d6f18db52e1a6a5c7f06d04 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:51:38 -0400 Subject: [PATCH 27/43] go --- .github/workflows/ci-lint.yml | 2 +- app/app.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 53a8bd153e..ce8ccd7ca7 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -38,7 +38,7 @@ jobs: echo "$changed_files" # Prepare arguments for golangci-lint # Filter only Go files - go_files=$(echo "$changed_files" | grep '\.go$' | tr '\n' ' ') + go_files=$(find . -name '*.go' -print | tr '\n' ' ') echo "go_files=$go_files" >> $GITHUB_ENV - name: golangci-lint diff --git a/app/app.go b/app/app.go index 35ab87a290..d04086c913 100644 --- a/app/app.go +++ b/app/app.go @@ -676,7 +676,6 @@ func NewApp( app.stakingKeeper, &app.distrKeeper, ) - savingsKeeper := savingskeeper.NewKeeper( appCodec, keys[savingstypes.StoreKey], @@ -685,6 +684,7 @@ func NewApp( app.bankKeeper, app.liquidKeeper, ) + earnKeeper := earnkeeper.NewKeeper( appCodec, keys[earntypes.StoreKey], From 1003a08fb3c2e84101928aba9cce317443b6d20d Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 13:55:36 -0400 Subject: [PATCH 28/43] go --- .github/workflows/ci-lint.yml | 2 +- app/ante/ante.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index ce8ccd7ca7..bfaffa8a88 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -45,7 +45,7 @@ jobs: uses: golangci/golangci-lint-action@v6 with: version: ${{ steps.load-version.outputs.GOLANGCI_VERSION }} - args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 ${{ env.go_files }} + args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 working-directory: ${{ github.workspace }} if: | contains(steps.changed-files.outputs.all_changed_files, '.go') diff --git a/app/ante/ante.go b/app/ante/ante.go index abc1db32b1..646139d3f3 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -175,6 +175,7 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler { evmante.NewEthIncrementSenderSequenceDecorator(options.AccountKeeper), // innermost AnteDecorator. evmante.NewEthEmitEventDecorator(options.EvmKeeper), // emit eth tx hash and index at the very last ante handler. ) + } func Recover(logger tmlog.Logger, err *error) { From 3c92d962679a5dd0cd0b56ea56818f5156932f3d Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 14:36:35 -0400 Subject: [PATCH 29/43] hm --- .github/workflows/ci-lint.yml | 23 +---------------------- app/params/encoding.go | 2 +- app/params/params.go | 9 +++++---- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index bfaffa8a88..aaa2dfedef 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -16,31 +16,10 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: '0' + fetch-depth: '1' - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 - - name: List all changed files - run: | - for file in ${{ steps.changed-files.outputs.all_changed_files }}; do - echo "$file was changed" - done - - name: Prepare Lint Args - id: prepare-lint-args - run: | - # Extract changed Go files and format them for golangci-lint - changed_files="${{ steps.changed-files.outputs.all_changed_files }}" - if [ -z "$changed_files" ]; then - echo "No Go files changed, skipping golangci-lint." - exit 0 - fi - echo "Changed Go files:" - echo "$changed_files" - # Prepare arguments for golangci-lint - # Filter only Go files - go_files=$(find . -name '*.go' -print | tr '\n' ' ') - echo "go_files=$go_files" >> $GITHUB_ENV - - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: diff --git a/app/params/encoding.go b/app/params/encoding.go index 2e030a2051..589897a6e1 100644 --- a/app/params/encoding.go +++ b/app/params/encoding.go @@ -16,7 +16,7 @@ type EncodingConfig struct { Amino *codec.LegacyAmino } -// MakeEncodingConfig creates a new EncodingConfig. +// MakeEncodingConfigBlah creates a new EncodingConfig. func MakeEncodingConfig() EncodingConfig { amino := codec.NewLegacyAmino() interfaceRegistry := types.NewInterfaceRegistry() diff --git a/app/params/params.go b/app/params/params.go index 675dbe4182..4d1056d518 100644 --- a/app/params/params.go +++ b/app/params/params.go @@ -10,10 +10,11 @@ const ( // Default simulation operation weights for messages and gov proposals const ( - DefaultWeightMsgPlaceBid int = 20 - DefaultWeightMsgCreateAtomicSwap int = 20 - DefaultWeightMsgUpdatePrices int = 20 - DefaultWeightMsgCdp int = 20 + DefaultWeightMsgPlaceBid int = 20 + DefaultWeightMsgCreateAtomicSwap int = 20 + DefaultWeightMsgUpdatePrices int = 20 + DefaultWeightMsgCdp int = 20 + DefaultWeightMsgClaimReward int = 20 DefaultWeightMsgDeposit int = 20 DefaultWeightMsgWithdraw int = 20 From d74e3252dc137eec2c8b8d0edf978d533a7a1336 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 14:42:01 -0400 Subject: [PATCH 30/43] tests --- .github/workflows/ci-lint.yml | 36 ++++++++++++++++++++++++++++++++++- app/params/encoding.go | 2 +- app/params/params.go | 9 ++++----- 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index aaa2dfedef..2dbde591e0 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -28,7 +28,41 @@ jobs: working-directory: ${{ github.workspace }} if: | contains(steps.changed-files.outputs.all_changed_files, '.go') - + golang-test: + name: go test + runs-on: ubuntu-latest + if: | + contains(needs.changed_files.outputs.changed_files, '.go') || + contains(needs.changed_files.outputs.changed_files, 'go.sum') || + ( + contains(needs.changed_files.outputs.changed_files, '.yml') || + contains(needs.changed_files.outputs.changed_files, '.yaml') + ) + && + ( + contains(needs.changed_files.outputs.changed_files, 'app') || + contains(needs.changed_files.outputs.changed_files, 'client') || + contains(needs.changed_files.outputs.changed_files, 'cmd') || + contains(needs.changed_files.outputs.changed_files, 'migrate') || + contains(needs.changed_files.outputs.changed_files, 'tests') || + contains(needs.changed_files.outputs.changed_files, 'x') + ) + env: + COVERAGE_DIR: out/coverage/unit/go + COVERAGE_PATH: out/coverage/unit/go/cover.out + FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out + HTML_REPORT: out/coverage/unit/go/go-unit-cover.html + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup + uses: ./.github/actions/setup_go + - name: Go Test + run: | + mkdir -p ${{ env.COVERAGE_DIR }} + readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') + half_nproc=$(( $(nproc --all) / 2 )) + printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race # - name: Load Version # id: load-version # run: | diff --git a/app/params/encoding.go b/app/params/encoding.go index 589897a6e1..2e030a2051 100644 --- a/app/params/encoding.go +++ b/app/params/encoding.go @@ -16,7 +16,7 @@ type EncodingConfig struct { Amino *codec.LegacyAmino } -// MakeEncodingConfigBlah creates a new EncodingConfig. +// MakeEncodingConfig creates a new EncodingConfig. func MakeEncodingConfig() EncodingConfig { amino := codec.NewLegacyAmino() interfaceRegistry := types.NewInterfaceRegistry() diff --git a/app/params/params.go b/app/params/params.go index 4d1056d518..675dbe4182 100644 --- a/app/params/params.go +++ b/app/params/params.go @@ -10,11 +10,10 @@ const ( // Default simulation operation weights for messages and gov proposals const ( - DefaultWeightMsgPlaceBid int = 20 - DefaultWeightMsgCreateAtomicSwap int = 20 - DefaultWeightMsgUpdatePrices int = 20 - DefaultWeightMsgCdp int = 20 - + DefaultWeightMsgPlaceBid int = 20 + DefaultWeightMsgCreateAtomicSwap int = 20 + DefaultWeightMsgUpdatePrices int = 20 + DefaultWeightMsgCdp int = 20 DefaultWeightMsgClaimReward int = 20 DefaultWeightMsgDeposit int = 20 DefaultWeightMsgWithdraw int = 20 From dd3e6519f3a3ee906258833bb9ab259fe16a1e28 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 14:46:33 -0400 Subject: [PATCH 31/43] fix --- .github/workflows/ci-lint.yml | 2 +- app/app.go | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 2dbde591e0..4d863a3ba7 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -16,7 +16,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: '1' + fetch-depth: '0' - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 diff --git a/app/app.go b/app/app.go index d04086c913..6d74a270da 100644 --- a/app/app.go +++ b/app/app.go @@ -684,7 +684,6 @@ func NewApp( app.bankKeeper, app.liquidKeeper, ) - earnKeeper := earnkeeper.NewKeeper( appCodec, keys[earntypes.StoreKey], From ca2764cbf327a3fe6ca8b1b1d7aa726f968eac0f Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 14:48:27 -0400 Subject: [PATCH 32/43] put back --- .github/workflows/ci-lint.yml | 33 ++++++++++----------------------- app/ante/ante.go | 1 - 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 4d863a3ba7..c2af9a99dd 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -32,20 +32,20 @@ jobs: name: go test runs-on: ubuntu-latest if: | - contains(needs.changed_files.outputs.changed_files, '.go') || - contains(needs.changed_files.outputs.changed_files, 'go.sum') || + contains(steps.changed-files.outputs.changed_files, '.go') || + contains(steps.changed-files.outputs.changed_files, 'go.sum') || ( - contains(needs.changed_files.outputs.changed_files, '.yml') || - contains(needs.changed_files.outputs.changed_files, '.yaml') + contains(steps.changed-files.outputs.changed_files, '.yml') || + contains(steps.changed-files.outputs.changed_files, '.yaml') ) && ( - contains(needs.changed_files.outputs.changed_files, 'app') || - contains(needs.changed_files.outputs.changed_files, 'client') || - contains(needs.changed_files.outputs.changed_files, 'cmd') || - contains(needs.changed_files.outputs.changed_files, 'migrate') || - contains(needs.changed_files.outputs.changed_files, 'tests') || - contains(needs.changed_files.outputs.changed_files, 'x') + contains(steps.changed-files.outputs.changed_files, 'app') || + contains(steps.changed-files.outputs.changed_files, 'client') || + contains(steps.changed-files.outputs.changed_files, 'cmd') || + contains(steps.changed-files.outputs.changed_files, 'migrate') || + contains(steps.changed-files.outputs.changed_files, 'tests') || + contains(steps.changed-files.outputs.changed_files, 'x') ) env: COVERAGE_DIR: out/coverage/unit/go @@ -63,16 +63,3 @@ jobs: readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') half_nproc=$(( $(nproc --all) / 2 )) printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race -# - name: Load Version -# id: load-version -# run: | -# echo "GOLANGCI_VERSION=v$(cat .golangci-version)" -# -# - name: golangci-lint -# uses: golangci/golangci-lint-action@v6 -# with: -# version: ${{ steps.load-version.outputs.GOLANGCI_VERSION }} -# args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 -# working-directory: ${{ github.workspace }} -# if: | -# contains(steps.changed-files.outputs.all_changed_files, '.go') diff --git a/app/ante/ante.go b/app/ante/ante.go index 646139d3f3..abc1db32b1 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -175,7 +175,6 @@ func newEthAnteHandler(options HandlerOptions) sdk.AnteHandler { evmante.NewEthIncrementSenderSequenceDecorator(options.AccountKeeper), // innermost AnteDecorator. evmante.NewEthEmitEventDecorator(options.EvmKeeper), // emit eth tx hash and index at the very last ante handler. ) - } func Recover(logger tmlog.Logger, err *error) { From b19f97ea29aebceba00d83aefb7cee520b46814f Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 14:54:51 -0400 Subject: [PATCH 33/43] fix --- .github/workflows/ci-lint.yml | 25 +++++++++++++++++++++++-- app/ante/ante.go | 1 + 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index c2af9a99dd..270fe3b12e 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -20,6 +20,10 @@ jobs: - name: Get changed files id: changed-files uses: tj-actions/changed-files@v44 + - name: Load Version + id: load-version + run: | + echo "GOLANGCI_VERSION=v$(cat .golangci-version)" - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: @@ -28,6 +32,19 @@ jobs: working-directory: ${{ github.workspace }} if: | contains(steps.changed-files.outputs.all_changed_files, '.go') + golang-sec: + runs-on: ubuntu-latest + env: + GO111MODULE: on + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Run Gosec Security Scanner + uses: cosmos/gosec@master + with: + args: ./... golang-test: name: go test runs-on: ubuntu-latest @@ -55,8 +72,12 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Setup - uses: ./.github/actions/setup_go + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache-dependency-path: go.sum + cache: true - name: Go Test run: | mkdir -p ${{ env.COVERAGE_DIR }} diff --git a/app/ante/ante.go b/app/ante/ante.go index abc1db32b1..e44c231684 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -134,6 +134,7 @@ func newCosmosAnteHandler(options cosmosHandlerOptions) sdk.AnteHandler { var sigVerification sdk.AnteDecorator = authante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler) if options.isEIP712 { + sigVerification = evmante.NewLegacyEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler, options.EvmKeeper) } From ffee5b0ab801bf07707f81db19416211c9027fb5 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 14:55:59 -0400 Subject: [PATCH 34/43] hm --- .github/workflows/ci-lint.yml | 24 +++++++++++------------- app/ante/ante.go | 1 - 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 270fe3b12e..0ab6c6c2f8 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -32,19 +32,17 @@ jobs: working-directory: ${{ github.workspace }} if: | contains(steps.changed-files.outputs.all_changed_files, '.go') - golang-sec: - runs-on: ubuntu-latest - env: - GO111MODULE: on - steps: - - name: Checkout code - uses: actions/checkout@v4 - with: - fetch-depth: '0' - - name: Run Gosec Security Scanner - uses: cosmos/gosec@master - with: - args: ./... +# golang-sec: +# runs-on: ubuntu-latest +# steps: +# - name: Checkout code +# uses: actions/checkout@v4 +# with: +# fetch-depth: '0' +# - name: Run Gosec Security Scanner +# uses: cosmos/gosec@master +# with: +# args: ./... golang-test: name: go test runs-on: ubuntu-latest diff --git a/app/ante/ante.go b/app/ante/ante.go index e44c231684..abc1db32b1 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -134,7 +134,6 @@ func newCosmosAnteHandler(options cosmosHandlerOptions) sdk.AnteHandler { var sigVerification sdk.AnteDecorator = authante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler) if options.isEIP712 { - sigVerification = evmante.NewLegacyEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler, options.EvmKeeper) } From 5b0dfb72dd423616405d334f6293c0733974a9df Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 14:57:08 -0400 Subject: [PATCH 35/43] what --- .github/workflows/ci-lint.yml | 77 +++++++++++++++++------------------ 1 file changed, 38 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 0ab6c6c2f8..1613205fe9 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -43,42 +43,41 @@ jobs: # uses: cosmos/gosec@master # with: # args: ./... - golang-test: - name: go test - runs-on: ubuntu-latest - if: | - contains(steps.changed-files.outputs.changed_files, '.go') || - contains(steps.changed-files.outputs.changed_files, 'go.sum') || - ( - contains(steps.changed-files.outputs.changed_files, '.yml') || - contains(steps.changed-files.outputs.changed_files, '.yaml') - ) - && - ( - contains(steps.changed-files.outputs.changed_files, 'app') || - contains(steps.changed-files.outputs.changed_files, 'client') || - contains(steps.changed-files.outputs.changed_files, 'cmd') || - contains(steps.changed-files.outputs.changed_files, 'migrate') || - contains(steps.changed-files.outputs.changed_files, 'tests') || - contains(steps.changed-files.outputs.changed_files, 'x') - ) - env: - COVERAGE_DIR: out/coverage/unit/go - COVERAGE_PATH: out/coverage/unit/go/cover.out - FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out - HTML_REPORT: out/coverage/unit/go/go-unit-cover.html - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - cache-dependency-path: go.sum - cache: true - - name: Go Test - run: | - mkdir -p ${{ env.COVERAGE_DIR }} - readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') - half_nproc=$(( $(nproc --all) / 2 )) - printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race +# golang-test: +# name: go test +# runs-on: ubuntu-latest +# if: | +# contains(steps.changed-files.outputs.changed_files, '.go') || +# contains(steps.changed-files.outputs.changed_files, 'go.sum') || +# ( +# contains(steps.changed-files.outputs.changed_files, '.yml') || +# contains(steps.changed-files.outputs.changed_files, '.yaml') +# ) +# && +# ( +# contains(steps.changed-files.outputs.changed_files, 'app') || +# contains(steps.changed-files.outputs.changed_files, 'client') || +# contains(steps.changed-files.outputs.changed_files, 'cmd') || +# contains(steps.changed-files.outputs.changed_files, 'migrate') || +# contains(steps.changed-files.outputs.changed_files, 'tests') || +# contains(steps.changed-files.outputs.changed_files, 'x') +# ) +# env: +# COVERAGE_DIR: out/coverage/unit/go +# COVERAGE_PATH: out/coverage/unit/go/cover.out +# FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out +# HTML_REPORT: out/coverage/unit/go/go-unit-cover.html +# steps: +# - name: Checkout +# uses: actions/checkout@v4 +# - name: Install Go +# uses: actions/setup-go@v5 +# with: +# go-version-file: go.mod +# cache-dependency-path: go.sum +# - name: Go Test +# run: | +# mkdir -p ${{ env.COVERAGE_DIR }} +# readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') +# half_nproc=$(( $(nproc --all) / 2 )) +# printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race From 786202c2ae1b1f2cd0f9f5beef7031ff4720d300 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 14:57:45 -0400 Subject: [PATCH 36/43] go sec --- .github/workflows/ci-lint.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 1613205fe9..d36b892e7c 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -32,17 +32,17 @@ jobs: working-directory: ${{ github.workspace }} if: | contains(steps.changed-files.outputs.all_changed_files, '.go') -# golang-sec: -# runs-on: ubuntu-latest -# steps: -# - name: Checkout code -# uses: actions/checkout@v4 -# with: -# fetch-depth: '0' -# - name: Run Gosec Security Scanner -# uses: cosmos/gosec@master -# with: -# args: ./... + golang-sec: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: '0' + - name: Run Gosec Security Scanner + uses: cosmos/gosec@master + with: + args: ./... # golang-test: # name: go test # runs-on: ubuntu-latest From f75baf1d1da635ca15759866f983de075cd47687 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 14:59:11 -0400 Subject: [PATCH 37/43] tests --- .github/workflows/ci-lint.yml | 43 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index d36b892e7c..b90e2c0512 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -43,9 +43,8 @@ jobs: uses: cosmos/gosec@master with: args: ./... -# golang-test: -# name: go test -# runs-on: ubuntu-latest + golang-test: + runs-on: ubuntu-latest # if: | # contains(steps.changed-files.outputs.changed_files, '.go') || # contains(steps.changed-files.outputs.changed_files, 'go.sum') || @@ -62,22 +61,22 @@ jobs: # contains(steps.changed-files.outputs.changed_files, 'tests') || # contains(steps.changed-files.outputs.changed_files, 'x') # ) -# env: -# COVERAGE_DIR: out/coverage/unit/go -# COVERAGE_PATH: out/coverage/unit/go/cover.out -# FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out -# HTML_REPORT: out/coverage/unit/go/go-unit-cover.html -# steps: -# - name: Checkout -# uses: actions/checkout@v4 -# - name: Install Go -# uses: actions/setup-go@v5 -# with: -# go-version-file: go.mod -# cache-dependency-path: go.sum -# - name: Go Test -# run: | -# mkdir -p ${{ env.COVERAGE_DIR }} -# readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') -# half_nproc=$(( $(nproc --all) / 2 )) -# printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race + env: + COVERAGE_DIR: out/coverage/unit/go + COVERAGE_PATH: out/coverage/unit/go/cover.out + FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out + HTML_REPORT: out/coverage/unit/go/go-unit-cover.html + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache-dependency-path: go.sum + - name: Go Test + run: | + mkdir -p ${{ env.COVERAGE_DIR }} + readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') + half_nproc=$(( $(nproc --all) / 2 )) + printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race From 20a2905e701875b160945333b4c566bec486d007 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 15:00:42 -0400 Subject: [PATCH 38/43] go --- .github/workflows/ci-lint.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index b90e2c0512..8e1360fc67 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -17,9 +17,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: '0' - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v44 - name: Load Version id: load-version run: | From a5849a55090990f430d006b0638554eca8d6aa3d Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 15:05:00 -0400 Subject: [PATCH 39/43] here --- .github/workflows/ci-lint.yml | 38 ++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 8e1360fc67..2ccb339eba 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -17,6 +17,9 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: '0' + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v44 - name: Load Version id: load-version run: | @@ -42,22 +45,22 @@ jobs: args: ./... golang-test: runs-on: ubuntu-latest -# if: | -# contains(steps.changed-files.outputs.changed_files, '.go') || -# contains(steps.changed-files.outputs.changed_files, 'go.sum') || -# ( -# contains(steps.changed-files.outputs.changed_files, '.yml') || -# contains(steps.changed-files.outputs.changed_files, '.yaml') -# ) -# && -# ( -# contains(steps.changed-files.outputs.changed_files, 'app') || -# contains(steps.changed-files.outputs.changed_files, 'client') || -# contains(steps.changed-files.outputs.changed_files, 'cmd') || -# contains(steps.changed-files.outputs.changed_files, 'migrate') || -# contains(steps.changed-files.outputs.changed_files, 'tests') || -# contains(steps.changed-files.outputs.changed_files, 'x') -# ) + if: | + contains(steps.changed-files.outputs.changed_files, '.go') || + contains(steps.changed-files.outputs.changed_files, 'go.sum') || + ( + contains(steps.changed-files.outputs.changed_files, '.yml') || + contains(steps.changed-files.outputs.changed_files, '.yaml') + ) + && + ( + contains(steps.changed-files.outputs.changed_files, 'app') || + contains(steps.changed-files.outputs.changed_files, 'client') || + contains(steps.changed-files.outputs.changed_files, 'cmd') || + contains(steps.changed-files.outputs.changed_files, 'migrate') || + contains(steps.changed-files.outputs.changed_files, 'tests') || + contains(steps.changed-files.outputs.changed_files, 'x') + ) env: COVERAGE_DIR: out/coverage/unit/go COVERAGE_PATH: out/coverage/unit/go/cover.out @@ -66,6 +69,9 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v44 - name: Install Go uses: actions/setup-go@v5 with: From ad79dcd6262e1fad10bbbd3ee70490508f50793e Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 15:05:14 -0400 Subject: [PATCH 40/43] fix --- app/ante/ante.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/ante/ante.go b/app/ante/ante.go index abc1db32b1..e44c231684 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -134,6 +134,7 @@ func newCosmosAnteHandler(options cosmosHandlerOptions) sdk.AnteHandler { var sigVerification sdk.AnteDecorator = authante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler) if options.isEIP712 { + sigVerification = evmante.NewLegacyEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler, options.EvmKeeper) } From 9a2b98ab0aa9ff2ac2f7d13ed0b9a90133eecdf4 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 15:12:41 -0400 Subject: [PATCH 41/43] what --- .github/workflows/ci-lint.yml | 35 ++++++++++++++++------------------- app/ante/ante.go | 1 - 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 2ccb339eba..b90e2c0512 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -45,22 +45,22 @@ jobs: args: ./... golang-test: runs-on: ubuntu-latest - if: | - contains(steps.changed-files.outputs.changed_files, '.go') || - contains(steps.changed-files.outputs.changed_files, 'go.sum') || - ( - contains(steps.changed-files.outputs.changed_files, '.yml') || - contains(steps.changed-files.outputs.changed_files, '.yaml') - ) - && - ( - contains(steps.changed-files.outputs.changed_files, 'app') || - contains(steps.changed-files.outputs.changed_files, 'client') || - contains(steps.changed-files.outputs.changed_files, 'cmd') || - contains(steps.changed-files.outputs.changed_files, 'migrate') || - contains(steps.changed-files.outputs.changed_files, 'tests') || - contains(steps.changed-files.outputs.changed_files, 'x') - ) +# if: | +# contains(steps.changed-files.outputs.changed_files, '.go') || +# contains(steps.changed-files.outputs.changed_files, 'go.sum') || +# ( +# contains(steps.changed-files.outputs.changed_files, '.yml') || +# contains(steps.changed-files.outputs.changed_files, '.yaml') +# ) +# && +# ( +# contains(steps.changed-files.outputs.changed_files, 'app') || +# contains(steps.changed-files.outputs.changed_files, 'client') || +# contains(steps.changed-files.outputs.changed_files, 'cmd') || +# contains(steps.changed-files.outputs.changed_files, 'migrate') || +# contains(steps.changed-files.outputs.changed_files, 'tests') || +# contains(steps.changed-files.outputs.changed_files, 'x') +# ) env: COVERAGE_DIR: out/coverage/unit/go COVERAGE_PATH: out/coverage/unit/go/cover.out @@ -69,9 +69,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v44 - name: Install Go uses: actions/setup-go@v5 with: diff --git a/app/ante/ante.go b/app/ante/ante.go index e44c231684..abc1db32b1 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -134,7 +134,6 @@ func newCosmosAnteHandler(options cosmosHandlerOptions) sdk.AnteHandler { var sigVerification sdk.AnteDecorator = authante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler) if options.isEIP712 { - sigVerification = evmante.NewLegacyEip712SigVerificationDecorator(options.AccountKeeper, options.SignModeHandler, options.EvmKeeper) } From 27cbeadab4ae1f0d87dbaa9122366e77500fd27a Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 15:28:58 -0400 Subject: [PATCH 42/43] update --- .github/workflows/ci-lint.yml | 41 ++++------------------------------- Makefile | 5 +++++ 2 files changed, 9 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index b90e2c0512..347a33a905 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -12,6 +12,10 @@ jobs: uses: ./.github/workflows/proto.yml golangci-lint: runs-on: ubuntu-latest + permissions: + contents: read # to download code coverage results from unit_tests job + pull-requests: write # write permission needed to comment on PR + checks: write steps: - name: Checkout code uses: actions/checkout@v4 @@ -43,40 +47,3 @@ jobs: uses: cosmos/gosec@master with: args: ./... - golang-test: - runs-on: ubuntu-latest -# if: | -# contains(steps.changed-files.outputs.changed_files, '.go') || -# contains(steps.changed-files.outputs.changed_files, 'go.sum') || -# ( -# contains(steps.changed-files.outputs.changed_files, '.yml') || -# contains(steps.changed-files.outputs.changed_files, '.yaml') -# ) -# && -# ( -# contains(steps.changed-files.outputs.changed_files, 'app') || -# contains(steps.changed-files.outputs.changed_files, 'client') || -# contains(steps.changed-files.outputs.changed_files, 'cmd') || -# contains(steps.changed-files.outputs.changed_files, 'migrate') || -# contains(steps.changed-files.outputs.changed_files, 'tests') || -# contains(steps.changed-files.outputs.changed_files, 'x') -# ) - env: - COVERAGE_DIR: out/coverage/unit/go - COVERAGE_PATH: out/coverage/unit/go/cover.out - FORMATTED_REPORT: out/coverage/unit/go/go-unit-cover.out - HTML_REPORT: out/coverage/unit/go/go-unit-cover.html - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install Go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - cache-dependency-path: go.sum - - name: Go Test - run: | - mkdir -p ${{ env.COVERAGE_DIR }} - readarray -t test_dirs < <(find * -name "*_test.go" -exec dirname {} \; | sort | uniq | grep -v -e '^\.$') - half_nproc=$(( $(nproc --all) / 2 )) - printf '%s\0' "${test_dirs[@]}" | xargs -0 -P $half_nproc -n 1 -I {} go test "./{}" -race diff --git a/Makefile b/Makefile index 3ede6be40f..27195308c6 100644 --- a/Makefile +++ b/Makefile @@ -314,6 +314,11 @@ test-ibc: docker-build test: @$(GO_BIN) test $$($(GO_BIN) list ./... | grep -v 'contrib' | grep -v 'tests/e2e') +coverage: + @mkdir -p out + @$(GO_BIN) test -v -coverprofile=out/coverage.out $$($(GO_BIN) list ./... | grep -v 'contrib' | grep -v 'tests/e2e') + @$(GO_BIN) tool cover -html="out/coverage.out" + # Run cli integration tests # `-p 4` to use 4 cores, `-tags cli_test` to tell $(GO_BIN) not to ignore the cli package # These tests use the `kvd` or `kvcli` binaries in the build dir, or in `$BUILDDIR` if that env var is set. From dd7174065b82af1a2466773f28df6d1ae97b9247 Mon Sep 17 00:00:00 2001 From: Sam Sheffield Date: Thu, 25 Jul 2024 15:30:57 -0400 Subject: [PATCH 43/43] run always --- .github/workflows/ci-lint.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/ci-lint.yml b/.github/workflows/ci-lint.yml index 347a33a905..5c83d00fb0 100644 --- a/.github/workflows/ci-lint.yml +++ b/.github/workflows/ci-lint.yml @@ -20,10 +20,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 with: - fetch-depth: '0' - - name: Get changed files - id: changed-files - uses: tj-actions/changed-files@v44 + fetch-depth: 0 - name: Load Version id: load-version run: | @@ -34,8 +31,6 @@ jobs: version: ${{ steps.load-version.outputs.GOLANGCI_VERSION }} args: --timeout 30m --verbose --allow-parallel-runners --max-same-issues 0 --max-issues-per-linter 0 working-directory: ${{ github.workspace }} - if: | - contains(steps.changed-files.outputs.all_changed_files, '.go') golang-sec: runs-on: ubuntu-latest steps: