history

package
v0.0.0-...-ae9da89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Overview

Code generated by fastssz. DO NOT EDIT. Hash: 61b113382a0931d2f239bb8712b2c09846d541b565494645b8d12d572b8b3dfb Version: 0.1.3

Index

Constants

View Source
const (
	XorFindFarthestQuery = `SELECT
		xor(key, (?1)) as distance
		FROM kvstore
		ORDER BY distance DESC`
)

Variables

View Source
var (
	ErrNotPreMergeHeader           = errors.New("must be pre merge header")
	ErrPreMergeHeaderMustWithProof = errors.New("pre merge header must has accumulator proof")
)
View Source
var (
	ErrWithdrawalHashIsNotEqual = errors.New("withdrawals hash is not equal")
	ErrTxHashIsNotEqual         = errors.New("tx hash is not equal")
	ErrUnclesHashIsNotEqual     = errors.New("uncles hash is not equal")
	ErrReceiptsHashIsNotEqual   = errors.New("receipts hash is not equal")
	ErrContentOutOfRange        = errors.New("content out of range")
	ErrHeaderWithProofIsInvalid = errors.New("header proof is invalid")
	ErrInvalidBlockHash         = errors.New("invalid block hash")
	ErrInvalidBlockNumber       = errors.New("invalid block number")
)

Functions

func DecodeBlockHeader

func DecodeBlockHeader(headerBytes []byte) (*types.Header, error)

func DecodePortalBlockBodyBytes

func DecodePortalBlockBodyBytes(bodyBytes []byte) (*types.Body, error)

func EncodeBlockBody

func EncodeBlockBody(body *types.Body) ([]byte, error)

EncodeBlockBody encode types.Body to ssz bytes

func EncodeReceipts

func EncodeReceipts(receipts []*types.Receipt) ([]byte, error)

func FromBlockBodyLegacy

func FromBlockBodyLegacy(b *BlockBodyLegacy) (*types.Body, error)

FromBlockBodyLegacy convert BlockBodyLegacy to types.Body

func FromPortalBlockBodyShanghai

func FromPortalBlockBodyShanghai(b *PortalBlockBodyShanghai) (*types.Body, error)

FromPortalBlockBodyShanghai convert PortalBlockBodyShanghai to types.Body

func FromPortalReceipts

func FromPortalReceipts(r *PortalReceipts) ([]*types.Receipt, error)

FromPortalReceipts convert PortalReceipts to types.Receipt

func GetEpochIndex

func GetEpochIndex(blockNumber uint64) uint64

func GetEpochIndexByHeader

func GetEpochIndexByHeader(header types.Header) uint64

func GetHeaderRecordIndex

func GetHeaderRecordIndex(blockNumber uint64) uint64

func GetHeaderRecordIndexByHeader

func GetHeaderRecordIndexByHeader(header types.Header) uint64

func MixInLength

func MixInLength(root [32]byte, length uint64) []byte

func NewDB

func NewDB(dataDir string, network string) (*sql.DB, error)

func ValidateBlockBodyBytes

func ValidateBlockBodyBytes(bodyBytes []byte, header *types.Header) (*types.Body, error)

func ValidateBlockHeaderBytes

func ValidateBlockHeaderBytes(headerBytes []byte, blockHash []byte) (*types.Header, error)

func ValidatePortalReceiptsBytes

func ValidatePortalReceiptsBytes(receiptBytes, receiptsRoot []byte) ([]*types.Receipt, error)

Types

type API

type API struct {
	*portalwire.PortalProtocolAPI
}

func NewHistoryNetworkAPI

func NewHistoryNetworkAPI(historyAPI *portalwire.PortalProtocolAPI) *API

func (*API) HistoryAddEnr

func (p *API) HistoryAddEnr(enr string) (bool, error)

func (*API) HistoryDeleteEnr

func (p *API) HistoryDeleteEnr(nodeId string) (bool, error)

func (*API) HistoryFindContent

func (p *API) HistoryFindContent(enr string, contentKey string) (interface{}, error)

func (*API) HistoryFindNodes

func (p *API) HistoryFindNodes(enr string, distances []uint) ([]string, error)

func (*API) HistoryGetContent

func (p *API) HistoryGetContent(contentKeyHex string) (*portalwire.ContentInfo, error)

func (*API) HistoryGetEnr

func (p *API) HistoryGetEnr(nodeId string) (string, error)

func (*API) HistoryGossip

func (p *API) HistoryGossip(contentKeyHex, contentHex string) (int, error)

