mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-02-26 13:15:16 +00:00
Implement /eth/v1/validator/{beacon,sync}_committee_selections Beacon API end-points (#4760)
This commit is contained in:
parent
eb678be0ff
commit
44b38ef137
@ -226,3 +226,5 @@ const
|
||||
"Invalid BLS to execution change; it won't validate, so it's rejected"
|
||||
BlsToExecutionChangeValidationSuccess* =
|
||||
"BLS to execution change was broadcast"
|
||||
AggregationSelectionNotImplemented* =
|
||||
"Attestation and sync committee aggreggation selection are not implemented"
|
||||
|
@ -993,3 +993,27 @@ proc installValidatorApiHandlers*(router: var RestRouter, node: BeaconNode) =
|
||||
)
|
||||
)
|
||||
return RestApiResponse.jsonResponse(response)
|
||||
|
||||
# https://github.com/ethereum/beacon-APIs/blob/f087fbf2764e657578a6c29bdf0261b36ee8db1e/apis/validator/beacon_committee_selections.yaml
|
||||
router.api(MethodPost, "/eth/v1/validator/beacon_committee_selections") do (
|
||||
contentBody: Option[ContentBody]) -> RestApiResponse:
|
||||
# "Consensus clients need not support this endpoint and may return a 501."
|
||||
# https://github.com/ethereum/beacon-APIs/pull/224: "This endpoint need not
|
||||
# be implemented on the CL side. Once a validator client is aware of it and
|
||||
# able to use it when a feature flag is turned on, the intercepting
|
||||
# middleware can handle and swallow the request. I suggest a CL either
|
||||
# returns 501 Not Implemented [or] 400 Bad Request."
|
||||
return RestApiResponse.jsonError(
|
||||
Http501, AggregationSelectionNotImplemented)
|
||||
|
||||
# https://github.com/ethereum/beacon-APIs/blob/f087fbf2764e657578a6c29bdf0261b36ee8db1e/apis/validator/sync_committee_selections.yaml
|
||||
router.api(MethodPost, "/eth/v1/validator/sync_committee_selections") do (
|
||||
contentBody: Option[ContentBody]) -> RestApiResponse:
|
||||
# "Consensus clients need not support this endpoint and may return a 501."
|
||||
# https://github.com/ethereum/beacon-APIs/pull/224: "This endpoint need not
|
||||
# be implemented on the CL side. Once a validator client is aware of it and
|
||||
# able to use it when a feature flag is turned on, the intercepting
|
||||
# middleware can handle and swallow the request. I suggest a CL either
|
||||
# returns 501 Not Implemented [or] 400 Bad Request."
|
||||
return RestApiResponse.jsonError(
|
||||
Http501, AggregationSelectionNotImplemented)
|
||||
|
@ -3333,6 +3333,32 @@
|
||||
"body": [{"operator": "jstructcmpns", "value": {"code": 400, "message": ""}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": ["validator", "beacon_committee_selections"],
|
||||
"request": {
|
||||
"url": "/eth/v1/validator/beacon_committee_selections",
|
||||
"method": "POST",
|
||||
"headers": {"Accept": "application/json"}
|
||||
},
|
||||
"response": {
|
||||
"status": {"operator": "equals", "value": "501"},
|
||||
"headers": [{"key": "Content-Type", "value": "application/json", "operator": "equals"}],
|
||||
"body": [{"operator": "jstructcmpns", "value": {"code": 501, "message": ""}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": ["validator", "sync_committee_selections"],
|
||||
"request": {
|
||||
"url": "/eth/v1/validator/sync_committee_selections",
|
||||
"method": "POST",
|
||||
"headers": {"Accept": "application/json"}
|
||||
},
|
||||
"response": {
|
||||
"status": {"operator": "equals", "value": "501"},
|
||||
"headers": [{"key": "Content-Type", "value": "application/json", "operator": "equals"}],
|
||||
"body": [{"operator": "jstructcmpns", "value": {"code": 501, "message": ""}}]
|
||||
}
|
||||
},
|
||||
{
|
||||
"topics": ["validator", "register_validators"],
|
||||
"request": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user