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

Commit 816dffd

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

File tree

87 files changed

+1302
-566
lines changed

Some content is hidden

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

87 files changed

+1302
-566
lines changed

docs/build/abci/01-prepare-proposal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ The Cosmos SDK defines the `DefaultProposalHandler` type, which provides applica
2626
`PrepareProposal` and `ProcessProposal` handlers. If you decide to implement your
2727
own `PrepareProposal` handler, you must ensure that the transactions
2828
selected DO NOT exceed the maximum block gas (if set) and the maximum bytes provided
29-
by `req.MaxBytes`.
29+
by `req.MaxTxBytes`.
3030

3131
```go reference
3232
https://github.com/cosmos/cosmos-sdk/blob/v0.53.0/baseapp/abci_utils.go

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ defined in ABCI++.
88
## Extend Vote
99

1010
ABCI 2.0 (colloquially called ABCI++) allows an application to extend a pre-commit vote with arbitrary data. This process does NOT have to be deterministic, and the data returned can be unique to the
11-
validator process. The Cosmos SDK defines [`baseapp.ExtendVoteHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.53.0/types/abci.go#L32):
11+
validator process. The Cosmos SDK defines [`sdk.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`
@@ -49,7 +49,7 @@ validators will share the same view of what vote extensions they verify dependin
4949
on how votes are propagated. See [here](https://github.com/cometbft/cometbft/blob/v0.38.0-rc1/spec/abci/abci++_methods.md#verifyvoteextension)
5050
for more details.
5151

52-
Additionally, please keep in mind that performance can be degraded if vote extensions are too big (https://docs.cometbft.com/v0.38/qa/cometbft-qa-38#vote-extensions-testbed), so we highly recommend a size validation in `VerifyVoteExtensions`.
52+
Additionally, please keep in mind that performance can be degraded if vote extensions are too big (https://docs.cometbft.com/v0.38/qa/cometbft-qa-38#vote-extensions-testbed), so we highly recommend a size validation in `ValidateVoteExtensions`.
5353

5454

5555
## Vote Extension Propagation
@@ -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) (*sdk.ResponsePreBlock, 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
@@ -95,10 +95,10 @@ app.SetPreBlocker(func(ctx sdk.Context, req *abci.FinalizeBlockRequest) error {
9595
result := compute(allVEs)
9696
err := storeVEResult(ctx, result)
9797
if err != nil {
98-
return err
98+
return nil, err
9999
}
100100

101-
return nil
101+
return &sdk.ResponsePreBlock{}, nil
102102
})
103103

104104
```

docs/build/abci/04-checktx.md

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,34 @@ https://github.com/cosmos/cosmos-sdk/blob/31c604762a434c7b676b6a89897ecbd7c4653a
2020

2121
## CheckTx Handler
2222

23-
`CheckTxHandler` allows users to extend the logic of `CheckTx`. `CheckTxHandler` is called by passing context and the transaction bytes received through ABCI. It is required that the handler returns deterministic results given the same transaction bytes.
24-
25-
:::note
26-
we return the raw decoded transaction here to avoid decoding it twice.
27-
:::
23+
`CheckTxHandler` allows applications to extend the logic of `CheckTx`. It is invoked with the ABCI request and a `RunTx` function that executes the standard `CheckTx` pipeline (ante handlers, gas accounting and mempool interaction). The implementation of `CheckTxHandler` MUST be deterministic for a given `RequestCheckTx`.
2824

2925
```go
30-
type CheckTxHandler func(ctx sdk.Context, tx []byte) (Tx, error)
26+
type CheckTxHandler func(RunTx, *abci.RequestCheckTx) (*abci.ResponseCheckTx, error)
3127
```
3228

33-
Setting a custom `CheckTxHandler` is optional. It can be done from your app.go file:
29+
The provided `RunTx` function does not override ante handlers and does not allow changing the execution mode; it simply runs the transaction through the normal `CheckTx` path and returns the result that can be used to construct a `ResponseCheckTx`.
30+
31+
Setting a custom `CheckTxHandler` is optional. It can be done from your `app.go` file by setting the handler on `BaseApp`:
3432

3533
```go
3634
func NewSimApp(
3735
logger log.Logger,
3836
db corestore.KVStoreWithBatch,
39-
traceStore io.Writer,
4037
loadLatest bool,
4138
appOpts servertypes.AppOptions,
4239
baseAppOptions ...func(*baseapp.BaseApp),
4340
) *SimApp {
44-
...
45-
// Create ChecktxHandler
46-
checktxHandler := abci.NewCustomCheckTxHandler(...)
47-
app.SetCheckTxHandler(checktxHandler)
48-
...
41+
...
42+
checkTxOpt := func(app *baseapp.BaseApp) {
43+
app.SetCheckTxHandler(func(runTx sdk.RunTx, req *abci.RequestCheckTx) (*abci.ResponseCheckTx, error) {
44+
// custom pre- or post-processing logic can be added here
45+
return runTx(req.Tx, nil)
46+
})
47+
}
48+
baseAppOptions = append(baseAppOptions, checkTxOpt)
49+
...
4950
}
5051
```
52+
53+
When `RequestCheckTx.Type` is `abci.CheckTxType_New`, the transaction is evaluated for admission into the mempool; when it is `abci.CheckTxType_Recheck`, the existing mempool transaction is re-evaluated and may be removed if it no longer passes validation. Successful `CheckTx` executions update an internal CheckTx state, which is reset when a block is committed.

docs/build/architecture/adr-002-docs-structure.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Accepted
7575
### Neutral
7676

7777
* We need to move a bunch of deprecated stuff to `/_attic` folder.
78-
* We need to integrate content in `docs/sdk/docs/core` in `concepts`.
78+
* We need to integrate content from `docs/sdk/docs/core` into `concepts`.
7979
* We need to move all the content that currently lives in `docs` and does not fit in new structure (like `lotion`, intro material, whitepaper) to the website repository.
8080
* Update `DOCS_README.md`
8181

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-013-metrics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ Proposed
1010

1111
## Context
1212

13-
Telemetry is paramount into debugging and understanding what the application is doing and how it is
13+
Telemetry is paramount to debugging and understanding what the application is doing and how it is
1414
performing. We aim to expose metrics from modules and other core parts of the Cosmos SDK.
1515

1616
In addition, we should aim to support multiple configurable sinks that an operator may choose from.
1717
By default, when telemetry is enabled, the application should track and expose metrics that are
1818
stored in-memory. The operator may choose to enable additional sinks, where we support only
19-
[Prometheus](https://prometheus.io/) for now, as it's battle-tested, simple to setup, open source,
19+
[Prometheus](https://prometheus.io/) for now, as it's battle-tested, simple to set up, open source,
2020
and is rich with ecosystem tooling.
2121

2222
We must also aim to integrate metrics into the Cosmos SDK in the most seamless way possible such that
2323
metrics may be added or removed at will and without much friction. To do this, we will use the
2424
[go-metrics](https://github.com/hashicorp/go-metrics) library.
2525

2626
Finally, operators may enable telemetry along with specific configuration options. If enabled, metrics
27-
will be exposed via `/metrics?format={text|prometheus}` via the API server.
27+
will be exposed at `/metrics?format={text|prometheus}` via the API server.
2828

2929
## Decision
3030

@@ -41,7 +41,7 @@ We will add an additional configuration block to `app.toml` that defines telemet
4141
service-name = {{ .Telemetry.ServiceName }}
4242

4343
# Enabled enables the application telemetry functionality. When enabled,
44-
# an in-memory sink is also enabled by default. Operators may also enabled
44+
# an in-memory sink is also enabled by default. Operators may also enable
4545
# other sinks such as Prometheus.
4646
enabled = {{ .Telemetry.Enabled }}
4747

docs/build/architecture/adr-016-validator-consensus-key-rotation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Also, it should be noted that this ADR includes only the simplest form of consen
3838
* parameters can be decided by governance and stored in genesis file.
3939
* key rotation fee
4040
* a validator should pay `KeyRotationFee` to rotate the consensus key which is calculated as below
41-
* `KeyRotationFee` = (max(`VotingPowerPercentage` *100, 1)* `InitialKeyRotationFee`) * 2^(number of rotations in `ConsPubKeyRotationHistory` in recent unbonding period)
41+
* `KeyRotationFee` = (max(`VotingPowerPercentage` *100, 1)* `InitialKeyRotationFee`) * 2^(number of rotations in `ConsPubKeyRotationHistory` during a recent unbonding period)
4242
* evidence module
4343
* evidence module can search corresponding consensus key for any height from slashing keeper so that it can decide which consensus key is supposed to be used for the given height.
4444
* abci.ValidatorUpdate

docs/build/architecture/adr-022-custom-panic-handling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ It will also make `OutOfGas` case and `default` case one of the middlewares.
2626
`Default` case wraps recovery object to an error and logs it ([example middleware implementation](#recovery-middleware)).
2727

2828
Our project has a sidecar service running alongside the blockchain node (smart contracts virtual machine). It is
29-
essential that node <-> sidecar connectivity stays stable for TXs processing. So when the communication breaks we need
30-
to crash the node and reboot it once the problem is solved. That behaviour makes the node's state machine execution
29+
essential that node <-> sidecar connectivity stays stable for TXs processing. So when the communication breaks, we need
30+
to crash the node and reboot it once the problem is solved. That behavior makes the node's state machine execution
3131
deterministic. As all keeper panics are caught by runTx's `defer()` handler, we have to adjust the BaseApp code
3232
in order to customize it.
3333

@@ -97,7 +97,7 @@ Function receives a `recoveryObj` object and returns:
9797
* (next `recoveryMiddleware`, `nil`) if object wasn't handled (not a target type) by `RecoveryHandler`;
9898
* (`nil`, not nil `error`) if input object was handled and other middlewares in the chain should not be executed;
9999
* (`nil`, `nil`) in case of invalid behavior. Panic recovery might not have been properly handled;
100-
this can be avoided by always using a `default` as a rightmost middleware in the chain (always returns an `error`');
100+
this can be avoided by always using a `default` as a rightmost middleware in the chain (always returns an `error`);
101101

102102
`OutOfGas` middleware example:
103103

@@ -153,7 +153,7 @@ That way we can create a middleware chain which is executed from left to right,
153153

154154
##### BaseApp changes
155155

156-
The `default` middleware chain must exist in a `BaseApp` object. `Baseapp` modifications:
156+
The `default` middleware chain must exist in a `BaseApp` object. `BaseApp` modifications:
157157

158158
```go
159159
type BaseApp struct {

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/enterprise/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

0 commit comments

Comments
 (0)