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: minimum-commission-rate #138

Draft
wants to merge 23 commits into
base: minimum-commission-rate-feature
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
db28752
wip: pairing
Jonathansumner May 26, 2023
fc00d9b
Attempt to fix json deserialisation of staking Params.MinCommissionRate
pbukva May 30, 2023
c46528b
Fixing null-ability of the staking Params.MinCommissionRate
pbukva May 30, 2023
59ddf69
chore: add null check to retrieving MinCommissionRate param
Jonathansumner May 31, 2023
aa09c6a
chore: remove prints & fix buf.yaml version
Jonathansumner May 31, 2023
fa5ba96
Fixing protobuf compilation for macOS and linux platforms
pbukva Jun 1, 2023
90bb9e5
chore: remove prints & fix min commission params getter
Jonathansumner Jun 1, 2023
b6e0717
Merge remote-tracking branch 'up/feat/minimum-commission-rate' into f…
pbukva Jun 1, 2023
c5104ba
fix: include linter as build tool
Jonathansumner Jun 2, 2023
6e04cd4
chore: amend tests with 0% commission
Jonathansumner Jun 5, 2023
ce303dc
test: increase test coverage for default min commission rate
Jonathansumner Jun 5, 2023
3069b93
fix: amend broken formatting test
Jonathansumner Jun 5, 2023
39052cc
chore: remove redundant import
Jonathansumner Jun 5, 2023
2da8299
chore: update go.sum & go.mod
Jonathansumner Jun 5, 2023
8221cdb
Merge remote-tracking branch 'origin/feat/minimum-commission-rate' in…
Jonathansumner Jun 5, 2023
edce318
chore: remove unnecessary print
Jonathansumner Jun 6, 2023
1b8a5e8
chore: include supported go version check & warning
Jonathansumner Jun 6, 2023
0a95e41
chore: formatting
Jonathansumner Jun 6, 2023
3424f87
fix: amend broken markdown linting execution
Jonathansumner Jun 6, 2023
a2f76f1
chore: run markdown & go linting
Jonathansumner Jun 6, 2023
9ca8d4e
refact: rename setInitialCommission function to better represent
Jonathansumner Jun 7, 2023
b818eb0
test: improve test coverage for minimum commission rate
Jonathansumner Jun 7, 2023
c4d65eb
chore: bump go-linter version
Jonathansumner Jun 8, 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
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ run:
linters:
disable-all: true
enable:
- depguard
# - depguard # TODO(Joe): Investigate why depguard fails in CI
- dogsled
- exportloopref
- goconst
Expand Down
2 changes: 2 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
"MD036": false,
"MD040": false,
"MD041": false,
"MD051": false,
"MD052": false,
"no-hard-tabs": false
}
24 changes: 20 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ HTTPS_GIT := https://github.com/fetchai/cosmos-sdk.git
DOCKER := $(shell which docker)
DOCKER_BUF := $(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace bufbuild/buf

GO_VERSION := $(shell go version | grep -Eo '[0-9]\.[0-9]+\.[0-9]+')
GO_MAJOR_VERSION := $(shell echo $(GO_VERSION) | cut -d. -f1)
GO_MINOR_VERSION := $(shell echo $(GO_VERSION) | cut -d. -f2)
GO_MICRO_VERSION := $(shell echo $(GO_VERSION) | cut -d. -f3)
SUPPORTED_GO_VERSION = 1.18.10

IS_SUPPORTED_VERSION := $(shell expr "$(GO_VERSION)" "==" "$(SUPPORTED_GO_VERSION)")
ifeq "$(IS_SUPPORTED_VERSION)" "1"
$(info Go version is supported: $(GO_VERSION))
else
$(info WARN: Go version not supported, some tests might fail without version $(SUPPORTED_GO_VERSION))
endif


export GO111MODULE = on

# process build tags
Expand Down Expand Up @@ -315,11 +329,13 @@ containerMarkdownLintFix=cosmos-sdk-markdownlint-fix
golangci_lint_cmd=go run github.com/golangci/golangci-lint/cmd/golangci-lint

lint: lint-go
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLint}$$"; then docker start -a $(containerMarkdownLint); else docker run --name $(containerMarkdownLint) -i -v "$(CURDIR):/work" $(markdownLintImage); fi
@#if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLint}$$"; then docker start -a $(containerMarkdownLint); else docker run --name $(containerMarkdownLint) -i -v "$(CURDIR):/work" $(markdownLintImage); fi
docker run -i --rm -v "$(CURDIR):/work" $(containerMarkdownLintImage) .

lint-fix:
$(golangci_lint_cmd) run --fix --out-format=tab --issues-exit-code=0
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLintFix}$$"; then docker start -a $(containerMarkdownLintFix); else docker run --name $(containerMarkdownLintFix) -i -v "$(CURDIR):/work" $(markdownLintImage) . --fix; fi
@#if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerMarkdownLintFix}$$"; then docker start -a $(containerMarkdownLintFix); else docker run --name $(containerMarkdownLintFix) -i -v "$(CURDIR):/work" $(markdownLintImage) . --fix; fi
docker run -i --rm -v "$(CURDIR):/work" $(containerMarkdownLintImage) --fix .

