blob_storage

package
v3.0.0-alpha5.0...-c974331 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: LGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyAgainstIdentifiersAndInsertIntoTheBlobStore

func VerifyAgainstIdentifiersAndInsertIntoTheBlobStore(ctx context.Context, storage BlobStorage, identifiers *solid.ListSSZ[*cltypes.BlobIdentifier], sidecars []*cltypes.BlobSidecar, verifySignatureFn verifyHeaderSignatureFn) (uint64, uint64, error)

VerifyAgainstIdentifiersAndInsertIntoTheBlobStore does all due verification for blobs before database insertion. it also returns the latest correctly return blob.

Types

type BlobStorage

type BlobStorage interface {
	WriteBlobSidecars(ctx context.Context, blockRoot libcommon.Hash, blobSidecars []*cltypes.BlobSidecar) error
	RemoveBlobSidecars(ctx context.Context, slot uint64, blockRoot libcommon.Hash) error
	ReadBlobSidecars(ctx context.Context, slot uint64, blockRoot libcommon.Hash) (out []*cltypes.BlobSidecar, found bool, err error)
	WriteStream(w io.Writer, slot uint64, blockRoot libcommon.Hash, idx uint64) error // Used for P2P networking
	KzgCommitmentsCount(ctx context.Context, blockRoot libcommon.Hash) (uint32, error)
	Prune() error
}

func NewBlobStore

func NewBlobStore(db kv.RwDB, fs afero.Fs, slotsKept uint64, beaconChainConfig *clparams.BeaconChainConfig, ethClock eth_clock.EthereumClock) BlobStorage

type BlobStore

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

func (*BlobStore) KzgCommitmentsCount

func (bs *BlobStore) KzgCommitmentsCount(ctx context.Context, blockRoot libcommon.Hash) (uint32, error)

func (*BlobStore) Prune

func (bs *BlobStore) Prune() error

Do a bit of pruning

func (*BlobStore) ReadBlobSidecars

func (bs *BlobStore) ReadBlobSidecars(ctx context.Context, slot uint64, blockRoot libcommon.Hash) ([]*cltypes.BlobSidecar, bool, error)

ReadBlobSidecars reads the sidecars from the database. it assumes that all blobSidecars are for the same blockRoot and we have all of them.

func (*BlobStore) RemoveBlobSidecars

func (bs *BlobStore) RemoveBlobSidecars(ctx context.Context, slot uint64, blockRoot libcommon.Hash) error

func (*BlobStore) WriteBlobSidecars

func (bs *BlobStore) WriteBlobSidecars(ctx context.Context, blockRoot libcommon.Hash, blobSidecars []*cltypes.BlobSidecar) error

WriteBlobSidecars writes the sidecars on the database. it assumes that all blobSidecars are for the same blockRoot and we have all of them.

func (*BlobStore) WriteStream

func (bs *BlobStore) WriteStream(w io.Writer, slot uint64, blockRoot libcommon.Hash, idx uint64) error

Jump to

Keyboard shortcuts

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