Skip to content

Commit d606863

Browse files
committed
#303 Upgrade Cosmos-SDK to v0.47.8
- Update docs and helper scripts - Revert Ansible CI changes Signed-off-by: Abdulbois <abdulbois.tursunov@dsr-corporation.com> Signed-off-by: Abdulbois <abdulbois123@gmail.com>
1 parent 576f325 commit d606863

21 files changed

+11584
-3197
lines changed

README-DEV.md

+21-13
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,12 @@ Please take into account the following when sending a PR:
153153

154154
## How To Add a new Module or Transaction
155155

156-
- Use [starport](https://github.com/tendermint/starport) command to scaffold the module.
157-
Consider using a docker container built from the provided [Dockerfile](scripts/Dockerfile) to have a predictable version of starport. See [README.md](scripts/README.md).
156+
- Use [ignite v0.27.1](https://github.com/ignite/cli) command to scaffold the module.
157+
Consider using a docker container built from the provided [Dockerfile](scripts/Dockerfile) to have a predictable version of ignite. See [README.md](scripts/README.md).
158158
- Have a look at the scripts and commands used for generation of existing modules, messages and CRUD operations and do it in a similar way
159159
(for example [PKI module commands](scripts/starport/upgrade-0.44/07.pki_types.sh)).
160+
Note: On previous scaffolding of modules `starport` cli used instead of `ignite`.
161+
While generating new module, command structure will the same except it must start with `ignite`.
160162
- If a new transaction with a new data in state (key-value) and new queries needs to be created, then both message and CRUD commands need to be executed.
161163
- If just a message to update existing state values need to be created, then a message command is enough.
162164
- Adjust the generated code
@@ -166,19 +168,18 @@ Please take into account the following when sending a PR:
166168
- add `(cosmos_proto.scalar) = "cosmos.AddressString"` annotation for all fields with address/account type (such as `signer` or `owner`).
167169
- fix types if needed in `proto/<module>/<entity>.proto` files
168170
- Note1: `unit64` will be returned as string if the output is a JSON format. So, it's better to use `uint64` only when it's really `uint64`.
169-
- Note2: for `uint16` type: use `int32` during starport scaffolding, and add custom validation (annotations above) to check the lower and upper bounds.
170-
- Note3: for `uint32` type: use `int32` during starport scaffolding, then replace it by `uint32` in .proto files, re-generate the code and fix compilation errors.
171-
- build proto (for example `starport chain build`). Fix compilation errors if any.
171+
- Note2: for `uint16` type: use `int32` during ignite scaffolding, and add custom validation (annotations above) to check the lower and upper bounds.
172+
- Note3: for `uint32` type: use `int32` during ignite scaffolding, then replace it by `uint32` in .proto files, re-generate the code and fix compilation errors.
173+
- build proto (for example `ignite chain build`). Fix compilation errors if any.
172174
- generate openapi docs from proto using (`scripts/dcl-swagger-gen.sh`). It's recommended to run from container built from [Dockerfile](scripts/Dockerfile)
173175
174176
- **Note1**: colons (`:`) are part of subject-id in PKI module, but colons are not allowed in gRPC REST URLs by default.
175177
`allow_colon_final_segments=true` should be used as a workaround.
176178
So, make sure that `runtime.AssumeColonVerbOpt(false)` in `/x/pki/types/query.pb.gw.go`.
177179
It's usually sufficient to revert the generated changes in `/x/pki/types/query.pb.gw.go`.
178-
- **Note2**: move `compliance_info.pb.go` and `compliance_history_item.pb.go` to `types/compliance` and adjust the import in other places accordingly.
179180
It may be easier just to revert changes in all `*.pb.go` files not affected by your changes in `.proto`
180-
- **Note3**: `starport chain build` needs to be called only if you made manual changes in `.proto` files.
181-
There is no need to call `starport chain build` again once all errors and adjustments above are done. It's sufficient just to build the project via usual ways (such as `make build`)
181+
- **Note3**: `ignite chain build` needs to be called only if you made manual changes in `.proto` files.
182+
There is no need to call `ignite chain build` again once all errors and adjustments above are done. It's sufficient just to build the project via usual ways (such as `make build`)
182183
- Add static validation for new messages:
183184
- Call `validator.Validate(msg)` in `ValidateBasic` methods for all generated messages
184185
- Add additional checks to `ValidateBasic` that do not depend on the state (key-value) and order of transactions
@@ -195,19 +196,19 @@ Please take into account the following when sending a PR:
195196

196197
## How To Make Changes in Data Model for Existing Modules
197198

198-
- Use [starport](https://github.com/tendermint/starport) command to scaffold the module.
199-
Consider using the provided [Dockerfile](scripts/Dockerfile) to have a predictable version of starport. See [README.md](scripts/README.md).
199+
- Use [ignite](https://github.com/ignite/cli) command to scaffold the module.
200+
Consider using the provided [Dockerfile](scripts/Dockerfile) to have a predictable version of ignite. See [README.md](scripts/README.md).
200201
- **Never change `.pb` files manually**. Do the changes in `.proto` files.
201-
- Every time `.proto` files change, re-generate the code (for example `starport chain build`) and fix compilation errors if any.
202+
- Every time `.proto` files change, re-generate the code (for example `ignite chain build`) and fix compilation errors if any.
202203
- Update openapi docs from proto using (`scripts/dcl-swagger-gen.sh`). It's recommended to run from container built from [Dockerfile](scripts/Dockerfile).
203204
- **Note1**: colons (`:`) are part of subject-id in PKI module, but colons are not allowed in gRPC REST URLs by default.
204205
`allow_colon_final_segments=true` should be used as a workaround.
205206
So, make sure that `runtime.AssumeColonVerbOpt(false)` in `/x/pki/types/query.pb.gw.go`.
206207
It's usually sufficient to revert the generated changes in `/x/pki/types/query.pb.gw.go`.
207208
- **Note2**: move `compliance_info.pb.go` and `compliance_history_item.pb.go` to `types/compliance` and adjust the import in other places accordingly.
208209
It may be easier just to revert changes in all `*.pb.go` files not affected by your changes in `.proto`
209-
- **Note3**: `starport chain build` needs to be called only if you made manual changes in `.proto` files.
210-
There is no need to call `starport chain build` again once all errors and adjustments above are done. It's sufficient just to build the project via usual ways (such as `make build`)
210+
- **Note3**: `ignite chain build` needs to be called only if you made manual changes in `.proto` files.
211+
There is no need to call `ignite chain build` again once all errors and adjustments above are done. It's sufficient just to build the project via usual ways (such as `make build`)
211212
212213
213214
## Update Cosmos-sdk Version
@@ -221,6 +222,13 @@ Re-generate cosmos base openapi (service API from cosmos exposed in DCL) using [
221222
./scripts/cosmos-swagger-gen.sh tx
222223
```
223224
225+
## Update CometBFT Version
226+
Please note, that we depend on the CometBFT fork https://github.com/zigbee-alliance/cometbft/releases/tag/v0.37.5
227+
due to hotfixes for https://github.com/tendermint/tendermint/issues/7640 and https://github.com/tendermint/tendermint/issues/7641
228+
required for Light Client Proxy.
229+
230+
Also don't forget to update the link to the CometBFT RPC in [Swagger UI](docs/index.html).
231+
224232
## Other
225233

226234
For more details, please have a look at [Cosmos SDK tutorial](https://tutorials.cosmos.network/).

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ DC Ledger is a public permissioned Ledger which can be used for two main use cas
1818

1919
More information about use cases can be found in [DC Ledger Overview](./docs/design/DCL-Overview.pdf) and [Use Case Diagrams](docs/use_cases).
2020

21-
DC Ledger is based on [Tendermint](https://tendermint.com/) and [Cosmos SDK](https://cosmos.network/sdk).
21+
DC Ledger is based on [CometBFT](https://cometbft.com/) and [Cosmos SDK](https://cosmos.network/sdk).
2222

2323
DC Ledger is a public permissioned ledger in the following sense:
2424

@@ -40,7 +40,7 @@ In order to send write transactions to the ledger you need:
4040

4141
### Pool of Nodes
4242

43-
- A network of Tendermint-based validator nodes (Validators and Observers) maintaining the ledger.
43+
- A network of CometBFT-based validator nodes (Validators and Observers) maintaining the ledger.
4444
- Every validator node (`dcld` binary) runs DC Ledger application code (based on Cosmos SDK) implementing the use cases.
4545
- See the proposed deployment in [deployment](docs/deployment.png) and [deployment-detailed](docs/deployment-detailed.png).
4646
- See recommended design for DCL MainNet deployment on AWS in [aws deployment](./docs/deployment-design-aws.md)
@@ -54,7 +54,7 @@ In order to send write transactions to the ledger you need:
5454
- **Private Sentry Node:** a full node to connect other Validator or Sentry nodes only; should not be accessed by clients.
5555
- **Public Sentry Node:** a full node to connect other external full nodes (possibly observer nodes).
5656
- **Observer Node (ON):** a full node that doesn't participate in consensus. Should be used to receive read/write requests from the clients.
57-
- **Light Client Proxy Node**: doesn't contain a full replication of data. Can be used as a proxy to untrusted Full nodes for single-value query requests sent via CLI or Tendermint RPC.
57+
- **Light Client Proxy Node**: doesn't contain a full replication of data. Can be used as a proxy to untrusted Full nodes for single-value query requests sent via CLI or CometBFT RPC.
5858
It will verify all state proofs automatically.
5959
- **Seed Node**: provides a list of peers which a node can connect to.
6060

@@ -64,7 +64,7 @@ See
6464
- [Deployment-detailed](docs/deployment-detailed.png).
6565
- [Deployment Recommendations](https://github.com/zigbee-alliance/distributed-compliance-ledger/wiki/DCL-MainNet-Deployment)
6666
- [Deployment Recommendations for AWS](./docs/deployment-design-aws.md)
67-
- <https://docs.tendermint.com/v0.34/tendermint-core/validators.html>
67+
- <https://docs.cometbft.com/v0.37/core/validators>
6868
- [Run Light Client Proxy](docs/running-light-client-proxy.md)
6969

7070
### Clients
@@ -79,7 +79,7 @@ A Light Client Proxy can be connected to multiple nodes and will verify the stat
7979
- [CLI](#cli)
8080
- [REST](#rest)
8181
- [gRPC](#grpc)
82-
- [Tendermint RPC and Light Client](#tendermint-rpc-and-light-client)
82+
- [CometBFT RPC and Light Client](#cometbft-rpc-and-light-client)
8383

8484
**Please note, that multi-value queries don't have state proofs support and should be sent to trusted nodes only.**
8585

@@ -126,7 +126,7 @@ See [Run local pool](README-DEV.md#run-local-pool) section in [README-DEV.md](RE
126126

127127
Should be used if there are no trusted Observer or Validator nodes to connect.
128128

129-
It can be a proxy for CLI or direct requests from code done via Tendermint RPC.
129+
It can be a proxy for CLI or direct requests from code done via CometBFT RPC.
130130

131131
Please note, that CLI can use a Light Client proxy only for single-value query requests.
132132
A Full Node (Validator or Observer) should be used for multi-value query requests and write requests.
@@ -139,7 +139,7 @@ See [Run Light Client Proxy](docs/running-light-client-proxy.md) for details how
139139

140140
- **There are no state proofs in REST, so REST queries should be sent to trusted Validator or Observer nodes only.**
141141
- OpenAPI specification: <https://zigbee-alliance.github.io/distributed-compliance-ledger/>.
142-
- Any running node exposes a REST API at port `1317`. See <https://docs.cosmos.network/v0.45/core/grpc_rest.html>.
142+
- Any running node exposes a REST API at port `1317`. See <https://docs.cosmos.network/v0.47/learn/advanced/grpc_rest>.
143143
- See [transactions](docs/transactions.md) for a full list of endpoints.
144144
- REST HTTP(S) queries can be directly used for read requests.
145145
See [How to read from the Ledger](docs/transactions.md#how-to-read-from-the-ledger).
@@ -150,23 +150,23 @@ See [Run Light Client Proxy](docs/running-light-client-proxy.md) for details how
150150
### gRPC
151151

152152
- **There are no state proofs in gRPC, so gRPC queries should be sent to trusted Validator or Observer nodes only.**
153-
- Any running node exposes a REST API at port `9090`. See <https://docs.cosmos.network/v0.45/core/grpc_rest.html>.
153+
- Any running node exposes a REST API at port `9090`. See <https://docs.cosmos.network/v0.47/learn/advanced/grpc_rest>.
154154
- A client code can be generated for all popular languages from the proto files [proto](proto), see <https://grpc.io/docs/languages/>.
155155
- The generated client code can be used for read and write requests, i.e. generation and signing of transactions
156156
See [How to read from the Ledger](docs/transactions.md#how-to-read-from-the-ledger) and [How to write to the Ledger](docs/transactions.md#how-to-write-to-the-ledger) for details.
157157

158-
### Tendermint RPC and Light Client
158+
### CometBFT RPC and Light Client
159159

160-
- Tendermint RPC is exposed by every running node at port `26657`. See <https://docs.cosmos.network/v0.45/core/grpc_rest.html#tendermint-rpc>.
161-
- Tendermint RPC supports state proofs. Tendermint's Light Client library can be used to verify the state proofs.
160+
- CometBFT RPC is exposed by every running node at port `26657`. See <https://docs.cosmos.network/v0.47/learn/advanced/grpc_rest#cometbft-rpc>.
161+
- CometBFT RPC supports state proofs. CometBFT's Light Client library can be used to verify the state proofs.
162162
So, if Light Client API is used, then it's possible to communicate with non-trusted nodes.
163163
- Please note, that multi-value queries don't have state proofs support and should be sent to trusted nodes only.
164164
- There are currently no DC Ledger specific API libraries for various platforms and languages,
165165
but they may be provided in the future.
166166
- The following libraries can be used as light clients:
167167
- [Golang Light Client implementation](https://pkg.go.dev/github.com/cometbft/cometbft/light)
168168
- [Rust Light Client implementation](https://docs.rs/cometbft-light-client/0.1.0-alpha.2/cometbft_light_client/)
169-
- Refer to [this doc](./docs/tendermint-rpc.md) to see how to [subscribe](./docs/tendermint-rpc.md#subscribe) to a Tendermint WebSocket based events and/or [query](./docs/tendermint-rpc.md#querying-application-components) an application components.
169+
- Refer to [this doc](./docs/cometbtf-rpc.md) to see how to [subscribe](./docs/cometbtf-rpc.md#subscribe) to a CometBFT WebSocket based events and/or [query](./docs/cometbtf-rpc.md#querying-application-components) an application components.
170170

171171

172172
### Instructions
@@ -227,5 +227,5 @@ the following instructions from [how-to.md](docs/how-to.md) can be used for ever
227227
- [Running Node](docs/running-node.md)
228228
- [Pool Upgrade](docs/pool-upgrade.md)
229229
- [Pool Upgrade How To Guide](docs/pool-upgrade-how-to.md)
230-
- [Tendermint](https://tendermint.com/)
230+
- [CometBFT](https://cometbft.com/)
231231
- [Cosmos SDK](https://cosmos.network/sdk)

app/encoding.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/cosmos/cosmos-sdk/x/auth/tx"
1010
)
1111

12-
// makeEncodingConfig creates an EncodingConfig for an amino based test configuration.
12+
// makeEncodingConfig creates an EncodingConfig for an amino based configuration.
1313
func makeEncodingConfig() params.EncodingConfig {
1414
amino := codec.NewLegacyAmino()
1515
interfaceRegistry := types.NewInterfaceRegistry()
@@ -24,7 +24,7 @@ func makeEncodingConfig() params.EncodingConfig {
2424
}
2525
}
2626

27-
// MakeEncodingConfig creates an EncodingConfig for testing
27+
// MakeEncodingConfig creates an EncodingConfig
2828
func MakeEncodingConfig() params.EncodingConfig {
2929
encodingConfig := makeEncodingConfig()
3030
std.RegisterLegacyAminoCodec(encodingConfig.Amino)

deployment/ansible/roles/bootstrap/defaults/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,5 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15+
16+

deployment/ansible/roles/bootstrap/molecule/default/tests/test_default.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ def test_service(host):
3333
"User=cosmovisor",
3434
"Group=dcl",
3535
'Environment="DAEMON_HOME=/var/lib/dcl/.dcl" "DAEMON_NAME=dcld"',
36-
"ExecStart=/usr/bin/cosmovisor run start",
36+
"ExecStart=/usr/bin/cosmovisor start",
3737
]:
3838
assert prop in svc.content_string

deployment/ansible/roles/configure/defaults/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ client:
2828
# <host>:<port> to Tendermint RPC interface for this chain
2929
node: "tcp://localhost:26657"
3030
# Transaction broadcasting mode (sync|async|block)
31-
broadcast-mode: sync
31+
broadcast-mode: block
3232
config: {}
3333
app: {}

deployment/cosmovisor.service

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ User=ubuntu
1111
Environment="DAEMON_HOME=/var/lib/ubuntu/.dcl"
1212
Environment="DAEMON_NAME=dcld"
1313
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
14-
ExecStart=/usr/bin/cosmovisor run start
14+
ExecStart=/usr/bin/cosmovisor start
1515

1616
[Install]
1717
WantedBy=multi-user.target
File renamed without changes.

docs/how-to.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ Here is the list of supported settings:
4747
- `chain-id <chain id>` - unique chain ID of the network you are going to connect to
4848
- `output <type>` - Output format (text/json)
4949
- `node <node-ip>` - Address `<host>:<port>` of the node to connect.
50-
- `broadcast-mode <mode>` - Write transaction broadcast mode to use (one of: `sync`, `async`, `block`. `block` is default).
50+
- `broadcast-mode <mode>` - Write transaction broadcast mode to use (one of: `sync`, `async`. `sync` is default).
51+
- Note: In `sync` broadcast mode, to get the actual result of transaction(`dcld tx ..`) one more query call with `txHash` must be executed(`dcld query tx=txHash`)
5152

5253
In order to connect the CLI to a DC Ledger Network (Chain), the following parameters should be used:
5354

@@ -336,5 +337,5 @@ Node will be jailed and removed from the active validator set in the following c
336337

337338
Note that jailed node will not be removed from the main index to track validator nodes.
338339
So it is not possible to create a new node with the same `validator address`.
339-
In order to unjail the node and return it to the active tendermint validator set the sufficient number of Trustee's approvals is needed
340+
In order to unjail the node and return it to the active cometbft validator set the sufficient number of Trustee's approvals is needed
340341
(see authorization rules).

docs/running-light-client-proxy.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
Light Client Proxy can be used if there are no trusted Full Nodes (Validator or Observers) a client can connect to.
44

5-
It can be a proxy for CLI or direct requests from code done via Tendermint RPC.
5+
It can be a proxy for CLI or direct requests from code done via CometBFT RPC.
66

77
Please note, that CLI can use a Light Client proxy only for single-value query requests.
88
A Full Node (Validator or Observer) should be used for multi-value query requests and write requests.
99

1010
See the following links for details about a Light Client:
1111

12-
- <https://docs.tendermint.com/v0.34/tendermint-core/light-client.html>
12+
- <https://docs.cometbft.com/main/explanation/core/light-client>
1313

1414
## Running Light Client Proxy - Short
1515

@@ -21,7 +21,7 @@ dcld config node tcp://<light-client-proxy-host>:8888
2121

2222
## Running Light Client Proxy - Detailed
2323

24-
See <https://docs.tendermint.com/v0.34/tendermint-core/light-client.html> for details
24+
See <https://docs.cometbft.com/main/explanation/core/light-client> for details
2525

2626
### 1. Choose Semi-trusted or Non-trusted Nodes for Connection
2727

@@ -36,7 +36,7 @@ dcld light <chain-id> -p tcp://<primary-host>:26657 -w tcp://<witness1-host>:266
3636

3737
Light Client Proxy is started at port `8888` by default. It can be changed with `--laddr` argument.
3838

39-
Light Client Proxy will write some information (about headers) to disk. Default location is `~/.tendermint-light`.
39+
Light Client Proxy will write some information (about headers) to disk. Default location is `~/.cometbft-light`.
4040
It can be changed with `--dir` argument.
4141

4242
Light Client needs initial height and hash it trusts. If no `--height` and `--hash` arguments provided,

docs/running-node.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- `Private Sentry` - Full Node to connect other (external) Validator Nodes ([Sentry Node Architecture](https://forum.cosmos.network/t/sentry-node-architecture-overview/454))
88
- `Public Sentry` - Full Node to connect other (external) Full Nodes
99
- `Observer` - Full Node for serving gRPC / REST / RPC clients
10-
- `Seed` - Full Node for sharing IP addresses of `Public Sentry` Nodes ([Seed Node](https://docs.tendermint.com/))
10+
- `Seed` - Full Node for sharing IP addresses of `Public Sentry` Nodes ([Seed Node](https://docs.cometbft.com/))
1111

1212
## DCL network architecture overview
1313

0 commit comments

Comments
 (0)