Skip to content

Commit

Permalink
Merge branch 'develop' into fix/hd-path
Browse files Browse the repository at this point in the history
  • Loading branch information
lumtis authored Aug 11, 2023
2 parents a7c2f26 + e82e86a commit 1763f14
Show file tree
Hide file tree
Showing 98 changed files with 7,346 additions and 968 deletions.
51 changes: 9 additions & 42 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ jobs:
skip_python: "true"
skip_aws_cli: "true"
skip_docker_compose: "true"

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

- name: Test
uses: nick-fields/retry@v2
Expand Down Expand Up @@ -128,11 +123,6 @@ jobs:
skip_aws_cli: "true"
skip_docker_compose: "true"

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

# - uses: buildjet/cache
# timeout-minutes: 5
# with:
Expand Down Expand Up @@ -235,28 +225,15 @@ jobs:
git
shell-name: alpine.sh

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

# - name: Test
# shell: alpine.sh --root {0}
# run: |
# echo "Running Build Tests"
# apk add --no-cache --update
# make clean
# make test

- name: Test
uses: nick-fields/retry@v2
with:
timeout_minutes: 20
max_attempts: 2
retry_on: error
shell: alpine.sh --root {0}
command: |
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: ${{ env.CPU_ARCH }}
shell: alpine.sh --root {0}
run: |
echo "Running Build Tests"
apk add --no-cache --update
make clean
make test
Expand Down Expand Up @@ -371,11 +348,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

- name: Install Pipeline Dependencies
uses: ./.github/actions/install-dependencies
timeout-minutes: 8
Expand Down Expand Up @@ -519,11 +491,6 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

- name: Install Pipeline Dependencies
uses: ./.github/actions/install-dependencies
timeout-minutes: 8
Expand Down Expand Up @@ -584,10 +551,10 @@ jobs:
discord_token: "${{ secrets.DISCORD_TOKEN }}"
discord_channel_id: "${{ secrets.DISCORD_CHANNEL_ID }}"
discord_message: |
Hey <@&1122981184255840306>! A new version of the zetachain node has been released.
Hey <@&1122981184255840306>! A new version of the ZetaChain software has been released.
Major Version Upgrade (e.g. v5.x.x to V6.x.x) must be completed through a governance proposal.
We will submit a governance proposal in the next few days with a 12-hour voting period.
We will submit a governance proposal in the next few days.
More specific information including block height will be shared as part of the governance proposal.
See the release notes for more details. https://github.com/zeta-chain/node/releases/tag/${{ env.BINARY_VERSION }}
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/chain-operations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@ jobs:

- name: Install Pipeline Dependencies
uses: ./.github/actions/install-dependencies

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
- name: Install Pipeline Dependencies
uses: ./.github/actions/install-dependencies

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}
# - name: setup-git-credentials
# uses: de-vri-es/setup-git-credentials@v2.0.8
# with:
# credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Generated Go/OpenAPI to Match Protobuf
name: Generated Files are Updated
on:
pull_request:
branches:
Expand All @@ -17,14 +17,20 @@ jobs:
run: |
echo "$HOME/go/bin" >> $GITHUB_PATH
- name: Generate Go and OpenAPI
- name: Generate Go code from proto files
run: make proto

- name: Generate OpenAPI
run: make openapi

- name: Generate Module Documentation
run: make specs

- name: Check for changes
run: |
if git diff --exit-code --ignore-space-change --ignore-all-space --ignore-cr-at-eol; then
echo "Generated Go files are up-to-date."
else
echo "::error::Generated Go and/or OpenAPI files are not up-to-date. Please run 'make proto' locally and commit any changes."
echo "::error::Generated files are not up-to-date. Please run 'make generate' locally and commit any changes."
exit 1
fi
45 changes: 0 additions & 45 deletions .github/workflows/linter.yml

This file was deleted.

56 changes: 38 additions & 18 deletions .github/workflows/gosec.yml → .github/workflows/sast-linters.yml
Original file line number Diff line number Diff line change
@@ -1,35 +1,33 @@
name: Gosec
name: Linters and SAST
on:
push:
tags:
- '*'
- "*"
pull_request:
types:
- opened
- edited
- synchronize

