Documentation ¶
Index ¶
- Constants
- type AccessListTrie
- type Account
- type BlockHash
- type BlockHashTree
- func (b *BlockHashTree) Copy() *BlockHashTree
- func (b *BlockHashTree) EncodeState() []byte
- func (b *BlockHashTree) GetBlockHash(number uint64) common.Hash
- func (b *BlockHashTree) GetProof(number uint64) ([]common.Hash, uint64, error)
- func (b *BlockHashTree) Root() common.Hash
- func (b *BlockHashTree) SetBlockHash(number *uint256.Int, hash common.Hash) error
- type BlockHashes
- type BlockState
- type CallFlag
- type InterState
- type IntraState
- type LogSeries
- type Memory
- func (m *Memory) Cell(i uint64) *uint256.Int
- func (m *Memory) CellNum() uint64
- func (m *Memory) Data() []byte
- func (m *Memory) Empty() bool
- func (m *Memory) EncodeState() []byte
- func (m *Memory) GetAppendProof() []common.Hash
- func (m *Memory) GetCombinedProof(indices []uint64) ([]common.Hash, error)
- func (m *Memory) GetProof(indices []uint64) []common.Hash
- func (m *Memory) Root() common.Hash
- func (m *Memory) Size() uint64
- type OneStepState
- type ReceiptTrie
- type SelfDestructSet
- type Stack
- func (st *Stack) Back(n int) *uint256.Int
- func (st *Stack) Copy() *Stack
- func (st *Stack) Data() []uint256.Int
- func (st *Stack) EncodeState() []byte
- func (st *Stack) Hash() common.Hash
- func (st *Stack) HashAfterPops(n int) common.Hash
- func (st *Stack) Len() int
- func (st *Stack) Peek() *uint256.Int
- func (st *Stack) PopN(n int)
- type StateType
- type TransactionTrie
Constants ¶
View Source
const ( CALLFLAG_CALL = 0 CALLFLAG_CALLCODE = 1 CALLFLAG_DELEGATECALL = 2 CALLFLAG_STATICCALL = 3 CALLFLAG_CREATE = 4 CALLFLAG_CREATE2 = 5 )
View Source
const RECENT_BLOCK_HASHES_LENGTH = 256
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessListTrie ¶
type AccessListTrie struct { }
func NewAccessListTrie ¶
func NewAccessListTrie() *AccessListTrie
func (*AccessListTrie) EncodeState ¶
func (s *AccessListTrie) EncodeState() []byte
func (*AccessListTrie) Root ¶
func (s *AccessListTrie) Root() common.Hash
type Account ¶
type Account struct { Nonce uint64 Balance uint256.Int StorageRoot common.Hash CodeHash common.Hash }
func AccountFromEVM ¶
func AccountFromEVM(acc types.StateAccount) *Account
type BlockHash ¶
func (BlockHash) CalculateHash ¶
type BlockHashTree ¶
type BlockHashTree struct { Hashes BlockHashes // contains filtered or unexported fields }
func BlockHashTreeFromBlockContext ¶
func BlockHashTreeFromBlockContext(blockCtx *vm.BlockContext) (*BlockHashTree, error)
func BlockHashTreeFromContext ¶
func BlockHashTreeFromContext(blockCtx *vm.Context) (*BlockHashTree, error)
func NewBlockHashTree ¶
func NewBlockHashTree(hashes *BlockHashes) (*BlockHashTree, error)
func (*BlockHashTree) Copy ¶
func (b *BlockHashTree) Copy() *BlockHashTree
func (*BlockHashTree) EncodeState ¶
func (b *BlockHashTree) EncodeState() []byte
func (*BlockHashTree) GetBlockHash ¶
func (b *BlockHashTree) GetBlockHash(number uint64) common.Hash
func (*BlockHashTree) Root ¶
func (b *BlockHashTree) Root() common.Hash
func (*BlockHashTree) SetBlockHash ¶
type BlockHashes ¶
type BlockHashes [RECENT_BLOCK_HASHES_LENGTH]BlockHash
type BlockState ¶
type BlockState struct { BlockNumber uint64 GlobalState vm.StateDB BlockHashTree *BlockHashTree }
Represent the state at the end of a finalized block
func BlockStateFromBlock ¶
func BlockStateFromBlock(blockNumber uint64, stateDB vm.StateDB, blockHashTree *BlockHashTree) (*BlockState, error)
func (*BlockState) Hash ¶
func (s *BlockState) Hash() common.Hash
func (*BlockState) IsInter ¶
func (s *BlockState) IsInter() bool
type InterState ¶
type InterState struct { BlockNumber uint64 TransactionIdx uint64 GlobalState vm.StateDB BlockGasUsed *uint256.Int BlockHashTree *BlockHashTree TransactionTrie *TransactionTrie ReceiptTrie *ReceiptTrie }
func InterStateFromCaptured ¶
func InterStateFromCaptured( blockNumber, transactionIdx uint64, statedb vm.StateDB, blockGasUsed *big.Int, transactions types.Transactions, receipts types.Receipts, blockHashTree *BlockHashTree, ) *InterState
func (*InterState) Hash ¶
func (s *InterState) Hash() common.Hash
func (*InterState) IsInter ¶
func (s *InterState) IsInter() bool
type IntraState ¶
type IntraState struct { BlockNumber uint64 TransactionIdx uint64 Depth uint16 Gas uint64 Refund uint64 LastDepthState OneStepState ContractAddress common.Address Caller common.Address Value uint256.Int CallFlag CallFlag Out uint64 OutSize uint64 Pc uint64 OpCode vm.OpCode CodeHash common.Hash Stack *Stack Memory *Memory InputData *Memory ReturnData *Memory CommittedGlobalState vm.StateDB GlobalState vm.StateDB SelfDestructSet *SelfDestructSet LogSeries *LogSeries BlockHashTree *BlockHashTree AccessListTrie *AccessListTrie }
func StateFromCaptured ¶
func StateFromCaptured( blockNumber, transactionIdx uint64, committedGlobalState vm.StateDB, selfDestructSet *SelfDestructSet, blockHashTree *BlockHashTree, accessListTrie *AccessListTrie, evm *vm.EVM, lastDepthState OneStepState, callFlag CallFlag, inputData *Memory, out, outSize, pc uint64, op vm.OpCode, gas, cost uint64, memory *vm.Memory, stack *vm.Stack, contract *vm.Contract, rData []byte, depth int, ) *IntraState
func (*IntraState) Encode ¶
func (s *IntraState) Encode() []byte
func (*IntraState) Hash ¶
func (s *IntraState) Hash() common.Hash
func (*IntraState) HashAsLastDepth ¶
func (s *IntraState) HashAsLastDepth(callFlag CallFlag, cost uint64) common.Hash
func (*IntraState) IsInter ¶
func (s *IntraState) IsInter() bool
func (*IntraState) StateAsLastDepth ¶
func (s *IntraState) StateAsLastDepth(callFlag CallFlag, cost uint64) *IntraState
Make sure the cost is less than the current gas
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
func MemoryFromEVMMemory ¶
func NewMemoryFromBytes ¶
func (*Memory) EncodeState ¶
func (*Memory) GetAppendProof ¶
func (*Memory) GetCombinedProof ¶
type OneStepState ¶
type ReceiptTrie ¶
type ReceiptTrie struct {
// contains filtered or unexported fields
}
func NewReceiptTrie ¶
func NewReceiptTrie(receipts types.Receipts) *ReceiptTrie
func (*ReceiptTrie) Bloom ¶
func (r *ReceiptTrie) Bloom() types.Bloom
func (*ReceiptTrie) EncodeState ¶
func (r *ReceiptTrie) EncodeState() []byte
func (*ReceiptTrie) GetReceipt ¶
func (r *ReceiptTrie) GetReceipt(index int) *types.Receipt
func (*ReceiptTrie) Root ¶
func (r *ReceiptTrie) Root() common.Hash
type SelfDestructSet ¶
func NewSelfDestructSet ¶
func NewSelfDestructSet() *SelfDestructSet
func (*SelfDestructSet) Add ¶
func (s *SelfDestructSet) Add(addr common.Address) *SelfDestructSet
func (*SelfDestructSet) EncodeState ¶
func (s *SelfDestructSet) EncodeState() []byte
type Stack ¶
type Stack struct {
// contains filtered or unexported fields
}
func EmptyStack ¶
func EmptyStack() *Stack
func StackFromEVMStack ¶
func (*Stack) EncodeState ¶
type TransactionTrie ¶
type TransactionTrie struct {
// contains filtered or unexported fields
}
func NewTransactionTrie ¶
func NewTransactionTrie(txs types.Transactions) *TransactionTrie
func (*TransactionTrie) EncodeState ¶
func (t *TransactionTrie) EncodeState() []byte
func (*TransactionTrie) GetTransaction ¶
func (t *TransactionTrie) GetTransaction(index int) *types.Transaction
func (*TransactionTrie) Root ¶
func (t *TransactionTrie) Root() common.Hash
Click to show internal directories.
Click to hide internal directories.