From b417dd1986e90320c6df0c3fd3fa7636caca5bd8 Mon Sep 17 00:00:00 2001 From: tersec Date: Fri, 14 Feb 2025 01:10:47 +0000 Subject: [PATCH] rm engine_exchangeTransitionConfigurationV1 support (#3067) --- execution_chain/beacon/api_handler.nim | 4 +- .../beacon/api_handler/api_exchangeconf.nim | 71 ------------------- execution_chain/rpc/engine_api.nim | 7 +- 3 files changed, 2 insertions(+), 80 deletions(-) delete mode 100644 execution_chain/beacon/api_handler/api_exchangeconf.nim diff --git a/execution_chain/beacon/api_handler.nim b/execution_chain/beacon/api_handler.nim index 861a15a61..ffff6a726 100644 --- a/execution_chain/beacon/api_handler.nim +++ b/execution_chain/beacon/api_handler.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2023-2024 Status Research & Development GmbH +# Copyright (c) 2023-2025 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) # * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -11,7 +11,6 @@ import ./api_handler/api_utils, ./api_handler/api_getpayload, ./api_handler/api_getbodies, - ./api_handler/api_exchangeconf, ./api_handler/api_newpayload, ./api_handler/api_forkchoice @@ -26,6 +25,5 @@ export getPayloadV4, getPayloadBodiesByHash, getPayloadBodiesByRange, - exchangeConf, newPayload, forkchoiceUpdated diff --git a/execution_chain/beacon/api_handler/api_exchangeconf.nim b/execution_chain/beacon/api_handler/api_exchangeconf.nim deleted file mode 100644 index a179db778..000000000 --- a/execution_chain/beacon/api_handler/api_exchangeconf.nim +++ /dev/null @@ -1,71 +0,0 @@ -# Nimbus -# Copyright (c) 2023-2025 Status Research & Development GmbH -# Licensed under either of -# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) -# * MIT license ([LICENSE-MIT](LICENSE-MIT)) -# at your option. -# This file may not be copied, modified, or distributed except according to -# those terms. - -import - std/[strutils], - eth/common/[base, headers, hashes], - ../beacon_engine, - web3/execution_types, - chronicles - -{.push gcsafe, raises:[CatchableError].} - -proc exchangeConf*(ben: BeaconEngineRef, - conf: TransitionConfigurationV1): - TransitionConfigurationV1 = - trace "Engine API request received", - meth = "exchangeTransitionConfigurationV1", - ttd = conf.terminalTotalDifficulty, - number = uint64(conf.terminalBlockNumber), - blockHash = conf.terminalBlockHash - - let - com = ben.com - db = com.db - ttd = com.ttd - - if ttd.isNone: - raise newException(ValueError, "invalid ttd: EL (none) CL ($1)" % [ - $conf.terminalTotalDifficulty]) - - if conf.terminalTotalDifficulty != ttd.get: - raise newException(ValueError, "invalid ttd: EL ($1) CL ($2)" % [ - $ttd.get, $conf.terminalTotalDifficulty]) - - let - terminalBlockNumber = base.BlockNumber conf.terminalBlockNumber - terminalBlockHash = conf.terminalBlockHash - - if terminalBlockHash != default(Hash32): - let headerHash = db.baseTxFrame().getBlockHash(terminalBlockNumber).valueOr: - raise newException(ValueError, "cannot get terminal block hash, number $1, msg: $2" % - [$terminalBlockNumber, error]) - - if terminalBlockHash != headerHash: - raise newException(ValueError, "invalid terminal block hash, got $1 want $2" % - [$terminalBlockHash, $headerHash]) - - let header = db.baseTxFrame().getBlockHeader(headerHash).valueOr: - raise newException(ValueError, "cannot get terminal block header, hash $1, msg: $2" % - [$terminalBlockHash, error]) - - return TransitionConfigurationV1( - terminalTotalDifficulty: ttd.get, - terminalBlockHash : headerHash, - terminalBlockNumber : Quantity(header.number) - ) - - if terminalBlockNumber != 0'u64: - raise newException(ValueError, "invalid terminal block number: $1" % [ - $terminalBlockNumber]) - - if terminalBlockHash != default(Hash32): - raise newException(ValueError, "invalid terminal block hash, no terminal header set") - - TransitionConfigurationV1(terminalTotalDifficulty: ttd.get) diff --git a/execution_chain/rpc/engine_api.nim b/execution_chain/rpc/engine_api.nim index 628dd4cc5..141a7aa20 100644 --- a/execution_chain/rpc/engine_api.nim +++ b/execution_chain/rpc/engine_api.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2021-2024 Status Research & Development GmbH +# Copyright (c) 2021-2025 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE)) # * MIT license ([LICENSE-MIT](LICENSE-MIT)) @@ -29,7 +29,6 @@ const supportedMethods: HashSet[string] = "engine_getPayloadV2", "engine_getPayloadV3", "engine_getPayloadV4", - "engine_exchangeTransitionConfigurationV1", "engine_forkchoiceUpdatedV1", "engine_forkchoiceUpdatedV2", "engine_forkchoiceUpdatedV3", @@ -76,10 +75,6 @@ proc setupEngineAPI*(engine: BeaconEngineRef, server: RpcServer) = server.rpc("engine_getPayloadV4") do(payloadId: Bytes8) -> GetPayloadV4Response: return engine.getPayloadV4(payloadId) - server.rpc("engine_exchangeTransitionConfigurationV1") do( - conf: TransitionConfigurationV1) -> TransitionConfigurationV1: - return engine.exchangeConf(conf) - server.rpc("engine_forkchoiceUpdatedV1") do(update: ForkchoiceStateV1, attrs: Opt[PayloadAttributesV1]) -> ForkchoiceUpdatedResponse: return engine.forkchoiceUpdated(Version.V1, update, attrs.payloadAttributes)