Documentation ¶
Index ¶
- func InitStartBlock(parentCtx context.Context, db db.DB, em etherman.Etherman, genesisBlock uint64, ...) error
- func UnpackTxData(txData []byte) ([]common.Hash, error)
- type BatchSynchronizer
- type BlockReorg
- type CommitteeMapSafe
- func (t *CommitteeMapSafe) AsSlice() []etherman.DataCommitteeMember
- func (t *CommitteeMapSafe) Delete(key common.Address)
- func (t *CommitteeMapSafe) Length() int
- func (t *CommitteeMapSafe) Load(addr common.Address) (etherman.DataCommitteeMember, bool)
- func (t *CommitteeMapSafe) Store(member etherman.DataCommitteeMember)
- func (t *CommitteeMapSafe) StoreBatch(members []etherman.DataCommitteeMember)
- type ReorgDetector
- type SequencerTracker
- type SyncTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BatchSynchronizer ¶
type BatchSynchronizer struct {
// contains filtered or unexported fields
}
BatchSynchronizer watches for number events, checks if they are "locally" stored, then retrieves and stores missing data
func NewBatchSynchronizer ¶
func NewBatchSynchronizer( cfg config.L1Config, self common.Address, db db.DB, reorgs <-chan BlockReorg, ethClient etherman.Etherman, sequencer SequencerTracker, rpcClientFactory client.Factory, ) (*BatchSynchronizer, error)
NewBatchSynchronizer creates the BatchSynchronizer
func (*BatchSynchronizer) Gaps ¶ added in v0.0.8
func (bs *BatchSynchronizer) Gaps() map[uint64]uint64
Gaps returns the offchain data gaps
func (*BatchSynchronizer) Start ¶
func (bs *BatchSynchronizer) Start(ctx context.Context)
Start starts the synchronizer
type BlockReorg ¶
BlockReorg is emitted to subscribers when a reorg is detected. Number is the block to which the chain rewound.
type CommitteeMapSafe ¶ added in v0.0.8
type CommitteeMapSafe struct {
// contains filtered or unexported fields
}
CommitteeMapSafe represents a thread-safe implementation for the data availability committee members map.
func NewCommitteeMapSafe ¶ added in v0.0.8
func NewCommitteeMapSafe() *CommitteeMapSafe
NewCommitteeMapSafe creates a new CommitteeMapSafe.
func (*CommitteeMapSafe) AsSlice ¶ added in v0.0.8
func (t *CommitteeMapSafe) AsSlice() []etherman.DataCommitteeMember
AsSlice returns a slice of etherman.DataCommitteeMembers.
func (*CommitteeMapSafe) Delete ¶ added in v0.0.8
func (t *CommitteeMapSafe) Delete(key common.Address)
Delete deletes the value for a key.
func (*CommitteeMapSafe) Length ¶ added in v0.0.8
func (t *CommitteeMapSafe) Length() int
Length returns the current length of the map.
func (*CommitteeMapSafe) Load ¶ added in v0.0.8
func (t *CommitteeMapSafe) Load(addr common.Address) (etherman.DataCommitteeMember, bool)
Load returns the value stored in the map for a key, or false if no value is present.
func (*CommitteeMapSafe) Store ¶ added in v0.0.8
func (t *CommitteeMapSafe) Store(member etherman.DataCommitteeMember)
Store sets the value for a key.
func (*CommitteeMapSafe) StoreBatch ¶ added in v0.0.8
func (t *CommitteeMapSafe) StoreBatch(members []etherman.DataCommitteeMember)
StoreBatch sets the range of values and keys.
type ReorgDetector ¶
type ReorgDetector struct {
// contains filtered or unexported fields
}
ReorgDetector watches for block reorganizations on chain, and sends messages to subscribing components when a reorg is detected.
func NewReorgDetector ¶
func NewReorgDetector(rpcUrl string, pollingPeriod time.Duration) (*ReorgDetector, error)
NewReorgDetector creates a new ReorgDetector
func (*ReorgDetector) Start ¶
func (rd *ReorgDetector) Start(ctx context.Context) error
Start starts the ReorgDetector tracking for reorg events
func (*ReorgDetector) Stop ¶
func (rd *ReorgDetector) Stop()
Stop stops the chain reorganization detector loop
func (*ReorgDetector) Subscribe ¶
func (rd *ReorgDetector) Subscribe() <-chan BlockReorg
Subscribe returns a channel on which the caller can receive reorg messages