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

Delete some legacy code for delaying when lockup unbonds are possible #8030

Merged
merged 2 commits into from
Apr 13, 2024
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
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) 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