func (*API) HistoryLocalContent

func (p *API) HistoryLocalContent(contentKeyHex string) (string, error)

func (*API) HistoryLookupEnr

func (p *API) HistoryLookupEnr(nodeId string) (string, error)

func (*API) HistoryOffer

func (p *API) HistoryOffer(enr string, contentItems [][2]string) (string, error)

func (*API) HistoryPing

func (p *API) HistoryPing(enr string) (*portalwire.PortalPongResp, error)

func (*API) HistoryRecursiveFindNodes

func (p *API) HistoryRecursiveFindNodes(nodeId string) ([]string, error)

func (*API) HistoryRoutingTableInfo

func (p *API) HistoryRoutingTableInfo() *portalwire.RoutingTableInfo

func (*API) HistoryStore

func (p *API) HistoryStore(contentKeyHex string, contextHex string) (bool, error)

func (*API) HistoryTraceGetContent

func (p *API) HistoryTraceGetContent(contentKeyHex string) (*portalwire.TraceContentResult, error)

type Accumulator

type Accumulator struct {
	// contains filtered or unexported fields
}

func NewAccumulator

func NewAccumulator() *Accumulator

func (*Accumulator) Finish

func (a *Accumulator) Finish() (*MasterAccumulator, error)

func (*Accumulator) Update

func (a *Accumulator) Update(header types.Header) error

type AccumulatorProof

type AccumulatorProof [][]byte

func BuildProof

func BuildProof(header types.Header, epochAccumulator EpochAccumulator) (AccumulatorProof, error)

type BeaconBlockBodyProof

type BeaconBlockBodyProof [beaconBlockBodyProofLen]common.Root

func (BeaconBlockBodyProof) ByteLength

func (b BeaconBlockBodyProof) ByteLength() (out uint64)

func (*BeaconBlockBodyProof) Deserialize

func (b *BeaconBlockBodyProof) Deserialize(dr *codec.DecodingReader) error

func (BeaconBlockBodyProof) FixedLength

func (b BeaconBlockBodyProof) FixedLength() uint64

func (*BeaconBlockBodyProof) HashTreeRoot

func (b *BeaconBlockBodyProof) HashTreeRoot(hFn tree.HashFn) common.Root

func (*BeaconBlockBodyProof) Serialize

type BeaconBlockHeaderProof

type BeaconBlockHeaderProof [beaconBlockHeaderProofLen]common.Root

func (BeaconBlockHeaderProof) ByteLength

func (b BeaconBlockHeaderProof) ByteLength() (out uint64)

func (*BeaconBlockHeaderProof) Deserialize

func (b *BeaconBlockHeaderProof) Deserialize(dr *codec.DecodingReader) error

func (BeaconBlockHeaderProof) FixedLength

func (b BeaconBlockHeaderProof) FixedLength() uint64

func (*BeaconBlockHeaderProof) HashTreeRoot

func (b *BeaconBlockHeaderProof) HashTreeRoot(hFn tree.HashFn) common.Root

func (*BeaconBlockHeaderProof) Serialize

type BlockBodyLegacy

type BlockBodyLegacy struct {
	Transactions [][]byte `ssz-max:"16384,16777216"`
	Uncles       []byte   `ssz-max:"131072"`
}

func (*BlockBodyLegacy) GetTree

func (b *BlockBodyLegacy) GetTree() (*ssz.Node, error)

GetTree ssz hashes the BlockBodyLegacy object

func (*BlockBodyLegacy) HashTreeRoot

func (b *BlockBodyLegacy) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the BlockBodyLegacy object

func (*BlockBodyLegacy) HashTreeRootWith

func (b *BlockBodyLegacy) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the BlockBodyLegacy object with a hasher

func (*BlockBodyLegacy) MarshalSSZ

func (b *BlockBodyLegacy) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the BlockBodyLegacy object

func (*BlockBodyLegacy) MarshalSSZTo

func (b *BlockBodyLegacy) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the BlockBodyLegacy object to a target array

func (*BlockBodyLegacy) SizeSSZ

func (b *BlockBodyLegacy) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the BlockBodyLegacy object

func (*BlockBodyLegacy) UnmarshalSSZ

func (b *BlockBodyLegacy) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the BlockBodyLegacy object

type BlockEpochData

type BlockEpochData struct {
	// contains filtered or unexported fields
}

type BlockHeaderProof

type BlockHeaderProof struct {
	Selector BlockHeaderProofType
	Proof    [][]byte `ssz-size:"15,32"`
}

