Skip to content

Commit

Permalink
rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanBratanov committed Oct 1, 2024
1 parent a2765a4 commit d34da85
Show file tree
Hide file tree
Showing 17 changed files with 126 additions and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import tech.pegasys.teku.spec.datastructures.execution.GetPayloadResponse;
import tech.pegasys.teku.spec.datastructures.execution.SignedExecutionPayloadEnvelope;
import tech.pegasys.teku.spec.datastructures.execution.versions.eip7732.ExecutionPayloadHeaderEip7732;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequestsSchema;
import tech.pegasys.teku.spec.datastructures.state.beaconstate.BeaconState;
import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment;
import tech.pegasys.teku.spec.datastructures.type.SszKZGProof;
Expand Down Expand Up @@ -81,11 +82,15 @@ public Optional<ExecutionPayloadEnvelope> revealExecutionPayload(
schemaDefinitions
.getBlobKzgCommitmentsSchema()
.createFromBlobsBundle(getPayloadResponse.getBlobsBundle().orElseThrow());
final ExecutionRequestsSchema executionRequestsSchema =
schemaDefinitions.getExecutionRequestsSchema();
final ExecutionPayloadEnvelope executionPayload =
schemaDefinitions
.getExecutionPayloadEnvelopeSchema()
.create(
getPayloadResponse.getExecutionPayload(),
// EIP7732 TODO: engine-API still in discussion
executionRequestsSchema.create(List.of(), List.of(), List.of()),
committedHeader.getBuilderIndex(),
block.getRoot(),
blobKzgCommitments,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"in" : "header",
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra" ],
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"description" : "Version of the block being submitted, if using SSZ encoding."
}
} ],
Expand Down Expand Up @@ -38,6 +38,8 @@
"$ref" : "#/components/schemas/SignedBlindedBlockDeneb"
}, {
"$ref" : "#/components/schemas/SignedBlindedBlockElectra"
}, {
"$ref" : "#/components/schemas/SignedBlindedBlockEip7732"
} ]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,13 @@
"200" : {
"description" : "Request successful",
"headers" : {
"Eth-Consensus-Version": {
"description": "Required in response so client can deserialize returned json or ssz data more effectively.",
"required": true,
"schema": {
"type": "string",
"enum": [
"phase0",
"altair",
"bellatrix",
"capella",
"deneb",
"electra"
],
"example": "phase0"
"Eth-Consensus-Version" : {
"description" : "Required in response so client can deserialize returned json or ssz data more effectively.",
"required" : true,
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"example" : "phase0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"bellatrix",
"capella",
"deneb",
"electra"
"electra",
"eip7732"
],
"example": "phase0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"in" : "header",
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra" ],
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"description" : "Version of the block being submitted."
}
} ],
Expand Down Expand Up @@ -48,6 +48,8 @@
"$ref" : "#/components/schemas/SignedBlindedBlockDeneb"
}, {
"$ref" : "#/components/schemas/SignedBlindedBlockElectra"
}, {
"$ref" : "#/components/schemas/SignedBlindedBlockEip7732"
} ]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"in" : "header",
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra" ],
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"description" : "Version of the block being submitted."
}
} ],
Expand Down Expand Up @@ -48,6 +48,8 @@
"$ref" : "#/components/schemas/SignedBlockContentsDeneb"
}, {
"$ref" : "#/components/schemas/SignedBlockContentsElectra"
}, {
"$ref" : "#/components/schemas/SignedBlockContentsEip7732"
} ]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,13 @@
"200" : {
"description" : "Request successful",
"headers" : {
"Eth-Consensus-Version": {
"description": "Required in response so client can deserialize returned json or ssz data more effectively.",
"required": true,
"schema": {
"type": "string",
"enum": [
"phase0",
"altair",
"bellatrix",
"capella",
"deneb",
"electra"
],
"example": "phase0"
"Eth-Consensus-Version" : {
"description" : "Required in response so client can deserialize returned json or ssz data more effectively.",
"required" : true,
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"example" : "phase0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,13 @@
"200" : {
"description" : "Request successful",
"headers" : {
"Eth-Consensus-Version": {
"description": "Required in response so client can deserialize returned json or ssz data more effectively.",
"required": true,
"schema": {
"type": "string",
"enum": [
"phase0",
"altair",
"bellatrix",
"capella",
"deneb",
"electra"
],
"example": "phase0"
"Eth-Consensus-Version" : {
"description" : "Required in response so client can deserialize returned json or ssz data more effectively.",
"required" : true,
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"example" : "phase0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,13 @@
"200" : {
"description" : "Request successful",
"headers" : {
"Eth-Consensus-Version": {
"description": "Required in response so client can deserialize returned json or ssz data more effectively.",
"required": true,
"schema": {
"type": "string",
"enum": [
"phase0",
"altair",
"bellatrix",
"capella",
"deneb",
"electra"
],
"example": "phase0"
"Eth-Consensus-Version" : {
"description" : "Required in response so client can deserialize returned json or ssz data more effectively.",
"required" : true,
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"example" : "phase0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,13 @@
"200" : {
"description" : "Request successful",
"headers" : {
"Eth-Consensus-Version": {
"description": "Required in response so client can deserialize returned json or ssz data more effectively.",
"required": true,
"schema": {
"type": "string",
"enum": [
"phase0",
"altair",
"bellatrix",
"capella",
"deneb",
"electra"
],
"example": "phase0"
"Eth-Consensus-Version" : {
"description" : "Required in response so client can deserialize returned json or ssz data more effectively.",
"required" : true,
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"example" : "phase0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,13 @@
"200" : {
"description" : "Request successful",
"headers" : {
"Eth-Consensus-Version": {
"description": "Required in response so client can deserialize returned json or ssz data more effectively.",
"required": true,
"schema": {
"type": "string",
"enum": [
"phase0",
"altair",
"bellatrix",
"capella",
"deneb",
"electra"
],
"example": "phase0"
"Eth-Consensus-Version" : {
"description" : "Required in response so client can deserialize returned json or ssz data more effectively.",
"required" : true,
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"example" : "phase0"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,44 +56,37 @@
"responses" : {
"200" : {
"description" : "Request successful",
"headers": {
"Eth-Consensus-Version": {
"description": "Required in response so client can deserialize returned json or ssz data more effectively.",
"required": true,
"schema": {
"type": "string",
"enum": [
"phase0",
"altair",
"bellatrix",
"capella",
"deneb",
"electra"
],
"example": "phase0"
"headers" : {
"Eth-Consensus-Version" : {
"description" : "Required in response so client can deserialize returned json or ssz data more effectively.",
"required" : true,
"schema" : {
"type" : "string",
"enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra", "eip7732" ],
"example" : "phase0"
}
},
"Eth-Execution-Payload-Blinded": {
"description": "Required in response so client can deserialize returned json or ssz data to the correct object.",
"required": true,
"schema": {
"type": "boolean"
"Eth-Execution-Payload-Blinded" : {
"description" : "Required in response so client can deserialize returned json or ssz data to the correct object.",
"required" : true,
"schema" : {
"type" : "boolean"
}
},
"Eth-Execution-Payload-Value": {
"description": "Execution payload value in Wei. Required in response so client can determine relative value of execution payloads.",
"required": true,
"schema": {
"type": "string",
"example": "1"
"Eth-Execution-Payload-Value" : {
"description" : "Execution payload value in Wei. Required in response so client can determine relative value of execution payloads.",
"required" : true,
"schema" : {
"type" : "string",
"example" : "1"
}
},
"Eth-Consensus-Block-Value": {
"description": "Consensus rewards paid to the proposer for this block, in Wei. Required in response so client can determine relative value of consensus blocks.",
"required": true,
"schema": {
"type": "string",
"example": "1"
"Eth-Consensus-Block-Value" : {
"description" : "Consensus rewards paid to the proposer for this block, in Wei. Required in response so client can determine relative value of consensus blocks.",
"required" : true,
"schema" : {
"type" : "string",
"example" : "1"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,20 @@

import org.apache.tuweni.bytes.Bytes32;
import tech.pegasys.teku.infrastructure.ssz.SszList;
import tech.pegasys.teku.infrastructure.ssz.containers.Container6;
import tech.pegasys.teku.infrastructure.ssz.containers.Container7;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBit;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode;
import tech.pegasys.teku.infrastructure.unsigned.UInt64;
import tech.pegasys.teku.spec.datastructures.execution.versions.electra.ExecutionRequests;
import tech.pegasys.teku.spec.datastructures.type.SszKZGCommitment;

public class ExecutionPayloadEnvelope
extends Container6<
extends Container7<
ExecutionPayloadEnvelope,
ExecutionPayload,
ExecutionRequests,
SszUInt64,
SszBytes32,
SszList<SszKZGCommitment>,
Expand All @@ -36,6 +38,7 @@ public class ExecutionPayloadEnvelope
ExecutionPayloadEnvelope(
final ExecutionPayloadEnvelopeSchema schema,
final ExecutionPayload payload,
final ExecutionRequests executionRequests,
final UInt64 builderIndex,
final Bytes32 beaconBlockRoot,
final SszList<SszKZGCommitment> blobKzgCommitments,
Expand All @@ -44,6 +47,7 @@ public class ExecutionPayloadEnvelope
super(
schema,
payload,
executionRequests,
SszUInt64.of(builderIndex),
SszBytes32.of(beaconBlockRoot),
blobKzgCommitments,
Expand All @@ -59,24 +63,28 @@ public ExecutionPayload getPayload() {
return getField0();
}

public ExecutionRequests getExecutionRequests() {
return getField1();
}

public UInt64 getBuilderIndex() {
return getField1().get();
return getField2().get();
}

public Bytes32 getBeaconBlockRoot() {
return getField2().get();
return getField3().get();
}

public SszList<SszKZGCommitment> getBlobKzgCommitments() {
return getField3();
return getField4();
}

public boolean isPayloadWithheld() {
return getField4().get();
return getField5().get();
}

public Bytes32 getStateRoot() {
return getField5().get();
return getField6().get();
}

@Override
Expand Down
Loading

0 comments on commit d34da85

Please sign in to comment.