From a986a1bcd82c065e7cee7a4fcb0c727879145839 Mon Sep 17 00:00:00 2001 From: tersec Date: Fri, 20 Oct 2023 01:39:47 +0000 Subject: [PATCH] using deneb_mev for Deneb is less incorrect than using capella_mev (#5516) --- .../spec/eth2_apis/eth2_rest_serialization.nim | 11 ++++++----- beacon_chain/spec/forks.nim | 8 ++++---- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim index 9c0ffe6df..668dac558 100644 --- a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim +++ b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim @@ -5,6 +5,8 @@ # * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0). # at your option. This file may not be copied, modified, or distributed except according to those terms. +{.push raises: [].} + import std/[typetraits, strutils] import stew/[assign2, results, base10, byteutils, endians2], presto/common, libp2p/peerid, serialization, json_serialization, @@ -162,9 +164,8 @@ type RestBlockTypes* = phase0.BeaconBlock | altair.BeaconBlock | bellatrix.BeaconBlock | capella.BeaconBlock | - DenebBlockContents | capella_mev.BlindedBeaconBlock - -{.push raises: [].} + DenebBlockContents | capella_mev.BlindedBeaconBlock | + deneb_mev.BlindedBeaconBlock proc prepareJsonResponse*(t: typedesc[RestApiResponse], d: auto): seq[byte] = let res = @@ -1223,7 +1224,7 @@ proc readValue*[BlockType: ForkedBlindedBeaconBlock]( let res = try: RestJson.decode(string(data.get()), - capella_mev.BlindedBeaconBlock, + deneb_mev.BlindedBeaconBlock, requireAllFields = true, allowUnknownFields = true) except SerializationError as exc: @@ -3483,7 +3484,7 @@ proc decodeBytes*[T: DecodeConsensysTypes]( case fork of ConsensusFork.Deneb: let - blck = ? readSszResBytes(capella_mev.BlindedBeaconBlock, value) + blck = ? readSszResBytes(deneb_mev.BlindedBeaconBlock, value) forked = ForkedBlindedBeaconBlock( kind: ConsensusFork.Deneb, denebData: blck) ok(ProduceBlindedBlockResponse(forked)) diff --git a/beacon_chain/spec/forks.nim b/beacon_chain/spec/forks.nim index 1e696fcfa..5cd8f8c42 100644 --- a/beacon_chain/spec/forks.nim +++ b/beacon_chain/spec/forks.nim @@ -155,7 +155,7 @@ type of ConsensusFork.Altair: altairData*: altair.BeaconBlock of ConsensusFork.Bellatrix: bellatrixData*: bellatrix_mev.BlindedBeaconBlock of ConsensusFork.Capella: capellaData*: capella_mev.BlindedBeaconBlock - of ConsensusFork.Deneb: denebData*: capella_mev.BlindedBeaconBlock + of ConsensusFork.Deneb: denebData*: deneb_mev.BlindedBeaconBlock ForkedTrustedBeaconBlock* = object case kind*: ConsensusFork @@ -191,7 +191,7 @@ type of ConsensusFork.Altair: altairData*: altair.SignedBeaconBlock of ConsensusFork.Bellatrix: bellatrixData*: bellatrix_mev.SignedBlindedBeaconBlock of ConsensusFork.Capella: capellaData*: capella_mev.SignedBlindedBeaconBlock - of ConsensusFork.Deneb: denebData*: capella_mev.SignedBlindedBeaconBlock + of ConsensusFork.Deneb: denebData*: deneb_mev.SignedBlindedBeaconBlock ForkySigVerifiedSignedBeaconBlock* = phase0.SigVerifiedSignedBeaconBlock | @@ -562,8 +562,8 @@ func init*(T: type ForkedSignedBlindedBeaconBlock, signature: signature)) of ConsensusFork.Deneb: T(kind: ConsensusFork.Deneb, - denebData: capella_mev.SignedBlindedBeaconBlock(message: forked.denebData, - signature: signature)) + denebData: deneb_mev.SignedBlindedBeaconBlock(message: forked.denebData, + signature: signature)) template init*(T: type ForkedMsgTrustedSignedBeaconBlock, blck: phase0.MsgTrustedSignedBeaconBlock): T = T(kind: ConsensusFork.Phase0, phase0Data: blck)