Documentation ¶
Index ¶
- func BatchWasExecuted(ctx context.Context, db *sql.DB, hash common.L2BatchHash) (bool, error)
- func CheckCanonicalValidity(ctx context.Context, dbtx *sql.Tx, blockId int64) error
- func CountTransactionsPerAddress(ctx context.Context, db *sql.DB, address *gethcommon.Address) (uint64, error)
- func DebugGetLogs(ctx context.Context, db *sql.DB, fromBlock *big.Int, toBlock *big.Int, ...) ([]*common.DebugLogVisibility, error)
- func Delete(ctx context.Context, db *sql.DB, key []byte) error
- func DeleteKeys(ctx context.Context, db *sql.Tx, keys [][]byte) error
- func ExistsBatchAtHeight(ctx context.Context, dbTx *sql.Tx, height *big.Int) (bool, error)
- func ExistsReceipt(ctx context.Context, db *sql.DB, txHash common.L2TxHash) (bool, error)
- func FetchAttKey(ctx context.Context, db *sql.DB, party common.Address) ([]byte, error)
- func FetchBlockHeader(ctx context.Context, db *sql.DB, hash common.L1BlockHash) (*types.Header, 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.Header, 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 GetTransactionsPerAddress(ctx context.Context, db *sql.DB, address *gethcommon.Address, ...) ([]*core.InternalReceipt, 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 IsCanonicalBatchHash(ctx context.Context, dbtx *sql.Tx, hash *gethcommon.Hash) (bool, error)
- func IsCanonicalBatchSeq(ctx context.Context, db *sql.DB, seqNo uint64) (bool, error)
- func IsCanonicalBlock(ctx context.Context, dbtx *sql.Tx, hash *gethcommon.Hash) (bool, error)
- func MarkBatchExecuted(ctx context.Context, dbtx *sql.Tx, seqNo *big.Int) 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 ReadBatchHeaderByHash(ctx context.Context, db *sql.DB, hash common.L2BatchHash) (*common.BatchHeader, error)
- func ReadBatchHeaderBySeqNo(ctx context.Context, db *sql.DB, seqNo uint64) (*common.BatchHeader, error)
- func ReadBatchTransactions(ctx context.Context, db *sql.DB, height uint64) ([]*common.L2Tx, error)
- func ReadBatchesByBlock(ctx context.Context, db *sql.DB, hash common.L1BlockHash) ([]*common.BatchHeader, error)
- func ReadCanonicalBatchHeaderByHeight(ctx context.Context, db *sql.DB, height uint64) (*common.BatchHeader, error)
- func ReadCanonicalBatches(ctx context.Context, db *sql.DB, startAtSeq uint64, endSeq uint64) ([]*common.BatchHeader, error)
- func ReadContractCreationCount(ctx context.Context, db *sql.DB) (*big.Int, error)
- func ReadCurrentHeadBatchHeader(ctx context.Context, db *sql.DB) (*common.BatchHeader, error)
- func ReadCurrentSequencerNo(ctx context.Context, db *sql.DB) (*big.Int, error)
- func ReadEoa(ctx context.Context, dbTx *sql.Tx, addr gethcommon.Address) (uint64, error)
- func ReadEventTopic(ctx context.Context, dbTX *sql.Tx, topic []byte, eventTypeId uint64) (uint64, *uint64, error)
- func ReadNonCanonicalBatches(ctx context.Context, db *sql.DB, startAtSeq uint64, endSeq uint64) ([]*common.BatchHeader, error)
- func ReadReceipt(ctx context.Context, db *sql.DB, txHash common.L2TxHash, ...) (*core.InternalReceipt, error)
- func ReadRelevantAddressFromEventTopic(ctx context.Context, dbTX *sql.Tx, id uint64) (*uint64, error)
- func ReadTransaction(ctx context.Context, db *sql.DB, txHash gethcommon.Hash) (*types.Transaction, common.L2BatchHash, uint64, uint64, error)
- func ReadTransactionIdAndSender(ctx context.Context, dbtx *sql.Tx, txHash gethcommon.Hash) (*uint64, *uint64, error)
- func ReadUnexecutedBatches(ctx context.Context, db *sql.DB, from *big.Int) ([]*common.BatchHeader, error)
- func UpdateCanonicalBatch(ctx context.Context, dbtx *sql.Tx, isCanonical bool, ...) error
- func UpdateCanonicalBlock(ctx context.Context, dbtx *sql.Tx, isCanonical bool, ...) error
- func UpdateEventTypeAutoPublic(ctx context.Context, dbTx *sql.Tx, etId uint64, isPublic bool) error
- func WriteAttKey(ctx context.Context, db *sql.Tx, party common.Address, key []byte) (sql.Result, error)
- func WriteBatchHeader(ctx context.Context, dbtx *sql.Tx, batch *core.Batch, ...) 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 WriteContractConfig(ctx context.Context, dbTX *sql.Tx, contractAddress gethcommon.Address, ...) (*uint64, error)
- func WriteEoa(ctx context.Context, dbTX *sql.Tx, sender gethcommon.Address) (uint64, error)
- func WriteEventLog(ctx context.Context, dbTX *sql.Tx, eventTypeId uint64, userTopics []*uint64, ...) error
- func WriteEventTopic(ctx context.Context, dbTX *sql.Tx, topic *gethcommon.Hash, addressId *uint64, ...) (uint64, error)
- func WriteEventType(ctx context.Context, dbTX *sql.Tx, et *EventType) (uint64, error)
- func WriteL1Messages[T any](ctx context.Context, db *sql.Tx, blockId int64, messages []T, ...) error
- func WriteReceipt(ctx context.Context, dbtx *sql.Tx, batchSeqNo uint64, txId *uint64, ...) (uint64, error)
- func WriteRollup(ctx context.Context, dbtx *sql.Tx, rollup *common.RollupHeader, blockId int64, ...) error
- func WriteTransactions(ctx context.Context, dbtx *sql.Tx, batch *core.Batch, senders []uint64, ...) error
- type Contract
- type EnclaveDB
- type EventType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchWasExecuted ¶
func CheckCanonicalValidity ¶ added in v0.25.0
CheckCanonicalValidity - expensive but useful for debugging races
func CountTransactionsPerAddress ¶ added in v0.24.1
func DebugGetLogs ¶
func DebugGetLogs(ctx context.Context, db *sql.DB, fromBlock *big.Int, toBlock *big.Int, address gethcommon.Address, eventSig gethcommon.Hash) ([]*common.DebugLogVisibility, error)
func ExistsBatchAtHeight ¶ added in v0.25.0
func ExistsReceipt ¶ added in v0.28.0
func FetchAttKey ¶
func FetchBlockHeader ¶
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 GetTransactionsPerAddress ¶ added in v0.24.1
func GetTransactionsPerAddress(ctx context.Context, db *sql.DB, address *gethcommon.Address, pagination *common.QueryPagination) ([]*core.InternalReceipt, 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 IsCanonicalBatchHash ¶ added in v0.25.0
func IsCanonicalBatchSeq ¶ added in v0.25.0
func IsCanonicalBlock ¶ added in v0.25.0
func MarkBatchExecuted ¶ added in v0.25.0
func NewIterator ¶
func PutKeyValues ¶
func ReadBatchHeaderByHash ¶ added in v0.25.0
func ReadBatchHeaderByHash(ctx context.Context, db *sql.DB, hash common.L2BatchHash) (*common.BatchHeader, error)
func ReadBatchHeaderBySeqNo ¶ added in v0.25.0
func ReadBatchTransactions ¶ added in v0.25.0
func ReadBatchesByBlock ¶
func ReadBatchesByBlock(ctx context.Context, db *sql.DB, hash common.L1BlockHash) ([]*common.BatchHeader, error)
func ReadCanonicalBatchHeaderByHeight ¶ added in v0.25.0
func ReadCanonicalBatches ¶ added in v0.24.1
func ReadCurrentHeadBatchHeader ¶ added in v0.25.0
todo - is there a better way to write this query?
func ReadCurrentSequencerNo ¶
func ReadEventTopic ¶ added in v0.25.0
func ReadNonCanonicalBatches ¶
func ReadReceipt ¶
func ReadRelevantAddressFromEventTopic ¶ added in v0.28.0
func ReadTransaction ¶
func ReadTransaction(ctx context.Context, db *sql.DB, txHash gethcommon.Hash) (*types.Transaction, common.L2BatchHash, uint64, uint64, error)
func ReadTransactionIdAndSender ¶ added in v0.25.0
func ReadUnexecutedBatches ¶
func UpdateCanonicalBatch ¶ added in v0.25.0
func UpdateCanonicalBlock ¶ added in v0.25.0
func UpdateEventTypeAutoPublic ¶ added in v0.28.0
func WriteAttKey ¶
func WriteBatchHeader ¶ added in v0.25.0
func WriteConfig ¶
func WriteConfigToTx ¶
func WriteContractConfig ¶ added in v0.28.0
func WriteEventLog ¶ added in v0.25.0
func WriteEventTopic ¶ added in v0.25.0
func WriteEventType ¶ added in v0.25.0
func WriteL1Messages ¶
func WriteReceipt ¶ added in v0.25.0
func WriteRollup ¶
func WriteRollup(ctx context.Context, dbtx *sql.Tx, rollup *common.RollupHeader, blockId int64, internalHeader *common.CalldataRollupHeader) error
Types ¶
type Contract ¶ added in v0.28.0
type Contract struct { Id uint64 Address gethcommon.Address Creator gethcommon.Address AutoVisibility bool Transparent *bool }
Contract - maps to the “contract“ table
func ReadContractByAddress ¶ added in v0.28.0
func (Contract) IsTransparent ¶ added in v0.28.0
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
func NewEnclaveDB ¶
func NewEnclaveDB(db *sql.DB, rwdb *sql.DB, config enclaveconfig.EnclaveConfig, logger gethlog.Logger) (EnclaveDB, error)
type EventType ¶ added in v0.28.0
type EventType struct { Id uint64 Contract *Contract EventSignature gethcommon.Hash AutoVisibility bool AutoPublic *bool // true -when the event is autodetected as public ConfigPublic bool Topic1CanView, Topic2CanView, Topic3CanView *bool SenderCanView *bool }
EventType - maps to the “event_type“ table
func ReadEventType ¶ added in v0.25.0
func (EventType) IsTopicRelevant ¶ added in v0.28.0
Click to show internal directories.
Click to hide internal directories.