tornadocash/tornado-relayer

Added new relayer

01BTC10 opened this issue · 12 comments

kovan.relaymy.eth
mainnet.relaymy.eth

Thanks!

Your relayer is down. Your relayer is down. Please properly setup your relayer before submitting it here. Also, make withdrawal transactions via your relayer (on both kovan and mainnet) and provide tx hashes in the comment below.

image

I think the issue is that I didn't know that infura could not use the free API and need a registered project ID (maybe should be mentioned in the doc). The container probably maxed out the amount of free request available... I will fix and report back.

mainnet_1      |     at IncomingMessage.emit (events.js:327:22)
mainnet_1      |     at IncomingMessage.emit (events.js:327:22)
mainnet_1      |     at endReadableNT (_stream_readable.js:1220:12)
mainnet_1      |     at processTicksAndRejections (internal/process/task_queues.js:84:21)
mainnet_1      | Problem with RPC Error: Returned error: project ID is required
mainnet_1      |     at XMLHttpRequestEventTarget.dispatchEvent (/app/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
mainnet_1      |     at IncomingMessage.<anonymous> (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
mainnet_1      |     at IncomingMessage.emit (events.js:327:22)
mainnet_1      |     at endReadableNT (_stream_readable.js:1220:12)
mainnet_1      |     at XMLHttpRequest._setReadyState (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
mainnet_1      |     at XMLHttpRequest._onHttpResponseEnd (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
mainnet_1      |     at IncomingMessage.<anonymous> (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
mainnet_1      |     at Object.ErrorResponse (/app/node_modules/web3-core-helpers/src/errors.js:29:16)
mainnet_1      |     at /app/node_modules/web3-core-requestmanager/src/index.js:140:36

@01BTC10 you shouldn't rely on just infura. In order to become a reliable relayer, you should:

  • setup monitoring for your node, so you get alerted every time when your node is not responding
  • have your own geth node + failover to something else(Infura, QuikNode, etc) Infura shouldn't be your primary way to process requests
  • making sure the node works as expected. At least you could have tried using your own relayer once, at least on testnet(kovan)
  • following updates for this github repository
  • monitor tornadocash telegram group for questions/updates/ regarding your node.

If you don't know how to do any of these, ask existing relayers so they can help you out. (Try telegram group for help)

@01BTC10 you shouldn't rely on just infura. In order to become a reliable relayer, you should:

  • setup monitoring for your node, so you get alerted every time when your node is not responding
  • have your own geth node + failover to something else(Infura, QuikNode, etc) Infura shouldn't be your primary way to process requests
  • making sure the node works as expected. At least you could have tried using your own relayer once, at least on testnet(kovan)
  • following updates for this github repository
  • monitor tornadocash telegram group for questions/updates/ regarding your node.

If you don't know how to do any of these, ask existing relayers so they can help you out. (Try telegram group for help)

I was monitoring my server but it never went down. How to monitor that the service is working as expected?

I have my own geth node but not sure how to set fallback in the config. Can I simply add more endpoint on the same line?

I'm following this repository but missed the reply to this ticket for some reason.

I see a lot of telegram question remaining unanswered or getting very slow answer. I think it's better on github.

The relayer is working for kovan: https://kovan.etherscan.io/tx/0xb59ccbbf6bbbdaf6dc1e95461f11c38820f1fcc1f7171ed844b19c91a0644dda

But it doesn't work on mainnet. I tried another relayer and it worked. I'm thinking maybe the fee are too low? Please let me know if you need more information to debug this problem.

mainnet_1      | Error: Returned error: gas required exceeds allowance (12444965) or always failing transaction
mainnet_1      |     at Object.ErrorResponse (/app/node_modules/web3-core-helpers/src/errors.js:29:16)
mainnet_1      |     at /app/node_modules/web3-core-requestmanager/src/index.js:140:36
mainnet_1      |     at XMLHttpRequest.request.onreadystatechange (/app/node_modules/web3-providers-http/src/index.js:102:13)
mainnet_1      |     at XMLHttpRequestEventTarget.dispatchEvent (/app/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
mainnet_1      |     at XMLHttpRequest._setReadyState (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
mainnet_1      |     at XMLHttpRequest._onHttpResponseEnd (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
mainnet_1      |     at IncomingMessage.<anonymous> (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
mainnet_1      |     at IncomingMessage.emit (events.js:327:22)
mainnet_1      |     at endReadableNT (_stream_readable.js:1220:12)
mainnet_1      |     at processTicksAndRejections (internal/process/task_queues.js:84:21) estimate gas failed

I was monitoring my server but it never went down. How to monitor that the service is working as expected?

Apart from regular manual checks (through test withdrawals, log inspection, ...) you can somewhat automate the monitoring of your Tornado relayer and your Ethereum node through e.g. an independent server. This doesn't need to be some special one, a Raspberrry Pi would be sufficient.
Just as an example these are ports your relayer uses:
- Port 80 and 443 to serve the status frontend
- Port 8000 [default - changeable e.g. here] to serve the backend.

The Raspberry Pi would now in regular intervals ping/check the ports and get an overview if your relayer could respond to requests. If it detects unresponsive or irregular answers you could connfigure it to automatically send an email with a status report.

To verify whether your Ethereum node is working properly you can do something similar and check 1) the responsiveness of your node and 2) compare e.g. the latest blocknumber your node is reporting with various other sources (e.g. etherscan, infura) to check if it is up to date.

There are probably more ideas or setups doing something similar or more advanced, but this is simple and should work quite well.

I have my own geth node but not sure how to set fallback in the config. Can I simply add more endpoint on the same line?

Don't really have an answer for that. It seems to be possible to specify multiple nodes for different protocols in the upcoming "mining" version of the relayer software.

I'm following this repository but missed the reply to this ticket for some reason.

You should be able to subscribe to issues individually. There should be a button (desktop version of github) for this on the right below "Notifications".

But it doesn't work on mainnet. I tried another relayer and it worked. I'm thinking maybe the fee are too low? Please let me know if you need more information to debug this problem.

mainnet_1      | Error: Returned error: gas required exceeds allowance (12444965) or always failing transaction
mainnet_1      |     at Object.ErrorResponse (/app/node_modules/web3-core-helpers/src/errors.js:29:16)
mainnet_1      |     at /app/node_modules/web3-core-requestmanager/src/index.js:140:36
mainnet_1      |     at XMLHttpRequest.request.onreadystatechange (/app/node_modules/web3-providers-http/src/index.js:102:13)
mainnet_1      |     at XMLHttpRequestEventTarget.dispatchEvent (/app/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
mainnet_1      |     at XMLHttpRequest._setReadyState (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
mainnet_1      |     at XMLHttpRequest._onHttpResponseEnd (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
mainnet_1      |     at IncomingMessage.<anonymous> (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
mainnet_1      |     at IncomingMessage.emit (events.js:327:22)
mainnet_1      |     at endReadableNT (_stream_readable.js:1220:12)
mainnet_1      |     at processTicksAndRejections (internal/process/task_queues.js:84:21) estimate gas failed

There is something wrong with the construction of the withdrawal transaction.
Is your geth node completely synced? Do you run multiple instances (one for Kovan, one for mainnet)?

Something else I noticed: your node is very slow to respond, apparently so slow that I get timeouts in the UI.

It would be nice if you could post parts of your configuration of the relayer (make sure you REDACT/REMOVE INFORMATION ABOUT your private key(s) and other information you want to keep secret), especially interesting for us would be the way you set the RPC_URL's and ORACLE_RPC_URL's (be sure to replace/redact/remove your project ID if you use Infura).

EDIT:
While this shouldn't be a problem (Kovan got a different Chain_ID and Network_ID), it is good practice to use different private keys (and therefore addresses) across different networks to prevent replay attacks.

Here is my configuration. Note that I'm not using my own geth node yet to make debugging easier but I have one available for mainnet if config would allow more than one option. I will try changing fee and also the private key for the test network. The relayer is in singapore... Not sure if it explains high latency but I'm in SE Asia and my latency to the server is 30ms. It doesn't look slow or timeout when I use the cli and watch the log in real time. Maybe I can post the full withdraw log since it doesn't seems to include sensitive information? Thanks for your help!

edit: Increased fee, changed privatekey for kovan, rebuilt all containers and still have the same issue.

`version: '2'

services:
kovan:
image: tornadocash/relayer
restart: always
environment:
VIRTUAL_HOST: kovan.relaymy.xyz
LETSENCRYPT_HOST: kovan.relaymy.xyz
NET_ID: 42
RPC_URL: https://kovan.infura.io/v3/[REDACTED]
# ORACLE_RPC_URL should always point to the mainnet
ORACLE_RPC_URL: https://mainnet.infura.io/v3/[REDACTED]
# without 0x prefix
PRIVATE_KEY: [REDACTED SAME AS MAINNET]
# 2.5 means 2.5%
RELAYER_FEE: 0.045
REDIS_URL: redis://redis/0
nginx_proxy_read_timeout: 600
depends_on:
- redis

mainnet:
image: tornadocash/relayer
restart: always
environment:
VIRTUAL_HOST: mainnet.relaymy.xyz
LETSENCRYPT_HOST: mainnet.relaymy.xyz
NET_ID: 1
RPC_URL: https://mainnet.infura.io/v3/[REDACTED]
# ORACLE_RPC_URL should always point to the mainnet
ORACLE_RPC_URL: https://mainnet.infura.io/v3/[REDACTED]
# without 0x prefix
PRIVATE_KEY: [REDACTED SAME AS KOVAN]
# 2.5 means 2.5%
RELAYER_FEE: 0.045
REDIS_URL: redis://redis/1
nginx_proxy_read_timeout: 600
depends_on:
- redis

redis:
image: redis
restart: always
command: [redis-server, --appendonly, 'yes']
volumes:
- redis:/data

nginx:
image: nginx:alpine
container_name: nginx
restart: always
ports:
- 80:80
- 443:443
volumes:
- conf:/etc/nginx/conf.d
- vhost:/etc/nginx/vhost.d
- html:/usr/share/nginx/html
- certs:/etc/nginx/certs
logging:
driver: none

dockergen:
image: poma/docker-gen
container_name: dockergen
restart: always
command: -notify-sighup nginx -watch /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf
volumes_from:
- nginx
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro

letsencrypt:
image: jrcs/letsencrypt-nginx-proxy-companion
container_name: letsencrypt
restart: always
environment:
NGINX_DOCKER_GEN_CONTAINER: dockergen
volumes_from:
- nginx
- dockergen

volumes:
conf:
vhost:
html:
certs:
redis:
`

remove

image

make it like on Kovan
image

when done, plz send a proof that your relayer works on mainnet

I fixed the text record: https://app.ens.domains/name/mainnet.relaymy.eth/details

Restarted the containers and still have the same issue. I tried kovan again and it is working. The mainnet account has 0.46 ETH. Does it needs a higher balance?

mainnet_1      | fee, refund 10500000000000000 0 [REDACTED ADDRESS]
mainnet_1      | 1603589364523  withdraw started 10
mainnet_1      | [REDACTED JSON]
mainnet_1      | Error: Returned error: gas required exceeds allowance (12512179) or always failing transaction
mainnet_1      |     at Object.ErrorResponse (/app/node_modules/web3-core-helpers/src/errors.js:29:16)
mainnet_1      |     at /app/node_modules/web3-core-requestmanager/src/index.js:140:36
mainnet_1      |     at XMLHttpRequest.request.onreadystatechange (/app/node_modules/web3-providers-http/src/index.js:102:13)
mainnet_1      |     at XMLHttpRequestEventTarget.dispatchEvent (/app/node_modules/xhr2-cookies/dist/xml-http-request-event-target.js:34:22)
mainnet_1      |     at XMLHttpRequest._setReadyState (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:208:14)
mainnet_1      |     at XMLHttpRequest._onHttpResponseEnd (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:318:14)
mainnet_1      |     at IncomingMessage.<anonymous> (/app/node_modules/xhr2-cookies/dist/xml-http-request.js:289:61)
mainnet_1      |     at IncomingMessage.emit (events.js:327:22)
mainnet_1      |     at endReadableNT (_stream_readable.js:1220:12)
mainnet_1      |     at processTicksAndRejections (internal/process/task_queues.js:84:21) estimate gas failed

@01BTC10 your relayer is working properly. when you enter in Custom Node, make sure you type mainnet.relaymy.eth
Also, what is your telegram name?

Congrats, you have been added to the UI list. Please check your telegram

I just noticed that the relay does work via the web UI but all that time I was trying to use the terminal utility without success. That's probably another issue so I will close now. Thank you!

hell can u tell.if i follow the introduction, i can import my etherium. how about btc