Update minimum gasPrice for Gnosis#256
Conversation
| try { | ||
| const response = await axios.get(blockchain.gasPriceOracleLink); | ||
| const fastGasPrice = Number(response?.data?.fast) * 1e9; | ||
| const fastGasPrice = Number(response ? .data ? .fast) * 1e9; |
There was a problem hiding this comment.
Aditional spaces here need to be removed
|
|
||
| try { | ||
| if (requestData?.paymaster && requestData?.paymaster !== ZERO_ADDRESS) { | ||
| if (requestData ? .paymaster && requestData ? .paymaster !== ZERO_ADDRESS) { |
There was a problem hiding this comment.
This is wrong synatx
|
There are some formatting changes that look suspicius, but what you changed looks good. I woud just move that logic to this function: Can we move logic there and merge only those chagnes. Also version bump is need, after version is updated and npm i is done we can release |
| const fastGasPrice = Number(response?.data?.fast) * 1e9; | ||
| return fastGasPrice || DEFAULT_GAS_PRICE_WEI.GNOSIS; | ||
| let fastGasPrice = Number(response?.data?.fast) * 1e9; | ||
| const minGnosisGasPrice = 1100000000; // 1.1 Gwei |
There was a problem hiding this comment.
Can you make this a constant and reuse it in catch?
| const minGnosisGasPrice = 1100000000; // 1.1 Gwei | ||
| // Enforce minimum | ||
| if (!fastGasPrice || fastGasPrice < minGnosisGasPrice) { | ||
| fastGasPrice = minGnosisGasPrice; |
There was a problem hiding this comment.
fastGasPrice is multiplied by 1e9 but minGnosisGasPrice is not. That seems to suggest that the final value should be in wei, not gwei.
However, when you're assigning fastGasPrice = minGnosisGasPrice, fastGasPrice becomes a gwei value. Same for the catch block
| gasPrice = Number(response.result, 10); | ||
| } else if (blockchain.name.split(':')[1] === '10200') { | ||
| gasPrice = Math.round((response.data.fast) * 1e9); | ||
| gasPrice = Math.round(response.data.fast * 1e9); |
There was a problem hiding this comment.
I think this should be different if response fast is less than minimum required than use default values, also this is only change for testnet
PATCH: Force minimum gas price for Gnosis