Documentation ¶
Index ¶
- func DecodeChunkBlockRanges(chunks [][]byte) ([]*rawdb.ChunkBlockRange, error)
- func UnpackLog(c *abi.ABI, out interface{}, event string, log types.Log) error
- type BatchHeader
- type BlockContext
- type Chunk
- type L1Client
- type L1CommitBatchEvent
- type L1FinalizeBatchEvent
- type L1RevertBatchEvent
- type RollupSyncService
- type WrappedBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeChunkBlockRanges ¶
func DecodeChunkBlockRanges(chunks [][]byte) ([]*rawdb.ChunkBlockRange, error)
DecodeChunkBlockRanges decodes the provided chunks into a list of block ranges. Each chunk contains information about multiple blocks, which are decoded and their ranges (from the start block to the end block) are returned.
Types ¶
type BatchHeader ¶
type BatchHeader struct {
// contains filtered or unexported fields
}
BatchHeader contains batch header info to be committed.
func NewBatchHeader ¶
func NewBatchHeader(version uint8, batchIndex, totalL1MessagePoppedBefore uint64, parentBatchHash common.Hash, chunks []*Chunk) (*BatchHeader, error)
NewBatchHeader creates a new BatchHeader
func (*BatchHeader) Encode ¶
func (b *BatchHeader) Encode() []byte
Encode encodes the BatchHeader into RollupV2 BatchHeaderV0Codec Encoding.
func (*BatchHeader) Hash ¶
func (b *BatchHeader) Hash() common.Hash
Hash calculates the hash of the batch header.
type BlockContext ¶
type BlockContext struct { BlockHash common.Hash ParentHash common.Hash BlockNumber uint64 Timestamp uint64 BaseFee *big.Int GasLimit uint64 NumTransactions uint16 NumL1Messages uint16 }
BlockContext represents the essential data of a block in the ScrollChain. It provides an overview of block attributes including hash values, block numbers, gas details, and transaction counts.
type Chunk ¶
type Chunk struct {
Blocks []*WrappedBlock `json:"blocks"`
}
Chunk contains blocks to be encoded
func (*Chunk) NumL1Messages ¶
NumL1Messages returns the number of L1 messages in this chunk. This number is the sum of included and skipped L1 messages.
type L1Client ¶
type L1Client struct {
// contains filtered or unexported fields
}
L1Client is a wrapper around EthClient that adds methods for conveniently collecting rollup events of ScrollChain contract.
type L1CommitBatchEvent ¶
L1CommitBatchEvent represents a CommitBatch event raised by the ScrollChain contract.
type L1FinalizeBatchEvent ¶
type L1FinalizeBatchEvent struct { BatchIndex *big.Int BatchHash common.Hash StateRoot common.Hash WithdrawRoot common.Hash }
L1FinalizeBatchEvent represents a FinalizeBatch event raised by the ScrollChain contract.
type L1RevertBatchEvent ¶
L1RevertBatchEvent represents a RevertBatch event raised by the ScrollChain contract.
type RollupSyncService ¶
type RollupSyncService struct {
// contains filtered or unexported fields
}
RollupSyncService collects ScrollChain batch commit/revert/finalize events and stores metadata into db.
func NewRollupSyncService ¶
func NewRollupSyncService(ctx context.Context, genesisConfig *params.ChainConfig, db ethdb.Database, l1Client sync_service.EthClient, bc *core.BlockChain, l1DeploymentBlock uint64) (*RollupSyncService, error)
func (*RollupSyncService) Start ¶
func (s *RollupSyncService) Start()
func (*RollupSyncService) Stop ¶
func (s *RollupSyncService) Stop()
type WrappedBlock ¶
type WrappedBlock struct { Header *types.Header `json:"header"` // Transactions is only used for recover types.Transactions, the from of types.TransactionData field is missing. Transactions []*types.TransactionData `json:"transactions"` WithdrawRoot common.Hash `json:"withdraw_trie_root,omitempty"` }
WrappedBlock contains the block's Header, Transactions and WithdrawTrieRoot hash.