Documentation
¶
Index ¶
- type AccountAccess
- type BlockAccessList
- func (e *BlockAccessList) Copy() (res BlockAccessList)
- func (obj *BlockAccessList) DecodeRLP(dec *rlp.Stream) error
- func (obj *BlockAccessList) EncodeRLP(_w io.Writer) error
- func (e *BlockAccessList) Hash() common.Hash
- func (e *BlockAccessList) PrettyPrint() string
- func (e *BlockAccessList) Validate() error
- type CodeChange
- type ConstructionAccountAccess
- type ConstructionBlockAccessList
- func (b *ConstructionBlockAccessList) AccountRead(addr common.Address)
- func (b *ConstructionBlockAccessList) BalanceChange(txIdx uint16, address common.Address, balance *uint256.Int)
- func (b *ConstructionBlockAccessList) CodeChange(address common.Address, txIndex uint16, code []byte)
- func (b *ConstructionBlockAccessList) Copy() *ConstructionBlockAccessList
- func (b *ConstructionBlockAccessList) EncodeRLP(wr io.Writer) error
- func (b *ConstructionBlockAccessList) NonceChange(address common.Address, txIdx uint16, postNonce uint64)
- func (b *ConstructionBlockAccessList) PrettyPrint() string
- func (b *ConstructionBlockAccessList) StorageRead(address common.Address, key common.Hash)
- func (b *ConstructionBlockAccessList) StorageWrite(txIdx uint16, address common.Address, key, value common.Hash)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountAccess ¶
type AccountAccess struct {
Address [20]byte `ssz-size:"20"` // 20-byte Ethereum address
StorageWrites []encodingSlotWrites `ssz-max:"300000"` // Storage changes (slot -> [tx_index -> new_value])
StorageReads [][32]byte `ssz-max:"300000"` // Read-only storage keys
BalanceChanges []encodingBalanceChange `ssz-max:"300000"` // Balance changes ([tx_index -> post_balance])
NonceChanges []encodingAccountNonce `ssz-max:"300000"` // Nonce changes ([tx_index -> new_nonce])
Code []CodeChange `ssz-max:"1"` // Code changes ([tx_index -> new_code])
}
AccountAccess is the encoding format of ConstructionAccountAccess.
func (*AccountAccess) Copy ¶
func (e *AccountAccess) Copy() AccountAccess
Copy returns a deep copy of the account access
type BlockAccessList ¶
type BlockAccessList struct {
Accesses []AccountAccess `ssz-max:"300000"`
}
BlockAccessList is the encoding format of ConstructionBlockAccessList.
func (*BlockAccessList) Copy ¶
func (e *BlockAccessList) Copy() (res BlockAccessList)
Copy returns a deep copy of the access list
func (*BlockAccessList) Hash ¶
func (e *BlockAccessList) Hash() common.Hash
Hash computes the keccak256 hash of the access list
func (*BlockAccessList) PrettyPrint ¶
func (e *BlockAccessList) PrettyPrint() string
func (*BlockAccessList) Validate ¶
func (e *BlockAccessList) Validate() error
Validate returns an error if the contents of the access list are not ordered according to the spec or any code changes are contained which exceed protocol max code size.
type CodeChange ¶
CodeChange contains the runtime bytecode deployed at an address and the transaction index where the deployment took place.
type ConstructionAccountAccess ¶
type ConstructionAccountAccess struct {
// StorageWrites is the post-state values of an account's storage slots
// that were modified in a block, keyed by the slot key and the tx index
// where the modification occurred.
StorageWrites map[common.Hash]map[uint16]common.Hash `json:"storageWrites,omitempty"`
// StorageReads is the set of slot keys that were accessed during block
// execution.
//
// Storage slots which are both read and written (with changed values)
// appear only in StorageWrites.
StorageReads map[common.Hash]struct{} `json:"storageReads,omitempty"`
// BalanceChanges contains the post-transaction balances of an account,
// keyed by transaction indices where it was changed.
BalanceChanges map[uint16]*uint256.Int `json:"balanceChanges,omitempty"`
// NonceChanges contains the post-state nonce values of an account keyed
// by tx index.
NonceChanges map[uint16]uint64 `json:"nonceChanges,omitempty"`
// CodeChange is only set for contract accounts which were deployed in
// the block.
CodeChange *CodeChange `json:"codeChange,omitempty"`
}
ConstructionAccountAccess contains post-block account state for mutations as well as all storage keys that were read during execution. It is used when building block access list during execution.
func NewConstructionAccountAccess ¶
func NewConstructionAccountAccess() *ConstructionAccountAccess
NewConstructionAccountAccess initializes the account access object.
type ConstructionBlockAccessList ¶
type ConstructionBlockAccessList struct {
Accounts map[common.Address]*ConstructionAccountAccess
}
ConstructionBlockAccessList contains post-block modified state and some state accessed in execution (account addresses and storage keys).
func NewConstructionBlockAccessList ¶
func NewConstructionBlockAccessList() ConstructionBlockAccessList
NewConstructionBlockAccessList instantiates an empty access list.
func (*ConstructionBlockAccessList) AccountRead ¶
func (b *ConstructionBlockAccessList) AccountRead(addr common.Address)
AccountRead records the address of an account that has been read during execution.
func (*ConstructionBlockAccessList) BalanceChange ¶
func (b *ConstructionBlockAccessList) BalanceChange(txIdx uint16, address common.Address, balance *uint256.Int)
BalanceChange records the post-transaction balance of an account whose balance changed.
func (*ConstructionBlockAccessList) CodeChange ¶
func (b *ConstructionBlockAccessList) CodeChange(address common.Address, txIndex uint16, code []byte)
CodeChange records the code of a newly-created contract.
func (*ConstructionBlockAccessList) Copy ¶
func (b *ConstructionBlockAccessList) Copy() *ConstructionBlockAccessList
Copy returns a deep copy of the access list.
func (*ConstructionBlockAccessList) EncodeRLP ¶
func (b *ConstructionBlockAccessList) EncodeRLP(wr io.Writer) error
EncodeRLP returns the RLP-encoded access list
func (*ConstructionBlockAccessList) NonceChange ¶
func (b *ConstructionBlockAccessList) NonceChange(address common.Address, txIdx uint16, postNonce uint64)
NonceChange records tx post-state nonce of any contract-like accounts whose nonce was incremented.
func (*ConstructionBlockAccessList) PrettyPrint ¶
func (b *ConstructionBlockAccessList) PrettyPrint() string
PrettyPrint returns a human-readable representation of the access list
func (*ConstructionBlockAccessList) StorageRead ¶
func (b *ConstructionBlockAccessList) StorageRead(address common.Address, key common.Hash)
StorageRead records a storage key read during execution.
func (*ConstructionBlockAccessList) StorageWrite ¶
func (b *ConstructionBlockAccessList) StorageWrite(txIdx uint16, address common.Address, key, value common.Hash)
StorageWrite records the post-transaction value of a mutated storage slot. The storage slot is removed from the list of read slots.