Co-authored-by: Hieu Vu <72878483+hieuvubk@users.noreply.github.com>
This commit is contained in:
parent
95354cb2e5
commit
3202a79517
2
docs/build/abci/00-introduction.md
vendored
2
docs/build/abci/00-introduction.md
vendored
@ -19,7 +19,7 @@ The 5 methods introduced during ABCI 2.0 (compared to ABCI v0) are:
|
||||
|
||||
Based on validator voting power, CometBFT chooses a block proposer and calls `PrepareProposal` on the block proposer's application (Cosmos SDK). The selected block proposer is responsible for collecting outstanding transactions from the mempool, adhering to the application's specifications. The application can enforce custom transaction ordering and incorporate additional transactions, potentially generated from vote extensions in the previous block.
|
||||
|
||||
To perform this manipulation on the application side, a custom handler must be implemented. By default, the Cosmos SDK provides `PrepareProposalHandler`, used in conjunction with an application specific mempool. A custom handler can be written by application developer, if a noop handler provided, all transactions are considered valid. Please see [this](https://github.com/fatal-fruit/abci-workshop) tutorial for more information on custom handlers.
|
||||
To perform this manipulation on the application side, a custom handler must be implemented. By default, the Cosmos SDK provides `PrepareProposalHandler`, used in conjunction with an application specific mempool. A custom handler can be written by application developer, if a noop handler provided, all transactions are considered valid.
|
||||
|
||||
Please note that vote extensions will only be available on the following height in which vote extensions are enabled. More information about vote extensions can be found [here](https://docs.cosmos.network/main/build/abci/vote-extensions).
|
||||
|
||||
|
||||
4
docs/build/abci/01-prepare-proposal.md
vendored
4
docs/build/abci/01-prepare-proposal.md
vendored
@ -29,7 +29,7 @@ selected DO NOT exceed the maximum block gas (if set) and the maximum bytes prov
|
||||
by `req.MaxBytes`.
|
||||
|
||||
```go reference
|
||||
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go
|
||||
https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/baseapp/abci_utils.go
|
||||
```
|
||||
|
||||
This default implementation can be overridden by the application developer in
|
||||
@ -38,7 +38,7 @@ favor of a custom implementation in [`app_di.go`](https://docs.cosmos.network/ma
|
||||
```go
|
||||
prepareOpt := func(app *baseapp.BaseApp) {
|
||||
abciPropHandler := baseapp.NewDefaultProposalHandler(mempool, app)
|
||||
app.SetPrepareProposal(abciPropHandler.PrepareProposalHandler()))
|
||||
app.SetPrepareProposal(abciPropHandler.PrepareProposalHandler())
|
||||
}
|
||||
|
||||
baseAppOptions = append(baseAppOptions, prepareOpt)
|
||||
|
||||
4
docs/build/abci/02-process-proposal.md
vendored
4
docs/build/abci/02-process-proposal.md
vendored
@ -14,12 +14,12 @@ and `ProcessProposal` for the new proposal.
|
||||
Here is the implementation of the default implementation:
|
||||
|
||||
```go reference
|
||||
https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/abci_utils.go#L153-L159
|
||||
https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/baseapp/abci_utils.go#L224-L231
|
||||
```
|
||||
|
||||
Like `PrepareProposal` this implementation is the default and can be modified by
|
||||
the application developer in [`app_di.go`](https://docs.cosmos.network/main/build/building-apps/app-go-di). If you decide to implement
|
||||
your own `ProcessProposal` handler, you must be sure to ensure that the transactions
|
||||
your own `ProcessProposal` handler, you must ensure that the transactions
|
||||
provided in the proposal DO NOT exceed the maximum block gas and `maxtxbytes` (if set).
|
||||
|
||||
```go
|
||||
|
||||
4
docs/build/abci/03-vote-extensions.md
vendored
4
docs/build/abci/03-vote-extensions.md
vendored
@ -8,7 +8,7 @@ defined in ABCI++.
|
||||
## Extend Vote
|
||||
|
||||
ABCI2.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
|
||||
validator process. The Cosmos SDK defines [`baseapp.ExtendVoteHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.50.1/types/abci.go#L26-L27):
|
||||
validator process. The Cosmos SDK defines [`baseapp.ExtendVoteHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/types/abci.go#L26-L27):
|
||||
|
||||
```go
|
||||
type ExtendVoteHandler func(Context, *abci.ExtendVoteRequest) (*abci.ExtendVoteResponse, error)
|
||||
@ -35,7 +35,7 @@ Click [here](https://docs.cosmos.network/main/build/abci/vote-extensions) if you
|
||||
|
||||
Similar to extending a vote, an application can also verify vote extensions from
|
||||
other validators when validating their pre-commits. For a given vote extension,
|
||||
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):
|
||||
this process MUST be deterministic. The Cosmos SDK defines [`sdk.VerifyVoteExtensionHandler`](https://github.com/cosmos/cosmos-sdk/blob/v0.52.0-beta.1/types/abci.go#L29-L31):
|
||||
|
||||
```go
|
||||
type VerifyVoteExtensionHandler func(Context, *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user