Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ allprojects {
}

def nightly = System.getenv("NIGHTLY") != null
def refTestVersion = nightly ? "nightly" : "v1.7.0-alpha.5"
def refTestVersion = nightly ? "nightly" : "v1.7.0-alpha.7"
def blsRefTestVersion = 'v0.1.2'
def slashingProtectionInterchangeRefTestVersion = 'v5.3.0'
def refTestBaseUrl = 'https://github.com/ethereum/consensus-specs/releases/download'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ public class EpochProcessingTestExecutor implements TestExecutor {
.put(
"epoch_processing/pending_deposits",
new EpochProcessingTestExecutor(EpochOperation.PENDING_DEPOSITS))
.put(
"epoch_processing/pending_deposits_churn",
new EpochProcessingTestExecutor(EpochOperation.PENDING_DEPOSITS))
.put(
"epoch_processing/proposer_lookahead",
new EpochProcessingTestExecutor(EpochOperation.PROPOSER_LOOKAHEAD))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ private enum Operation {
.put(
"operations/voluntary_exit",
new OperationsTestExecutor<>("voluntary_exit.ssz_snappy", Operation.VOLUNTARY_EXIT))
.put(
"operations/voluntary_exit_churn",
new OperationsTestExecutor<>("voluntary_exit.ssz_snappy", Operation.VOLUNTARY_EXIT))
.put(
"operations/attestation",
new OperationsTestExecutor<>("attestation.ssz_snappy", Operation.ATTESTATION))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ public class GossipTests {
// TODO: https://github.com/Consensys/teku/issues/10578
.put("networking/gossip_beacon_attestation", TestExecutor.IGNORE_TESTS)
.put("networking/gossip_beacon_block", TestExecutor.IGNORE_TESTS)
.put("networking/gossip_sync_committee_contribution_and_proof", TestExecutor.IGNORE_TESTS)
.put("networking/gossip_sync_committee_message", TestExecutor.IGNORE_TESTS)
.put("networking/gossip_bls_to_execution_change", TestExecutor.IGNORE_TESTS)
.put("networking/gossip_proposer_slashing", new GossipProposerSlashingTestExecutor())
.put("networking/gossip_voluntary_exit", new GossipVoluntaryExitTestExecutor())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public class SszTestExecutor<T extends SszData> implements TestExecutor {
.put("ssz_static/PartialDataColumnHeader", IGNORE_TESTS)
.put("ssz_static/PartialDataColumnPartsMetadata", IGNORE_TESTS)
.put("ssz_static/PartialDataColumnSidecar", IGNORE_TESTS)
.put("ssz_static/PartialDataColumnGroupID", IGNORE_TESTS)

// Bellatrix types
.put(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ void shouldSkipWhenElReturnsNullBlockAccessList() {
executionPayload,
dataStructureUtil.randomExecutionRequests(),
dataStructureUtil.randomBuilderIndex(),
dataStructureUtil.randomBytes32(),
dataStructureUtil.randomBytes32()),
dataStructureUtil.randomSignature());
final Bytes32 blockRoot = originalEnvelope.getBeaconBlockRoot();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ static SpecConfigHeze required(final SpecConfig specConfig) {
"Expected Heze spec config but got: " + specConfig.getClass().getSimpleName()));
}

int getViewFreezeCutoffBps();

int getInclusionListSubmissionDueBps();

int getProposerInclusionListCutoffBps();
int getInclusionListDueBps();

int getInclusionListCommitteeSize();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,25 +19,19 @@

public class SpecConfigHezeImpl extends DelegatingSpecConfigGloas implements SpecConfigHeze {

private final int viewFreezeCutoffBps;
private final int inclusionListSubmissionDueBps;
private final int proposerInclusionListCutoffBps;
private final int inclusionListDueBps;
private final int maxRequestInclusionList;
private final int maxBytesPerInclusionList;
private final int inclusionListCommitteeSize;

public SpecConfigHezeImpl(
final SpecConfigGloas specConfig,
final int viewFreezeCutoffBps,
final int inclusionListSubmissionDueBps,
final int proposerInclusionListCutoffBps,
final int inclusionListDueBps,
final int maxRequestInclusionList,
final int maxBytesPerInclusionList,
final int inclusionListCommitteeSize) {
super(specConfig);
this.viewFreezeCutoffBps = viewFreezeCutoffBps;
this.inclusionListSubmissionDueBps = inclusionListSubmissionDueBps;
this.proposerInclusionListCutoffBps = proposerInclusionListCutoffBps;
this.inclusionListDueBps = inclusionListDueBps;
this.maxRequestInclusionList = maxRequestInclusionList;
this.maxBytesPerInclusionList = maxBytesPerInclusionList;
this.inclusionListCommitteeSize = inclusionListCommitteeSize;
Expand All @@ -49,18 +43,8 @@ public SpecMilestone getMilestone() {
}

@Override
public int getViewFreezeCutoffBps() {
return viewFreezeCutoffBps;
}

@Override
public int getInclusionListSubmissionDueBps() {
return inclusionListSubmissionDueBps;
}

@Override
public int getProposerInclusionListCutoffBps() {
return proposerInclusionListCutoffBps;
public int getInclusionListDueBps() {
return inclusionListDueBps;
}

@Override
Expand Down Expand Up @@ -92,9 +76,7 @@ public boolean equals(final Object o) {
return false;
}
SpecConfigHezeImpl that = (SpecConfigHezeImpl) o;
return viewFreezeCutoffBps == that.viewFreezeCutoffBps
&& inclusionListSubmissionDueBps == that.inclusionListSubmissionDueBps
&& proposerInclusionListCutoffBps == that.proposerInclusionListCutoffBps
return inclusionListDueBps == that.inclusionListDueBps
&& maxRequestInclusionList == that.maxRequestInclusionList
&& maxBytesPerInclusionList == that.maxBytesPerInclusionList
&& inclusionListCommitteeSize == that.inclusionListCommitteeSize;
Expand All @@ -104,11 +86,9 @@ public boolean equals(final Object o) {
public int hashCode() {
return Objects.hash(
super.hashCode(),
viewFreezeCutoffBps,
inclusionListSubmissionDueBps,
proposerInclusionListCutoffBps,
inclusionListDueBps,
maxRequestInclusionList,
maxBytesPerInclusionList,
inclusionListCommitteeSize);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
public class HezeBuilder extends BaseForkBuilder
implements ForkConfigBuilder<SpecConfigGloas, SpecConfigHeze> {

private Integer viewFreezeCutoffBps;
private Integer inclusionListSubmissionDueBps;
private Integer proposerInclusionListCutoffBps;
private Integer inclusionListDueBps;
private Integer maxRequestInclusionList;
private Integer maxBytesPerInclusionList;

Expand All @@ -43,30 +41,16 @@ public SpecConfigAndParent<SpecConfigHeze> build(
return SpecConfigAndParent.of(
new SpecConfigHezeImpl(
specConfigAndParent.specConfig(),
viewFreezeCutoffBps,
inclusionListSubmissionDueBps,
proposerInclusionListCutoffBps,
inclusionListDueBps,
maxRequestInclusionList,
maxBytesPerInclusionList,
inclusionListCommitteeSize),
specConfigAndParent);
}

public HezeBuilder viewFreezeCutoffBps(final Integer viewFreezeCutoffBps) {
checkNotNull(viewFreezeCutoffBps);
this.viewFreezeCutoffBps = viewFreezeCutoffBps;
return this;
}

public HezeBuilder inclusionListSubmissionDueBps(final Integer inclusionListSubmissionDueBps) {
checkNotNull(inclusionListSubmissionDueBps);
this.inclusionListSubmissionDueBps = inclusionListSubmissionDueBps;
return this;
}

public HezeBuilder proposerInclusionListCutoffBps(final Integer proposerInclusionListCutoffBps) {
checkNotNull(proposerInclusionListCutoffBps);
this.proposerInclusionListCutoffBps = proposerInclusionListCutoffBps;
public HezeBuilder inclusionListDueBps(final Integer inclusionListDueBps) {
checkNotNull(inclusionListDueBps);
this.inclusionListDueBps = inclusionListDueBps;
return this;
}

Expand Down Expand Up @@ -97,9 +81,7 @@ public void validate() {
@Override
public Map<String, Object> getValidationMap() {
final Map<String, Object> constants = new HashMap<>();
constants.put("viewFreezeCutoffBps", viewFreezeCutoffBps);
constants.put("inclusionListSubmissionDueBps", inclusionListSubmissionDueBps);
constants.put("proposerInclusionListCutoffBps", proposerInclusionListCutoffBps);
constants.put("inclusionListDueBps", inclusionListDueBps);
constants.put("maxRequestInclusionList", maxRequestInclusionList);
constants.put("maxBytesPerInclusionList", maxBytesPerInclusionList);
constants.put("inclusionListCommitteeSize", inclusionListCommitteeSize);
Expand All @@ -108,4 +90,4 @@ public Map<String, Object> getValidationMap() {

@Override
public void addOverridableItemsToRawConfig(final BiConsumer<String, Object> rawConfig) {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static com.google.common.base.Preconditions.checkState;

import org.apache.tuweni.bytes.Bytes32;
import tech.pegasys.teku.infrastructure.ssz.containers.Container4;
import tech.pegasys.teku.infrastructure.ssz.containers.Container5;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode;
Expand All @@ -29,25 +29,28 @@
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsGloas;

public class BlindedExecutionPayloadEnvelope
extends Container4<
extends Container5<
BlindedExecutionPayloadEnvelope,
ExecutionPayloadHeader,
ExecutionRequests,
SszUInt64,
SszBytes32,
SszBytes32> {

BlindedExecutionPayloadEnvelope(
final BlindedExecutionPayloadEnvelopeSchema schema,
final ExecutionPayloadHeader payloadHeader,
final ExecutionRequests executionRequests,
final UInt64 builderIndex,
final Bytes32 beaconBlockRoot) {
final Bytes32 beaconBlockRoot,
final Bytes32 parentBeaconBlockRoot) {
super(
schema,
payloadHeader,
executionRequests,
SszUInt64.of(builderIndex),
SszBytes32.of(beaconBlockRoot));
SszBytes32.of(beaconBlockRoot),
SszBytes32.of(parentBeaconBlockRoot));
}

BlindedExecutionPayloadEnvelope(
Expand All @@ -71,6 +74,10 @@ public Bytes32 getBeaconBlockRoot() {
return getField3().get();
}

public Bytes32 getParentBeaconBlockRoot() {
return getField4().get();
}

public UInt64 getSlot() {
return ExecutionPayloadHeaderGloas.required(getPayloadHeader()).getSlotNumber();
}
Expand All @@ -92,7 +99,12 @@ public ExecutionPayloadEnvelope unblind(
final ExecutionPayloadEnvelope executionPayloadEnvelope =
schemaDefinitions
.getExecutionPayloadEnvelopeSchema()
.create(payload, getExecutionRequests(), getBuilderIndex(), getBeaconBlockRoot());
.create(
payload,
getExecutionRequests(),
getBuilderIndex(),
getBeaconBlockRoot(),
getParentBeaconBlockRoot());
checkState(
executionPayloadEnvelope.hashTreeRoot().equals(hashTreeRoot()),
"unblinded execution payload envelope root does not match original envelope root");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import static tech.pegasys.teku.spec.schemas.registry.SchemaTypes.EXECUTION_REQUESTS_SCHEMA;

import org.apache.tuweni.bytes.Bytes32;
import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema4;
import tech.pegasys.teku.infrastructure.ssz.containers.ContainerSchema5;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
import tech.pegasys.teku.infrastructure.ssz.schema.SszPrimitiveSchemas;
Expand All @@ -29,11 +29,12 @@
import tech.pegasys.teku.spec.schemas.registry.SchemaRegistry;

public class BlindedExecutionPayloadEnvelopeSchema
extends ContainerSchema4<
extends ContainerSchema5<
BlindedExecutionPayloadEnvelope,
ExecutionPayloadHeader,
ExecutionRequests,
SszUInt64,
SszBytes32,
SszBytes32> {

public BlindedExecutionPayloadEnvelopeSchema(final SchemaRegistry schemaRegistry) {
Expand All @@ -45,16 +46,23 @@ public BlindedExecutionPayloadEnvelopeSchema(final SchemaRegistry schemaRegistry
ExecutionPayloadHeader.class, schemaRegistry.get(EXECUTION_PAYLOAD_HEADER_SCHEMA))),
namedSchema("execution_requests", schemaRegistry.get(EXECUTION_REQUESTS_SCHEMA)),
namedSchema("builder_index", SszPrimitiveSchemas.UINT64_SCHEMA),
namedSchema("beacon_block_root", SszPrimitiveSchemas.BYTES32_SCHEMA));
namedSchema("beacon_block_root", SszPrimitiveSchemas.BYTES32_SCHEMA),
namedSchema("parent_beacon_block_root", SszPrimitiveSchemas.BYTES32_SCHEMA));
}

public BlindedExecutionPayloadEnvelope create(
final ExecutionPayloadHeader payloadHeader,
final ExecutionRequests executionRequests,
final UInt64 builderIndex,
final Bytes32 beaconBlockRoot) {
final Bytes32 beaconBlockRoot,
final Bytes32 parentBeaconBlockRoot) {
return new BlindedExecutionPayloadEnvelope(
this, payloadHeader, executionRequests, builderIndex, beaconBlockRoot);
this,
payloadHeader,
executionRequests,
builderIndex,
beaconBlockRoot,
parentBeaconBlockRoot);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static com.google.common.base.Preconditions.checkState;

import org.apache.tuweni.bytes.Bytes32;
import tech.pegasys.teku.infrastructure.ssz.containers.Container4;
import tech.pegasys.teku.infrastructure.ssz.containers.Container5;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszBytes32;
import tech.pegasys.teku.infrastructure.ssz.primitive.SszUInt64;
import tech.pegasys.teku.infrastructure.ssz.tree.TreeNode;
Expand All @@ -29,21 +29,28 @@
import tech.pegasys.teku.spec.schemas.SchemaDefinitionsGloas;

public class ExecutionPayloadEnvelope
extends Container4<
ExecutionPayloadEnvelope, ExecutionPayload, ExecutionRequests, SszUInt64, SszBytes32> {
extends Container5<
ExecutionPayloadEnvelope,
ExecutionPayload,
ExecutionRequests,
SszUInt64,
SszBytes32,
SszBytes32> {

ExecutionPayloadEnvelope(
final ExecutionPayloadEnvelopeSchema schema,
final ExecutionPayload payload,
final ExecutionRequests executionRequests,
final UInt64 builderIndex,
final Bytes32 beaconBlockRoot) {
final Bytes32 beaconBlockRoot,
final Bytes32 parentBeaconBlockRoot) {
super(
schema,
payload,
executionRequests,
SszUInt64.of(builderIndex),
SszBytes32.of(beaconBlockRoot));
SszBytes32.of(beaconBlockRoot),
SszBytes32.of(parentBeaconBlockRoot));
}

ExecutionPayloadEnvelope(final ExecutionPayloadEnvelopeSchema type, final TreeNode backingNode) {
Expand All @@ -66,6 +73,10 @@ public Bytes32 getBeaconBlockRoot() {
return getField3().get();
}

public Bytes32 getParentBeaconBlockRoot() {
return getField4().get();
}

public UInt64 getSlot() {
return ExecutionPayloadGloas.required(getPayload()).getSlotNumber();
}
Expand Down Expand Up @@ -93,7 +104,8 @@ public BlindedExecutionPayloadEnvelope blind(final SchemaDefinitionsGloas schema
.createFromExecutionPayload(getPayload()),
getExecutionRequests(),
getBuilderIndex(),
getBeaconBlockRoot());
getBeaconBlockRoot(),
getParentBeaconBlockRoot());
checkState(
blinded.hashTreeRoot().equals(hashTreeRoot()),
"Blinded root does not match the unblinded root");
Expand Down
Loading
Loading