diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 647f09d..b69995d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,12 +20,13 @@ jobs: - run: yarn lint - name: Telegram Failure Notification uses: appleboy/telegram-action@master - if: failure() - with: - message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }} - format: markdown - to: ${{ secrets.TELEGRAM_CHAT_ID }} - token: ${{ secrets.TELEGRAM_BOT_TOKEN }} +# TODO if: failure() +# if: failure() +# with: +# message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }} +# format: markdown +# to: ${{ secrets.TELEGRAM_CHAT_ID }} +# token: ${{ secrets.TELEGRAM_BOT_TOKEN }} # TODO: Edit this step # publish: # runs-on: ubuntu-latest diff --git a/src/config.ts b/src/config.ts index fca6d83..a14184c 100644 --- a/src/config.ts +++ b/src/config.ts @@ -8,6 +8,8 @@ export const netId = Number(process.env.NET_ID || 1); export const redisUrl = process.env.REDIS_URL || 'redis://127.0.0.1:6379'; export const rpcUrl = process.env.HTTP_RPC_URL; export const CONFIRMATIONS = Number(process.env.CONFIRMATIONS) || 4; +export const MAX_GAS_PRICE = Number(process.env.MAX_GAS_PRICE) || 1000; +export const BASE_FEE_RESERVE_PERCENTAGE = Number(process.env.BASE_FEE_RESERVE_PERCENTAGE) || 25; export const mainnetRpcUrl = process.env.ORACLE_RPC_URL || 'https://mainnet.infura.io/'; export const offchainOracleAddress = '0x07D91f5fb9Bf7798734C3f606dB065549F6893bb'; export const multiCallAddress = '0xda3c19c6fe954576707fa24695efb830d9cca1ca'; diff --git a/src/services/notifier.service.ts b/src/services/notifier.service.ts index 5835ada..d9fa205 100644 --- a/src/services/notifier.service.ts +++ b/src/services/notifier.service.ts @@ -40,13 +40,13 @@ export class NotifierService { private telegram: Telegram | MockTelegram; private readonly token: string; private readonly chatId: string; - prefix: string; + host: string; constructor(private store: RedisStore, private config: ConfigService) { this.token = process.env.TELEGRAM_NOTIFIER_BOT_TOKEN; this.chatId = process.env.TELEGRAM_NOTIFIER_CHAT_ID; this.telegram = this.token ? new Telegram(this.token) : new MockTelegram(); - this.prefix = this.config.host; + this.host = this.config.host; } async processAlert(message: string) { @@ -72,7 +72,7 @@ export class NotifierService { } send(message: string, level: Levels) { - const text = `${AlertLevel[level]} ${this.prefix}: ${message}`; + const text = `${AlertLevel[level]} ${this.host}: ${message}`; return this.telegram.sendMessage(this.chatId, text, { parse_mode: 'HTML' }); } diff --git a/src/services/tx.service.ts b/src/services/tx.service.ts index e6c4f77..9a4867b 100644 --- a/src/services/tx.service.ts +++ b/src/services/tx.service.ts @@ -4,7 +4,7 @@ import { Provider } from '@ethersproject/providers'; import { formatEther, parseUnits } from 'ethers/lib/utils'; import { BigNumber, BigNumberish, BytesLike } from 'ethers'; import { ProxyLightABI, TornadoProxyABI } from '../contracts'; -import { CONFIRMATIONS, gasLimits, tornadoServiceFee } from '../config'; +import { BASE_FEE_RESERVE_PERCENTAGE, CONFIRMATIONS, gasLimits, MAX_GAS_PRICE, tornadoServiceFee } from '../config'; import { JobStatus, RelayerJobType } from '../types'; import { PriceService } from './price.service'; import { Job } from 'bullmq'; @@ -47,7 +47,7 @@ export class TxService { this.txManager = new TxManager({ privateKey, rpcUrl, - config: { THROW_ON_REVERT: true, CONFIRMATIONS }, + config: { THROW_ON_REVERT: true, CONFIRMATIONS, MAX_GAS_PRICE, BASE_FEE_RESERVE_PERCENTAGE }, provider: this.provider, }); this.oracle = new GasPriceOracle({