diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e610602d05..22057adedbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,4 +18,4 @@ ### Bug Fixes - Fixed `data_column_sidecar` gossip decoding to use the schema of the topic's fork instead of the highest supported milestone. Previously, on networks with Gloas scheduled, every Fulu-era column sidecar received via gossip failed deserialization. - Fixed a regression where archive nodes using `leveldb-tree` storage would take an extremely long time to start up. - - Post-Electra, the `committee_index` query parameter in `GET /eth/v1/validator/attestation_data` is now ignored instead of rejected when non-zero, matching the behaviour of other consensus clients. + - Post-Electra, the `committee_index` query parameter in `GET /eth/v1/validator/attestation_data` is now ignored instead of rejected when non-zero, matching the behaviour of other consensus clients. \ No newline at end of file diff --git a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/events/EventSubscriptionManager.java b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/events/EventSubscriptionManager.java index 9e8b5900628..c5645bf2fa6 100644 --- a/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/events/EventSubscriptionManager.java +++ b/data/beaconrestapi/src/main/java/tech/pegasys/teku/beaconrestapi/handlers/v1/events/EventSubscriptionManager.java @@ -164,16 +164,18 @@ public void chainHeadUpdated( notifySubscribersOfEvent(EventType.chain_reorg, reorgEvent); }); - final HeadEvent headEvent = - new HeadEvent( - slot, - bestBlockRoot, - stateRoot, - epochTransition, - executionOptimistic, - previousDutyDependentRoot, - currentDutyDependentRoot); - notifySubscribersOfEvent(EventType.head, headEvent); + if (spec.atSlot(slot).getMilestone().isLessThan(SpecMilestone.GLOAS)) { + final HeadEvent headEvent = + new HeadEvent( + slot, + bestBlockRoot, + stateRoot, + epochTransition, + executionOptimistic, + previousDutyDependentRoot, + currentDutyDependentRoot); + notifySubscribersOfEvent(EventType.head, headEvent); + } final HeadV2Event headV2Event = HeadV2Event.create( diff --git a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/events/EventSubscriptionManagerTest.java b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/events/EventSubscriptionManagerTest.java index 9cfd5b46d50..80108895441 100644 --- a/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/events/EventSubscriptionManagerTest.java +++ b/data/beaconrestapi/src/test/java/tech/pegasys/teku/beaconrestapi/handlers/v1/events/EventSubscriptionManagerTest.java @@ -218,12 +218,15 @@ void shouldPropagateReorgMessages() throws IOException { } @Test - void shouldPropagateHeadEvent() throws IOException { - when(req.getQueryString()).thenReturn("&topics=head"); + void shouldNotPropagateHeadV1EventAfterGloas() throws IOException { + when(req.getQueryString()).thenReturn("&topics=head,head_v2"); manager.registerClient(client1); triggerHeadEvent(); - checkEvent("head", headEvent); + final List events = outputStream.getEvents(); + assertThat(events.size()).isEqualTo(1); + assertThat(events.getFirst()).doesNotContain("event: head\n"); + assertThat(events.getFirst()).contains("event: head_v2\n"); } @Test @@ -251,13 +254,14 @@ void shouldPropagateContributions() { @Test void shouldPropagateHeadAndReorg() { - when(req.getQueryString()).thenReturn("&topics=chain_reorg,head"); + when(req.getQueryString()).thenReturn("&topics=chain_reorg,head,head_v2"); manager.registerClient(client1); triggerReorgEvent(); final List events = outputStream.getEvents(); assertThat(events.get(0)).contains("event: chain_reorg\n"); - assertThat(events.get(1)).contains("event: head\n"); + assertThat(events.get(1)).doesNotContain("event: head\n"); + assertThat(events.get(1)).contains("event: head_v2\n"); } @Test