You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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,
38
38
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):
39
39
40
40
```go
41
-
type VerifyVoteExtensionHandler func(Context, *abci.RequestVerifyVoteExtension) (*abci.ResponseVerifyVoteExtension, error)
41
+
type VerifyVoteExtensionHandler func(Context, *abci.VerifyVoteExtensionRequest) (*abci.VerifyVoteExtensionResponse, error)
42
42
```
43
43
44
44
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.
78
78
An example of how a pre-FinalizeBlock hook could look like is shown below:
Copy file name to clipboardExpand all lines: docs/build/architecture/adr-032-typed-events.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Currently in the Cosmos SDK, events are defined in the handlers for each message
22
22
23
23
Currently in the Cosmos SDK, events are defined in the handlers for each message, meaning each module doesn't have a cannonical set of types for each event. Above all else this makes these events difficult to consume as it requires a great deal of raw string matching and parsing. This proposal focuses on updating the events to use **typed events** defined in each module such that emiting and subscribing to events will be much easier. This workflow comes from the experience of the Akash Network team.
24
24
25
-
[Our platform](http://github.com/ovrclk/akash) requires a number of programatic on chain interactions both on the provider (datacenter - to bid on new orders and listen for leases created) and user (application developer - to send the app manifest to the provider) side. In addition the Akash team is now maintaining the IBC [`relayer`](https://github.com/ovrclk/relayer), another very event driven process. In working on these core pieces of infrastructure, and integrating lessons learned from Kubernetes developement, our team has developed a standard method for defining and consuming typed events in Cosmos SDK modules. We have found that it is extremely useful in building this type of event driven application.
25
+
[Our platform](http://github.com/ovrclk/akash) requires a number of programatic on chain interactions both on the provider (datacenter - to bid on new orders and listen for leases created) and user (application developer - to send the app manifest to the provider) side. In addition the Akash team is now maintaining the IBC [`relayer`](https://github.com/ovrclk/relayer), another very event driven process. In working on these core pieces of infrastructure, and integrating lessons learned from Kubernetes development, our team has developed a standard method for defining and consuming typed events in Cosmos SDK modules. We have found that it is extremely useful in building this type of event driven application.
26
26
27
27
As the Cosmos SDK gets used more extensively for apps like `peggy`, other peg zones, IBC, DeFi, etc... there will be an exploding demand for event driven applications to support new features desired by users. We propose upstreaming our findings into the Cosmos SDK to enable all Cosmos SDK applications to quickly and easily build event driven apps to aid their core application. Wallets, exchanges, explorers, and defi protocols all stand to benefit from this work.
Copy file name to clipboardExpand all lines: docs/build/architecture/adr-040-storage-and-smt-state-commitments.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,16 +92,16 @@ A new database snapshot will be created in every `EndBlocker` and identified by
92
92
NOTE: `Commit` must be called exactly once per block. Otherwise we risk going out of sync for the version number and block height.
93
93
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).
94
94
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.
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.
96
96
97
97
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.
98
98
99
99
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.
100
100
101
101
#### Accessing old state versions
102
102
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.
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.
105
105
106
106
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.
Copy file name to clipboardExpand all lines: docs/build/architecture/adr-047-extend-upgrade-plan.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -95,6 +95,7 @@ All fields in the `UpgradeInstructions` are optional.
95
95
|`30`|`pre-upgrade` command was executed but failed. This fails the entire upgrade. |
96
96
|`31`|`pre-upgrade` command was executed but failed. But the command is retried until exit code `1` or `30` are returned. |
97
97
If defined, then the app supervisors (e.g. Cosmovisor) MUST NOT run `app pre-run`.
98
+
98
99
*`post_run` is a command to run after the upgraded chain has been started. If defined, this command MUST be only executed at most once by an upgrading node.
99
100
The output and exit code SHOULD be logged but SHOULD NOT affect the running of the upgraded chain.
100
101
The working directory this command runs from MUST be `{DAEMON_HOME}/cosmovisor/{upgrade name}`.
Copy file name to clipboardExpand all lines: docs/build/architecture/adr-050-sign-mode-textual-annex1.md
+5-2Lines changed: 5 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -195,6 +195,7 @@ Messages that have a custom encoding, including `google.protobuf.Timestamp`, `go
195
195
#### Examples
196
196
197
197
Message header screen is stripped, one-level of indentation removed:
198
+
198
199
```
199
200
/cosmos.gov.v1.Vote
200
201
> Proposal id: 4
@@ -210,6 +211,7 @@ Message header screen is stripped, one-level of indentation removed:
210
211
```
211
212
212
213
Message with custom encoding:
214
+
213
215
```
214
216
/cosmos.base.v1beta1.Coin
215
217
> 10uatom
@@ -271,8 +273,9 @@ Examples:
271
273
* The hexadecimal string is finally separated into groups of 4 digits, with a space `' '` as separator. If the bytes length is odd, the 2 remaining hexadecimal characters are at the end.
272
274
273
275
The number 35 was chosen because it is the longest length where the hashed-and-prefixed representation is longer than the original data directly formatted, using the 3 rules above. More specifically:
274
-
- a 35-byte array will have 70 hex characters, plus 17 space characters, resulting in 87 characters.
275
-
- byte arrays starting from length 36 will be be hashed to 32 bytes, which is 64 hex characters plus 15 spaces, and with the `SHA-256=` prefix, it takes 87 characters.
276
+
277
+
* a 35-byte array will have 70 hex characters, plus 17 space characters, resulting in 87 characters.
278
+
* byte arrays starting from length 36 will be be hashed to 32 bytes, which is 64 hex characters plus 15 spaces, and with the `SHA-256=` prefix, it takes 87 characters.
276
279
Also, secp256k1 public keys have length 33, so their Textual representation is not their hashed value, which we would like to avoid.
277
280
278
281
Note: Data longer than 35 bytes are not rendered in a way that can be inverted. See ADR-050's [section about invertability](./adr-050-sign-mode-textual.md#invertible-rendering) for a discussion.
Copy file name to clipboardExpand all lines: docs/build/architecture/adr-057-app-wiring.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -303,15 +303,17 @@ Code generation requires that all providers and invokers and their parameters ar
303
303
304
304
When we start creating semantically versioned SDK modules that are in standalone go modules, a state machine breaking
305
305
change to a module should be handled as follows:
306
-
- the semantic major version should be incremented, and
307
-
- a new semantically versioned module config protobuf type should be created.
306
+
307
+
* the semantic major version should be incremented, and
308
+
* a new semantically versioned module config protobuf type should be created.
308
309
309
310
For instance, if we have the SDK module for bank in the go module `github.com/cosmos/cosmos-sdk/x/bank` with the module config type
310
311
`cosmos.bank.module.v1.Module`, and we want to make a state machine breaking change to the module, we would:
311
-
- create a new go module `github.com/cosmos/cosmos-sdk/x/bank/v2`,
312
-
- with the module config protobuf type `cosmos.bank.module.v2.Module`.
313
312
314
-
This _does not_ mean that we need to increment the protobuf API version for bank. Both modules can support
313
+
* create a new go module `github.com/cosmos/cosmos-sdk/x/bank/v2`,
314
+
* with the module config protobuf type `cosmos.bank.module.v2.Module`.
315
+
316
+
This *does not* mean that we need to increment the protobuf API version for bank. Both modules can support
315
317
`cosmos.bank.v1`, but `github.com/cosmos/cosmos-sdk/x/bank/v2` will be a separate go module with a separate module config type.
316
318
317
319
This practice will eventually allow us to use appconfig to load new versions of a module via a configuration change.
@@ -320,7 +322,7 @@ Effectively, there should be a 1:1 correspondence between a semantically version
320
322
versioned module config protobuf type, and major versioning bumps should occur whenever state machine breaking changes
321
323
are made to a module.
322
324
323
-
NOTE: SDK modules that are standalone go modules _should not_ adopt semantic versioning until the concerns described in
325
+
NOTE: SDK modules that are standalone go modules *should not* adopt semantic versioning until the concerns described in
324
326
[ADR 054: Module Semantic Versioning](./adr-054-semver-compatible-modules.md) are
325
327
addressed. The short-term solution for this issue was left somewhat unresolved. However, the easiest tactic is
326
328
likely to use a standalone API go module and follow the guidelines described in this comment: https://github.com/cosmos/cosmos-sdk/pull/11802#issuecomment-1406815181. For the time-being, it is recommended that
0 commit comments