Skip to content

Commit dec1cd3

Browse files
authored
update VC to use SingleAttestation (#6884)
1 parent 4183c93 commit dec1cd3

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim

+1-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ type
378378

379379
EncodeArrays* =
380380
seq[phase0.Attestation] |
381-
seq[electra.Attestation] |
381+
seq[electra.SingleAttestation] |
382382
seq[PrepareBeaconProposer] |
383383
seq[RemoteKeystoreInfo] |
384384
seq[RestCommitteeSubscription] |

beacon_chain/spec/forks.nim

+2-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ type
178178

179179
ForkyAttestation* =
180180
phase0.Attestation |
181-
electra.Attestation
181+
electra.SingleAttestation
182182

183183
ForkedAttestation* = object
184184
case kind*: ConsensusFork
@@ -461,6 +461,7 @@ template kind*(
461461
electra.MsgTrustedSignedBeaconBlock |
462462
electra.TrustedSignedBeaconBlock |
463463
electra.Attestation |
464+
electra.SingleAttestation |
464465
electra.AggregateAndProof |
465466
electra.SignedAggregateAndProof |
466467
electra_mev.SignedBlindedBeaconBlock]): ConsensusFork =

beacon_chain/validator_client/attestation_service.nim

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# beacon_chain
2-
# Copyright (c) 2021-2024 Status Research & Development GmbH
2+
# Copyright (c) 2021-2025 Status Research & Development GmbH
33
# Licensed and distributed under either of
44
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
55
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
@@ -72,10 +72,12 @@ proc serveAttestation(
7272
logScope:
7373
attestation = shortLog(atst)
7474
try:
75-
when atst is electra.Attestation:
75+
when atst is electra.SingleAttestation:
7676
await vc.submitPoolAttestationsV2(@[atst], ApiStrategyKind.First)
77-
else:
77+
elif atst is phase0.Attestation:
7878
await vc.submitPoolAttestations(@[atst], ApiStrategyKind.First)
79+
else:
80+
static: doAssert false
7981
except ValidatorApiError as exc:
8082
warn "Unable to publish attestation", reason = exc.getFailureReason()
8183
return false
@@ -85,7 +87,7 @@ proc serveAttestation(
8587

8688
let res =
8789
if afterElectra:
88-
let attestation = registered.toElectraAttestation(signature)
90+
let attestation = registered.toSingleAttestation(signature)
8991
submitAttestation(attestation)
9092
else:
9193
let attestation = registered.toAttestation(signature)

0 commit comments

Comments
 (0)