From aee5cab8340b9e5239136a1ff1b2a943ca2e375f Mon Sep 17 00:00:00 2001 From: tac0turtle <24299864+tac0turtle@users.noreply.github.com> Date: Wed, 10 Jul 2024 12:02:35 +0000 Subject: [PATCH] chore: Sync docs from cosmos-sdk/docs --- .../adr-014-proportional-slashing.md | 2 +- .../architecture/adr-039-epoched-staking.md | 2 +- .../architecture/adr-049-state-sync-hooks.md | 2 +- docs/build/building-modules/11-structure.md | 45 +- docs/build/tooling/01-cosmovisor.md | 2 +- docs/learn/advanced/00-baseapp.md | 5 +- docs/learn/advanced/01-transactions.md | 5 +- docs/learn/advanced/02-context.md | 6 +- docs/learn/advanced/03-node.md | 2 +- docs/learn/advanced/05-encoding.md | 2 - docs/learn/advanced/10-ocap.md | 2 - docs/learn/beginner/01-tx-lifecycle.md | 2 +- docs/learn/beginner/02-query-lifecycle.md | 2 +- docs/learn/beginner/03-accounts.md | 2 +- docs/learn/beginner/04-gas-fees.md | 2 +- docs/learn/intro/01-why-app-specific.md | 2 +- openapi/swagger.yaml | 1055 +++++++++++++++-- 17 files changed, 1019 insertions(+), 121 deletions(-) diff --git a/docs/build/architecture/adr-014-proportional-slashing.md b/docs/build/architecture/adr-014-proportional-slashing.md index 976136a9f..d9aeffb80 100644 --- a/docs/build/architecture/adr-014-proportional-slashing.md +++ b/docs/build/architecture/adr-014-proportional-slashing.md @@ -65,7 +65,7 @@ Whenever a new slash occurs, a `SlashEvent` struct is created with the faulting We then will iterate over all the SlashEvents in the queue, adding their `ValidatorVotingPercent` to calculate the new percent to slash all the validators in the queue at, using the "Square of Sum of Roots" formula introduced above. -Once we have the `NewSlashPercent`, we then iterate over all the `SlashEvent`s in the queue once again, and if `NewSlashPercent > SlashedSoFar` for that SlashEvent, we call the `staking.Slash(slashEvent.Address, slashEvent.Power, Math.Min(Math.Max(minSlashPercent, NewSlashPercent - SlashedSoFar), maxSlashPercent)` (we pass in the power of the validator before any slashes occurred, so that we slash the right amount of tokens). We then set `SlashEvent.SlashedSoFar` amount to `NewSlashPercent`. +Once we have the `NewSlashPercent`, we then iterate over all the `SlashEvent`s in the queue once again, and if `NewSlashPercent > SlashedSoFar` for that SlashEvent, we call the `staking.Slash(slashEvent.Address, slashEvent.Power, Math.Min(Math.Max(minSlashPercent, NewSlashPercent - SlashedSoFar), maxSlashPercent))` (we pass in the power of the validator before any slashes occurred, so that we slash the right amount of tokens). We then set `SlashEvent.SlashedSoFar` amount to `NewSlashPercent`. ## Status diff --git a/docs/build/architecture/adr-039-epoched-staking.md b/docs/build/architecture/adr-039-epoched-staking.md index c343ac514..bfdddbe20 100644 --- a/docs/build/architecture/adr-039-epoched-staking.md +++ b/docs/build/architecture/adr-039-epoched-staking.md @@ -21,7 +21,7 @@ This ADR updates the proof of stake module to buffer the staking weight updates The current proof of stake module takes the design decision to apply staking weight changes to the consensus engine immediately. This means that delegations and unbonds get applied immediately to the validator set. This decision was primarily done as it was implementationally simplest, and because we at the time believed that this would lead to better UX for clients. -An alternative design choice is to allow buffering staking updates (delegations, unbonds, validators joining) for a number of blocks. This 'epoch'd proof of stake consensus provides the guarantee that the consensus weights for validators will not change mid-epoch, except in the event of a slash condition. +An alternative design choice is to allow buffering staking updates (delegations, unbonds, validators joining) for a number of blocks. This 'epoch'ed proof of stake consensus provides the guarantee that the consensus weights for validators will not change mid-epoch, except in the event of a slash condition. Additionally, the UX hurdle may not be as significant as was previously thought. This is because it is possible to provide users immediate acknowledgement that their bond was recorded and will be executed. diff --git a/docs/build/architecture/adr-049-state-sync-hooks.md b/docs/build/architecture/adr-049-state-sync-hooks.md index 3fb0b1850..50c551ea2 100644 --- a/docs/build/architecture/adr-049-state-sync-hooks.md +++ b/docs/build/architecture/adr-049-state-sync-hooks.md @@ -139,7 +139,7 @@ type ExtensionSnapshotter interface { ## Consequences -As a result of this implementation, we are able to create snapshots of binary chunk stream for the state that we maintain outside of the IAVL Tree, CosmWasm blobs for example. And new clients are able to fetch sanpshots of state for all modules that have implemented the corresponding interface from peer nodes. +As a result of this implementation, we are able to create snapshots of binary chunk stream for the state that we maintain outside of the IAVL Tree, CosmWasm blobs for example. And new clients are able to fetch snapshots of state for all modules that have implemented the corresponding interface from peer nodes. ### Backwards Compatibility diff --git a/docs/build/building-modules/11-structure.md b/docs/build/building-modules/11-structure.md index 6b66f5380..95750c4e4 100644 --- a/docs/build/building-modules/11-structure.md +++ b/docs/build/building-modules/11-structure.md @@ -50,29 +50,29 @@ x/{module_name} │   ├── keys.go │   ├── msg_server.go │   └── querier.go -├── module -│   └── module.go -│   └── abci.go -│   └── autocli.go -│   └── depinject.go ├── simulation │   ├── decoder.go │   ├── genesis.go │   ├── operations.go │   └── params.go -├── {module_name}.pb.go -├── codec.go -├── errors.go -├── events.go -├── events.pb.go -├── expected_keepers.go -├── genesis.go -├── genesis.pb.go -├── keys.go -├── msgs.go -├── params.go -├── query.pb.go -├── tx.pb.go +├── types +│   ├── {module_name}.pb.go +│ ├── codec.go +│ ├── errors.go +│ ├── events.go +│ ├── events.pb.go +│ ├── expected_keepers.go +│ ├── genesis.go +│ ├── genesis.pb.go +│ ├── keys.go +│ ├── msgs.go +│ ├── params.go +│ ├── query.pb.go +│ └── tx.pb.go +├── module.go +├── abci.go +├── autocli.go +├── depinject.go └── README.md ``` @@ -80,11 +80,9 @@ x/{module_name} * `exported/`: The module's exported types - typically interface types. If a module relies on keepers from another module, it is expected to receive the keepers as interface contracts through the `expected_keepers.go` file (see below) in order to avoid a direct dependency on the module implementing the keepers. However, these interface contracts can define methods that operate on and/or return types that are specific to the module that is implementing the keepers and this is where `exported/` comes into play. The interface types that are defined in `exported/` use canonical types, allowing for the module to receive the keepers as interface contracts through the `expected_keepers.go` file. This pattern allows for code to remain DRY and also alleviates import cycle chaos. * `keeper/`: The module's `Keeper` and `MsgServer` implementation. * `abci.go`: The module's `BeginBlocker` and `EndBlocker` implementations (this file is only required if `BeginBlocker` and/or `EndBlocker` need to be defined). -* `module/`: The module's `AppModule` implementation. - * `autocli.go`: The module [autocli](https://docs.cosmos.network/main/core/autocli) options. * `simulation/`: The module's [simulation](./14-simulator.md) package defines functions used by the blockchain simulator application (`simapp`). * `README.md`: The module's specification documents outlining important concepts, state storage structure, and message and event type definitions. Learn more how to write module specs in the [spec guidelines](../spec/SPEC_MODULE.md). -* The root directory includes type definitions for messages, events, and genesis state, including the type definitions generated by Protocol Buffers. +* `types/`: includes type definitions for messages, events, and genesis state, including the type definitions generated by Protocol Buffers. * `codec.go`: The module's registry methods for interface types. * `errors.go`: The module's sentinel errors. * `events.go`: The module's event types and constructors. @@ -94,3 +92,8 @@ x/{module_name} * `msgs.go`: The module's message type definitions and associated methods. * `params.go`: The module's parameter type definitions and associated methods. * `*.pb.go`: The module's type definitions generated by Protocol Buffers (as defined in the respective `*.proto` files above). +* The root directory includes the module's `AppModule` implementation. + * `autocli.go`: The module [autocli](https://docs.cosmos.network/main/core/autocli) options. + * `depinject.go`: The module [depinject](./15-depinject.md#type-definition) options. + +> Note: although the above pattern is followed by most of the Cosmos SDK modules, there are some modules that don't follow this pattern. E.g `x/group` and `x/nft` dont have a `types` folder, instead all of the type definitions for messages, events, and genesis state are live in the root directory and the module's `AppModule` implementation lives in the `module` folder. diff --git a/docs/build/tooling/01-cosmovisor.md b/docs/build/tooling/01-cosmovisor.md index 0d771a6b1..06c7e61c9 100644 --- a/docs/build/tooling/01-cosmovisor.md +++ b/docs/build/tooling/01-cosmovisor.md @@ -130,7 +130,7 @@ Use of `cosmovisor` without one of the action arguments is deprecated. For backw The `cosmovisor/` directory includes a subdirectory for each version of the application (i.e. `genesis` or `upgrades/`). 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/`). The `name` variable in `upgrades/` is the lowercased URI-encoded name of the upgrade as specified in the upgrade module plan. Note that the upgrade name path are normalized to be lowercased: for instance, `MyUpgrade` is normalized to `myupgrade`, and its path is `upgrades/myupgrade`. -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/.simapp`) 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 configuration like the following: +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/.simapp`) or the data directory specified with the `--home` flag. `$DAEMON_HOME` is dependent of the data directory and must be set to the same directory as the data directory, you will end up with a configuration like the following: ```text .simapp diff --git a/docs/learn/advanced/00-baseapp.md b/docs/learn/advanced/00-baseapp.md index 418ec64d3..e59eaf4e6 100644 --- a/docs/learn/advanced/00-baseapp.md +++ b/docs/learn/advanced/00-baseapp.md @@ -49,9 +49,7 @@ management logic. The `BaseApp` type holds many important parameters for any Cosmos SDK based application. -```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/baseapp.go#L58-L182 -``` Let us go through the most important components. @@ -492,9 +490,8 @@ The `FinalizeBlock` ABCI function defined in `BaseApp` does the bulk of the stat Instead of using their `checkState`, full-nodes use `finalizeblock`: -```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/baseapp/baseapp.go#LL708-L743 -``` + Transaction execution within `FinalizeBlock` performs the **exact same steps as `CheckTx`**, with a little caveat at step 3 and the addition of a fifth step: diff --git a/docs/learn/advanced/01-transactions.md b/docs/learn/advanced/01-transactions.md index a8b60ff09..6bb246cfc 100644 --- a/docs/learn/advanced/01-transactions.md +++ b/docs/learn/advanced/01-transactions.md @@ -31,7 +31,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/tx_msg.go#L51-L5 It contains the following methods: * **GetMsgs:** unwraps the transaction and returns a list of contained `sdk.Msg`s - one transaction may have one or multiple messages, which are defined by module developers. -* **ValidateBasic:** lightweight, [_stateless_](../beginner/01-tx-lifecycle.md#types-of-checks) checks used by ABCI messages [`CheckTx`](./00-baseapp.md#checktx) and [`DeliverTx`](./00-baseapp.md#delivertx) to make sure transactions are not invalid. For example, the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth) module's `ValidateBasic` function checks that its transactions are signed by the correct number of signers and that the fees do not exceed what the user's maximum. When [`runTx`](./00-baseapp.md#runtx) is checking a transaction created from the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth/) module, it first runs `ValidateBasic` on each message, then runs the `auth` module AnteHandler which calls `ValidateBasic` for the transaction itself. +* **ValidateBasic:** lightweight, [_stateless_](../beginner/01-tx-lifecycle.md#types-of-checks) checks used by ABCI messages [`CheckTx`](./00-baseapp.md#checktx) and [`DeliverTx`](./00-baseapp.md#delivertx) to make sure transactions are not invalid. For example, the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth) module's `ValidateBasic` function checks that its transactions are signed by the correct number of signers and that the fees do not exceed the user's maximum. When [`runTx`](./00-baseapp.md#runtx) is checking a transaction created from the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth/) module, it first runs `ValidateBasic` on each message, then runs the `auth` module AnteHandler which calls `ValidateBasic` for the transaction itself. :::note This function is different from the deprecated `sdk.Msg` [`ValidateBasic`](../beginner/01-tx-lifecycle.md#ValidateBasic) methods, which was performing basic validity checks on messages only. @@ -187,9 +187,8 @@ simd tx send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake [gRPC](https://grpc.io) is the main component for the Cosmos SDK's RPC layer. Its principal usage is in the context of modules' [`Query` services](../../build/building-modules/04-query-services.md). However, the Cosmos SDK also exposes a few other module-agnostic gRPC services, one of them being the `Tx` service: -```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/service.proto -``` + The `Tx` service exposes a handful of utility functions, such as simulating a transaction or querying a transaction, and also one method to broadcast transactions. diff --git a/docs/learn/advanced/02-context.md b/docs/learn/advanced/02-context.md index 73315e3de..33d530b52 100644 --- a/docs/learn/advanced/02-context.md +++ b/docs/learn/advanced/02-context.md @@ -39,7 +39,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/context.go#L41-L `Events` by defining various `Types` and `Attributes` or use the common definitions found in `types/`. Clients can subscribe or query for these `Events`. These `Events` are collected throughout `FinalizeBlock` and are returned to CometBFT for indexing. * **Priority:** The transaction priority, only relevant in `CheckTx`. * **KV `GasConfig`:** Enables applications to set a custom `GasConfig` for the `KVStore`. -* **Transient KV `GasConfig`:** Enables applications to set a custom `GasConfig` for the transiant `KVStore`. +* **Transient KV `GasConfig`:** Enables applications to set a custom `GasConfig` for the transient `KVStore`. * **StreamingManager:** The streamingManager field provides access to the streaming manager, which allows modules to subscribe to state changes emitted by the blockchain. The streaming manager is used by the state listening API, which is described in [ADR 038](https://docs.cosmos.network/main/architecture/adr-038-state-listening). * **CometInfo:** A lightweight field that contains information about the current block, such as the block height, time, and hash. This information can be used for validating evidence, providing historical data, and enhancing the user experience. For further details see [here](https://github.com/cosmos/cosmos-sdk/blob/main/core/comet/service.go#L14). * **HeaderInfo:** The `headerInfo` field contains information about the current block header, such as the chain ID, gas limit, and timestamp. For further details see [here](https://github.com/cosmos/cosmos-sdk/blob/main/core/header/service.go#L14). @@ -54,7 +54,7 @@ Contexts are intended to be **immutable**; they should never be edited. Instead, to create a child context from its parent using a `With` function. For example: ```go -childCtx = parentCtx.WithBlockHeader(header) +childCtx := parentCtx.WithBlockHeader(header) ``` The [Golang Context Package](https://pkg.go.dev/context) documentation instructs developers to @@ -71,7 +71,7 @@ goes wrong. The pattern of usage for a Context is as follows: 1. A process receives a Context `ctx` from its parent process, which provides information needed to perform the process. -2. The `ctx.ms` is a **branched store**, i.e. a branch of the [multistore](./04-store.md#multistore) is made so that the process can make changes to the state as it executes, without changing the original`ctx.ms`. This is useful to protect the underlying multistore in case the changes need to be reverted at some point in the execution. +2. The `ctx.ms` is a **branched store**, i.e. a branch of the [multistore](./04-store.md#multistore) is made so that the process can make changes to the state as it executes, without changing the original `ctx.ms`. This is useful to protect the underlying multistore in case the changes need to be reverted at some point in the execution. 3. The process may read and write from `ctx` as it is executing. It may call a subprocess and pass `ctx` to it as needed. 4. When a subprocess returns, it checks if the result is a success or failure. If a failure, nothing diff --git a/docs/learn/advanced/03-node.md b/docs/learn/advanced/03-node.md index e1330e503..65dc86793 100644 --- a/docs/learn/advanced/03-node.md +++ b/docs/learn/advanced/03-node.md @@ -55,7 +55,7 @@ simd start As a reminder, the full-node is composed of three conceptual layers: the networking layer, the consensus layer and the application layer. The first two are generally bundled together in an entity called the consensus engine (CometBFT by default), while the third is the state-machine defined with the help of the Cosmos SDK. Currently, the Cosmos SDK uses CometBFT as the default consensus engine, meaning the start command is implemented to boot up a CometBFT node. -The flow of the `start` command is pretty straightforward. First, it retrieves the `config` from the `context` in order to open the `db` (a [`leveldb`](https://github.com/syndtr/goleveldb) instance by default). This `db` contains the latest known state of the application (empty if the application is started from the first time. +The flow of the `start` command is pretty straightforward. First, it retrieves the `config` from the `context` in order to open the `db` (a [`levelDB`](https://github.com/syndtr/goleveldb) instance by default). This `db` contains the latest known state of the application (empty if the application is started from the first time). With the `db`, the `start` command creates a new instance of the application using an `appCreator` function: diff --git a/docs/learn/advanced/05-encoding.md b/docs/learn/advanced/05-encoding.md index 8b37c2bce..6df0dda2e 100644 --- a/docs/learn/advanced/05-encoding.md +++ b/docs/learn/advanced/05-encoding.md @@ -83,9 +83,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/tx_msg.go#L91-L9 A standard implementation of both these objects can be found in the [`auth/tx` module](https://docs.cosmos.network/main/build/modules/auth#transactions): -```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/tx/decoder.go -``` ```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/tx/encoder.go diff --git a/docs/learn/advanced/10-ocap.md b/docs/learn/advanced/10-ocap.md index c5a472b7f..35bc3ecd4 100644 --- a/docs/learn/advanced/10-ocap.md +++ b/docs/learn/advanced/10-ocap.md @@ -67,9 +67,7 @@ sumValue := externalModule.ComputeSumValue(*account) In the Cosmos SDK, you can see the application of this principle in simapp. -```go reference https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/simapp/app.go -``` The following diagram shows the current dependencies between keepers. diff --git a/docs/learn/beginner/01-tx-lifecycle.md b/docs/learn/beginner/01-tx-lifecycle.md index 100ae7d00..4888baa60 100644 --- a/docs/learn/beginner/01-tx-lifecycle.md +++ b/docs/learn/beginner/01-tx-lifecycle.md @@ -53,7 +53,7 @@ The command-line is an easy way to interact with an application, but `Tx` can al ## Transaction Broadcasting -This is the next phase, where a transactison is sent from a client (such as a wallet or a command-line interface) to the network of nodes. This process is consensus-agnostic, meaning it can work with various consensus engines. +This is the next phase, where a transaction is sent from a client (such as a wallet or a command-line interface) to the network of nodes. This process is consensus-agnostic, meaning it can work with various consensus engines. Below are the steps involved in transaction broadcasting: diff --git a/docs/learn/beginner/02-query-lifecycle.md b/docs/learn/beginner/02-query-lifecycle.md index 4fbaf7ce4..2c3600f7f 100644 --- a/docs/learn/beginner/02-query-lifecycle.md +++ b/docs/learn/beginner/02-query-lifecycle.md @@ -47,7 +47,7 @@ One such tool is [grpcurl](https://github.com/fullstorydev/grpcurl), and a gRPC ```bash grpcurl \ - -plaintext # We want results in plain test + -plaintext # We want results in plain text -import-path ./proto \ # Import these .proto files -proto ./proto/cosmos/staking/v1beta1/query.proto \ # Look into this .proto file for the Query protobuf service -d '{"address":"$MY_DELEGATOR"}' \ # Query arguments diff --git a/docs/learn/beginner/03-accounts.md b/docs/learn/beginner/03-accounts.md index eb8ff47d4..b9f7eefa6 100644 --- a/docs/learn/beginner/03-accounts.md +++ b/docs/learn/beginner/03-accounts.md @@ -135,7 +135,7 @@ A few notes on the `Keyring` methods: https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta1/tx.proto#L50-L66 ``` -* `NewAccount(uid, mnemonic, bip39Passphrase, hdPath string, algo SignatureAlgo) (*Record, error)` creates a new account based on the [`bip44 path`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) and persists it on disk. The `PrivKey` is **never stored unencrypted**, instead it is [encrypted with a passphrase](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/armor.go) before being persisted. In the context of this method, the key type and sequence number refer to the segment of the BIP44 derivation path (for example, `0`, `1`, `2`, ...) that is used to derive a private and a public key from the mnemonic. Using the same mnemonic and derivation path, the same `PrivKey`, `PubKey` and `Address` is generated. The following keys are supported by the keyring: +* `NewAccount(uid, mnemonic, bip39Passphrase, hdPath string, algo SignatureAlgo) (*Record, error)` creates a new account based on the [`bip44 path`](https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki) and persists it on disk. The `PrivKey` is **never stored unencrypted**, instead it is [encrypted with a passphrase](https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/crypto/armor.go) before being persisted. In the context of this method, the key type and sequence number refers to the segment of the BIP44 derivation path (for example, `0`, `1`, `2`, ...) that is used to derive a private and a public key from the mnemonic. Using the same mnemonic and derivation path, the same `PrivKey`, `PubKey` and `Address` is generated. The following keys are supported by the keyring: * `secp256k1` * `ed25519` diff --git a/docs/learn/beginner/04-gas-fees.md b/docs/learn/beginner/04-gas-fees.md index 086523b5a..783a2228b 100644 --- a/docs/learn/beginner/04-gas-fees.md +++ b/docs/learn/beginner/04-gas-fees.md @@ -94,7 +94,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta ``` * Verify signatures for each [`message`](../../build/building-modules/02-messages-and-queries.md#messages) contained in the transaction. Each `message` should be signed by one or multiple sender(s), and these signatures must be verified in the `anteHandler`. -* During `CheckTx`, verify that the gas prices provided with the transaction is greater than the local `min-gas-prices` (as a reminder, gas-prices can be deducted from the following equation: `fees = gas * gas-prices`). `min-gas-prices` is a parameter local to each full-node and used during `CheckTx` to discard transactions that do not provide a minimum amount of fees. This ensures that the mempool cannot be spammed with garbage transactions. +* During `CheckTx`, verify that the gas prices provided with the transaction is greater than the local `min-gas-prices` (as a reminder, gas-prices can be deduced from the following equation: `fees = gas * gas-prices`). `min-gas-prices` is a parameter local to each full-node and used during `CheckTx` to discard transactions that do not provide a minimum amount of fees. This ensures that the mempool cannot be spammed with garbage transactions. * Verify that the sender of the transaction has enough funds to cover for the `fees`. When the end-user generates a transaction, they must indicate 2 of the 3 following parameters (the third one being implicit): `fees`, `gas` and `gas-prices`. This signals how much they are willing to pay for nodes to execute their transaction. The provided `gas` value is stored in a parameter called `GasWanted` for later use. * Set `newCtx.GasMeter` to 0, with a limit of `GasWanted`. **This step is crucial**, as it not only makes sure the transaction cannot consume infinite gas, but also that `ctx.GasMeter` is reset in-between each transaction (`ctx` is set to `newCtx` after `anteHandler` is run, and the `anteHandler` is run each time a transactions executes). diff --git a/docs/learn/intro/01-why-app-specific.md b/docs/learn/intro/01-why-app-specific.md index e34bf3270..170e45e9e 100644 --- a/docs/learn/intro/01-why-app-specific.md +++ b/docs/learn/intro/01-why-app-specific.md @@ -68,7 +68,7 @@ The list above contains a few examples that show how much flexibility applicatio Decentralized applications built with Smart Contracts are inherently capped in performance by the underlying environment. For a decentralized application to optimise performance, it needs to be built as an application-specific blockchain. Next are some of the benefits an application-specific blockchain brings in terms of performance: -* Developers of application-specific blockchains can choose to operate with a novel consensus engine such as CometBFT BFT. Compared to Proof-of-Work (used by most virtual-machine blockchains today), it offers significant gains in throughput. +* Developers of application-specific blockchains can choose to operate with a novel consensus engine such as CometBFT. * An application-specific blockchain only operates a single application, so that the application does not compete with others for computation and storage. This is the opposite of most non-sharded virtual-machine blockchains today, where smart contracts all compete for computation and storage. * Even if a virtual-machine blockchain offered application-based sharding coupled with an efficient consensus algorithm, performance would still be limited by the virtual-machine itself. The real throughput bottleneck is the state-machine, and requiring transactions to be interpreted by a virtual-machine significantly increases the computational complexity of processing them. diff --git a/openapi/swagger.yaml b/openapi/swagger.yaml index 29df67ba0..f949019cf 100644 --- a/openapi/swagger.yaml +++ b/openapi/swagger.yaml @@ -13941,6 +13941,9 @@ paths: result to be considered valid for an expedited proposal. + proposal_execution_gas: + type: string + format: uint64 description: >- QueryParamsResponse is the response type for the Query/Params RPC method. @@ -17345,7 +17348,177 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } tags: - Query /cosmos/mint/v1beta1/inflation: @@ -17384,7 +17557,177 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } tags: - Query /cosmos/mint/v1beta1/params: @@ -17443,7 +17786,177 @@ paths: properties: '@type': type: string + description: >- + A URL/resource name that uniquely identifies the type of + the serialized + + protocol buffer message. This string must contain at + least + + one "/" character. The last segment of the URL's path + must represent + + the fully qualified name of the type (as in + + `path/google.protobuf.Duration`). The name should be in + a canonical form + + (e.g., leading "." is not accepted). + + + In practice, teams usually precompile into the binary + all types that they + + expect it to use in the context of Any. However, for + URLs which use the + + scheme `http`, `https`, or no scheme, one can optionally + set up a type + + server that maps type URLs to message definitions as + follows: + + + * If no scheme is provided, `https` is assumed. + + * An HTTP GET on the URL must yield a + [google.protobuf.Type][] + value in binary format, or produce an error. + * Applications are allowed to cache lookup results based + on the + URL, or have them precompiled into a binary to avoid any + lookup. Therefore, binary compatibility needs to be preserved + on changes to types. (Use versioned type names to manage + breaking changes.) + + Note: this functionality is not currently available in + the official + + protobuf release, and it is not used for type URLs + beginning with + + type.googleapis.com. + + + Schemes other than `http`, `https` (or the empty scheme) + might be + + used with implementation specific semantics. additionalProperties: {} + description: >- + `Any` contains an arbitrary serialized protocol buffer + message along with a + + URL that describes the type of the serialized message. + + + Protobuf library provides support to pack/unpack Any values + in the form + + of utility functions or additional generated methods of the + Any type. + + + Example 1: Pack and unpack a message in C++. + + Foo foo = ...; + Any any; + any.PackFrom(foo); + ... + if (any.UnpackTo(&foo)) { + ... + } + + Example 2: Pack and unpack a message in Java. + + Foo foo = ...; + Any any = Any.pack(foo); + ... + if (any.is(Foo.class)) { + foo = any.unpack(Foo.class); + } + // or ... + if (any.isSameTypeAs(Foo.getDefaultInstance())) { + foo = any.unpack(Foo.getDefaultInstance()); + } + + Example 3: Pack and unpack a message in Python. + + foo = Foo(...) + any = Any() + any.Pack(foo) + ... + if any.Is(Foo.DESCRIPTOR): + any.Unpack(foo) + ... + + Example 4: Pack and unpack a message in Go + + foo := &pb.Foo{...} + any, err := anypb.New(foo) + if err != nil { + ... + } + ... + foo := &pb.Foo{} + if err := any.UnmarshalTo(foo); err != nil { + ... + } + + The pack methods provided by protobuf library will by + default use + + 'type.googleapis.com/full.type.name' as the type URL and the + unpack + + methods only use the fully qualified type name after the + last '/' + + in the type URL, for example "foo.bar.com/x/y.z" will yield + type + + name "y.z". + + + JSON + + ==== + + The JSON representation of an `Any` value uses the regular + + representation of the deserialized, embedded message, with + an + + additional field `@type` which contains the type URL. + Example: + + package google.profile; + message Person { + string first_name = 1; + string last_name = 2; + } + + { + "@type": "type.googleapis.com/google.profile.Person", + "firstName": , + "lastName": + } + + If the embedded message type is well-known and has a custom + JSON + + representation, that representation will be embedded adding + a field + + `value` which holds the custom JSON in addition to the + `@type` + + field. Example (for message [google.protobuf.Duration][]): + + { + "@type": "type.googleapis.com/google.protobuf.Duration", + "value": "1.212s" + } tags: - Query /cosmos/params/v1beta1/params: @@ -20236,29 +20749,6 @@ paths: bonded shares multiplied by exchange rate. - historical_record: - type: object - properties: - apphash: - type: string - format: byte - time: - type: string - format: date-time - validators_hash: - type: string - format: byte - description: >- - Historical contains a set of minimum values needed for - evaluating historical validator sets and blocks. - - It is stored as part of staking module's state, which persists - the `n` most - - recent HistoricalInfo - - (`n` is set by the staking module's `historical_entries` - parameter). description: >- QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC @@ -21150,9 +21640,32 @@ paths: bonded shares multiplied by exchange rate. - description: validators contains all the queried validators. + validator_info: + type: array + items: + type: object + properties: + consensus_address: + type: string + description: >- + consensus_address is the consensus address of the + validator. + description: >- + ValidatorInfo contains the validator's address and public + key. + description: >- + validator_info contains additional information for each + validator. + + The order of the elements in this list corresponds to the + order of the elements in the validators list. + + For example, if you want the ValidatorInfo for the third + validator in the validators list, + + you should look at the third element in the validator_info + list. pagination: - description: pagination defines the pagination in the response. type: object properties: next_key: @@ -21170,6 +21683,16 @@ paths: PageRequest.count_total was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } title: >- QueryValidatorsResponse is response type for the Query/Validators RPC method @@ -21884,7 +22407,6 @@ paths: balance in addition to shares which is more suitable for client responses. pagination: - description: pagination defines the pagination in the response. type: object properties: next_key: @@ -21902,6 +22424,16 @@ paths: PageRequest.count_total was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } title: |- QueryValidatorDelegationsResponse is response type for the Query/ValidatorDelegations RPC method @@ -22764,7 +23296,6 @@ paths: for a single validator in an time-ordered list. pagination: - description: pagination defines the pagination in the response. type: object properties: next_key: @@ -22782,6 +23313,16 @@ paths: PageRequest.count_total was set, its value is undefined otherwise + description: >- + PageResponse is to be embedded in gRPC response messages where + the + + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } description: >- QueryValidatorUnbondingDelegationsResponse is response type for the @@ -49952,6 +50493,9 @@ definitions: description: |- Minimum percentage of total stake needed to vote for a result to be considered valid for an expedited proposal. + proposal_execution_gas: + type: string + format: uint64 description: Params defines the parameters for the x/gov module. cosmos.gov.v1.Proposal: type: object @@ -50711,6 +51255,9 @@ definitions: be considered valid for an expedited proposal. + proposal_execution_gas: + type: string + format: uint64 description: QueryParamsResponse is the response type for the Query/Params RPC method. cosmos.gov.v1.QueryProposalResponse: type: object @@ -52621,28 +53168,6 @@ definitions: recent HistoricalInfo - (`n` is set by the staking module's `historical_entries` parameter). - cosmos.staking.v1beta1.HistoricalRecord: - type: object - properties: - apphash: - type: string - format: byte - time: - type: string - format: date-time - validators_hash: - type: string - format: byte - description: >- - Historical contains a set of minimum values needed for evaluating - historical validator sets and blocks. - - It is stored as part of staking module's state, which persists the `n` - most - - recent HistoricalInfo - (`n` is set by the staking module's `historical_entries` parameter). cosmos.staking.v1beta1.Params: type: object @@ -53607,28 +54132,6 @@ definitions: shares multiplied by exchange rate. - historical_record: - type: object - properties: - apphash: - type: string - format: byte - time: - type: string - format: date-time - validators_hash: - type: string - format: byte - description: >- - Historical contains a set of minimum values needed for evaluating - historical validator sets and blocks. - - It is stored as part of staking module's state, which persists the `n` - most - - recent HistoricalInfo - - (`n` is set by the staking module's `historical_entries` parameter). description: >- QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC @@ -53964,7 +54467,6 @@ definitions: balance in addition to shares which is more suitable for client responses. pagination: - description: pagination defines the pagination in the response. type: object properties: next_key: @@ -53982,6 +54484,14 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } title: |- QueryValidatorDelegationsResponse is response type for the Query/ValidatorDelegations RPC method @@ -54225,7 +54735,6 @@ definitions: for a single validator in an time-ordered list. pagination: - description: pagination defines the pagination in the response. type: object properties: next_key: @@ -54243,6 +54752,14 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } description: |- QueryValidatorUnbondingDelegationsResponse is response type for the Query/ValidatorUnbondingDelegations RPC method. @@ -54451,9 +54968,26 @@ definitions: exchange rate. Voting power can be calculated as total bonded shares multiplied by exchange rate. - description: validators contains all the queried validators. + validator_info: + type: array + items: + type: object + properties: + consensus_address: + type: string + description: consensus_address is the consensus address of the validator. + description: ValidatorInfo contains the validator's address and public key. + description: >- + validator_info contains additional information for each validator. + + The order of the elements in this list corresponds to the order of the + elements in the validators list. + + For example, if you want the ValidatorInfo for the third validator in + the validators list, + + you should look at the third element in the validator_info list. pagination: - description: pagination defines the pagination in the response. type: object properties: next_key: @@ -54471,6 +55005,14 @@ definitions: PageRequest.count_total was set, its value is undefined otherwise + description: |- + PageResponse is to be embedded in gRPC response messages where the + corresponding request message has used PageRequest. + + message SomeResponse { + repeated Bar results = 1; + PageResponse page = 2; + } title: >- QueryValidatorsResponse is response type for the Query/Validators RPC method @@ -55018,6 +55560,13 @@ definitions: exchange rate. Voting power can be calculated as total bonded shares multiplied by exchange rate. + cosmos.staking.v1beta1.ValidatorInfo: + type: object + properties: + consensus_address: + type: string + description: consensus_address is the consensus address of the validator. + description: ValidatorInfo contains the validator's address and public key. cometbft.abci.v1.Event: type: object properties: @@ -64643,6 +65192,152 @@ definitions: breaker for Msg's of all type URLs. - LEVEL_SUPER_ADMIN: LEVEL_SUPER_ADMIN indicates that the account can take all circuit breaker actions and can grant permissions to other accounts. + cometbft.abci.v1.CommitInfo: + type: object + properties: + round: + type: integer + format: int32 + votes: + type: array + items: + type: object + properties: + validator: + type: object + properties: + address: + type: string + format: byte + title: The first 20 bytes of SHA256(public key) + power: + type: string + format: int64 + description: The voting power + title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; + description: Validator in the validator set. + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + description: |- + - BLOCK_ID_FLAG_UNKNOWN: Indicates an error condition + - BLOCK_ID_FLAG_ABSENT: The vote was not received + - BLOCK_ID_FLAG_COMMIT: Voted for the block that received the majority + - BLOCK_ID_FLAG_NIL: Voted for nil + title: BlockIdFlag indicates which BlockID the signature is for + description: VoteInfo contains the information about the vote. + description: CommitInfo contains votes for the particular round. + cometbft.abci.v1.Misbehavior: + type: object + properties: + type: + type: string + enum: + - MISBEHAVIOR_TYPE_UNKNOWN + - MISBEHAVIOR_TYPE_DUPLICATE_VOTE + - MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK + default: MISBEHAVIOR_TYPE_UNKNOWN + description: |- + The type of misbehavior committed by a validator. + + - MISBEHAVIOR_TYPE_UNKNOWN: Unknown + - MISBEHAVIOR_TYPE_DUPLICATE_VOTE: Duplicate vote + - MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK: Light client attack + validator: + type: object + properties: + address: + type: string + format: byte + title: The first 20 bytes of SHA256(public key) + power: + type: string + format: int64 + description: The voting power + title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; + description: Validator in the validator set. + title: The offending validator + height: + type: string + format: int64 + title: The height when the offense occurred + time: + type: string + format: date-time + title: The corresponding time where the offense occurred + total_voting_power: + type: string + format: int64 + title: >- + Total voting power of the validator set in case the ABCI application + does + + not store historical validators. + + https://github.com/tendermint/tendermint/issues/4581 + description: Misbehavior is a type of misbehavior committed by a validator. + cometbft.abci.v1.MisbehaviorType: + type: string + enum: + - MISBEHAVIOR_TYPE_UNKNOWN + - MISBEHAVIOR_TYPE_DUPLICATE_VOTE + - MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK + default: MISBEHAVIOR_TYPE_UNKNOWN + description: |- + The type of misbehavior committed by a validator. + + - MISBEHAVIOR_TYPE_UNKNOWN: Unknown + - MISBEHAVIOR_TYPE_DUPLICATE_VOTE: Duplicate vote + - MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK: Light client attack + cometbft.abci.v1.Validator: + type: object + properties: + address: + type: string + format: byte + title: The first 20 bytes of SHA256(public key) + power: + type: string + format: int64 + description: The voting power + title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; + description: Validator in the validator set. + cometbft.abci.v1.VoteInfo: + type: object + properties: + validator: + type: object + properties: + address: + type: string + format: byte + title: The first 20 bytes of SHA256(public key) + power: + type: string + format: int64 + description: The voting power + title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; + description: Validator in the validator set. + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + description: |- + - BLOCK_ID_FLAG_UNKNOWN: Indicates an error condition + - BLOCK_ID_FLAG_ABSENT: The vote was not received + - BLOCK_ID_FLAG_COMMIT: Voted for the block that received the majority + - BLOCK_ID_FLAG_NIL: Voted for nil + title: BlockIdFlag indicates which BlockID the signature is for + description: VoteInfo contains the information about the vote. cometbft.types.v1.ABCIParams: type: object properties: @@ -65009,6 +65704,214 @@ definitions: It was named app_version in CometBFT 0.34. description: VersionParams contain the version of specific components of CometBFT. + cosmos.consensus.v1.CometInfo: + type: object + properties: + evidence: + type: array + items: + type: object + properties: + type: + type: string + enum: + - MISBEHAVIOR_TYPE_UNKNOWN + - MISBEHAVIOR_TYPE_DUPLICATE_VOTE + - MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK + default: MISBEHAVIOR_TYPE_UNKNOWN + description: |- + The type of misbehavior committed by a validator. + + - MISBEHAVIOR_TYPE_UNKNOWN: Unknown + - MISBEHAVIOR_TYPE_DUPLICATE_VOTE: Duplicate vote + - MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK: Light client attack + validator: + type: object + properties: + address: + type: string + format: byte + title: The first 20 bytes of SHA256(public key) + power: + type: string + format: int64 + description: The voting power + title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; + description: Validator in the validator set. + title: The offending validator + height: + type: string + format: int64 + title: The height when the offense occurred + time: + type: string + format: date-time + title: The corresponding time where the offense occurred + total_voting_power: + type: string + format: int64 + title: >- + Total voting power of the validator set in case the ABCI + application does + + not store historical validators. + + https://github.com/tendermint/tendermint/issues/4581 + description: Misbehavior is a type of misbehavior committed by a validator. + validators_hash: + type: string + format: byte + proposer_address: + type: string + format: byte + last_commit: + type: object + properties: + round: + type: integer + format: int32 + votes: + type: array + items: + type: object + properties: + validator: + type: object + properties: + address: + type: string + format: byte + title: The first 20 bytes of SHA256(public key) + power: + type: string + format: int64 + description: The voting power + title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; + description: Validator in the validator set. + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + description: |- + - BLOCK_ID_FLAG_UNKNOWN: Indicates an error condition + - BLOCK_ID_FLAG_ABSENT: The vote was not received + - BLOCK_ID_FLAG_COMMIT: Voted for the block that received the majority + - BLOCK_ID_FLAG_NIL: Voted for nil + title: BlockIdFlag indicates which BlockID the signature is for + description: VoteInfo contains the information about the vote. + description: CommitInfo contains votes for the particular round. + description: CometInfo defines the structure of the x/consensus module's comet info. + cosmos.consensus.v1.QueryGetCometInfoResponse: + type: object + properties: + comet_info: + description: comet_info is the comet info of the x/consensus module. + type: object + properties: + evidence: + type: array + items: + type: object + properties: + type: + type: string + enum: + - MISBEHAVIOR_TYPE_UNKNOWN + - MISBEHAVIOR_TYPE_DUPLICATE_VOTE + - MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK + default: MISBEHAVIOR_TYPE_UNKNOWN + description: |- + The type of misbehavior committed by a validator. + + - MISBEHAVIOR_TYPE_UNKNOWN: Unknown + - MISBEHAVIOR_TYPE_DUPLICATE_VOTE: Duplicate vote + - MISBEHAVIOR_TYPE_LIGHT_CLIENT_ATTACK: Light client attack + validator: + type: object + properties: + address: + type: string + format: byte + title: The first 20 bytes of SHA256(public key) + power: + type: string + format: int64 + description: The voting power + title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; + description: Validator in the validator set. + title: The offending validator + height: + type: string + format: int64 + title: The height when the offense occurred + time: + type: string + format: date-time + title: The corresponding time where the offense occurred + total_voting_power: + type: string + format: int64 + title: >- + Total voting power of the validator set in case the ABCI + application does + + not store historical validators. + + https://github.com/tendermint/tendermint/issues/4581 + description: Misbehavior is a type of misbehavior committed by a validator. + validators_hash: + type: string + format: byte + proposer_address: + type: string + format: byte + last_commit: + type: object + properties: + round: + type: integer + format: int32 + votes: + type: array + items: + type: object + properties: + validator: + type: object + properties: + address: + type: string + format: byte + title: The first 20 bytes of SHA256(public key) + power: + type: string + format: int64 + description: The voting power + title: PubKey pub_key = 2 [(gogoproto.nullable)=false]; + description: Validator in the validator set. + block_id_flag: + type: string + enum: + - BLOCK_ID_FLAG_UNKNOWN + - BLOCK_ID_FLAG_ABSENT + - BLOCK_ID_FLAG_COMMIT + - BLOCK_ID_FLAG_NIL + default: BLOCK_ID_FLAG_UNKNOWN + description: |- + - BLOCK_ID_FLAG_UNKNOWN: Indicates an error condition + - BLOCK_ID_FLAG_ABSENT: The vote was not received + - BLOCK_ID_FLAG_COMMIT: Voted for the block that received the majority + - BLOCK_ID_FLAG_NIL: Voted for nil + title: BlockIdFlag indicates which BlockID the signature is for + description: VoteInfo contains the information about the vote. + description: CommitInfo contains votes for the particular round. + description: >- + QueryCometInfoResponse defines the response type for querying x/consensus + comet info. cosmos.consensus.v1.QueryParamsResponse: type: object properties: @@ -65688,4 +66591,4 @@ definitions: The scope of this field's configuration is global (not module specific). - description: QueryConfigRequest is the Query/Config response type. + description: QueryConfigResponse is the Query/Config response type.