BlockHeaderProof is a ssz union type Union[None, AccumulatorProof]

func (*BlockHeaderProof) HashTreeRootWith

func (p *BlockHeaderProof) HashTreeRootWith(_ ssz.HashWalker) (err error)

func (*BlockHeaderProof) MarshalSSZ

func (p *BlockHeaderProof) MarshalSSZ() ([]byte, error)

func (*BlockHeaderProof) MarshalSSZTo

func (p *BlockHeaderProof) MarshalSSZTo(buf []byte) (dst []byte, err error)

func (*BlockHeaderProof) SizeSSZ

func (p *BlockHeaderProof) SizeSSZ() (size int)

func (*BlockHeaderProof) UnmarshalSSZ

func (p *BlockHeaderProof) UnmarshalSSZ(buf []byte) (err error)

type BlockHeaderProofType

type BlockHeaderProofType uint8

type BlockHeaderWithProof

type BlockHeaderWithProof struct {
	Header []byte            `ssz-max:"8192"`
	Proof  *BlockHeaderProof `ssz-max:"512"`
}

func BuildHeaderWithProof

func BuildHeaderWithProof(header types.Header, epochAccumulator EpochAccumulator) (*BlockHeaderWithProof, error)

func DecodeBlockHeaderWithProof

func DecodeBlockHeaderWithProof(content []byte) (*BlockHeaderWithProof, error)

func (*BlockHeaderWithProof) GetTree

func (b *BlockHeaderWithProof) GetTree() (*ssz.Node, error)

GetTree ssz hashes the BlockHeaderWithProof object

func (*BlockHeaderWithProof) HashTreeRoot

func (b *BlockHeaderWithProof) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the BlockHeaderWithProof object

func (*BlockHeaderWithProof) HashTreeRootWith

func (b *BlockHeaderWithProof) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the BlockHeaderWithProof object with a hasher

func (*BlockHeaderWithProof) MarshalSSZ

func (b *BlockHeaderWithProof) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the BlockHeaderWithProof object

func (*BlockHeaderWithProof) MarshalSSZTo

func (b *BlockHeaderWithProof) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the BlockHeaderWithProof object to a target array

func (*BlockHeaderWithProof) SizeSSZ

func (b *BlockHeaderWithProof) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the BlockHeaderWithProof object

func (*BlockHeaderWithProof) UnmarshalSSZ

func (b *BlockHeaderWithProof) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the BlockHeaderWithProof object

type BlockNumberKey

type BlockNumberKey view.Uint64View

type ContentKey

type ContentKey struct {
	// contains filtered or unexported fields
}

type ContentStorage

type ContentStorage struct {
	// contains filtered or unexported fields
}

func (*ContentStorage) Close

func (p *ContentStorage) Close() error

func (*ContentStorage) ContentCount

func (p *ContentStorage) ContentCount() (uint64, error)

ContentCount return the total content count

func (*ContentStorage) ContentSize

func (p *ContentStorage) ContentSize() (uint64, error)

func (*ContentStorage) EstimateNewRadius

func (p *ContentStorage) EstimateNewRadius(currentRadius *uint256.Int) (*uint256.Int, error)

EstimateNewRadius calculates an estimated new radius based on the current radius, used size, and storage capacity. The method takes the currentRadius as input and returns the estimated new radius and an error (if any). It calculates the size ratio of usedSize to storageCapacityInBytes and adjusts the currentRadius accordingly. If the size ratio is greater than 0, it performs the adjustment; otherwise, it returns the currentRadius unchanged. The method returns an error if there is any issue in determining the used size.

func (*ContentStorage) ForcePrune

func (p *ContentStorage) ForcePrune(radius *uint256.Int) error

ForcePrune delete the content which distance is further than the given radius

func (*ContentStorage) Get

func (p *ContentStorage) Get(contentKey []byte, contentId []byte) ([]byte, error)

Get the content according to the contentId

func (*ContentStorage) GetLargestDistance

func (p *ContentStorage) GetLargestDistance() (*uint256.Int, error)

GetLargestDistance find the largest distance

func (*ContentStorage) Put

func (p *ContentStorage) Put(contentKey []byte, contentId []byte, content []byte) error

func (*ContentStorage) Radius

func (p *ContentStorage) Radius() *uint256.Int

func (*ContentStorage) ReclaimSpace

func (p *ContentStorage) ReclaimSpace() error

