diff --git a/api/v1/payloadattributesevent.go b/api/v1/payloadattributesevent.go index 3a6379b..96daac2 100644 --- a/api/v1/payloadattributesevent.go +++ b/api/v1/payloadattributesevent.go @@ -462,7 +462,7 @@ func (e *PayloadAttributesEvent) MarshalJSON() ([]byte, error) { if err != nil { return nil, errors.Wrap(err, "failed to marshal payload attributes v3") } - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if e.Data.V4 == nil { return nil, errors.New("no payload attributes v4 data") } @@ -592,7 +592,7 @@ func (e *PayloadAttributesEvent) unpack(data *payloadAttributesEventJSON) error return err } e.Data.V3 = &payloadAttributes - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: var payloadAttributes PayloadAttributesV4 err = json.Unmarshal(data.Data.PayloadAttributes, &payloadAttributes) if err != nil { diff --git a/api/versionedblindedbeaconblock.go b/api/versionedblindedbeaconblock.go index 88ec55e..588612e 100644 --- a/api/versionedblindedbeaconblock.go +++ b/api/versionedblindedbeaconblock.go @@ -58,7 +58,7 @@ func (v *VersionedBlindedBeaconBlock) Slot() (phase0.Slot, error) { } return v.Deneb.Slot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return 0, ErrDataMissing } @@ -90,7 +90,7 @@ func (v *VersionedBlindedBeaconBlock) ProposerIndex() (phase0.ValidatorIndex, er } return v.Deneb.ProposerIndex, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return 0, ErrDataMissing } @@ -125,7 +125,7 @@ func (v *VersionedBlindedBeaconBlock) RandaoReveal() (phase0.BLSSignature, error } return v.Deneb.Body.RANDAOReveal, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return phase0.BLSSignature{}, ErrDataMissing @@ -161,7 +161,7 @@ func (v *VersionedBlindedBeaconBlock) Graffiti() ([32]byte, error) { } return v.Deneb.Body.Graffiti, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return [32]byte{}, ErrDataMissing @@ -218,7 +218,7 @@ func (v *VersionedBlindedBeaconBlock) Attestations() ([]spec.VersionedAttestatio } return versionedAttestations, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return nil, ErrDataMissing } @@ -258,7 +258,7 @@ func (v *VersionedBlindedBeaconBlock) Root() (phase0.Root, error) { } return v.Deneb.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -290,7 +290,7 @@ func (v *VersionedBlindedBeaconBlock) BodyRoot() (phase0.Root, error) { } return v.Deneb.Body.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -322,7 +322,7 @@ func (v *VersionedBlindedBeaconBlock) ParentRoot() (phase0.Root, error) { } return v.Deneb.ParentRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -354,7 +354,7 @@ func (v *VersionedBlindedBeaconBlock) StateRoot() (phase0.Root, error) { } return v.Deneb.StateRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -392,7 +392,7 @@ func (v *VersionedBlindedBeaconBlock) TransactionsRoot() (phase0.Root, error) { } return v.Deneb.Body.ExecutionPayloadHeader.TransactionsRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil || v.Electra.Body.ExecutionPayloadHeader == nil { @@ -432,7 +432,7 @@ func (v *VersionedBlindedBeaconBlock) FeeRecipient() (bellatrix.ExecutionAddress } return v.Deneb.Body.ExecutionPayloadHeader.FeeRecipient, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil || v.Electra.Body.ExecutionPayloadHeader == nil { @@ -472,7 +472,7 @@ func (v *VersionedBlindedBeaconBlock) Timestamp() (uint64, error) { } return v.Deneb.Body.ExecutionPayloadHeader.Timestamp, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil || v.Electra.Body.ExecutionPayloadHeader == nil { @@ -506,7 +506,7 @@ func (v *VersionedBlindedBeaconBlock) String() string { } return v.Deneb.String() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return "" } diff --git a/api/versionedblindedproposal.go b/api/versionedblindedproposal.go index 0f84b09..65ea248 100644 --- a/api/versionedblindedproposal.go +++ b/api/versionedblindedproposal.go @@ -58,7 +58,7 @@ func (v *VersionedBlindedProposal) Slot() (phase0.Slot, error) { } return v.Deneb.Slot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return 0, ErrDataMissing } @@ -90,7 +90,7 @@ func (v *VersionedBlindedProposal) ProposerIndex() (phase0.ValidatorIndex, error } return v.Deneb.ProposerIndex, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return 0, ErrDataMissing } @@ -125,7 +125,7 @@ func (v *VersionedBlindedProposal) RandaoReveal() (phase0.BLSSignature, error) { } return v.Deneb.Body.RANDAOReveal, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return phase0.BLSSignature{}, ErrDataMissing @@ -161,7 +161,7 @@ func (v *VersionedBlindedProposal) Graffiti() ([32]byte, error) { } return v.Deneb.Body.Graffiti, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return [32]byte{}, ErrDataMissing @@ -218,7 +218,7 @@ func (v *VersionedBlindedProposal) Attestations() ([]spec.VersionedAttestation, } return versionedAttestations, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return nil, ErrDataMissing } @@ -258,7 +258,7 @@ func (v *VersionedBlindedProposal) Root() (phase0.Root, error) { } return v.Deneb.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -293,7 +293,7 @@ func (v *VersionedBlindedProposal) BodyRoot() (phase0.Root, error) { } return v.Deneb.Body.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return phase0.Root{}, ErrDataMissing @@ -326,7 +326,7 @@ func (v *VersionedBlindedProposal) ParentRoot() (phase0.Root, error) { } return v.Deneb.ParentRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -358,7 +358,7 @@ func (v *VersionedBlindedProposal) StateRoot() (phase0.Root, error) { } return v.Deneb.StateRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -396,7 +396,7 @@ func (v *VersionedBlindedProposal) TransactionsRoot() (phase0.Root, error) { } return v.Deneb.Body.ExecutionPayloadHeader.TransactionsRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil || v.Electra.Body.ExecutionPayloadHeader == nil { @@ -436,7 +436,7 @@ func (v *VersionedBlindedProposal) FeeRecipient() (bellatrix.ExecutionAddress, e } return v.Deneb.Body.ExecutionPayloadHeader.FeeRecipient, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil || v.Electra.Body.ExecutionPayloadHeader == nil { @@ -476,7 +476,7 @@ func (v *VersionedBlindedProposal) Timestamp() (uint64, error) { } return v.Deneb.Body.ExecutionPayloadHeader.Timestamp, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil || v.Electra.Body.ExecutionPayloadHeader == nil { @@ -510,7 +510,7 @@ func (v *VersionedBlindedProposal) String() string { } return v.Deneb.String() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return "" } diff --git a/api/versionedblockrequest.go b/api/versionedblockrequest.go index 5783b67..88f4d46 100644 --- a/api/versionedblockrequest.go +++ b/api/versionedblockrequest.go @@ -55,7 +55,7 @@ func (v *VersionedBlockRequest) Slot() (phase0.Slot, error) { } return v.Deneb.Message.Slot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return 0, ErrDataMissing @@ -97,7 +97,7 @@ func (v *VersionedBlockRequest) ExecutionBlockHash() (phase0.Hash32, error) { } return v.Deneb.Message.Body.ExecutionPayload.BlockHash, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || @@ -162,7 +162,7 @@ func (v *VersionedBlockRequest) Attestations() ([]spec.VersionedAttestation, err } return versionedAttestations, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -207,7 +207,7 @@ func (v *VersionedBlockRequest) Root() (phase0.Root, error) { } return v.Deneb.Message.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return phase0.Root{}, ErrDataMissing @@ -246,7 +246,7 @@ func (v *VersionedBlockRequest) BodyRoot() (phase0.Root, error) { } return v.Deneb.Message.Body.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -283,7 +283,7 @@ func (v *VersionedBlockRequest) ParentRoot() (phase0.Root, error) { } return v.Deneb.Message.ParentRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return phase0.Root{}, ErrDataMissing @@ -319,7 +319,7 @@ func (v *VersionedBlockRequest) StateRoot() (phase0.Root, error) { } return v.Deneb.Message.StateRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return phase0.Root{}, ErrDataMissing @@ -382,7 +382,7 @@ func (v *VersionedBlockRequest) AttesterSlashings() ([]spec.VersionedAttesterSla } return versionedAttesterSlashings, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -430,7 +430,7 @@ func (v *VersionedBlockRequest) ProposerSlashings() ([]*phase0.ProposerSlashing, } return v.Deneb.Message.Body.ProposerSlashings, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -464,7 +464,7 @@ func (v *VersionedBlockRequest) String() string { } return v.Deneb.String() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return "" } diff --git a/api/versionedproposal.go b/api/versionedproposal.go index 49f27da..668ee8a 100644 --- a/api/versionedproposal.go +++ b/api/versionedproposal.go @@ -90,7 +90,7 @@ func (v *VersionedProposal) BodyRoot() (phase0.Root, error) { } return v.Deneb.Block.Body.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.Body.HashTreeRoot() } @@ -130,7 +130,7 @@ func (v *VersionedProposal) ParentRoot() (phase0.Root, error) { } return v.Deneb.Block.ParentRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.ParentRoot, nil } @@ -170,7 +170,7 @@ func (v *VersionedProposal) ProposerIndex() (phase0.ValidatorIndex, error) { } return v.Deneb.Block.ProposerIndex, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.ProposerIndex, nil } @@ -210,7 +210,7 @@ func (v *VersionedProposal) Root() (phase0.Root, error) { } return v.Deneb.Block.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.HashTreeRoot() } @@ -250,7 +250,7 @@ func (v *VersionedProposal) Slot() (phase0.Slot, error) { } return v.Deneb.Block.Slot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.Slot, nil } @@ -290,7 +290,7 @@ func (v *VersionedProposal) StateRoot() (phase0.Root, error) { } return v.Deneb.Block.StateRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.StateRoot, nil } @@ -394,7 +394,7 @@ func (v *VersionedProposal) Attestations() ([]spec.VersionedAttestation, error) } return versionedAttestations, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { versionedAttestations := make([]spec.VersionedAttestation, len(v.ElectraBlinded.Body.Attestations)) for i, attestation := range v.ElectraBlinded.Body.Attestations { @@ -450,7 +450,7 @@ func (v *VersionedProposal) Graffiti() ([32]byte, error) { } return v.Deneb.Block.Body.Graffiti, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.Body.Graffiti, nil } @@ -490,7 +490,7 @@ func (v *VersionedProposal) RandaoReveal() (phase0.BLSSignature, error) { } return v.Deneb.Block.Body.RANDAOReveal, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.Body.RANDAOReveal, nil } @@ -526,7 +526,7 @@ func (v *VersionedProposal) Transactions() ([]bellatrix.Transaction, error) { } return v.Deneb.Block.Body.ExecutionPayload.Transactions, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return nil, ErrDataMissing } @@ -562,7 +562,7 @@ func (v *VersionedProposal) FeeRecipient() (bellatrix.ExecutionAddress, error) { } return v.Deneb.Block.Body.ExecutionPayload.FeeRecipient, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.Body.ExecutionPayloadHeader.FeeRecipient, nil } @@ -598,7 +598,7 @@ func (v *VersionedProposal) Timestamp() (uint64, error) { } return v.Deneb.Block.Body.ExecutionPayload.Timestamp, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.Body.ExecutionPayloadHeader.Timestamp, nil } @@ -622,7 +622,7 @@ func (v *VersionedProposal) Blobs() ([]deneb.Blob, error) { } return v.Deneb.Blobs, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return nil, ErrDataMissing } @@ -646,7 +646,7 @@ func (v *VersionedProposal) KZGProofs() ([]deneb.KZGProof, error) { } return v.Deneb.KZGProofs, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return nil, ErrDataMissing } @@ -703,7 +703,7 @@ func (v *VersionedProposal) String() string { } return v.Deneb.String() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return "" } @@ -738,7 +738,7 @@ func (v *VersionedProposal) proposalPresent() bool { } return v.Deneb.Block != nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded != nil } @@ -773,7 +773,7 @@ func (v *VersionedProposal) bodyPresent() bool { } return v.Deneb != nil && v.Deneb.Block != nil && v.Deneb.Block.Body != nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded != nil && v.ElectraBlinded.Body != nil } @@ -810,7 +810,7 @@ func (v *VersionedProposal) payloadPresent() bool { } return v.Deneb != nil && v.Deneb.Block != nil && v.Deneb.Block.Body != nil && v.Deneb.Block.Body.ExecutionPayload != nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded != nil && v.ElectraBlinded.Body != nil && v.ElectraBlinded.Body.ExecutionPayloadHeader != nil } diff --git a/api/versionedsignedblindedbeaconblock.go b/api/versionedsignedblindedbeaconblock.go index 7c8888d..58d141b 100644 --- a/api/versionedsignedblindedbeaconblock.go +++ b/api/versionedsignedblindedbeaconblock.go @@ -55,7 +55,7 @@ func (v *VersionedSignedBlindedBeaconBlock) Slot() (phase0.Slot, error) { } return v.Deneb.Message.Slot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return 0, ErrDataMissing @@ -118,7 +118,7 @@ func (v *VersionedSignedBlindedBeaconBlock) Attestations() ([]spec.VersionedAtte } return versionedAttestations, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -163,7 +163,7 @@ func (v *VersionedSignedBlindedBeaconBlock) Root() (phase0.Root, error) { } return v.Deneb.Message.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -201,7 +201,7 @@ func (v *VersionedSignedBlindedBeaconBlock) BodyRoot() (phase0.Root, error) { } return v.Deneb.Message.Body.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -236,7 +236,7 @@ func (v *VersionedSignedBlindedBeaconBlock) ParentRoot() (phase0.Root, error) { } return v.Deneb.Message.ParentRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -271,7 +271,7 @@ func (v *VersionedSignedBlindedBeaconBlock) StateRoot() (phase0.Root, error) { } return v.Deneb.Message.StateRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -333,7 +333,7 @@ func (v *VersionedSignedBlindedBeaconBlock) AttesterSlashings() ([]spec.Versione } return versionedAttesterSlashings, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return nil, ErrDataMissing } @@ -379,7 +379,7 @@ func (v *VersionedSignedBlindedBeaconBlock) ProposerSlashings() ([]*phase0.Propo } return v.Deneb.Message.Body.ProposerSlashings, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return nil, ErrDataMissing } @@ -414,7 +414,7 @@ func (v *VersionedSignedBlindedBeaconBlock) ProposerIndex() (phase0.ValidatorInd } return v.Deneb.Message.ProposerIndex, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return 0, ErrDataMissing @@ -456,7 +456,7 @@ func (v *VersionedSignedBlindedBeaconBlock) ExecutionBlockHash() (phase0.Hash32, } return v.Deneb.Message.Body.ExecutionPayloadHeader.BlockHash, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || @@ -500,7 +500,7 @@ func (v *VersionedSignedBlindedBeaconBlock) ExecutionBlockNumber() (uint64, erro } return v.Deneb.Message.Body.ExecutionPayloadHeader.BlockNumber, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || @@ -535,7 +535,7 @@ func (v *VersionedSignedBlindedBeaconBlock) Signature() (phase0.BLSSignature, er } return v.Deneb.Signature, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.BLSSignature{}, ErrDataMissing } diff --git a/api/versionedsignedblindedproposal.go b/api/versionedsignedblindedproposal.go index abd0e23..6bc9465 100644 --- a/api/versionedsignedblindedproposal.go +++ b/api/versionedsignedblindedproposal.go @@ -55,7 +55,7 @@ func (v *VersionedSignedBlindedProposal) Slot() (phase0.Slot, error) { } return v.Deneb.Message.Slot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return 0, ErrDataMissing @@ -118,7 +118,7 @@ func (v *VersionedSignedBlindedProposal) Attestations() ([]spec.VersionedAttesta } return versionedAttestations, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -163,7 +163,7 @@ func (v *VersionedSignedBlindedProposal) Root() (phase0.Root, error) { } return v.Deneb.Message.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.Root{}, ErrDataMissing } @@ -201,7 +201,7 @@ func (v *VersionedSignedBlindedProposal) BodyRoot() (phase0.Root, error) { } return v.Deneb.Message.Body.HashTreeRoot() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -238,7 +238,7 @@ func (v *VersionedSignedBlindedProposal) ParentRoot() (phase0.Root, error) { } return v.Deneb.Message.ParentRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return phase0.Root{}, ErrDataMissing @@ -274,7 +274,7 @@ func (v *VersionedSignedBlindedProposal) StateRoot() (phase0.Root, error) { } return v.Deneb.Message.StateRoot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return phase0.Root{}, ErrDataMissing @@ -337,7 +337,7 @@ func (v *VersionedSignedBlindedProposal) AttesterSlashings() ([]spec.VersionedAt } return versionedAttesterSlashings, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -385,7 +385,7 @@ func (v *VersionedSignedBlindedProposal) ProposerSlashings() ([]*phase0.Proposer } return v.Deneb.Message.Body.ProposerSlashings, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -422,7 +422,7 @@ func (v *VersionedSignedBlindedProposal) ProposerIndex() (phase0.ValidatorIndex, } return v.Deneb.Message.ProposerIndex, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return 0, ErrDataMissing @@ -464,7 +464,7 @@ func (v *VersionedSignedBlindedProposal) ExecutionBlockHash() (phase0.Hash32, er } return v.Deneb.Message.Body.ExecutionPayloadHeader.BlockHash, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || @@ -508,7 +508,7 @@ func (v *VersionedSignedBlindedProposal) ExecutionBlockNumber() (uint64, error) } return v.Deneb.Message.Body.ExecutionPayloadHeader.BlockNumber, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || @@ -543,7 +543,7 @@ func (v *VersionedSignedBlindedProposal) Signature() (phase0.BLSSignature, error } return v.Deneb.Signature, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil { return phase0.BLSSignature{}, ErrDataMissing } diff --git a/api/versionedsignedproposal.go b/api/versionedsignedproposal.go index c73f3fd..29985bc 100644 --- a/api/versionedsignedproposal.go +++ b/api/versionedsignedproposal.go @@ -80,7 +80,7 @@ func (v *VersionedSignedProposal) AssertPresent() error { if v.DenebBlinded == nil && v.Blinded { return errors.New("blinded deneb proposal not present") } - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Electra == nil && !v.Blinded { return errors.New("electra proposal not present") } @@ -123,7 +123,7 @@ func (v *VersionedSignedProposal) Slot() (phase0.Slot, error) { } return v.Deneb.SignedBlock.Message.Slot, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.Message.Slot, nil } @@ -163,7 +163,7 @@ func (v *VersionedSignedProposal) ProposerIndex() (phase0.ValidatorIndex, error) } return v.Deneb.SignedBlock.Message.ProposerIndex, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.Message.ProposerIndex, nil } @@ -199,7 +199,7 @@ func (v *VersionedSignedProposal) ExecutionBlockHash() (phase0.Hash32, error) { } return v.Deneb.SignedBlock.Message.Body.ExecutionPayload.BlockHash, nil - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { return v.ElectraBlinded.Message.Body.ExecutionPayloadHeader.BlockHash, nil } @@ -267,7 +267,7 @@ func (v *VersionedSignedProposal) String() string { } return v.Deneb.String() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { if v.ElectraBlinded == nil { return "" @@ -327,7 +327,7 @@ func (v *VersionedSignedProposal) assertMessagePresent() error { return ErrDataMissing } } - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { if v.ElectraBlinded == nil || v.ElectraBlinded.Message == nil { @@ -402,7 +402,7 @@ func (v *VersionedSignedProposal) assertExecutionPayloadPresent() error { return ErrDataMissing } } - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if v.Blinded { if v.ElectraBlinded == nil || v.ElectraBlinded.Message == nil || diff --git a/http/beaconstate.go b/http/beaconstate.go index e7983d1..1a32f2f 100644 --- a/http/beaconstate.go +++ b/http/beaconstate.go @@ -135,7 +135,7 @@ func (s *Service) beaconStateFromSSZ(ctx context.Context, res *httpResponse) (*a if err != nil { return nil, errors.Join(errors.New("failed to decode deneb beacon state"), err) } - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: response.Data.Electra = &electra.BeaconState{} if s.customSpecSupport { err = dynSSZ.UnmarshalSSZ(response.Data.Electra, res.body) @@ -171,7 +171,7 @@ func (*Service) beaconStateFromJSON(res *httpResponse) (*api.Response[*spec.Vers response.Data.Capella, response.Metadata, err = decodeJSONResponse(bytes.NewReader(res.body), &capella.BeaconState{}) case spec.DataVersionDeneb: response.Data.Deneb, response.Metadata, err = decodeJSONResponse(bytes.NewReader(res.body), &deneb.BeaconState{}) - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: response.Data.Electra, response.Metadata, err = decodeJSONResponse(bytes.NewReader(res.body), &electra.BeaconState{}) default: err = fmt.Errorf("unsupported version %s", res.consensusVersion) diff --git a/http/blindedproposal.go b/http/blindedproposal.go index e790029..f115522 100644 --- a/http/blindedproposal.go +++ b/http/blindedproposal.go @@ -141,7 +141,7 @@ func (*Service) blindedProposalFromSSZ(res *httpResponse) (*api.Response[*api.Ve if err := response.Data.Deneb.UnmarshalSSZ(res.body); err != nil { return nil, errors.Join(errors.New("failed to decode deneb blinded beacon block proposal"), err) } - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: response.Data.Electra = &apiv1electra.BlindedBeaconBlock{} if err := response.Data.Electra.UnmarshalSSZ(res.body); err != nil { return nil, errors.Join(errors.New("failed to decode electra blinded beacon block proposal"), err) @@ -177,7 +177,7 @@ func (*Service) blindedProposalFromJSON(res *httpResponse) (*api.Response[*api.V bytes.NewReader(res.body), &apiv1deneb.BlindedBeaconBlock{}, ) - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: response.Data.Electra, response.Metadata, err = decodeJSONResponse( bytes.NewReader(res.body), &apiv1electra.BlindedBeaconBlock{}, diff --git a/http/proposal.go b/http/proposal.go index bbdcfd1..e5f8f5a 100644 --- a/http/proposal.go +++ b/http/proposal.go @@ -218,7 +218,7 @@ func (s *Service) beaconBlockProposalFromSSZ(ctx context.Context, err = response.Data.Deneb.UnmarshalSSZ(res.body) } } - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if response.Data.Blinded { response.Data.ElectraBlinded = &apiv1electra.BlindedBeaconBlock{} if s.customSpecSupport { @@ -309,7 +309,7 @@ func (s *Service) beaconBlockProposalFromJSON(res *httpResponse) (*api.Response[ &apiv1deneb.BlockContents{}, ) } - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: if response.Data.Blinded { response.Data.ElectraBlinded, response.Metadata, err = decodeJSONResponse( bytes.NewReader(res.body), diff --git a/http/signedbeaconblock.go b/http/signedbeaconblock.go index d41dfbb..65c1934 100644 --- a/http/signedbeaconblock.go +++ b/http/signedbeaconblock.go @@ -143,7 +143,7 @@ func (s *Service) signedBeaconBlockFromSSZ(ctx context.Context, if err != nil { return nil, errors.Join(errors.New("failed to decode deneb signed block contents"), err) } - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: response.Data.Electra = &electra.SignedBeaconBlock{} if s.customSpecSupport { err = dynSSZ.UnmarshalSSZ(response.Data.Electra, res.body) @@ -189,7 +189,7 @@ func (*Service) signedBeaconBlockFromJSON(res *httpResponse) (*api.Response[*spe response.Data.Deneb, response.Metadata, err = decodeJSONResponse(bytes.NewReader(res.body), &deneb.SignedBeaconBlock{}, ) - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: response.Data.Electra, response.Metadata, err = decodeJSONResponse(bytes.NewReader(res.body), &electra.SignedBeaconBlock{}, ) diff --git a/http/submitbeaconblock.go b/http/submitbeaconblock.go index 39d5d7a..57cf532 100644 --- a/http/submitbeaconblock.go +++ b/http/submitbeaconblock.go @@ -49,7 +49,7 @@ func (s *Service) SubmitBeaconBlock(ctx context.Context, block *spec.VersionedSi specJSON, err = json.Marshal(block.Capella) case spec.DataVersionDeneb: specJSON, err = json.Marshal(block.Deneb) - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: specJSON, err = json.Marshal(block.Electra) default: err = errors.New("unknown block version") diff --git a/http/submitblindedbeaconblock.go b/http/submitblindedbeaconblock.go index 64945fd..9002ce8 100644 --- a/http/submitblindedbeaconblock.go +++ b/http/submitblindedbeaconblock.go @@ -50,7 +50,7 @@ func (s *Service) SubmitBlindedBeaconBlock(ctx context.Context, block *api.Versi specJSON, err = json.Marshal(block.Capella) case spec.DataVersionDeneb: specJSON, err = json.Marshal(block.Deneb) - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: specJSON, err = json.Marshal(block.Electra) default: err = errors.New("unknown block version") diff --git a/http/submitblindedproposal.go b/http/submitblindedproposal.go index ef49a05..0291a8e 100644 --- a/http/submitblindedproposal.go +++ b/http/submitblindedproposal.go @@ -53,7 +53,7 @@ func (s *Service) SubmitBlindedProposal(ctx context.Context, specJSON, err = json.Marshal(opts.Proposal.Capella) case spec.DataVersionDeneb: specJSON, err = json.Marshal(opts.Proposal.Deneb) - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: specJSON, err = json.Marshal(opts.Proposal.Electra) default: err = errors.New("unknown proposal version") diff --git a/http/submitproposal.go b/http/submitproposal.go index a63e1cf..1dd25b9 100644 --- a/http/submitproposal.go +++ b/http/submitproposal.go @@ -110,7 +110,7 @@ func (*Service) submitProposalJSON(_ context.Context, specJSON, err = json.Marshal(proposal.Capella) case spec.DataVersionDeneb: specJSON, err = json.Marshal(proposal.Deneb) - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: specJSON, err = json.Marshal(proposal.Electra) default: err = errors.New("unknown proposal version") @@ -146,7 +146,7 @@ func (*Service) submitProposalSSZ(_ context.Context, specSSZ, err = proposal.Capella.MarshalSSZ() case spec.DataVersionDeneb: specSSZ, err = proposal.Deneb.MarshalSSZ() - case spec.DataVersionAlpaca: + case spec.DataVersionAlpaca, spec.DataVersionBadger: specSSZ, err = proposal.Electra.MarshalSSZ() default: err = errors.New("unknown proposal version") diff --git a/spec/dataversion.go b/spec/dataversion.go index 4773aef..e50f3d3 100644 --- a/spec/dataversion.go +++ b/spec/dataversion.go @@ -36,6 +36,8 @@ const ( DataVersionDeneb // DataVersionAlpaca is data applicable for the Electra release of the beacon chain. DataVersionAlpaca + // DataVersionBadger is data applicable for the Badger release of the beacon chain. + DataVersionBadger ) var dataVersionStrings = [...]string{ @@ -46,6 +48,7 @@ var dataVersionStrings = [...]string{ "capella", "deneb", "alpaca", + "badger", } // MarshalJSON implements json.Marshaler. @@ -69,6 +72,8 @@ func (d *DataVersion) UnmarshalJSON(input []byte) error { *d = DataVersionDeneb case `"alpaca"`: *d = DataVersionAlpaca + case `"badger"`: + *d = DataVersionBadger default: err = fmt.Errorf("unrecognised data version %s", string(input)) } diff --git a/spec/versionedattestation.go b/spec/versionedattestation.go index f0e9a42..e4981f0 100644 --- a/spec/versionedattestation.go +++ b/spec/versionedattestation.go @@ -71,7 +71,7 @@ func (v *VersionedAttestation) AggregationBits() (bitfield.Bitlist, error) { } return v.Deneb.AggregationBits, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra attestation") } @@ -115,7 +115,7 @@ func (v *VersionedAttestation) Data() (*phase0.AttestationData, error) { } return v.Deneb.Data, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra attestation") } @@ -131,7 +131,7 @@ func (v *VersionedAttestation) CommitteeBits() (bitfield.Bitvector64, error) { switch v.Version { case DataVersionPhase0, DataVersionAltair, DataVersionBellatrix, DataVersionCapella, DataVersionDeneb: return nil, errors.New("attestation does not provide committee bits") - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra attestation") } @@ -175,7 +175,7 @@ func (v *VersionedAttestation) Signature() (phase0.BLSSignature, error) { } return v.Deneb.Signature, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return phase0.BLSSignature{}, errors.New("no Electra attestation") } @@ -219,7 +219,7 @@ func (v *VersionedAttestation) String() string { } return v.Deneb.String() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return "" } diff --git a/spec/versionedattesterslashing.go b/spec/versionedattesterslashing.go index b935db3..1957d8d 100644 --- a/spec/versionedattesterslashing.go +++ b/spec/versionedattesterslashing.go @@ -94,7 +94,7 @@ func (v *VersionedAttesterSlashing) Attestation1() (*VersionedIndexedAttestation } return &versionedIndexedAttestation, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra indexed attestation") } @@ -168,7 +168,7 @@ func (v *VersionedAttesterSlashing) Attestation2() (*VersionedIndexedAttestation } return &versionedIndexedAttestation, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra indexed attestation") } @@ -217,7 +217,7 @@ func (v *VersionedAttesterSlashing) String() string { } return v.Deneb.String() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return "" } diff --git a/spec/versionedbeaconblock.go b/spec/versionedbeaconblock.go index 7a32b2c..930c1c1 100644 --- a/spec/versionedbeaconblock.go +++ b/spec/versionedbeaconblock.go @@ -74,7 +74,7 @@ func (v *VersionedBeaconBlock) Slot() (phase0.Slot, error) { } return v.Deneb.Slot, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return 0, errors.New("no electra block") } @@ -133,7 +133,7 @@ func (v *VersionedBeaconBlock) RandaoReveal() (phase0.BLSSignature, error) { } return v.Deneb.Body.RANDAOReveal, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return phase0.BLSSignature{}, errors.New("no electra block") } @@ -195,7 +195,7 @@ func (v *VersionedBeaconBlock) Graffiti() ([32]byte, error) { } return v.Deneb.Body.Graffiti, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return [32]byte{}, errors.New("no electra block") } @@ -242,7 +242,7 @@ func (v *VersionedBeaconBlock) ProposerIndex() (phase0.ValidatorIndex, error) { } return v.Deneb.ProposerIndex, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return 0, errors.New("no electra block") } @@ -286,7 +286,7 @@ func (v *VersionedBeaconBlock) Root() (phase0.Root, error) { } return v.Deneb.HashTreeRoot() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return phase0.Root{}, errors.New("no electra block") } @@ -345,7 +345,7 @@ func (v *VersionedBeaconBlock) BodyRoot() (phase0.Root, error) { } return v.Deneb.Body.HashTreeRoot() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return phase0.Root{}, errors.New("no electra block") } @@ -392,7 +392,7 @@ func (v *VersionedBeaconBlock) ParentRoot() (phase0.Root, error) { } return v.Deneb.ParentRoot, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return phase0.Root{}, errors.New("no electra block") } @@ -436,7 +436,7 @@ func (v *VersionedBeaconBlock) StateRoot() (phase0.Root, error) { } return v.Deneb.StateRoot, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return phase0.Root{}, errors.New("no electra block") } @@ -520,7 +520,7 @@ func (v *VersionedBeaconBlock) Attestations() ([]VersionedAttestation, error) { } return versionedAttestations, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return nil, errors.New("no electra block") } @@ -612,7 +612,7 @@ func (v *VersionedBeaconBlock) AttesterSlashings() ([]VersionedAttesterSlashing, } return versionedAttesterSlashings, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return nil, errors.New("no electra block") } @@ -664,7 +664,7 @@ func (v *VersionedBeaconBlock) ProposerSlashings() ([]*phase0.ProposerSlashing, } return v.Deneb.Body.ProposerSlashings, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Body == nil { return nil, errors.New("no electra block") } @@ -708,7 +708,7 @@ func (v *VersionedBeaconBlock) String() string { } return v.Deneb.String() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return "" } diff --git a/spec/versionedbeaconblockbody.go b/spec/versionedbeaconblockbody.go index 870a183..e888719 100644 --- a/spec/versionedbeaconblockbody.go +++ b/spec/versionedbeaconblockbody.go @@ -66,7 +66,7 @@ func (v *VersionedBeaconBlockBody) String() string { } return v.Deneb.String() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return "" } diff --git a/spec/versionedbeaconstate.go b/spec/versionedbeaconstate.go index 3d3dc19..33f0bcd 100644 --- a/spec/versionedbeaconstate.go +++ b/spec/versionedbeaconstate.go @@ -73,7 +73,7 @@ func (v *VersionedBeaconState) Slot() (phase0.Slot, error) { } return v.Deneb.Slot, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return 0, errors.New("no Electra state") } @@ -101,7 +101,7 @@ func (v *VersionedBeaconState) NextWithdrawalValidatorIndex() (phase0.ValidatorI } return v.Deneb.NextWithdrawalValidatorIndex, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return 0, errors.New("no Electra state") } @@ -145,7 +145,7 @@ func (v *VersionedBeaconState) Validators() ([]*phase0.Validator, error) { } return v.Deneb.Validators, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra state") } @@ -189,7 +189,7 @@ func (v *VersionedBeaconState) ValidatorBalances() ([]phase0.Gwei, error) { } return v.Deneb.Balances, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra state") } @@ -205,7 +205,7 @@ func (v *VersionedBeaconState) DepositRequestsStartIndex() (uint64, error) { switch v.Version { case DataVersionPhase0, DataVersionAltair, DataVersionBellatrix, DataVersionCapella, DataVersionDeneb: return 0, errors.New("state does not provide deposit requests start index") - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return 0, errors.New("no Electra state") } @@ -221,7 +221,7 @@ func (v *VersionedBeaconState) DepositBalanceToConsume() (phase0.Gwei, error) { switch v.Version { case DataVersionPhase0, DataVersionAltair, DataVersionBellatrix, DataVersionCapella, DataVersionDeneb: return 0, errors.New("state does not provide deposit balance to consume") - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return 0, errors.New("no Electra state") } @@ -237,7 +237,7 @@ func (v *VersionedBeaconState) ExitBalanceToConsume() (phase0.Gwei, error) { switch v.Version { case DataVersionPhase0, DataVersionAltair, DataVersionBellatrix, DataVersionCapella, DataVersionDeneb: return 0, errors.New("state does not provide exit balance to consume") - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return 0, errors.New("no Electra state") } @@ -253,7 +253,7 @@ func (v *VersionedBeaconState) EarliestExitEpoch() (phase0.Epoch, error) { switch v.Version { case DataVersionPhase0, DataVersionAltair, DataVersionBellatrix, DataVersionCapella, DataVersionDeneb: return 0, errors.New("state does not provide earliest exit epoch") - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return 0, errors.New("no Electra state") } @@ -269,7 +269,7 @@ func (v *VersionedBeaconState) PendingDeposits() ([]*electra.PendingDeposit, err switch v.Version { case DataVersionPhase0, DataVersionAltair, DataVersionBellatrix, DataVersionCapella, DataVersionDeneb: return nil, errors.New("state does not provide pending deposits") - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra state") } @@ -285,7 +285,7 @@ func (v *VersionedBeaconState) PendingPartialWithdrawals() ([]*electra.PendingPa switch v.Version { case DataVersionPhase0, DataVersionAltair, DataVersionBellatrix, DataVersionCapella, DataVersionDeneb: return nil, errors.New("state does not provide pending partial withdrawals") - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra state") } @@ -329,7 +329,7 @@ func (v *VersionedBeaconState) String() string { } return v.Deneb.String() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return "" } diff --git a/spec/versionedindexedattestation.go b/spec/versionedindexedattestation.go index a85b6f7..b4a0fca 100644 --- a/spec/versionedindexedattestation.go +++ b/spec/versionedindexedattestation.go @@ -69,7 +69,7 @@ func (v *VersionedIndexedAttestation) AttestingIndices() ([]uint64, error) { } return v.Deneb.AttestingIndices, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra indexed attestation") } @@ -113,7 +113,7 @@ func (v *VersionedIndexedAttestation) Data() (*phase0.AttestationData, error) { } return v.Deneb.Data, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return nil, errors.New("no Electra indexed attestation") } @@ -157,7 +157,7 @@ func (v *VersionedIndexedAttestation) Signature() (phase0.BLSSignature, error) { } return v.Deneb.Signature, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return phase0.BLSSignature{}, errors.New("no Electra indexed attestation") } @@ -201,7 +201,7 @@ func (v *VersionedIndexedAttestation) String() string { } return v.Deneb.String() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return "" } diff --git a/spec/versionedsignedbeaconblock.go b/spec/versionedsignedbeaconblock.go index f11c718..d0f6b68 100644 --- a/spec/versionedsignedbeaconblock.go +++ b/spec/versionedsignedbeaconblock.go @@ -69,7 +69,7 @@ func (v *VersionedSignedBeaconBlock) Slot() (phase0.Slot, error) { } return v.Deneb.Message.Slot, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return 0, errors.New("no electra block") } @@ -113,7 +113,7 @@ func (v *VersionedSignedBeaconBlock) ProposerIndex() (phase0.ValidatorIndex, err } return v.Deneb.Message.ProposerIndex, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return 0, errors.New("no electra block") } @@ -151,7 +151,7 @@ func (v *VersionedSignedBeaconBlock) ExecutionBlockHash() (phase0.Hash32, error) } return v.Deneb.Message.Body.ExecutionPayload.BlockHash, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || @@ -192,7 +192,7 @@ func (v *VersionedSignedBeaconBlock) ExecutionBlockNumber() (uint64, error) { } return v.Deneb.Message.Body.ExecutionPayload.BlockNumber, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || @@ -237,7 +237,7 @@ func (v *VersionedSignedBeaconBlock) ExecutionTransactions() ([]bellatrix.Transa } return v.Deneb.Message.Body.ExecutionPayload.Transactions, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || @@ -284,7 +284,7 @@ func (v *VersionedSignedBeaconBlock) Graffiti() ([32]byte, error) { } return v.Deneb.Message.Body.Graffiti, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return [32]byte{}, errors.New("no electra block") } @@ -370,7 +370,7 @@ func (v *VersionedSignedBeaconBlock) Attestations() ([]VersionedAttestation, err } return versionedAttestations, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return nil, errors.New("no electra block") } @@ -422,7 +422,7 @@ func (v *VersionedSignedBeaconBlock) Root() (phase0.Root, error) { } return v.Deneb.Message.HashTreeRoot() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return phase0.Root{}, errors.New("no electra block") } @@ -466,7 +466,7 @@ func (v *VersionedSignedBeaconBlock) BodyRoot() (phase0.Root, error) { } return v.Deneb.Message.Body.HashTreeRoot() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return phase0.Root{}, errors.New("no electra block") } @@ -510,7 +510,7 @@ func (v *VersionedSignedBeaconBlock) ParentRoot() (phase0.Root, error) { } return v.Deneb.Message.ParentRoot, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return phase0.Root{}, errors.New("no electra block") } @@ -554,7 +554,7 @@ func (v *VersionedSignedBeaconBlock) StateRoot() (phase0.Root, error) { } return v.Deneb.Message.StateRoot, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil { return phase0.Root{}, errors.New("no electra block") } @@ -598,7 +598,7 @@ func (v *VersionedSignedBeaconBlock) RandaoReveal() (phase0.BLSSignature, error) } return v.Deneb.Message.Body.RANDAOReveal, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return phase0.BLSSignature{}, errors.New("no electra block") } @@ -642,7 +642,7 @@ func (v *VersionedSignedBeaconBlock) ETH1Data() (*phase0.ETH1Data, error) { } return v.Deneb.Message.Body.ETH1Data, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return nil, errors.New("no electra block") } @@ -686,7 +686,7 @@ func (v *VersionedSignedBeaconBlock) Deposits() ([]*phase0.Deposit, error) { } return v.Deneb.Message.Body.Deposits, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return nil, errors.New("no electra block") } @@ -730,7 +730,7 @@ func (v *VersionedSignedBeaconBlock) VoluntaryExits() ([]*phase0.SignedVoluntary } return v.Deneb.Message.Body.VoluntaryExits, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return nil, errors.New("no electra block") } @@ -816,7 +816,7 @@ func (v *VersionedSignedBeaconBlock) AttesterSlashings() ([]VersionedAttesterSla } return versionedAttesterSlashings, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return nil, errors.New("no electra block") } @@ -868,7 +868,7 @@ func (v *VersionedSignedBeaconBlock) ProposerSlashings() ([]*phase0.ProposerSlas } return v.Deneb.Message.Body.ProposerSlashings, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return nil, errors.New("no electra block") } @@ -903,7 +903,7 @@ func (v *VersionedSignedBeaconBlock) Withdrawals() ([]*capella.Withdrawal, error } return v.Deneb.Message.Body.ExecutionPayload.Withdrawals, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil || @@ -934,7 +934,7 @@ func (v *VersionedSignedBeaconBlock) BlobKZGCommitments() ([]deneb.KZGCommitment } return v.Deneb.Message.Body.BlobKZGCommitments, nil - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { return nil, errors.New("no electra block") } @@ -958,7 +958,7 @@ func (v *VersionedSignedBeaconBlock) ExecutionRequests() (*electra.ExecutionRequ return nil, errors.New("capella block does not have execution requests") case DataVersionDeneb: return nil, errors.New("deneb block does not have execution requests") - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil || v.Electra.Message == nil || v.Electra.Message.Body == nil { @@ -1004,7 +1004,7 @@ func (v *VersionedSignedBeaconBlock) String() string { } return v.Deneb.String() - case DataVersionAlpaca: + case DataVersionAlpaca, DataVersionBadger: if v.Electra == nil { return "" }