From 4501e08067a244e16f42476dd3306ff5095c3247 Mon Sep 17 00:00:00 2001 From: Nico Flaig Date: Thu, 28 Nov 2024 11:54:33 +0100 Subject: [PATCH] fix: select correct gossip type when publishing single attestation (#7256) * fix: select correct gossip type when publishing single attestation * Add SingleAttestation as alias to phase0 ssz types --- packages/beacon-node/src/network/gossip/topic.ts | 2 +- packages/types/src/phase0/sszTypes.ts | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/beacon-node/src/network/gossip/topic.ts b/packages/beacon-node/src/network/gossip/topic.ts index 35248576f337..4f5a9c5a75d3 100644 --- a/packages/beacon-node/src/network/gossip/topic.ts +++ b/packages/beacon-node/src/network/gossip/topic.ts @@ -89,7 +89,7 @@ export function getGossipSSZType(topic: GossipTopic) { case GossipType.beacon_aggregate_and_proof: return sszTypesFor(topic.fork).SignedAggregateAndProof; case GossipType.beacon_attestation: - return sszTypesFor(topic.fork).Attestation; + return sszTypesFor(topic.fork).SingleAttestation; case GossipType.proposer_slashing: return ssz.phase0.ProposerSlashing; case GossipType.attester_slashing: diff --git a/packages/types/src/phase0/sszTypes.ts b/packages/types/src/phase0/sszTypes.ts index 2f9eead77608..f64415439b3e 100644 --- a/packages/types/src/phase0/sszTypes.ts +++ b/packages/types/src/phase0/sszTypes.ts @@ -316,6 +316,8 @@ export const Attestation = new ContainerType( {typeName: "Attestation", jsonCase: "eth2"} ); +export const SingleAttestation = Attestation; + export const AttesterSlashing = new ContainerType( { // In state transition, AttesterSlashing attestations are only partially validated. Their slot and epoch could