Skip to content

Commit

Permalink
Merge pull request #549 from liquity/increase-traversal-headroom
Browse files Browse the repository at this point in the history
fix: increase gas headroom for TXs that manipulate StortedTroves
  • Loading branch information
edmulraney authored Apr 27, 2021
2 parents a76c1d3 + ceccaa8 commit 1e36fe9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/lib-ethers/src/PopulatableEthersLiquity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ const id = <T>(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);

Expand Down

0 comments on commit 1e36fe9

Please sign in to comment.