ReclaimSpace reclaims space in the ContentStorage's SQLite database by performing a VACUUM operation. It returns an error if the VACUUM operation encounters any issues.

func (*ContentStorage) Size

func (p *ContentStorage) Size() (uint64, error)

Size get database size, content size and similar

func (*ContentStorage) SizeByKey

func (p *ContentStorage) SizeByKey(contentId []byte) (uint64, error)

func (*ContentStorage) SizeByKeys

func (p *ContentStorage) SizeByKeys(ids [][]byte) (uint64, error)

func (*ContentStorage) SizeOutRadius

func (p *ContentStorage) SizeOutRadius(radius *uint256.Int) (uint64, error)

func (*ContentStorage) UnusedSize

func (p *ContentStorage) UnusedSize() (uint64, error)

func (*ContentStorage) UsedSize

func (p *ContentStorage) UsedSize() (uint64, error)

UsedSize = Size - UnusedSize

type ContentType

type ContentType byte
const (
	BlockHeaderType       ContentType = 0x00
	BlockBodyType         ContentType = 0x01
	ReceiptsType          ContentType = 0x02
	BlockHeaderNumberType ContentType = 0x03
)

type EpochAccumulator

type EpochAccumulator struct {
	HeaderRecords [][]byte `ssz-size:"8192,64"`
}

func (*EpochAccumulator) GetTree

func (e *EpochAccumulator) GetTree() (*ssz.Node, error)

GetTree ssz hashes the EpochAccumulator object

func (*EpochAccumulator) HashTreeRoot

func (e *EpochAccumulator) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the EpochAccumulator object

func (*EpochAccumulator) HashTreeRootWith

func (e *EpochAccumulator) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the EpochAccumulator object with a hasher

func (*EpochAccumulator) MarshalSSZ

func (e *EpochAccumulator) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the EpochAccumulator object

func (*EpochAccumulator) MarshalSSZTo

func (e *EpochAccumulator) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the EpochAccumulator object to a target array

func (*EpochAccumulator) SizeSSZ

func (e *EpochAccumulator) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the EpochAccumulator object

func (*EpochAccumulator) UnmarshalSSZ

func (e *EpochAccumulator) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the EpochAccumulator object

type HeaderRecord

type HeaderRecord struct {
	BlockHash       []byte `ssz-size:"32"`
	TotalDifficulty []byte `ssz-size:"32"`
}

func (*HeaderRecord) GetTree

func (h *HeaderRecord) GetTree() (*ssz.Node, error)

GetTree ssz hashes the HeaderRecord object

func (*HeaderRecord) HashTreeRoot

func (h *HeaderRecord) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the HeaderRecord object

func (*HeaderRecord) HashTreeRootWith

func (h *HeaderRecord) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the HeaderRecord object with a hasher

func (*HeaderRecord) MarshalSSZ

func (h *HeaderRecord) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the HeaderRecord object

func (*HeaderRecord) MarshalSSZTo

func (h *HeaderRecord) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the HeaderRecord object to a target array

func (*HeaderRecord) SizeSSZ

func (h *HeaderRecord) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the HeaderRecord object

func (*HeaderRecord) UnmarshalSSZ

func (h *HeaderRecord) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the HeaderRecord object

type HistoricalRoots

type HistoricalRoots []common.Root

func (HistoricalRoots) ByteLength

func (h HistoricalRoots) ByteLength(spec *common.Spec) uint64

func (*HistoricalRoots) Deserialize

func (h *HistoricalRoots) Deserialize(spec *common.Spec, dr *codec.DecodingReader) error

func (*HistoricalRoots) FixedLength

func (h *HistoricalRoots) FixedLength(_ *common.Spec) uint64

func (HistoricalRoots) HashTreeRoot

func (h HistoricalRoots) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (HistoricalRoots) Serialize

func (h HistoricalRoots) Serialize(spec *common.Spec, w *codec.EncodingWriter) error

type HistoricalRootsAccumulator

type HistoricalRootsAccumulator struct {
	HistoricalRoots HistoricalRoots
}

func NewHistoricalRootsAccumulator

func NewHistoricalRootsAccumulator(spec *common.Spec) (HistoricalRootsAccumulator, error)

func (HistoricalRootsAccumulator) VerifyPostMergePreCapellaHeader

func (h HistoricalRootsAccumulator) VerifyPostMergePreCapellaHeader(blockNumber uint64, headerHash common.Root, proof *HistoricalRootsBlockProof) error

type HistoricalRootsBlockProof

