mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-23 11:48:33 +00:00
parent
dc50abbc90
commit
06a5c67e62
@ -764,21 +764,22 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
|||||||
"/eth/v1/validator/prepare_beacon_proposer") do (
|
"/eth/v1/validator/prepare_beacon_proposer") do (
|
||||||
contentBody: Option[ContentBody]) -> RestApiResponse:
|
contentBody: Option[ContentBody]) -> RestApiResponse:
|
||||||
let
|
let
|
||||||
proposerData =
|
body =
|
||||||
block:
|
block:
|
||||||
if contentBody.isNone():
|
if contentBody.isNone():
|
||||||
return RestApiResponse.jsonError(Http400, EmptyRequestBodyError)
|
return RestApiResponse.jsonError(Http400, EmptyRequestBodyError)
|
||||||
let dres = decodeBody(PrepareBeaconProposerBody, contentBody.get())
|
let dres = decodeBody(seq[PrepareBeaconProposer], contentBody.get())
|
||||||
if dres.isErr():
|
if dres.isErr():
|
||||||
return RestApiResponse.jsonError(Http400,
|
return RestApiResponse.jsonError(Http400,
|
||||||
InvalidPrepareBeaconProposerError)
|
InvalidPrepareBeaconProposerError)
|
||||||
dres.get()
|
dres.get()
|
||||||
currentEpoch = node.beaconClock.now.slotOrZero.epoch
|
currentEpoch = node.beaconClock.now.slotOrZero.epoch
|
||||||
|
|
||||||
node.dynamicFeeRecipientsStore.addMapping(
|
for proposerData in body:
|
||||||
proposerData.validator_index,
|
node.dynamicFeeRecipientsStore.addMapping(
|
||||||
proposerData.fee_recipient,
|
proposerData.validator_index,
|
||||||
currentEpoch)
|
proposerData.fee_recipient,
|
||||||
|
currentEpoch)
|
||||||
|
|
||||||
return RestApiResponse.response("", Http200, "text/plain")
|
return RestApiResponse.response("", Http200, "text/plain")
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ type
|
|||||||
ImportDistributedKeystoresBody |
|
ImportDistributedKeystoresBody |
|
||||||
ImportRemoteKeystoresBody |
|
ImportRemoteKeystoresBody |
|
||||||
KeystoresAndSlashingProtection |
|
KeystoresAndSlashingProtection |
|
||||||
PrepareBeaconProposerBody |
|
PrepareBeaconProposer |
|
||||||
ProposerSlashing |
|
ProposerSlashing |
|
||||||
SetFeeRecipientRequest |
|
SetFeeRecipientRequest |
|
||||||
SignedBlindedBeaconBlock |
|
SignedBlindedBeaconBlock |
|
||||||
@ -105,6 +105,7 @@ type
|
|||||||
|
|
||||||
EncodeArrays* =
|
EncodeArrays* =
|
||||||
seq[Attestation] |
|
seq[Attestation] |
|
||||||
|
seq[PrepareBeaconProposer] |
|
||||||
seq[RemoteKeystoreInfo] |
|
seq[RemoteKeystoreInfo] |
|
||||||
seq[RestCommitteeSubscription] |
|
seq[RestCommitteeSubscription] |
|
||||||
seq[RestSignedContributionAndProof] |
|
seq[RestSignedContributionAndProof] |
|
||||||
@ -128,7 +129,7 @@ type
|
|||||||
KeymanagerGenericError |
|
KeymanagerGenericError |
|
||||||
KeystoresAndSlashingProtection |
|
KeystoresAndSlashingProtection |
|
||||||
ListFeeRecipientResponse |
|
ListFeeRecipientResponse |
|
||||||
PrepareBeaconProposerBody |
|
PrepareBeaconProposer |
|
||||||
ProduceBlockResponseV2 |
|
ProduceBlockResponseV2 |
|
||||||
RestDutyError |
|
RestDutyError |
|
||||||
RestGenericError |
|
RestGenericError |
|
||||||
|
@ -242,7 +242,7 @@ type
|
|||||||
epoch*: Epoch
|
epoch*: Epoch
|
||||||
active*: bool
|
active*: bool
|
||||||
|
|
||||||
PrepareBeaconProposerBody* = object
|
PrepareBeaconProposer* = object
|
||||||
validator_index*: ValidatorIndex
|
validator_index*: ValidatorIndex
|
||||||
fee_recipient*: Eth1Address
|
fee_recipient*: Eth1Address
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ proc publishContributionAndProofs*(body: seq[RestSignedContributionAndProof]): R
|
|||||||
meth: MethodPost.}
|
meth: MethodPost.}
|
||||||
## https://ethereum.github.io/beacon-APIs/#/Validator/publishContributionAndProofs
|
## https://ethereum.github.io/beacon-APIs/#/Validator/publishContributionAndProofs
|
||||||
|
|
||||||
proc prepareBeaconProposer*(body: PrepareBeaconProposerBody): RestPlainResponse {.
|
proc prepareBeaconProposer*(body: seq[PrepareBeaconProposer]): RestPlainResponse {.
|
||||||
rest, endpoint: "/eth/v1/validator/prepare_beacon_proposer",
|
rest, endpoint: "/eth/v1/validator/prepare_beacon_proposer",
|
||||||
meth: MethodPost.}
|
meth: MethodPost.}
|
||||||
## https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/prepareBeaconProposer
|
## https://ethereum.github.io/beacon-APIs/#/ValidatorRequiredApi/prepareBeaconProposer
|
||||||
|
Loading…
x
Reference in New Issue
Block a user