From 3c74f07bd13bc79024d0935e5388f4aa479df76d Mon Sep 17 00:00:00 2001 From: Stefan Bratanov Date: Sat, 12 Aug 2023 19:49:39 +0100 Subject: [PATCH] Fix serialization of parentBeaconBlockRoot fCuv3 (#7417) --- .../executionclient/schema/PayloadAttributesV3.java | 8 +++++++- .../versions/deneb/SignedBlobSidecarsUnblinderDeneb.java | 3 +-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV3.java b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV3.java index aad612e1f5d..7d62f80d8ec 100644 --- a/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV3.java +++ b/ethereum/executionclient/src/main/java/tech/pegasys/teku/ethereum/executionclient/schema/PayloadAttributesV3.java @@ -14,22 +14,28 @@ package tech.pegasys.teku.ethereum.executionclient.schema; import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; import java.util.List; import java.util.Optional; import org.apache.tuweni.bytes.Bytes32; +import tech.pegasys.teku.ethereum.executionclient.serialization.Bytes32Deserializer; +import tech.pegasys.teku.ethereum.executionclient.serialization.BytesSerializer; import tech.pegasys.teku.infrastructure.bytes.Bytes20; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.executionlayer.PayloadBuildingAttributes; public class PayloadAttributesV3 extends PayloadAttributesV2 { + @JsonSerialize(using = BytesSerializer.class) + @JsonDeserialize(using = Bytes32Deserializer.class) public final Bytes32 parentBeaconBlockRoot; public PayloadAttributesV3( @JsonProperty("timestamp") UInt64 timestamp, @JsonProperty("prevRandao") Bytes32 prevRandao, @JsonProperty("suggestedFeeRecipient") Bytes20 suggestedFeeRecipient, - @JsonProperty("withdrawals") final List withdrawals, + @JsonProperty("withdrawals") List withdrawals, @JsonProperty("parentBeaconBlockRoot") final Bytes32 parentBeaconBlockRoot) { super(timestamp, prevRandao, suggestedFeeRecipient, withdrawals); this.parentBeaconBlockRoot = parentBeaconBlockRoot; diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/SignedBlobSidecarsUnblinderDeneb.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/SignedBlobSidecarsUnblinderDeneb.java index 20e7c666ea5..23dd8d58be0 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/SignedBlobSidecarsUnblinderDeneb.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blobs/versions/deneb/SignedBlobSidecarsUnblinderDeneb.java @@ -15,7 +15,6 @@ import java.util.List; import java.util.function.Supplier; -import java.util.stream.Collectors; import tech.pegasys.teku.infrastructure.async.SafeFuture; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.datastructures.blobs.SignedBlobSidecarsUnblinder; @@ -51,7 +50,7 @@ public SafeFuture> unblind() { .map( signedBlindedBlobSidecar -> unblindSignedBlindedBlobSidecar(signedBlindedBlobSidecar, blobsBundle)) - .collect(Collectors.toUnmodifiableList())); + .toList()); } private SignedBlobSidecar unblindSignedBlindedBlobSidecar(