From d30544f790ec055da0c71d32e7e544418f26fce8 Mon Sep 17 00:00:00 2001 From: tersec Date: Tue, 24 Jan 2023 22:25:51 +0100 Subject: [PATCH] disallow filling BLS to execution change pool pre-capella (#4547) * disallow filling BLS to execution change pool pre-capella * use better BLS change epoch --- beacon_chain/rpc/rest_beacon_api.nim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/beacon_chain/rpc/rest_beacon_api.nim b/beacon_chain/rpc/rest_beacon_api.nim index 163fd3902..56aa8616e 100644 --- a/beacon_chain/rpc/rest_beacon_api.nim +++ b/beacon_chain/rpc/rest_beacon_api.nim @@ -1125,6 +1125,10 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) = # https://github.com/ethereum/beacon-APIs/blob/86850001845df9163da5ae9605dbf15cd318d5d0/apis/beacon/pool/bls_to_execution_changes.yaml router.api(MethodPost, "/eth/v1/beacon/pool/bls_to_execution_changes") do ( contentBody: Option[ContentBody]) -> RestApiResponse: + if node.currentSlot().epoch() < node.dag.cfg.CAPELLA_FORK_EPOCH: + return RestApiResponse.jsonError(Http400, + InvalidBlsToExecutionChangeObjectError, + "Attempt to add to BLS to execution change pool pre-Capella") let bls_to_execution_changes = block: if contentBody.isNone():