Documentation ¶
Overview ¶
Code generated by fastssz. DO NOT EDIT. Hash: 7b06aa2a0612821c21a42cced443e791afc5c4f842d09312d0f29e40102138a3 Version: 0.1.3
Index ¶
- Constants
- Variables
- func BuildHistoricalSummariesProof(beaconState deneb.BeaconState) ([][]byte, error)
- func CalcSyncPeriod(slot uint64) uint64
- func ComputeSigningRoot(root common.Root, domain common.BLSDomain) common.Root
- func IsFinalityProofValid(attestedHeader common.BeaconBlockHeader, ...) bool
- func IsNextCommitteeProofValid(attestedHeader common.BeaconBlockHeader, nextCommittee common.SyncCommittee, ...) bool
- func NewBeaconStorage(config storage2.PortalStorageConfig, db *sql.DB) (storage2.ContentStorage, error)
- type API
- func (p *API) BeaconAddEnr(enr string) (bool, error)
- func (p *API) BeaconDeleteEnr(nodeId string) (bool, error)
- func (p *API) BeaconFindContent(enr string, contentKey string) (interface{}, error)
- func (p *API) BeaconFindNodes(enr string, distances []uint) ([]string, error)
- func (p *API) BeaconGetContent(contentKeyHex string) (*portalwire.ContentInfo, error)
- func (p *API) BeaconGetEnr(nodeId string) (string, error)
- func (p *API) BeaconGossip(contentKeyHex, contentHex string) (int, error)
- func (p *API) BeaconLocalContent(contentKeyHex string) (string, error)
- func (p *API) BeaconLookupEnr(nodeId string) (string, error)
- func (p *API) BeaconOffer(enr string, contentItems [][2]string) (string, error)
- func (p *API) BeaconPing(enr string) (*portalwire.PortalPongResp, error)
- func (p *API) BeaconRecursiveFindNodes(nodeId string) ([]string, error)
- func (p *API) BeaconRoutingTableInfo() *portalwire.RoutingTableInfo
- func (p *API) BeaconStore(contentKeyHex string, contextHex string) (bool, error)
- func (p *API) BeaconTraceGetContent(contentKeyHex string) (*portalwire.TraceContentResult, error)
- type BaseConfig
- type ChainConfig
- type Config
- type ConsensusAPI
- type ConsensusLightClient
- func (c *ConsensusLightClient) Advance() error
- func (c *ConsensusLightClient) ApplyFinalityUpdate(update common.SpecObj) error
- func (c *ConsensusLightClient) ApplyGenericUpdate(update *GenericUpdate)
- func (c *ConsensusLightClient) ApplyOptimisticUpdate(update common.SpecObj) error
- func (c *ConsensusLightClient) ApplyUpdate(update common.SpecObj) error
- func (c *ConsensusLightClient) ComputeCommitteeSignRoot(headerRoot tree.Root, slot common.Slot) common.Root
- func (c *ConsensusLightClient) GetFinalityHeader() *common.BeaconBlockHeader
- func (c *ConsensusLightClient) GetHeader() *common.BeaconBlockHeader
- func (c *ConsensusLightClient) Sync() error
- func (c *ConsensusLightClient) VerifyFinalityUpdate(update common.SpecObj) error
- func (c *ConsensusLightClient) VerifyGenericUpdate(update *GenericUpdate) error
- func (c *ConsensusLightClient) VerifyOptimisticUpdate(update common.SpecObj) error
- func (c *ConsensusLightClient) VerifySyncCommitteeSignature(pks []common.BLSPubkey, attestedHeader common.BeaconBlockHeader, ...) (bool, error)
- func (c *ConsensusLightClient) VerifyUpdate(update common.SpecObj) error
- type ForkedHistoricalSummariesWithProof
- func (fhswp ForkedHistoricalSummariesWithProof) ByteLength(spec *common.Spec) uint64
- func (fhswp *ForkedHistoricalSummariesWithProof) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (fhswp ForkedHistoricalSummariesWithProof) FixedLength(_ *common.Spec) uint64
- func (fhswp ForkedHistoricalSummariesWithProof) HashTreeRoot(spec *common.Spec, h tree.HashFn) common.Root
- func (fhswp *ForkedHistoricalSummariesWithProof) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- type ForkedLightClientBootstrap
- func (flcb *ForkedLightClientBootstrap) ByteLength(spec *common.Spec) uint64
- func (flcb *ForkedLightClientBootstrap) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (flcb *ForkedLightClientBootstrap) FixedLength(_ *common.Spec) uint64
- func (flcb *ForkedLightClientBootstrap) HashTreeRoot(spec *common.Spec, h tree.HashFn) common.Root
- func (flcb *ForkedLightClientBootstrap) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- type ForkedLightClientFinalityUpdate
- func (flcfu *ForkedLightClientFinalityUpdate) ByteLength(spec *common.Spec) uint64
- func (flcfu *ForkedLightClientFinalityUpdate) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (flcfu *ForkedLightClientFinalityUpdate) FixedLength(_ *common.Spec) uint64
- func (flcfu *ForkedLightClientFinalityUpdate) HashTreeRoot(spec *common.Spec, h tree.HashFn) common.Root
- func (flcfu *ForkedLightClientFinalityUpdate) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- type ForkedLightClientOptimisticUpdate
- func (flcou *ForkedLightClientOptimisticUpdate) ByteLength(spec *common.Spec) uint64
- func (flcou *ForkedLightClientOptimisticUpdate) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (flcou *ForkedLightClientOptimisticUpdate) FixedLength(_ *common.Spec) uint64
- func (flcou *ForkedLightClientOptimisticUpdate) HashTreeRoot(spec *common.Spec, h tree.HashFn) common.Root
- func (flcou *ForkedLightClientOptimisticUpdate) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- type ForkedLightClientUpdate
- func (flcu *ForkedLightClientUpdate) ByteLength(spec *common.Spec) uint64
- func (flcu *ForkedLightClientUpdate) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (flcu *ForkedLightClientUpdate) FixedLength(_ *common.Spec) uint64
- func (flcu *ForkedLightClientUpdate) HashTreeRoot(spec *common.Spec, h tree.HashFn) common.Root
- func (flcu *ForkedLightClientUpdate) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- type GenericBootstrap
- type GenericUpdate
- type HistoricalSummariesProof
- func (hsp *HistoricalSummariesProof) ByteLength() uint64
- func (hsp *HistoricalSummariesProof) Deserialize(dr *codec.DecodingReader) error
- func (hsp *HistoricalSummariesProof) FixedLength() uint64
- func (hsp *HistoricalSummariesProof) HashTreeRoot(hFn tree.HashFn) common.Root
- func (hsp *HistoricalSummariesProof) Serialize(w *codec.EncodingWriter) error
- type HistoricalSummariesWithProof
- func (hswp *HistoricalSummariesWithProof) ByteLength(spec *common.Spec) uint64
- func (hswp *HistoricalSummariesWithProof) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (hswp *HistoricalSummariesWithProof) FixedLength(_ *common.Spec) uint64
- func (hswp *HistoricalSummariesWithProof) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root
- func (hswp *HistoricalSummariesWithProof) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- type HistoricalSummariesWithProofKey
- func (v HistoricalSummariesWithProofKey) ByteLength() uint64
- func (v *HistoricalSummariesWithProofKey) Deserialize(r *codec.DecodingReader) error
- func (v HistoricalSummariesWithProofKey) FixedLength() uint64
- func (v HistoricalSummariesWithProofKey) HashTreeRoot(h tree.HashFn) common.Root
- func (v HistoricalSummariesWithProofKey) Serialize(w *codec.EncodingWriter) error
- type LightClientBootstrapKey
- func (l *LightClientBootstrapKey) GetTree() (*ssz.Node, error)
- func (l *LightClientBootstrapKey) HashTreeRoot() ([32]byte, error)
- func (l *LightClientBootstrapKey) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (l *LightClientBootstrapKey) MarshalSSZ() ([]byte, error)
- func (l *LightClientBootstrapKey) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (l *LightClientBootstrapKey) SizeSSZ() (size int)
- func (l *LightClientBootstrapKey) UnmarshalSSZ(buf []byte) error
- type LightClientFinalityUpdateKey
- func (l *LightClientFinalityUpdateKey) GetTree() (*ssz.Node, error)
- func (l *LightClientFinalityUpdateKey) HashTreeRoot() ([32]byte, error)
- func (l *LightClientFinalityUpdateKey) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (l *LightClientFinalityUpdateKey) MarshalSSZ() ([]byte, error)
- func (l *LightClientFinalityUpdateKey) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (l *LightClientFinalityUpdateKey) SizeSSZ() (size int)
- func (l *LightClientFinalityUpdateKey) UnmarshalSSZ(buf []byte) error
- type LightClientOptimisticUpdateKey
- func (l *LightClientOptimisticUpdateKey) GetTree() (*ssz.Node, error)
- func (l *LightClientOptimisticUpdateKey) HashTreeRoot() ([32]byte, error)
- func (l *LightClientOptimisticUpdateKey) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (l *LightClientOptimisticUpdateKey) MarshalSSZ() ([]byte, error)
- func (l *LightClientOptimisticUpdateKey) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (l *LightClientOptimisticUpdateKey) SizeSSZ() (size int)
- func (l *LightClientOptimisticUpdateKey) UnmarshalSSZ(buf []byte) error
- type LightClientStore
- type LightClientUpdateKey
- func (l *LightClientUpdateKey) GetTree() (*ssz.Node, error)
- func (l *LightClientUpdateKey) HashTreeRoot() ([32]byte, error)
- func (l *LightClientUpdateKey) HashTreeRootWith(hh ssz.HashWalker) (err error)
- func (l *LightClientUpdateKey) MarshalSSZ() ([]byte, error)
- func (l *LightClientUpdateKey) MarshalSSZTo(buf []byte) (dst []byte, err error)
- func (l *LightClientUpdateKey) SizeSSZ() (size int)
- func (l *LightClientUpdateKey) UnmarshalSSZ(buf []byte) error
- type LightClientUpdateRange
- func (r LightClientUpdateRange) ByteLength(spec *common.Spec) (out uint64)
- func (r *LightClientUpdateRange) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
- func (r *LightClientUpdateRange) FixedLength(_ *common.Spec) uint64
- func (r LightClientUpdateRange) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root
- func (r LightClientUpdateRange) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
- type Network
- func (bn *Network) GetCheckpointData(checkpointHash tree.Root) (common.SpecObj, error)
- func (bn *Network) GetFinalityUpdate(finalizedSlot uint64) (common.SpecObj, error)
- func (bn *Network) GetOptimisticUpdate(optimisticSlot uint64) (common.SpecObj, error)
- func (bn *Network) GetUpdates(firstPeriod, count uint64) ([]common.SpecObj, error)
- func (bn *Network) Start() error
- func (bn *Network) Stop()
- type PortalLightApi
- func (p *PortalLightApi) ChainID() uint64
- func (p *PortalLightApi) GetBootstrap(blockRoot tree.Root) (common.SpecObj, error)
- func (p *PortalLightApi) GetFinalityUpdate() (common.SpecObj, error)
- func (p *PortalLightApi) GetOptimisticUpdate() (common.SpecObj, error)
- func (p *PortalLightApi) GetUpdates(firstPeriod uint64, count uint64) ([]common.SpecObj, error)
- func (p *PortalLightApi) Name() string
- type Storage
Constants ¶
const ( LightClientBootstrap storage.ContentType = 0x10 LightClientUpdate storage.ContentType = 0x11 LightClientFinalityUpdate storage.ContentType = 0x12 LightClientOptimisticUpdate storage.ContentType = 0x13 HistoricalSummaries storage.ContentType = 0x14 )
const BytesInMB uint64 = 1000 * 1000
const ContentKeyLookupQueryBeacon = `SELECT content_key FROM beacon WHERE content_id = (?1) LIMIT 1`
const ContentSizeLookupQueryBeacon = "SELECT content_size FROM beacon WHERE content_id = (?1)"
const ContentValueLookupQueryBeacon = `SELECT content_value FROM beacon WHERE content_id = (?1) LIMIT 1`
const CreateQueryDBBeacon = `` /* 242-byte string literal not displayed */
const DeleteQueryBeacon = `DELETE FROM beacon
WHERE content_id = (?1)`
const GenesisTime uint64 = 1606824023
const InsertLCUpdateQuery = `INSERT OR IGNORE INTO lc_update (period, value, score, update_size)
VALUES (?1, ?2, ?3, ?4)`
const InsertQueryBeacon = `` /* 135-byte string literal not displayed */
const LCUpdateCreateTable = `` /* 241-byte string literal not displayed */
const LCUpdateLookupQuery = `SELECT value FROM lc_update WHERE period = (?1) LIMIT 1`
const LCUpdateLookupQueryByRange = `SELECT value FROM lc_update WHERE period >= (?1) AND period < (?2)`
const LCUpdatePeriodLookupQuery = `SELECT period FROM lc_update WHERE period = (?1) LIMIT 1`
const LCUpdateTotalSizeQuery = `SELECT TOTAL(update_size) FROM lc_update`
const MainnetType = iota
const MaxRequestLightClientUpdates = 128
const TotalDataSizeQueryBeacon = "SELECT TOTAL(content_size) FROM beacon"
const TotalEntryCountQueryBeacon = "SELECT COUNT(*) FROM beacon"
Variables ¶
var ( ErrInsufficientParticipation = errors.New("insufficient participation") ErrInvalidTimestamp = errors.New("invalid timestamp") ErrInvalidPeriod = errors.New("invalid sync committee period") ErrNotRelevant = errors.New("update not relevant") ErrInvalidFinalityProof = errors.New("invalid finality proof") ErrInvalidNextSyncCommitteeProof = errors.New("invalid next sync committee proof") ErrInvalidSignature = errors.New("invalid sync committee signature") )
var ( Bellatrix common.ForkDigest = [4]byte{0x0, 0x0, 0x0, 0x0} Capella common.ForkDigest = [4]byte{0xbb, 0xa4, 0xda, 0x96} Deneb common.ForkDigest = [4]byte{0x6a, 0x95, 0xa1, 0xa9} )
Functions ¶
func BuildHistoricalSummariesProof ¶
func BuildHistoricalSummariesProof(beaconState deneb.BeaconState) ([][]byte, error)
func CalcSyncPeriod ¶
func ComputeSigningRoot ¶
func IsFinalityProofValid ¶
func IsFinalityProofValid(attestedHeader common.BeaconBlockHeader, finalityHeader common.BeaconBlockHeader, finalityBranch altair.FinalizedRootProofBranch) bool
func IsNextCommitteeProofValid ¶
func IsNextCommitteeProofValid(attestedHeader common.BeaconBlockHeader, nextCommittee common.SyncCommittee, nextCommitteeBranch altair.SyncCommitteeProofBranch) bool
func NewBeaconStorage ¶
func NewBeaconStorage(config storage2.PortalStorageConfig, db *sql.DB) (storage2.ContentStorage, error)
Types ¶
type API ¶
type API struct {
*portalwire.PortalProtocolAPI
}
func NewBeaconNetworkAPI ¶
func NewBeaconNetworkAPI(BeaconAPI *portalwire.PortalProtocolAPI) *API
func (*API) BeaconFindContent ¶
func (*API) BeaconFindNodes ¶
func (*API) BeaconGetContent ¶
func (p *API) BeaconGetContent(contentKeyHex string) (*portalwire.ContentInfo, error)
func (*API) BeaconGossip ¶
func (*API) BeaconLocalContent ¶
func (*API) BeaconOffer ¶
func (*API) BeaconPing ¶
func (p *API) BeaconPing(enr string) (*portalwire.PortalPongResp, error)
func (*API) BeaconRecursiveFindNodes ¶
func (*API) BeaconRoutingTableInfo ¶
func (p *API) BeaconRoutingTableInfo() *portalwire.RoutingTableInfo
func (*API) BeaconStore ¶
func (*API) BeaconTraceGetContent ¶
func (p *API) BeaconTraceGetContent(contentKeyHex string) (*portalwire.TraceContentResult, error)
type BaseConfig ¶
type BaseConfig struct { APIPort uint64 API string DefaultCheckpoint common.Root Chain ChainConfig Spec *common.Spec MaxCheckpointAge uint64 }
func Mainnet ¶
func Mainnet() *BaseConfig
func ToBaseConfig ¶
func ToBaseConfig(networkType int) (*BaseConfig, error)
type ChainConfig ¶
type ConsensusAPI ¶
type ConsensusLightClient ¶
type ConsensusLightClient struct { Store LightClientStore API ConsensusAPI InitialCheckpoint common.Root LastCheckpoint common.Root Config *Config Logger log.Logger }
func NewConsensusLightClient ¶
func NewConsensusLightClient(api ConsensusAPI, config *Config, checkpointBlockRoot common.Root, logger log.Logger) (*ConsensusLightClient, error)
func (*ConsensusLightClient) Advance ¶
func (c *ConsensusLightClient) Advance() error
func (*ConsensusLightClient) ApplyFinalityUpdate ¶
func (c *ConsensusLightClient) ApplyFinalityUpdate(update common.SpecObj) error
func (*ConsensusLightClient) ApplyGenericUpdate ¶
func (c *ConsensusLightClient) ApplyGenericUpdate(update *GenericUpdate)
func (*ConsensusLightClient) ApplyOptimisticUpdate ¶
func (c *ConsensusLightClient) ApplyOptimisticUpdate(update common.SpecObj) error
func (*ConsensusLightClient) ApplyUpdate ¶
func (c *ConsensusLightClient) ApplyUpdate(update common.SpecObj) error
func (*ConsensusLightClient) ComputeCommitteeSignRoot ¶
func (*ConsensusLightClient) GetFinalityHeader ¶
func (c *ConsensusLightClient) GetFinalityHeader() *common.BeaconBlockHeader
func (*ConsensusLightClient) GetHeader ¶
func (c *ConsensusLightClient) GetHeader() *common.BeaconBlockHeader
func (*ConsensusLightClient) Sync ¶
func (c *ConsensusLightClient) Sync() error
func (*ConsensusLightClient) VerifyFinalityUpdate ¶
func (c *ConsensusLightClient) VerifyFinalityUpdate(update common.SpecObj) error
func (*ConsensusLightClient) VerifyGenericUpdate ¶
func (c *ConsensusLightClient) VerifyGenericUpdate(update *GenericUpdate) error
func (*ConsensusLightClient) VerifyOptimisticUpdate ¶
func (c *ConsensusLightClient) VerifyOptimisticUpdate(update common.SpecObj) error
func (*ConsensusLightClient) VerifySyncCommitteeSignature ¶
func (c *ConsensusLightClient) VerifySyncCommitteeSignature(pks []common.BLSPubkey, attestedHeader common.BeaconBlockHeader, signature common.BLSSignature, signatureSlot common.Slot) (bool, error)
func (*ConsensusLightClient) VerifyUpdate ¶
func (c *ConsensusLightClient) VerifyUpdate(update common.SpecObj) error
type ForkedHistoricalSummariesWithProof ¶
type ForkedHistoricalSummariesWithProof struct { ForkDigest common.ForkDigest HistoricalSummariesWithProof HistoricalSummariesWithProof }
func (ForkedHistoricalSummariesWithProof) ByteLength ¶
func (fhswp ForkedHistoricalSummariesWithProof) ByteLength(spec *common.Spec) uint64
func (*ForkedHistoricalSummariesWithProof) Deserialize ¶
func (fhswp *ForkedHistoricalSummariesWithProof) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
func (ForkedHistoricalSummariesWithProof) FixedLength ¶
func (fhswp ForkedHistoricalSummariesWithProof) FixedLength(_ *common.Spec) uint64
func (ForkedHistoricalSummariesWithProof) HashTreeRoot ¶
func (*ForkedHistoricalSummariesWithProof) Serialize ¶
func (fhswp *ForkedHistoricalSummariesWithProof) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
type ForkedLightClientBootstrap ¶
type ForkedLightClientBootstrap struct { ForkDigest common.ForkDigest Bootstrap common.SpecObj }
func GetLightClientBootstrap ¶
func GetLightClientBootstrap(number uint8) (ForkedLightClientBootstrap, error)
func (*ForkedLightClientBootstrap) ByteLength ¶
func (flcb *ForkedLightClientBootstrap) ByteLength(spec *common.Spec) uint64
func (*ForkedLightClientBootstrap) Deserialize ¶
func (flcb *ForkedLightClientBootstrap) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
func (*ForkedLightClientBootstrap) FixedLength ¶
func (flcb *ForkedLightClientBootstrap) FixedLength(_ *common.Spec) uint64
func (*ForkedLightClientBootstrap) HashTreeRoot ¶
func (*ForkedLightClientBootstrap) Serialize ¶
func (flcb *ForkedLightClientBootstrap) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
type ForkedLightClientFinalityUpdate ¶
type ForkedLightClientFinalityUpdate struct { ForkDigest common.ForkDigest LightClientFinalityUpdate common.SpecObj }
func GetLightClientFinalityUpdate ¶
func GetLightClientFinalityUpdate(number uint8) (ForkedLightClientFinalityUpdate, error)
func (*ForkedLightClientFinalityUpdate) ByteLength ¶
func (flcfu *ForkedLightClientFinalityUpdate) ByteLength(spec *common.Spec) uint64
func (*ForkedLightClientFinalityUpdate) Deserialize ¶
func (flcfu *ForkedLightClientFinalityUpdate) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
func (*ForkedLightClientFinalityUpdate) FixedLength ¶
func (flcfu *ForkedLightClientFinalityUpdate) FixedLength(_ *common.Spec) uint64
func (*ForkedLightClientFinalityUpdate) HashTreeRoot ¶
func (*ForkedLightClientFinalityUpdate) Serialize ¶
func (flcfu *ForkedLightClientFinalityUpdate) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
type ForkedLightClientOptimisticUpdate ¶
type ForkedLightClientOptimisticUpdate struct { ForkDigest common.ForkDigest LightClientOptimisticUpdate common.SpecObj }
func GetLightClientOptimisticUpdate ¶
func GetLightClientOptimisticUpdate(number uint8) (ForkedLightClientOptimisticUpdate, error)
func (*ForkedLightClientOptimisticUpdate) ByteLength ¶
func (flcou *ForkedLightClientOptimisticUpdate) ByteLength(spec *common.Spec) uint64
func (*ForkedLightClientOptimisticUpdate) Deserialize ¶
func (flcou *ForkedLightClientOptimisticUpdate) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
func (*ForkedLightClientOptimisticUpdate) FixedLength ¶
func (flcou *ForkedLightClientOptimisticUpdate) FixedLength(_ *common.Spec) uint64
func (*ForkedLightClientOptimisticUpdate) HashTreeRoot ¶
func (*ForkedLightClientOptimisticUpdate) Serialize ¶
func (flcou *ForkedLightClientOptimisticUpdate) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
type ForkedLightClientUpdate ¶
type ForkedLightClientUpdate struct { ForkDigest common.ForkDigest LightClientUpdate common.SpecObj }
func GetClientUpdate ¶
func GetClientUpdate(number uint8) (ForkedLightClientUpdate, error)
func (*ForkedLightClientUpdate) ByteLength ¶
func (flcu *ForkedLightClientUpdate) ByteLength(spec *common.Spec) uint64
func (*ForkedLightClientUpdate) Deserialize ¶
func (flcu *ForkedLightClientUpdate) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
func (*ForkedLightClientUpdate) FixedLength ¶
func (flcu *ForkedLightClientUpdate) FixedLength(_ *common.Spec) uint64
func (*ForkedLightClientUpdate) HashTreeRoot ¶
func (*ForkedLightClientUpdate) Serialize ¶
func (flcu *ForkedLightClientUpdate) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
type GenericBootstrap ¶
type GenericBootstrap struct { Header *common.BeaconBlockHeader CurrentSyncCommittee common.SyncCommittee CurrentSyncCommitteeBranch altair.SyncCommitteeProofBranch }
func FromBootstrap ¶
func FromBootstrap(commonBootstrap common.SpecObj) (*GenericBootstrap, error)
type GenericUpdate ¶
type GenericUpdate struct { AttestedHeader *common.BeaconBlockHeader SyncAggregate *altair.SyncAggregate SignatureSlot common.Slot NextSyncCommittee *common.SyncCommittee NextSyncCommitteeBranch *altair.SyncCommitteeProofBranch FinalizedHeader *common.BeaconBlockHeader FinalityBranch *altair.FinalizedRootProofBranch }
func FromLightClientFinalityUpdate ¶
func FromLightClientFinalityUpdate(commonFinalityUpdate common.SpecObj) (*GenericUpdate, error)
func FromLightClientOptimisticUpdate ¶
func FromLightClientOptimisticUpdate(commonOptimisticUpdate common.SpecObj) (*GenericUpdate, error)
func FromLightClientUpdate ¶
func FromLightClientUpdate(commonUpdate common.SpecObj) (*GenericUpdate, error)
type HistoricalSummariesProof ¶
func (*HistoricalSummariesProof) ByteLength ¶
func (hsp *HistoricalSummariesProof) ByteLength() uint64
func (*HistoricalSummariesProof) Deserialize ¶
func (hsp *HistoricalSummariesProof) Deserialize(dr *codec.DecodingReader) error
func (*HistoricalSummariesProof) FixedLength ¶
func (hsp *HistoricalSummariesProof) FixedLength() uint64
func (*HistoricalSummariesProof) HashTreeRoot ¶
func (hsp *HistoricalSummariesProof) HashTreeRoot(hFn tree.HashFn) common.Root
func (*HistoricalSummariesProof) Serialize ¶
func (hsp *HistoricalSummariesProof) Serialize(w *codec.EncodingWriter) error
type HistoricalSummariesWithProof ¶
type HistoricalSummariesWithProof struct { EPOCH common.Epoch HistoricalSummaries capella.HistoricalSummaries Proof HistoricalSummariesProof }
func GetHistorySummariesWithProof ¶
func GetHistorySummariesWithProof() (HistoricalSummariesWithProof, common.Root, error)
func (*HistoricalSummariesWithProof) ByteLength ¶
func (hswp *HistoricalSummariesWithProof) ByteLength(spec *common.Spec) uint64
func (*HistoricalSummariesWithProof) Deserialize ¶
func (hswp *HistoricalSummariesWithProof) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
func (*HistoricalSummariesWithProof) FixedLength ¶
func (hswp *HistoricalSummariesWithProof) FixedLength(_ *common.Spec) uint64
func (*HistoricalSummariesWithProof) HashTreeRoot ¶
func (*HistoricalSummariesWithProof) Serialize ¶
func (hswp *HistoricalSummariesWithProof) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
type HistoricalSummariesWithProofKey ¶
type HistoricalSummariesWithProofKey struct {
Epoch uint64
}
func (HistoricalSummariesWithProofKey) ByteLength ¶
func (v HistoricalSummariesWithProofKey) ByteLength() uint64
func (*HistoricalSummariesWithProofKey) Deserialize ¶
func (v *HistoricalSummariesWithProofKey) Deserialize(r *codec.DecodingReader) error
func (HistoricalSummariesWithProofKey) FixedLength ¶
func (v HistoricalSummariesWithProofKey) FixedLength() uint64
func (HistoricalSummariesWithProofKey) HashTreeRoot ¶
func (v HistoricalSummariesWithProofKey) HashTreeRoot(h tree.HashFn) common.Root
func (HistoricalSummariesWithProofKey) Serialize ¶
func (v HistoricalSummariesWithProofKey) Serialize(w *codec.EncodingWriter) error
type LightClientBootstrapKey ¶
type LightClientBootstrapKey struct {
BlockHash []byte `ssz-size:"32"`
}
func (*LightClientBootstrapKey) GetTree ¶
func (l *LightClientBootstrapKey) GetTree() (*ssz.Node, error)
GetTree ssz hashes the LightClientBootstrapKey object
func (*LightClientBootstrapKey) HashTreeRoot ¶
func (l *LightClientBootstrapKey) HashTreeRoot() ([32]byte, error)
HashTreeRoot ssz hashes the LightClientBootstrapKey object
func (*LightClientBootstrapKey) HashTreeRootWith ¶
func (l *LightClientBootstrapKey) HashTreeRootWith(hh ssz.HashWalker) (err error)
HashTreeRootWith ssz hashes the LightClientBootstrapKey object with a hasher
func (*LightClientBootstrapKey) MarshalSSZ ¶
func (l *LightClientBootstrapKey) MarshalSSZ() ([]byte, error)
MarshalSSZ ssz marshals the LightClientBootstrapKey object
func (*LightClientBootstrapKey) MarshalSSZTo ¶
func (l *LightClientBootstrapKey) MarshalSSZTo(buf []byte) (dst []byte, err error)
MarshalSSZTo ssz marshals the LightClientBootstrapKey object to a target array
func (*LightClientBootstrapKey) SizeSSZ ¶
func (l *LightClientBootstrapKey) SizeSSZ() (size int)
SizeSSZ returns the ssz encoded size in bytes for the LightClientBootstrapKey object
func (*LightClientBootstrapKey) UnmarshalSSZ ¶
func (l *LightClientBootstrapKey) UnmarshalSSZ(buf []byte) error
UnmarshalSSZ ssz unmarshals the LightClientBootstrapKey object
type LightClientFinalityUpdateKey ¶
type LightClientFinalityUpdateKey struct {
FinalizedSlot uint64
}
func (*LightClientFinalityUpdateKey) GetTree ¶
func (l *LightClientFinalityUpdateKey) GetTree() (*ssz.Node, error)
GetTree ssz hashes the LightClientFinalityUpdateKey object
func (*LightClientFinalityUpdateKey) HashTreeRoot ¶
func (l *LightClientFinalityUpdateKey) HashTreeRoot() ([32]byte, error)
HashTreeRoot ssz hashes the LightClientFinalityUpdateKey object
func (*LightClientFinalityUpdateKey) HashTreeRootWith ¶
func (l *LightClientFinalityUpdateKey) HashTreeRootWith(hh ssz.HashWalker) (err error)
HashTreeRootWith ssz hashes the LightClientFinalityUpdateKey object with a hasher
func (*LightClientFinalityUpdateKey) MarshalSSZ ¶
func (l *LightClientFinalityUpdateKey) MarshalSSZ() ([]byte, error)
MarshalSSZ ssz marshals the LightClientFinalityUpdateKey object
func (*LightClientFinalityUpdateKey) MarshalSSZTo ¶
func (l *LightClientFinalityUpdateKey) MarshalSSZTo(buf []byte) (dst []byte, err error)
MarshalSSZTo ssz marshals the LightClientFinalityUpdateKey object to a target array
func (*LightClientFinalityUpdateKey) SizeSSZ ¶
func (l *LightClientFinalityUpdateKey) SizeSSZ() (size int)
SizeSSZ returns the ssz encoded size in bytes for the LightClientFinalityUpdateKey object
func (*LightClientFinalityUpdateKey) UnmarshalSSZ ¶
func (l *LightClientFinalityUpdateKey) UnmarshalSSZ(buf []byte) error
UnmarshalSSZ ssz unmarshals the LightClientFinalityUpdateKey object
type LightClientOptimisticUpdateKey ¶
type LightClientOptimisticUpdateKey struct {
OptimisticSlot uint64
}
func (*LightClientOptimisticUpdateKey) GetTree ¶
func (l *LightClientOptimisticUpdateKey) GetTree() (*ssz.Node, error)
GetTree ssz hashes the LightClientOptimisticUpdateKey object
func (*LightClientOptimisticUpdateKey) HashTreeRoot ¶
func (l *LightClientOptimisticUpdateKey) HashTreeRoot() ([32]byte, error)
HashTreeRoot ssz hashes the LightClientOptimisticUpdateKey object
func (*LightClientOptimisticUpdateKey) HashTreeRootWith ¶
func (l *LightClientOptimisticUpdateKey) HashTreeRootWith(hh ssz.HashWalker) (err error)
HashTreeRootWith ssz hashes the LightClientOptimisticUpdateKey object with a hasher
func (*LightClientOptimisticUpdateKey) MarshalSSZ ¶
func (l *LightClientOptimisticUpdateKey) MarshalSSZ() ([]byte, error)
MarshalSSZ ssz marshals the LightClientOptimisticUpdateKey object
func (*LightClientOptimisticUpdateKey) MarshalSSZTo ¶
func (l *LightClientOptimisticUpdateKey) MarshalSSZTo(buf []byte) (dst []byte, err error)
MarshalSSZTo ssz marshals the LightClientOptimisticUpdateKey object to a target array
func (*LightClientOptimisticUpdateKey) SizeSSZ ¶
func (l *LightClientOptimisticUpdateKey) SizeSSZ() (size int)
SizeSSZ returns the ssz encoded size in bytes for the LightClientOptimisticUpdateKey object
func (*LightClientOptimisticUpdateKey) UnmarshalSSZ ¶
func (l *LightClientOptimisticUpdateKey) UnmarshalSSZ(buf []byte) error
UnmarshalSSZ ssz unmarshals the LightClientOptimisticUpdateKey object
type LightClientStore ¶
type LightClientStore struct { FinalizedHeader *common.BeaconBlockHeader CurrentSyncCommittee *common.SyncCommittee NextSyncCommittee *common.SyncCommittee OptimisticHeader *common.BeaconBlockHeader PreviousMaxActiveParticipants view.Uint64View CurrentMaxActiveParticipants view.Uint64View }
type LightClientUpdateKey ¶
func (*LightClientUpdateKey) GetTree ¶
func (l *LightClientUpdateKey) GetTree() (*ssz.Node, error)
GetTree ssz hashes the LightClientUpdateKey object
func (*LightClientUpdateKey) HashTreeRoot ¶
func (l *LightClientUpdateKey) HashTreeRoot() ([32]byte, error)
HashTreeRoot ssz hashes the LightClientUpdateKey object
func (*LightClientUpdateKey) HashTreeRootWith ¶
func (l *LightClientUpdateKey) HashTreeRootWith(hh ssz.HashWalker) (err error)
HashTreeRootWith ssz hashes the LightClientUpdateKey object with a hasher
func (*LightClientUpdateKey) MarshalSSZ ¶
func (l *LightClientUpdateKey) MarshalSSZ() ([]byte, error)
MarshalSSZ ssz marshals the LightClientUpdateKey object
func (*LightClientUpdateKey) MarshalSSZTo ¶
func (l *LightClientUpdateKey) MarshalSSZTo(buf []byte) (dst []byte, err error)
MarshalSSZTo ssz marshals the LightClientUpdateKey object to a target array
func (*LightClientUpdateKey) SizeSSZ ¶
func (l *LightClientUpdateKey) SizeSSZ() (size int)
SizeSSZ returns the ssz encoded size in bytes for the LightClientUpdateKey object
func (*LightClientUpdateKey) UnmarshalSSZ ¶
func (l *LightClientUpdateKey) UnmarshalSSZ(buf []byte) error
UnmarshalSSZ ssz unmarshals the LightClientUpdateKey object
type LightClientUpdateRange ¶
type LightClientUpdateRange []ForkedLightClientUpdate
func (LightClientUpdateRange) ByteLength ¶
func (r LightClientUpdateRange) ByteLength(spec *common.Spec) (out uint64)
func (*LightClientUpdateRange) Deserialize ¶
func (r *LightClientUpdateRange) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error
func (*LightClientUpdateRange) FixedLength ¶
func (r *LightClientUpdateRange) FixedLength(_ *common.Spec) uint64
func (LightClientUpdateRange) HashTreeRoot ¶
func (LightClientUpdateRange) Serialize ¶
func (r LightClientUpdateRange) Serialize(spec *common.Spec, w *codec.EncodingWriter) error
type Network ¶
type Network struct {
// contains filtered or unexported fields
}
func NewBeaconNetwork ¶
func NewBeaconNetwork(portalProtocol *portalwire.PortalProtocol) *Network
func SetupBeaconNetwork ¶
func (*Network) GetCheckpointData ¶
func (*Network) GetFinalityUpdate ¶
func (*Network) GetOptimisticUpdate ¶
func (*Network) GetUpdates ¶
type PortalLightApi ¶
type PortalLightApi struct {
// contains filtered or unexported fields
}
func NewPortalLightApi ¶
func NewPortalLightApi() *PortalLightApi
func (*PortalLightApi) ChainID ¶
func (p *PortalLightApi) ChainID() uint64
ChainID implements ConsensusAPI.
func (*PortalLightApi) GetBootstrap ¶
GetBootstrap implements ConsensusAPI.
func (*PortalLightApi) GetFinalityUpdate ¶
func (p *PortalLightApi) GetFinalityUpdate() (common.SpecObj, error)
GetFinalityUpdate implements ConsensusAPI.
func (*PortalLightApi) GetOptimisticUpdate ¶
func (p *PortalLightApi) GetOptimisticUpdate() (common.SpecObj, error)
GetOptimisticUpdate implements ConsensusAPI.
func (*PortalLightApi) GetUpdates ¶
GetUpdates implements ConsensusAPI.