This commit is contained in:
smart_ex 2022-07-29 18:42:55 +10:00
parent 32b7714371
commit 340df8bdd1
6 changed files with 81 additions and 109 deletions

@ -2,8 +2,8 @@ name: build
on: on:
push: push:
branches: ['*'] branches: [ '*' ]
tags: ['v[0-9]+.[0-9]+.[0-9]+'] tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ]
pull_request: pull_request:
jobs: jobs:
@ -15,85 +15,81 @@ jobs:
- uses: actions/setup-node@v1 - uses: actions/setup-node@v1
with: with:
node-version: 16 node-version: 16
- run: yarn install --network-concurrency=2 - run: yarn install
# - run: yarn test
- run: yarn lint - run: yarn lint
# - name: Telegram Failure Notification - name: Telegram Failure Notification
# uses: appleboy/telegram-action@master uses: appleboy/telegram-action@master
# if: failure() if: failure()
# with: with:
# message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }} message: ❗ Build failed for [${{ github.repository }}](https://github.com/${{ github.repository }}/actions) because of ${{ github.actor }}
# format: markdown format: markdown
# to: ${{ secrets.TELEGRAM_CHAT_ID }} to: ${{ secrets.TELEGRAM_CHAT_ID }}
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }} token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# TODO: Edit this step publish:
# publish: runs-on: ubuntu-latest
# runs-on: ubuntu-latest needs: build
# needs: build if: startsWith(github.ref, 'refs/tags')
# if: startsWith(github.ref, 'refs/tags') steps:
# steps: - name: Checkout
# - name: Checkout uses: actions/checkout@v2
# uses: actions/checkout@v2
# - name: Set vars
# - name: Set vars id: vars
# id: vars run: |
# run: | echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/v})"
# echo "::set-output name=version::$(echo ${GITHUB_REF#refs/tags/v})" echo "::set-output name=repo_name::$(echo ${GITHUB_REPOSITORY#*/})"
# echo "::set-output name=repo_name::$(echo ${GITHUB_REPOSITORY#*/})"
# - name: Check package.json version vs tag
# - name: Check package.json version vs tag run: |
# run: | [ ${{ steps.vars.outputs.version }} = $(grep '"version":' package.json | grep -o "[0-9.]*") ] || (echo "Git tag doesn't match version in package.json" && false)
# [ ${{ steps.vars.outputs.version }} = $(grep '"version":' package.json | grep -o "[0-9.]*") ] || (echo "Git tag doesn't match version in package.json" && false)
# - name: Build and push Docker image
# - name: Build and push Docker image uses: docker/build-push-action@v1.1.0
# uses: docker/build-push-action@v1.1.0 with:
# with: dockerfile: Dockerfile
# dockerfile: Dockerfile repository: tornadocash/relayer
# repository: tornadocash/relayer tag_with_ref: true
# tag_with_ref: true tags: candidate
# tags: candidate username: ${{ secrets.DOCKER_USERNAME }}
# username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_TOKEN }}
# password: ${{ secrets.DOCKER_TOKEN }}
# - name: Telegram Message Notify
# - name: Telegram Message Notify uses: appleboy/telegram-action@master
# uses: appleboy/telegram-action@master with:
# with: to: ${{ secrets.TELEGRAM_CHAT_ID }}
# to: ${{ secrets.TELEGRAM_CHAT_ID }} token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }} message: 🚀 Published a [${{ steps.vars.outputs.repo_name }}](https://github.com/${{ github.repository }}) version ${{ steps.vars.outputs.version }} to docker hub
# message: 🚀 Published a [${{ steps.vars.outputs.repo_name }}](https://github.com/${{ github.repository }}) version ${{ steps.vars.outputs.version }} to docker hub debug: true
# debug: true format: markdown
# format: markdown
# - name: Telegram Relayer Channel Notification
# - name: Telegram Relayer Channel Notification uses: appleboy/telegram-action@master
# uses: appleboy/telegram-action@master with:
# with: to: ${{ secrets.TELEGRAM_RELAYER_CHAT_ID }}
# to: ${{ secrets.TELEGRAM_RELAYER_CHAT_ID }} token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }} message: |
# message: | 🚀 Published a new version of the relayer node service for mainnet to docker hub: `tornadocash/relayer:v${{ steps.vars.outputs.version }}` and `tornadocash/relayer`.
# 🚀 Published a new version of the relayer node service for mainnet to docker hub: `tornadocash/relayer:v${{ steps.vars.outputs.version }}` and `tornadocash/relayer:mining`.
# Please update your mainnet nodes ❗️
# ❗Please update your mainnet nodes ❗️
# DO NOT TOUCH SIDECHAINS AND NOVA RELAYERS. debug: true
# format: markdown
# debug: true
# format: markdown - name: Discord Relayer Channel Notification
# env:
# - name: Discord Relayer Channel Notification DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELAYER_WEBHOOK }}
# env: uses: Ilshidur/action-discord@master
# DISCORD_WEBHOOK: ${{ secrets.DISCORD_RELAYER_WEBHOOK }} with:
# uses: Ilshidur/action-discord@master args: |
# with: 🚀 Published a new version of the relayer node service for mainnet to docker hub: `tornadocash/relayer:v${{ steps.vars.outputs.version }}` and `tornadocash/relayer`.
# args: |
# 🚀 Published a new version of the relayer node service for mainnet to docker hub: `tornadocash/relayer:v${{ steps.vars.outputs.version }}` and `tornadocash/relayer:mining`. Please update your mainnet nodes ❗️
#
# ❗Please update your mainnet nodes ❗️ - name: Telegram Failure Notification
# DO NOT TOUCH SIDECHAINS AND NOVA RELAYERS. uses: appleboy/telegram-action@master
# if: failure()
# - name: Telegram Failure Notification with:
# uses: appleboy/telegram-action@master message: ❗ Failed to publish [${{ steps.vars.outputs.repo_name }}](https://github.com/${{ github.repository }}/actions):v${{ steps.vars.outputs.version }} for mainnet because of ${{ github.actor }}
# if: failure() format: markdown
# with: to: ${{ secrets.TELEGRAM_CHAT_ID }}
# message: ❗ Failed to publish [${{ steps.vars.outputs.repo_name }}](https://github.com/${{ github.repository }}/actions):v${{ steps.vars.outputs.version }} for mainnet because of ${{ github.actor }} token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
# format: markdown
# to: ${{ secrets.TELEGRAM_CHAT_ID }}
# token: ${{ secrets.TELEGRAM_BOT_TOKEN }}