concurrency:
group: linters-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
GOPRIVATE: github.com/zeta-chain/*

jobs:
gosec:
runs-on: ubuntu-latest

env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: setup-git-credentials
uses: de-vri-es/setup-git-credentials@v2.0.8
with:
credentials: ${{ secrets.PAT_GITHUB_SERVICE_ACCT }}

fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
go-version: 1.19

# - name: Install Pipeline Dependencies
# uses: ./.github/actions/install-dependencies
Expand All @@ -42,21 +40,43 @@ jobs:
git-guardian:
runs-on: ubuntu-latest

env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 0

- name: GitGuardian scan
uses: GitGuardian/ggshield-action@master
env:
GITHUB_PUSH_BEFORE_SHA: ${{ github.event.before }}
GITHUB_PUSH_BASE_SHA: ${{ github.event.base }}
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_PULL_BASE_SHA: ${{ github.event.pull_request.base.sha }}
GITHUB_DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
GITGUARDIAN_API_KEY: ${{ secrets.GITGUARDIAN_API_KEY }}


lint:
runs-on: ubuntu-latest
timeout-minutes: 10
env:
GO111MODULE: on
steps:
- name: Checkout Source
uses: actions/checkout@v2

# - name: Install Pipeline Dependencies
# uses: ./.github/actions/install-dependencies

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3

with:
version: v1.50
skip-cache: false
14 changes: 9 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=zetacore \
-X github.com/cosmos/cosmos-sdk/version.ClientName=zetaclientd \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/zeta-chain/zetacore/common.Name=zetacored \
-X github.com/zeta-chain/zetacore/common.Version=$(VERSION) \
-X github.com/zeta-chain/zetacore/common.CommitHash=$(COMMIT) \
-X github.com/zeta-chain/zetacore/common.BuildTime=$(BUILDTIME) \
Expand Down Expand Up @@ -140,18 +141,21 @@ proto:
@find . -name '*.pb.go' -type f -delete
@echo "--> Generating new Go types from protocol buffer files"
@bash ./scripts/protoc-gen-go.sh
.PHONY: proto

openapi:
@echo "--> Generating OpenAPI specs"
@bash ./scripts/protoc-gen-openapi.sh

proto-format:
@bash ./scripts/proto-format.sh

.PHONY: proto
.PHONY: openapi

specs:
@echo "--> Generating module documentation"
@go run ./scripts/gen-spec.go
.PHONY: specs

generate: proto openapi specs
.PHONY: generate

###############################################################################
### Docker Images ###
###############################################################################
Expand Down
18 changes: 18 additions & 0 deletions app/ante/ante_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package ante_test

import sdk "github.com/cosmos/cosmos-sdk/types"

var _ sdk.AnteHandler = (&MockAnteHandler{}).AnteHandle

// MockAnteHandler mocks an AnteHandler
type MockAnteHandler struct {
WasCalled bool
CalledCtx sdk.Context
}

// AnteHandle implements AnteHandler
func (mah *MockAnteHandler) AnteHandle(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) {
mah.WasCalled = true
mah.CalledCtx = ctx
return ctx, nil
}
14 changes: 6 additions & 8 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,16 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
"github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
ibcante "github.com/cosmos/ibc-go/v6/modules/core/ante"
ethante "github.com/evmos/ethermint/app/ante"
ethermint "github.com/evmos/ethermint/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
)

func NewLegacyCosmosAnteHandlerEip712(options ethante.HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ethante.RejectMessagesDecorator{}, // reject MsgEthereumTxs
NewAuthzLimiterDecorator(sdk.MsgTypeURL(&evmtypes.MsgEthereumTx{}), // disable the Msg types that cannot be included on an authz.MsgExec msgs field
sdk.MsgTypeURL(&types.MsgCreateVestingAccount{})),
NewAuthzLimiterDecorator(options.DisabledAuthzMsgs...),
NewVestingAccountDecorator(),
ante.NewSetUpContextDecorator(),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
Expand Down Expand Up @@ -73,8 +71,8 @@ func newEthAnteHandler(options ethante.HandlerOptions) sdk.AnteHandler {
func newCosmosAnteHandler(options ethante.HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ethante.RejectMessagesDecorator{}, // reject MsgEthereumTxs
NewAuthzLimiterDecorator(sdk.MsgTypeURL(&evmtypes.MsgEthereumTx{}), // disable the Msg types that cannot be included on an authz.MsgExec msgs field
sdk.MsgTypeURL(&types.MsgCreateVestingAccount{})),
NewAuthzLimiterDecorator(options.DisabledAuthzMsgs...),
NewVestingAccountDecorator(),
ante.NewSetUpContextDecorator(),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
Expand All @@ -97,8 +95,8 @@ func newCosmosAnteHandler(options ethante.HandlerOptions) sdk.AnteHandler {
func newCosmosAnteHandlerNoGasLimit(options ethante.HandlerOptions) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
ethante.RejectMessagesDecorator{}, // reject MsgEthereumTxs
NewAuthzLimiterDecorator(sdk.MsgTypeURL(&evmtypes.MsgEthereumTx{}), // disable the Msg types that cannot be included on an authz.MsgExec msgs field
sdk.MsgTypeURL(&types.MsgCreateVestingAccount{})),
NewAuthzLimiterDecorator(options.DisabledAuthzMsgs...),
NewVestingAccountDecorator(),
NewSetUpContextDecorator(),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
Expand Down
Loading

0 comments on commit 1763f14

Please sign in to comment.