Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility testing #313

Closed
wants to merge 17 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- run: go build ./...

tidy:
Expand All @@ -34,7 +34,7 @@ jobs:
- name: Setup go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- run: |
go mod tidy
CHANGES_IN_REPO=$(git status --porcelain)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.19
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21

- name: checkout code
uses: actions/checkout@v3
Expand All @@ -54,10 +54,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.19
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21

- name: checkout code
uses: actions/checkout@v3
Expand All @@ -70,10 +70,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.19
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21

- name: checkout code
uses: actions/checkout@v3
Expand All @@ -86,10 +86,10 @@ jobs:
runs-on: ubuntu-latest
needs: build-and-push-image
steps:
- name: Set up Go 1.19
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21

- name: checkout code
uses: actions/checkout@v3
Expand All @@ -102,10 +102,10 @@ jobs:
# runs-on: ubuntu-latest
# needs: build-and-push-image
# steps:
# - name: Set up Go 1.19
# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version: 1.19
# go-version: 1.21

# - name: checkout code
# uses: actions/checkout@v3
Expand All @@ -118,10 +118,10 @@ jobs:
# runs-on: ubuntu-latest
# needs: build-and-push-image
# steps:
# - name: Set up Go 1.19
# - name: Set up Go
# uses: actions/setup-go@v3
# with:
# go-version: 1.19
# go-version: 1.21