lint-go:
echo $(GIT_DIFF)
Expand Down Expand Up @@ -400,7 +416,7 @@ proto-check-breaking:

TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.0-rc6/proto/tendermint
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/main
COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master
CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.6.3

TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
Expand Down Expand Up @@ -452,7 +468,7 @@ proto-update-deps:
@curl -sSL $(CONFIO_URL)/proofs.proto > $(CONFIO_TYPES)/proofs.proto
## insert go package option into proofs.proto file
## Issue link: https://github.com/confio/ics23/issues/32
@sed -i '4ioption go_package = "github.com/confio/ics23/go";' $(CONFIO_TYPES)/proofs.proto
@sed -i'.bak' -r -e 's/^[[:space:]]*(package[[:space:]]+ics23[[:space:]]*;)[[:space:]]*$$/\1 option go_package = "github.com\/confio\/ics23\/go";/' third_party/proto/confio/proofs.proto

.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps

Expand Down
4 changes: 2 additions & 2 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Cosmos SDK v0.45.9 Release Notes

This is a security release for the
[Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702).
This is a security release for the
[Dragonberry security advisory](https://forum.cosmos.network/t/ibc-security-advisory-dragonberry/7702).
Please upgrade ASAP.

Next to this, we have also included a few minor bugfixes.
Expand Down
10 changes: 5 additions & 5 deletions RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Only the following major release series have a stable release status:
### Patch Releases

Once a Cosmos-SDK release has been completed and published, updates for it are released under certain circumstances
and must follow the [Patch Release Procedure](CONTRIBUTING.md#patch-release-procedure)[Point Release Procedure].
and must follow the [Patch Release Procedure][CONTRIBUTING.md#patch-release-procedure](Point Release Procedure).

### Rationale

Expand Down Expand Up @@ -113,7 +113,7 @@ To smoothen the update to the latest stable release, the SDK includes a set of C

* **High-impact bugs**
* Bugs that may directly cause a security vulnerability.
* *Severe regressions* from a Cosmos-SDK's previous release. This includes all sort of issues
* _Severe regressions_ from a Cosmos-SDK's previous release. This includes all sort of issues
that may cause the core packages or the `x/` modules unusable.
* Bugs that may cause **loss of user's data**.
* Other safe cases:
Expand Down Expand Up @@ -150,10 +150,10 @@ As rule of thumb, the following changes will **NOT** be automatically accepted i
* **State machine changes**.
* **Protobug-breaking changes**, as specified in [ADR-044](./docs/architecture/adr-044-protobuf-updates- guidelines.md).
* **Client-breaking changes**, i.e. changes that prevent gRPC, HTTP and RPC clients to continue interacting with the node without any change.
* **API-breaking changes**, i.e. changes that prevent client applications to *build without modifications* to the client application's source code.
* **API-breaking changes**, i.e. changes that prevent client applications to _build without modifications_ to the client application's source code.
* **CLI-breaking changes**, i.e. changes that require usage changes for CLI users.

In some circumstances, PRs that don't meet the aforementioned criteria might be raised and asked to be granted a *Stable Release Exception*.
In some circumstances, PRs that don't meet the aforementioned criteria might be raised and asked to be granted a _Stable Release Exception_.

### Stable Release Exception - Procedure

Expand All @@ -164,7 +164,7 @@ As rule of thumb, the following changes will **NOT** be automatically accepted i
* A **[Test Case]** section containing detailed instructions on how to reproduce the bug.
* A **[Regression Potential]** section with a clear assessment on how regressions are most likely to manifest as a result of the pull request that aims to fix the bug in the target stable release.

3. **Stable Release Managers** will review and discuss the PR. Once *consensus* surrounding the rationale has been reached and the technical review has successfully concluded, the pull request will be merged in the respective point-release target branch (e.g. `release/v0.43.x`) and the PR included in the point-release's respective milestone (e.g. `v0.43.5`).
3. **Stable Release Managers** will review and discuss the PR. Once _consensus_ surrounding the rationale has been reached and the technical review has successfully concluded, the pull request will be merged in the respective point-release target branch (e.g. `release/v0.43.x`) and the PR included in the point-release's respective milestone (e.g. `v0.43.5`).

#### Stable Release Exception - Bug template

Expand Down
1 change: 0 additions & 1 deletion RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ Edit it and:
- Tick the `This is a pre-release` box (until mainnet release)
- Hit `Publish release`


## Next steps

To use this new release, `fetchd` needs to be updated.
Expand Down
4 changes: 2 additions & 2 deletions baseapp/testutil/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: v1
version: v1beta1
plugins:
- name: gocosmos
out: ../..
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/cosmos/cosmos-sdk/codec/types
17 changes: 0 additions & 17 deletions baseapp/testutil/buf.lock

This file was deleted.

2 changes: 1 addition & 1 deletion baseapp/testutil/buf.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: v1
version: v1beta1
deps:
- buf.build/cosmos/gogo-proto
- buf.build/cosmos/cosmos-proto
50 changes: 24 additions & 26 deletions baseapp/testutil/messages.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion baseapp/testutil/messages.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
syntax = "proto3";
package testdata;

import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";

option go_package = "github.com/cosmos/cosmos-sdk/baseapp/testutil";
Expand Down
Loading