rocket-pool / smartnode

The CLI package for Rocket Pool smart nodes.
GNU General Public License v3.0
145 stars 114 forks source link

Register & Deposit result in "Transaction failed with status 0" #114

Open jclapis opened 3 years ago

jclapis commented 3 years ago

From Discord user pala (https://discord.com/channels/405159462932971535/704214707904446535/824322274143240248):

Registering results in Could not register node: Could not register node: Transaction failed with status 0

But seems to work:

rocketpool node status

The node <...> has a balance of 32.499629 ETH, 0.000000 RPL and 0.000000 nETH.
The node has a balance of 160.000000 old RPL which can be swapped for new RPL.

The node is registered with Rocket Pool with a timezone location of Europe/Dublin.

Trying a deposit after that results in the same issue:

rocketpool node deposit

Please choose an amount of ETH to deposit:
1: 32 ETH (minipool begins staking immediately)
2: 16 ETH (minipool begins staking after ETH is assigned)
1

The current network node commission rate that your minipool should receive is 20.000000%.
The suggested maximum commission rate slippage for your deposit transaction is 1.000000%.
This will result in your minipool receiving a minimum possible commission rate of 19.000000%.
Do you want to use the suggested maximum commission rate slippage? [y/n]
y

Are you sure you want to deposit 32.000000 ETH to create a minipool with a minimum possible commission rate of 19.000000%? Running a minipool is a long-term commitment. [y/n]
y

Could not make node deposit: Could not make node deposit: Transaction failed with status 0

Version info:

rocketpool service version

Rocket Pool client version: 1.0.0-beta.1
Rocket Pool service version: 1.0.0-beta.1
Selected Eth 1.0 client: Custom (rocketpool/smartnode-pow-proxy:v1.0.0-beta.0)
Selected Eth 2.0 client: Lighthouse (sigp/lighthouse:v1.2.1)
easttemp commented 3 years ago

(Discord user pala here)

It might be worth mentioning that I'm trying to use eth2 beacon service from infura by modifying config.yml like this

eth2:
    provider: https://XXX:XXX@eth2-beacon-pyrmont.infura.io

I ran into some troubles because chains/eth2/start-validator.sh script uses a hardcoded http:// in front of the ETH2_PROVIDER env variable, so I had to modify that. On top of the errors already specified, when I try to get the status in the end

rocketpool minipool status

Could not get minipool status: Could not get node sync status: Get "http://https//XXX:XXX@eth2-beacon-pyrmont.infura.io/eth/v1/node/syncing": dial tcp: lookup https: Temporary failure in name resolution

Removing the https:// part in config.yml and restarting the service yields:

Could not get minipool status: Could not get node sync status: HTTP status 401; response body: 'project id required

I'm guessing there's a problem with how that eth2.provider configuration is being used in the code. I'm not sure if it's related to the problems already mentioned by @jclapis or not, but thought it might help.

moles1 commented 3 years ago

I'm not sure if it's related to the problems already mentioned by @jclapis or not, but thought it might help.

There isn't any interaction with the beacon chain when registering a node or making a deposit, so this will be a separate, unrelated issue. I've created one here: https://github.com/rocket-pool/smartnode/issues/115

moles1 commented 3 years ago

The error Transaction failed with status 0 is thrown in the following scenario:

1) The smart node broadcasts a transaction 2) The smart node waits for the transaction to be mined (polls the eth1 client for a tx receipt) 3) The eth1 client returns a receipt for the tx with a status of 0 (meaning the tx failed)

I can't see any code paths in the smartnode which would cause this error to be thrown incorrectly; it appears as though the eth1 client in this case is sending back an incorrect tx receipt. There may not be anything actionable here, but will wait for more info from @easttemp on Discord.

easttemp commented 3 years ago

So probably it is related with #115 as I specified the eth1 node in the same manner: chose custom at configuration and then setting eth1.provider (as per docs) to infura's provider.

moles1 commented 3 years ago

So probably it is related with #115 as I specified the eth1 node in the same manner: chose custom at configuration and then setting eth1.provider (as per docs) to infura's provider.

Yeah, that sounds likely. I would try switching to a different eth1 client (i.e. Geth) and see if the problem persists. If not, then it's likely a bug with Infura (possibly with a specific node? as I have not seen this mentioned by anyone else). Will leave this issue open until you've had time to check it out.

easttemp commented 3 years ago

I don't know if infura is to blame beacause:

$ rocketpool minipool status

Could not get minipool status: Could not get node sync status: Get "http://https//XXX:XXX@eth2-beacon-pyrmont.infura.io/eth/v1/node/syncing": dial tcp: lookup https: Temporary failure in name resolution

To me it looks like the smartnode is not handling a custom eth2/eth1 provider correctly.

parasyte commented 3 years ago

You need to use the websocket endpoint with nimbus. See https://nimbus.guide/infura-guide.html#7-copy-the-websocket-endpoint

:warning: Warning: make sure you've copied the endpoint that starts with wss (websocket), and not the https endpoint. If you're connecting to mainnet this will read wss://mainnet.infura.io/ws/...

I don't know which Eth 2.0 client you are using, but this might be useful.