From ceccaa863ae41537370b8d5a48ff732d2f064289 Mon Sep 17 00:00:00 2001 From: Daniel Simon Date: Mon, 26 Apr 2021 18:13:27 +0700 Subject: [PATCH] fix: increase gas headroom for TXs that manipulate StortedTroves --- packages/lib-ethers/src/PopulatableEthersLiquity.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/lib-ethers/src/PopulatableEthersLiquity.ts b/packages/lib-ethers/src/PopulatableEthersLiquity.ts index ae7bd91e7..317be6e21 100644 --- a/packages/lib-ethers/src/PopulatableEthersLiquity.ts +++ b/packages/lib-ethers/src/PopulatableEthersLiquity.ts @@ -70,8 +70,9 @@ const id = (t: T) => t; // Takes ~6-7K to update lastFeeOperationTime. Let's be on the safe side. const addGasForPotentialLastFeeOperationTimeUpdate = (gas: BigNumber) => gas.add(10000); -// An extra traversal can take ~12K. -const addGasForPotentialListTraversal = (gas: BigNumber) => gas.add(25000); +// First traversal in ascending direction takes ~50K, then ~13.5K per extra step. +// 80K should be enough for 3 steps, plus some extra to be safe. +const addGasForPotentialListTraversal = (gas: BigNumber) => gas.add(80000); const addGasForLQTYIssuance = (gas: BigNumber) => gas.add(50000);