Skip to content

Commit 9891b4f

Browse files
committed
Ditch umbracle for prysm
1 parent fb6e541 commit 9891b4f

1 file changed

Lines changed: 14 additions & 13 deletions

File tree

shared/services/beacon/client/std-http-client.go

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
"github.com/ethereum/go-ethereum/common"
1414
"github.com/goccy/go-json"
1515
"github.com/prysmaticlabs/prysm/v5/crypto/bls"
16+
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
1617
"github.com/rocket-pool/rocketpool-go/types"
17-
gec "github.com/umbracle/go-eth-consensus"
1818
eth2types "github.com/wealdtech/go-eth2-types/v2"
1919
"golang.org/x/sync/errgroup"
2020
"google.golang.org/protobuf/encoding/protojson"
@@ -521,36 +521,37 @@ func (c *StandardHttpClient) GetAttestationsRaw(blockId string) (*attestationsRe
521521
}
522522

523523
func (c *StandardHttpClient) ParseAttestationsResponseRaw(resp *attestationsResponseRaw) ([]beacon.AttestationInfo, error) {
524-
var attestations []*gec.Attestation
524+
var attestations []*ethpb.Attestation
525525

526-
// Unmarshal block SSZ
527526
if strings.EqualFold(resp.version, "phase0") {
528-
block := new(gec.SignedBeaconBlockPhase0)
527+
block := new(ethpb.SignedBeaconBlock)
529528
if err := block.UnmarshalSSZ(resp.body); err != nil {
530529
return nil, err
531530
}
532-
533531
attestations = block.Block.Body.Attestations
534532
} else if strings.EqualFold(resp.version, "altair") {
535-
block := new(gec.SignedBeaconBlockAltair)
533+
block := new(ethpb.SignedBeaconBlockAltair)
536534
if err := block.UnmarshalSSZ(resp.body); err != nil {
537535
return nil, err
538536
}
539-
540537
attestations = block.Block.Body.Attestations
541538
} else if strings.EqualFold(resp.version, "bellatrix") {
542-
block := new(gec.SignedBeaconBlockBellatrix)
539+
block := new(ethpb.SignedBeaconBlockBellatrix)
543540
if err := block.UnmarshalSSZ(resp.body); err != nil {
544541
return nil, err
545542
}
546-
547543
attestations = block.Block.Body.Attestations
548544
} else if strings.EqualFold(resp.version, "capella") {
549-
block := new(gec.SignedBeaconBlockCapella)
545+
block := new(ethpb.SignedBeaconBlockCapella)
546+
if err := block.UnmarshalSSZ(resp.body); err != nil {
547+
return nil, err
548+
}
549+
attestations = block.Block.Body.Attestations
550+
} else if strings.EqualFold(resp.version, "deneb") {
551+
block := new(ethpb.SignedBeaconBlockDeneb)
550552
if err := block.UnmarshalSSZ(resp.body); err != nil {
551553
return nil, err
552554
}
553-
554555
attestations = block.Block.Body.Attestations
555556
} else {
556557
return nil, fmt.Errorf("unknown consensus version header: %s", resp.version)
@@ -559,8 +560,8 @@ func (c *StandardHttpClient) ParseAttestationsResponseRaw(resp *attestationsResp
559560
out := make([]beacon.AttestationInfo, len(attestations))
560561
for i := range attestations {
561562
out[i].AggregationBits = attestations[i].AggregationBits
562-
out[i].SlotIndex = attestations[i].Data.Slot
563-
out[i].CommitteeIndex = attestations[i].Data.Index
563+
out[i].SlotIndex = uint64(attestations[i].Data.Slot)
564+
out[i].CommitteeIndex = uint64(attestations[i].Data.CommitteeIndex)
564565
}
565566

566567
return out, nil

0 commit comments

Comments
 (0)