wealdtech / ethdo

Apache License 2.0
284 stars 101 forks source link

fail to prepare offline #123

Closed garyng2000 closed 6 months ago

garyng2000 commented 11 months ago

./ethdo validator exit --prepare-offline --connection=http://localhost:3501 --timeout 600s

and I get

Error: failed to process: failed to obtain validators: no beacon state

my prysm node is running as I can get the list of validator via simple curl

curl -s http://localhost:3501/eth/v1/beacon/states/head/validators

garyng2000 commented 11 months ago

I tried to clone the source and open it in vscode and it seems that eth2-client package in go changed the interface for all the calls, I don't know if that is the reason. say this call in chainInfo.go

// Obtain validators.
validatorsResponse, err := consensusClient.(consensusclient.ValidatorsProvider).Validators(ctx, &api.ValidatorsOpts{State: "head"})

it now is a 3 value return (*apiResponse, validators, err) instead of 2

garyng2000 commented 11 months ago

I downloaded 1.29 and it works so something has changed starting 1.30

mcdee commented 11 months ago

What happens if you run

curl -s http://localhost:3501/eth/v2/debug/beacon/states/head
garyng2000 commented 11 months ago

404 so need to enable prysm support for v2 ? not sure if they have that

garyng2000 commented 11 months ago

I am looking at this,

https://ethereum.github.io/beacon-APIs/#/Beacon

where is that /eth/v2 defined ?

mcdee commented 11 months ago

The relevant endpoint is https://ethereum.github.io/beacon-APIs/#/Debug/getStateV2 please could you raise an issue with prysm for them to support it?

Alternatively, you may need to add a flag to the beacon node to enable this as it is a debug endpoint.

garyng2000 commented 11 months ago

I would try. Though I have created a free account on quicknode which provide beacon api support and it seems they also only support the official 'v1' version only

ank-everstake commented 10 months ago

Same here, It would be helpful to have a flag --use-api= v1 | v2 or similar.

mcdee commented 10 months ago

The V2 version of the endpoint has been in the beacon API spec for over 2 years, and the V1 version deprecated for the same amount of time. It isn't practical to continue to support older versions, especially as each endpoint is individually versioned and commonly return different information for different versions.

YuXiaoCoder commented 9 months ago

Can you tell me how to fix this, I'm having the same problem!

mcdee commented 9 months ago

Can you tell me how to fix this, I'm having the same problem!

Use a beacon node that supports the standard endpoint. Lighthouse, nimbus and Teku all provide support.

YuXiaoCoder commented 9 months ago

Can you tell me how to fix this, I'm having the same problem!

Use a beacon node that supports the standard endpoint. Lighthouse, nimbus and Teku all provide support.

We're using Prysm as a validator now, and the dependencies are heavy and not easy to replace, I've rolled back ethdo to 1.29.2 for now, so I'll just have to follow up with the prysm team to see if they can fix it!

mcdee commented 6 months ago

This can be fixed by adding --enable-debug-rpc-endpoints to the prysm startup parameters.