Documentation
¶
Index ¶
- Variables
- type DB
- func (db *DB) AddLog(logHash common.Hash, parentBlock eth.BlockID, logIdx uint32, ...) error
- func (db *DB) Close() error
- func (db *DB) Contains(blockNum uint64, logIdx uint32, logHash common.Hash) (entrydb.EntryIdx, error)
- func (db *DB) FindSealedBlock(block eth.BlockID) (nextEntry entrydb.EntryIdx, err error)
- func (db *DB) Get(blockNum uint64, logIdx uint32) (common.Hash, error)
- func (db *DB) IteratorStartingAt(i entrydb.EntryIdx) (Iterator, error)
- func (db *DB) LatestSealedBlockNum() (n uint64, ok bool)
- func (db *DB) Rewind(newHeadBlockNum uint64) error
- func (db *DB) SealBlock(parentHash common.Hash, block eth.BlockID, timestamp uint64) error
- type EntryObj
- type EntryStore
- type Iterator
- type IteratorState
- type Metrics
Constants ¶
This section is empty.
Variables ¶
var ( // ErrLogOutOfOrder happens when you try to add a log to the DB, // but it does not actually fit onto the latest data (by being too old or new). ErrLogOutOfOrder = errors.New("log out of order") // ErrDataCorruption happens when the underlying DB has some I/O issue ErrDataCorruption = errors.New("data corruption") // ErrSkipped happens when we try to retrieve data that is not available (pruned) // It may also happen if we erroneously skip data, that was not considered a conflict, if the DB is corrupted. ErrSkipped = errors.New("skipped data") // ErrFuture happens when data is just not yet available ErrFuture = errors.New("future data") // ErrConflict happens when we know for sure that there is different canonical data ErrConflict = errors.New("conflicting data") )
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB implements an append only database for log data and cross-chain dependencies.
To keep the append-only format, reduce data size, and support reorg detection and registering of executing-messages:
Use a fixed 24 bytes per entry.
Data is an append-only log, that can be binary searched for any necessary event data.
func NewFromEntryStore ¶
func NewFromFile ¶
func (*DB) Contains ¶
func (db *DB) Contains(blockNum uint64, logIdx uint32, logHash common.Hash) (entrydb.EntryIdx, error)
Contains returns no error iff the specified logHash is recorded in the specified blockNum and logIdx. If the log is out of reach, then ErrFuture is returned. If the log is determined to conflict with the canonical chain, then ErrConflict is returned. logIdx is the index of the log in the array of all logs in the block. This can be used to check the validity of cross-chain interop events.
func (*DB) FindSealedBlock ¶ added in v1.9.3
FindSealedBlock finds the requested block, to check if it exists, returning the next index after it where things continue from. returns ErrFuture if the block is too new to be able to tell returns ErrDifferent if the known block does not match
func (*DB) Get ¶ added in v1.9.1
Get returns the hash of the log at the specified blockNum (of the sealed block) and logIdx (of the log after the block), or an error if the log is not found.
func (*DB) IteratorStartingAt ¶ added in v1.9.3
func (*DB) LatestSealedBlockNum ¶ added in v1.9.3
LatestSealedBlockNum returns the block number of the block that was last sealed, or ok=false if there is no sealed block (i.e. empty DB)
type EntryObj ¶ added in v1.9.3
type EntryObj interface {
// contains filtered or unexported methods
}
type EntryStore ¶
type Iterator ¶ added in v1.9.1
type Iterator interface {
End() error
NextInitMsg() error
NextExecMsg() error
NextBlock() error
IteratorState
}