aggregator

package
v0.0.0-...-c80a3f0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2022 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FirstType                   = Account
	NumberOfAccountStorageTypes = Code
	NumberOfStateTypes          = AccountHistory
)
View Source
const AggregatorPrefix = "aggregator"

Variables

This section is empty.

Functions

func AggregateItemLess

func AggregateItemLess(a, than *AggregateItem) bool

func ByEndBlockItemLess

func ByEndBlockItemLess(i, than *byEndBlockItem) bool

Types

type AggregateItem

type AggregateItem struct {
	// contains filtered or unexported fields
}

func (*AggregateItem) Less

func (i *AggregateItem) Less(than btree.Item) bool

type AggregationTask

type AggregationTask struct {
	// contains filtered or unexported fields
}

type Aggregator

type Aggregator struct {
	// contains filtered or unexported fields
}

func NewAggregator

func NewAggregator(diffDir string, unwindLimit uint64, aggregationStep uint64, changesets, commitments bool, minArch uint64, trie commitment.Trie, tx kv.RwTx) (*Aggregator, error)

func (*Aggregator) Close

func (a *Aggregator) Close()

func (*Aggregator) MakeStateReader

func (a *Aggregator) MakeStateReader(blockNum uint64, tx kv.Tx) *Reader

func (*Aggregator) MakeStateWriter

func (a *Aggregator) MakeStateWriter(beforeOn bool) *Writer

func (*Aggregator) Stats

func (a *Aggregator) Stats() FilesStats

type ChangeFile

type ChangeFile struct {
	// contains filtered or unexported fields
}

type Changes

type Changes struct {
	// contains filtered or unexported fields
}

func (*Changes) Init

func (c *Changes) Init(namebase string, step uint64, dir string, beforeOn bool)

type ChangesItem

type ChangesItem struct {
	// contains filtered or unexported fields
}

func (*ChangesItem) Less

func (i *ChangesItem) Less(than btree.Item) bool

type CommitmentItem

type CommitmentItem struct {
	// contains filtered or unexported fields
}

func (*CommitmentItem) Less

func (i *CommitmentItem) Less(than btree.Item) bool

type CommitmentValTransform

type CommitmentValTransform struct {
	// contains filtered or unexported fields
}

type CursorHeap

type CursorHeap []*CursorItem

func (CursorHeap) Len

func (ch CursorHeap) Len() int

func (CursorHeap) Less

func (ch CursorHeap) Less(i, j int) bool

func (*CursorHeap) Pop

func (ch *CursorHeap) Pop() interface{}

func (*CursorHeap) Push

func (ch *CursorHeap) Push(x interface{})

func (*CursorHeap) Swap

func (ch *CursorHeap) Swap(i, j int)

type CursorItem

type CursorItem struct {
	// contains filtered or unexported fields
}

CursorItem is the item in the priority queue used to do merge interation over storage of a given account

type CursorType

type CursorType uint8
const (
	FILE_CURSOR CursorType = iota
	DB_CURSOR
	TREE_CURSOR
)

type FileType

type FileType int
const (
	Account FileType = iota
	Storage
	Code
	Commitment
	AccountHistory
	StorageHistory
	CodeHistory
	AccountBitmap
	StorageBitmap
	CodeBitmap
	NumberOfTypes
)

func ParseFileType

func ParseFileType(s string) (FileType, bool)

func (FileType) String

func (ft FileType) String() string

func (FileType) Table

func (ft FileType) Table() string

type FilesStats

type FilesStats struct {
	AccountsCount     int
	AccountsDatSize   int64
	AccountsIdxSize   int64
	CodeCount         int
	CodeDatSize       int64
	CodeIdxSize       int64
	StorageCount      int
	StorageDatSize    int64
	StorageIdxSize    int64
	CommitmentCount   int
	CommitmentDatSize int64
	CommitmentIdxSize int64
	Hits              uint64
	Misses            uint64
}

type History

type History struct {
	// contains filtered or unexported fields
}

History is a utility class that allows reading history of state from state files, history files, and bitmap files produced by an Aggregator

func NewHistory

func NewHistory(diffDir string, blockTo uint64, aggregationStep uint64) (*History, error)

func (*History) Close

func (h *History) Close()

func (*History) MakeHistoryReader

func (h *History) MakeHistoryReader() *HistoryReader

type HistoryReader

type HistoryReader struct {
	// contains filtered or unexported fields
}

func (*HistoryReader) ReadAccountCode

func (hr *HistoryReader) ReadAccountCode(addr []byte, trace bool) ([]byte, error)

func (*HistoryReader) ReadAccountCodeSize

func (hr *HistoryReader) ReadAccountCodeSize(addr []byte, trace bool) (int, error)

func (*HistoryReader) ReadAccountData

func (hr *HistoryReader) ReadAccountData(addr []byte, trace bool) ([]byte, error)

func (*HistoryReader) ReadAccountStorage

func (hr *HistoryReader) ReadAccountStorage(addr []byte, loc []byte, trace bool) (*uint256.Int, error)

func (*HistoryReader) SetNums

func (hr *HistoryReader) SetNums(blockNum, txNum uint64, lastTx bool)

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func (*Reader) ReadAccountCode

func (r *Reader) ReadAccountCode(addr []byte, trace bool) ([]byte, error)

func (*Reader) ReadAccountCodeSize

func (r *Reader) ReadAccountCodeSize(addr []byte, trace bool) (int, error)

func (*Reader) ReadAccountData

func (r *Reader) ReadAccountData(addr []byte, trace bool) ([]byte, error)

func (*Reader) ReadAccountStorage

func (r *Reader) ReadAccountStorage(addr []byte, loc []byte, trace bool) ([]byte, error)

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func (*Writer) Aggregate

func (w *Writer) Aggregate(trace bool) error

Aggegate should be called to check if the aggregation is required, and if it is required, perform it

func (*Writer) Close

func (w *Writer) Close()

func (*Writer) ComputeCommitment

func (w *Writer) ComputeCommitment(trace bool) ([]byte, error)

func (*Writer) DeleteAccount

func (w *Writer) DeleteAccount(addr []byte, trace bool) error

func (*Writer) FinishTx

func (w *Writer) FinishTx(txNum uint64, trace bool) error

func (*Writer) Reset

func (w *Writer) Reset(blockNum uint64, tx kv.RwTx) error

func (*Writer) UpdateAccountCode

func (w *Writer) UpdateAccountCode(addr []byte, code []byte, trace bool) error

func (*Writer) UpdateAccountData

func (w *Writer) UpdateAccountData(addr []byte, account []byte, trace bool) error

func (*Writer) WriteAccountStorage

func (w *Writer) WriteAccountStorage(addr, loc []byte, value []byte, trace bool) error

Jump to

Keyboard shortcuts

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