Skip to content

Commit

Permalink
Delete some legacy code for delaying when lockup unbonds are possible (
Browse files Browse the repository at this point in the history
…#8030)

* Delete some legacy code for delaying when lockup unbonds are possible

* Update changelog
  • Loading branch information
ValarDragon authored Apr 13, 2024
1 parent 49776d0 commit e98d023
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### State Breaking

* [#8030](https://github.com/osmosis-labs/osmosis/pull/8030) Delete legacy behavior where lockups could not unbond at very small block heights on a testnet.

### State Compatible

* [#8006](https://github.com/osmosis-labs/osmosis/pull/8006), [#8014](https://github.com/osmosis-labs/osmosis/pull/8014) Speedup many BigDec operations
Expand Down
9 changes: 2 additions & 7 deletions x/lockup/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ func BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock, k keeper.Keeper)

// Called every block to automatically unlock matured locks.
func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate {
// disable automatic withdraw before specific block height
// it is actually for testing with legacy
MinBlockHeightToBeginAutoWithdrawing := int64(6)
if ctx.BlockHeight() < MinBlockHeightToBeginAutoWithdrawing {
return []abci.ValidatorUpdate{}
}

// TODO: Change this logic to "know" when the next unbonding time is, and only unlock at that time.
// At each unbond, do an iterate to find the next unbonding time and wait until then.
// delete synthetic locks matured before lockup deletion
k.DeleteAllMaturedSyntheticLocks(ctx)

Expand Down

0 comments on commit e98d023

Please sign in to comment.