Documentation
¶
Index ¶
- Variables
- type Config
- type EthClienter
- type Event
- type InitL1InfoRootMap
- type L1InfoTreeLeaf
- type L1InfoTreeSync
- func (s *L1InfoTreeSync) GetInfoByIndex(ctx context.Context, index uint32) (*L1InfoTreeLeaf, error)
- func (s *L1InfoTreeSync) GetL1InfoTreeMerkleProof(ctx context.Context, index uint32) (types.Proof, types.Root, error)
- func (s *L1InfoTreeSync) GetL1InfoTreeRootByIndex(ctx context.Context, index uint32) (types.Root, error)
- func (s *L1InfoTreeSync) GetLastL1InfoTreeRoot(ctx context.Context) (types.Root, error)
- func (s *L1InfoTreeSync) GetLastProcessedBlock(ctx context.Context) (uint64, error)
- func (s *L1InfoTreeSync) GetLastRollupExitRoot(ctx context.Context) (types.Root, error)
- func (s *L1InfoTreeSync) GetLatestInfoUntilBlock(ctx context.Context, blockNum uint64) (*L1InfoTreeLeaf, error)
- func (s *L1InfoTreeSync) GetLocalExitRoot(ctx context.Context, networkID uint32, rollupExitRoot common.Hash) (common.Hash, error)
- func (s *L1InfoTreeSync) GetRollupExitTreeMerkleProof(ctx context.Context, networkID uint32, root common.Hash) (types.Proof, error)
- func (s *L1InfoTreeSync) Start(ctx context.Context)
- type UpdateL1InfoTree
- type VerifyBatches
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DBPath string `mapstructure:"DBPath"`
GlobalExitRootAddr common.Address `mapstructure:"GlobalExitRootAddr"`
RollupManagerAddr common.Address `mapstructure:"RollupManagerAddr"`
SyncBlockChunkSize uint64 `mapstructure:"SyncBlockChunkSize"`
// BlockFinality indicates the status of the blocks that will be queried in order to sync
BlockFinality string `` //nolint:lll
/* 134-byte string literal not displayed */
URLRPCL1 string `mapstructure:"URLRPCL1"`
WaitForNewBlocksPeriod types.Duration `mapstructure:"WaitForNewBlocksPeriod"`
InitialBlock uint64 `mapstructure:"InitialBlock"`
RetryAfterErrorPeriod types.Duration `mapstructure:"RetryAfterErrorPeriod"`
MaxRetryAttemptsAfterError int `mapstructure:"MaxRetryAttemptsAfterError"`
}
type EthClienter ¶
type EthClienter interface {
ethereum.LogFilterer
ethereum.BlockNumberReader
ethereum.ChainReader
bind.ContractBackend
}
type Event ¶
type Event struct {
UpdateL1InfoTree *UpdateL1InfoTree
VerifyBatches *VerifyBatches
InitL1InfoRootMap *InitL1InfoRootMap
}
type InitL1InfoRootMap ¶
type L1InfoTreeLeaf ¶
type L1InfoTreeLeaf struct {
BlockNumber uint64 `meddler:"block_num"`
BlockPosition uint64 `meddler:"block_pos"`
L1InfoTreeIndex uint32 `meddler:"position"`
PreviousBlockHash ethCommon.Hash `meddler:"previous_block_hash,hash"`
Timestamp uint64 `meddler:"timestamp"`
MainnetExitRoot ethCommon.Hash `meddler:"mainnet_exit_root,hash"`
RollupExitRoot ethCommon.Hash `meddler:"rollup_exit_root,hash"`
GlobalExitRoot ethCommon.Hash `meddler:"global_exit_root,hash"`
Hash ethCommon.Hash `meddler:"hash,hash"`
}
L1InfoTreeLeaf representation of a leaf of the L1 Info tree
type L1InfoTreeSync ¶
type L1InfoTreeSync struct {
// contains filtered or unexported fields
}
func New ¶
func New( ctx context.Context, dbPath string, globalExitRoot, rollupManager common.Address, syncBlockChunkSize uint64, blockFinalityType etherman.BlockNumberFinality, rd sync.ReorgDetector, l1Client EthClienter, waitForNewBlocksPeriod time.Duration, initialBlock uint64, retryAfterErrorPeriod time.Duration, maxRetryAttemptsAfterError int, ) (*L1InfoTreeSync, error)
New creates a L1 Info tree syncer that syncs the L1 info tree and the rollup exit tree
func (*L1InfoTreeSync) GetInfoByIndex ¶
func (s *L1InfoTreeSync) GetInfoByIndex(ctx context.Context, index uint32) (*L1InfoTreeLeaf, error)
GetInfoByIndex returns the value of a leaf (not the hash) of the L1 info tree
func (*L1InfoTreeSync) GetL1InfoTreeMerkleProof ¶
func (s *L1InfoTreeSync) GetL1InfoTreeMerkleProof(ctx context.Context, index uint32) (types.Proof, types.Root, error)
GetL1InfoTreeMerkleProof creates a merkle proof for the L1 Info tree
func (*L1InfoTreeSync) GetL1InfoTreeRootByIndex ¶
func (s *L1InfoTreeSync) GetL1InfoTreeRootByIndex(ctx context.Context, index uint32) (types.Root, error)
GetL1InfoTreeRootByIndex returns the root of the L1 info tree at the moment the leaf with the given index was added
func (*L1InfoTreeSync) GetLastL1InfoTreeRoot ¶
GetLastL1InfoTreeRoot return the last root and index processed from the L1 Info tree
func (*L1InfoTreeSync) GetLastProcessedBlock ¶
func (s *L1InfoTreeSync) GetLastProcessedBlock(ctx context.Context) (uint64, error)
GetLastProcessedBlock return the last processed block
func (*L1InfoTreeSync) GetLastRollupExitRoot ¶
GetLastRollupExitRoot return the last rollup exit root processed
func (*L1InfoTreeSync) GetLatestInfoUntilBlock ¶
func (s *L1InfoTreeSync) GetLatestInfoUntilBlock(ctx context.Context, blockNum uint64) (*L1InfoTreeLeaf, error)
GetLatestInfoUntilBlock returns the most recent L1InfoTreeLeaf that occurred before or at blockNum. If the blockNum has not been processed yet the error ErrBlockNotProcessed will be returned
func (*L1InfoTreeSync) GetLocalExitRoot ¶
func (*L1InfoTreeSync) GetRollupExitTreeMerkleProof ¶
func (s *L1InfoTreeSync) GetRollupExitTreeMerkleProof( ctx context.Context, networkID uint32, root common.Hash, ) (types.Proof, error)
GetRollupExitTreeMerkleProof creates a merkle proof for the rollup exit tree
func (*L1InfoTreeSync) Start ¶
func (s *L1InfoTreeSync) Start(ctx context.Context)
Start starts the synchronization process