Documentation ¶
Index ¶
- Variables
- func NewDeletedItem(index int, incarnation int) *valueItem
- func NewEstimateItem(index int, incarnation int) *valueItem
- func NewMultiVersionItem() *multiVersionItem
- func NewValueItem(index int, incarnation int, value common.Hash) *valueItem
- type Abort
- type AccessListTracer
- func (*AccessListTracer) CaptureEnd(output []byte, gasUsed uint64, err error)
- func (*AccessListTracer) CaptureEnter(typ vm.OpCode, from common.Address, to common.Address, input []byte, ...)
- func (*AccessListTracer) CaptureExit(output []byte, gasUsed uint64, err error)
- func (*AccessListTracer) CaptureFault(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost, ccLeft, ccOpcode uint64, ...)
- func (a *AccessListTracer) CaptureStart(env *vm.EVM, from common.Address, to common.Address, create bool, input []byte, ...)
- func (a *AccessListTracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost, ccLeft, ccOpcode uint64, ...)
- func (a *AccessListTracer) CaptureTxEnd(restGas uint64)
- func (*AccessListTracer) CaptureTxStart(gasLimit uint64)
- func (a *AccessListTracer) Delete(key StorageKey)
- func (a *AccessListTracer) Get(key StorageKey) common.Hash
- func (a *AccessListTracer) GetReadset() map[StorageKey][]common.Hash
- func (a *AccessListTracer) GetWriteset() map[StorageKey]common.Hash
- func (a *AccessListTracer) Has(key StorageKey) bool
- func (a *AccessListTracer) Set(key StorageKey, value common.Hash)
- func (a *AccessListTracer) UpdateReadSet(key StorageKey, value common.Hash)
- func (a *AccessListTracer) ValidGet(key StorageKey)
- func (a *AccessListTracer) ValidateReadset() bool
- func (a *AccessListTracer) WriteAbort(abort Abort)
- func (a *AccessListTracer) WriteEstimatesToMultiVersionStore()
- func (a *AccessListTracer) WriteToMultiVersionStore()
- type ExtraKey
- type MultiVersionStore
- type MultiVersionValue
- type MultiVersionValueItem
- type ReadSet
- type StorageKey
- type Store
- func (s *Store) ClearReadset(index int)
- func (s *Store) GetAllWritesetKeys() map[int][]StorageKey
- func (s *Store) GetLatest(key StorageKey) (value MultiVersionValueItem)
- func (s *Store) GetLatestBeforeIndex(index int, key StorageKey) (value MultiVersionValueItem)
- func (s *Store) GetParentState() *state.StateDB
- func (s *Store) GetReadset(index int) ReadSet
- func (s *Store) Has(index int, key StorageKey) bool
- func (s *Store) InvalidateWriteset(index int, incarnation int)
- func (s *Store) SetEstimatedWriteset(index int, incarnation int, writeset WriteSet)
- func (s *Store) SetReadset(index int, readset ReadSet)
- func (s *Store) SetWriteset(index int, incarnation int, writeset WriteSet)
- func (s *Store) ValidateTransactionState(index int) (bool, []int)
- func (s *Store) VersionedIndexedStore(msg blockchain.Message, index int, incarnation int, abortChannel chan Abort) *AccessListTracer
- func (s *Store) WriteLatestToStore(finalState *state.StateDB)
- func (s *Store) WriteLatestToStoreUntil(lastStoreIndex int, startIndex int, finalState *state.StateDB)
- type WriteSet
Constants ¶
This section is empty.
Variables ¶
var ( CodeCopyKey = common.BytesToHash([]byte("codecopy")) CodeHashKey = common.BytesToHash([]byte("codehash")) CodeSizeKey = common.BytesToHash([]byte("codesize")) BalanceKey = common.BytesToHash([]byte("balance")) SelfDestructKey = common.BytesToHash([]byte("selfdestruct")) NonceKey = common.BytesToHash([]byte("nonce")) )
var ( ErrReadEstimate = errors.New("multiversion store value contains estimate, cannot read, aborting") ErrNeedSequentialExecution = errors.New("transaction must execute sequentially, aborting") )
Functions ¶
func NewDeletedItem ¶
func NewEstimateItem ¶
func NewMultiVersionItem ¶
func NewMultiVersionItem() *multiVersionItem
Types ¶
type AccessListTracer ¶
type AccessListTracer struct {
// contains filtered or unexported fields
}
func NewAccessListTracer ¶
func NewAccessListTracer(multiVersionStore MultiVersionStore, msg blockchain.Message, transactionIndex int, incarnation int, abortedChannel chan Abort) *AccessListTracer
TODO-kaia: add initial value transfer to writeset?
func (*AccessListTracer) CaptureEnd ¶
func (*AccessListTracer) CaptureEnd(output []byte, gasUsed uint64, err error)
func (*AccessListTracer) CaptureEnter ¶
func (*AccessListTracer) CaptureExit ¶
func (*AccessListTracer) CaptureExit(output []byte, gasUsed uint64, err error)
func (*AccessListTracer) CaptureFault ¶
func (*AccessListTracer) CaptureStart ¶
func (*AccessListTracer) CaptureState ¶
func (a *AccessListTracer) CaptureState(env *vm.EVM, pc uint64, op vm.OpCode, gas, cost, ccLeft, ccOpcode uint64, scope *vm.ScopeContext, depth int, err error)
CaptureState captures all opcodes that touch storage or addresses and adds them to the accesslist.
func (*AccessListTracer) CaptureTxEnd ¶
func (a *AccessListTracer) CaptureTxEnd(restGas uint64)
func (*AccessListTracer) CaptureTxStart ¶
func (*AccessListTracer) CaptureTxStart(gasLimit uint64)
func (*AccessListTracer) Delete ¶
func (a *AccessListTracer) Delete(key StorageKey)
Delete implements types.KVStore.
func (*AccessListTracer) Get ¶
func (a *AccessListTracer) Get(key StorageKey) common.Hash
Get implements types.KVStore.
func (*AccessListTracer) GetReadset ¶
func (a *AccessListTracer) GetReadset() map[StorageKey][]common.Hash
GetReadset returns the readset
func (*AccessListTracer) GetWriteset ¶
func (a *AccessListTracer) GetWriteset() map[StorageKey]common.Hash
GetWriteset returns the writeset
func (*AccessListTracer) Has ¶
func (a *AccessListTracer) Has(key StorageKey) bool
Has implements types.KVStore.
func (*AccessListTracer) Set ¶
func (a *AccessListTracer) Set(key StorageKey, value common.Hash)
Set implements types.KVStore.
func (*AccessListTracer) UpdateReadSet ¶
func (a *AccessListTracer) UpdateReadSet(key StorageKey, value common.Hash)
func (*AccessListTracer) ValidGet ¶
func (a *AccessListTracer) ValidGet(key StorageKey)
func (*AccessListTracer) ValidateReadset ¶
func (a *AccessListTracer) ValidateReadset() bool
This function iterates over the readset, validating that the values in the readset are consistent with the values in the multiversion store and underlying parent store, and returns a boolean indicating validity
func (*AccessListTracer) WriteAbort ¶
func (a *AccessListTracer) WriteAbort(abort Abort)
func (*AccessListTracer) WriteEstimatesToMultiVersionStore ¶
func (a *AccessListTracer) WriteEstimatesToMultiVersionStore()
func (*AccessListTracer) WriteToMultiVersionStore ¶
func (a *AccessListTracer) WriteToMultiVersionStore()
type MultiVersionStore ¶
type MultiVersionStore interface { GetLatest(key StorageKey) (value MultiVersionValueItem) GetLatestBeforeIndex(index int, key StorageKey) (value MultiVersionValueItem) GetParentState() *state.StateDB Has(index int, key StorageKey) bool WriteLatestToStore(state *state.StateDB) WriteLatestToStoreUntil(lastStoreIndex int, startIndex int, state *state.StateDB) SetWriteset(index int, incarnation int, writeset WriteSet) InvalidateWriteset(index int, incarnation int) SetEstimatedWriteset(index int, incarnation int, writeset WriteSet) GetAllWritesetKeys() map[int][]StorageKey SetReadset(index int, readset ReadSet) GetReadset(index int) ReadSet ClearReadset(index int) ValidateTransactionState(index int) (bool, []int) VersionedIndexedStore(msg blockchain.Message, index int, incarnation int, abortChannel chan Abort) *AccessListTracer }
type MultiVersionValue ¶
type MultiVersionValue interface { GetLatest() (value MultiVersionValueItem, found bool) GetLatestNonEstimate() (value MultiVersionValueItem, found bool) GetLatestBeforeIndex(index int) (value MultiVersionValueItem, found bool) Set(index int, incarnation int, value common.Hash) SetEstimate(index int, incarnation int) Delete(index int, incarnation int) Remove(index int) }
type MultiVersionValueItem ¶
type ReadSet ¶
type ReadSet map[StorageKey][]common.Hash
type StorageKey ¶
type StorageKey string
func ToStorageKey ¶
func ToStorageKey(addr common.Address, slot common.Hash) StorageKey
func (StorageKey) Address ¶
func (k StorageKey) Address() common.Address
func (StorageKey) Bytes ¶
func (k StorageKey) Bytes() []byte
func (StorageKey) SetValue ¶
func (k StorageKey) SetValue(stateDB *state.StateDB, value common.Hash)
func (StorageKey) Slot ¶
func (k StorageKey) Slot() common.Hash
func (StorageKey) String ¶
func (k StorageKey) String() string
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewMultiVersionStore ¶
func (*Store) ClearReadset ¶
func (*Store) GetAllWritesetKeys ¶
func (s *Store) GetAllWritesetKeys() map[int][]StorageKey
GetAllWritesetKeys implements MultiVersionStore.
func (*Store) GetLatest ¶
func (s *Store) GetLatest(key StorageKey) (value MultiVersionValueItem)
GetLatest implements MultiVersionStore.
func (*Store) GetLatestBeforeIndex ¶
func (s *Store) GetLatestBeforeIndex(index int, key StorageKey) (value MultiVersionValueItem)
GetLatestBeforeIndex implements MultiVersionStore.
func (*Store) GetParentState ¶
func (*Store) GetReadset ¶
func (*Store) Has ¶
func (s *Store) Has(index int, key StorageKey) bool
Has implements MultiVersionStore. It checks if the key exists in the multiversion store at or before the specified index.
func (*Store) InvalidateWriteset ¶
InvalidateWriteset iterates over the keys for the given index and incarnation writeset and replaces with ESTIMATEs
func (*Store) SetEstimatedWriteset ¶
SetEstimatedWriteset is used to directly write estimates instead of writing a writeset and later invalidating
func (*Store) SetReadset ¶
func (*Store) SetWriteset ¶
SetWriteset sets a writeset for a transaction index, and also writes all of the multiversion items in the writeset to the multiversion store. TODO: returns a list of NEW keys added
func (*Store) ValidateTransactionState ¶
TODO: do we want to return bool + []int where bool indicates whether it was valid and then []int indicates only ones for which we need to wait due to estimates? - yes i think so?
func (*Store) VersionedIndexedStore ¶
func (s *Store) VersionedIndexedStore(msg blockchain.Message, index int, incarnation int, abortChannel chan Abort) *AccessListTracer
func (*Store) WriteLatestToStore ¶
type WriteSet ¶
type WriteSet map[StorageKey]common.Hash