From bdfca7617c262e1d36c34e5e28c4b941a833ffac Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 18 May 2023 23:46:02 +0000 Subject: [PATCH 1/2] chore: commit at the end of benchmark --- x/concentrated-liquidity/bench_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/concentrated-liquidity/bench_test.go b/x/concentrated-liquidity/bench_test.go index 95cec986ea6..b30870e3974 100644 --- a/x/concentrated-liquidity/bench_test.go +++ b/x/concentrated-liquidity/bench_test.go @@ -5,7 +5,6 @@ import ( "math" "math/rand" "testing" - "time" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" @@ -222,7 +221,7 @@ func BenchmarkSwapExactAmountIn(b *testing.B) { // Increase block time so that some incentives uptime accumulator update logic // isn't a no-op. - s.Ctx = s.Ctx.WithBlockTime(s.Ctx.BlockTime().Add(time.Second)) + s.Commit() // Fund swap amount. simapp.FundAccount(s.App.BankKeeper, s.Ctx, s.TestAccs[0], sdk.NewCoins(largeSwapInCoin)) From 6923f636c7599c8b74b1fce3a494411e39a309af Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 18 May 2023 23:50:50 +0000 Subject: [PATCH 2/2] updates --- x/concentrated-liquidity/bench_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/x/concentrated-liquidity/bench_test.go b/x/concentrated-liquidity/bench_test.go index b30870e3974..8fecfe4a05d 100644 --- a/x/concentrated-liquidity/bench_test.go +++ b/x/concentrated-liquidity/bench_test.go @@ -219,8 +219,7 @@ func BenchmarkSwapExactAmountIn(b *testing.B) { fmt.Println("num_ticks_traversed", len(liquidityNet)) fmt.Println("current_tick", currentTick) - // Increase block time so that some incentives uptime accumulator update logic - // isn't a no-op. + // Commit the block so that position updates are propagated to IAVL. s.Commit() // Fund swap amount.