Skip to content

Commit 491b18b

Browse files
authored
Merge branch 'master' into sai/9684-pretty-json-to-tx-commands
2 parents 8557221 + 941d635 commit 491b18b

File tree

13 files changed

+65
-262
lines changed

13 files changed

+65
-262
lines changed

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
sed -i.bak "/$(echo $filename | sed 's/\//\\\//g')/d" coverage.txt
165165
done
166166
if: env.GIT_DIFF
167-
- uses: codecov/codecov-action@v1.5.2
167+
- uses: codecov/codecov-action@v2.0.2
168168
with:
169169
file: ./coverage.txt
170170
if: env.GIT_DIFF

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ docs/_build
1818
docs/tutorial
1919
docs/node_modules
2020
docs/modules
21+
docs/run-node/cosmovisor.md
2122
dist
2223
tools-stamp
2324
buf-stamp

CONTRIBUTING.md

+16-17
Original file line numberDiff line numberDiff line change
@@ -72,58 +72,57 @@ of how these are written refer to the current [ADRs](https://github.com/cosmos/c
7272

7373
## Pull Requests
7474

75-
PRs should be categorically broken up based on the type of changes being made (i.e. `fix`, `feat`,
76-
`refactor`, `docs`, etc.). The *type* must be included in the PR title as a prefix (e.g.
77-
`fix: <description>`). This ensures that all changes committed to the base branch follow the
75+
PRs should be categorically broken up based on the type of changes being made (for example, `fix`, `feat`,
76+
`refactor`, `docs`, and so on). The *type* must be included in the PR title as a prefix (for example,
77+
`fix: <description>`). This convention ensures that all changes that are committed to the base branch follow the
7878
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
7979
Additionally, each PR should only address a single issue.
8080

8181
### Pull Request Templates
8282

83-
There are currently three PR templates. The [default template](./.github/PULL_REQUEST_TEMPLATE.md) is for types `fix`, `feat`, and `refactor`. We also have a [docs template](./.github/PULL_REQUEST_TEMPLATE/docs.md) for documentation changes and an [other template](./.github/PULL_REQUEST_TEMPLATE/other.md) for changes that do not affect production code. When previewing a PR before it has been opened, you can change the template by adding one of the following parameters to the url:
83+
There are three PR templates. The [default template](./.github/PULL_REQUEST_TEMPLATE.md) is for types `fix`, `feat`, and `refactor`. We also have a [docs template](./.github/PULL_REQUEST_TEMPLATE/docs.md) for documentation changes and an [other template](./.github/PULL_REQUEST_TEMPLATE/other.md) for changes that do not affect production code. When previewing a PR before it has been opened, you can change the template by adding one of the following parameters to the url:
8484

8585
- `template=docs.md`
8686
- `template=other.md`
8787

8888
### Requesting Reviews
8989

90-
In order to accomodate the review process, the author of the PR must complete the author checklist
90+
In order to accommodate the review process, the author of the PR must complete the author checklist
9191
to the best of their abilities before marking the PR as "Ready for Review". If you would like to
9292
receive early feedback on the PR, open the PR as a "Draft" and leave a comment in the PR indicating
9393
that you would like early feedback and tagging whoever you would like to receive feedback from.
9494

9595
### Reviewing Pull Requests
9696

97-
All PRs require at least two reviews before they can be merged (one review might be acceptable in
98-
the case of minor changes to [docs](./.github/PULL_REQUEST_TEMPLATE/docs.md) or [other](./.github/PULL_REQUEST_TEMPLATE/other.md) changes that do not affect production code). Each PR template has a
99-
reviewers checklist that must be completed before the PR can be merged. Each reviewer is responsible
97+
All PRs require at least two review approvals before they can be merged (one review might be acceptable in
98+
the case of minor changes to [docs](./.github/PULL_REQUEST_TEMPLATE/docs.md) or [other](./.github/PULL_REQUEST_TEMPLATE/other.md) changes that do not affect production code). Each PR template has a reviewers checklist that must be completed before the PR can be merged. Each reviewer is responsible
10099
for all checked items unless they have indicated otherwise by leaving their handle next to specific
101-
items. In addition, please use the following review explanations:
100+
items. In addition, use the following review explanations:
102101

103102
- `LGTM` without an explicit approval means that the changes look good, but you haven't thoroughly reviewed the reviewer checklist items.
104-
- `Approval` means that you have completed some or all of the reviewer checklist items. If you only reviewed selected items, you have added your handle next to the items that you have reviewed. In addition, please follow these guidelines:
103+
- `Approval` means that you have completed some or all of the reviewer checklist items. If you only reviewed selected items, you must add your handle next to the items that you have reviewed. In addition, follow these guidelines:
105104
- You must also think through anything which ought to be included but is not
106105
- You must think through whether any added code could be partially combined (DRYed) with existing code
107106
- You must think through any potential security issues or incentive-compatibility flaws introduced by the changes
108107
- Naming must be consistent with conventions and the rest of the codebase
109-
- Code must live in a reasonable location, considering dependency structures (e.g. not importing testing modules in production code, or including example code modules in production code).
110-
- If you approve of the PR, you are responsible for any issues mentioned here and any issues that should have been addressed after thoroughly reviewing the reviewer checklist items in the pull request template.
111-
- If you sat down with the PR submitter and did a pairing review please note that in the `Approval`, or your PR comments.
108+
- Code must live in a reasonable location, considering dependency structures (for example, not importing testing modules in production code, or including example code modules in production code).
109+
- If you approve the PR, you are responsible for any issues mentioned here and any issues that should have been addressed after thoroughly reviewing the reviewer checklist items in the pull request template.
110+
- If you sat down with the PR submitter and did a pairing review, add this information in the `Approval` or your PR comments.
112111
- If you are only making "surface level" reviews, submit any notes as `Comments` without adding a review.
113112

114113
### Updating Documentation
115114

116115
If you open a PR on the Cosmos SDK, it is mandatory to update the relevant documentation in `/docs`.
117116

118-
- If your change relates to the core SDK (baseapp, store, ...), please update the `docs/basics/`, `docs/core/` and/or `docs/building-modules/` folders.
119-
- If your changes relate to the core of the CLI (not specifically to module's CLI/Rest), please modify the `docs/run-node/` folder.
120-
- If your changes relate to a module, please update the module's spec in `x/moduleName/docs/spec/`.
117+
- If your change relates to the core SDK (baseapp, store, ...), be sure to update the content in `docs/basics/`, `docs/core/` and/or `docs/building-modules/` folders.
118+
- If your changes relate to the core of the CLI (not specifically to module's CLI/Rest), then modify the content in the `docs/run-node/` folder.
119+
- If your changes relate to a module, then be sure to update the module's spec in `x/moduleName/docs/spec/`.
121120

122121
When writing documentation, follow the [Documentation Writing Guidelines](./docs/DOC_WRITING_GUIDELINES.md).
123122

124123
## Forking
125124

126-
Please note that Go requires code to live under absolute paths, which complicates forking.
125+
Go requires code to live under absolute paths, and this requirement complicates forking.
127126
While my fork lives at `https://github.com/rigeyrigerige/cosmos-sdk`,
128127
the code should never exist at `$GOPATH/src/github.com/rigeyrigerige/cosmos-sdk`.
129128
Instead, we use `git remote` to add the fork as a new remote for the original repo,

cosmovisor/README.md

+10-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ All arguments passed to `cosmovisor` will be passed to the application binary (a
3939
└── $DAEMON_NAME
4040
```
4141

42-
The `cosmovisor/` directory incudes a subdirectory for each version of the application (i.e. `genesis` or `upgrades/<name>`). Within each subdirectory is the application binary (i.e. `bin/$DAEMON_NAME`) and any additional auxiliary files associated with each binary. `current` is a symbolic link to the currently active directory (i.e `genesis` or `upgrades/<name>`). The `name` variable in `upgrades/<name>` is the URI-encoded name of the upgrade as specified in the upgrade module plan.
42+
The `cosmovisor/` directory incudes a subdirectory for each version of the application (i.e. `genesis` or `upgrades/<name>`). Within each subdirectory is the application binary (i.e. `bin/$DAEMON_NAME`) and any additional auxiliary files associated with each binary. `current` is a symbolic link to the currently active directory (i.e. `genesis` or `upgrades/<name>`). The `name` variable in `upgrades/<name>` is the URI-encoded name of the upgrade as specified in the upgrade module plan.
4343

4444
Please note that `$DAEMON_HOME/cosmovisor` only stores the *application binaries*. The `cosmovisor` binary itself can be stored in any typical location (e.g. `/usr/local/bin`). The application will continue to store its data in the default data directory (e.g. `$HOME/.gaiad`) or the data directory specified with the `--home` flag. `$DAEMON_HOME` is independent of the data directory and can be set to any location. If you set `$DAEMON_HOME` to the same directory as the data directory, you will end up with a configuation like the following:
4545

@@ -90,7 +90,7 @@ https://example.com/testnet-1001-info.json?checksum=sha256:deaaa99fda9407c4dbe1d
9090

9191
When `cosmovisor` is triggered to download the new binary, `cosmovisor` will parse the `"binaries"` field, download the new binary with [go-getter](https://github.com/hashicorp/go-getter), and unpack the new binary in the `upgrades/<name>` folder so that it can be run as if it was installed manually.
9292

93-
Note that for this mechanism to provide strong security guarantees, all URLs should include a SHA 256/512 checksum. This ensures that no false binary is run, even if someone hacks the server or hijacks the DNS. `go-getter` will always ensure the downloaded file matches the checksum if it is provided.
93+
Note that for this mechanism to provide strong security guarantees, all URLs should include a SHA 256/512 checksum. This ensures that no false binary is run, even if someone hacks the server or hijacks the DNS. `go-getter` will always ensure the downloaded file matches the checksum if it is provided. `go-getter` will also handle unpacking archives into directories (in this case the download link should point to a `zip` file of all data in the `bin` directory).
9494

9595
To properly create a sha256 checksum on linux, you can use the `sha256sum` utility. For example:
9696

@@ -106,7 +106,13 @@ You can also use `sha512sum` if you would prefer to use longer hashes, or `md5su
106106

107107
The following instructions provide a demonstration of `cosmovisor` using the simulation application (`simapp`) shipped with the Cosmos SDK's source code. The following commands are to be run from within the `cosmos-sdk` repository.
108108

109-
First compile the `simd` binary:
109+
First, check out the latest `v0.42` release:
110+
111+
```
112+
git checkout v0.42.7
113+
```
114+
115+
Compile the `simd` binary:
110116

111117
```
112118
make build
@@ -186,7 +192,7 @@ app.UpgradeKeeper = upgradekeeper.NewKeeper(skipUpgradeHeights, keys[upgradetype
186192

187193
After that line, add the following:
188194

189-
```go
195+
```go
190196
app.UpgradeKeeper.SetUpgradeHandler("test1", func(ctx sdk.Context, plan upgradetypes.Plan) {
191197
// Add some coins to a random account
192198
addr, err := sdk.AccAddressFromBech32("cosmos18cgkqduwuh253twzmhedesw3l7v3fm37sppt58")

docs/basics/accounts.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,11 @@ The Cosmos SDK supports the following digital key schemes for creating digital s
7070
- `secp256r1`, as implemented in the [SDK's `crypto/keys/secp256r1` package](https://github.com/cosmos/cosmos-sdk/blob/master/crypto/keys/secp256r1/pubkey.go),
7171
- `tm-ed25519`, as implemented in the [SDK `crypto/keys/ed25519` package](https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/crypto/keys/ed25519/ed25519.go). This scheme is supported only for the consensus validation.
7272

73-
| | Address length | Public key length | Used for transaction | Used for consensus |
74-
| | in bytes | in bytes | authentication | (tendermint) |
75-
|--------------+----------------+-------------------+----------------------+--------------------|
76-
| `secp256k1` | 20 | 33 | yes | no |
77-
| `secp256r1` | 32 | 33 | yes | no |
78-
| `tm-ed25519` | -- not used -- | 32 | no | yes |
73+
| | Address length in bytes | Public key length in bytes | Used for transaction authentication | Used for consensus (tendermint) |
74+
|:------------:|:-----------------------:|:--------------------------:|:-----------------------------------:|:-------------------------------:|
75+
| `secp256k1` | 20 | 33 | yes | no |
76+
| `secp256r1` | 32 | 33 | yes | no |
77+
| `tm-ed25519` | -- not used -- | 32 | no | yes |
7978

8079
## Addresses
8180

docs/basics/app-anatomy.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ See an example of a `MakeTestEncodingConfig` from `simapp`:
135135

136136
Modules must implement [interfaces](../building-modules/module-manager.md#application-module-interfaces) defined in the Cosmos SDK, [`AppModuleBasic`](../building-modules/module-manager.md#appmodulebasic) and [`AppModule`](../building-modules/module-manager.md#appmodule). The former implements basic non-dependant elements of the module, such as the `codec`, while the latter handles the bulk of the module methods (including methods that require references to other modules' `keeper`s). Both the `AppModule` and `AppModuleBasic` types are defined in a file called `./module.go`.
137137

138-
`AppModule` exposes a collection of useful methods on the module that facilitates the composition of modules into a coherent application. These methods are are called from the `module manager`(../building-modules/module-manager.md#manager), which manages the application's collection of modules.
138+
`AppModule` exposes a collection of useful methods on the module that facilitates the composition of modules into a coherent application. These methods are called from the `module manager`(../building-modules/module-manager.md#manager), which manages the application's collection of modules.
139139

140140
### `Msg` Services
141141

docs/core/grpc_rest.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ Please see [issue #8392](https://github.com/cosmos/cosmos-sdk/issues/8392) for m
3434

3535
Cosmos SDK v0.40 introduced Protobuf as the main [encoding](./encoding) library, and this brings a wide range of Protobuf-based tools that can be plugged into the SDK. One such tool is [gRPC](https://grpc.io), a modern open source high performance RPC framework that has decent client support in several languages.
3636

37-
Each module exposes [`Msg` and `Query` Protobuf services](../building-modules/messages-and-queries.md) to define state transitions and state queries. These services are hooked up to gRPC via the following function inside the application:
37+
Each module exposes a [Protobuf `Query` service](../building-modules/messages-and-queries.md#queries) that defines state queries. The `Query` services and a transaction service used to broadcast transactions are hooked up to the gRPC server via the following function inside the application:
3838

39-
<https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/server/types/app.go#L39-L41>
39+
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-rc0/server/types/app.go#L39-L41
4040

41-
The `grpc.Server` is a concrete gRPC server, which spawns and serves any gRPC requests. This server can be configured inside `~/.simapp/config/app.toml`:
41+
Note: It is not possible to expose any [Protobuf `Msg` service](../building-modules/messages-and-queries.md#messages) endpoints via gRPC. Transactions must be generated and signed using the CLI or programatically before they can be broadcasted using gRPC. See [Generating, Signing, and Broadcasting Transactions](../run-node/txs.html) for more information.
42+
43+
The `grpc.Server` is a concrete gRPC server, which spawns and serves all gRPC query requests and a broadcast transaction request. This server can be configured inside `~/.simapp/config/app.toml`:
4244

4345
- `grpc.enable = true|false` field defines if the gRPC server should be enabled. Defaults to `true`.
4446
- `grpc.address = {string}` field defines the address (really, the port, since the host should be kept at `0.0.0.0`) the server should bind to. Defaults to `0.0.0.0:9090`.
@@ -65,15 +67,15 @@ All routes are configured under the following fields in `~/.simapp/config/app.to
6567

6668
If, for various reasons, you cannot use gRPC (for example, you are building a web application, and browsers don't support HTTP2 on which gRPC is built), then the SDK offers REST routes via gRPC-gateway.
6769

68-
[gRPC-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) is a tool to expose gRPC endpoints as REST endpoints. For each RPC endpoint defined in a Protobuf service, the SDK offers a REST equivalent. For instance, querying a balance could be done via the `/cosmos.bank.v1beta1.QueryAllBalances` gRPC endpoint, or alternatively via the gRPC-gateway `"/cosmos/bank/v1beta1/balances/{address}"` REST endpoint: both will return the same result. For each RPC method defined in a Protobuf service, the corresponding REST endpoint is defined as an option:
70+
[gRPC-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) is a tool to expose gRPC endpoints as REST endpoints. For each gRPC endpoint defined in a Protobuf `Query` service, the SDK offers a REST equivalent. For instance, querying a balance could be done via the `/cosmos.bank.v1beta1.QueryAllBalances` gRPC endpoint, or alternatively via the gRPC-gateway `"/cosmos/bank/v1beta1/balances/{address}"` REST endpoint: both will return the same result. For each RPC method defined in a Protobuf `Query` service, the corresponding REST endpoint is defined as an option:
6971

7072
+++ https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/proto/cosmos/bank/v1beta1/query.proto#L19-L22
7173

7274
For application developers, gRPC-gateway REST routes needs to be wired up to the REST server, this is done by calling the `RegisterGRPCGatewayRoutes` function on the ModuleManager.
7375

7476
### Legacy REST API Routes
7577

76-
The REST routes present in Cosmos SDK v0.39 and earlier are marked as deprecated via a [HTTP deprecation header](https://tools.ietf.org/id/draft-dalal-deprecation-header-01.html). They are still maintained to keep backwards compatibility, but will be removed in v0.41. For updating from Legacy REST routes to new gRPC-gateway REST routes, please refer to our [migration guide](../migrations/rest.md).
78+
The REST routes present in Cosmos SDK v0.39 and earlier are marked as deprecated via a [HTTP deprecation header](https://tools.ietf.org/id/draft-dalal-deprecation-header-01.html). They are still maintained to keep backwards compatibility, but will be removed in v0.44. For updating from Legacy REST routes to new gRPC-gateway REST routes, please refer to our [migration guide](../migrations/rest.md).
7779

7880
For application developers, Legacy REST API routes needs to be wired up to the REST server, this is done by calling the `RegisterRESTRoutes` function on the ModuleManager.
7981

docs/ibc/integration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ connection handhake.
206206
The IBC module also has
207207
[`BeginBlock`](https://github.com/cosmos/ibc-go/blob/main/modules/core/02-client/abci.go) logic as
208208
well. This is optional as it is only required if your application uses the [localhost
209-
client](https://github.com/cosmos/ics/blob/master/spec/ics-009-loopback-client) to connect two
209+
client](https://github.com/cosmos/ibc/tree/master/spec/client/ics-009-loopback-client) to connect two
210210
different modules from the same chain.
211211
212212
::: tip

docs/ibc/overview.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<!-- order: 1 -->
1+
<!--
2+
order: 1
3+
-->
24

35
# IBC Overview
46

docs/post.sh

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/usr/bin/env bash
22

33
rm -rf modules
4+
rm -rf run-node/cosmovisor.md

docs/pre.sh

+2
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ for D in ../x/*; do
1010
done
1111

1212
cat ../x/README.md | sed 's/\.\/x/\/modules/g' | sed 's/spec\/README.md//g' | sed 's/\.\.\/docs\/building-modules\/README\.md/\/building-modules\/intro\.html/g' > ./modules/README.md
13+
14+
cp ../cosmovisor/README.md ./run-node/cosmovisor.md

0 commit comments

Comments
 (0)