datacommittee

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: AGPL-3.0, AGPL-3.0-or-later Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

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

Backend implements the DAC integration

func New

func New(
	l1RPCURL string,
	dataCommitteeAddr common.Address,
	privKey *ecdsa.PrivateKey,
	dataCommitteeClientFactory client.Factory,
) (*Backend, error)

New creates an instance of Backend

func (*Backend) GetBatchL2Data

func (d *Backend) GetBatchL2Data(hash common.Hash) ([]byte, error)

GetBatchL2Data returns the data from the DAC. It checks that it matches with the expected hash

func (*Backend) GetSequence

func (d *Backend) GetSequence(_ context.Context, hashes []common.Hash, _ []byte) ([][]byte, error)

GetSequence gets backend data one hash at a time. This should be optimized on the DAC side to get them all at once.

func (*Backend) Init

func (d *Backend) Init() error

Init loads the DAC to be cached when needed

func (*Backend) PostSequence

func (s *Backend) PostSequence(ctx context.Context, batchesData [][]byte) ([]byte, error)

PostSequence sends the sequence data to the data availability backend, and returns the dataAvailabilityMessage as expected by the contract

type DataCommittee

type DataCommittee struct {
	AddressesHash      common.Hash
	Members            []DataCommitteeMember
	RequiredSignatures uint64
}

DataCommittee represents a specific committee

type DataCommitteeMember

type DataCommitteeMember struct {
	Addr common.Address
	URL  string
}

DataCommitteeMember represents a member of the Data Committee

Jump to

Keyboard shortcuts

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