Skip to content

Commit

Permalink
Fix serialization of parentBeaconBlockRoot fCuv3 (Consensys#7417)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov authored Aug 12, 2023
1 parent 4e9587b commit 3c74f07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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<WithdrawalV1> withdrawals,
@JsonProperty("withdrawals") List<WithdrawalV1> withdrawals,
@JsonProperty("parentBeaconBlockRoot") final Bytes32 parentBeaconBlockRoot) {
super(timestamp, prevRandao, suggestedFeeRecipient, withdrawals);
this.parentBeaconBlockRoot = parentBeaconBlockRoot;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -51,7 +50,7 @@ public SafeFuture<List<SignedBlobSidecar>> unblind() {
.map(
signedBlindedBlobSidecar ->
unblindSignedBlindedBlobSidecar(signedBlindedBlobSidecar, blobsBundle))
.collect(Collectors.toUnmodifiableList()));
.toList());
}

private SignedBlobSidecar unblindSignedBlindedBlobSidecar(
Expand Down

0 comments on commit 3c74f07

Please sign in to comment.