From 49241cd5f8fd2576f669ba4084e42fc409c6110e Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Wed, 10 Jul 2024 17:21:10 +0200 Subject: [PATCH 01/18] add retrive attestations and metadata --- .../main/java/tech/pegasys/teku/api/NodeDataProvider.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/data/provider/src/main/java/tech/pegasys/teku/api/NodeDataProvider.java b/data/provider/src/main/java/tech/pegasys/teku/api/NodeDataProvider.java index 220807bb76d..f6f4336904a 100644 --- a/data/provider/src/main/java/tech/pegasys/teku/api/NodeDataProvider.java +++ b/data/provider/src/main/java/tech/pegasys/teku/api/NodeDataProvider.java @@ -113,12 +113,13 @@ public ObjectAndMetaData> getAttestationsAndMetaData( private ObjectAndMetaData> lookupMetaData( final List attestations, final Optional maybeSlot) { - final UInt64 slot = getSlot(attestations, maybeSlot); + final UInt64 slot = getSlotForAttestations(attestations, maybeSlot); return new ObjectAndMetaData<>( attestations, spec.atSlot(slot).getMilestone(), false, false, false); } - private UInt64 getSlot(final List attestations, final Optional maybeSlot) { + private UInt64 getSlotForAttestations( + final List attestations, final Optional maybeSlot) { return maybeSlot.orElseGet( () -> attestations.stream() From 31986d33fec8d08f7ddadf6ddf7feab6273964c5 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Wed, 10 Jul 2024 17:26:15 +0200 Subject: [PATCH 02/18] Add GET attestations from aggregation pool V2 --- .../_eth_v2_beacon_pool_attestations.json | 59 +++++++++ .../schema/getPoolAttestationsV2Response.json | 31 +++++ .../JsonTypeDefinitionBeaconRestApi.java | 2 + .../handlers/v1/beacon/GetAttestations.java | 1 - .../handlers/v2/beacon/GetAttestationsV2.java | 116 +++++++++++++++++ .../v1/beacon/GetAttestationsTest.java | 2 +- .../v2/beacon/GetAttestationsV2Test.java | 120 ++++++++++++++++++ .../v2/beacon/getAttestationsAltair.json | 39 ++++++ .../v2/beacon/getAttestationsBellatrix.json | 39 ++++++ .../v2/beacon/getAttestationsCapella.json | 39 ++++++ .../v2/beacon/getAttestationsDeneb.json | 39 ++++++ .../v2/beacon/getAttestationsElectra.json | 41 ++++++ .../v2/beacon/getAttestationsPhase0.json | 39 ++++++ .../teku/spec/util/DataStructureUtil.java | 10 ++ 14 files changed, 575 insertions(+), 2 deletions(-) create mode 100644 data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_pool_attestations.json create mode 100644 data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/getPoolAttestationsV2Response.json create mode 100644 data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java create mode 100644 data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java create mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsAltair.json create mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBellatrix.json create mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCapella.json create mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDeneb.json create mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsElectra.json create mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsPhase0.json diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_pool_attestations.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_pool_attestations.json new file mode 100644 index 00000000000..391a425ba93 --- /dev/null +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_pool_attestations.json @@ -0,0 +1,59 @@ +{ + "get" : { + "tags" : [ "Beacon" ], + "operationId" : "getPoolAttestationsV2", + "summary" : "Get Attestations from operations pool", + "description" : "Retrieves attestations known by the node but not necessarily incorporated into any block.", + "parameters" : [ { + "name" : "slot", + "in" : "query", + "schema" : { + "type" : "string", + "description" : "`UInt64` Slot to query in the canonical chain.", + "example" : "1", + "format" : "uint64" + } + }, { + "name" : "committee_index", + "in" : "query", + "schema" : { + "type" : "string", + "description" : "`uint64` Committee index to query.", + "example" : "1", + "format" : "uint64" + } + } ], + "responses" : { + "200" : { + "description" : "Request successful", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/getPoolAttestationsV2Response" + } + } + } + }, + "400" : { + "description" : "The request could not be processed, check the response for more information.", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/HttpErrorResponse" + } + } + } + }, + "500" : { + "description" : "Internal server error", + "content" : { + "application/json" : { + "schema" : { + "$ref" : "#/components/schemas/HttpErrorResponse" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/getPoolAttestationsV2Response.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/getPoolAttestationsV2Response.json new file mode 100644 index 00000000000..25211cc8e07 --- /dev/null +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/getPoolAttestationsV2Response.json @@ -0,0 +1,31 @@ +{ + "title" : "getPoolAttestationsV2Response", + "type" : "object", + "required" : [ "version", "data" ], + "properties" : { + "version" : { + "type" : "string", + "enum" : [ "phase0", "altair", "bellatrix", "capella", "deneb", "electra" ] + }, + "data" : { + "type" : "array", + "items" : { + "title" : "Attestation", + "type" : "object", + "oneOf" : [ { + "$ref" : "#/components/schemas/AttestationPhase0" + }, { + "$ref" : "#/components/schemas/AttestationPhase0" + }, { + "$ref" : "#/components/schemas/AttestationPhase0" + }, { + "$ref" : "#/components/schemas/AttestationPhase0" + }, { + "$ref" : "#/components/schemas/AttestationPhase0" + }, { + "$ref" : "#/components/schemas/AttestationElectra" + } ] + } + } + } +} \ No newline at end of file diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/JsonTypeDefinitionBeaconRestApi.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/JsonTypeDefinitionBeaconRestApi.java index bbf8abaf299..ab073602f7e 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/JsonTypeDefinitionBeaconRestApi.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/JsonTypeDefinitionBeaconRestApi.java @@ -101,6 +101,7 @@ import tech.pegasys.teku.beaconrestapi.handlers.v1.validator.PostSyncCommitteeSubscriptions; import tech.pegasys.teku.beaconrestapi.handlers.v1.validator.PostSyncDuties; import tech.pegasys.teku.beaconrestapi.handlers.v1.validator.PostValidatorLiveness; +import tech.pegasys.teku.beaconrestapi.handlers.v2.beacon.GetAttestationsV2; import tech.pegasys.teku.beaconrestapi.handlers.v2.beacon.GetAttesterSlashingsV2; import tech.pegasys.teku.beaconrestapi.handlers.v2.beacon.GetBlock; import tech.pegasys.teku.beaconrestapi.handlers.v2.beacon.GetBlockAttestationsV2; @@ -236,6 +237,7 @@ private static RestApi create( .endpoint(new GetBlockAttestations(dataProvider, spec)) .endpoint(new GetBlockAttestationsV2(dataProvider, schemaCache)) .endpoint(new GetAttestations(dataProvider, spec)) + .endpoint(new GetAttestationsV2(dataProvider, schemaCache)) .endpoint(new PostAttestation(dataProvider, schemaCache)) .endpoint(new GetAttesterSlashings(dataProvider, spec)) .endpoint(new GetAttesterSlashingsV2(dataProvider, schemaCache)) diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestations.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestations.java index 199897ea156..197cdd4a7df 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestations.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestations.java @@ -70,7 +70,6 @@ public void handleRequest(final RestApiRequest request) throws JsonProcessingExc request.respondOk(nodeDataProvider.getAttestations(slot, committeeIndex)); } - // TODO EIP-7549 handle Electra attestations private static SerializableTypeDefinition> getResponseType(final Spec spec) { return SerializableTypeDefinition.>object() .name("GetPoolAttestationsResponse") diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java new file mode 100644 index 00000000000..c8ad0a35cb3 --- /dev/null +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java @@ -0,0 +1,116 @@ +/* + * Copyright Consensys Software Inc., 2024 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package tech.pegasys.teku.beaconrestapi.handlers.v2.beacon; + +import static tech.pegasys.teku.beaconrestapi.BeaconRestApiTypes.COMMITTEE_INDEX_PARAMETER; +import static tech.pegasys.teku.beaconrestapi.BeaconRestApiTypes.SLOT_PARAMETER; +import static tech.pegasys.teku.beaconrestapi.handlers.v1.beacon.MilestoneDependentTypesUtil.getMultipleSchemaDefinitionFromMilestone; +import static tech.pegasys.teku.ethereum.json.types.EthereumTypes.MILESTONE_TYPE; +import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_OK; +import static tech.pegasys.teku.infrastructure.http.RestApiConstants.CACHE_NONE; +import static tech.pegasys.teku.infrastructure.http.RestApiConstants.SLOT_QUERY_DESCRIPTION; +import static tech.pegasys.teku.infrastructure.http.RestApiConstants.TAG_BEACON; +import static tech.pegasys.teku.infrastructure.json.types.SerializableTypeDefinition.listOf; + +import com.fasterxml.jackson.core.JsonProcessingException; +import io.javalin.http.Header; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; +import tech.pegasys.teku.api.DataProvider; +import tech.pegasys.teku.api.NodeDataProvider; +import tech.pegasys.teku.beaconrestapi.handlers.v1.beacon.MilestoneDependentTypesUtil; +import tech.pegasys.teku.infrastructure.json.types.SerializableTypeDefinition; +import tech.pegasys.teku.infrastructure.restapi.endpoints.EndpointMetadata; +import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiEndpoint; +import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest; +import tech.pegasys.teku.infrastructure.unsigned.UInt64; +import tech.pegasys.teku.spec.SpecMilestone; +import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; +import tech.pegasys.teku.spec.datastructures.operations.Attestation; +import tech.pegasys.teku.spec.schemas.SchemaDefinitionCache; +import tech.pegasys.teku.spec.schemas.SchemaDefinitions; + +public class GetAttestationsV2 extends RestApiEndpoint { + + public static final String ROUTE = "/eth/v2/beacon/pool/attestations"; + + private final NodeDataProvider nodeDataProvider; + + public GetAttestationsV2( + final DataProvider dataProvider, final SchemaDefinitionCache schemaDefinitionCache) { + + this(dataProvider.getNodeDataProvider(), schemaDefinitionCache); + } + + public GetAttestationsV2( + final NodeDataProvider nodeDataProvider, final SchemaDefinitionCache schemaDefinitionCache) { + super( + EndpointMetadata.get(ROUTE) + .operationId("getPoolAttestationsV2") + .summary("Get Attestations from operations pool") + .description( + "Retrieves attestations known by the node but not necessarily incorporated into any block.") + .tags(TAG_BEACON) + .queryParam(SLOT_PARAMETER.withDescription(SLOT_QUERY_DESCRIPTION)) + .queryParam(COMMITTEE_INDEX_PARAMETER) + .response(SC_OK, "Request successful", getResponseType(schemaDefinitionCache)) + .build()); + this.nodeDataProvider = nodeDataProvider; + } + + @Override + public void handleRequest(final RestApiRequest request) throws JsonProcessingException { + request.header(Header.CACHE_CONTROL, CACHE_NONE); + final Optional slot = + request.getOptionalQueryParameter(SLOT_PARAMETER.withDescription(SLOT_QUERY_DESCRIPTION)); + final Optional committeeIndex = + request.getOptionalQueryParameter(COMMITTEE_INDEX_PARAMETER); + + request.respondOk(nodeDataProvider.getAttestationsAndMetaData(slot, committeeIndex)); + } + + private static SerializableTypeDefinition>> getResponseType( + final SchemaDefinitionCache schemaDefinitionCache) { + + final List> schemaGetters = + generateAttestationSchemaGetters(schemaDefinitionCache); + + final SerializableTypeDefinition attestationType = + getMultipleSchemaDefinitionFromMilestone( + schemaDefinitionCache, "Attestation", schemaGetters); + + return SerializableTypeDefinition.>>object() + .name("getPoolAttestationsV2Response") + .withField("version", MILESTONE_TYPE, ObjectAndMetaData::getMilestone) + .withField("data", listOf(attestationType), ObjectAndMetaData::getData) + .build(); + } + + private static List> + generateAttestationSchemaGetters(final SchemaDefinitionCache schemaDefinitionCache) { + final List> schemaGetterList = + new ArrayList<>(); + + schemaGetterList.add( + new MilestoneDependentTypesUtil.ConditionalSchemaGetter<>( + (attestation, milestone) -> + schemaDefinitionCache + .milestoneAtSlot(attestation.getData().getSlot()) + .equals(milestone), + SpecMilestone.PHASE0, + SchemaDefinitions::getAttestationSchema)); + return schemaGetterList; + } +} diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestationsTest.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestationsTest.java index b76aee76611..14d6e99e7b8 100644 --- a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestationsTest.java +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestationsTest.java @@ -81,7 +81,7 @@ void metadata_shouldHandle200() throws IOException { final String data = getResponseStringFromMetadata(handler, SC_OK, responseData); final String expected = Resources.toString( - Resources.getResource(GetAttestationsTest.class, "getAttestations.json"), UTF_8); + Resources.getResource(GetAttestationsTest.class, "getAttestationsPhase0.json"), UTF_8); assertThat(data).isEqualTo(expected); } } diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java new file mode 100644 index 00000000000..7be7af15432 --- /dev/null +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java @@ -0,0 +1,120 @@ +/* + * Copyright Consensys Software Inc., 2024 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + */ + +package tech.pegasys.teku.beaconrestapi.handlers.v2.beacon; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.assertj.core.api.AssertionsForClassTypes.assertThat; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.when; +import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_BAD_REQUEST; +import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_INTERNAL_SERVER_ERROR; +import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_OK; +import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.getResponseStringFromMetadata; +import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.verifyMetadataErrorResponse; +import static tech.pegasys.teku.spec.SpecMilestone.ELECTRA; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.google.common.io.Resources; +import java.io.IOException; +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestTemplate; +import tech.pegasys.teku.beaconrestapi.AbstractMigratedBeaconHandlerTest; +import tech.pegasys.teku.infrastructure.json.JsonTestUtil; +import tech.pegasys.teku.spec.SpecMilestone; +import tech.pegasys.teku.spec.TestSpecContext; +import tech.pegasys.teku.spec.TestSpecInvocationContextProvider; +import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; +import tech.pegasys.teku.spec.datastructures.operations.Attestation; +import tech.pegasys.teku.spec.schemas.SchemaDefinitionCache; +import tech.pegasys.teku.spec.util.DataStructureUtil; + +@TestSpecContext(allMilestones = true) +public class GetAttestationsV2Test extends AbstractMigratedBeaconHandlerTest { + + private SpecMilestone specMilestone; + + @BeforeEach + void setup(final TestSpecInvocationContextProvider.SpecContext specContext) { + spec = specContext.getSpec(); + dataStructureUtil = new DataStructureUtil(spec); + specMilestone = specContext.getSpecMilestone(); + setHandler(new GetAttestationsV2(nodeDataProvider, new SchemaDefinitionCache(spec))); + } + + @TestTemplate + public void shouldReturnAttestationsWhenFound() throws JsonProcessingException { + final List attestations = + List.of(dataStructureUtil.randomAttestation(), dataStructureUtil.randomAttestation()); + final ObjectAndMetaData> attestationsAndMetaData = + new ObjectAndMetaData<>( + attestations, spec.getGenesisSpec().getMilestone(), false, false, false); + when(nodeDataProvider.getAttestationsAndMetaData(any(), any())) + .thenReturn(attestationsAndMetaData); + + handler.handleRequest(request); + assertThat(request.getResponseCode()).isEqualTo(SC_OK); + assertThat(request.getResponseBody()).isEqualTo(attestationsAndMetaData); + } + + @TestTemplate + public void shouldReturnEmptyListWhenNoAttestations() throws JsonProcessingException { + final ObjectAndMetaData> attestationsAndMetaData = + new ObjectAndMetaData<>( + Collections.emptyList(), spec.getGenesisSpec().getMilestone(), false, false, false); + when(nodeDataProvider.getAttestationsAndMetaData(any(), any())) + .thenReturn(attestationsAndMetaData); + + handler.handleRequest(request); + assertThat(request.getResponseCode()).isEqualTo(SC_OK); + assertThat(request.getResponseBody()).isEqualTo(attestationsAndMetaData); + } + + @TestTemplate + void metadata_shouldHandle400() throws JsonProcessingException { + verifyMetadataErrorResponse(handler, SC_BAD_REQUEST); + } + + @TestTemplate + void metadata_shouldHandle500() throws JsonProcessingException { + verifyMetadataErrorResponse(handler, SC_INTERNAL_SERVER_ERROR); + } + + @TestTemplate + void metadata_shouldHandle200() throws Exception { + List attestations; + if (specMilestone.isGreaterThanOrEqualTo(ELECTRA)) { + attestations = + List.of( + dataStructureUtil.randomElectraAttestation(), + dataStructureUtil.randomElectraAttestation()); + } else { + attestations = + List.of(dataStructureUtil.randomAttestation(), dataStructureUtil.randomAttestation()); + } + final ObjectAndMetaData> responseData = withMetaData(attestations); + final String responseDataAsString = getResponseStringFromMetadata(handler, SC_OK, responseData); + final JsonNode responseDataAsJsonNode = JsonTestUtil.parseAsJsonNode(responseDataAsString); + final String expected = getExpectedResponseAsJson(specMilestone); + final JsonNode expectedAsJsonNode = JsonTestUtil.parseAsJsonNode(expected); + assertThat(responseDataAsJsonNode).isEqualTo(expectedAsJsonNode); + } + + private String getExpectedResponseAsJson(final SpecMilestone specMilestone) throws IOException { + final String fileName = String.format("getAttestations%s.json", specMilestone.name()); + return Resources.toString(Resources.getResource(GetAttestationsV2Test.class, fileName), UTF_8); + } +} diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsAltair.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsAltair.json new file mode 100644 index 00000000000..6d9afcc41d9 --- /dev/null +++ b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsAltair.json @@ -0,0 +1,39 @@ +{ + "version": "altair", + "data": [ + { + "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f01", + "data": { + "slot": "4665021361504678828", + "index": "4669978815449698508", + "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", + "source": { + "epoch": "542502839", + "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" + }, + "target": { + "epoch": "542887588", + "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" + } + }, + "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852" + }, + { + "aggregation_bits": "0xd837d68714980f385c05b1c4e60e08695d100bd93ba04e50555a513c03bd99ce5c71e4a2a5a91419669bc583aab06a4e8f5d03f406f837e1a1d5bbec09cef1d8d9e33e9b65986cb7c3a274160d8245732ae9bf069db0adc8c4b9550069bfba37b8831ae257e4435f9910b4f4833226fa4830001eab94dc4fb0c094ac3876f98df571f6287b2093a52d404dc4bc3ae98f220a5127f647a3ba73545715870cc3e15051d024ea5de67f28429fd3139d978cc4aec10f360ef8e1f2207665a62887850b6ab8094cde4d7683e37ba631c8dc6e8ea826e6d12d1bf0962970755d49f8451035b8e305c6352b7de6753e459f404b760689dd4f53dd9ff6b0d221849b10aa01", + "data": { + "slot": "4603879456717562315", + "index": "4602226973500878187", + "beacon_block_root": "0x6b0ac13f8a279ad3abec11bed1a49214f6e7af79b643595df6a38706b338e93b", + "source": { + "epoch": "534615487", + "root": "0x45c8cc3f4a90db49c16643672a93697ae9e1b15549b207e99aa10076fe767a26" + }, + "target": { + "epoch": "535000236", + "root": "0xb88ea93f0a5617e780f8ae6b1fc8e4480ff4abc18f66fc45ada895271cbcc666" + } + }, + "signature": "0xb8f4f7eb7f1ff3eb3923e6bf36b3a0865c80f47fb8e5dbe8830751f66bd8a06a3a1e06b7b2dec66556b532721018ce940c982953c8c6176125c7dd2ba1e8cb944e10e4a14905f7135a477810872518cbac085dfc69c1759d64dab5e225a5f16c" + } + ] +} \ No newline at end of file diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBellatrix.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBellatrix.json new file mode 100644 index 00000000000..1ab4e70db42 --- /dev/null +++ b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBellatrix.json @@ -0,0 +1,39 @@ +{ + "version": "bellatrix", + "data": [ + { + "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f01", + "data": { + "slot": "4665021361504678828", + "index": "4669978815449698508", + "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", + "source": { + "epoch": "542502839", + "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" + }, + "target": { + "epoch": "542887588", + "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" + } + }, + "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852" + }, + { + "aggregation_bits": "0xd837d68714980f385c05b1c4e60e08695d100bd93ba04e50555a513c03bd99ce5c71e4a2a5a91419669bc583aab06a4e8f5d03f406f837e1a1d5bbec09cef1d8d9e33e9b65986cb7c3a274160d8245732ae9bf069db0adc8c4b9550069bfba37b8831ae257e4435f9910b4f4833226fa4830001eab94dc4fb0c094ac3876f98df571f6287b2093a52d404dc4bc3ae98f220a5127f647a3ba73545715870cc3e15051d024ea5de67f28429fd3139d978cc4aec10f360ef8e1f2207665a62887850b6ab8094cde4d7683e37ba631c8dc6e8ea826e6d12d1bf0962970755d49f8451035b8e305c6352b7de6753e459f404b760689dd4f53dd9ff6b0d221849b10aa01", + "data": { + "slot": "4603879456717562315", + "index": "4602226973500878187", + "beacon_block_root": "0x6b0ac13f8a279ad3abec11bed1a49214f6e7af79b643595df6a38706b338e93b", + "source": { + "epoch": "534615487", + "root": "0x45c8cc3f4a90db49c16643672a93697ae9e1b15549b207e99aa10076fe767a26" + }, + "target": { + "epoch": "535000236", + "root": "0xb88ea93f0a5617e780f8ae6b1fc8e4480ff4abc18f66fc45ada895271cbcc666" + } + }, + "signature": "0xb8f4f7eb7f1ff3eb3923e6bf36b3a0865c80f47fb8e5dbe8830751f66bd8a06a3a1e06b7b2dec66556b532721018ce940c982953c8c6176125c7dd2ba1e8cb944e10e4a14905f7135a477810872518cbac085dfc69c1759d64dab5e225a5f16c" + } + ] +} \ No newline at end of file diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCapella.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCapella.json new file mode 100644 index 00000000000..f32545e323d --- /dev/null +++ b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCapella.json @@ -0,0 +1,39 @@ +{ + "version": "capella", + "data": [ + { + "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f01", + "data": { + "slot": "4665021361504678828", + "index": "4669978815449698508", + "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", + "source": { + "epoch": "542502839", + "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" + }, + "target": { + "epoch": "542887588", + "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" + } + }, + "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852" + }, + { + "aggregation_bits": "0xd837d68714980f385c05b1c4e60e08695d100bd93ba04e50555a513c03bd99ce5c71e4a2a5a91419669bc583aab06a4e8f5d03f406f837e1a1d5bbec09cef1d8d9e33e9b65986cb7c3a274160d8245732ae9bf069db0adc8c4b9550069bfba37b8831ae257e4435f9910b4f4833226fa4830001eab94dc4fb0c094ac3876f98df571f6287b2093a52d404dc4bc3ae98f220a5127f647a3ba73545715870cc3e15051d024ea5de67f28429fd3139d978cc4aec10f360ef8e1f2207665a62887850b6ab8094cde4d7683e37ba631c8dc6e8ea826e6d12d1bf0962970755d49f8451035b8e305c6352b7de6753e459f404b760689dd4f53dd9ff6b0d221849b10aa01", + "data": { + "slot": "4603879456717562315", + "index": "4602226973500878187", + "beacon_block_root": "0x6b0ac13f8a279ad3abec11bed1a49214f6e7af79b643595df6a38706b338e93b", + "source": { + "epoch": "534615487", + "root": "0x45c8cc3f4a90db49c16643672a93697ae9e1b15549b207e99aa10076fe767a26" + }, + "target": { + "epoch": "535000236", + "root": "0xb88ea93f0a5617e780f8ae6b1fc8e4480ff4abc18f66fc45ada895271cbcc666" + } + }, + "signature": "0xb8f4f7eb7f1ff3eb3923e6bf36b3a0865c80f47fb8e5dbe8830751f66bd8a06a3a1e06b7b2dec66556b532721018ce940c982953c8c6176125c7dd2ba1e8cb944e10e4a14905f7135a477810872518cbac085dfc69c1759d64dab5e225a5f16c" + } + ] +} \ No newline at end of file diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDeneb.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDeneb.json new file mode 100644 index 00000000000..852cfe1aeca --- /dev/null +++ b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDeneb.json @@ -0,0 +1,39 @@ +{ + "version": "deneb", + "data": [ + { + "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f01", + "data": { + "slot": "4665021361504678828", + "index": "4669978815449698508", + "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", + "source": { + "epoch": "542502839", + "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" + }, + "target": { + "epoch": "542887588", + "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" + } + }, + "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852" + }, + { + "aggregation_bits": "0xd837d68714980f385c05b1c4e60e08695d100bd93ba04e50555a513c03bd99ce5c71e4a2a5a91419669bc583aab06a4e8f5d03f406f837e1a1d5bbec09cef1d8d9e33e9b65986cb7c3a274160d8245732ae9bf069db0adc8c4b9550069bfba37b8831ae257e4435f9910b4f4833226fa4830001eab94dc4fb0c094ac3876f98df571f6287b2093a52d404dc4bc3ae98f220a5127f647a3ba73545715870cc3e15051d024ea5de67f28429fd3139d978cc4aec10f360ef8e1f2207665a62887850b6ab8094cde4d7683e37ba631c8dc6e8ea826e6d12d1bf0962970755d49f8451035b8e305c6352b7de6753e459f404b760689dd4f53dd9ff6b0d221849b10aa01", + "data": { + "slot": "4603879456717562315", + "index": "4602226973500878187", + "beacon_block_root": "0x6b0ac13f8a279ad3abec11bed1a49214f6e7af79b643595df6a38706b338e93b", + "source": { + "epoch": "534615487", + "root": "0x45c8cc3f4a90db49c16643672a93697ae9e1b15549b207e99aa10076fe767a26" + }, + "target": { + "epoch": "535000236", + "root": "0xb88ea93f0a5617e780f8ae6b1fc8e4480ff4abc18f66fc45ada895271cbcc666" + } + }, + "signature": "0xb8f4f7eb7f1ff3eb3923e6bf36b3a0865c80f47fb8e5dbe8830751f66bd8a06a3a1e06b7b2dec66556b532721018ce940c982953c8c6176125c7dd2ba1e8cb944e10e4a14905f7135a477810872518cbac085dfc69c1759d64dab5e225a5f16c" + } + ] +} \ No newline at end of file diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsElectra.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsElectra.json new file mode 100644 index 00000000000..784409b894b --- /dev/null +++ b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsElectra.json @@ -0,0 +1,41 @@ +{ + "version": "electra", + "data": [ + { + "aggregation_bits": "0x9827585d426605f0a23b9e5655df2c9b501c6282a5f6fae2fd7d5e0bdb68956e5b396afdfa9429f71e6e46ce94b24c59a4ca399550d1eccd9132ddc8c623328fd26ffad9a0d317fa12c74fe24eaaed6af7c42ab575d7d1d67fc4c3f1a42ebfba009b6ffc09671e81630d44851d5881782c1e25b9bb224b6f3e326221dfe891a480eb8fb6b93496a3836eb84d14bdd14706b06561622086cc5b5599be5c85252c2fb381141967c86c0aac570904117a3ae74d23572cdacff735639f1be45bcb7361cfbaf2970c5a0ec22004c4bfcfa8f75398984d07612c95523f1f39d17ed2b606cdd95e2ce4f41553918ac38030fbd280fc33c4c12a96052807f2e0cbbe1dcbac4a17e4c8a6041077468bb47e4c556e28153f8eff2c061036fb2dee285a45df386ac52ff9f4338aa06e169d04880eac988fca2453ae6f4fd72ee2e298aa82319001e10d82a03c58fbf9015fa2cb58f20f29c18c92fe321e9b9bcb061767b1054cbf99d3f34a82a63c4b43e00f928632ea40e7846ce450781b307841950923059e7d45b4b142c0e3dbcf5c6ae6733a2131ac6b9d66294b9823ea4e321c3e30c4b2f4f1660816aa665d8bdebe4a7ff38c772b1f9d2ebca10af70e90314668d75881b704d819dd7c4073599477d281bcb9e45842cb1f4b5942854ca83e2318285b24420bf0e53ce2d713ad1ec83f5336e1a4cf8d08b5bde5314e2566093d2793a8430d666e8995f5e71991e930fc45abfc67a7de0e7fcd27adb94334377ea703e3c7f39e0a92f5fb0c28e0e4ca92218e6fae157a74f97bf49ed75921a55d87fb97e04d879d4928c348fa2e79db213918f98f1089854dfac64845051f78e647101eb5c5dd339d7bd3f156fd22bb544e59adc6074d583814284a40c7608b5d6429ae02fdfc9cd873554b9f7c0a81f6b69f856ed66075c94877e2a6d7a298a688d2329ca50d6b4585f005e62ab163ef5603f26f998ff1cd48ee6cc509a2d8b497c8a533344fde12a300e4319bf5b54aaacff6bc222f2fcf3d20ed2cdcc54e6a3040f3fec9abd95dfafe5aa0383cbd3f7b5c71dba07422b717c5e65db1a95b2691b8ebafcdebbfb8febe622f49c1b48affd7a7c24693592ebe69834d65c74fa2cf025e36115dc345f7c16da37659fb58646f8f98819ff70c38c825b75ae3ef61f9b3f127c4b294dc04340c11e5f03fb370f445028488354017392d09e17fc2bbe60d76b99acdda94a846d431ece3b6311e55e95836c768aa39e6485d0b4cd6ae5f5e9c8fc4ec8359505edb76e622ae2ea4f42e6b9424cdd5953109eeba188718f4b17eda005f3c87c52070f0e97972e0ba48adbae11045262e27ee3f1f17ea1bca8888f58cc4a1a830bc00935cbe8982563daeb1e60ad9e373bc2a980b7032bf3013369d5d23d3763e499cb3950610aff05a4df9a8752c1b4b0eb3e94a97f34ae7896201", + "data": { + "slot": "4669978815449698508", + "index": "4668326327938047084", + "beacon_block_root": "0x6fdfab408c56b6105a76eff5c0435d09fc6ed7a938e7f946cf74fbbb9416428f", + "source": { + "epoch": "542310465", + "root": "0x499db7404cbff78670f0209f1932346fef68d985cb55a8d27472742bdf54d379" + }, + "target": { + "epoch": "542695214", + "root": "0x1f86d83f0bf91cc0d7e07410828140e0dddbb331dc20b6743f9f79e549b50b11" + } + }, + "signature": "0xb3a22ab9ec46aec35a9dacfb9036375ea1528041a926cb9d2d315ab964e82be5d6990e7fef2343f2dbb4c2b7dd74687f11144beaeb5758ebe349762b4dbde5e67bbc8d89a95a803c6610631d178249917cbf0d8b11bd8740f3cb767c843aa88c", + "committee_bits": "0x04" + }, + { + "aggregation_bits": "0x068f248a19e0065e3d86f2db7b742100545602fae9889b1427720965c55584c5fec8484375d473375bc802f420147d851c20a849feb07b9b4ffcdc2119fb4bfdae17b9116c38549a914d5848808a3017e8fb82decc0caf21a51cb028d23c45b03509655d2510caf3d6dd77fa99d1c4f2e89b4f55f7378df63d9d4acb4866a16291277bb2b08224673fe90ed61405adcad442bcaa3d55606d42e6e01b60500ced943da0e81a8d532c5e8848f6b80506bdf703f1f36c90ee9fe87b49ef271cb8692d432216f40c1ebfacb950fa168ffa266c7415e83d2d87206886f536ed0ce246217b033699effe833076c5e2e5f45692b613e8719b49d145c0cfaa3da4c66f3773fc7346bf69f2d47922037212e51547d8da220fb10ce0997113ffaadd6262248af50b2ff495359ac3c3965b5a1a673fcb23ecdd446a837d866a60c1b9223af42be00c8edf99568188fd32416e8e6d8ff154a6c1e2105fc004a0e0a50a09057a72fc5c8bb1eda79b1169f97bd1db1d485f5de88e9db2939f2e8ecca1a640ab299f5ef5811e153041c28fbd13982a537b55af8033ca2fc33bbcb817db4383793b76564accccaeaed6ac2d21559088cb84e8fe2a031cfa9ebeabe9d33149ca53d79b20712a4b262d3233cce7d722cbd58be811f4fcf1d053241ad419bf599540dc90c52460ee54d0b808b1f65a8c88f10ffd3af40773c4f74d7c82949648598e7880a1e19e68f4eff92e4df5bacb39c6388519fd2ebaa26879ec1f5251e2607a82229733eb13ae666ce88fec52281b2ff5fd609585d49c734d3afb69bf79a666cbda6d863e6780900480f8995c73fc6eb588f5b4adf096bc06cc83d0db27b8d72b237dcc2a7af1bf75777dde87d6e57ae756dcaa99d3f42f09d32a0cef128dc73332136b2a5e1541a2bf6d660623e8c09d5034dbab8fc6afaaee97be2bad3e964b44456be3873820bb4a72948c849d4577474fa207a2fcc25a9a3edf64aa70f25b578a7bceab054dccdf1a26c38fa2ac39c7352ace5683b4b51ae4a8e9c275be4b9a4f78c5a2f7dbe2e256841907fd21d5d9352abcafb00f2e08b95f2bf4dfa11ca5cd53ca17d188b8c7c2e988c40e8527e3de08e5a519dc47f92d126336fa53b423914c9142a58b4353c56dfa27a26d97278c4468cfe1803c5c400198baeb6e5b2a4483cfbd7146ddcc92b9471663ba1292f9755db6463f53887c5a21386417cc0f8e31e0d0c347cbb525d21b6d1f95c6674efb7861690e61dd6e9bf1119cb3429175bd37fca4c2f5fb6b20234f63a6ae6ae56e32df7b1dc622b13465cc4cf313d68933dfa38baf65d4458b57d83e84f1e4fc2e0fd654f4d12476917a50830be5635659f33db11924834e6a8e63fc36bef07e8f7c122f24cd752dcbd7bb53fe23bdf2578743c3b1e93a94710baad858de9feb9293586c410547ee5445fbb05a6201", + "data": { + "slot": "4592312065610838826", + "index": "4597269519555858506", + "beacon_block_root": "0x58e9c63feadbba8eb6a9aa92fd1b7e47efe4b0e7ff7a30a3c822443ed8d731b1", + "source": { + "epoch": "534038364", + "root": "0xcbafa33faaa1f62b763b1697f350f91515f7aa53462f2500db29d9eff71c7ef1" + }, + "target": { + "epoch": "534423113", + "root": "0xa56daf3f6a0a38a28bb547404c3fd07b08f1ac2fd99dd38b7f27525f425b0fdc" + } + }, + "signature": "0x8f2f048d2061f5e290f2fcbe3ba5ab2d85fb62db534e5e49d985475e3ac39e317db50af5dbc2fd94c81284c10c3ff5930b21b375837f13de2cb209aa8804af037f75dde5900da65d98d717bdee5549f3de2f544b576e860a001fb69b5ac82e5f", + "committee_bits": "0x00" + } + ] +} \ No newline at end of file diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsPhase0.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsPhase0.json new file mode 100644 index 00000000000..51f28386580 --- /dev/null +++ b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsPhase0.json @@ -0,0 +1,39 @@ +{ + "version": "phase0", + "data": [ + { + "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f01", + "data": { + "slot": "4665021361504678828", + "index": "4669978815449698508", + "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", + "source": { + "epoch": "542502839", + "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" + }, + "target": { + "epoch": "542887588", + "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" + } + }, + "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852" + }, + { + "aggregation_bits": "0xd837d68714980f385c05b1c4e60e08695d100bd93ba04e50555a513c03bd99ce5c71e4a2a5a91419669bc583aab06a4e8f5d03f406f837e1a1d5bbec09cef1d8d9e33e9b65986cb7c3a274160d8245732ae9bf069db0adc8c4b9550069bfba37b8831ae257e4435f9910b4f4833226fa4830001eab94dc4fb0c094ac3876f98df571f6287b2093a52d404dc4bc3ae98f220a5127f647a3ba73545715870cc3e15051d024ea5de67f28429fd3139d978cc4aec10f360ef8e1f2207665a62887850b6ab8094cde4d7683e37ba631c8dc6e8ea826e6d12d1bf0962970755d49f8451035b8e305c6352b7de6753e459f404b760689dd4f53dd9ff6b0d221849b10aa01", + "data": { + "slot": "4603879456717562315", + "index": "4602226973500878187", + "beacon_block_root": "0x6b0ac13f8a279ad3abec11bed1a49214f6e7af79b643595df6a38706b338e93b", + "source": { + "epoch": "534615487", + "root": "0x45c8cc3f4a90db49c16643672a93697ae9e1b15549b207e99aa10076fe767a26" + }, + "target": { + "epoch": "535000236", + "root": "0xb88ea93f0a5617e780f8ae6b1fc8e4480ff4abc18f66fc45ada895271cbcc666" + } + }, + "signature": "0xb8f4f7eb7f1ff3eb3923e6bf36b3a0865c80f47fb8e5dbe8830751f66bd8a06a3a1e06b7b2dec66556b532721018ce940c982953c8c6176125c7dd2ba1e8cb944e10e4a14905f7135a477810872518cbac085dfc69c1759d64dab5e225a5f16c" + } + ] +} \ No newline at end of file diff --git a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java index 1e6ee19fefc..a43fac41fa1 100644 --- a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java +++ b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java @@ -813,6 +813,16 @@ public Attestation randomAttestation() { this::randomCommitteeBitvector); } + public Attestation randomElectraAttestation() { + return getElectraSchemaDefinitions(randomSlot()) + .getAttestationSchema() + .create( + randomBitlist(), + randomAttestationData(), + randomSignature(), + this::randomCommitteeBitvector); + } + public Attestation randomAttestation(final long slot) { return randomAttestation(UInt64.valueOf(slot)); } From 35b7bd2d50c5f0c9e4a4af31be8b349dd9c4ca54 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Wed, 10 Jul 2024 22:19:12 +0200 Subject: [PATCH 03/18] fix unit test --- .../beaconrestapi/handlers/v1/beacon/GetAttestationsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestationsTest.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestationsTest.java index 14d6e99e7b8..b76aee76611 100644 --- a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestationsTest.java +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestationsTest.java @@ -81,7 +81,7 @@ void metadata_shouldHandle200() throws IOException { final String data = getResponseStringFromMetadata(handler, SC_OK, responseData); final String expected = Resources.toString( - Resources.getResource(GetAttestationsTest.class, "getAttestationsPhase0.json"), UTF_8); + Resources.getResource(GetAttestationsTest.class, "getAttestations.json"), UTF_8); assertThat(data).isEqualTo(expected); } } From cd2783283763d085c40be075ce1fdf2bc5f00901 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Wed, 10 Jul 2024 22:39:12 +0200 Subject: [PATCH 04/18] rename json files --- .../{getAttestationsAltair.json => getAttestationsALTAIR.json} | 0 ...etAttestationsBellatrix.json => getAttestationsBELLATRIX.json} | 0 .../{getAttestationsCapella.json => getAttestationsCAPELLA.json} | 0 .../{getAttestationsDeneb.json => getAttestationsDENEB.json} | 0 .../{getAttestationsElectra.json => getAttestationsELECTRA.json} | 0 .../{getAttestationsPhase0.json => getAttestationsPHASE0.json} | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/{getAttestationsAltair.json => getAttestationsALTAIR.json} (100%) rename data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/{getAttestationsBellatrix.json => getAttestationsBELLATRIX.json} (100%) rename data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/{getAttestationsCapella.json => getAttestationsCAPELLA.json} (100%) rename data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/{getAttestationsDeneb.json => getAttestationsDENEB.json} (100%) rename data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/{getAttestationsElectra.json => getAttestationsELECTRA.json} (100%) rename data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/{getAttestationsPhase0.json => getAttestationsPHASE0.json} (100%) diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsAltair.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsALTAIR.json similarity index 100% rename from data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsAltair.json rename to data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsALTAIR.json diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBellatrix.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBELLATRIX.json similarity index 100% rename from data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBellatrix.json rename to data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBELLATRIX.json diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCapella.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCAPELLA.json similarity index 100% rename from data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCapella.json rename to data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCAPELLA.json diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDeneb.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDENEB.json similarity index 100% rename from data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDeneb.json rename to data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDENEB.json diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsElectra.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsELECTRA.json similarity index 100% rename from data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsElectra.json rename to data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsELECTRA.json diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsPhase0.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsPHASE0.json similarity index 100% rename from data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsPhase0.json rename to data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsPHASE0.json From 146cc3fff7071d61bd35de0695542c7ac3dca992 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 11 Jul 2024 16:56:52 +0200 Subject: [PATCH 05/18] remove duplicate schemas --- .../beacon/paths/_eth_v2_beacon_pool_attestations.json | 2 +- ...esponse.json => GetPoolAttestationsV2Response.json} | 10 +--------- .../handlers/v2/beacon/GetAttestationsV2.java | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) rename data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/{getPoolAttestationsV2Response.json => GetPoolAttestationsV2Response.json} (60%) diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_pool_attestations.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_pool_attestations.json index 391a425ba93..079710fb0c4 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_pool_attestations.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v2_beacon_pool_attestations.json @@ -29,7 +29,7 @@ "content" : { "application/json" : { "schema" : { - "$ref" : "#/components/schemas/getPoolAttestationsV2Response" + "$ref" : "#/components/schemas/GetPoolAttestationsV2Response" } } } diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/getPoolAttestationsV2Response.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/GetPoolAttestationsV2Response.json similarity index 60% rename from data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/getPoolAttestationsV2Response.json rename to data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/GetPoolAttestationsV2Response.json index 25211cc8e07..80756cfe9c9 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/getPoolAttestationsV2Response.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/schema/GetPoolAttestationsV2Response.json @@ -1,5 +1,5 @@ { - "title" : "getPoolAttestationsV2Response", + "title" : "GetPoolAttestationsV2Response", "type" : "object", "required" : [ "version", "data" ], "properties" : { @@ -14,14 +14,6 @@ "type" : "object", "oneOf" : [ { "$ref" : "#/components/schemas/AttestationPhase0" - }, { - "$ref" : "#/components/schemas/AttestationPhase0" - }, { - "$ref" : "#/components/schemas/AttestationPhase0" - }, { - "$ref" : "#/components/schemas/AttestationPhase0" - }, { - "$ref" : "#/components/schemas/AttestationPhase0" }, { "$ref" : "#/components/schemas/AttestationElectra" } ] diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java index c8ad0a35cb3..b749a40a767 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java @@ -92,7 +92,7 @@ private static SerializableTypeDefinition>> schemaDefinitionCache, "Attestation", schemaGetters); return SerializableTypeDefinition.>>object() - .name("getPoolAttestationsV2Response") + .name("GetPoolAttestationsV2Response") .withField("version", MILESTONE_TYPE, ObjectAndMetaData::getMilestone) .withField("data", listOf(attestationType), ObjectAndMetaData::getData) .build(); From 453adb3621d07a028c2ff8a24362ac417277ee97 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Fri, 12 Jul 2024 11:37:35 +0200 Subject: [PATCH 06/18] refactor tests --- .../v2/beacon/GetAttestationsV2Test.java | 15 ++----- .../v2/beacon/getAttestationsALTAIR.json | 39 ------------------ .../v2/beacon/getAttestationsBELLATRIX.json | 39 ------------------ .../v2/beacon/getAttestationsCAPELLA.json | 39 ------------------ .../v2/beacon/getAttestationsDENEB.json | 39 ------------------ .../v2/beacon/getAttestationsELECTRA.json | 40 +++++++++---------- .../teku/spec/util/DataStructureUtil.java | 10 ----- 7 files changed, 24 insertions(+), 197 deletions(-) delete mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsALTAIR.json delete mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBELLATRIX.json delete mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCAPELLA.json delete mode 100644 data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDENEB.json diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java index 7be7af15432..2d3b8b8c97a 100644 --- a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java @@ -23,6 +23,7 @@ import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.getResponseStringFromMetadata; import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.verifyMetadataErrorResponse; import static tech.pegasys.teku.spec.SpecMilestone.ELECTRA; +import static tech.pegasys.teku.spec.SpecMilestone.PHASE0; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; @@ -42,7 +43,7 @@ import tech.pegasys.teku.spec.schemas.SchemaDefinitionCache; import tech.pegasys.teku.spec.util.DataStructureUtil; -@TestSpecContext(allMilestones = true) +@TestSpecContext(milestone = {PHASE0, ELECTRA}) public class GetAttestationsV2Test extends AbstractMigratedBeaconHandlerTest { private SpecMilestone specMilestone; @@ -95,16 +96,8 @@ void metadata_shouldHandle500() throws JsonProcessingException { @TestTemplate void metadata_shouldHandle200() throws Exception { - List attestations; - if (specMilestone.isGreaterThanOrEqualTo(ELECTRA)) { - attestations = - List.of( - dataStructureUtil.randomElectraAttestation(), - dataStructureUtil.randomElectraAttestation()); - } else { - attestations = - List.of(dataStructureUtil.randomAttestation(), dataStructureUtil.randomAttestation()); - } + final List attestations = + List.of(dataStructureUtil.randomAttestation(), dataStructureUtil.randomAttestation()); final ObjectAndMetaData> responseData = withMetaData(attestations); final String responseDataAsString = getResponseStringFromMetadata(handler, SC_OK, responseData); final JsonNode responseDataAsJsonNode = JsonTestUtil.parseAsJsonNode(responseDataAsString); diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsALTAIR.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsALTAIR.json deleted file mode 100644 index 6d9afcc41d9..00000000000 --- a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsALTAIR.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "version": "altair", - "data": [ - { - "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f01", - "data": { - "slot": "4665021361504678828", - "index": "4669978815449698508", - "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", - "source": { - "epoch": "542502839", - "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" - }, - "target": { - "epoch": "542887588", - "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" - } - }, - "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852" - }, - { - "aggregation_bits": "0xd837d68714980f385c05b1c4e60e08695d100bd93ba04e50555a513c03bd99ce5c71e4a2a5a91419669bc583aab06a4e8f5d03f406f837e1a1d5bbec09cef1d8d9e33e9b65986cb7c3a274160d8245732ae9bf069db0adc8c4b9550069bfba37b8831ae257e4435f9910b4f4833226fa4830001eab94dc4fb0c094ac3876f98df571f6287b2093a52d404dc4bc3ae98f220a5127f647a3ba73545715870cc3e15051d024ea5de67f28429fd3139d978cc4aec10f360ef8e1f2207665a62887850b6ab8094cde4d7683e37ba631c8dc6e8ea826e6d12d1bf0962970755d49f8451035b8e305c6352b7de6753e459f404b760689dd4f53dd9ff6b0d221849b10aa01", - "data": { - "slot": "4603879456717562315", - "index": "4602226973500878187", - "beacon_block_root": "0x6b0ac13f8a279ad3abec11bed1a49214f6e7af79b643595df6a38706b338e93b", - "source": { - "epoch": "534615487", - "root": "0x45c8cc3f4a90db49c16643672a93697ae9e1b15549b207e99aa10076fe767a26" - }, - "target": { - "epoch": "535000236", - "root": "0xb88ea93f0a5617e780f8ae6b1fc8e4480ff4abc18f66fc45ada895271cbcc666" - } - }, - "signature": "0xb8f4f7eb7f1ff3eb3923e6bf36b3a0865c80f47fb8e5dbe8830751f66bd8a06a3a1e06b7b2dec66556b532721018ce940c982953c8c6176125c7dd2ba1e8cb944e10e4a14905f7135a477810872518cbac085dfc69c1759d64dab5e225a5f16c" - } - ] -} \ No newline at end of file diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBELLATRIX.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBELLATRIX.json deleted file mode 100644 index 1ab4e70db42..00000000000 --- a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsBELLATRIX.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "version": "bellatrix", - "data": [ - { - "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f01", - "data": { - "slot": "4665021361504678828", - "index": "4669978815449698508", - "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", - "source": { - "epoch": "542502839", - "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" - }, - "target": { - "epoch": "542887588", - "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" - } - }, - "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852" - }, - { - "aggregation_bits": "0xd837d68714980f385c05b1c4e60e08695d100bd93ba04e50555a513c03bd99ce5c71e4a2a5a91419669bc583aab06a4e8f5d03f406f837e1a1d5bbec09cef1d8d9e33e9b65986cb7c3a274160d8245732ae9bf069db0adc8c4b9550069bfba37b8831ae257e4435f9910b4f4833226fa4830001eab94dc4fb0c094ac3876f98df571f6287b2093a52d404dc4bc3ae98f220a5127f647a3ba73545715870cc3e15051d024ea5de67f28429fd3139d978cc4aec10f360ef8e1f2207665a62887850b6ab8094cde4d7683e37ba631c8dc6e8ea826e6d12d1bf0962970755d49f8451035b8e305c6352b7de6753e459f404b760689dd4f53dd9ff6b0d221849b10aa01", - "data": { - "slot": "4603879456717562315", - "index": "4602226973500878187", - "beacon_block_root": "0x6b0ac13f8a279ad3abec11bed1a49214f6e7af79b643595df6a38706b338e93b", - "source": { - "epoch": "534615487", - "root": "0x45c8cc3f4a90db49c16643672a93697ae9e1b15549b207e99aa10076fe767a26" - }, - "target": { - "epoch": "535000236", - "root": "0xb88ea93f0a5617e780f8ae6b1fc8e4480ff4abc18f66fc45ada895271cbcc666" - } - }, - "signature": "0xb8f4f7eb7f1ff3eb3923e6bf36b3a0865c80f47fb8e5dbe8830751f66bd8a06a3a1e06b7b2dec66556b532721018ce940c982953c8c6176125c7dd2ba1e8cb944e10e4a14905f7135a477810872518cbac085dfc69c1759d64dab5e225a5f16c" - } - ] -} \ No newline at end of file diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCAPELLA.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCAPELLA.json deleted file mode 100644 index f32545e323d..00000000000 --- a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsCAPELLA.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "version": "capella", - "data": [ - { - "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f01", - "data": { - "slot": "4665021361504678828", - "index": "4669978815449698508", - "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", - "source": { - "epoch": "542502839", - "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" - }, - "target": { - "epoch": "542887588", - "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" - } - }, - "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852" - }, - { - "aggregation_bits": "0xd837d68714980f385c05b1c4e60e08695d100bd93ba04e50555a513c03bd99ce5c71e4a2a5a91419669bc583aab06a4e8f5d03f406f837e1a1d5bbec09cef1d8d9e33e9b65986cb7c3a274160d8245732ae9bf069db0adc8c4b9550069bfba37b8831ae257e4435f9910b4f4833226fa4830001eab94dc4fb0c094ac3876f98df571f6287b2093a52d404dc4bc3ae98f220a5127f647a3ba73545715870cc3e15051d024ea5de67f28429fd3139d978cc4aec10f360ef8e1f2207665a62887850b6ab8094cde4d7683e37ba631c8dc6e8ea826e6d12d1bf0962970755d49f8451035b8e305c6352b7de6753e459f404b760689dd4f53dd9ff6b0d221849b10aa01", - "data": { - "slot": "4603879456717562315", - "index": "4602226973500878187", - "beacon_block_root": "0x6b0ac13f8a279ad3abec11bed1a49214f6e7af79b643595df6a38706b338e93b", - "source": { - "epoch": "534615487", - "root": "0x45c8cc3f4a90db49c16643672a93697ae9e1b15549b207e99aa10076fe767a26" - }, - "target": { - "epoch": "535000236", - "root": "0xb88ea93f0a5617e780f8ae6b1fc8e4480ff4abc18f66fc45ada895271cbcc666" - } - }, - "signature": "0xb8f4f7eb7f1ff3eb3923e6bf36b3a0865c80f47fb8e5dbe8830751f66bd8a06a3a1e06b7b2dec66556b532721018ce940c982953c8c6176125c7dd2ba1e8cb944e10e4a14905f7135a477810872518cbac085dfc69c1759d64dab5e225a5f16c" - } - ] -} \ No newline at end of file diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDENEB.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDENEB.json deleted file mode 100644 index 852cfe1aeca..00000000000 --- a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsDENEB.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "version": "deneb", - "data": [ - { - "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f01", - "data": { - "slot": "4665021361504678828", - "index": "4669978815449698508", - "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", - "source": { - "epoch": "542502839", - "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" - }, - "target": { - "epoch": "542887588", - "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" - } - }, - "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852" - }, - { - "aggregation_bits": "0xd837d68714980f385c05b1c4e60e08695d100bd93ba04e50555a513c03bd99ce5c71e4a2a5a91419669bc583aab06a4e8f5d03f406f837e1a1d5bbec09cef1d8d9e33e9b65986cb7c3a274160d8245732ae9bf069db0adc8c4b9550069bfba37b8831ae257e4435f9910b4f4833226fa4830001eab94dc4fb0c094ac3876f98df571f6287b2093a52d404dc4bc3ae98f220a5127f647a3ba73545715870cc3e15051d024ea5de67f28429fd3139d978cc4aec10f360ef8e1f2207665a62887850b6ab8094cde4d7683e37ba631c8dc6e8ea826e6d12d1bf0962970755d49f8451035b8e305c6352b7de6753e459f404b760689dd4f53dd9ff6b0d221849b10aa01", - "data": { - "slot": "4603879456717562315", - "index": "4602226973500878187", - "beacon_block_root": "0x6b0ac13f8a279ad3abec11bed1a49214f6e7af79b643595df6a38706b338e93b", - "source": { - "epoch": "534615487", - "root": "0x45c8cc3f4a90db49c16643672a93697ae9e1b15549b207e99aa10076fe767a26" - }, - "target": { - "epoch": "535000236", - "root": "0xb88ea93f0a5617e780f8ae6b1fc8e4480ff4abc18f66fc45ada895271cbcc666" - } - }, - "signature": "0xb8f4f7eb7f1ff3eb3923e6bf36b3a0865c80f47fb8e5dbe8830751f66bd8a06a3a1e06b7b2dec66556b532721018ce940c982953c8c6176125c7dd2ba1e8cb944e10e4a14905f7135a477810872518cbac085dfc69c1759d64dab5e225a5f16c" - } - ] -} \ No newline at end of file diff --git a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsELECTRA.json b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsELECTRA.json index 784409b894b..df4001d5efd 100644 --- a/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsELECTRA.json +++ b/data/beaconrestapi/src/test/resources/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/getAttestationsELECTRA.json @@ -2,40 +2,40 @@ "version": "electra", "data": [ { - "aggregation_bits": "0x9827585d426605f0a23b9e5655df2c9b501c6282a5f6fae2fd7d5e0bdb68956e5b396afdfa9429f71e6e46ce94b24c59a4ca399550d1eccd9132ddc8c623328fd26ffad9a0d317fa12c74fe24eaaed6af7c42ab575d7d1d67fc4c3f1a42ebfba009b6ffc09671e81630d44851d5881782c1e25b9bb224b6f3e326221dfe891a480eb8fb6b93496a3836eb84d14bdd14706b06561622086cc5b5599be5c85252c2fb381141967c86c0aac570904117a3ae74d23572cdacff735639f1be45bcb7361cfbaf2970c5a0ec22004c4bfcfa8f75398984d07612c95523f1f39d17ed2b606cdd95e2ce4f41553918ac38030fbd280fc33c4c12a96052807f2e0cbbe1dcbac4a17e4c8a6041077468bb47e4c556e28153f8eff2c061036fb2dee285a45df386ac52ff9f4338aa06e169d04880eac988fca2453ae6f4fd72ee2e298aa82319001e10d82a03c58fbf9015fa2cb58f20f29c18c92fe321e9b9bcb061767b1054cbf99d3f34a82a63c4b43e00f928632ea40e7846ce450781b307841950923059e7d45b4b142c0e3dbcf5c6ae6733a2131ac6b9d66294b9823ea4e321c3e30c4b2f4f1660816aa665d8bdebe4a7ff38c772b1f9d2ebca10af70e90314668d75881b704d819dd7c4073599477d281bcb9e45842cb1f4b5942854ca83e2318285b24420bf0e53ce2d713ad1ec83f5336e1a4cf8d08b5bde5314e2566093d2793a8430d666e8995f5e71991e930fc45abfc67a7de0e7fcd27adb94334377ea703e3c7f39e0a92f5fb0c28e0e4ca92218e6fae157a74f97bf49ed75921a55d87fb97e04d879d4928c348fa2e79db213918f98f1089854dfac64845051f78e647101eb5c5dd339d7bd3f156fd22bb544e59adc6074d583814284a40c7608b5d6429ae02fdfc9cd873554b9f7c0a81f6b69f856ed66075c94877e2a6d7a298a688d2329ca50d6b4585f005e62ab163ef5603f26f998ff1cd48ee6cc509a2d8b497c8a533344fde12a300e4319bf5b54aaacff6bc222f2fcf3d20ed2cdcc54e6a3040f3fec9abd95dfafe5aa0383cbd3f7b5c71dba07422b717c5e65db1a95b2691b8ebafcdebbfb8febe622f49c1b48affd7a7c24693592ebe69834d65c74fa2cf025e36115dc345f7c16da37659fb58646f8f98819ff70c38c825b75ae3ef61f9b3f127c4b294dc04340c11e5f03fb370f445028488354017392d09e17fc2bbe60d76b99acdda94a846d431ece3b6311e55e95836c768aa39e6485d0b4cd6ae5f5e9c8fc4ec8359505edb76e622ae2ea4f42e6b9424cdd5953109eeba188718f4b17eda005f3c87c52070f0e97972e0ba48adbae11045262e27ee3f1f17ea1bca8888f58cc4a1a830bc00935cbe8982563daeb1e60ad9e373bc2a980b7032bf3013369d5d23d3763e499cb3950610aff05a4df9a8752c1b4b0eb3e94a97f34ae7896201", + "aggregation_bits": "0x4a9278690f62e1a353f1abf2b9701e13e8cdf4d9ac6b032ba43b05b25f713540ce24f3192819e752fb091217ff34b68e934a06d316b6060696f8f24749574c4b3ac2e4ccb6914c434b09a81fff523e12acbe299fcdad715593298d72ca70e1ffc743ad7ce89587fbb4b4c57db7856b7082db70ebddcbebe264f886236df2dd51539e10d4dcd5950e6cea7c993d3e999a5589a4c71669ffb1390987e43a8c4790a70275364f96cbee34b0b5a9d1b3da4322ad12e07c81c6e6430d2528f19bb1727c3f63f414885bd97505283b0bb6773712096d5feb67c43d67f2fbf17bf796ed5080aece6b968d532d985ad2553daf31ad4022aa49d7a92ada719c9f93ab4b6f0d09f127c8d47b9ab80e95a2e72257013e933113029994778c23dfa313b689e08c58979148ac541159b8eb601eee74e985a3b5b9c2dfe0ce3145794d84647136865fabf5814e8a013e236e9b740a6c18229838f3022e1aa2afe5fe48caff6e1470e4458ebcbf152462dc300b07a3d0b102a29196b0a8d444871868408fe80e1dcecd216fe8022ea70326081e516c48bd1b8a18003322738642b189013c3ed8ad64185cf1a44cb1f6265cc40450b5caea7c29b135b5145b4f3c5f14bc76f27442d5a180909ec2e144be68711737211e8d70bda6502a88a4a6558d9c857d6028b1fdfdf2d7df9d2a415b8754d194d17b29d09444d786a0478e62141c31410eda02abcd05769473e5fa75496d49aad564d139af8efee156d8089a253f4cd49814ed34fa9346701d66738938cbc5d54ba2adeb11dbe76f828dec46b82a6ff51dcf17e49771a6d88ad61996a5552809f78746562eba9d7aa9d4525d969c662628b857133d024ead8205bd3f367f3523c6ee9ff9b1784f47de41a1c196a73b178fce869b445c9a1b872a83ba946f2ca41232cdea11c53b7652dcfe615e9b3f9f0153f706eeee404e88e8736b3712e8ab9da9c9b75e419a615c3c1d1357886f77c8eaebbf4501dc1fef854fc5cc7f2f071c0a7411eb78bc14b25307cc7e4bde334ee3df0c53d6159751e82248f280434e466712dfe33981e0171e67352cdd86838eff3acd6e05592e2d1e441ddae9450a144da5c7926ee673458a59bc98c9e4d68f8b04134cc24ffdc2034c4ac3b46d6dd98ecca28dcaa7857f0c3f73a0809ae3c5dd2205555fd7cc6444024869d4f6d7dfe043917660119433c76239b17cdc8fad6c92f3756d206d67800e4e2566a73b27bb7a51dac62bc8411cdab0c5920a821e8ae6bb7779afb69f53452ad0b33c60c41a2be2c3aa94d46e97ffb5b2ebd9adc99eab85d5a3a73d4935f7ea6867d8277040c49f3ac822a4c7c7d67aba4f45765a46fccb7f79c332ac708b58911dc000c49d54fe6137be87df7f364a94fa5642338b6eeaf4152f7410ba97b0169aad82a9c4dd2d353cc3a8f57aaa90b5335f325b3e6e01", "data": { - "slot": "4669978815449698508", - "index": "4668326327938047084", - "beacon_block_root": "0x6fdfab408c56b6105a76eff5c0435d09fc6ed7a938e7f946cf74fbbb9416428f", + "slot": "4665021361504678828", + "index": "4669978815449698508", + "beacon_block_root": "0x103ac9406cdc59b89027eb1c9e97f607dd5fdccfa8fb2da4eaeea9d25032add9", "source": { - "epoch": "542310465", - "root": "0x499db7404cbff78670f0209f1932346fef68d985cb55a8d27472742bdf54d379" + "epoch": "542502839", + "root": "0x8200a6402ca295554fb9562193cc71d60272d63beeaf2201fdf53e846e77f919" }, "target": { - "epoch": "542695214", - "root": "0x1f86d83f0bf91cc0d7e07410828140e0dddbb331dc20b6743f9f79e549b50b11" + "epoch": "542887588", + "root": "0x5cbeb140ec0ad7cb653388caecba483cf66bd817821ed18ca1f3b7f3b9b58a04" } }, - "signature": "0xb3a22ab9ec46aec35a9dacfb9036375ea1528041a926cb9d2d315ab964e82be5d6990e7fef2343f2dbb4c2b7dd74687f11144beaeb5758ebe349762b4dbde5e67bbc8d89a95a803c6610631d178249917cbf0d8b11bd8740f3cb767c843aa88c", - "committee_bits": "0x04" + "signature": "0xae401f767ab1917f925fe299ad51a57d52f7cc80deb1cc20fa2b3aa983e4e4d23056d79f01f3c97e29c8905da17e70e30c2a3f6bdd83dbc4ddf530e02e8f4d7ba22260e12e5f5fe7875b48e79660615b275597e87b2d33e076664b3da1737852", + "committee_bits": "0x08" }, { - "aggregation_bits": "0x068f248a19e0065e3d86f2db7b742100545602fae9889b1427720965c55584c5fec8484375d473375bc802f420147d851c20a849feb07b9b4ffcdc2119fb4bfdae17b9116c38549a914d5848808a3017e8fb82decc0caf21a51cb028d23c45b03509655d2510caf3d6dd77fa99d1c4f2e89b4f55f7378df63d9d4acb4866a16291277bb2b08224673fe90ed61405adcad442bcaa3d55606d42e6e01b60500ced943da0e81a8d532c5e8848f6b80506bdf703f1f36c90ee9fe87b49ef271cb8692d432216f40c1ebfacb950fa168ffa266c7415e83d2d87206886f536ed0ce246217b033699effe833076c5e2e5f45692b613e8719b49d145c0cfaa3da4c66f3773fc7346bf69f2d47922037212e51547d8da220fb10ce0997113ffaadd6262248af50b2ff495359ac3c3965b5a1a673fcb23ecdd446a837d866a60c1b9223af42be00c8edf99568188fd32416e8e6d8ff154a6c1e2105fc004a0e0a50a09057a72fc5c8bb1eda79b1169f97bd1db1d485f5de88e9db2939f2e8ecca1a640ab299f5ef5811e153041c28fbd13982a537b55af8033ca2fc33bbcb817db4383793b76564accccaeaed6ac2d21559088cb84e8fe2a031cfa9ebeabe9d33149ca53d79b20712a4b262d3233cce7d722cbd58be811f4fcf1d053241ad419bf599540dc90c52460ee54d0b808b1f65a8c88f10ffd3af40773c4f74d7c82949648598e7880a1e19e68f4eff92e4df5bacb39c6388519fd2ebaa26879ec1f5251e2607a82229733eb13ae666ce88fec52281b2ff5fd609585d49c734d3afb69bf79a666cbda6d863e6780900480f8995c73fc6eb588f5b4adf096bc06cc83d0db27b8d72b237dcc2a7af1bf75777dde87d6e57ae756dcaa99d3f42f09d32a0cef128dc73332136b2a5e1541a2bf6d660623e8c09d5034dbab8fc6afaaee97be2bad3e964b44456be3873820bb4a72948c849d4577474fa207a2fcc25a9a3edf64aa70f25b578a7bceab054dccdf1a26c38fa2ac39c7352ace5683b4b51ae4a8e9c275be4b9a4f78c5a2f7dbe2e256841907fd21d5d9352abcafb00f2e08b95f2bf4dfa11ca5cd53ca17d188b8c7c2e988c40e8527e3de08e5a519dc47f92d126336fa53b423914c9142a58b4353c56dfa27a26d97278c4468cfe1803c5c400198baeb6e5b2a4483cfbd7146ddcc92b9471663ba1292f9755db6463f53887c5a21386417cc0f8e31e0d0c347cbb525d21b6d1f95c6674efb7861690e61dd6e9bf1119cb3429175bd37fca4c2f5fb6b20234f63a6ae6ae56e32df7b1dc622b13465cc4cf313d68933dfa38baf65d4458b57d83e84f1e4fc2e0fd654f4d12476917a50830be5635659f33db11924834e6a8e63fc36bef07e8f7c122f24cd752dcbd7bb53fe23bdf2578743c3b1e93a94710baad858de9feb9293586c410547ee5445fbb05a6201", + "aggregation_bits": "0x845545fabb721755d4a172b873380c0edb449ebd072a2de3b1876da1d8982be4180ef73f8ba3ae1e5591d29e266b8c81c5dc355847a2ab7cf16ea32faa82896cf0321cbbe284bea22e0d0f1d89dc2eaf1ee3ebad1a41c1b15320f7c539213a5c3b66b6cbb895b3b64f7f5c734069f90ae04794bbb4b878eecf54206948eed9a986c2cfbc6e63f6d4579b685d3d0b676b64ddfd0823e79f1b707f2ecbfc53c9d917bc69ee349db40ce9c613b9607a638788397d29c83c607606ac5b6365d67a87594f1d21ec28f28a30add7b915540909f15d30d59bb57e9983af5140e516365a41bdb22c28e71d738d4cedebc05d4c03ee3b5b12737ce986c3e6163f7d1c66d53c5b042691f5b62c2dcb47650682746b7d69ea1c24344b23f6d64e66c493ded66be1f3ad68110c921365fde983165637ac4508cf3e0c2e9d0d3ae4d0ea19837b5f6195ff65a37e3dcbcba06ee4be125ca8ba384941e40088d56d47e9f4be8235999e152bafdc5fc1a9876e6224596f101f6afd2879ffb0f413a008143ffc8e357c370a420c2ad2941429587d57858cf5c42d42a92c6b4741e78575a8d72734141913081c7f8813ea6084af86618a4c50b0427ad32842d24332757466c89b8709fbae2cf2185cf20bcbcbfe2523965a044f351c4eddd63ca44814a5e21d1385405c5e009777a1c5edd367364ac7ccfc8c4b17e3c904063b0dbb3277c42c0b455a1e4c3755c93da5d6c0018d6ca9fea294627664b646e59a352e1401ff5cb86331e2cc8c85a1c6b5ac7e3c89d6fcf6e8a94fc252f7f4a08965791f54ee8e054f403c4d335935b0e21e08d921580cd2305343eb32a4ca75a0203401efc6812f8b34d54ac10357f88a36f054b2fe53ca54aa2e52d4451399f31a4fbdf0bf4e35ca8685bbc869fd75f24563a6b74f14ea273c44109eed479daeb97d92d4a4f853d32a222d484d3e1014caccf4a9583c54cb4884de03a579b6fcc131bd13fd0ed7647b7071a19e295c019241adf483375b32ddece6a07ef9d3451da2fbbe3959d45c0158dfeedae3bed87fd8fb15b36561017d37440a071a388c96d76991acc70cea3ad10537622e358ac8800213b687e1a3bcda4fb7365ce99e727eae54191a75021f76c9bff99509adc9af01dc98dd2ad1b6e1703026439b58a2db7ae37554cbaf21f4e6fde58e492653b7c9a87cfa4b987d00ce797077326fcf6afd4b19c985b7dce7376a3f80cf09dbfcf883979accd219e6b9c0bab705a1299bc306ea85f718082a4cc901ca763b59f38224dccd9cfaa8aa9908eec3cdb9d6e4ae7e9cb0a216225d34d205b0d343e6c1be6bf311d01aafcdfd8c61284746bf9fe83cdf4f4421b5bde4060cf81ad019f06db0ace76d59dec36b01e971601d3aaef9a25f192059fa3bd734deb9ab88df6e4f5c107a900d0449b2a05ac93b1f2c5f78e36cf0ed66e801", "data": { - "slot": "4592312065610838826", - "index": "4597269519555858506", - "beacon_block_root": "0x58e9c63feadbba8eb6a9aa92fd1b7e47efe4b0e7ff7a30a3c822443ed8d731b1", + "slot": "4602226973500878187", + "index": "4593964548827522954", + "beacon_block_root": "0x7e2bbb3f2a737918a12f79e9a52da7e1fceaae0b6c0c82172425cbce8d99a0c6", "source": { - "epoch": "534038364", - "root": "0xcbafa33faaa1f62b763b1697f350f91515f7aa53462f2500db29d9eff71c7ef1" + "epoch": "535192610", + "root": "0x58e9c63feadbba8eb6a9aa92fd1b7e47efe4b0e7ff7a30a3c822443ed8d731b1" }, "target": { - "epoch": "534423113", - "root": "0xa56daf3f6a0a38a28bb547404c3fd07b08f1ac2fd99dd38b7f27525f425b0fdc" + "epoch": "534038364", + "root": "0xcbafa33faaa1f62b763b1697f350f91515f7aa53462f2500db29d9eff71c7ef1" } }, - "signature": "0x8f2f048d2061f5e290f2fcbe3ba5ab2d85fb62db534e5e49d985475e3ac39e317db50af5dbc2fd94c81284c10c3ff5930b21b375837f13de2cb209aa8804af037f75dde5900da65d98d717bdee5549f3de2f544b576e860a001fb69b5ac82e5f", - "committee_bits": "0x00" + "signature": "0x9776d892cbc6c914554d0153158c9a7c72164e9f60d3fe5816bdaf08a9bf3ca67d77a9c1d6431ba3294ec9032424322b0ab9e9a58fb0b9d8de93946ff414d2bef1f58da9f4a9b1e585c57571a6c8c8c2c0aa1c574939b7acd228d3f35d7b6e6e", + "committee_bits": "0x02" } ] } \ No newline at end of file diff --git a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java index a43fac41fa1..1e6ee19fefc 100644 --- a/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java +++ b/ethereum/spec/src/testFixtures/java/tech/pegasys/teku/spec/util/DataStructureUtil.java @@ -813,16 +813,6 @@ public Attestation randomAttestation() { this::randomCommitteeBitvector); } - public Attestation randomElectraAttestation() { - return getElectraSchemaDefinitions(randomSlot()) - .getAttestationSchema() - .create( - randomBitlist(), - randomAttestationData(), - randomSignature(), - this::randomCommitteeBitvector); - } - public Attestation randomAttestation(final long slot) { return randomAttestation(UInt64.valueOf(slot)); } From 5d887eb69b142ef24506d140f8db3c3d8aec93e5 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Fri, 12 Jul 2024 13:51:05 +0200 Subject: [PATCH 07/18] increase timeout for acceptance test --- .../acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java | 2 +- .../pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java b/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java index c07fff3d627..814bece8e97 100644 --- a/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java +++ b/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java @@ -77,7 +77,7 @@ void setup() throws Exception { @Test void shouldPassMergeOptimisticallyAndBeginFinalizationAfterSafeSlotsToImport() throws Exception { - tekuNode2.waitForNonDefaultExecutionPayload(); + tekuNode2.waitForNonDefaultExecutionPayload(10); tekuNode2.waitForOptimisticBlock(); // Now make execution node sync and clarify switch from optimistic sync back to the normal diff --git a/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java b/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java index 18cd70077a7..a6683bc6508 100644 --- a/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java +++ b/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java @@ -461,6 +461,10 @@ public void waitForMilestone(final SpecMilestone expectedMilestone) { } public void waitForNonDefaultExecutionPayload() { + waitForNonDefaultExecutionPayload(5); + } + + public void waitForNonDefaultExecutionPayload(final int timeoutInMinutes) { LOG.debug("Wait for a block containing a non default execution payload"); waitFor( @@ -469,7 +473,7 @@ public void waitForNonDefaultExecutionPayload() { assertThat(block).isPresent(); checkExecutionPayloadInBlock(block.get()); }, - 5, + timeoutInMinutes, MINUTES); } From 0f563fa46de84519d50214cf7118d180c01c0d8f Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Wed, 17 Jul 2024 14:55:37 +0200 Subject: [PATCH 08/18] add changelog entry --- CHANGELOG.md | 1 + .../teku/beaconrestapi/handlers/v1/beacon/GetAttestations.java | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0fee413bc7..17d50d387af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Added a state pruner that can limit the number of finalized states stored when running an archive node. - Updated bootnodes for Sepolia network. - Implemented [GetBlockAttestationV2](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getBlockAttestationsV2) (adding support for Electra attestations) +- Implemented [GetAttestationsV2](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getPoolAttestationsV2) (adding support for Electra attestations) - Implemented [GetAggregateAttestationV2](https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Validator/getAggregatedAttestationV2) (adding support for Electra attestations) - Updated a number of parameters to reduce issues when using `p2p-subscribe-all-subnets-enabled`. If you have adjusted queue sizes manually when using all-subnets, please refer to details below. Manual settings will still override these defaults. - When `p2p-subscribe-all-subnets-enabled`, `p2p-peer-lower-bound` now defaults to 60 (previously 64), and `p2p-peer-upper-bound` now defaults to 80 (previously 100). diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestations.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestations.java index 197cdd4a7df..2d7ee137c41 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestations.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/beacon/GetAttestations.java @@ -52,6 +52,7 @@ public GetAttestations(final NodeDataProvider nodeDataProvider, final Spec spec) .description( "Retrieves attestations known by the node but not necessarily incorporated into any block.") .tags(TAG_BEACON) + .deprecated(true) .queryParam(SLOT_PARAMETER.withDescription(SLOT_QUERY_DESCRIPTION)) .queryParam(COMMITTEE_INDEX_PARAMETER) .response(SC_OK, "Request successful", getResponseType(spec)) From ea9f9b0a62c42910c7144b19307fa9ef4e48c844 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Wed, 17 Jul 2024 15:01:24 +0200 Subject: [PATCH 09/18] fix open api test --- .../beacon/paths/_eth_v1_beacon_pool_attestations.json | 1 + .../main/java/tech/pegasys/teku/api/NodeDataProvider.java | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_beacon_pool_attestations.json b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_beacon_pool_attestations.json index 8d7dccf937e..cb9c873b2f8 100644 --- a/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_beacon_pool_attestations.json +++ b/data/beaconrestapi/src/integration-test/resources/tech/pegasys/teku/beaconrestapi/beacon/paths/_eth_v1_beacon_pool_attestations.json @@ -4,6 +4,7 @@ "operationId" : "getPoolAttestations", "summary" : "Get Attestations from operations pool", "description" : "Retrieves attestations known by the node but not necessarily incorporated into any block.", + "deprecated" : true, "parameters" : [ { "name" : "slot", "in" : "query", diff --git a/data/provider/src/main/java/tech/pegasys/teku/api/NodeDataProvider.java b/data/provider/src/main/java/tech/pegasys/teku/api/NodeDataProvider.java index f6f4336904a..220807bb76d 100644 --- a/data/provider/src/main/java/tech/pegasys/teku/api/NodeDataProvider.java +++ b/data/provider/src/main/java/tech/pegasys/teku/api/NodeDataProvider.java @@ -113,13 +113,12 @@ public ObjectAndMetaData> getAttestationsAndMetaData( private ObjectAndMetaData> lookupMetaData( final List attestations, final Optional maybeSlot) { - final UInt64 slot = getSlotForAttestations(attestations, maybeSlot); + final UInt64 slot = getSlot(attestations, maybeSlot); return new ObjectAndMetaData<>( attestations, spec.atSlot(slot).getMilestone(), false, false, false); } - private UInt64 getSlotForAttestations( - final List attestations, final Optional maybeSlot) { + private UInt64 getSlot(final List attestations, final Optional maybeSlot) { return maybeSlot.orElseGet( () -> attestations.stream() From d5e9dda973c3e9959f1a5a7b157a76ed30c8c9ee Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Tue, 23 Jul 2024 19:03:17 +0200 Subject: [PATCH 10/18] add consensus version header --- .../handlers/v2/beacon/GetAttestationsV2.java | 9 ++++++++- .../handlers/v2/beacon/GetAttestationsV2Test.java | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java index b749a40a767..a1fb01e5130 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2.java @@ -19,6 +19,7 @@ import static tech.pegasys.teku.ethereum.json.types.EthereumTypes.MILESTONE_TYPE; import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_OK; import static tech.pegasys.teku.infrastructure.http.RestApiConstants.CACHE_NONE; +import static tech.pegasys.teku.infrastructure.http.RestApiConstants.HEADER_CONSENSUS_VERSION; import static tech.pegasys.teku.infrastructure.http.RestApiConstants.SLOT_QUERY_DESCRIPTION; import static tech.pegasys.teku.infrastructure.http.RestApiConstants.TAG_BEACON; import static tech.pegasys.teku.infrastructure.json.types.SerializableTypeDefinition.listOf; @@ -30,6 +31,7 @@ import java.util.Optional; import tech.pegasys.teku.api.DataProvider; import tech.pegasys.teku.api.NodeDataProvider; +import tech.pegasys.teku.api.schema.Version; import tech.pegasys.teku.beaconrestapi.handlers.v1.beacon.MilestoneDependentTypesUtil; import tech.pegasys.teku.infrastructure.json.types.SerializableTypeDefinition; import tech.pegasys.teku.infrastructure.restapi.endpoints.EndpointMetadata; @@ -77,8 +79,13 @@ public void handleRequest(final RestApiRequest request) throws JsonProcessingExc request.getOptionalQueryParameter(SLOT_PARAMETER.withDescription(SLOT_QUERY_DESCRIPTION)); final Optional committeeIndex = request.getOptionalQueryParameter(COMMITTEE_INDEX_PARAMETER); + final ObjectAndMetaData> attestationsAndMetaData = + nodeDataProvider.getAttestationsAndMetaData(slot, committeeIndex); - request.respondOk(nodeDataProvider.getAttestationsAndMetaData(slot, committeeIndex)); + request.header( + HEADER_CONSENSUS_VERSION, + Version.fromMilestone(attestationsAndMetaData.getMilestone()).name()); + request.respondOk(attestationsAndMetaData); } private static SerializableTypeDefinition>> getResponseType( diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java index 2d3b8b8c97a..3425a5667cc 100644 --- a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetAttestationsV2Test.java @@ -20,6 +20,7 @@ import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_BAD_REQUEST; import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_INTERNAL_SERVER_ERROR; import static tech.pegasys.teku.infrastructure.http.HttpStatusCodes.SC_OK; +import static tech.pegasys.teku.infrastructure.http.RestApiConstants.HEADER_CONSENSUS_VERSION; import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.getResponseStringFromMetadata; import static tech.pegasys.teku.infrastructure.restapi.MetadataTestUtil.verifyMetadataErrorResponse; import static tech.pegasys.teku.spec.SpecMilestone.ELECTRA; @@ -33,6 +34,7 @@ import java.util.List; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.TestTemplate; +import tech.pegasys.teku.api.schema.Version; import tech.pegasys.teku.beaconrestapi.AbstractMigratedBeaconHandlerTest; import tech.pegasys.teku.infrastructure.json.JsonTestUtil; import tech.pegasys.teku.spec.SpecMilestone; @@ -69,6 +71,8 @@ public void shouldReturnAttestationsWhenFound() throws JsonProcessingException { handler.handleRequest(request); assertThat(request.getResponseCode()).isEqualTo(SC_OK); assertThat(request.getResponseBody()).isEqualTo(attestationsAndMetaData); + assertThat(request.getResponseHeaders(HEADER_CONSENSUS_VERSION)) + .isEqualTo(Version.fromMilestone(specMilestone).name()); } @TestTemplate @@ -82,6 +86,8 @@ public void shouldReturnEmptyListWhenNoAttestations() throws JsonProcessingExcep handler.handleRequest(request); assertThat(request.getResponseCode()).isEqualTo(SC_OK); assertThat(request.getResponseBody()).isEqualTo(attestationsAndMetaData); + assertThat(request.getResponseHeaders(HEADER_CONSENSUS_VERSION)) + .isEqualTo(Version.fromMilestone(specMilestone).name()); } @TestTemplate From 1eb134bf078dba99f6d1f2d4e65c7b95b07be7e6 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Wed, 24 Jul 2024 15:20:27 +0200 Subject: [PATCH 11/18] refactor attestations filtering --- .../AggregatingAttestationPool.java | 32 +++++++++++++++---- .../AggregatingAttestationPoolTest.java | 21 ++++++++++-- 2 files changed, 45 insertions(+), 8 deletions(-) diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java index c488a5d8c8f..c8e9f98cd45 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java @@ -25,7 +25,9 @@ import java.util.Set; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Function; import java.util.function.Predicate; +import java.util.stream.Stream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.tuweni.bytes.Bytes; @@ -273,17 +275,23 @@ public synchronized List getAttestations( final Predicate>> filterForSlot = (entry) -> maybeSlot.map(slot -> entry.getKey().equals(slot)).orElse(true); - final Predicate filterForCommitteeIndex = - (group) -> - maybeCommitteeIndex - .map(index -> group.getAttestationData().getIndex().equals(index)) - .orElse(true); final UInt64 slot = maybeSlot.orElse(recentChainData.getCurrentSlot().orElse(UInt64.ZERO)); final SchemaDefinitions schemaDefinitions = spec.atSlot(slot).getSchemaDefinitions(); final boolean requestRequiresAttestationWithCommitteeBits = schemaDefinitions.getAttestationSchema().requiresCommitteeBits(); + // Committee index filter predicate is used for pre Electra attestations only (the filter is + // applied to the index at the attestation data level) + // Post Electra the index is always set to 0 at the attestation data level (the filter + // is rather applied to the committee bits) + final Predicate filterForCommitteeIndex = + (group) -> + requestRequiresAttestationWithCommitteeBits + || maybeCommitteeIndex + .map(index -> group.getAttestationData().getIndex().equals(index)) + .orElse(true); + return dataHashBySlot.descendingMap().entrySet().stream() .filter(filterForSlot) .map(Map.Entry::getValue) @@ -291,7 +299,9 @@ public synchronized List getAttestations( .map(attestationGroupByDataHash::get) .filter(Objects::nonNull) .filter(filterForCommitteeIndex) - .flatMap(MatchingDataAttestationGroup::stream) + .flatMap( + streamMatchingAttestations( + maybeCommitteeIndex, requestRequiresAttestationWithCommitteeBits)) .map(ValidatableAttestation::getAttestation) .filter( attestation -> @@ -299,6 +309,16 @@ public synchronized List getAttestations( .toList(); } + private Function> + streamMatchingAttestations( + final Optional maybeCommitteeIndex, + final boolean requestRequiresAttestationWithCommitteeBits) { + return matchingDataAttestationGroup -> + requestRequiresAttestationWithCommitteeBits + ? matchingDataAttestationGroup.stream(maybeCommitteeIndex) + : matchingDataAttestationGroup.stream(); + } + private boolean isValid( final BeaconState stateAtBlockSlot, final AttestationData attestationData) { return spec.validateAttestation(stateAtBlockSlot, attestationData).isEmpty(); diff --git a/ethereum/statetransition/src/test/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPoolTest.java b/ethereum/statetransition/src/test/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPoolTest.java index b804792a9c9..05d82c5c265 100644 --- a/ethereum/statetransition/src/test/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPoolTest.java +++ b/ethereum/statetransition/src/test/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPoolTest.java @@ -522,7 +522,10 @@ public void getAttestations_shouldReturnAllAttestations() { } @TestTemplate - public void getAttestations_shouldReturnAttestationsForGivenCommitteeIndexOnly() { + public void getAttestations_shouldReturnAttestationsForGivenCommitteeIndexOnly_PreElectra() { + assumeThat(specMilestone).isLessThan(ELECTRA); + // Pre Electra the committee index filter is applied to the index set at the attestation data + // level final AttestationData attestationData1 = dataStructureUtil.randomAttestationData(); final AttestationData attestationData2 = new AttestationData( @@ -531,7 +534,7 @@ public void getAttestations_shouldReturnAttestationsForGivenCommitteeIndexOnly() attestationData1.getBeaconBlockRoot(), attestationData1.getSource(), attestationData1.getTarget()); - Attestation attestation1 = addAttestationFromValidators(attestationData1, 1, 2, 3); + final Attestation attestation1 = addAttestationFromValidators(attestationData1, 1, 2, 3); addAttestationFromValidators(attestationData2, 4, 5, 6); assertThat( aggregatingPool.getAttestations( @@ -539,6 +542,20 @@ public void getAttestations_shouldReturnAttestationsForGivenCommitteeIndexOnly() .containsExactly(attestation1); } + @TestTemplate + public void getAttestations_shouldReturnAttestationsForGivenCommitteeIndexOnly_PostElectra() { + assumeThat(specMilestone).isGreaterThanOrEqualTo(ELECTRA); + // Post Electra the committee index filter is applied to the committee bits + final AttestationData attestationData1 = dataStructureUtil.randomAttestationData(); + final AttestationData attestationData2 = dataStructureUtil.randomAttestationData(); + final Attestation attestation1 = addAttestationFromValidators(attestationData1, 1, 2, 3); + final Optional committeeIndexFilter = committeeIndex; + committeeIndex = Optional.of(committeeIndex.get().plus(1)); + addAttestationFromValidators(attestationData2, 4, 5, 6); + assertThat(aggregatingPool.getAttestations(Optional.empty(), committeeIndexFilter)) + .containsExactly(attestation1); + } + @TestTemplate public void getAttestations_shouldReturnAttestationsForGivenSlotOnly() { final AttestationData attestationData1 = dataStructureUtil.randomAttestationData(); From 3c8c0b7be94aa92d9819e5335136dd701fb50d0d Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 25 Jul 2024 13:39:25 +0200 Subject: [PATCH 12/18] refactor committee index filtering --- .../AggregatingAttestationPool.java | 28 ++----------------- .../MatchingDataAttestationGroup.java | 24 ++++++++-------- 2 files changed, 15 insertions(+), 37 deletions(-) diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java index c8e9f98cd45..c4296a9df6b 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java @@ -25,9 +25,7 @@ import java.util.Set; import java.util.TreeMap; import java.util.concurrent.atomic.AtomicInteger; -import java.util.function.Function; import java.util.function.Predicate; -import java.util.stream.Stream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.tuweni.bytes.Bytes; @@ -281,27 +279,15 @@ public synchronized List getAttestations( final boolean requestRequiresAttestationWithCommitteeBits = schemaDefinitions.getAttestationSchema().requiresCommitteeBits(); - // Committee index filter predicate is used for pre Electra attestations only (the filter is - // applied to the index at the attestation data level) - // Post Electra the index is always set to 0 at the attestation data level (the filter - // is rather applied to the committee bits) - final Predicate filterForCommitteeIndex = - (group) -> - requestRequiresAttestationWithCommitteeBits - || maybeCommitteeIndex - .map(index -> group.getAttestationData().getIndex().equals(index)) - .orElse(true); - return dataHashBySlot.descendingMap().entrySet().stream() .filter(filterForSlot) .map(Map.Entry::getValue) .flatMap(Collection::stream) .map(attestationGroupByDataHash::get) .filter(Objects::nonNull) - .filter(filterForCommitteeIndex) .flatMap( - streamMatchingAttestations( - maybeCommitteeIndex, requestRequiresAttestationWithCommitteeBits)) + matchingDataAttestationGroup -> + matchingDataAttestationGroup.stream(maybeCommitteeIndex)) .map(ValidatableAttestation::getAttestation) .filter( attestation -> @@ -309,16 +295,6 @@ public synchronized List getAttestations( .toList(); } - private Function> - streamMatchingAttestations( - final Optional maybeCommitteeIndex, - final boolean requestRequiresAttestationWithCommitteeBits) { - return matchingDataAttestationGroup -> - requestRequiresAttestationWithCommitteeBits - ? matchingDataAttestationGroup.stream(maybeCommitteeIndex) - : matchingDataAttestationGroup.stream(); - } - private boolean isValid( final BeaconState stateAtBlockSlot, final AttestationData attestationData) { return spec.validateAttestation(stateAtBlockSlot, attestationData).isEmpty(); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java index b840d82e033..5a857203fef 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java @@ -270,21 +270,23 @@ public Iterator getRemainingAttestations() { .iterator(); } - /* - If we have attestations with committeeBits (Electra) then, if maybeCommitteeIndex is specified, we will consider attestation related to that committee only - */ private boolean maybeFilterOnCommitteeIndex(final ValidatableAttestation candidate) { - final Optional maybeCommitteeBits = - candidate.getAttestation().getCommitteeBits(); - if (maybeCommitteeBits.isEmpty() || maybeCommitteeIndex.isEmpty()) { + final Attestation attestation = candidate.getAttestation(); + final Optional maybeCommitteeBits = attestation.getCommitteeBits(); + if (maybeCommitteeIndex.isEmpty()) { return true; } - - final SszBitvector committeeBits = maybeCommitteeBits.get(); - if (committeeBits.getBitCount() != 1) { - return false; + // Pre Electra attestation, filter based on the attestation data index + if (maybeCommitteeBits.isEmpty()) { + return attestation.getData().getIndex().equals(maybeCommitteeIndex.get()); + } else { + // Post Electra attestation, filter on committee bits + final SszBitvector committeeBits = maybeCommitteeBits.get(); + if (committeeBits.getBitCount() != 1) { + return false; + } + return committeeBits.isSet(maybeCommitteeIndex.get().intValue()); } - return committeeBits.isSet(maybeCommitteeIndex.get().intValue()); } } } From 4883f6ac65f998635e00042bc933e3343dbef162 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 25 Jul 2024 14:38:28 +0200 Subject: [PATCH 13/18] spotless --- .../v2/beacon/GetBlockAttestationsV2.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetBlockAttestationsV2.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetBlockAttestationsV2.java index 81b15809640..cf893d108fd 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetBlockAttestationsV2.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetBlockAttestationsV2.java @@ -39,8 +39,11 @@ import tech.pegasys.teku.infrastructure.restapi.endpoints.EndpointMetadata; import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiEndpoint; import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest; +import tech.pegasys.teku.spec.Spec; +import tech.pegasys.teku.spec.SpecMilestone; import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; +import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing; import tech.pegasys.teku.spec.schemas.SchemaDefinitionCache; public class GetBlockAttestationsV2 extends RestApiEndpoint { @@ -116,6 +119,20 @@ private static Predicate> phase0AttestationsPredicate() { return attestations -> attestations.isEmpty() || !attestations.get(0).requiresCommitteeBits(); } + private static Predicate electraAttesterSlashing(final Spec spec) { + return attesterSlashing -> + spec.atSlot(attesterSlashing.getAttestation1().getData().getSlot()) + .getMilestone() + .isGreaterThanOrEqualTo(SpecMilestone.ELECTRA); + } + + private static Predicate phase0AttesterSlashing(final Spec spec) { + return attesterSlashing -> + !spec.atSlot(attesterSlashing.getAttestation1().getData().getSlot()) + .getMilestone() + .isGreaterThanOrEqualTo(SpecMilestone.ELECTRA); + } + private static Predicate> electraAttestationsPredicate() { // Only once we are in Electra attestations will have committee bits return attestations -> !attestations.isEmpty() && attestations.get(0).requiresCommitteeBits(); From b9604a8b31047c009aa78ca150fd14ff5eb484f2 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 25 Jul 2024 15:57:07 +0200 Subject: [PATCH 14/18] refactor attestation filtering --- .../v2/beacon/GetBlockAttestationsV2.java | 17 -------- .../AggregatingAttestationPool.java | 7 +--- .../MatchingDataAttestationGroup.java | 40 +++++++++++++------ 3 files changed, 29 insertions(+), 35 deletions(-) diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetBlockAttestationsV2.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetBlockAttestationsV2.java index cf893d108fd..81b15809640 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetBlockAttestationsV2.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v2/beacon/GetBlockAttestationsV2.java @@ -39,11 +39,8 @@ import tech.pegasys.teku.infrastructure.restapi.endpoints.EndpointMetadata; import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiEndpoint; import tech.pegasys.teku.infrastructure.restapi.endpoints.RestApiRequest; -import tech.pegasys.teku.spec.Spec; -import tech.pegasys.teku.spec.SpecMilestone; import tech.pegasys.teku.spec.datastructures.metadata.ObjectAndMetaData; import tech.pegasys.teku.spec.datastructures.operations.Attestation; -import tech.pegasys.teku.spec.datastructures.operations.AttesterSlashing; import tech.pegasys.teku.spec.schemas.SchemaDefinitionCache; public class GetBlockAttestationsV2 extends RestApiEndpoint { @@ -119,20 +116,6 @@ private static Predicate> phase0AttestationsPredicate() { return attestations -> attestations.isEmpty() || !attestations.get(0).requiresCommitteeBits(); } - private static Predicate electraAttesterSlashing(final Spec spec) { - return attesterSlashing -> - spec.atSlot(attesterSlashing.getAttestation1().getData().getSlot()) - .getMilestone() - .isGreaterThanOrEqualTo(SpecMilestone.ELECTRA); - } - - private static Predicate phase0AttesterSlashing(final Spec spec) { - return attesterSlashing -> - !spec.atSlot(attesterSlashing.getAttestation1().getData().getSlot()) - .getMilestone() - .isGreaterThanOrEqualTo(SpecMilestone.ELECTRA); - } - private static Predicate> electraAttestationsPredicate() { // Only once we are in Electra attestations will have committee bits return attestations -> !attestations.isEmpty() && attestations.get(0).requiresCommitteeBits(); diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java index c4296a9df6b..b9e658cc645 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/AggregatingAttestationPool.java @@ -276,7 +276,7 @@ public synchronized List getAttestations( final UInt64 slot = maybeSlot.orElse(recentChainData.getCurrentSlot().orElse(UInt64.ZERO)); final SchemaDefinitions schemaDefinitions = spec.atSlot(slot).getSchemaDefinitions(); - final boolean requestRequiresAttestationWithCommitteeBits = + final boolean requiresCommitteeBits = schemaDefinitions.getAttestationSchema().requiresCommitteeBits(); return dataHashBySlot.descendingMap().entrySet().stream() @@ -287,11 +287,8 @@ public synchronized List getAttestations( .filter(Objects::nonNull) .flatMap( matchingDataAttestationGroup -> - matchingDataAttestationGroup.stream(maybeCommitteeIndex)) + matchingDataAttestationGroup.stream(maybeCommitteeIndex, requiresCommitteeBits)) .map(ValidatableAttestation::getAttestation) - .filter( - attestation -> - attestation.requiresCommitteeBits() == requestRequiresAttestationWithCommitteeBits) .toList(); } diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java index 5a857203fef..675dad76de1 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java @@ -147,6 +147,22 @@ public Stream stream(final Optional committeeInd return StreamSupport.stream(spliterator(committeeIndex), false); } + public Stream stream( + final Optional committeeIndex, final boolean requiresCommitteeBits) { + // Group Attestation type mismatch + if (requiresCommitteeBits != includedValidators.requiresCommitteeBits()) { + return Stream.empty(); + } + // Pre electra attestation and committee index not matching + if (committeeIndex.isPresent() + && !includedValidators.requiresCommitteeBits() + && !attestationData.getIndex().equals(committeeIndex.get())) { + return Stream.empty(); + } + // Filter based on the committee index + return StreamSupport.stream(spliterator(committeeIndex), false); + } + public Spliterator spliterator(final Optional committeeIndex) { return Spliterators.spliteratorUnknownSize(iterator(committeeIndex), 0); } @@ -270,23 +286,21 @@ public Iterator getRemainingAttestations() { .iterator(); } + /* + If we have attestations with committeeBits (Electra) then, if maybeCommitteeIndex is specified, we will consider attestation related to that committee only + */ private boolean maybeFilterOnCommitteeIndex(final ValidatableAttestation candidate) { - final Attestation attestation = candidate.getAttestation(); - final Optional maybeCommitteeBits = attestation.getCommitteeBits(); - if (maybeCommitteeIndex.isEmpty()) { + final Optional maybeCommitteeBits = + candidate.getAttestation().getCommitteeBits(); + if (maybeCommitteeBits.isEmpty() || maybeCommitteeIndex.isEmpty()) { return true; } - // Pre Electra attestation, filter based on the attestation data index - if (maybeCommitteeBits.isEmpty()) { - return attestation.getData().getIndex().equals(maybeCommitteeIndex.get()); - } else { - // Post Electra attestation, filter on committee bits - final SszBitvector committeeBits = maybeCommitteeBits.get(); - if (committeeBits.getBitCount() != 1) { - return false; - } - return committeeBits.isSet(maybeCommitteeIndex.get().intValue()); + + final SszBitvector committeeBits = maybeCommitteeBits.get(); + if (committeeBits.getBitCount() != 1) { + return false; } + return committeeBits.isSet(maybeCommitteeIndex.get().intValue()); } } } From e6b20248e8502b5645dee0068da18ec47e1b9c75 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 25 Jul 2024 17:22:36 +0200 Subject: [PATCH 15/18] extract methods --- .../MatchingDataAttestationGroup.java | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java index 675dad76de1..dec9b77610a 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java @@ -149,18 +149,11 @@ public Stream stream(final Optional committeeInd public Stream stream( final Optional committeeIndex, final boolean requiresCommitteeBits) { - // Group Attestation type mismatch - if (requiresCommitteeBits != includedValidators.requiresCommitteeBits()) { + if (noMatchingAttestations(committeeIndex, requiresCommitteeBits)) { return Stream.empty(); + } else { + return StreamSupport.stream(spliterator(committeeIndex), false); } - // Pre electra attestation and committee index not matching - if (committeeIndex.isPresent() - && !includedValidators.requiresCommitteeBits() - && !attestationData.getIndex().equals(committeeIndex.get())) { - return Stream.empty(); - } - // Filter based on the committee index - return StreamSupport.stream(spliterator(committeeIndex), false); } public Spliterator spliterator(final Optional committeeIndex) { @@ -245,6 +238,18 @@ public boolean matchesCommitteeShufflingSeed(final Set validSeeds) { return committeeShufflingSeed.map(validSeeds::contains).orElse(false); } + private boolean noMatchingAttestations( + Optional committeeIndex, boolean requiresCommitteeBits) { + return requiresCommitteeBits != includedValidators.requiresCommitteeBits() + || noMatchingPreElectraAttestations(committeeIndex); + } + + private boolean noMatchingPreElectraAttestations(Optional committeeIndex) { + return committeeIndex.isPresent() + && !includedValidators.requiresCommitteeBits() + && !attestationData.getIndex().equals(committeeIndex.get()); + } + private class AggregatingIterator implements Iterator { private final Optional maybeCommitteeIndex; From fb8cab47062f0cb4fb8921c696f5b1fcc371433f Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 25 Jul 2024 18:09:48 +0200 Subject: [PATCH 16/18] remove else --- .../attestation/MatchingDataAttestationGroup.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java index dec9b77610a..e0d93bd9edc 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java @@ -151,9 +151,8 @@ public Stream stream( final Optional committeeIndex, final boolean requiresCommitteeBits) { if (noMatchingAttestations(committeeIndex, requiresCommitteeBits)) { return Stream.empty(); - } else { - return StreamSupport.stream(spliterator(committeeIndex), false); } + return StreamSupport.stream(spliterator(committeeIndex), false); } public Spliterator spliterator(final Optional committeeIndex) { From 4de3d1b6a691e6850bcca4d34188f5ca2ed7abb8 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Thu, 25 Jul 2024 18:11:20 +0200 Subject: [PATCH 17/18] missing finals --- .../attestation/MatchingDataAttestationGroup.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java index e0d93bd9edc..27303e656bd 100644 --- a/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java +++ b/ethereum/statetransition/src/main/java/tech/pegasys/teku/statetransition/attestation/MatchingDataAttestationGroup.java @@ -238,12 +238,12 @@ public boolean matchesCommitteeShufflingSeed(final Set validSeeds) { } private boolean noMatchingAttestations( - Optional committeeIndex, boolean requiresCommitteeBits) { + final Optional committeeIndex, final boolean requiresCommitteeBits) { return requiresCommitteeBits != includedValidators.requiresCommitteeBits() || noMatchingPreElectraAttestations(committeeIndex); } - private boolean noMatchingPreElectraAttestations(Optional committeeIndex) { + private boolean noMatchingPreElectraAttestations(final Optional committeeIndex) { return committeeIndex.isPresent() && !includedValidators.requiresCommitteeBits() && !attestationData.getIndex().equals(committeeIndex.get()); From a5804b8237a9e6a420775f6c0579b160aa72aef9 Mon Sep 17 00:00:00 2001 From: Mehdi AOUADI Date: Fri, 26 Jul 2024 10:05:40 +0200 Subject: [PATCH 18/18] remove AT changes --- .../acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java | 2 +- .../pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java b/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java index 814bece8e97..c07fff3d627 100644 --- a/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java +++ b/acceptance-tests/src/acceptance-test/java/tech/pegasys/teku/test/acceptance/OptimisticSyncSafeSlotsAcceptanceTest.java @@ -77,7 +77,7 @@ void setup() throws Exception { @Test void shouldPassMergeOptimisticallyAndBeginFinalizationAfterSafeSlotsToImport() throws Exception { - tekuNode2.waitForNonDefaultExecutionPayload(10); + tekuNode2.waitForNonDefaultExecutionPayload(); tekuNode2.waitForOptimisticBlock(); // Now make execution node sync and clarify switch from optimistic sync back to the normal diff --git a/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java b/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java index a6683bc6508..18cd70077a7 100644 --- a/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java +++ b/acceptance-tests/src/testFixtures/java/tech/pegasys/teku/test/acceptance/dsl/TekuBeaconNode.java @@ -461,10 +461,6 @@ public void waitForMilestone(final SpecMilestone expectedMilestone) { } public void waitForNonDefaultExecutionPayload() { - waitForNonDefaultExecutionPayload(5); - } - - public void waitForNonDefaultExecutionPayload(final int timeoutInMinutes) { LOG.debug("Wait for a block containing a non default execution payload"); waitFor( @@ -473,7 +469,7 @@ public void waitForNonDefaultExecutionPayload(final int timeoutInMinutes) { assertThat(block).isPresent(); checkExecutionPayloadInBlock(block.get()); }, - timeoutInMinutes, + 5, MINUTES); }