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

feat(release): v1.x Release #510

Merged
merged 27 commits into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e9e672d
fix: Debug logging for migration handlers [DEV-1974] (#478)
abdulla-ashurov Dec 15, 2022
366f5c8
ci: Execute interactive installer test [DEV-1944] (#460)
ankurdotb Dec 15, 2022
0be3d86
Merge branch 'main' into develop
ankurdotb Dec 20, 2022
5814159
Merge branch 'main' into develop
ankurdotb Dec 21, 2022
00a13e0
Merge branch 'main' into develop
ankurdotb Dec 21, 2022
c03f21a
Merge branch 'main' into develop
ankurdotb Dec 21, 2022
aaa0542
Merge branch 'main' into develop
ankurdotb Dec 22, 2022
caaac08
chore(deps): Bump github.com/cosmos/cosmos-sdk from 0.46.6 to 0.46.7 …
dependabot[bot] Dec 22, 2022
fb4a76f
Merge branch 'main' into develop
ankurdotb Dec 22, 2022
327ff87
Merge branch 'main' into develop
ankurdotb Dec 22, 2022
f852ec2
feat(pulsar): Autogenerate Pulsar files [DEV-2008] (#492)
ankurdotb Dec 30, 2022
8f12576
Merge branch 'main' into develop
ankurdotb Jan 3, 2023
df63c4e
Merge branch 'main' into develop
ankurdotb Jan 3, 2023
2a31379
chore(deps): Bump github.com/cosmos/ibc-go/v5 from 5.1.0 to 5.2.0 (#494)
dependabot[bot] Jan 3, 2023
0a18e7c
fix(state): Fixed v1.0.x resource genesis export pointed values (#493)
Eengineer1 Jan 3, 2023
2aa528b
feat(keys): Ed25519VerificationKey2020 full spec compliant & add 2018…
Jan 6, 2023
ba92670
build(deps): Bump IBC v6.1 & ICS 23 v0.9 [DEV-2071] (#500)
Eengineer1 Jan 6, 2023
9813bd9
ci: Fix github app token action
ankurdotb Jan 6, 2023
8d5ad61
refactor: Change upgrade handler name to v1 (#501)
ankurdotb Jan 9, 2023
6c953a8
chore(deps-dev): Bump semantic-release from 19.0.5 to 20.0.2 (#504)
dependabot[bot] Jan 10, 2023
f6aa320
build(deps): Bump github.com/onsi/ginkgo/v2 from 2.6.1 to 2.7.0 (#502)
dependabot[bot] Jan 10, 2023
8110d67
fix(upgrade): Bring UpgradeHandler and InitChainer in-line with best …
ankurdotb Jan 10, 2023
cbd873d
fix(ibc): Fixed router seal & legacy bash tests latest working state …
Eengineer1 Jan 11, 2023
945572a
feat(swagger): Autogenerate swagger for cheqd-node protobufs [DEV-166…
benyam7 Jan 12, 2023
8a088b2
fix(lint): Ignore non-breaking combine config (#508)
Eengineer1 Jan 12, 2023
6207dde
fix(lint): Switch to json config for `swagger-combine` (#509)
Eengineer1 Jan 12, 2023
583be08
Restored buf breaking action
Eengineer1 Jan 16, 2023
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
45 changes: 40 additions & 5 deletions .github/linters/.golangci.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,64 @@
run:
timeout: 5m
timeout: 10m


linters:
enable:
- deadcode
- bodyclose
- depguard
- dogsled
- errcheck
- gosimple
- exportloopref
- goconst
- gocritic
- gofumpt
- goimports
- gosimple
- govet
- ineffassign
- misspell
- nakedret
- nestif
- nolintlint
- staticcheck
- structcheck
- stylecheck
- typecheck
- unconvert
- unused
- varcheck


linters-settings:
dogsled:
# Checks assignments with too many blank identifiers.
# Default: 2
max-blank-identifiers: 3

gocritic:
# Which checks should be disabled; can't be combined with 'enabled-checks'.
# See https://go-critic.github.io/overview#checks-overview.
# Default: []
disabled-checks:
- regexpMust
- badCall # Remove this after CI workflow PR

gofumpt:
lang-version: "1.18"

misspell:
ignore-words:
- cheqd
- cheq
- ncheq

stylecheck:
# Select the Go version to target.
go: "1.18"
# STxxxx checks in https://staticcheck.io/docs/configuration/options/#checks
# Default: ["*"]
checks: ["all"]
# https://staticcheck.io/docs/configuration/options/#dot_import_whitelist
dot-import-whitelist:
- "github.com/cheqd/cheqd-node/x/did/utils"
- "github.com/onsi/gomega"
# https://staticcheck.io/docs/configuration/options/#initialisms
initialisms: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
11 changes: 11 additions & 0 deletions .github/linters/.openapirc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---

##########################
##########################
## OpenAPI Linter rules ##
##########################
##########################

extends: spectral:oas
rules:
oas2-schema: warn
8 changes: 5 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
version: v1.47
version: v1.49.0
args: --config .github/linters/.golangci.yaml

proto-lint:
Expand All @@ -64,12 +64,14 @@ jobs:

# Lint
- uses: bufbuild/buf-lint-action@v1
with:
input: proto

# Breaking change detection
- uses: bufbuild/buf-breaking-action@v1
continue-on-error: true
with:
input: 'proto'
input: proto
against: 'https://github.com/cheqd/cheqd-node.git#branch=main,ref=HEAD~1,subdir=proto'

super-lint:
Expand All @@ -88,7 +90,7 @@ jobs:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOG_LEVEL: WARN
VALIDATE_ALL_CODEBASE: true
VALIDATE_ALL_CODEBASE: false
MULTI_STATUS: true

VALIDATE_BASH: true
Expand Down
40 changes: 36 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,41 @@ permissions:


jobs:
# Super Linter only runs on diffs in PRs
# For release, we run it on VALIDATE_ALL_CODEBASE=true
# List of languages enabled is smaller than in lint workflow
super-lint:
name: "Super Linter"
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Required to fetch version

- name: Run Super Linter
uses: github/super-linter/slim@v4
env:
IGNORE_GITIGNORED_FILES: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOG_LEVEL: WARN
VALIDATE_ALL_CODEBASE: true
MULTI_STATUS: true

VALIDATE_BASH: true
VALIDATE_DOCKERFILE_HADOLINT: true
VALIDATE_JSON: true
VALIDATE_OPENAPI: true
VALIDATE_PYTHON_PYLINT: true
VALIDATE_XML: true
VALIDATE_YAML: true


release-binary:
name: "Node binary"
runs-on: ubuntu-20.04
needs: super-lint
outputs:
RELEASE_VERSION: ${{ steps.set-version.outputs.RELEASE_VERSION }}

Expand All @@ -36,7 +67,7 @@ jobs:
cache-dependency-path: '**/package-lock.json'

# Setup for pushing to Buf.build later
- uses: bufbuild/buf-setup-action@v1.11.0
- uses: bufbuild/buf-setup-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

Expand Down Expand Up @@ -68,18 +99,19 @@ jobs:
- name: Set release version number
id: set-version
run: |
RELEASE_VERSION=$( git describe --tags ${{ github.sha }})
echo ::set-output name=RELEASE_VERSION::"$RELEASE_VERSION"
RELEASE_VERSION=$( git describe --tags "${{ github.sha }}")
echo "RELEASE_VERSION=$RELEASE_VERSION" >> "$GITHUB_OUTPUT"

# Push Protobufs to Buf.build registry
- uses: bufbuild/buf-push-action@v1
with:
input: proto
buf_token: ${{ secrets.BUF_TOKEN }}
draft: ${{ github.ref_name != 'main'}}

release-docker:
name: "Docker image"
needs: release-binary
needs: [ super-lint, release-binary ]
runs-on: ubuntu-20.04
env:
IMAGE_NAME: ${{ github.repository }}
Expand Down
19 changes: 9 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
### APP-SPECIFIC EXCLUSIONS ###

# Ignored directories
api/docs/cheqd/**
api/docs/swagger-ui/**
build/
dist/

# Tests
**/network-config
**/node_configs

# Python
.pytest_cache
**/__pycache__
# Ignored files
api/docs/config.yaml

# Allowed files
!api/docs/swagger-ui/**/swagger-initializer.js

### GENERAL EXCLUSIONS ###

Expand Down Expand Up @@ -93,10 +96,6 @@ Temporary Items
# Dependency directories (remove the comment below to include it)
# vendor/

# Go workspace file
go.work


### Node/JavaScript ###
# Logs
logs
Expand Down
9 changes: 5 additions & 4 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ env:
before:
hooks:
- make clean
- go mod tidy
- go mod download
- make tidy
- make install
- make proto-gen
- make swagger

builds:
- id: ubuntu-latest-amd64
Expand All @@ -22,7 +23,7 @@ builds:
- CGO_ENABLED=1
flags:
- -mod=readonly
- -tags="netgo ledger"
- -tags="netgo ledger goleveldb"
- -trimpath
ldflags:
- -s -w
Expand All @@ -42,7 +43,7 @@ builds:
- sudo apt update && sudo apt install clang gcc-multilib g++-multilib -y
flags:
- -mod=readonly
- -tags="netgo ledger"
- -tags="netgo ledger goleveldb"
- -trimpath
ldflags:
- -s -w
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ clean:
GO_MAJOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1)
GO_MINOR_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f2)
MIN_GO_MAJOR_VERSION = 1
MIN_GO_MINOR_VERSION = 17
MIN_GO_MINOR_VERSION = 18
GO_VERSION_ERROR = Golang version $(GO_MAJOR_VERSION).$(GO_MINOR_VERSION) is not supported, \
please update to at least $(MIN_GO_MAJOR_VERSION).$(MIN_GO_MINOR_VERSION)

Expand Down Expand Up @@ -245,6 +245,5 @@ include make/proto.mk
###############################################################################

swagger: proto-swagger-gen
@./scripts/generate_swagger_docs.sh

.PHONY: swagger
2 changes: 1 addition & 1 deletion ante/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func IsSufficientFee(ctx sdk.Context, tax, reward, burn, feeProvided sdk.Coins,

// Determine the required fees by multiplying each required minimum gas
// price by the gas limit, where fee = ceil(minGasPrice * gasLimit).
glDec := sdk.NewDec(int64(gasRequested))
glDec := sdk.NewDec(gasRequested)
for i, gp := range minGasPrices {
fee := gp.Amount.Mul(glDec)
requiredFees[i] = sdk.NewCoin(gp.Denom, fee.Ceil().RoundInt())
Expand Down
4 changes: 2 additions & 2 deletions ante/testdata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func SandboxDidDoc() *didtypes.MsgCreateDidDoc {
var signatures []*didtypes.SignInfo

signatures = append(signatures, &didtypes.SignInfo{
VerificationMethodId: didDocInfo.SignInput.VerificationMethodId,
VerificationMethodId: didDocInfo.SignInput.VerificationMethodID,
Signature: ed25519.Sign(didDocInfo.SignInput.Key, signBytes),
})

Expand All @@ -41,7 +41,7 @@ func SandboxResource() *resourcetypes.MsgCreateResource {
var signatures []*didtypes.SignInfo

signatures = append(signatures, &didtypes.SignInfo{
VerificationMethodId: didDocInfo.SignInput.VerificationMethodId,
VerificationMethodId: didDocInfo.SignInput.VerificationMethodID,
Signature: ed25519.Sign(didDocInfo.SignInput.Key, signBytes),
})

Expand Down
2 changes: 1 addition & 1 deletion ante/testutil_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (s *AnteTestSuite) CreateTestAccounts(numAccs int) ([]TestAccount, error) {
func (s *AnteTestSuite) CreateTestTx(privs []cryptotypes.PrivKey, accNums []uint64, accSeqs []uint64, chainID string) (xauthsigning.Tx, error) {
// First round: we gather all the signer infos. We use the "set empty
// signature" hack to do that.
var sigsV2 []signing.SignatureV2
sigsV2 := make([]signing.SignatureV2, 0, len(privs))
for i, priv := range privs {
sigV2 := signing.SignatureV2{
PubKey: priv.PubKey(),
Expand Down
10 changes: 5 additions & 5 deletions ante/tx_msg_filters.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
MsgDeactivateDidDoc
MsgCreateResourceDefault
MsgCreateResourceImage
MsgCreateResourceJson
MsgCreateResourceJSON

TaxableMsgFeeCount
)
Expand All @@ -37,7 +37,7 @@ var TaxableMsgFees = TaxableMsgFee{
MsgDeactivateDidDoc: (sdk.Coins)(nil),
MsgCreateResourceDefault: (sdk.Coins)(nil),
MsgCreateResourceImage: (sdk.Coins)(nil),
MsgCreateResourceJson: (sdk.Coins)(nil),
MsgCreateResourceJSON: (sdk.Coins)(nil),
}

var BurnFactors = BurnFactor{
Expand Down Expand Up @@ -97,8 +97,8 @@ func GetResourceTaxableMsgFee(ctx sdk.Context, msg *resourcetypes.MsgCreateResou

// Mime type json
if strings.HasPrefix(mediaType, "application/json") {
burnPortion := GetBurnFeePortion(BurnFactors[BurnFactorResource], TaxableMsgFees[MsgCreateResourceJson])
return GetRewardPortion(TaxableMsgFees[MsgCreateResourceJson], burnPortion), burnPortion, true
burnPortion := GetBurnFeePortion(BurnFactors[BurnFactorResource], TaxableMsgFees[MsgCreateResourceJSON])
return GetRewardPortion(TaxableMsgFees[MsgCreateResourceJSON], burnPortion), burnPortion, true
}

// Default mime type
Expand All @@ -114,7 +114,7 @@ func checkFeeParamsFromSubspace(ctx sdk.Context, didKeeper DidKeeper, resourceKe

resourceParams := resourceKeeper.GetParams(ctx)
TaxableMsgFees[MsgCreateResourceImage] = sdk.NewCoins(resourceParams.Image)
TaxableMsgFees[MsgCreateResourceJson] = sdk.NewCoins(resourceParams.Json)
TaxableMsgFees[MsgCreateResourceJSON] = sdk.NewCoins(resourceParams.Json)
TaxableMsgFees[MsgCreateResourceDefault] = sdk.NewCoins(resourceParams.Default)

BurnFactors[BurnFactorDid] = didParams.BurnFactor
Expand Down
Loading