hermez_db

package
v0.0.0-...-92d349b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

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 BytesToUint64(b []byte) uint64

func BytesToUint8

func BytesToUint8(b []byte) uint8

func ConcatKey

func ConcatKey(l1BlockNo, batchNo uint64) []byte

func SplitKey

func SplitKey(data []byte) (uint64, uint64, error)

func Uint64ToBytes

func Uint64ToBytes(i uint64) []byte

func Uint8ToBytes

func Uint8ToBytes(i uint8) []byte

Types

type HermezDb

type HermezDb struct {
	*HermezDbReader
	// contains filtered or unexported fields
}

func NewHermezDb

func NewHermezDb(tx kv.RwTx) (*HermezDb, error)

func (*HermezDb) CreateBuckets

func (db *HermezDb) CreateBuckets() error

func (*HermezDb) DeleteBatchGlobalExitRoots

func (db *HermezDb) DeleteBatchGlobalExitRoots(fromBatchNum, toBatchNum uint64) error

func (*HermezDb) DeleteBlockBatches

func (db *HermezDb) DeleteBlockBatches(fromBatchNum, toBatchNum uint64) error

func (*HermezDb) DeleteBlockGlobalExitRoots

func (db *HermezDb) DeleteBlockGlobalExitRoots(fromBlockNum, toBlockNum uint64) error

func (*HermezDb) DeleteForkIds

func (db *HermezDb) DeleteForkIds(fromBatchNum, toBatchNum uint64) error

func (*HermezDb) WriteBatchGBatchGlobalExitRoot

func (db *HermezDb) WriteBatchGBatchGlobalExitRoot(batchNumber uint64, ger dstypes.GerUpdate) error

func (*HermezDb) WriteBlockBatch

func (db *HermezDb) WriteBlockBatch(l2BlockNo, batchNo uint64) error

func (*HermezDb) WriteBlockGlobalExitRoot

func (db *HermezDb) WriteBlockGlobalExitRoot(l2BlockNo uint64, ger common.Hash) error

func (*HermezDb) WriteEffectiveGasPricePercentage

func (db *HermezDb) WriteEffectiveGasPricePercentage(txHash common.Hash, txPricePercentage uint8) error

func (*HermezDb) WriteForkId

func (db *HermezDb) WriteForkId(batchNo, forkId uint64) error

func (*HermezDb) WriteSequence

func (db *HermezDb) WriteSequence(l1BlockNo, batchNo uint64, l1TxHash common.Hash, stateRoot common.Hash) error

func (*HermezDb) WriteStateRoot

func (db *HermezDb) WriteStateRoot(l2BlockNo uint64, rpcRoot common.Hash) error

func (*HermezDb) WriteVerification

func (db *HermezDb) WriteVerification(l1BlockNo, batchNo uint64, l1TxHash common.Hash, stateRoot common.Hash) error

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL