diff --git a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyBuilderEip7732.java b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyBuilderEip7732.java index 2e7909b78e4..ed9745fe674 100644 --- a/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyBuilderEip7732.java +++ b/ethereum/spec/src/main/java/tech/pegasys/teku/spec/datastructures/blocks/blockbody/versions/eip7732/BeaconBlockBodyBuilderEip7732.java @@ -79,33 +79,9 @@ protected void validate() { checkNotNull(payloadAttestations, "payloadAttestations must be specified"); } - @Override - protected Boolean isBlinded() { - return super.isBlinded() || blindedSchema != null; - } - @Override public BeaconBlockBody build() { validate(); - if (isBlinded()) { - final BlindedBeaconBlockBodySchemaEip7732Impl schema = - getAndValidateSchema(true, BlindedBeaconBlockBodySchemaEip7732Impl.class); - return new BlindedBeaconBlockBodyEip7732Impl( - schema, - new SszSignature(randaoReveal), - eth1Data, - SszBytes32.of(graffiti), - proposerSlashings, - attesterSlashings, - attestations, - deposits, - voluntaryExits, - syncAggregate, - getBlsToExecutionChanges(), - signedExecutionPayloadHeader, - payloadAttestations); - } - final BeaconBlockBodySchemaEip7732Impl schema = getAndValidateSchema(false, BeaconBlockBodySchemaEip7732Impl.class); return new BeaconBlockBodyEip7732Impl( diff --git a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/generator/BlockProposalTestUtil.java b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/generator/BlockProposalTestUtil.java index ef7b1cdd9d2..c3d7d56e9a9 100644 --- a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/generator/BlockProposalTestUtil.java +++ b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/generator/BlockProposalTestUtil.java @@ -131,7 +131,6 @@ public SafeFuture createNewBlock( builder.blobKzgCommitments( kzgCommitments.orElseGet(dataStructureUtil::emptyBlobKzgCommitments)); } - // EIP7732 TODO: if (builder.supportsSignedExecutionPayloadHeader()) { final SchemaDefinitionsEip7732 schemaDefinitionsEip7732 = SchemaDefinitionsEip7732.required(spec.atSlot(newSlot).getSchemaDefinitions()); diff --git a/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BeaconBlocksByRangeIntegrationTest.java b/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BeaconBlocksByRangeIntegrationTest.java index c22c4b674df..cd1c3a4cd10 100644 --- a/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BeaconBlocksByRangeIntegrationTest.java +++ b/networking/eth2/src/integration-test/java/tech/pegasys/teku/networking/eth2/BeaconBlocksByRangeIntegrationTest.java @@ -32,6 +32,7 @@ import tech.pegasys.teku.networking.eth2.peers.Eth2Peer; import tech.pegasys.teku.networking.eth2.rpc.core.RpcException; import tech.pegasys.teku.networking.eth2.rpc.core.RpcException.DeserializationFailedException; +import tech.pegasys.teku.networking.eth2.rpc.core.RpcException.LengthOutOfBoundsException; import tech.pegasys.teku.networking.eth2.rpc.core.RpcException.UnrecognizedContextBytesException; import tech.pegasys.teku.networking.p2p.peer.DisconnectReason; import tech.pegasys.teku.networking.p2p.peer.PeerDisconnectedException; @@ -244,8 +245,11 @@ public void requestBlockByRange_withDisparateVersionsEnabled_requestNextSpecBloc assertThat(res).isCompletedExceptionally(); assertThatThrownBy(res::get) .hasCauseInstanceOf(RpcException.class) - .hasRootCauseInstanceOf(DeserializationFailedException.class) - .hasMessageContaining("Failed to deserialize payload"); + .satisfies( + ex -> + assertThat(ex.getCause()) + .isInstanceOfAny( + DeserializationFailedException.class, LengthOutOfBoundsException.class)); } } diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java index 87d0e3900c8..2a88452e445 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/ValidatorClientService.java @@ -498,23 +498,9 @@ private void scheduleValidatorsDuties( validators, validatorIndexProvider)); - final DutyLoader payloadDutyLoader = - new RetryingDutyLoader<>( - asyncRunner, - new PayloadAttestationDutyLoader( - validatorApiChannel, - dependentRoot -> - new SlotBasedScheduledDuties<>( - payloadAttestationDutyFactory, - dependentRoot, - validatorDutyMetrics::performDutyWithMetrics), - validators, - validatorIndexProvider)); validatorTimingChannels.add(new BlockDutyScheduler(metricsSystem, blockDutyLoader, spec)); validatorTimingChannels.add( new AttestationDutyScheduler(metricsSystem, attestationDutyLoader, spec)); - validatorTimingChannels.add( - new PayloadAttestationDutyScheduler(metricsSystem, payloadDutyLoader, spec)); validatorTimingChannels.add(validatorLoader.getSlashingProtectionLogger()); if (spec.isMilestoneSupported(SpecMilestone.ALTAIR)) { @@ -545,6 +531,24 @@ private void scheduleValidatorsDuties( }); validatorRegistrator.ifPresent(validatorTimingChannels::add); } + + if (spec.isMilestoneSupported(SpecMilestone.EIP7732)) { + final DutyLoader payloadDutyLoader = + new RetryingDutyLoader<>( + asyncRunner, + new PayloadAttestationDutyLoader( + validatorApiChannel, + dependentRoot -> + new SlotBasedScheduledDuties<>( + payloadAttestationDutyFactory, + dependentRoot, + validatorDutyMetrics::performDutyWithMetrics), + validators, + validatorIndexProvider)); + validatorTimingChannels.add( + new PayloadAttestationDutyScheduler(metricsSystem, payloadDutyLoader, spec)); + } + addValidatorCountMetric(metricsSystem, validators); final ValidatorStatusLogger validatorStatusLogger = new ValidatorStatusLogger(validators); validatorStatusProvider.subscribeValidatorStatusesUpdates(