type HistoricalRootsBlockProof struct {
	BeaconBlockBodyProof   BeaconBlockBodyProof   `yaml:"beacon_block_body_proof" json:"beacon_block_body_proof"`
	BeaconBlockBodyRoot    common.Root            `yaml:"beacon_block_body_root" json:"beacon_block_body_root"`
	BeaconBlockHeaderProof BeaconBlockHeaderProof `yaml:"beacon_block_header_proof" json:"beacon_block_header_proof"`
	BeaconBlockHeaderRoot  common.Root            `yaml:"beacon_block_header_root" json:"beacon_block_header_root"`
	HistoricalRootsProof   HistoricalRootsProof   `yaml:"historical_roots_proof" json:"historical_roots_proof"`
	Slot                   common.Slot            `yaml:"slot" json:"slot"`
}

func (*HistoricalRootsBlockProof) ByteLength

func (h *HistoricalRootsBlockProof) ByteLength(spec *common.Spec) uint64

func (*HistoricalRootsBlockProof) Deserialize

func (*HistoricalRootsBlockProof) FixedLength

func (h *HistoricalRootsBlockProof) FixedLength(spec *common.Spec) uint64

func (*HistoricalRootsBlockProof) HashTreeRoot

func (h *HistoricalRootsBlockProof) HashTreeRoot(spec *common.Spec, hFn tree.HashFn) common.Root

func (*HistoricalRootsBlockProof) Serialize

type HistoricalRootsProof

type HistoricalRootsProof [historicalRootsProofLen]common.Root

func (HistoricalRootsProof) ByteLength

func (b HistoricalRootsProof) ByteLength() (out uint64)

func (*HistoricalRootsProof) Deserialize

func (b *HistoricalRootsProof) Deserialize(dr *codec.DecodingReader) error

func (HistoricalRootsProof) FixedLength

func (b HistoricalRootsProof) FixedLength() uint64

func (*HistoricalRootsProof) HashTreeRoot

func (b *HistoricalRootsProof) HashTreeRoot(hFn tree.HashFn) common.Root

func (*HistoricalRootsProof) Serialize

type MasterAccumulator

type MasterAccumulator struct {
	HistoricalEpochs [][]byte `ssz-max:"1897,32" ssz-size:"?,32"`
}

func NewMasterAccumulator

func NewMasterAccumulator() (MasterAccumulator, error)

func (MasterAccumulator) Contains

func (f MasterAccumulator) Contains(epochHash []byte) bool

func (MasterAccumulator) GetBlockEpochDataForBlockNumber

func (f MasterAccumulator) GetBlockEpochDataForBlockNumber(blockNumber uint64) BlockEpochData

func (*MasterAccumulator) GetTree

func (m *MasterAccumulator) GetTree() (*ssz.Node, error)

GetTree ssz hashes the MasterAccumulator object

func (*MasterAccumulator) HashTreeRoot

func (m *MasterAccumulator) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the MasterAccumulator object

func (*MasterAccumulator) HashTreeRootWith

func (m *MasterAccumulator) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the MasterAccumulator object with a hasher

func (*MasterAccumulator) MarshalSSZ

func (m *MasterAccumulator) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the MasterAccumulator object

func (*MasterAccumulator) MarshalSSZTo

func (m *MasterAccumulator) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the MasterAccumulator object to a target array

func (*MasterAccumulator) SizeSSZ

func (m *MasterAccumulator) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the MasterAccumulator object

func (*MasterAccumulator) UnmarshalSSZ

func (m *MasterAccumulator) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the MasterAccumulator object

func (MasterAccumulator) VerifyAccumulatorProof

func (f MasterAccumulator) VerifyAccumulatorProof(header types.Header, proof AccumulatorProof) (bool, error)

func (MasterAccumulator) VerifyHeader

func (f MasterAccumulator) VerifyHeader(header types.Header, headerProof BlockHeaderProof) (bool, error)

type Network

type Network struct {
	// contains filtered or unexported fields
}

func NewHistoryNetwork

func NewHistoryNetwork(portalProtocol *portalwire.PortalProtocol, accu *MasterAccumulator) *Network

func (*Network) GetBlockBody

func (h *Network) GetBlockBody(blockHash []byte) (*types.Body, error)

func (*Network) GetBlockHeader

func (h *Network) GetBlockHeader(blockHash []byte) (*types.Header, error)

func (*Network) GetReceipts

func (h *Network) GetReceipts(blockHash []byte) ([]*types.Receipt, error)

