From 2b3892774324cb52fbd304093078708ccb3232c8 Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 23 Dec 2020 20:03:20 -0600 Subject: [PATCH] decrease default BLOCK_GAS_LIMIT --- src/Transaction.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Transaction.js b/src/Transaction.js index def47d1..6341f02 100644 --- a/src/Transaction.js +++ b/src/Transaction.js @@ -118,7 +118,7 @@ class Transaction { async _prepare() { if (!this.config.BLOCK_GAS_LIMIT) { const lastBlock = await this._provider.getBlock('latest') - this.config.BLOCK_GAS_LIMIT = lastBlock.gasLimit.toNumber() + this.config.BLOCK_GAS_LIMIT = Math.floor(lastBlock.gasLimit.toNumber() * 0.95) } if (!this.tx.gasLimit || this.config.ESTIMATE_GAS) {