diff --git a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim index 693cecbedf..86fa8aa491 100644 --- a/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim +++ b/beacon_chain/spec/eth2_apis/eth2_rest_serialization.nim @@ -378,7 +378,7 @@ type EncodeArrays* = seq[phase0.Attestation] | - seq[electra.Attestation] | + seq[electra.SingleAttestation] | seq[PrepareBeaconProposer] | seq[RemoteKeystoreInfo] | seq[RestCommitteeSubscription] | diff --git a/beacon_chain/spec/forks.nim b/beacon_chain/spec/forks.nim index 5f6e3dd9e2..5974679fd3 100644 --- a/beacon_chain/spec/forks.nim +++ b/beacon_chain/spec/forks.nim @@ -178,7 +178,7 @@ type ForkyAttestation* = phase0.Attestation | - electra.Attestation + electra.SingleAttestation ForkedAttestation* = object case kind*: ConsensusFork @@ -461,6 +461,7 @@ template kind*( electra.MsgTrustedSignedBeaconBlock | electra.TrustedSignedBeaconBlock | electra.Attestation | + electra.SingleAttestation | electra.AggregateAndProof | electra.SignedAggregateAndProof | electra_mev.SignedBlindedBeaconBlock]): ConsensusFork = diff --git a/beacon_chain/validator_client/attestation_service.nim b/beacon_chain/validator_client/attestation_service.nim index 2048cd4b05..d39df49c90 100644 --- a/beacon_chain/validator_client/attestation_service.nim +++ b/beacon_chain/validator_client/attestation_service.nim @@ -1,5 +1,5 @@ # beacon_chain -# Copyright (c) 2021-2024 Status Research & Development GmbH +# Copyright (c) 2021-2025 Status Research & Development GmbH # Licensed and distributed under either of # * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT). # * 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( logScope: attestation = shortLog(atst) try: - when atst is electra.Attestation: + when atst is electra.SingleAttestation: await vc.submitPoolAttestationsV2(@[atst], ApiStrategyKind.First) - else: + elif atst is phase0.Attestation: await vc.submitPoolAttestations(@[atst], ApiStrategyKind.First) + else: + static: doAssert false except ValidatorApiError as exc: warn "Unable to publish attestation", reason = exc.getFailureReason() return false @@ -85,7 +87,7 @@ proc serveAttestation( let res = if afterElectra: - let attestation = registered.toElectraAttestation(signature) + let attestation = registered.toSingleAttestation(signature) submitAttestation(attestation) else: let attestation = registered.toAttestation(signature)