Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.

Commit 74f0dbd

Browse files
tac0turtlegithub-actions[bot]
authored andcommitted
chore: Sync docs from cosmos-sdk/docs
1 parent 4845163 commit 74f0dbd

65 files changed

Lines changed: 599 additions & 342 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/build/abci/03-vote-extensions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ ABCI 2.0 (colloquially called ABCI++) allows an application to extend a pre-comm
1111
validator process. The Cosmos SDK defines [`baseapp.ExtendVoteHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.53.0/types/abci.go#L32):
1212

1313
```go
14-
type ExtendVoteHandler func(Context, *abci.ExtendVoteRequest) (*abci.ExtendVoteResponse, error)
14+
type ExtendVoteHandler func(Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error)
1515
```
1616

1717
An application can set this handler in `app.go` via the `baseapp.SetExtendVoteHandler`
@@ -38,7 +38,7 @@ other validators when validating their pre-commits. For a given vote extension,
3838
this process MUST be deterministic. The Cosmos SDK defines [`sdk.VerifyVoteExtensionHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.1/types/abci.go#L29-L31):
3939

4040
```go
41-
type VerifyVoteExtensionHandler func(Context, *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error)
41+
type VerifyVoteExtensionHandler func(Context, *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error)
4242
```
4343

4444
An application can set this handler in `app.go` via the `baseapp.SetVerifyVoteExtensionHandler`
@@ -78,7 +78,7 @@ will be available to the application during the subsequent `FinalizeBlock` call.
7878
An example of how a pre-FinalizeBlock hook could look like is shown below:
7979

8080
```go
81-
app.SetPreBlocker(func(ctx sdk.Context, req *abci.FinalizeBlockRequest) error {
81+
app.SetPreBlocker(func(ctx sdk.Context, req *abci.RequestFinalizeBlock) error {
8282
allVEs := []VE{} // store all parsed vote extensions here
8383
for _, tx := range req.Txs {
8484
// define a custom function that tries to parse the tx as a vote extension

docs/build/architecture/adr-006-secret-store-replacement.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ This is not desirable for a number of reasons. Perhaps the biggest reason is ins
1515

1616
All modern desktop computers OS (Ubuntu, Debian, MacOS, Windows) provide a built-in secret store that is designed to allow applications to store information that is isolated from all other applications and requires passphrase entry to access the data.
1717

18-
We are seeking solution that provides a common abstraction layer to the many different backends and reasonable fallback for minimal platforms that don’t provide a native secret store.
18+
We are seeking a solution that provides a common abstraction layer to the many different backends and reasonable fallback for minimal platforms that don’t provide a native secret store.
1919

2020
## Decision
2121

docs/build/architecture/adr-030-authz-module.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The concrete use cases which motivated this module include:
2525
delegated stake
2626
* "sub-keys" functionality, as originally proposed in [\#4480](https://github.com/cosmos/cosmos-sdk/issues/4480) which
2727
is a term used to describe the functionality provided by this module together with
28-
the `fee_grant` module from [ADR 029](./adr-029-fee-grant-module.md) and the [group module](https://github.com/cosmos/cosmos-sdk/tree/main/x/group).
28+
the `fee_grant` module from [ADR 029](./adr-029-fee-grant-module.md) and the [group module](https://github.com/cosmos/cosmos-sdk/tree/main/contrib/x/group).
2929

3030
The "sub-keys" functionality roughly refers to the ability for one account to grant some subset of its capabilities to
3131
other accounts with possibly less robust, but easier to use security measures. For instance, a master account representing

docs/build/architecture/adr-038-state-listening.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* 10/14/2022:
88
* Add `ListenCommit`, flatten the state writes in a block to a single batch.
99
* Remove listeners from cache stores, should only listen to `rootmulti.Store`.
10-
* Remove `HaltAppOnDeliveryError()`, the errors are propagated by default, the implementations should return nil if they don't want to propagate errors.
10+
* Remove `HaltAppOnDeliveryError()`, the errors are propagated by default, the implementations should return nil if don't want to propagate errors.
1111
* 26/05/2023: Update with ABCI 2.0
1212

1313
## Status
@@ -20,7 +20,7 @@ This ADR defines a set of changes to enable listening to state changes of indivi
2020

2121
## Context
2222

23-
Currently, KVStore data can be remotely accessed through [Queries](https://docs.cosmos.network/main/build/building-modules/messages-and-queries#queries)
23+
Currently, KVStore data can be remotely accessed through [Queries](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules/messages-and-queries.md#queries)
2424
which proceed either through Tendermint and the ABCI, or through the gRPC server.
2525
In addition to these request/response queries, it would be beneficial to have a means of listening to state changes as they occur in real time.
2626

@@ -40,7 +40,7 @@ type MemoryListener struct {
4040
stateCache []StoreKVPair
4141
}
4242

43-
// NewMemoryListener creates a listener that accumulates the state writes in memory.
43+
// NewMemoryListener creates a listener that accumulate the state writes in memory.
4444
func NewMemoryListener() *MemoryListener {
4545
return &MemoryListener{}
4646
}
@@ -114,7 +114,7 @@ func (s *Store) Delete(key []byte) {
114114

115115
### MultiStore interface updates
116116

117-
We will update the `CommitMultiStore` interface to allow us to wrap a `MemoryListener` to a specific `KVStore`.
117+
We will update the `CommitMultiStore` interface to allow us to wrap a `Memorylistener` to a specific `KVStore`.
118118
Note that the `MemoryListener` will be attached internally by the concrete `rootmulti` implementation.
119119

120120
```go
@@ -224,9 +224,9 @@ so that the service can group the state changes with the ABCI requests.
224224
// ABCIListener is the interface that we're exposing as a streaming service.
225225
type ABCIListener interface {
226226
// ListenFinalizeBlock updates the streaming service with the latest FinalizeBlock messages
227-
ListenFinalizeBlock(ctx context.Context, req abci.FinalizeBlockRequest, res abci.FinalizeBlockResponse) error
228-
// ListenCommit updates the streaming service with the latest Commit messages and state changes
229-
ListenCommit(ctx context.Context, res abci.CommitResponse, changeSet []*StoreKVPair) error
227+
ListenFinalizeBlock(ctx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error
228+
// ListenCommit updates the steaming service with the latest Commit messages and state changes
229+
ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []*StoreKVPair) error
230230
}
231231
```
232232

@@ -267,16 +267,16 @@ We will modify the `FinalizeBlock` and `Commit` methods to pass ABCI requests an
267267
to any streaming service hooks registered with the `BaseApp`.
268268

269269
```go
270-
func (app *BaseApp) FinalizeBlock(req abci.FinalizeBlockRequest) abci.FinalizeBlockResponse {
270+
func (app *BaseApp) FinalizeBlock(req abci.RequestFinalizeBlock) abci.ResponseFinalizeBlock {
271271

272-
var abciRes abci.FinalizeBlockResponse
272+
var abciRes abci.ResponseFinalizeBlock
273273
defer func() {
274274
// call the streaming service hook with the FinalizeBlock messages
275275
for _, abciListener := range app.abciListeners {
276276
ctx := app.finalizeState.ctx
277277
blockHeight := ctx.BlockHeight()
278278
if app.abciListenersAsync {
279-
go func(req abci.FinalizeBlockRequest, res abci.FinalizeBlockResponse) {
279+
go func(req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) {
280280
if err := app.abciListener.FinalizeBlock(blockHeight, req, res); err != nil {
281281
app.logger.Error("FinalizeBlock listening hook failed", "height", blockHeight, "err", err)
282282
}
@@ -299,11 +299,11 @@ func (app *BaseApp) FinalizeBlock(req abci.FinalizeBlockRequest) abci.FinalizeBl
299299
```
300300

301301
```go
302-
func (app *BaseApp) Commit() abci.CommitResponse {
302+
func (app *BaseApp) Commit() abci.ResponseCommit {
303303

304304
...
305305

306-
res := abci.CommitResponse{
306+
res := abci.ResponseCommit{
307307
Data: commitID.Hash,
308308
RetainHeight: retainHeight,
309309
}
@@ -314,7 +314,7 @@ func (app *BaseApp) Commit() abci.CommitResponse {
314314
blockHeight := ctx.BlockHeight()
315315
changeSet := app.cms.PopStateCache()
316316
if app.abciListenersAsync {
317-
go func(res abci.CommitResponse, changeSet []store.StoreKVPair) {
317+
go func(res abci.ResponseCommit, changeSet []store.StoreKVPair) {
318318
if err := app.abciListener.ListenCommit(ctx, res, changeSet); err != nil {
319319
app.logger.Error("ListenCommit listening hook failed", "height", blockHeight, "err", err)
320320
}
@@ -433,13 +433,13 @@ type GRPCClient struct {
433433
client ABCIListenerServiceClient
434434
}
435435

436-
func (m *GRPCClient) ListenFinalizeBlock(goCtx context.Context, req abci.FinalizeBlockRequest, res abci.FinalizeBlockResponse) error {
436+
func (m *GRPCClient) ListenFinalizeBlock(goCtx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error {
437437
ctx := sdk.UnwrapSDKContext(goCtx)
438438
_, err := m.client.ListenDeliverTx(ctx, &ListenDeliverTxRequest{BlockHeight: ctx.BlockHeight(), Req: req, Res: res})
439439
return err
440440
}
441441

442-
func (m *GRPCClient) ListenCommit(goCtx context.Context, res abci.CommitResponse, changeSet []store.StoreKVPair) error {
442+
func (m *GRPCClient) ListenCommit(goCtx context.Context, res abci.ResponseCommit, changeSet []store.StoreKVPair) error {
443443
ctx := sdk.UnwrapSDKContext(goCtx)
444444
_, err := m.client.ListenCommit(ctx, &ListenCommitRequest{BlockHeight: ctx.BlockHeight(), Res: res, ChangeSet: changeSet})
445445
return err
@@ -471,11 +471,11 @@ And the pre-compiled Go plugin `Impl`(*this is only used for plugins that are wr
471471
// ABCIListener is the implementation of the baseapp.ABCIListener interface
472472
type ABCIListener struct{}
473473

474-
func (m *ABCIListenerPlugin) ListenFinalizeBlock(ctx context.Context, req abci.FinalizeBlockRequest, res abci.FinalizeBlockResponse) error {
474+
func (m *ABCIListenerPlugin) ListenFinalizeBlock(ctx context.Context, req abci.RequestFinalizeBlock, res abci.ResponseFinalizeBlock) error {
475475
// send data to external system
476476
}
477477

478-
func (m *ABCIListenerPlugin) ListenCommit(ctx context.Context, res abci.CommitResponse, changeSet []store.StoreKVPair) error {
478+
func (m *ABCIListenerPlugin) ListenCommit(ctx context.Context, res abci.ResponseCommit, changeSet []store.StoreKVPair) error {
479479
// send data to external system
480480
}
481481

@@ -529,7 +529,7 @@ func NewStreamingPlugin(name string, logLevel string) (interface{}, error) {
529529

530530
We propose a `RegisterStreamingPlugin` function for the App to register `NewStreamingPlugin`s with the App's BaseApp.
531531
Streaming plugins can be of `Any` type; therefore, the function takes in an interface vs a concrete type.
532-
For example, we could have plugins of `ABCIListener`, `WasmListener` or `IBCListener`. Note that `RegisterStreamingPlugin` function
532+
For example, we could have plugins of `ABCIListener`, `WasmListener` or `IBCListener`. Note that `RegisterStreamingPluing` function
533533
is helper function and not a requirement. Plugin registration can easily be moved from the App to the BaseApp directly.
534534

535535
```go
@@ -720,5 +720,5 @@ These changes will provide a means of subscribing to KVStore state changes in re
720720
721721
### Neutral
722722
723-
* Introduces additionalbut optionalcomplexity to configuring and running a cosmos application
723+
* Introduces additional- but optional- complexity to configuring and running a cosmos application
724724
* If an application developer opts to use these features to expose data, they need to be aware of the ramifications/risks of that data exposure as it pertains to the specifics of their application

docs/build/architecture/adr-040-storage-and-smt-state-commitments.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,16 @@ A new database snapshot will be created in every `EndBlocker` and identified by
9292
NOTE: `Commit` must be called exactly once per block. Otherwise we risk going out of sync for the version number and block height.
9393
NOTE: For the Cosmos SDK storage, we may consider splitting that interface into `Committer` and `PruningCommitter` - only the multiroot should implement `PruningCommitter` (cache and prefix store don't need pruning).
9494

95-
Number of historical versions for `abci.QueryRequest` and state sync snapshots is part of a node configuration, not a chain configuration (configuration implied by the blockchain consensus). A configuration should allow to specify number of past blocks and number of past blocks modulo some number (eg: 100 past blocks and one snapshot every 100 blocks for past 2000 blocks). Archival nodes can keep all past versions.
95+
Number of historical versions for `abci.RequestQuery` and state sync snapshots is part of a node configuration, not a chain configuration (configuration implied by the blockchain consensus). A configuration should allow to specify number of past blocks and number of past blocks modulo some number (eg: 100 past blocks and one snapshot every 100 blocks for past 2000 blocks). Archival nodes can keep all past versions.
9696

9797
Pruning old snapshots is effectively done by a database. Whenever we update a record in `SC`, SMT won't update nodes - instead it creates new nodes on the update path, without removing the old one. Since we are snapshotting each block, we need to change that mechanism to immediately remove orphaned nodes from the database. This is a safe operation - snapshots will keep track of the records and make it available when accessing past versions.
9898

9999
To manage the active snapshots we will either use a DB _max number of snapshots_ option (if available), or we will remove DB snapshots in the `EndBlocker`. The latter option can be done efficiently by identifying snapshots with block height and calling a store function to remove past versions.
100100

101101
#### Accessing old state versions
102102

103-
One of the functional requirements is to access old state. This is done through `abci.QueryRequest` structure. The version is specified by a block height (so we query for an object by a key `K` at block height `H`). The number of old versions supported for `abci.QueryRequest` is configurable. Accessing an old state is done by using available snapshots.
104-
`abci.QueryRequest` doesn't need old state of `SC` unless the `prove=true` parameter is set. The SMT merkle proof must be included in the `abci.QueryResponse` only if both `SC` and `SS` have a snapshot for requested version.
103+
One of the functional requirements is to access old state. This is done through `abci.RequestQuery` structure. The version is specified by a block height (so we query for an object by a key `K` at block height `H`). The number of old versions supported for `abci.RequestQuery` is configurable. Accessing an old state is done by using available snapshots.
104+
`abci.RequestQuery` doesn't need old state of `SC` unless the `prove=true` parameter is set. The SMT merkle proof must be included in the `abci.ResponseQuery` only if both `SC` and `SS` have a snapshot for requested version.
105105

106106
Moreover, Cosmos SDK could provide a way to directly access a historical state. However, a state machine shouldn't do that - since the number of snapshots is configurable, it would lead to nondeterministic execution.
107107

@@ -192,7 +192,7 @@ The presented workaround can be used until the IBC module is fully upgraded to s
192192

193193
We consider a compression of prefix keys by creating a mapping from module key to an integer, and serializing the integer using varint coding. Varint coding assures that different values don't have common byte prefix. For Merkle Proofs we can't use prefix compression - so it should only apply for the `SS` keys. Moreover, the prefix compression should be only applied for the module namespace. More precisely:
194194

195-
* each module has it's own namespace;
195+
* each module has its own namespace;
196196
* when accessing a module namespace we create a KVStore with embedded prefix;
197197
* that prefix will be compressed only when accessing and managing `SS`.
198198

@@ -279,7 +279,7 @@ We were discussing use case where modules can use a support database, which is n
279279
## References
280280

281281
* [IAVL What's Next?](https://github.com/cosmos/cosmos-sdk/issues/7100)
282-
* [IAVL overview](https://docs.google.com/document/d/16Z_hW2rSAmoyMENO-RlAhQjAG3mSNKsQueMnKpmcBv0/edit#heading=h.yd2th7x3o1iv) of it's state v0.15
282+
* [IAVL overview](https://docs.google.com/document/d/16Z_hW2rSAmoyMENO-RlAhQjAG3mSNKsQueMnKpmcBv0/edit#heading=h.yd2th7x3o1iv) of its state v0.15
283283
* [State commitments and storage report](https://paper.dropbox.com/published/State-commitments-and-storage-review--BDvA1MLwRtOx55KRihJ5xxLbBw-KeEB7eOd11pNrZvVtqUgL3h)
284284
* [Celestia (LazyLedger) SMT](https://github.com/lazyledger/smt)
285285
* Facebook Diem (Libra) SMT [design](https://developers.diem.com/papers/jellyfish-merkle-tree/2021-01-14.pdf)

docs/build/architecture/adr-048-consensus-fees.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This ADR describes a flexible mechanism to maintain a consensus level gas prices
1414

1515
## Context
1616

17-
Currently, each validator configures it's own `minimal-gas-prices` in `app.yaml`. But setting a proper minimal gas price is critical to protect network from dos attack, and it's hard for all the validators to pick a sensible value, so we propose to maintain a gas price in consensus level.
17+
Currently, each validator configures its own `minimal-gas-prices` in `app.yaml`. But setting a proper minimal gas price is critical to protect network from DoS attack, and it's hard for all the validators to pick a sensible value, so we propose to maintain a gas price in consensus level.
1818

1919
Since tendermint 0.34.20 has supported mempool prioritization, we can take advantage of that to implement more sophisticated gas fee system.
2020

docs/build/architecture/adr-049-state-sync-hooks.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ type ExtensionPayloadReader = func() ([]byte, error)
116116
type ExtensionPayloadWriter = func([]byte) error
117117

118118
// ExtensionSnapshotter is an extension Snapshotter that is appended to the snapshot stream.
119-
// ExtensionSnapshotter has an unique name and manages it's own internal formats.
119+
// ExtensionSnapshotter has a unique name and manages its own internal formats.
120120
type ExtensionSnapshotter interface {
121121
// SnapshotName returns the name of snapshotter, it should be unique in the manager.
122122
SnapshotName() string

docs/build/architecture/adr-059-test-scopes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ exercises [HandleEquivocationEvidence](https://github.com/cosmos/cosmos-sdk/blob
9898
keeper.
9999

100100
Example 3 - Integration suite app configurations may also be specified via golang (not
101-
YAML as above) [statically](https://github.com/cosmos/cosmos-sdk/blob/main/x/nft/testutil/app_config.go) or [dynamically](https://github.com/cosmos/cosmos-sdk/blob/8c23f6f957d1c0bedd314806d1ac65bea59b084c/tests/integration/bank/keeper/keeper_test.go#L129-L134).
101+
YAML as above) [statically](https://github.com/cosmos/cosmos-sdk/blob/main/contrib/x/nft/testutil/app_config.go) or [dynamically](https://github.com/cosmos/cosmos-sdk/blob/8c23f6f957d1c0bedd314806d1ac65bea59b084c/tests/integration/bank/keeper/keeper_test.go#L129-L134).
102102

103103
#### Limitations
104104

docs/build/architecture/adr-060-abci-1.0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ transactions entirely with other transactions.
137137

138138
When evaluating transactions from `RequestPrepareProposal`, the application will
139139
ignore *ALL* transactions sent to it in the request and instead reap up to
140-
`RequestPrepareProposal.max_tx_bytes` from it's own mempool.
140+
`RequestPrepareProposal.max_tx_bytes` from its own mempool.
141141

142142
Since an application can technically insert or inject transactions on `Insert`
143143
during `CheckTx` execution, it is recommended that applications ensure transaction
@@ -169,7 +169,7 @@ Instead, we will define an additional ABCI interface method on the existing
169169
or `EndBlock`. This new interface method will be defined as follows:
170170

171171
```go
172-
ProcessProposal(sdk.Context, abci.ProcessProposalRequest) error {}
172+
ProcessProposal(sdk.Context, abci.RequestProcessProposal) error {}
173173
```
174174

175175
Note, we must call `ProcessProposal` with a new internal branched state on the

docs/build/architecture/adr-063-core-module-api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ func NewKeeper(logger log.Logger) Keeper {
192192
}
193193
```
194194

195-
```
196-
197195
### Core `AppModule` extension interfaces
198196

199197

0 commit comments

Comments
 (0)