Skip to content

Commit

Permalink
chore: Set MaxAgeNumBlocks in v11 Upgrade Handler (#2147)
Browse files Browse the repository at this point in the history
Closes: #2124

## What is the purpose of the change

Ref: #1638

Since the previous upgrade was a fork, the MaxAgeNumBlocks change was not applied during v10 upgrade.

As a result, adding the exact same logic to the v11 handler.

## Testing and Verifying

Covered by e2e upgrade tests.

## Documentation and Release Note

  - Does this pull request introduce a new feature or user-facing behavior changes? no
  - Is a relevant changelog entry added to the `Unreleased` section in `CHANGELOG.md`? no
  - How is the feature or change documented? not applicable
  • Loading branch information
p0mvn authored Jul 19, 2022
1 parent 3aecc23 commit edf78ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

* [#2016](https://github.com/osmosis-labs/osmosis/pull/2016) Add fixed 10000 gas cost for each Balancer swap
* [$2147](https://github.com/osmosis-labs/osmosis/pull/2147) Set MaxAgeNumBlocks in v11 Upgrade Handler to two weeks.

### Breaking Changes

Expand Down
12 changes: 12 additions & 0 deletions app/upgrades/v11/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ func CreateUpgradeHandler(
return nil, err
}

// Set the max_age_num_blocks in the evidence params to reflect the 14 day
// unbonding period.
//
// Ref: https://github.com/osmosis-labs/osmosis/issues/1160
cp := bpm.GetConsensusParams(ctx)
if cp != nil && cp.Evidence != nil {
evParams := cp.Evidence
evParams.MaxAgeNumBlocks = 186_092

bpm.StoreConsensusParams(ctx, cp)
}

return mm.RunMigrations(ctx, configurator, fromVM)
}
}

0 comments on commit edf78ae

Please sign in to comment.