nimbus-eth2
nimbus-eth2 copied to clipboard
`prepare_beacon_proposer` not spec-compliant
Describe the bug
The prepare_beacon_proposer
REST API appears to take only a single proposer object, whereas the spec states that it should take an array of objects.
To Reproduce
$ curl -w %{http_code} -H 'content-type:application/json' --data '{"validator_index":"1","fee_recipient":"0x5a454afa7e7d9b4d914067715c3b16cf3e3c899d"}' http://localhost:5052/eth/v1/validator/prepare_beacon_proposer
200
$ curl -s -H 'content-type:application/json' --data '[{"validator_index":"1","fee_recipient":"0x5a454afa7e7d9b4d914067715c3b16cf3e3c899d"}]' http://localhost:5052/eth/v1/validator/prepare_beacon_proposer
{"code":"400","message":"Unable to decode prepare beacon proposer request","stacktraces":[]}
Additional context
$ nimbus_beacon_node --version
Nimbus beacon node v22.7.0-75ccfc-stateofus
Copyright (c) 2019-2022 Status Research & Development GmbH
eth2 specification v1.2.0-rc.1
Nim Compiler Version 1.2.16 [Linux: amd64]
same happens for me, but I also use Vouch 😆 leaving this comment here to be subscribed to updates
This missing feature has been implemented in https://github.com/status-im/nimbus-eth2/pull/3901 and shipped in Nimbus 22.7.0.
hmm, I can attach logs from 22.7.0 that errors out on that...
alloc_logs_nimbus.stdout.0.txt
INF 2022-07-28 12:30:38.569+00:00 Launching beacon node topics="beacnde" version=v22.7.0-75ccfc-stateofus
DBG 2022-07-28 12:30:53.252+00:00 Failed to deserialize REST JSON data topics="rest_validatorapi" err="<data>(1, 0) Unexpected token 'tkBracketLe' in place of 'object start bracket'" data="[{\"validator_index\":\"30894\",\"fee_recipient\":
...
unfortunately it doesn't log which exact call caused it, but looking at the payload it looks very-very similar to what @mcdee shared
I think this LoC doesn't expect a list of validators, just a single one: https://github.com/status-im/nimbus-eth2/commit/cd04f27c37555d891f0d4eb5a45467cb2ced922d#diff-c6c7c4acd323803baf59aed256dc1188bb6697291cb1425f05314ff7e0668e66R771
I'm sorry. I've had confused this issue for an older one. I've just realized that @mcdee has filed it 15 hours ago against the just published version.
@zah is there any Docker image with your fix already? I can try to test and verify it works with Vouch