kowala-tech/kcoin

Validator doesn't automatically join the validation network

Opened this issue · 5 comments

I'm running a validator with enough funds and mtokens to join the network with --validate and a --deposit bigger than the min deposit.

When the node finds the network and syncs, I'm expecting it to start validating right away but it doesn't:

> validator.isRunning()
false
> validator.isValidating()
false

The logs show this error:

WARN [09-28|07:50:58.994] Joining the network 2 with a deposit 1000000000000000000000000. Account "0xa0B5CD08648cF5D29269356377Ac06C538D7de96" 
DEBUG[09-28|07:50:58.994] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.994] Executing EVM call finished              runtime=382.332µs
DEBUG[09-28|07:50:58.995] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.995] Executing EVM call finished              runtime=346.036µs
DEBUG[09-28|07:50:58.995] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.995] Executing EVM call finished              runtime=356.868µs
DEBUG[09-28|07:50:58.995] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.995] Executing EVM call finished              runtime=390.935µs
DEBUG[09-28|07:50:58.996] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.996] Executing EVM call finished              runtime=345.942µs
DEBUG[09-28|07:50:58.996] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.996] Executing EVM call finished              runtime=334.804µs
DEBUG[09-28|07:50:58.996] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.997] Executing EVM call finished              runtime=345.631µs
DEBUG[09-28|07:50:58.997] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.997] Executing EVM call finished              runtime=432.581µs
DEBUG[09-28|07:50:58.997] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.997] Executing EVM call finished              runtime=405.472µs
DEBUG[09-28|07:50:58.998] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.998] Executing EVM call finished              runtime=332.254µs
DEBUG[09-28|07:50:58.998] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.998] Executing EVM call finished              runtime=371.488µs
DEBUG[09-28|07:50:58.998] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.998] Executing EVM call finished              runtime=335.342µs
DEBUG[09-28|07:50:58.999] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.999] Executing EVM call finished              runtime=524.812µs
DEBUG[09-28|07:50:58.999] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:58.999] Executing EVM call finished              runtime=353.544µs
DEBUG[09-28|07:50:59.000] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.000] Executing EVM call finished              runtime=375.095µs
DEBUG[09-28|07:50:59.000] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.000] Executing EVM call finished              runtime=434.034µs
DEBUG[09-28|07:50:59.001] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.001] Executing EVM call finished              runtime=399.367µs
DEBUG[09-28|07:50:59.001] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.001] Executing EVM call finished              runtime=406.77µs
DEBUG[09-28|07:50:59.001] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.001] Executing EVM call finished              runtime=366.489µs
DEBUG[09-28|07:50:59.002] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.002] Executing EVM call finished              runtime=418.903µs
DEBUG[09-28|07:50:59.002] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.002] Executing EVM call finished              runtime=382.476µs
DEBUG[09-28|07:50:59.003] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.003] Executing EVM call finished              runtime=400.203µs
DEBUG[09-28|07:50:59.003] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.003] Executing EVM call finished              runtime=431.424µs
DEBUG[09-28|07:50:59.003] VM returned with error                   err="evm: execution reverted"
DEBUG[09-28|07:50:59.003] Executing EVM call finished              runtime=375.429µs
ERROR[09-28|07:50:59.004] Error joining validators network         err="failed to transact the deposit: failed to estimate gas needed: gas required exceeds allowance or always failing transaction"

logs.txt
Here the logs, it happened again.

I suspect the validator tries to join too early:

....
WARN [09-28|08:11:58.388] Joining the network 2 with a deposit 1000000000000000000000000. Account "0xa4A06cb7BCaA0162082F170d4B6f4b5360DA9e11"
....
DEBUG[09-28|08:12:03.556] Inserted new block                       number=1    hash=ee8daa…7f82cd txs=1 gas=21000 elapsed=1.185ms
....

It didn't even received the first block when it tried to join...

@acroca It looks pretty similar to #792 (comment) - sync started after join call and EVM error.

The SyncWaiter receives a downloader.DoneEvent even though the eth.blockNumber is 0 and admin.peers is empty.

The DoneEvent is being triggered by what we call forceSync, which sends the event after 10s with no peers