Documentation ¶
Index ¶
- Constants
- func BytesToUint64(b []byte) uint64
- func BytesToUint8(b []byte) uint8
- func ConcatKey(l1BlockNo, batchNo uint64) []byte
- func SplitKey(data []byte) (uint64, uint64, error)
- func Uint64ToBytes(i uint64) []byte
- func Uint8ToBytes(i uint8) []byte
- type HermezDb
- func (db *HermezDb) CreateBuckets() error
- func (db *HermezDb) DeleteBatchGlobalExitRoots(fromBatchNum, toBatchNum uint64) error
- func (db *HermezDb) DeleteBlockBatches(fromBatchNum, toBatchNum uint64) error
- func (db *HermezDb) DeleteBlockGlobalExitRoots(fromBlockNum, toBlockNum uint64) error
- func (db *HermezDb) DeleteForkIds(fromBatchNum, toBatchNum uint64) error
- func (db *HermezDb) WriteBatchGBatchGlobalExitRoot(batchNumber uint64, ger dstypes.GerUpdate) error
- func (db *HermezDb) WriteBlockBatch(l2BlockNo, batchNo uint64) error
- func (db *HermezDb) WriteBlockGlobalExitRoot(l2BlockNo uint64, ger common.Hash) error
- func (db *HermezDb) WriteEffectiveGasPricePercentage(txHash common.Hash, txPricePercentage uint8) error
- func (db *HermezDb) WriteForkId(batchNo, forkId uint64) error
- func (db *HermezDb) WriteSequence(l1BlockNo, batchNo uint64, l1TxHash common.Hash, stateRoot common.Hash) error
- func (db *HermezDb) WriteStateRoot(l2BlockNo uint64, rpcRoot common.Hash) error
- func (db *HermezDb) WriteVerification(l1BlockNo, batchNo uint64, l1TxHash common.Hash, stateRoot common.Hash) error
- type HermezDbReader
- func (db *HermezDbReader) GetBatchGlobalExitRoots(fromBatchNum, toBatchNum uint64) ([]*dstypes.GerUpdate, error)
- func (db *HermezDbReader) GetBatchNoByL2Block(l2BlockNo uint64) (uint64, error)
- func (db *HermezDbReader) GetBlockGlobalExitRoot(l2BlockNo uint64) (common.Hash, error)
- func (db *HermezDbReader) GetEffectiveGasPricePercentage(txHash common.Hash) (uint8, error)
- func (db *HermezDbReader) GetForkId(batchNo uint64) (uint64, error)
- func (db *HermezDbReader) GetHighestBlockInBatch(batchNo uint64) (uint64, error)
- func (db *HermezDbReader) GetHighestVerifiedBlockNo() (uint64, error)
- func (db *HermezDbReader) GetL2BlockNosByBatch(batchNo uint64) ([]uint64, error)
- func (db *HermezDbReader) GetLatestSequence() (*types.L1BatchInfo, error)
- func (db *HermezDbReader) GetLatestVerification() (*types.L1BatchInfo, error)
- func (db *HermezDbReader) GetSequenceByBatchNo(batchNo uint64) (*types.L1BatchInfo, error)
- func (db *HermezDbReader) GetSequenceByL1Block(l1BlockNo uint64) (*types.L1BatchInfo, error)
- func (db *HermezDbReader) GetStateRoot(l2BlockNo uint64) (common.Hash, error)
- func (db *HermezDbReader) GetVerificationByBatchNo(batchNo uint64) (*types.L1BatchInfo, error)
- func (db *HermezDbReader) GetVerificationByL1Block(l1BlockNo uint64) (*types.L1BatchInfo, error)
- func (db *HermezDbReader) GetVerificationByL2BlockNo(blockNo uint64) (*types.L1BatchInfo, error)
Constants ¶
View Source
const BLOCKBATCHES = "hermez_blockBatches" // l2blockno -> batchno
View Source
const FORKIDS = "hermez_forkIds" // batchNo -> forkId
View Source
const GLOBAL_EXIT_ROOTS = "hermez_globalExitRoots" // l2blockno -> GER
View Source
const GLOBAL_EXIT_ROOTS_BATCHES = "hermez_globalExitRoots_batches" // l2blockno -> GER
View Source
const L1SEQUENCES = "hermez_l1Sequences" // l1blockno, batchno -> l1txhash
View Source
const L1VERIFICATIONS = "hermez_l1Verifications" // l1blockno, batchno -> l1txhash
View Source
const STATE_ROOTS = "hermez_stateRoots" // l2blockno -> stateRoot
View Source
const TX_PRICE_PERCENTAGE = "hermez_txPricePercentage" // txHash -> txPricePercentage
Variables ¶
This section is empty.
Functions ¶
func BytesToUint64 ¶
func BytesToUint8 ¶
func Uint64ToBytes ¶
func Uint8ToBytes ¶
Types ¶
type HermezDb ¶
type HermezDb struct { *HermezDbReader // contains filtered or unexported fields }
func (*HermezDb) CreateBuckets ¶
func (*HermezDb) DeleteBatchGlobalExitRoots ¶
func (*HermezDb) DeleteBlockBatches ¶
func (*HermezDb) DeleteBlockGlobalExitRoots ¶
func (*HermezDb) DeleteForkIds ¶
func (*HermezDb) WriteBatchGBatchGlobalExitRoot ¶
func (*HermezDb) WriteBlockBatch ¶
func (*HermezDb) WriteBlockGlobalExitRoot ¶
func (*HermezDb) WriteEffectiveGasPricePercentage ¶
func (*HermezDb) WriteForkId ¶
func (*HermezDb) WriteSequence ¶
func (*HermezDb) WriteStateRoot ¶
type HermezDbReader ¶
type HermezDbReader struct {
// contains filtered or unexported fields
}
HermezDbReader represents a reader for the HermezDb database. It has no write functions and is embedded into the HermezDb type for read operations.
func NewHermezDbReader ¶
func NewHermezDbReader(tx kv.Tx) *HermezDbReader
func (*HermezDbReader) GetBatchGlobalExitRoots ¶
func (db *HermezDbReader) GetBatchGlobalExitRoots(fromBatchNum, toBatchNum uint64) ([]*dstypes.GerUpdate, error)
func (*HermezDbReader) GetBatchNoByL2Block ¶
func (db *HermezDbReader) GetBatchNoByL2Block(l2BlockNo uint64) (uint64, error)
func (*HermezDbReader) GetBlockGlobalExitRoot ¶
func (db *HermezDbReader) GetBlockGlobalExitRoot(l2BlockNo uint64) (common.Hash, error)
func (*HermezDbReader) GetEffectiveGasPricePercentage ¶
func (db *HermezDbReader) GetEffectiveGasPricePercentage(txHash common.Hash) (uint8, error)
func (*HermezDbReader) GetForkId ¶
func (db *HermezDbReader) GetForkId(batchNo uint64) (uint64, error)
func (*HermezDbReader) GetHighestBlockInBatch ¶
func (db *HermezDbReader) GetHighestBlockInBatch(batchNo uint64) (uint64, error)
func (*HermezDbReader) GetHighestVerifiedBlockNo ¶
func (db *HermezDbReader) GetHighestVerifiedBlockNo() (uint64, error)
func (*HermezDbReader) GetL2BlockNosByBatch ¶
func (db *HermezDbReader) GetL2BlockNosByBatch(batchNo uint64) ([]uint64, error)
func (*HermezDbReader) GetLatestSequence ¶
func (db *HermezDbReader) GetLatestSequence() (*types.L1BatchInfo, error)
func (*HermezDbReader) GetLatestVerification ¶
func (db *HermezDbReader) GetLatestVerification() (*types.L1BatchInfo, error)
func (*HermezDbReader) GetSequenceByBatchNo ¶
func (db *HermezDbReader) GetSequenceByBatchNo(batchNo uint64) (*types.L1BatchInfo, error)
func (*HermezDbReader) GetSequenceByL1Block ¶
func (db *HermezDbReader) GetSequenceByL1Block(l1BlockNo uint64) (*types.L1BatchInfo, error)
func (*HermezDbReader) GetStateRoot ¶
func (db *HermezDbReader) GetStateRoot(l2BlockNo uint64) (common.Hash, error)
func (*HermezDbReader) GetVerificationByBatchNo ¶
func (db *HermezDbReader) GetVerificationByBatchNo(batchNo uint64) (*types.L1BatchInfo, error)
func (*HermezDbReader) GetVerificationByL1Block ¶
func (db *HermezDbReader) GetVerificationByL1Block(l1BlockNo uint64) (*types.L1BatchInfo, error)
func (*HermezDbReader) GetVerificationByL2BlockNo ¶
func (db *HermezDbReader) GetVerificationByL2BlockNo(blockNo uint64) (*types.L1BatchInfo, error)
Click to show internal directories.
Click to hide internal directories.