Skip to content

Commit 2fbcfd6

Browse files
authored
Merge branch 'main' into 20250826_timeout_handler
2 parents 679a091 + 5f5ca59 commit 2fbcfd6

File tree

5 files changed

+36
-5
lines changed

5 files changed

+36
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
5555
* (crypto) [#24919](https://github.com/cosmos/cosmos-sdk/pull/24919) add `NewPubKeyFromBytes` function to the `secp256r1` package to create `PubKey` from bytes
5656
* (server) [#24720](https://github.com/cosmos/cosmos-sdk/pull/24720) add `verbose_log_level` flag for configuring the log level when switching to verbose logging mode during sensitive operations (such as chain upgrades).
5757
* (crypto) [#24861](https://github.com/cosmos/cosmos-sdk/pull/24861) add `PubKeyFromCometTypeAndBytes` helper function to convert from `comet/v2` PubKeys to the `cryptotypes.Pubkey` interface.
58-
* (abci_utils) [#25008](https://github.com/cosmos/cosmos-sdk/pull/24861) add the ability to assign a custom signer extraction adapter in `DefaultProposalHandler`.
58+
* (abci_utils) [#25008](https://github.com/cosmos/cosmos-sdk/pull/25008) add the ability to assign a custom signer extraction adapter in `DefaultProposalHandler`.
5959

6060
### Improvements
6161

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
</a>
2525
<a href="https://github.com/cosmos/cosmos-sdk/actions/workflows/sims.yml">
2626
<img alt="Sims" src="https://github.com/cosmos/cosmos-sdk/workflows/Sims/badge.svg" />
27+
</a>
2728
<a href="https://github.com/cosmos/cosmos-sdk/actions/workflows/lint.yml">
2829
<img alt="Lint Status" src="https://github.com/cosmos/cosmos-sdk/workflows/Lint/badge.svg" />
30+
</a>
2931
</div>
3032

3133
The Cosmos SDK is a framework for building blockchain applications. [CometBFT (BFT Consensus)](https://github.com/cometbft/cometbft) and the Cosmos SDK are written in the Go programming language. Cosmos SDK is used to build [Gaia](https://github.com/cosmos/gaia), the implementation of the Cosmos Hub.

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

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

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

199197

x/simulation/params.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,20 @@ const (
2020
maxTimePerBlock int64 = 10000
2121
)
2222

23-
// TODO: explain transitional matrix usage
23+
// The transition matrices below control stochastic behavior in the simulation:
24+
//
25+
// - defaultLivenessTransitionMatrix: models validator liveness across three
26+
// states (online, spotty, offline). Each column represents the current state,
27+
// each row represents the next state; entries are integer weights used for
28+
// weighted random selection. Higher weights mean higher probability.
29+
//
30+
// - defaultBlockSizeTransitionMatrix: models block size regimes across three
31+
// states (large range, medium range, zero). Similar column-as-current,
32+
// row-as-next convention applies.
33+
//
34+
// These matrices are fed into CreateTransitionMatrix, which precomputes column
35+
// totals for efficient sampling. During simulation, NextState(r, i) is called
36+
// with a deterministic RNG r and current state i to obtain the next state.
2437
var (
2538
// Currently there are 3 different liveness types,
2639
// fully online, spotty connection, offline.

x/simulation/transition_matrix.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,25 @@ type TransitionMatrix struct {
2020
}
2121

2222
// CreateTransitionMatrix creates a transition matrix from the provided weights.
23-
// TODO: Provide example usage
23+
//
24+
// Example:
25+
//
26+
// weights := [][]int{
27+
// // From state 0 to states 0,1,2
28+
// {90, 10, 0},
29+
// // From state 1 to states 0,1,2
30+
// {20, 70, 10},
31+
// // From state 2 to states 0,1,2
32+
// {5, 15, 80},
33+
// }
34+
// tm, err := CreateTransitionMatrix(weights)
35+
// if err != nil {
36+
// // handle error
37+
// }
38+
//
39+
// // NextState picks the next state from current state i.
40+
// // r should be a deterministic *rand.Rand when used in simulations.
41+
// // next := tm.NextState(r, i)
2442
func CreateTransitionMatrix(weights [][]int) (simulation.TransitionMatrix, error) {
2543
n := len(weights)
2644
for i := range n {

0 commit comments

Comments
 (0)