diff --git a/src/constants/constants.js b/src/constants/constants.js index 6a0d897a6c..9afa6ed6b9 100644 --- a/src/constants/constants.js +++ b/src/constants/constants.js @@ -188,6 +188,8 @@ export const COMMAND_TX_GAS_INCREASE_FACTORS = { SUBMIT_PROOFS: 1.2, }; +export const GNOSIS_DEFAULT_GAS_PRICE = 2; + export const WEBSOCKET_PROVIDER_OPTIONS = { reconnect: { auto: true, diff --git a/src/modules/blockchain/implementation/gnosis/gnosis-service.js b/src/modules/blockchain/implementation/gnosis/gnosis-service.js index a265283c0a..089ad52f81 100644 --- a/src/modules/blockchain/implementation/gnosis/gnosis-service.js +++ b/src/modules/blockchain/implementation/gnosis/gnosis-service.js @@ -1,6 +1,6 @@ import axios from 'axios'; import Web3Service from '../web3-service.js'; -import { BLOCK_TIME_MILLIS } from '../../../../constants/constants.js'; +import { BLOCK_TIME_MILLIS, GNOSIS_DEFAULT_GAS_PRICE } from '../../../../constants/constants.js'; class GnosisService extends Web3Service { constructor(ctx) { @@ -26,9 +26,23 @@ class GnosisService extends Web3Service { this.logger.debug(`Gas price on Gnosis: ${gasPrice}`); return gasPrice; } catch (error) { - return undefined; + this.logger.warn( + `Failed to fetch the gas price from the Gnosis: ${error}. Using default value: ${GNOSIS_DEFAULT_GAS_PRICE} Gwei.`, + ); + this.convertToWei(GNOSIS_DEFAULT_GAS_PRICE, 'gwei'); } } + + async healthCheck() { + try { + const blockNumber = await this.getBlockNumber(); + if (blockNumber) return true; + } catch (e) { + this.logger.error(`Error on checking Gnosis blockchain. ${e}`); + return false; + } + return false; + } } export default GnosisService;