Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix the bug introduced by fixing the testnet syncing issue #331

Merged
merged 1 commit into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

##v0.26.1
* [sdk] [\#331] (https://github.com/bnb-chain/bnc-cosmos-sdk/pull/331) fix: fix the bug introduced by fixing the testnet syncing issue

##v0.26.0
* [sec] [\#328](https://github.com/bnb-chain/bnc-cosmos-sdk/pull/328) sec: implement security enhancements (#328)

Expand Down
7 changes: 6 additions & 1 deletion x/stake/keeper/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,12 @@ func (k Keeper) SetParams(ctx sdk.Context, params types.Params) {
k.paramstore.Set(ctx, types.KeyMaxValidators, params.MaxValidators)
k.paramstore.Set(ctx, types.KeyBondDenom, params.BondDenom)
if sdk.IsUpgrade(sdk.LaunchBscUpgrade) {
if ctx.ChainID() == sdk.ChainIdGanges {
// the reason for this logic is:
// 1. when the testnet is set up, the config of `MaxValidators` and `MinSelfDelegation` is different from the default value in code
// 2. the first fix has a bug that the overwrite of the configs happens after the bsc upgrade instead of only taking effect block 1
// 3. so this is why the check `ctx.BlockHeight() == 1 || ctx.BlockHeight() == 37501781` is added to fix the bug. 37501781 is the height
// when the first proposal executed after the first fix
if ctx.ChainID() == sdk.ChainIdGanges && (ctx.BlockHeight() == 1 || ctx.BlockHeight() == 37501781) {
k.paramstore.Set(ctx, types.KeyMaxValidators, uint16(11))
k.paramstore.Set(ctx, types.KeyMinSelfDelegation, int64(5000000000000))
k.paramstore.Set(ctx, types.KeyMinDelegationChange, params.MinDelegationChange)
Expand Down