# - name: checkout code
# uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.19
go-version: 1.21
- name: Checkout code
uses: actions/checkout@v3
- name: Test
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,4 @@ bin/*
!.vscode/settings.json
.vendor
vendor
go.work
go.work.sum
124 changes: 88 additions & 36 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
run:
tests: true
timeout: 10m
sort-results: true
allow-parallel-runners: true
exclude-dir: testutil/testdata

linters:
disable-all: true
enable:
- dogsled
- exportloopref
- errcheck
- gci
- goconst
- gocritic
- gofumpt
Expand All @@ -19,51 +17,105 @@ linters:
- ineffassign
- misspell
- nakedret
- nolintlint
- staticcheck
- stylecheck
- thelper
- typecheck
- stylecheck
- revive
- typecheck
- tenv
- unconvert
- unparam
- unused
- misspell

issues:
exclude-rules:
- text: "Use of weak random number generator"
- text: 'differs only by capitalization to method'
linters:
- gosec
- text: "ST1003:"
linters:
- stylecheck
# FIXME: Disabled until golangci-lint updates stylecheck with this fix:
# https://github.com/dominikh/go-tools/issues/389
- text: "ST1016:"
linters:
- stylecheck
- path: "migrations"
text: "SA1019:"
- revive
- text: 'Use of weak random number generator'
linters:
- gosec
- linters:
- staticcheck
- text: "leading space"
linters:
- nolintlint
text: "SA1019:" # silence errors on usage of deprecated funcs

max-issues-per-linter: 10000
max-same-issues: 10000

linters-settings:
gofumpt:
# Choose whether to use the extra rules.
module-path: github.com/notional-labs/composable-centauri
# Default: false
extra-rules: true
dogsled:
max-blank-identifiers: 3
maligned:
# print struct with more effective memory layout or not, false by default
suggest-new: true
nolintlint:
allow-unused: false
allow-leading-space: true
require-explanation: false
require-specific: false
gci:
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- blank # blank imports
- dot # dot imports
- prefix(cosmossdk.io)
- prefix(github.com/cosmos/cosmos-sdk)
- prefix(github.com/cometbft/cometbft)
- prefix(github.com/cosmos/ibc-go)
- prefix(github.com/composablefi/composable-cosmos)
custom-order: true
revive:
enable-all-rules: true
# Do NOT whine about the following, full explanation found in:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#description-of-available-rules
rules:
- name: use-any
disabled: true
- name: if-return
disabled: true
- name: max-public-structs
disabled: true
- name: cognitive-complexity
disabled: true
- name: argument-limit
disabled: true
- name: cyclomatic
disabled: true
- name: file-header
disabled: true
- name: function-length
disabled: true
- name: function-result-limit
disabled: true
- name: line-length-limit
disabled: true
- name: flag-parameter
disabled: true
- name: add-constant
disabled: true
- name: empty-lines
disabled: true
- name: banned-characters
disabled: true
- name: deep-exit
disabled: true
- name: confusing-results
disabled: true
- name: unused-parameter
disabled: true
- name: modifies-value-receiver
disabled: true
- name: early-return
disabled: true
- name: confusing-naming
disabled: true
- name: defer
disabled: true
# Disabled in favour of unparam.
- name: unused-parameter
disabled: true
- name: unhandled-error
disabled: false
arguments:
- 'fmt.Printf'
- 'fmt.Print'
- 'fmt.Println'
- 'myFunction'
# Disabled temporarily
- name: import-shadowing
disabled: true
- name: var-naming
disabled: true
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.19"
ARG GO_VERSION="1.21"
ARG RUNNER_IMAGE="gcr.io/distroless/static-debian11"

# --------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.19"
ARG RUNNER_IMAGE="alpine:3.16"
ARG GO_VERSION="1.21"
ARG RUNNER_IMAGE="alpine:3.18"

# --------------------------------------------------------
# Builder
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Centauri

Cosmos blockchain with IBC-v7 and wasm client enable.

## Hardware Recommendation
Expand All @@ -9,12 +10,13 @@ Cosmos blockchain with IBC-v7 and wasm client enable.

## Quick start

Requires [Go 1.19](https://go.dev/doc/install) or higher.
Requires [Go 1.21](https://go.dev/doc/install) or higher.

```bash
make install
centaurid version
```

Then you can run a node with a single command.

```bash
Expand All @@ -26,6 +28,7 @@ If you have Docker installed, then you can run a local node with a single comman
```bash
docker compose up -d
```

and remove all node running with

```bash
Expand Down
19 changes: 10 additions & 9 deletions app/ante/ante.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
package ante

import (
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
tfmwkeeper "github.com/notional-labs/composable/v6/x/transfermiddleware/keeper"
txboundaryante "github.com/notional-labs/composable/v6/x/tx-boundary/ante"
txboundarykeeper "github.com/notional-labs/composable/v6/x/tx-boundary/keeper"

"github.com/cosmos/cosmos-sdk/codec"
servertypes "github.com/cosmos/cosmos-sdk/server/types"
sdk "github.com/cosmos/cosmos-sdk/types"
ante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/signing"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
tfmwKeeper "github.com/notional-labs/composable/v6/x/transfermiddleware/keeper"
txBoundaryAnte "github.com/notional-labs/composable/v6/x/tx-boundary/ante"
txBoundaryKeeper "github.com/notional-labs/composable/v6/x/tx-boundary/keeper"

ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"
)

// Link to default ante handler used by cosmos sdk:
Expand All @@ -26,8 +27,8 @@ func NewAnteHandler(
sigGasConsumer ante.SignatureVerificationGasConsumer,
signModeHandler signing.SignModeHandler,
channelKeeper *ibckeeper.Keeper,
tfmwKeeper tfmwKeeper.Keeper,
txBoundaryKeeper txBoundaryKeeper.Keeper,
tfmwKeeper tfmwkeeper.Keeper,
txBoundaryKeeper txboundarykeeper.Keeper,
codec codec.BinaryCodec,
) sdk.AnteHandler {
return sdk.ChainAnteDecorators(
Expand All @@ -39,7 +40,7 @@ func NewAnteHandler(
ante.NewValidateMemoDecorator(ak),
ante.NewConsumeGasForTxSizeDecorator(ak),
NewIBCPermissionDecorator(codec, tfmwKeeper),
txBoundaryAnte.NewStakingPermissionDecorator(codec, txBoundaryKeeper),
txboundaryante.NewStakingPermissionDecorator(codec, txBoundaryKeeper),
ante.NewSetPubKeyDecorator(ak), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(ak),
ante.NewSigGasConsumeDecorator(ak, sigGasConsumer),
Expand Down
Loading
Loading