Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue when using REST interface on local beacon chain node when using publicKey argument #5651

Closed
mragicl opened this issue Apr 27, 2020 · 3 comments
Assignees

Comments

@mragicl
Copy link

mragicl commented Apr 27, 2020

🐞 Bug Report

Description

When I request from the REST API using a publicKey as parameter, the API does not respond correctly. Using index as parameter works.

🔬 Minimal Reproduction

I run a local beacon node using the binaries provided with the prysm.sh script:

./prysm.sh beacon-chain --p2p-host-ip=$(curl -s ident.me) --min-sync-peers 7 --grpc-gateway-port 4001

Using the REST API on this local client does not work correctly when using a publicKey as parameter:

curl -X GET "http://127.0.0.1:4001/eth/v1alpha1/validator?publicKey=rF+aqQoQ/yo+XzDvJtj13PM21pRBpRGbgrHV+WXs9qaI9R2cWkShaCZspl6dt9eu" -H "accept: application/json"

it yields the error:

{"error":"Need to specify either validator index or public key in request","code":3,"message":"Need to specify either validator index or public key in request","details":[]}

running the same request on the public api provided by prylabs works:

curl -X GET "https://api.prylabs.net/eth/v1alpha1/validator?publicKey=rF+aqQoQ/yo+XzDvJtj13PM21pRBpRGbgrHV+WXs9qaI9R2cWkShaCZspl6dt9eu" -H "accept: application/json"
{
 "publicKey": "rF+aqQoQ/yo+XzDvJtj13PM21pRBpRGbgrHV+WXs9qaI9R2cWkShaCZspl6dt9eu",
 "withdrawalCredentials": "ACTB2D3ARp4zBVwE4/r5rI44lrtwCLFPzjJjdP9nE5g=",
 "effectiveBalance": "32000000000",
 "slashed": false,
 "activationEligibilityEpoch": "0",
 "activationEpoch": "0",
 "exitEpoch": "18446744073709551615",
 "withdrawableEpoch": "18446744073709551615"
}

Also using the index works locally:

curl -X GET "http://127.0.0.1:4001/eth/v1alpha1/validator?index=674" -H "accept: application/json"

{"publicKey":"rF+aqQoQ/yo+XzDvJtj13PM21pRBpRGbgrHV+WXs9qaI9R2cWkShaCZspl6dt9eu","withdrawalCredentials":"ACTB2D3ARp4zBVwE4/r5rI44lrtwCLFPzjJjdP9nE5g=","effectiveBalance":"32000000000","slashed":false,"activationEligibilityEpoch":"0","activationEpoch":"0","exitEpoch":"18446744073709551615","withdrawableEpoch":"18446744073709551615"}

🌍 Your Environment

Operating System:

lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04.4 LTS
Release:	18.04
Codename:	bionic

What version of Prysm are you running? (Which release)

binary, beacon-chain-v1.0.0-alpha.5-linux-amd64

@terencechain terencechain added the Help Wanted Extra attention is needed label Apr 27, 2020
@prestonvanloon prestonvanloon self-assigned this Apr 28, 2020
@prestonvanloon prestonvanloon removed the Help Wanted Extra attention is needed label Apr 28, 2020
@prestonvanloon
Copy link
Member

Looking at this now.

@prestonvanloon
Copy link
Member

@mragicl, I updated a few dependencies and got this to work only when the parameter is URL encoded.

Try http://127.0.0.1:4001/eth/v1alpha1/validator?publicKey=F%2BaqQoQ%2Fyo%2BXzDvJtj13PM21pRBpRGbgrHV%2BWXs9qaI9R2cWkShaCZspl6dt9eu with PR #5657

@rauljordan
Copy link
Contributor

Closing @mragicl , please let us know if this resolves your issue otherwise we can reopen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants