diff --git a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/ValidatorApiHandler.java b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/ValidatorApiHandler.java index 8b88b4f750b..fa0397db5f7 100644 --- a/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/ValidatorApiHandler.java +++ b/beacon/validator/src/main/java/tech/pegasys/teku/validator/coordinator/ValidatorApiHandler.java @@ -79,7 +79,6 @@ import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration; import tech.pegasys.teku.spec.datastructures.genesis.GenesisData; import tech.pegasys.teku.spec.datastructures.metadata.BlockContainerAndMetaData; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; import tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof; @@ -498,29 +497,18 @@ private AttestationData createAttestationData( } @Override - public SafeFuture>> createAggregate( + public SafeFuture> createAggregate( final UInt64 slot, final Bytes32 attestationHashTreeRoot, final Optional committeeIndex) { if (isSyncActive()) { return NodeSyncingException.failedFuture(); } - - final Optional maybeAttestation = + return SafeFuture.completedFuture( attestationPool .createAggregateFor(attestationHashTreeRoot, committeeIndex) .filter(attestation -> attestation.getData().getSlot().equals(slot)) - .map(ValidatableAttestation::getAttestation); - - return SafeFuture.completedFuture( - maybeAttestation.map( - attestation -> - new ObjectAndMetaData<>( - attestation, - spec.atSlot(attestation.getData().getSlot()).getMilestone(), - false, - false, - false))); + .map(ValidatableAttestation::getAttestation)); } @Override diff --git a/beacon/validator/src/test/java/tech/pegasys/teku/validator/coordinator/ValidatorApiHandlerTest.java b/beacon/validator/src/test/java/tech/pegasys/teku/validator/coordinator/ValidatorApiHandlerTest.java index 85a393aaaef..677244a8b50 100644 --- a/beacon/validator/src/test/java/tech/pegasys/teku/validator/coordinator/ValidatorApiHandlerTest.java +++ b/beacon/validator/src/test/java/tech/pegasys/teku/validator/coordinator/ValidatorApiHandlerTest.java @@ -695,7 +695,7 @@ public void createAttestationData_shouldUseCorrectSourceWhenEpochTransitionRequi @Test public void createAggregate_shouldFailWhenNodeIsSyncing() { nodeIsSyncing(); - final SafeFuture>> result = + final SafeFuture> result = validatorApiHandler.createAggregate( ONE, dataStructureUtil.randomAttestationData().hashTreeRoot(), Optional.empty()); @@ -717,18 +717,17 @@ public void createSyncCommitteeContribution() { @Test public void createAggregate_shouldReturnAggregateFromAttestationPool() { final AttestationData attestationData = dataStructureUtil.randomAttestationData(); - final Attestation aggregate = dataStructureUtil.randomAttestation(); + final Optional aggregate = Optional.of(dataStructureUtil.randomAttestation()); when(attestationPool.createAggregateFor( eq(attestationData.hashTreeRoot()), eq(Optional.empty()))) - .thenReturn(Optional.of(ValidatableAttestation.from(spec, aggregate))); + .thenReturn(aggregate.map(attestation -> ValidatableAttestation.from(spec, attestation))); assertThat( validatorApiHandler.createAggregate( - aggregate.getData().getSlot(), attestationData.hashTreeRoot(), Optional.empty())) - .isCompletedWithValue( - Optional.of( - new ObjectAndMetaData<>( - aggregate, spec.getGenesisSpec().getMilestone(), false, false, false))); + aggregate.get().getData().getSlot(), + attestationData.hashTreeRoot(), + Optional.empty())) + .isCompletedWithValue(aggregate); } @Test diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/GetAggregateAttestation.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/GetAggregateAttestation.java index bf04d8725e3..b9aee13ec09 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/GetAggregateAttestation.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/GetAggregateAttestation.java @@ -34,7 +34,6 @@ import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.Spec; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationSchema; @@ -72,16 +71,14 @@ public void handleRequest(final RestApiRequest request) throws JsonProcessingExc final Bytes32 beaconBlockRoot = request.getQueryParameter(ATTESTATION_DATA_ROOT_PARAMETER); final UInt64 slot = request.getQueryParameter(SLOT_PARAM); - final SafeFuture>> future = + final SafeFuture> future = provider.createAggregate(slot, beaconBlockRoot, Optional.empty()); request.respondAsync( future.thenApply( - maybeAttestationAndMetaData -> - maybeAttestationAndMetaData - .map( - attestationObjectAndMetaData -> - AsyncApiResponse.respondOk(attestationObjectAndMetaData.getData())) + maybeAttestation -> + maybeAttestation + .map(AsyncApiResponse::respondOk) .orElseGet(AsyncApiResponse::respondNotFound))); } diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/GetAggregateAttestationTest.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/GetAggregateAttestationTest.java index 9b67b6b02e8..c6e6533a469 100644 --- a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/GetAggregateAttestationTest.java +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/validator/GetAggregateAttestationTest.java @@ -34,7 +34,6 @@ import tech.pegasys.teku.beaconrestapi.AbstractMigratedBeaconHandlerTest; import tech.pegasys.teku.infrastructure.async.SafeFuture; import tech.pegasys.teku.infrastructure.unsigned.UInt64; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; class GetAggregateAttestationTest extends AbstractMigratedBeaconHandlerTest { @@ -53,11 +52,7 @@ public void shouldReturnAttestationInformation() throws JsonProcessingException Attestation attestation = dataStructureUtil.randomAttestation(); when(validatorDataProvider.createAggregate( eq(UInt64.valueOf(1)), eq(attestationDataRoot), eq(Optional.empty()))) - .thenReturn( - SafeFuture.completedFuture( - Optional.of( - new ObjectAndMetaData<>( - attestation, spec.getGenesisSpec().getMilestone(), false, false, false)))); + .thenReturn(SafeFuture.completedFuture(Optional.of(attestation))); handler.handleRequest(request); diff --git a/data/provider/src/main/java/tech/pegasys/teku/api/ValidatorDataProvider.java b/data/provider/src/main/java/tech/pegasys/teku/api/ValidatorDataProvider.java index b6fa28105cb..b5bf6cd529d 100644 --- a/data/provider/src/main/java/tech/pegasys/teku/api/ValidatorDataProvider.java +++ b/data/provider/src/main/java/tech/pegasys/teku/api/ValidatorDataProvider.java @@ -240,7 +240,7 @@ private Optional checkInternalCommitteeSignature( return Optional.of(message); } - public SafeFuture>> createAggregate( + public SafeFuture> createAggregate( final UInt64 slot, final Bytes32 attestationHashTreeRoot, final Optional committeeIndex) { @@ -249,7 +249,8 @@ public SafeFuture>> createAggregate( public SafeFuture>> createAggregateAndMetaData( final UInt64 slot, final Bytes32 attestationHashTreeRoot, final UInt64 committeeIndex) { - return createAggregate(slot, attestationHashTreeRoot, Optional.of(committeeIndex)); + return createAggregate(slot, attestationHashTreeRoot, Optional.of(committeeIndex)) + .thenApply(maybeAttestation -> maybeAttestation.map(this::lookUpMetadata)); } public SafeFuture> sendAggregateAndProofs( @@ -348,4 +349,13 @@ private static ValidatorBlockResult generateSubmitSignedBlockResponse( return new ValidatorBlockResult(responseCode, result.getRejectionReason(), hashRoot); } + + private ObjectAndMetaData lookUpMetadata(final Attestation attestation) { + return new ObjectAndMetaData<>( + attestation, + spec.atSlot(attestation.getData().getSlot()).getMilestone(), + false, + false, + false); + } } diff --git a/validator/api/src/main/java/tech/pegasys/teku/validator/api/ValidatorApiChannel.java b/validator/api/src/main/java/tech/pegasys/teku/validator/api/ValidatorApiChannel.java index ba96bdf4b48..f403b7ec657 100644 --- a/validator/api/src/main/java/tech/pegasys/teku/validator/api/ValidatorApiChannel.java +++ b/validator/api/src/main/java/tech/pegasys/teku/validator/api/ValidatorApiChannel.java @@ -39,7 +39,6 @@ import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration; import tech.pegasys.teku.spec.datastructures.genesis.GenesisData; import tech.pegasys.teku.spec.datastructures.metadata.BlockContainerAndMetaData; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; import tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof; @@ -109,7 +108,7 @@ public SafeFuture> createAttestationData( } @Override - public SafeFuture>> createAggregate( + public SafeFuture> createAggregate( UInt64 slot, Bytes32 attestationHashTreeRoot, Optional committeeIndex) { return SafeFuture.completedFuture(Optional.empty()); } @@ -232,7 +231,7 @@ SafeFuture> createUnsignedBlock( SafeFuture> createAttestationData(UInt64 slot, int committeeIndex); - SafeFuture>> createAggregate( + SafeFuture> createAggregate( UInt64 slot, Bytes32 attestationHashTreeRoot, Optional committeeIndex); SafeFuture> createSyncCommitteeContribution( diff --git a/validator/beaconnode/src/main/java/tech/pegasys/teku/validator/beaconnode/metrics/MetricRecordingValidatorApiChannel.java b/validator/beaconnode/src/main/java/tech/pegasys/teku/validator/beaconnode/metrics/MetricRecordingValidatorApiChannel.java index c6be0c74686..85ccf5ec827 100644 --- a/validator/beaconnode/src/main/java/tech/pegasys/teku/validator/beaconnode/metrics/MetricRecordingValidatorApiChannel.java +++ b/validator/beaconnode/src/main/java/tech/pegasys/teku/validator/beaconnode/metrics/MetricRecordingValidatorApiChannel.java @@ -48,7 +48,6 @@ import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration; import tech.pegasys.teku.spec.datastructures.genesis.GenesisData; import tech.pegasys.teku.spec.datastructures.metadata.BlockContainerAndMetaData; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; import tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof; @@ -157,7 +156,7 @@ public SafeFuture> createAttestationData( } @Override - public SafeFuture>> createAggregate( + public SafeFuture> createAggregate( final UInt64 slot, final Bytes32 attestationHashTreeRoot, final Optional committeeIndex) { diff --git a/validator/beaconnode/src/test/java/tech/pegasys/teku/validator/beaconnode/metrics/MetricRecordingValidatorApiChannelTest.java b/validator/beaconnode/src/test/java/tech/pegasys/teku/validator/beaconnode/metrics/MetricRecordingValidatorApiChannelTest.java index 6150f6d86c4..e07d26d9458 100644 --- a/validator/beaconnode/src/test/java/tech/pegasys/teku/validator/beaconnode/metrics/MetricRecordingValidatorApiChannelTest.java +++ b/validator/beaconnode/src/test/java/tech/pegasys/teku/validator/beaconnode/metrics/MetricRecordingValidatorApiChannelTest.java @@ -35,10 +35,8 @@ import tech.pegasys.teku.infrastructure.metrics.StubMetricsSystem; import tech.pegasys.teku.infrastructure.metrics.TekuMetricCategory; import tech.pegasys.teku.infrastructure.unsigned.UInt64; -import tech.pegasys.teku.spec.SpecMilestone; import tech.pegasys.teku.spec.TestSpecFactory; import tech.pegasys.teku.spec.datastructures.genesis.GenesisData; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; import tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof; @@ -210,8 +208,7 @@ public static Stream getDataRequestArguments() { channel.createAggregate( attestationData.getSlot(), attestationData.hashTreeRoot(), Optional.empty()), BeaconNodeRequestLabels.CREATE_AGGREGATE_METHOD, - new ObjectAndMetaData<>( - dataStructureUtil.randomAttestation(), SpecMilestone.PHASE0, false, false, false)), + dataStructureUtil.randomAttestation()), requestDataTest( "createSyncCommitteeContribution", channel -> diff --git a/validator/client/src/main/java/tech/pegasys/teku/validator/client/duties/attestations/AggregationDuty.java b/validator/client/src/main/java/tech/pegasys/teku/validator/client/duties/attestations/AggregationDuty.java index 402a45df218..d2d0419c8b5 100644 --- a/validator/client/src/main/java/tech/pegasys/teku/validator/client/duties/attestations/AggregationDuty.java +++ b/validator/client/src/main/java/tech/pegasys/teku/validator/client/duties/attestations/AggregationDuty.java @@ -26,7 +26,6 @@ import tech.pegasys.teku.infrastructure.metrics.Validator.ValidatorDutyMetricsSteps; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.Spec; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.AggregateAndProof; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; @@ -137,14 +136,10 @@ public SafeFuture> createAggregate( final SafeFuture> createAggregationFuture = validatorDutyMetrics.record( () -> - validatorApiChannel - .createAggregate( - slot, - attestationData.hashTreeRoot(), - Optional.of(aggregator.attestationCommitteeIndex)) - .thenApply( - maybeAttestationAndMetaData -> - maybeAttestationAndMetaData.map(ObjectAndMetaData::getData)), + validatorApiChannel.createAggregate( + slot, + attestationData.hashTreeRoot(), + Optional.of(aggregator.attestationCommitteeIndex)), this, ValidatorDutyMetricsSteps.CREATE); diff --git a/validator/client/src/test/java/tech/pegasys/teku/validator/client/duties/AggregationDutyTest.java b/validator/client/src/test/java/tech/pegasys/teku/validator/client/duties/AggregationDutyTest.java index b7227c364a6..dd47c2ec23c 100644 --- a/validator/client/src/test/java/tech/pegasys/teku/validator/client/duties/AggregationDutyTest.java +++ b/validator/client/src/test/java/tech/pegasys/teku/validator/client/duties/AggregationDutyTest.java @@ -45,10 +45,8 @@ import tech.pegasys.teku.infrastructure.metrics.Validator.ValidatorDutyMetricsSteps; import tech.pegasys.teku.infrastructure.unsigned.UInt64; import tech.pegasys.teku.spec.Spec; -import tech.pegasys.teku.spec.SpecMilestone; import tech.pegasys.teku.spec.TestSpecContext; import tech.pegasys.teku.spec.TestSpecInvocationContextProvider.SpecContext; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.AggregateAndProof; import tech.pegasys.teku.spec.datastructures.operations.AggregateAndProof.AggregateAndProofSchema; import tech.pegasys.teku.spec.datastructures.operations.Attestation; @@ -80,19 +78,18 @@ class AggregationDutyTest { spy(ValidatorDutyMetrics.create(new StubMetricsSystem())); private Spec spec; - private SpecMilestone specMilestone; private DataStructureUtil dataStructureUtil; private AggregateAndProofSchema aggregateAndProofSchema; private SignedAggregateAndProofSchema signedAggregateAndProofSchema; private ForkInfo forkInfo; private Validator validator1; private Validator validator2; + private AggregationDuty duty; @BeforeEach public void setUp(final SpecContext specContext) { spec = specContext.getSpec(); - specMilestone = specContext.getSpecMilestone(); dataStructureUtil = specContext.getDataStructureUtil(); aggregateAndProofSchema = spec.getGenesisSchemaDefinitions().getAggregateAndProofSchema(); signedAggregateAndProofSchema = @@ -145,7 +142,7 @@ public void shouldProduceAggregateAndProof() { SLOT, attestationData.hashTreeRoot(), Optional.of(UInt64.valueOf(attestationCommitteeIndex)))) - .thenReturn(completedFuture(Optional.of(addMetaData(aggregate)))); + .thenReturn(completedFuture(Optional.of(aggregate))); final AggregateAndProof expectedAggregateAndProof = aggregateAndProofSchema.create(UInt64.valueOf(validatorIndex), aggregate, proof); @@ -199,12 +196,12 @@ public void shouldProduceAggregateAndProofForMultipleCommittees() { SLOT, committee1AttestationData.hashTreeRoot(), Optional.of(UInt64.valueOf(validator1CommitteeIndex)))) - .thenReturn(completedFuture(Optional.of(addMetaData(committee1Aggregate)))); + .thenReturn(completedFuture(Optional.of(committee1Aggregate))); when(validatorApiChannel.createAggregate( SLOT, committee2AttestationData.hashTreeRoot(), Optional.of(UInt64.valueOf(validator2CommitteeIndex)))) - .thenReturn(completedFuture(Optional.of(addMetaData(committee2Aggregate)))); + .thenReturn(completedFuture(Optional.of(committee2Aggregate))); final AggregateAndProof aggregateAndProof1 = aggregateAndProofSchema.create( @@ -264,7 +261,7 @@ public void shouldProduceSingleAggregateAndProofWhenMultipleValidatorsAggregateS when(validatorApiChannel.createAggregate( SLOT, attestationData.hashTreeRoot(), Optional.of(UInt64.valueOf(committeeIndex)))) - .thenReturn(completedFuture(Optional.of(addMetaData(aggregate)))); + .thenReturn(completedFuture(Optional.of(aggregate))); when(validatorApiChannel.sendAggregateAndProofs(anyList())) .thenReturn(SafeFuture.completedFuture(Collections.emptyList())); @@ -383,8 +380,4 @@ private void performAndReportDuty() { assertThat(result).isCompleted(); safeJoin(result).report(TYPE, SLOT, validatorLogger); } - - private ObjectAndMetaData addMetaData(final Attestation aggregate) { - return new ObjectAndMetaData<>(aggregate, specMilestone, false, false, false); - } } diff --git a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/FailoverValidatorApiHandler.java b/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/FailoverValidatorApiHandler.java index 0f723c9d8a3..42d15b84d8b 100644 --- a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/FailoverValidatorApiHandler.java +++ b/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/FailoverValidatorApiHandler.java @@ -50,7 +50,6 @@ import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration; import tech.pegasys.teku.spec.datastructures.genesis.GenesisData; import tech.pegasys.teku.spec.datastructures.metadata.BlockContainerAndMetaData; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; import tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof; @@ -190,7 +189,7 @@ public SafeFuture> createAttestationData( } @Override - public SafeFuture>> createAggregate( + public SafeFuture> createAggregate( final UInt64 slot, final Bytes32 attestationHashTreeRoot, final Optional committeeIndex) { diff --git a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/RemoteValidatorApiHandler.java b/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/RemoteValidatorApiHandler.java index f9caefb5bd9..858a38bed77 100644 --- a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/RemoteValidatorApiHandler.java +++ b/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/RemoteValidatorApiHandler.java @@ -307,28 +307,24 @@ private List convertPostDataFailureResponseToSubmitDataErrors( } @Override - public SafeFuture>> createAggregate( + public SafeFuture> createAggregate( final UInt64 slot, final Bytes32 attestationHashTreeRoot, final Optional committeeIndex) { if (spec.atSlot(slot).getMilestone().isGreaterThanOrEqualTo(SpecMilestone.ELECTRA) && committeeIndex.isPresent()) { return sendRequest( - () -> typeDefClient.createAggregate(slot, attestationHashTreeRoot, committeeIndex.get())); + () -> + typeDefClient + .createAggregate(slot, attestationHashTreeRoot, committeeIndex.get()) + .map(ObjectAndMetaData::getData)); } return sendRequest( () -> apiClient .createAggregate(slot, attestationHashTreeRoot) - .map( - attestation -> - new ObjectAndMetaData<>( - attestation.asInternalAttestation(spec), - spec.atSlot(attestation.data.slot).getMilestone(), - false, - false, - false))); + .map(attestation -> attestation.asInternalAttestation(spec))); } @Override diff --git a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/sentry/SentryValidatorApiChannel.java b/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/sentry/SentryValidatorApiChannel.java index 8b4d2d4364a..0ec631b7059 100644 --- a/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/sentry/SentryValidatorApiChannel.java +++ b/validator/remote/src/main/java/tech/pegasys/teku/validator/remote/sentry/SentryValidatorApiChannel.java @@ -38,7 +38,6 @@ import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration; import tech.pegasys.teku.spec.datastructures.genesis.GenesisData; import tech.pegasys.teku.spec.datastructures.metadata.BlockContainerAndMetaData; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; import tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof; @@ -127,7 +126,7 @@ public SafeFuture> createAttestationData( } @Override - public SafeFuture>> createAggregate( + public SafeFuture> createAggregate( final UInt64 slot, final Bytes32 attestationHashTreeRoot, final Optional committeeIndex) { diff --git a/validator/remote/src/test/java/tech/pegasys/teku/validator/remote/FailoverValidatorApiHandlerTest.java b/validator/remote/src/test/java/tech/pegasys/teku/validator/remote/FailoverValidatorApiHandlerTest.java index 293bc1b6ca1..c2f8ada3679 100644 --- a/validator/remote/src/test/java/tech/pegasys/teku/validator/remote/FailoverValidatorApiHandlerTest.java +++ b/validator/remote/src/test/java/tech/pegasys/teku/validator/remote/FailoverValidatorApiHandlerTest.java @@ -64,7 +64,6 @@ import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration; import tech.pegasys.teku.spec.datastructures.genesis.GenesisData; import tech.pegasys.teku.spec.datastructures.metadata.BlockContainerAndMetaData; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; import tech.pegasys.teku.spec.datastructures.operations.SignedAggregateAndProof; @@ -700,9 +699,7 @@ private static Stream getRequestsUsingFailover() { "createAggregate", apiChannel -> apiChannel.createAggregate(slot, randomBytes32, Optional.empty()), BeaconNodeRequestLabels.CREATE_AGGREGATE_METHOD, - Optional.of( - new ObjectAndMetaData<>( - attestation, SPEC.atSlot(slot).getMilestone(), false, false, false))), + Optional.of(attestation)), getArguments( "createSyncCommitteeContribution", apiChannel -> apiChannel.createSyncCommitteeContribution(slot, 0, randomBytes32), diff --git a/validator/remote/src/test/java/tech/pegasys/teku/validator/remote/RemoteValidatorApiHandlerTest.java b/validator/remote/src/test/java/tech/pegasys/teku/validator/remote/RemoteValidatorApiHandlerTest.java index bfb5e2167ae..69172bc95c7 100644 --- a/validator/remote/src/test/java/tech/pegasys/teku/validator/remote/RemoteValidatorApiHandlerTest.java +++ b/validator/remote/src/test/java/tech/pegasys/teku/validator/remote/RemoteValidatorApiHandlerTest.java @@ -78,7 +78,6 @@ import tech.pegasys.teku.spec.datastructures.builder.SignedValidatorRegistration; import tech.pegasys.teku.spec.datastructures.genesis.GenesisData; import tech.pegasys.teku.spec.datastructures.metadata.BlockContainerAndMetaData; -import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.AggregateAndProof; import tech.pegasys.teku.spec.datastructures.operations.Attestation; import tech.pegasys.teku.spec.datastructures.operations.AttestationData; @@ -622,7 +621,7 @@ public void createAggregate_WhenNotFound_ReturnsEmpty() { when(apiClient.createAggregate(eq(slot), eq(attHashTreeRoot))).thenReturn(Optional.empty()); - SafeFuture>> future = + SafeFuture> future = apiHandler.createAggregate(slot, attHashTreeRoot, Optional.of(ONE)); assertThat(unwrapToOptional(future)).isEmpty(); @@ -640,10 +639,10 @@ public void createAggregate_WhenFound_ReturnsAttestation() { when(apiClient.createAggregate(eq(slot), eq(attHashTreeRoot))) .thenReturn(Optional.of(schemaAttestation)); - SafeFuture>> future = + SafeFuture> future = apiHandler.createAggregate(slot, attHashTreeRoot, Optional.of(ONE)); - assertThatSszData(unwrapToValue(future).getData()).isEqualByAllMeansTo(attestation); + assertThatSszData(unwrapToValue(future)).isEqualByAllMeansTo(attestation); } @Test