Documentation
¶
Index ¶
- Constants
- Variables
- func EncodeAccountsPlain(blockN uint64, s *ChangeSet, f func(k, v []byte) error) error
- func EncodeStoragePlain(blockN uint64, s *ChangeSet, f func(k, v []byte) error) error
- func FromDBFormat(addrSize int) func(dbKey, dbValue []byte) (blockN uint64, k, v []byte)
- func GetModifiedAccounts(db ethdb.Database, startNum, endNum uint64) ([]common.Address, error)
- func Len(b []byte) int
- func RewindData(db ethdb.Getter, timestampSrc, timestampDst uint64, quit <-chan struct{}) (map[string][]byte, map[string][]byte, error)
- func Truncate(tx ethdb.Tx, from uint64) error
- func Walk(db ethdb.Database, bucket string, startkey []byte, fixedbits int, ...) error
- type AccountChangeSetPlain
- type Change
- type ChangeSet
- func (s *ChangeSet) Add(key []byte, value []byte) error
- func (s *ChangeSet) ChangedKeys() map[string]struct{}
- func (s *ChangeSet) Equals(s2 *ChangeSet) bool
- func (s *ChangeSet) KeySize() int
- func (s *ChangeSet) Len() int
- func (s *ChangeSet) Less(i, j int) bool
- func (s *ChangeSet) String() string
- func (s *ChangeSet) Swap(i, j int)
- type Decoder
- type Encoder
- type StorageChangeSetPlain
- func (b StorageChangeSetPlain) Find(blockNumber uint64, k []byte) ([]byte, error)
- func (b StorageChangeSetPlain) FindWithIncarnation(blockNumber uint64, k []byte) ([]byte, error)
- func (b StorageChangeSetPlain) FindWithoutIncarnation(blockNumber uint64, addressToFind []byte, keyToFind []byte) ([]byte, error)
- type Walker
Constants ¶
View Source
const (
DefaultIncarnation = uint64(1)
)
Variables ¶
View Source
var ( ErrNotFound = errors.New("not found") ErrFindValue = errors.New("find value error") )
View Source
var Mapper = map[string]struct { IndexBucket string WalkerAdapter func(cursor ethdb.CursorDupSort) Walker KeySize int Template string New func() *ChangeSet Encode Encoder Decode Decoder }{ dbutils.PlainAccountChangeSetBucket: { IndexBucket: dbutils.AccountsHistoryBucket, WalkerAdapter: func(c ethdb.CursorDupSort) Walker { return AccountChangeSetPlain{c: c} }, KeySize: common.AddressLength, Template: "acc-ind-", New: NewAccountChangeSetPlain, Encode: EncodeAccountsPlain, Decode: FromDBFormat(common.AddressLength), }, dbutils.PlainStorageChangeSetBucket: { IndexBucket: dbutils.StorageHistoryBucket, WalkerAdapter: func(c ethdb.CursorDupSort) Walker { return StorageChangeSetPlain{c: c} }, KeySize: common.AddressLength, Template: "st-ind-", New: NewStorageChangeSetPlain, Encode: EncodeStoragePlain, Decode: FromDBFormat(common.AddressLength), }, }
Functions ¶
func EncodeAccountsPlain ¶
func EncodeStoragePlain ¶
func FromDBFormat ¶
func GetModifiedAccounts ¶
GetModifiedAccounts returns a list of addresses that were modified in the block range
func RewindData ¶
func RewindData(db ethdb.Getter, timestampSrc, timestampDst uint64, quit <-chan struct{}) (map[string][]byte, map[string][]byte, error)
RewindDataPlain generates rewind data for all plain buckets between the timestamp timestapSrc is the current timestamp, and timestamp Dst is where we rewind
Types ¶
type AccountChangeSetPlain ¶
type AccountChangeSetPlain struct {
// contains filtered or unexported fields
}
type ChangeSet ¶
type ChangeSet struct { // Invariant: all keys are of the same size. Changes []Change // contains filtered or unexported fields }
ChangeSet is a map with keys of the same size. Both keys and values are byte strings.
func NewAccountChangeSetPlain ¶
func NewAccountChangeSetPlain() *ChangeSet
func NewChangeSet ¶
func NewChangeSet() *ChangeSet
func NewStorageChangeSetPlain ¶
func NewStorageChangeSetPlain() *ChangeSet
func (*ChangeSet) Add ¶
Add adds a new entry to the AccountChangeSet. One must not add an existing key and may add keys only of the same size.
func (*ChangeSet) ChangedKeys ¶
type StorageChangeSetPlain ¶
type StorageChangeSetPlain struct {
// contains filtered or unexported fields
}
func (StorageChangeSetPlain) Find ¶
func (b StorageChangeSetPlain) Find(blockNumber uint64, k []byte) ([]byte, error)
func (StorageChangeSetPlain) FindWithIncarnation ¶
func (b StorageChangeSetPlain) FindWithIncarnation(blockNumber uint64, k []byte) ([]byte, error)
func (StorageChangeSetPlain) FindWithoutIncarnation ¶
Click to show internal directories.
Click to hide internal directories.