-
-
Notifications
You must be signed in to change notification settings - Fork 312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: select correct gossip type when publishing single attestation #7256
Conversation
@@ -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 isForkPostElectra(topic.fork) ? ssz.electra.SingleAttestation : ssz.phase0.Attestation; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could also be return sszTypesFor(topic.fork).SingleAttestation;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this to work we would have to define SingleAttestation
in phase0 types
lodestar/packages/types/src/sszTypes.ts
Line 18 in 48dea55
[ForkName.phase0]: {...phase0}, |
Otherwise it does not exist in all forks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can add it as an alias though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the alias makes sense as it matches with what we did in types
lodestar/packages/types/src/types.ts
Line 59 in 72d3448
SingleAttestation: phase0.Attestation; |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devnet-5 #7256 +/- ##
=========================================
Coverage 48.43% 48.44%
=========================================
Files 602 602
Lines 40320 40321 +1
Branches 2057 2057
=========================================
+ Hits 19531 19532 +1
Misses 20751 20751
Partials 38 38 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
…7256) * fix: select correct gossip type when publishing single attestation * Add SingleAttestation as alias to phase0 ssz types
…7256) * fix: select correct gossip type when publishing single attestation * Add SingleAttestation as alias to phase0 ssz types
…7256) * fix: select correct gossip type when publishing single attestation * Add SingleAttestation as alias to phase0 ssz types
…7256) * fix: select correct gossip type when publishing single attestation * Add SingleAttestation as alias to phase0 ssz types
Motivation
We are not selecting the correct type to serialize single attestation when publishing to gossip
Description
Select correct gossip type when publishing single attestation, instead of
electra.Attestation
, we need to useelectra.SingleAttestation