@ -1,4 +0,0 @@
timeout 0
tcp-keepalive 0
databases 1
save 60 100000

@ -16,7 +16,6 @@ export const mainnetRpcUrl = process.env.MAINNET_RPC_URL || process.env.ORACLE_R
export const oracleRpcUrl = process.env.ORACLE_RPC_URL || 'https://mainnet.infura.io/'; export const oracleRpcUrl = process.env.ORACLE_RPC_URL || 'https://mainnet.infura.io/';
export const offchainOracleAddress = '0x07D91f5fb9Bf7798734C3f606dB065549F6893bb'; export const offchainOracleAddress = '0x07D91f5fb9Bf7798734C3f606dB065549F6893bb';
export const multiCallAddress = '0xda3c19c6fe954576707fa24695efb830d9cca1ca'; export const multiCallAddress = '0xda3c19c6fe954576707fa24695efb830d9cca1ca';
export const aggregatorAddress = process.env.AGGREGATOR;
export const privateKey = process.env.PRIVATE_KEY; export const privateKey = process.env.PRIVATE_KEY;
export const instances = tornConfig.instances; export const instances = tornConfig.instances;
export const torn = tornConfig; export const torn = tornConfig;
@ -24,7 +23,6 @@ export const port = Number(process.env.APP_PORT) || 8000;
export const host = isProduction ? 'https://' + process.env.VIRTUAL_HOST : `http://localhost:${port}`; export const host = isProduction ? 'https://' + process.env.VIRTUAL_HOST : `http://localhost:${port}`;
export const tornadoServiceFee = Number(process.env.REGULAR_TORNADO_WITHDRAW_FEE); export const tornadoServiceFee = Number(process.env.REGULAR_TORNADO_WITHDRAW_FEE);
export const rewardAccount = process.env.REWARD_ACCOUNT; export const rewardAccount = process.env.REWARD_ACCOUNT;
export const governanceAddress = '0x5efda50f22d34F262c29268506C5Fa42cB56A1Ce';
export const tornadoGoerliProxy = '0x454d870a72e29d5E5697f635128D18077BD04C60'; export const tornadoGoerliProxy = '0x454d870a72e29d5E5697f635128D18077BD04C60';
export const ovmGasPriceOracleContract = '0x420000000000000000000000000000000000000F'; export const ovmGasPriceOracleContract = '0x420000000000000000000000000000000000000F';
export const txJobAttempts = 3; export const txJobAttempts = 3;
@ -34,11 +32,8 @@ export const gasLimits = {
[RelayerJobType.OP_TORNADO_WITHDRAW]: 440000, [RelayerJobType.OP_TORNADO_WITHDRAW]: 440000,
[RelayerJobType.ARB_TORNADO_WITHDRAW]: 1900000, [RelayerJobType.ARB_TORNADO_WITHDRAW]: 1900000,
}; };
// export const minimumBalance = '1000000000000000000'; export const minimumBalance = '1000000000000000000';
// export const minimumTornBalance = '30000000000000000000'; export const minimumTornBalance = '30000000000000000000';
// TODO: remove this
export const minimumBalance = '10000000000000000';
export const minimumTornBalance = '0';
export const baseFeeReserve = Number(process.env.BASE_FEE_RESERVE_PERCENTAGE); export const baseFeeReserve = Number(process.env.BASE_FEE_RESERVE_PERCENTAGE);
export const tornToken = { export const tornToken = {
tokenAddress: '0x77777FeDdddFfC19Ff86DB637967013e6C6A116C', tokenAddress: '0x77777FeDdddFfC19Ff86DB637967013e6C6A116C',

@ -1,12 +0,0 @@
import 'reflect-metadata';
import { configService, getHealthService } from './services';
(async () => {
try {
await configService.init();
const healthService = getHealthService();
console.log(healthService);
} catch (e) {
console.error('Top level catch', e);
}
})();

@ -139,8 +139,6 @@ export class ConfigService {
) )
.filter(Boolean); .filter(Boolean);
} }
// TODO get instances from registry
console.log( console.log(
'Configuration completed\n', 'Configuration completed\n',
`-- netId: ${this.netId}\n`, `-- netId: ${this.netId}\n`,

@ -152,7 +152,6 @@ export class TxService {
const { currency, amount, decimals } = instance; const { currency, amount, decimals } = instance;
const [fee, refund] = [args[4], args[5]].map(BigNumber.from); const [fee, refund] = [args[4], args[5]].map(BigNumber.from);
const gasPrice = await this.getGasPrice(); const gasPrice = await this.getGasPrice();
// TODO check refund value
let gasLimit = this.gasLimit; let gasLimit = this.gasLimit;
if (!this.config.isLightMode) { if (!this.config.isLightMode) {
gasLimit = gasLimits[RelayerJobType.TORNADO_WITHDRAW]; gasLimit = gasLimits[RelayerJobType.TORNADO_WITHDRAW];