Skip to content

Commit

Permalink
remove removed getDebugChainHeadsV1; fix API links in documentations (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
tersec authored Jun 15, 2023
1 parent 411d809 commit 939b300
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 56 deletions.
7 changes: 5 additions & 2 deletions beacon_chain/rpc/rest_constants.nim
Original file line number Diff line number Diff line change
Expand Up @@ -211,11 +211,14 @@ const
"LC optimistic update unavailable"
DeprecatedRemovalBeaconBlocksDebugStateV1* =
"v1/beacon/blocks/{block_id} and v1/debug/beacon/states/{state_id} " &
"endpoints were deprecated and replaced by v2, see " &
"endpoints were deprecated and replaced by v2: " &
"https://github.com/ethereum/beacon-APIs/pull/218"
DeprecatedRemovalValidatorBlocksV1* =
"v1/validator/blocks/{slot} endpoint was deprecated and replaced by v2, see " &
"v1/validator/blocks/{slot} endpoint was deprecated and replaced by v2: " &
"https://github.com/ethereum/beacon-APIs/pull/220"
DeprecatedRemovalGetDebugChainHeadsV1* =
"v1/debug/beacon/heads endpoint was deprecated and replaced by v2: " &
"https://github.com/ethereum/beacon-APIs/pull/319"
BlockIncorrectFork* =
"Block has incorrect fork"
ValidatorNotActive* =
Expand Down
5 changes: 2 additions & 3 deletions beacon_chain/rpc/rest_debug_api.nim
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ proc installDebugApiHandlers*(router: var RestRouter, node: BeaconNode) =
# https://ethereum.github.io/beacon-APIs/#/Debug/getDebugChainHeads
router.api(MethodGet,
"/eth/v1/debug/beacon/heads") do () -> RestApiResponse:
return RestApiResponse.jsonResponse(
node.dag.heads.mapIt((root: it.root, slot: it.slot))
)
return RestApiResponse.jsonError(
Http410, DeprecatedRemovalGetDebugChainHeadsV1)

# https://ethereum.github.io/beacon-APIs/#/Debug/getDebugChainHeadsV2
router.api(MethodGet,
Expand Down
5 changes: 0 additions & 5 deletions beacon_chain/spec/eth2_apis/rest_debug_calls.nim
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ import

export chronos, client, rest_types, eth2_rest_serialization

proc getDebugChainHeads*(): RestResponse[GetDebugChainHeadsResponse] {.
rest, endpoint: "/eth/v1/debug/beacon/heads",
meth: MethodGet.}
## https://ethereum.github.io/beacon-APIs/#/Beacon/getDebugChainHeads

proc getStateV2Plain*(state_id: StateIdent): RestPlainResponse {.
rest, endpoint: "/eth/v2/debug/beacon/states/{state_id}",
accept: preferSSZ,
Expand Down
2 changes: 1 addition & 1 deletion beacon_chain/spec/eth2_apis/rest_types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# at your option. This file may not be copied, modified, or distributed except according to those terms.

# Types used by both client and server in the common REST API:
# https://ethereum.github.io/eth2.0-APIs/#/
# https://ethereum.github.io/beacon-APIs/
# Be mindful that changing these changes the serialization and deserialization
# in the API which may lead to incompatibilities between clients - tread
# carefully!
Expand Down
Loading

0 comments on commit 939b300

Please sign in to comment.