Update bump percent for V4 relayer withdrawals & bump version to 0.2.2
This commit is contained in:
parent
03e6af5614
commit
f5244ae722
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@tornado/tornado-oracles",
|
||||
"version": "0.2.1",
|
||||
"version": "0.2.2",
|
||||
"description": "Gas oracle for Tornado-specific transactions",
|
||||
"main": "./lib/index.js",
|
||||
"types": "./lib/index.d.ts",
|
||||
|
@ -22,10 +22,10 @@ export class TornadoFeeOracleV4 extends TornadoFeeOracle implements ITornadoFeeO
|
||||
|
||||
// Need to bump relayer gas limit for transaction, because predefined gas limit to small to be 100% sure that transaction will be sent
|
||||
// This leads to fact that relayer often pays extra for gas from his own funds, however, this was designed by previous developers
|
||||
if (type === 'relayer_withdrawal') return bump(defaultWithdrawalGasLimit[this.chainId], bumpPercent || 20);
|
||||
if (type === 'relayer_withdrawal') return bump(defaultWithdrawalGasLimit[this.chainId], bumpPercent || 25);
|
||||
// For compatibility reasons, when wee check user-provided fee for V4 withdrawal transaction, we need dump gas limit
|
||||
// for about 20 percent,so that the transaction will be sent, even if it results in some loss for the relayer
|
||||
if (type === 'relayer_withdrawal_check_v4') return bump(defaultWithdrawalGasLimit[this.chainId], -20);
|
||||
if (type === 'relayer_withdrawal_check_v4') return bump(defaultWithdrawalGasLimit[this.chainId], -25);
|
||||
if (!tx) return BigNumber.from(21_000);
|
||||
|
||||
return this.provider.estimateGas(tx);
|
||||
|
Loading…
Reference in New Issue
Block a user