func (*Network) Start

func (h *Network) Start() error

func (*Network) Stop

func (h *Network) Stop()

type PortalBlockBodyShanghai

type PortalBlockBodyShanghai struct {
	Transactions [][]byte `ssz-max:"16384,16777216"`
	Uncles       []byte   `ssz-max:"131072"`
	Withdrawals  [][]byte `ssz-max:"16,192"`
}

func (*PortalBlockBodyShanghai) GetTree

func (p *PortalBlockBodyShanghai) GetTree() (*ssz.Node, error)

GetTree ssz hashes the PortalBlockBodyShanghai object

func (*PortalBlockBodyShanghai) HashTreeRoot

func (p *PortalBlockBodyShanghai) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the PortalBlockBodyShanghai object

func (*PortalBlockBodyShanghai) HashTreeRootWith

func (p *PortalBlockBodyShanghai) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the PortalBlockBodyShanghai object with a hasher

func (*PortalBlockBodyShanghai) MarshalSSZ

func (p *PortalBlockBodyShanghai) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the PortalBlockBodyShanghai object

func (*PortalBlockBodyShanghai) MarshalSSZTo

func (p *PortalBlockBodyShanghai) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the PortalBlockBodyShanghai object to a target array

func (*PortalBlockBodyShanghai) SizeSSZ

func (p *PortalBlockBodyShanghai) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the PortalBlockBodyShanghai object

func (*PortalBlockBodyShanghai) UnmarshalSSZ

func (p *PortalBlockBodyShanghai) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the PortalBlockBodyShanghai object

type PortalReceipts

type PortalReceipts struct {
	Receipts [][]byte `ssz-max:"16384,134217728"`
}

func ToPortalReceipts

func ToPortalReceipts(receipts []*types.Receipt) (*PortalReceipts, error)

ToPortalReceipts convert types.Receipt to PortalReceipts

func (*PortalReceipts) GetTree

func (p *PortalReceipts) GetTree() (*ssz.Node, error)

GetTree ssz hashes the PortalReceipts object

func (*PortalReceipts) HashTreeRoot

func (p *PortalReceipts) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the PortalReceipts object

func (*PortalReceipts) HashTreeRootWith

func (p *PortalReceipts) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the PortalReceipts object with a hasher

func (*PortalReceipts) MarshalSSZ

func (p *PortalReceipts) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the PortalReceipts object

func (*PortalReceipts) MarshalSSZTo

func (p *PortalReceipts) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the PortalReceipts object to a target array

func (*PortalReceipts) SizeSSZ

func (p *PortalReceipts) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the PortalReceipts object

func (*PortalReceipts) UnmarshalSSZ

func (p *PortalReceipts) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the PortalReceipts object

type PutResult

type PutResult struct {
	// contains filtered or unexported fields
}

func (*PutResult) Err

func (p *PutResult) Err() error

func (*PutResult) Pruned

func (p *PutResult) Pruned() bool

func (*PutResult) PrunedCount

func (p *PutResult) PrunedCount() int

type SSZProof

type SSZProof struct {
	Leaf      []byte   `ssz-size:"32"`
	Witnesses [][]byte `ssz-max:"65536,32" ssz-size:"?,32"`
}

func (*SSZProof) GetTree

func (s *SSZProof) GetTree() (*ssz.Node, error)

GetTree ssz hashes the SSZProof object

func (*SSZProof) HashTreeRoot

func (s *SSZProof) HashTreeRoot() ([32]byte, error)

HashTreeRoot ssz hashes the SSZProof object

func (*SSZProof) HashTreeRootWith

func (s *SSZProof) HashTreeRootWith(hh ssz.HashWalker) (err error)

HashTreeRootWith ssz hashes the SSZProof object with a hasher

func (*SSZProof) MarshalSSZ

func (s *SSZProof) MarshalSSZ() ([]byte, error)

MarshalSSZ ssz marshals the SSZProof object

func (*SSZProof) MarshalSSZTo

func (s *SSZProof) MarshalSSZTo(buf []byte) (dst []byte, err error)

MarshalSSZTo ssz marshals the SSZProof object to a target array

func (*SSZProof) SizeSSZ

func (s *SSZProof) SizeSSZ() (size int)

SizeSSZ returns the ssz encoded size in bytes for the SSZProof object

func (*SSZProof) UnmarshalSSZ

func (s *SSZProof) UnmarshalSSZ(buf []byte) error

UnmarshalSSZ ssz unmarshals the SSZProof object

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL