Documentation ¶
Index ¶
- func BatchWasExecuted(db *sql.DB, hash common.L2BatchHash) (bool, error)
- func DebugGetLogs(db *sql.DB, txHash common.TxHash) ([]*tracers.DebugLogs, error)
- func Delete(db *sql.DB, key []byte) error
- func DeleteKeys(db *sql.Tx, keys [][]byte) error
- func FetchAttKey(db *sql.DB, party common.Address) ([]byte, error)
- func FetchBlock(db *sql.DB, hash common.L1BlockHash) (*types.Block, error)
- func FetchBlockHeader(db *sql.DB, hash common.L1BlockHash) (*types.Header, error)
- func FetchBlockHeaderByHeight(db *sql.DB, height *big.Int) (*types.Header, error)
- func FetchConfig(db *sql.DB, key string) ([]byte, error)
- func FetchHeadBlock(db *sql.DB) (*types.Block, error)
- func FetchL1Messages[T any](db *sql.DB, blockHash common.L1BlockHash, isTransfer bool) ([]T, error)
- func FetchReorgedRollup(db *sql.DB, reorgedBlocks []common.L1BlockHash) (*common.L2BatchHash, error)
- func FilterLogs(db *sql.DB, requestingAccount *gethcommon.Address, fromBlock, toBlock *big.Int, ...) ([]*types.Log, error)
- func Get(db *sql.DB, key []byte) ([]byte, error)
- func GetContractCreationTx(db *sql.DB, address gethcommon.Address) (*gethcommon.Hash, error)
- func GetPublicTransactionCount(db *sql.DB) (uint64, error)
- func GetPublicTransactionData(db *sql.DB, pagination *common.QueryPagination) ([]common.PublicTransaction, error)
- func GetReceiptsPerAddress(db *sql.DB, config *params.ChainConfig, address *gethcommon.Address, ...) (types.Receipts, error)
- func GetReceiptsPerAddressCount(db *sql.DB, address *gethcommon.Address) (uint64, error)
- func Has(db *sql.DB, key []byte) (bool, error)
- func NewIterator(db *sql.DB, prefix []byte, start []byte) ethdb.Iterator
- func Put(db *sql.DB, key []byte, value []byte) error
- func PutKeyValues(tx *sql.Tx, keys [][]byte, vals [][]byte) error
- func ReadBatchByHash(db *sql.DB, hash common.L2BatchHash) (*core.Batch, error)
- func ReadBatchBySeqNo(db *sql.DB, seqNo uint64) (*core.Batch, error)
- func ReadBatchHeader(db *sql.DB, hash gethcommon.Hash) (*common.BatchHeader, error)
- func ReadBatchesByBlock(db *sql.DB, hash common.L1BlockHash) ([]*core.Batch, error)
- func ReadCanonicalBatchByHeight(db *sql.DB, height uint64) (*core.Batch, error)
- func ReadContractCreationCount(db *sql.DB) (*big.Int, error)
- func ReadCurrentHeadBatch(db *sql.DB) (*core.Batch, error)
- func ReadCurrentSequencerNo(db *sql.DB) (*big.Int, error)
- func ReadHeadBatchForBlock(db *sql.DB, l1Hash common.L1BlockHash) (*core.Batch, error)
- func ReadNonCanonicalBatches(db *sql.DB, startAtSeq uint64, endSeq uint64) ([]*core.Batch, error)
- func ReadReceipt(db *sql.DB, hash common.L2TxHash, config *params.ChainConfig) (*types.Receipt, error)
- func ReadReceiptsByBatchHash(db *sql.DB, hash common.L2BatchHash, config *params.ChainConfig) (types.Receipts, error)
- func ReadTransaction(db *sql.DB, txHash gethcommon.Hash) (*types.Transaction, gethcommon.Hash, uint64, uint64, error)
- func ReadUnexecutedBatches(db *sql.DB, from *big.Int) ([]*core.Batch, error)
- func StoreEventLogs(dbtx DBTransaction, receipts []*types.Receipt, stateDB *state.StateDB) error
- func UpdateCanonicalBlocks(dbtx DBTransaction, canonical []common.L1BlockHash, ...)
- func UpdateConfig(db *sql.DB, key string, value []byte) (sql.Result, error)
- func UpdateConfigToBatch(dbtx DBTransaction, key string, value []byte)
- func WriteAttKey(db *sql.DB, party common.Address, key []byte) (sql.Result, error)
- func WriteBatchAndTransactions(dbtx DBTransaction, batch *core.Batch) error
- func WriteBatchExecution(dbtx DBTransaction, seqNo *big.Int, receipts []*types.Receipt) error
- func WriteBlock(dbtx DBTransaction, b *types.Header) error
- func WriteConfig(db *sql.DB, key string, value []byte) (sql.Result, error)
- func WriteConfigToBatch(dbtx DBTransaction, key string, value any)
- func WriteConfigToTx(dbtx *sql.Tx, key string, value any) (sql.Result, error)
- func WriteL1Messages[T any](db *sql.DB, blockHash common.L1BlockHash, messages []T, isValueTransfer bool) error
- func WriteRollup(dbtx DBTransaction, rollup *common.RollupHeader, ...) error
- type DBTransaction
- type EnclaveDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchWasExecuted ¶
func DebugGetLogs ¶
func FetchBlock ¶
todo - remove this. For now creates a "block" but without a body.
func FetchBlockHeader ¶
func FetchBlockHeaderByHeight ¶ added in v0.17.0
func FetchL1Messages ¶
func FetchReorgedRollup ¶ added in v0.18.0
func FetchReorgedRollup(db *sql.DB, reorgedBlocks []common.L1BlockHash) (*common.L2BatchHash, error)
func FilterLogs ¶
func FilterLogs( db *sql.DB, requestingAccount *gethcommon.Address, fromBlock, toBlock *big.Int, batchHash *common.L2BatchHash, addresses []gethcommon.Address, topics [][]gethcommon.Hash, ) ([]*types.Log, error)
func GetContractCreationTx ¶
func GetContractCreationTx(db *sql.DB, address gethcommon.Address) (*gethcommon.Hash, error)
func GetPublicTransactionData ¶
func GetPublicTransactionData(db *sql.DB, pagination *common.QueryPagination) ([]common.PublicTransaction, error)
func GetReceiptsPerAddress ¶
func GetReceiptsPerAddress(db *sql.DB, config *params.ChainConfig, address *gethcommon.Address, pagination *common.QueryPagination) (types.Receipts, error)
func ReadBatchByHash ¶
func ReadBatchHeader ¶
func ReadBatchHeader(db *sql.DB, hash gethcommon.Hash) (*common.BatchHeader, error)
func ReadBatchesByBlock ¶
func ReadCurrentHeadBatch ¶
todo - is there a better way to write this query?
func ReadHeadBatchForBlock ¶
func ReadNonCanonicalBatches ¶ added in v0.18.0
func ReadReceipt ¶
func ReadReceiptsByBatchHash ¶
func ReadReceiptsByBatchHash(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(db *sql.DB, txHash gethcommon.Hash) (*types.Transaction, gethcommon.Hash, uint64, uint64, error)
func ReadUnexecutedBatches ¶
func StoreEventLogs ¶
func UpdateCanonicalBlocks ¶
func UpdateCanonicalBlocks(dbtx DBTransaction, canonical []common.L1BlockHash, nonCanonical []common.L1BlockHash)
func UpdateConfigToBatch ¶
func UpdateConfigToBatch(dbtx DBTransaction, key string, value []byte)
func WriteAttKey ¶
func WriteBatchAndTransactions ¶
func WriteBatchAndTransactions(dbtx DBTransaction, batch *core.Batch) error
WriteBatchAndTransactions - persists the batch and the transactions
func WriteBatchExecution ¶
WriteBatchExecution - insert all receipts to the db
func WriteBlock ¶
func WriteBlock(dbtx DBTransaction, b *types.Header) error
func WriteConfigToBatch ¶
func WriteConfigToBatch(dbtx DBTransaction, key string, value any)
func WriteConfigToTx ¶ added in v0.17.0
func WriteL1Messages ¶
func WriteRollup ¶
func WriteRollup(dbtx DBTransaction, rollup *common.RollupHeader, internalHeader *common.CalldataRollupHeader) error
Types ¶
type DBTransaction ¶
DBTransaction - represents a database transaction implemented unusually. Typically, databases have a "beginTransaction" command which is also exposed by the db drivers, and then the applications just sends commands on that connection. There are rules as to what data is returned when running selects. This implementation works by collecting all statements, and then writing them and committing in one go todo - does it need to be an ethdb.Batch? todo - can we use the typical
type EnclaveDB ¶
type EnclaveDB interface { ethdb.Database GetSQLDB() *sql.DB NewDBTransaction() *dbTransaction BeginTx() (*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