Skip to content

Commit 2997fec

Browse files
nflaigensi321
authored andcommitted
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
1 parent bd55851 commit 2997fec

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/beacon-node/src/network/gossip/topic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export function getGossipSSZType(topic: GossipTopic) {
8888
case GossipType.beacon_aggregate_and_proof:
8989
return sszTypesFor(topic.fork).SignedAggregateAndProof;
9090
case GossipType.beacon_attestation:
91-
return sszTypesFor(topic.fork).Attestation;
91+
return sszTypesFor(topic.fork).SingleAttestation;
9292
case GossipType.proposer_slashing:
9393
return ssz.phase0.ProposerSlashing;
9494
case GossipType.attester_slashing:

packages/types/src/phase0/sszTypes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ export const Attestation = new ContainerType(
316316
{typeName: "Attestation", jsonCase: "eth2"}
317317
);
318318

319+
export const SingleAttestation = Attestation;
320+
319321
export const AttesterSlashing = new ContainerType(
320322
{
321323
// In state transition, AttesterSlashing attestations are only partially validated. Their slot and epoch could

0 commit comments

Comments
 (0)