Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
61cb8ea
add debug query for validator queue
randy-cro Aug 26, 2025
eccd06c
add debug timing logs
randy-cro Aug 26, 2025
b65f034
add more logs
randy-cro Aug 26, 2025
2cc87de
add more debug logs
randy-cro Aug 27, 2025
04160e6
chore:optimise staking endblocker iteration
randy-cro Sep 19, 2025
516bb74
move queue iteration cache to in memory
randy-cro Sep 19, 2025
ee2bfce
add logs for debug
randy-cro Sep 19, 2025
ff3be06
fix compile
randy-cro Sep 19, 2025
0a5f23c
fix test
randy-cro Sep 19, 2025
d2d3d64
comment out arg for convenience first
randy-cro Sep 19, 2025
afa075c
change keeper to receiver
randy-cro Sep 19, 2025
066b93d
clean up code
randy-cro Sep 19, 2025
fbb339e
add logs
randy-cro Sep 19, 2025
50d37d2
add more logs
randy-cro Sep 19, 2025
dd1902c
update keeper to pointers
randy-cro Sep 19, 2025
3a34881
remove count
randy-cro Sep 19, 2025
692150e
try reverse iterator
randy-cro Sep 22, 2025
cd61c5d
Revert "try reverse iterator"
randy-cro Sep 22, 2025
612e30b
test out parallel iterators
randy-cro Sep 22, 2025
0f96812
amalgamate errors before returning + remove waitgroup + close all ite…
randy-cro Sep 22, 2025
12afbdd
add debug logs
randy-cro Sep 23, 2025
71d3ebb
fix lowest height not saved
randy-cro Sep 23, 2025
2401845
fix logging
randy-cro Sep 23, 2025
d88f5ea
remove debug staking query
randy-cro Sep 23, 2025
e86016c
code clean up and remove logs
randy-cro Sep 23, 2025
d70e018
remove debug logs
randy-cro Sep 24, 2025
4459c77
proto-gen
randy-cro Sep 24, 2025
99af2c5
backport refactor(x/staking)!: removing unbonding queue index (#22795)
randy-cro Sep 24, 2025
99d87d7
move QueueLastProcessedState out of proto
randy-cro Sep 25, 2025
92ec94f
fix:simapp build
randy-cro Sep 25, 2025
cfd7f5e
fix lint
randy-cro Sep 25, 2025
db6ec61
fix race
randy-cro Sep 25, 2025
3667e94
fix panic
randy-cro Sep 25, 2025
226098a
fix comments
randy-cro Sep 25, 2025
bbc455e
update CHANGELOG
randy-cro Sep 25, 2025
10a7d4b
fix lint
randy-cro Sep 25, 2025
4929fec
fix lint
randy-cro Sep 25, 2025
7dabbad
remove integration test for unbonding as per backport
randy-cro Sep 25, 2025
5a3e8da
remove unneccessary pointers
randy-cro Sep 25, 2025
1d53ef4
fix integration test
randy-cro Sep 25, 2025
e97d516
add test cases
randy-cro Sep 26, 2025
27493d5
minor optimisation
randy-cro Sep 26, 2025
a2fd275
check QueueLastProcessedState update state
randy-cro Sep 29, 2025
62c0a20
remove logs
randy-cro Sep 29, 2025
efab08f
fix unbondallMatureValidators iteration
randy-cro Sep 29, 2025
d78c0e4
optimise lower bound height to be the lowest height of all unbonding …
randy-cro Sep 29, 2025
ecccd8c
minor changes
randy-cro Sep 29, 2025
d3ff394
minor changes
randy-cro Sep 29, 2025
de99781
minor changes
randy-cro Sep 29, 2025
a3e3d9f
fix tests
randy-cro Sep 29, 2025
cf60463
fix build
randy-cro Sep 29, 2025
d219c93
check iterator not nil before closing
randy-cro Sep 29, 2025
0fc6198
update CHANGELOG.md
randy-cro Sep 29, 2025
36c60a9
fix test and add more tests
randy-cro Sep 29, 2025
6e9830f
try no op for testnet node to catchup (to be reverted)
randy-cro Sep 30, 2025
8f71d3b
Revert "try no op for testnet node to catchup (to be reverted)"
randy-cro Sep 30, 2025
b0f0509
add caching for unbonding validators, unbonding delegations and redel…
randy-cro Oct 2, 2025
88ee543
update delimiter for validator queue key to be '/'
randy-cro Oct 2, 2025
7aa9bba
add getter and setter for caches
randy-cro Oct 2, 2025
0be8a53
add test for unbonding validators
randy-cro Oct 2, 2025
8daabd2
remove old tests
randy-cro Oct 2, 2025
ea08a6d
add timing logs to track
randy-cro Oct 3, 2025
3a9963a
Revert "add timing logs to track"
randy-cro Oct 3, 2025
788712c
change some keeper methods to pointer + rename function names
randy-cro Oct 3, 2025
fa9afaa
add delegation tests
randy-cro Oct 3, 2025
83a9838
rename function name
randy-cro Oct 3, 2025
cc19a8a
add redelegation tests
randy-cro Oct 3, 2025
835fbd8
fix test
randy-cro Oct 3, 2025
8e92d20
update store before cache to prevent the need to rollback should pers…
randy-cro Oct 6, 2025
f6daf14
update store before cache to prevent the need to rollback should pers…
randy-cro Oct 6, 2025
6d1197b
do not remove non-mature unbonds and redelegations
randy-cro Oct 6, 2025
36994e3
fix lint
randy-cro Oct 6, 2025
ae29d02
gofumpt formatting
randy-cro Oct 6, 2025
7766d61
add function comments
randy-cro Oct 6, 2025
0049866
remove unnecessary empty variable
randy-cro Oct 6, 2025
5874b9c
fix comments
randy-cro Oct 6, 2025
cd7b3a6
update CHANGELOG
randy-cro Oct 6, 2025
e3249d3
use common blockTime variable
randy-cro Oct 7, 2025
c9f93a8
remove redundant pairs and triplets variables
randy-cro Oct 7, 2025
97f93a6
sort keys by ascending timestamp + add tests
randy-cro Oct 7, 2025
a821923
retrieve all unbonding delegations, reldegations, and unbonding valid…
randy-cro Oct 7, 2025
3bb3625
Merge remote-tracking branch 'crypto/release/v0.50.x' into debug/vali…
randy-cro Oct 8, 2025
cb08219
update unbonding validators to use cache
randy-cro Oct 8, 2025
b052bd7
add comments to functions
randy-cro Oct 8, 2025
3286d6c
update unbonding delegations and redelegations to use cache too
randy-cro Oct 8, 2025
dfd33e1
minor changes + formatting
randy-cro Oct 8, 2025
758c901
expose max size parameter for cache initialization + simplify cache …
randy-cro Oct 8, 2025
65464da
avoid getting cache when overflow is true + return empty slice instea…
randy-cro Oct 9, 2025
99c1163
open store and delete entries for unbonding delegation and redelegati…
randy-cro Oct 9, 2025
707fe35
fix cache to only allow slices as value
randy-cro Oct 9, 2025
099c766
check overflow with slices length instead of key length + deep copy w…
randy-cro Oct 9, 2025
019d251
fix get cache race condition
randy-cro Oct 9, 2025
2683f10
refactor Slice to slice
randy-cro Oct 9, 2025
0bd6e70
update Cache to ValidatorsCache so that it is less generic
randy-cro Oct 9, 2025
e8ec78b
encapsulate overflow boolean whenever getting the cache
randy-cro Oct 9, 2025
3259e9d
refactor overflow to invalidated for greater semantic clarity
randy-cro Oct 9, 2025
4fba2ea
initialize pending redelegations before setting new entry
randy-cro Oct 9, 2025
88b0e90
init unbonding delegations / unbonding validator cache using common m…
randy-cro Oct 9, 2025
c2b8b34
minor optimization
randy-cro Oct 9, 2025
8be7403
adding of comments for functions + minor changes
randy-cro Oct 9, 2025
b9f2f24
add cache related test for unbonding validators/unbonding delegations…
randy-cro Oct 9, 2025
05dc22e
remove redundancy
randy-cro Oct 9, 2025
1bf414c
refactor invalidated to full
randy-cro Oct 9, 2025
045fda3
use keys for map length comparison
randy-cro Oct 9, 2025
141cecb
refactor cache names
randy-cro Oct 9, 2025
abb4652
refactor unbonding validator queue cache
randy-cro Oct 10, 2025
a93bf2c
use preallocation and early exit when its full
randy-cro Oct 10, 2025
e56f0bf
use common method for logger
randy-cro Oct 10, 2025
6958418
revert unneeded pointer methods
randy-cro Oct 10, 2025
d573545
add guard for cache
randy-cro Oct 10, 2025
17b3759
refactor validator queue cache
randy-cro Oct 10, 2025
0047c82
small change
randy-cro Oct 10, 2025
e5ca154
return error when setting if its not about max cache
randy-cro Oct 10, 2025
f1e6459
fix full check and setQueueEntry check to include reinitialization if…
randy-cro Oct 10, 2025
6cee0d6
handle dirty outside cache, remove getEntry, set full as true upon hi…
randy-cro Oct 10, 2025
1d41769
minor change
randy-cro Oct 10, 2025
257ac7c
remove redundant need to set dirty to true if reinitialization fails
randy-cro Oct 10, 2025
7e04788
refactor getFromStore to loadFromStore
randy-cro Oct 10, 2025
8464abf
minor change
randy-cro Oct 10, 2025
073667c
add guard to setEntry
randy-cro Oct 10, 2025
92fe032
optimise GetUnbondingValidatorsQueueEntry
randy-cro Oct 10, 2025
add7515
combine max < 0 and data == nil checks
randy-cro Oct 13, 2025
26b2faa
set dirty as false only if setting all keys are successful + move che…
randy-cro Oct 13, 2025
76cb8ec
return empty map or empty slice instead of nil for get and getEntry
randy-cro Oct 13, 2025
68080e0
fix unbonding validator error log
randy-cro Oct 13, 2025
f2bb298
add unbonding delegations into cache
randy-cro Oct 13, 2025
bc8b1e7
add redelegations queue into cache
randy-cro Oct 13, 2025
4cbfed8
minor changes to validator queue function comments
randy-cro Oct 13, 2025
1ef546b
initialize cache only if size is greater than 0
randy-cro Oct 13, 2025
9921cdc
fix keeper test to have large cache
randy-cro Oct 13, 2025
6d39fc3
add cache size to validator tests
randy-cro Oct 13, 2025
7af0724
add cache size to delegation and redelegation tests
randy-cro Oct 13, 2025
43ae90a
add clear function to refresh cache when reloading
randy-cro Oct 13, 2025
35e1483
add cache tests
randy-cro Oct 13, 2025
cd1e537
fix tests
randy-cro Oct 13, 2025
b9b2082
optional maxCacheSize in dependency injection
randy-cro Oct 13, 2025
91ed613
remove unneeded pointer methods
randy-cro Oct 13, 2025
d43ebe7
gofumpt
randy-cro Oct 13, 2025
7181279
fix lint make CacheEntry exportable
randy-cro Oct 13, 2025
a7ac2af
remove redundant change
randy-cro Oct 13, 2025
ca0181d
add staking cache flag
randy-cro Oct 13, 2025
ae8b7c4
remove redundancy
randy-cro Oct 13, 2025
79b984a
add dependency injection flag
randy-cro Oct 13, 2025
f6adffd
fix dependency injection
randy-cro Oct 13, 2025
e0c3838
change cache size = 0 means unlimited and if size < 0 do not initiali…
randy-cro Oct 14, 2025
bd9d391
fix logger text
randy-cro Oct 14, 2025
1ae24ec
encapsulate cache initiation with NewValidatorsQueueCache constructor
randy-cro Oct 14, 2025
22f48a8
return nil for DequeueAllMatureRedelegationQueue
randy-cro Oct 14, 2025
f1c53f9
log cache errors and fallback to store instead of returning error to …
randy-cro Oct 14, 2025
9234e3a
change full and dirty to atomic bool to protect against race
randy-cro Oct 14, 2025
0ab9f6b
remove cache warnings since errors are logged on the caller
randy-cro Oct 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Features

* [#22795](https://github.com/cosmos/cosmos-sdk/pull/22795) `NewUnbondingDelegationEntry`, `NewUnbondingDelegation`, `AddEntry`, `NewRedelegationEntry`, `NewRedelegation` and `NewRedelegationEntryResponse` no longer take an ID in there function signatures. AfterUnbondingInitiated hook has been removed as it is no longer required by ICS. Keys `stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, stakingtypes.UnbondingTypeKey` have been removed as they are no longer required by ICS.
* (x/staking) [#22795](https://github.com/crypto-org-chain/cosmos-sdk/pull/1725) Optimize staking endblocker execution by caching queue entries from iterators.
* (x/staking) [#22795](https://github.com/cosmos/cosmos-sdk/pull/22795) `NewUnbondingDelegationEntry`, `NewUnbondingDelegation`, `AddEntry`, `NewRedelegationEntry`, `NewRedelegation` and `NewRedelegationEntryResponse` no longer take an ID in there function signatures. AfterUnbondingInitiated hook has been removed as it is no longer required by ICS. Keys `stakingtypes.UnbondingIDKey, stakingtypes.UnbondingIndexKey, stakingtypes.UnbondingTypeKey` have been removed as they are no longer required by ICS.
* (baseapp) [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Add `TxExecutor` baseapp option, add `TxIndex`/`TxCount`/`MsgIndex`/`BlockGasUsed` fields to `Context, to support tx parallel execution.
* (baseapp) [#206](https://github.com/crypto-org-chain/cosmos-sdk/pull/206) Support mount object store in baseapp, add `ObjectStore` api in context, [#585](https://github.com/crypto-org-chain/cosmos-sdk/pull/585) Skip snapshot for object store.
* (bank) [#237](https://github.com/crypto-org-chain/cosmos-sdk/pull/237) Support virtual accounts in sending coins.
Expand Down
2 changes: 1 addition & 1 deletion proto/cosmos/staking/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,4 @@ message QueryParamsRequest {}
message QueryParamsResponse {
// params holds all the parameters of this module.
Params params = 1 [(gogoproto.nullable) = false, (amino.dont_omitempty) = true];
}
}
14 changes: 14 additions & 0 deletions server/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ type MempoolConfig struct {
MaxTxs int `mapstructure:"max-txs"`
}

// StakingConfig defines the staking module configuration
type StakingConfig struct {
// CacheSize defines the maximum number of time-based queue entries to cache
// for unbonding validators, unbonding delegations, and redelegations.
// cache-size = 0 means unlimited cache (no size limit).
// cache-size < 0 means the cache is disabled.
// cache-size > 0 sets a size limit for the cache.
CacheSize int `mapstructure:"cache-size"`
}

// State Streaming configuration
type (
// StreamingConfig defines application configuration for external streaming services
Expand All @@ -194,6 +204,7 @@ type Config struct {
StateSync StateSyncConfig `mapstructure:"state-sync"`
Streaming StreamingConfig `mapstructure:"streaming"`
Mempool MempoolConfig `mapstructure:"mempool"`
Staking StakingConfig `mapstructure:"staking"`
}

// SetMinGasPrices sets the validator's minimum gas prices.
Expand Down Expand Up @@ -265,6 +276,9 @@ func DefaultConfig() *Config {
Mempool: MempoolConfig{
MaxTxs: -1,
},
Staking: StakingConfig{
CacheSize: 0,
},
}
}

Expand Down
12 changes: 12 additions & 0 deletions server/config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,18 @@ stop-node-on-err = {{ .Streaming.ABCI.StopNodeOnErr }}
# Note, this configuration only applies to SDK built-in app-side mempool
# implementations.
max-txs = {{ .Mempool.MaxTxs }}

###############################################################################
### Modules ###
###############################################################################

[staking]
# cache-size defines the maximum number of time-based queue entries to cache
# for unbonding validators, unbonding delegations, and redelegations.
# cache-size = 0 means unlimited cache (no size limit).
# cache-size < 0 means the cache is disabled.
# cache-size > 0 sets a size limit for the cache.
cache-size = {{ .Staking.CacheSize }}
`

var configTemplate *template.Template
Expand Down
4 changes: 4 additions & 0 deletions server/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,9 @@ const (
// mempool flags
FlagMempoolMaxTxs = "mempool.max-txs"

// staking flags
FlagStakingCacheSize = "staking.cache-size"

// testnet keys
KeyIsTestnet = "is-testnet"
KeyNewChainID = "new-chain-ID"
Expand Down Expand Up @@ -997,6 +1000,7 @@ func addStartNodeFlags(cmd *cobra.Command, opts StartCmdOptions) {
cmd.Flags().Uint32(FlagStateSyncSnapshotKeepRecent, 2, "State sync snapshot to keep")
cmd.Flags().Bool(FlagDisableIAVLFastNode, false, "Disable fast node for IAVL tree")
cmd.Flags().Int(FlagMempoolMaxTxs, mempool.DefaultMaxTx, "Sets MaxTx value for the app-side mempool")
cmd.Flags().Int(FlagStakingCacheSize, 0, "Sets the cache size for staking unbonding queues (0 = unlimited, negative = disabled)")
cmd.Flags().Duration(FlagShutdownGrace, 0*time.Second, "On Shutdown, duration to wait for resource clean up")

// support old flags name for backwards compatibility
Expand Down
4 changes: 3 additions & 1 deletion simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,10 @@ func NewSimApp(
}
app.txConfig = txConfig

stakingCacheSize := cast.ToInt(appOpts.Get(server.FlagStakingCacheSize))

app.StakingKeeper = stakingkeeper.NewKeeper(
appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
appCodec, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), app.AccountKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), authcodec.NewBech32Codec(sdk.Bech32PrefixValAddr), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), stakingCacheSize,
)
app.MintKeeper = mintkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[minttypes.StoreKey]), app.StakingKeeper, app.AccountKeeper, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String())

Expand Down
6 changes: 6 additions & 0 deletions simapp/app_di.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"

dbm "github.com/cosmos/cosmos-db"
"github.com/spf13/cast"

clienthelpers "cosmossdk.io/client/v2/helpers"
"cosmossdk.io/depinject"
Expand Down Expand Up @@ -96,6 +97,10 @@ func init() {
}
}

func ProvideStakingCacheSize(appOpts servertypes.AppOptions) int {
return cast.ToInt(appOpts.Get(server.FlagStakingCacheSize))
}

// NewSimApp returns a reference to an initialized SimApp.
func NewSimApp(
logger log.Logger,
Expand Down Expand Up @@ -158,6 +163,7 @@ func NewSimApp(
// custom function that implements the minttypes.InflationCalculationFn
// interface.
),
depinject.Provide(ProvideStakingCacheSize),
)
)

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/distribution/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func initFixture(t testing.TB) *fixture {
log.NewNopLogger(),
)

stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr))
stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), 0)

distrKeeper := distrkeeper.NewKeeper(
cdc, runtime.NewKVStoreService(keys[distrtypes.StoreKey]), accountKeeper, bankKeeper, stakingKeeper, distrtypes.ModuleName, authority.String(),
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/evidence/keeper/infraction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func initFixture(t testing.TB) *fixture {
log.NewNopLogger(),
)

stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr))
stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), 0)

slashingKeeper := slashingkeeper.NewKeeper(cdc, codec.NewLegacyAmino(), runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), stakingKeeper, authority.String())

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/gov/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func initFixture(t testing.TB) *fixture {
log.NewNopLogger(),
)

stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr))
stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), 0)

// set default staking params
stakingKeeper.SetParams(newCtx, stakingtypes.DefaultParams())
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/slashing/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func initFixture(t testing.TB) *fixture {
log.NewNopLogger(),
)

stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr))
stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), 0)

slashingKeeper := slashingkeeper.NewKeeper(cdc, &codec.LegacyAmino{}, runtime.NewKVStoreService(keys[slashingtypes.StoreKey]), stakingKeeper, authority.String())

Expand Down
2 changes: 1 addition & 1 deletion tests/integration/staking/keeper/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func initFixture(t testing.TB) *fixture {
log.NewNopLogger(),
)

stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[types.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr))
stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[types.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), 0)

authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts, nil)
bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper, nil)
Expand Down
4 changes: 2 additions & 2 deletions tests/integration/staking/keeper/determinstic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture {
log.NewNopLogger(),
)

stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr))
stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr), 0)

authModule := auth.NewAppModule(cdc, accountKeeper, authsims.RandomGenesisAccounts, nil)
bankModule := bank.NewAppModule(cdc, bankKeeper, accountKeeper, nil)
Expand Down Expand Up @@ -852,4 +852,4 @@ func TestGRPCParams(t *testing.T) {
assert.NilError(t, err)

testdata.DeterministicIterations(f.ctx, t, &stakingtypes.QueryParamsRequest{}, f.queryClient.Params, 1114, false)
}
}
Loading
Loading