Documentation ¶
Index ¶
- func BatchWasExecuted(ctx context.Context, db *sql.DB, hash common.L2BatchHash) (bool, error)
- func CountTransactionsPerAddress(ctx context.Context, db *sql.DB, address *gethcommon.Address) (uint64, error)
- func DebugGetLogs(ctx context.Context, db *sql.DB, txHash common.TxHash) ([]*tracers.DebugLogs, error)
- func Delete(ctx context.Context, db *sql.DB, key []byte) error
- func DeleteKeys(ctx context.Context, db *sql.Tx, keys [][]byte) error
- func FetchAttKey(ctx context.Context, db *sql.DB, party common.Address) ([]byte, error)
- func FetchBlock(ctx context.Context, db *sql.DB, hash common.L1BlockHash) (*types.Block, error)
- func FetchBlockHeaderByHeight(ctx context.Context, db *sql.DB, height *big.Int) (*types.Header, error)
- func FetchConfig(ctx context.Context, db *sql.DB, key string) ([]byte, error)
- func FetchConvertedBatchHash(ctx context.Context, db *sql.DB, seqNo uint64) (gethcommon.Hash, error)
- func FetchHeadBlock(ctx context.Context, db *sql.DB) (*types.Block, error)
- func FetchL1Messages[T any](ctx context.Context, db *sql.DB, blockHash common.L1BlockHash, isTransfer bool) ([]T, error)
- func FetchReorgedRollup(ctx context.Context, db *sql.DB, reorgedBlocks []common.L1BlockHash) (*common.L2BatchHash, error)
- func FetchRollupMetadata(ctx context.Context, db *sql.DB, hash common.L2RollupHash) (*common.PublicRollupMetadata, error)
- func FilterLogs(ctx context.Context, db *sql.DB, requestingAccount *gethcommon.Address, ...) ([]*types.Log, error)
- func Get(ctx context.Context, db *sql.DB, key []byte) ([]byte, error)
- func GetBlockId(ctx context.Context, db *sql.Tx, hash common.L1BlockHash) (int64, error)
- func GetContractCreationTx(ctx context.Context, db *sql.DB, address gethcommon.Address) (*gethcommon.Hash, error)
- func GetTransactionsPerAddress(ctx context.Context, db *sql.DB, config *params.ChainConfig, ...) (types.Receipts, error)
- func GetTxId(ctx context.Context, dbtx *sql.Tx, txHash gethcommon.Hash) (int64, error)
- func HandleBlockArrivedAfterBatches(ctx context.Context, dbtx *sql.Tx, blockId int64, blockHash common.L1BlockHash) error
- func Has(ctx context.Context, db *sql.DB, key []byte) (bool, error)
- func NewIterator(ctx context.Context, db *sql.DB, prefix []byte, start []byte) ethdb.Iterator
- func Put(ctx context.Context, db *sql.DB, key []byte, value []byte) error
- func PutKeyValues(ctx context.Context, tx *sql.Tx, keys [][]byte, vals [][]byte) error
- func ReadBatchByHash(ctx context.Context, db *sql.DB, hash common.L2BatchHash) (*core.Batch, error)
- func ReadBatchBySeqNo(ctx context.Context, db *sql.DB, seqNo uint64) (*core.Batch, error)
- func ReadBatchesByBlock(ctx context.Context, db *sql.DB, hash common.L1BlockHash) ([]*core.Batch, error)
- func ReadCanonicalBatchByHeight(ctx context.Context, db *sql.DB, height uint64) (*core.Batch, error)
- func ReadCanonicalBatches(ctx context.Context, db *sql.DB, startAtSeq uint64, endSeq uint64) ([]*core.Batch, error)
- func ReadContractCreationCount(ctx context.Context, db *sql.DB) (*big.Int, error)
- func ReadCurrentHeadBatch(ctx context.Context, db *sql.DB) (*core.Batch, error)
- func ReadCurrentSequencerNo(ctx context.Context, db *sql.DB) (*big.Int, error)
- func ReadNonCanonicalBatches(ctx context.Context, db *sql.DB, startAtSeq uint64, endSeq uint64) ([]*core.Batch, error)
- func ReadReceipt(ctx context.Context, db *sql.DB, txHash common.L2TxHash, ...) (*types.Receipt, error)
- func ReadReceiptsByBatchHash(ctx context.Context, db *sql.DB, hash common.L2BatchHash, ...) (types.Receipts, error)
- func ReadTransaction(ctx context.Context, db *sql.DB, txHash gethcommon.Hash) (*types.Transaction, common.L2BatchHash, uint64, uint64, error)
- func ReadUnexecutedBatches(ctx context.Context, db *sql.DB, from *big.Int) ([]*core.Batch, error)
- func StoreEventLogs(ctx context.Context, dbtx *sql.Tx, receipts []*types.Receipt, ...) error
- func UpdateCanonicalBlocks(ctx context.Context, dbtx *sql.Tx, canonical []common.L1BlockHash, ...) error
- func WriteAttKey(ctx context.Context, db *sql.Tx, party common.Address, key []byte) (sql.Result, error)
- func WriteBatchAndTransactions(ctx context.Context, dbtx *sql.Tx, batch *core.Batch, ...) error
- func WriteBatchExecution(ctx context.Context, dbtx *sql.Tx, seqNo *big.Int, receipts []*types.Receipt) error
- func WriteBlock(ctx context.Context, dbtx *sql.Tx, b *types.Header) error
- func WriteConfig(ctx context.Context, db *sql.Tx, key string, value []byte) (sql.Result, error)
- func WriteConfigToTx(ctx context.Context, dbtx *sql.Tx, key string, value any) (sql.Result, error)
- func WriteL1Messages[T any](ctx context.Context, db *sql.Tx, blockId int64, messages []T, ...) error
- func WriteRollup(ctx context.Context, dbtx *sql.Tx, rollup *common.RollupHeader, blockId int64, ...) error
- type EnclaveDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchWasExecuted ¶
func CountTransactionsPerAddress ¶ added in v0.24.1
func DebugGetLogs ¶
func FetchAttKey ¶
func FetchBlock ¶
todo - remove this. For now creates a "block" but without a body.
func FetchConvertedBatchHash ¶ added in v0.21.0
func FetchL1Messages ¶
func FetchReorgedRollup ¶
func FetchReorgedRollup(ctx context.Context, db *sql.DB, reorgedBlocks []common.L1BlockHash) (*common.L2BatchHash, error)
func FetchRollupMetadata ¶ added in v0.24.0
func FetchRollupMetadata(ctx context.Context, db *sql.DB, hash common.L2RollupHash) (*common.PublicRollupMetadata, error)
func FilterLogs ¶
func FilterLogs( ctx context.Context, db *sql.DB, requestingAccount *gethcommon.Address, fromBlock, toBlock *big.Int, batchHash *common.L2BatchHash, addresses []gethcommon.Address, topics [][]gethcommon.Hash, ) ([]*types.Log, error)
func GetBlockId ¶ added in v0.24.1
func GetContractCreationTx ¶
func GetContractCreationTx(ctx context.Context, db *sql.DB, address gethcommon.Address) (*gethcommon.Hash, error)
func GetTransactionsPerAddress ¶ added in v0.24.1
func GetTransactionsPerAddress(ctx context.Context, db *sql.DB, config *params.ChainConfig, address *gethcommon.Address, pagination *common.QueryPagination) (types.Receipts, error)
func HandleBlockArrivedAfterBatches ¶ added in v0.24.1
func HandleBlockArrivedAfterBatches(ctx context.Context, dbtx *sql.Tx, blockId int64, blockHash common.L1BlockHash) error
HandleBlockArrivedAfterBatches- handle the corner case where the block wasn't available when the batch was received
func NewIterator ¶
func PutKeyValues ¶
func ReadBatchByHash ¶
func ReadBatchBySeqNo ¶
func ReadBatchesByBlock ¶
func ReadCanonicalBatches ¶ added in v0.24.1
func ReadCurrentHeadBatch ¶
todo - is there a better way to write this query?
func ReadCurrentSequencerNo ¶
func ReadNonCanonicalBatches ¶
func ReadReceipt ¶
func ReadReceiptsByBatchHash ¶
func ReadReceiptsByBatchHash(ctx context.Context, db *sql.DB, hash common.L2BatchHash, config *params.ChainConfig) (types.Receipts, error)
ReadReceiptsByBatchHash retrieves all the transaction receipts belonging to a block, including its corresponding metadata fields. If it is unable to populate these metadata fields then nil is returned.
The current implementation populates these metadata fields by reading the receipts' corresponding block body, so if the block body is not found it will return nil even if the receipt itself is stored.
func ReadTransaction ¶
func ReadTransaction(ctx context.Context, db *sql.DB, txHash gethcommon.Hash) (*types.Transaction, common.L2BatchHash, uint64, uint64, error)
func ReadUnexecutedBatches ¶
func StoreEventLogs ¶
func UpdateCanonicalBlocks ¶
func WriteAttKey ¶
func WriteBatchAndTransactions ¶
func WriteBatchAndTransactions(ctx context.Context, dbtx *sql.Tx, batch *core.Batch, convertedHash gethcommon.Hash, blockId int64) error
WriteBatchAndTransactions - persists the batch and the transactions
func WriteBatchExecution ¶
func WriteBatchExecution(ctx context.Context, dbtx *sql.Tx, seqNo *big.Int, receipts []*types.Receipt) error
WriteBatchExecution - save receipts
func WriteConfig ¶
func WriteConfigToTx ¶
func WriteL1Messages ¶
func WriteRollup ¶
func WriteRollup(ctx context.Context, dbtx *sql.Tx, rollup *common.RollupHeader, blockId int64, internalHeader *common.CalldataRollupHeader) error
Types ¶
type EnclaveDB ¶
type EnclaveDB interface { ethdb.Database GetSQLDB() *sql.DB NewDBTransaction(ctx context.Context) (*sql.Tx, error) }
EnclaveDB - An abstraction that implements the `ethdb.Database` on top of SQL, and also exposes underling sql primitives. Note: This might not be the best approach. Todo - consider a few design alternatives: The EnclaveDB - can be a factory that returns an Sql implementation of the ethdb.Database