Skip to content

Commit 3731fcd

Browse files
committed
Ditch umbracle for prysm
1 parent e63c997 commit 3731fcd

1 file changed

Lines changed: 15 additions & 14 deletions

File tree

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

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ import (
1212

1313
"github.com/ethereum/go-ethereum/common"
1414
"github.com/goccy/go-json"
15-
"github.com/prysmaticlabs/prysm/v3/crypto/bls"
16-
gec "github.com/umbracle/go-eth-consensus"
15+
"github.com/prysmaticlabs/prysm/v5/crypto/bls"
16+
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
1717
eth2types "github.com/wealdtech/go-eth2-types/v2"
1818
"golang.org/x/sync/errgroup"
1919
"google.golang.org/protobuf/encoding/protojson"
@@ -520,36 +520,37 @@ func (c *StandardHttpClient) GetAttestationsRaw(blockId string) (*attestationsRe
520520
}
521521

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

525-
// Unmarshal block SSZ
526525
if strings.EqualFold(resp.version, "phase0") {
527-
block := new(gec.SignedBeaconBlockPhase0)
526+
block := new(ethpb.SignedBeaconBlock)
528527
if err := block.UnmarshalSSZ(resp.body); err != nil {
529528
return nil, err
530529
}
531-
532530
attestations = block.Block.Body.Attestations
533531
} else if strings.EqualFold(resp.version, "altair") {
534-
block := new(gec.SignedBeaconBlockAltair)
532+
block := new(ethpb.SignedBeaconBlockAltair)
535533
if err := block.UnmarshalSSZ(resp.body); err != nil {
536534
return nil, err
537535
}
538-
539536
attestations = block.Block.Body.Attestations
540537
} else if strings.EqualFold(resp.version, "bellatrix") {
541-
block := new(gec.SignedBeaconBlockBellatrix)
538+
block := new(ethpb.SignedBeaconBlockBellatrix)
542539
if err := block.UnmarshalSSZ(resp.body); err != nil {
543540
return nil, err
544541
}
545-
546542
attestations = block.Block.Body.Attestations
547543
} else if strings.EqualFold(resp.version, "capella") {
548-
block := new(gec.SignedBeaconBlockCapella)
544+
block := new(ethpb.SignedBeaconBlockCapella)
545+
if err := block.UnmarshalSSZ(resp.body); err != nil {
546+
return nil, err
547+
}
548+
attestations = block.Block.Body.Attestations
549+
} else if strings.EqualFold(resp.version, "deneb") {
550+
block := new(ethpb.SignedBeaconBlockDeneb)
549551
if err := block.UnmarshalSSZ(resp.body); err != nil {
550552
return nil, err
551553
}
552-
553554
attestations = block.Block.Body.Attestations
554555
} else {
555556
return nil, fmt.Errorf("unknown consensus version header: %s", resp.version)
@@ -558,8 +559,8 @@ func (c *StandardHttpClient) ParseAttestationsResponseRaw(resp *attestationsResp
558559
out := make([]beacon.AttestationInfo, len(attestations))
559560
for i := range attestations {
560561
out[i].AggregationBits = attestations[i].AggregationBits
561-
out[i].SlotIndex = attestations[i].Data.Slot
562-
out[i].CommitteeIndex = attestations[i].Data.Index
562+
out[i].SlotIndex = uint64(attestations[i].Data.Slot)
563+
out[i].CommitteeIndex = uint64(attestations[i].Data.CommitteeIndex)
563564
}
564565

565566
return out, nil

0 commit comments

Comments
 (0)