From 66091648c39b11386fbc6ce5d88d3604ff8f4f6b Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Fri, 26 Apr 2024 09:36:20 -0700 Subject: [PATCH 1/2] Don't check for expired locks every single blcok --- x/lockup/abci.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/x/lockup/abci.go b/x/lockup/abci.go index 031ab29d4cf..9c5bf044492 100644 --- a/x/lockup/abci.go +++ b/x/lockup/abci.go @@ -14,13 +14,15 @@ 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 { - // 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) + if ctx.BlockHeight()%30 == 0 { + // 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) - // withdraw and delete locks - k.WithdrawAllMaturedLocks(ctx) + // withdraw and delete locks + k.WithdrawAllMaturedLocks(ctx) + } return []abci.ValidatorUpdate{} } From 557e4c6ee601501848660deb8dc5ea5d7dbbefd2 Mon Sep 17 00:00:00 2001 From: Dev Ojha Date: Fri, 26 Apr 2024 10:00:15 -0700 Subject: [PATCH 2/2] Add Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4aca84d66..f6c8952eaa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * [#8125](https://github.com/osmosis-labs/osmosis/pull/8125) When using smart accounts, fees are deducted directly after the feePayer is authenticated. Regardless of the authentication of other signers * [#8136](https://github.com/osmosis-labs/osmosis/pull/8136) Don't allow gauge creation/addition with rewards that have no protorev route (i.e. no way to determine if rewards meet minimum epoch value distribution requirements) * [#8144](https://github.com/osmosis-labs/osmosis/pull/8144) IBC wasm clients can now make stargate queries and support abort. +* [#8147](https://github.com/osmosis-labs/osmosis/pull/8147) Process unbonding locks once per minute, rather than every single block. ### State Compatible