From 07eb468f7e8bf22a521ada0910104baebf228e1e Mon Sep 17 00:00:00 2001 From: Rainer Koirikivi Date: Wed, 29 May 2024 12:02:46 +0100 Subject: [PATCH] Hopefully fix gas limit issues and don't use 3.5M gas by default --- .../federator/src/lib/TransactionSender.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sovryn-token-bridge/federator/src/lib/TransactionSender.js b/sovryn-token-bridge/federator/src/lib/TransactionSender.js index 11927717..2fb8c796 100644 --- a/sovryn-token-bridge/federator/src/lib/TransactionSender.js +++ b/sovryn-token-bridge/federator/src/lib/TransactionSender.js @@ -51,9 +51,14 @@ module.exports = class TransactionSender { // Vote: ~70k // Vote+execute: A little over 250k + // Vote+execute with signatures: Can get to over 300k, 500k+ with aggregators involved // First side token deployment: ~3.15M - const minimum = 300000; - const gasLimit = estimatedGas < minimum ? minimum : 3500000; + const multiplier = 1.5; + const minimum = 400000; + let gasLimit = Math.ceil(estimatedGas * multiplier); + if (gasLimit < minimum) { + gasLimit = minimum; + } return gasLimit; }