proxy

package
v0.0.0-...-a3f79bb Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: LGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDeltaLoggerProxy

func NewDeltaLoggerProxy(db state.StateDB, sink *DeltaLogSink) state.StateDB

NewDeltaLoggerProxy wraps the given StateDB with the delta logger.

func NewLoggerProxy

func NewLoggerProxy(db state.StateDB, log logger.Logger, output chan string, wg *sync.WaitGroup) state.StateDB

NewLoggerProxy wraps the given StateDB instance into a logging wrapper causing every StateDB operation (except BulkLoading) to be logged for debugging.

func NewShadowProxy

func NewShadowProxy(prime, shadow state.StateDB, compareStateHash bool) state.StateDB

NewShadowProxy creates a StateDB instance bundling two other instances and running each operation on both of them, cross checking results. If the results are not equal, an error is logged and the result of the primary instance is returned.

Types

type ContractLiveliness

type ContractLiveliness struct {
	Addr      common.Address
	IsDeleted bool //if false, the account was created
}

type DeletionProxy

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

DeletionProxy data structure for capturing and recording invoked StateDB operations.

func NewDeletionProxy

func NewDeletionProxy(db state.StateDB, ch chan ContractLiveliness, logLevel string) *DeletionProxy

NewDeletionProxy creates a new StateDB proxy.

func (*DeletionProxy) AccessEvents

func (r *DeletionProxy) AccessEvents() *geth.AccessEvents

func (*DeletionProxy) AddAddressToAccessList

func (r *DeletionProxy) AddAddressToAccessList(addr common.Address)

AddAddressToAccessList adds an address to the access list.

func (*DeletionProxy) AddBalance

func (r *DeletionProxy) AddBalance(addr common.Address, amount *uint256.Int, reason tracing.BalanceChangeReason) uint256.Int

AddBalance adds amount to a contract address.

func (*DeletionProxy) AddLog

func (r *DeletionProxy) AddLog(log *types.Log)

AddLog adds a log entry.

func (*DeletionProxy) AddPreimage

func (r *DeletionProxy) AddPreimage(addr common.Hash, image []byte)

AddPreimage adds a SHA3 preimage.

func (*DeletionProxy) AddRefund

func (r *DeletionProxy) AddRefund(gas uint64)

AddRefund adds gas to the refund counter.

func (*DeletionProxy) AddSlotToAccessList

func (r *DeletionProxy) AddSlotToAccessList(addr common.Address, slot common.Hash)

AddSlotToAccessList adds the given (address, slot)-tuple to the access list

func (*DeletionProxy) AddressInAccessList

func (r *DeletionProxy) AddressInAccessList(addr common.Address) bool

AddressInAccessList checks whether an address is in the access list.

func (*DeletionProxy) BeginBlock

func (r *DeletionProxy) BeginBlock(number uint64) error

func (*DeletionProxy) BeginSyncPeriod

func (r *DeletionProxy) BeginSyncPeriod(number uint64)

func (*DeletionProxy) BeginTransaction

func (r *DeletionProxy) BeginTransaction(number uint32) error

func (*DeletionProxy) Close

func (r *DeletionProxy) Close() error

func (*DeletionProxy) Commit

func (r *DeletionProxy) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, error)

func (*DeletionProxy) CreateAccount

func (r *DeletionProxy) CreateAccount(addr common.Address)

CreateAccount creates a new account.

func (*DeletionProxy) CreateContract

func (r *DeletionProxy) CreateContract(addr common.Address)

func (*DeletionProxy) Empty

func (r *DeletionProxy) Empty(addr common.Address) bool

Empty checks whether the contract is either non-existent or empty according to the EIP161 specification (balance = nonce = code = 0).

func (*DeletionProxy) EndBlock

func (r *DeletionProxy) EndBlock() error

func (*DeletionProxy) EndSyncPeriod

func (r *DeletionProxy) EndSyncPeriod()

func (*DeletionProxy) EndTransaction

func (r *DeletionProxy) EndTransaction() error

func (*DeletionProxy) Error

func (r *DeletionProxy) Error() error

func (*DeletionProxy) Exist

func (r *DeletionProxy) Exist(addr common.Address) bool

Exist checks whether the contract exists in the StateDB. Notably this also returns true for suicided accounts.

func (*DeletionProxy) Finalise

func (r *DeletionProxy) Finalise(deleteEmptyObjects bool)

Finalise the state in StateDB.

func (*DeletionProxy) GetArchiveBlockHeight

func (r *DeletionProxy) GetArchiveBlockHeight() (uint64, bool, error)

func (*DeletionProxy) GetArchiveState

func (r *DeletionProxy) GetArchiveState(block uint64) (state.NonCommittableStateDB, error)

func (*DeletionProxy) GetBalance

func (r *DeletionProxy) GetBalance(addr common.Address) *uint256.Int

GetBalance retrieves the amount of a contract address.

func (*DeletionProxy) GetCode

func (r *DeletionProxy) GetCode(addr common.Address) []byte

GetCode returns the EVM bytecode of a contract.

func (*DeletionProxy) GetCodeHash

func (r *DeletionProxy) GetCodeHash(addr common.Address) common.Hash

GetCodeHash returns the hash of the EVM bytecode.

func (*DeletionProxy) GetCodeSize

func (r *DeletionProxy) GetCodeSize(addr common.Address) int

GetCodeSize returns the EVM bytecode's size.

func (*DeletionProxy) GetCommittedState

func (r *DeletionProxy) GetCommittedState(addr common.Address, key common.Hash) common.Hash

GetCommittedState retrieves a value that is already committed.

func (*DeletionProxy) GetHash

func (r *DeletionProxy) GetHash() (common.Hash, error)

func (*DeletionProxy) GetLogs

func (r *DeletionProxy) GetLogs(hash common.Hash, block uint64, blockHash common.Hash, blkTimestamp uint64) []*types.Log

GetLogs retrieves log entries.

func (*DeletionProxy) GetMemoryUsage

func (r *DeletionProxy) GetMemoryUsage() *state.MemoryUsage

func (*DeletionProxy) GetNonce

func (r *DeletionProxy) GetNonce(addr common.Address) uint64

GetNonce retrieves the nonce of a contract address.

func (*DeletionProxy) GetRefund

func (r *DeletionProxy) GetRefund() uint64

GetRefund returns the current value of the refund counter.

func (*DeletionProxy) GetShadowDB

func (r *DeletionProxy) GetShadowDB() state.StateDB

func (*DeletionProxy) GetState

func (r *DeletionProxy) GetState(addr common.Address, key common.Hash) common.Hash

GetState retrieves a value from the StateDB.

func (*DeletionProxy) GetStateAndCommittedState

func (r *DeletionProxy) GetStateAndCommittedState(addr common.Address, key common.Hash) (common.Hash, common.Hash)

func (*DeletionProxy) GetStorageRoot

func (r *DeletionProxy) GetStorageRoot(addr common.Address) common.Hash

func (*DeletionProxy) GetSubstatePostAlloc

func (r *DeletionProxy) GetSubstatePostAlloc() txcontext.WorldState

GetSubstatePostAlloc gets substate post allocation.

func (*DeletionProxy) GetTransientState

func (r *DeletionProxy) GetTransientState(addr common.Address, key common.Hash) common.Hash

func (*DeletionProxy) HasSelfDestructed

func (r *DeletionProxy) HasSelfDestructed(addr common.Address) bool

HasSelfDestructed checks whether a contract has been suicided.

func (*DeletionProxy) IntermediateRoot

func (r *DeletionProxy) IntermediateRoot(deleteEmptyObjects bool) common.Hash

IntermediateRoot computes the current hash of the StateDB. It is called in between transactions to get the root hash that goes into transaction receipts.

func (*DeletionProxy) PointCache

func (r *DeletionProxy) PointCache() *utils.PointCache

PointCache returns the point cache used in computations.

func (*DeletionProxy) Prepare

func (r *DeletionProxy) Prepare(rules params.Rules, sender, coinbase common.Address, dest *common.Address, precompiles []common.Address, txAccesses types.AccessList)

Prepare handles the preparatory steps for executing a state transition with regards to both EIP-2929 and EIP-2930:

- Add sender to access list (2929) - Add destination to access list (2929) - Add precompiles to access list (2929) - Add the contents of the optional tx access list (2930)

This method should only be called if Berlin/2929+2930 is applicable at the current number.

func (*DeletionProxy) PrepareSubstate

func (r *DeletionProxy) PrepareSubstate(substate txcontext.WorldState, block uint64)

func (*DeletionProxy) RevertToSnapshot

func (r *DeletionProxy) RevertToSnapshot(snapshot int)

RevertToSnapshot reverts all state changes from a given revision.

func (*DeletionProxy) SelfDestruct

func (r *DeletionProxy) SelfDestruct(addr common.Address) uint256.Int

SelfDestruct marks the given account as suicided. This clears the account balance. The account is still available until the state is committed; return a non-nil account after SelfDestruct.

func (*DeletionProxy) SelfDestruct6780

func (r *DeletionProxy) SelfDestruct6780(addr common.Address) (uint256.Int, bool)

func (*DeletionProxy) SetCode

func (r *DeletionProxy) SetCode(addr common.Address, code []byte, reason tracing.CodeChangeReason) []byte

SetCode sets the EVM bytecode of a contract.

func (*DeletionProxy) SetNonce

func (r *DeletionProxy) SetNonce(addr common.Address, nonce uint64, reason tracing.NonceChangeReason)

SetNonce sets the nonce of a contract address.

func (*DeletionProxy) SetState

func (r *DeletionProxy) SetState(addr common.Address, key common.Hash, value common.Hash) common.Hash

SetState sets a value in the StateDB.

func (*DeletionProxy) SetTransientState

func (r *DeletionProxy) SetTransientState(addr common.Address, key common.Hash, value common.Hash)

func (*DeletionProxy) SetTxContext

func (r *DeletionProxy) SetTxContext(thash common.Hash, ti int)

Prepare sets the current transaction hash and index.

func (*DeletionProxy) SlotInAccessList

func (r *DeletionProxy) SlotInAccessList(addr common.Address, slot common.Hash) (bool, bool)

SlotInAccessList checks whether the (address, slot)-tuple is in the access list.

func (*DeletionProxy) Snapshot

func (r *DeletionProxy) Snapshot() int

Snapshot returns an identifier for the current revision of the state.

func (*DeletionProxy) StartBulkLoad

func (r *DeletionProxy) StartBulkLoad(uint64) (state.BulkLoad, error)

func (*DeletionProxy) SubBalance

func (r *DeletionProxy) SubBalance(addr common.Address, amount *uint256.Int, reason tracing.BalanceChangeReason) uint256.Int

SubBalance subtracts amount from a contract address.

func (*DeletionProxy) SubRefund

func (r *DeletionProxy) SubRefund(gas uint64)

SubRefund subtracts gas to the refund counter.

func (*DeletionProxy) Witness

func (r *DeletionProxy) Witness() *stateless.Witness

Witness retrieves the current state witness.

type DeltaLogSink

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

DeltaLogSink writes textual operations to disk in the format expected by the delta debugger.

func NewDeltaLogSink

func NewDeltaLogSink(log logger.Logger, writer *bufio.Writer, closer io.Closer) *DeltaLogSink

NewDeltaLogSink creates a sink that logs to the provided writer and logger.

func (*DeltaLogSink) Close

func (s *DeltaLogSink) Close() error

Close flushes and closes the underlying writer/closer.

func (*DeltaLogSink) Flush

func (s *DeltaLogSink) Flush() error

Flush flushes buffered data and fsyncs when supported by the closer.

func (*DeltaLogSink) Logf

func (s *DeltaLogSink) Logf(format string, args ...any)

Logf writes the formatted message to the sink and flushes immediately so the last operation is present even if the process crashes.

type DeltaLoggingStateDB

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

DeltaLoggingStateDB logs operations in the delta debugger format before executing them.

func (*DeltaLoggingStateDB) AccessEvents

func (s *DeltaLoggingStateDB) AccessEvents() *geth.AccessEvents

func (*DeltaLoggingStateDB) AddAddressToAccessList

func (s *DeltaLoggingStateDB) AddAddressToAccessList(addr common.Address)

func (*DeltaLoggingStateDB) AddBalance

func (s *DeltaLoggingStateDB) AddBalance(addr common.Address, value *uint256.Int, reason tracing.BalanceChangeReason) uint256.Int

func (*DeltaLoggingStateDB) AddLog

func (s *DeltaLoggingStateDB) AddLog(entry *types.Log)

func (*DeltaLoggingStateDB) AddPreimage

func (s *DeltaLoggingStateDB) AddPreimage(hash common.Hash, data []byte)

func (*DeltaLoggingStateDB) AddRefund

func (s *DeltaLoggingStateDB) AddRefund(amount uint64)

func (*DeltaLoggingStateDB) AddSlotToAccessList

func (s *DeltaLoggingStateDB) AddSlotToAccessList(addr common.Address, slot common.Hash)

func (*DeltaLoggingStateDB) AddressInAccessList

func (s *DeltaLoggingStateDB) AddressInAccessList(addr common.Address) bool

func (*DeltaLoggingStateDB) BeginBlock

func (s *DeltaLoggingStateDB) BeginBlock(blk uint64) error

func (*DeltaLoggingStateDB) BeginSyncPeriod

func (s *DeltaLoggingStateDB) BeginSyncPeriod(number uint64)

func (*DeltaLoggingStateDB) BeginTransaction

func (s *DeltaLoggingStateDB) BeginTransaction(tx uint32) error

func (*DeltaLoggingStateDB) Close

func (s *DeltaLoggingStateDB) Close() error

func (*DeltaLoggingStateDB) Commit

func (s *DeltaLoggingStateDB) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, error)

func (*DeltaLoggingStateDB) CreateAccount

func (s *DeltaLoggingStateDB) CreateAccount(addr common.Address)

func (*DeltaLoggingStateDB) CreateContract

func (s *DeltaLoggingStateDB) CreateContract(addr common.Address)

func (*DeltaLoggingStateDB) Empty

func (s *DeltaLoggingStateDB) Empty(addr common.Address) bool

func (*DeltaLoggingStateDB) EndBlock

func (s *DeltaLoggingStateDB) EndBlock() error

func (*DeltaLoggingStateDB) EndSyncPeriod

func (s *DeltaLoggingStateDB) EndSyncPeriod()

func (*DeltaLoggingStateDB) EndTransaction

func (s *DeltaLoggingStateDB) EndTransaction() error

func (*DeltaLoggingStateDB) Error

func (s *DeltaLoggingStateDB) Error() error

func (*DeltaLoggingStateDB) Exist

func (s *DeltaLoggingStateDB) Exist(addr common.Address) bool

func (*DeltaLoggingStateDB) Finalise

func (s *DeltaLoggingStateDB) Finalise(deleteEmptyObjects bool)

func (*DeltaLoggingStateDB) GetArchiveBlockHeight

func (s *DeltaLoggingStateDB) GetArchiveBlockHeight() (uint64, bool, error)

func (*DeltaLoggingStateDB) GetArchiveState

func (s *DeltaLoggingStateDB) GetArchiveState(block uint64) (state.NonCommittableStateDB, error)

func (*DeltaLoggingStateDB) GetBalance

func (s *DeltaLoggingStateDB) GetBalance(addr common.Address) *uint256.Int

func (*DeltaLoggingStateDB) GetCode

func (s *DeltaLoggingStateDB) GetCode(addr common.Address) []byte

func (*DeltaLoggingStateDB) GetCodeHash

func (s *DeltaLoggingStateDB) GetCodeHash(addr common.Address) common.Hash

func (*DeltaLoggingStateDB) GetCodeSize

func (s *DeltaLoggingStateDB) GetCodeSize(addr common.Address) int

func (*DeltaLoggingStateDB) GetCommittedState

func (s *DeltaLoggingStateDB) GetCommittedState(addr common.Address, key common.Hash) common.Hash

func (*DeltaLoggingStateDB) GetHash

func (s *DeltaLoggingStateDB) GetHash() (common.Hash, error)

func (*DeltaLoggingStateDB) GetLogs

func (s *DeltaLoggingStateDB) GetLogs(hash common.Hash, block uint64, blockHash common.Hash, blkTimestamp uint64) []*types.Log

func (*DeltaLoggingStateDB) GetMemoryUsage

func (s *DeltaLoggingStateDB) GetMemoryUsage() *state.MemoryUsage

func (*DeltaLoggingStateDB) GetNonce

func (s *DeltaLoggingStateDB) GetNonce(addr common.Address) uint64

func (*DeltaLoggingStateDB) GetRefund

func (s *DeltaLoggingStateDB) GetRefund() uint64

func (*DeltaLoggingStateDB) GetShadowDB

func (s *DeltaLoggingStateDB) GetShadowDB() state.StateDB

func (*DeltaLoggingStateDB) GetState

func (s *DeltaLoggingStateDB) GetState(addr common.Address, key common.Hash) common.Hash

func (*DeltaLoggingStateDB) GetStateAndCommittedState

func (s *DeltaLoggingStateDB) GetStateAndCommittedState(addr common.Address, key common.Hash) (common.Hash, common.Hash)

func (*DeltaLoggingStateDB) GetStorageRoot

func (s *DeltaLoggingStateDB) GetStorageRoot(addr common.Address) common.Hash

func (*DeltaLoggingStateDB) GetSubstatePostAlloc

func (s *DeltaLoggingStateDB) GetSubstatePostAlloc() txcontext.WorldState

func (*DeltaLoggingStateDB) GetTransientState

func (s *DeltaLoggingStateDB) GetTransientState(addr common.Address, key common.Hash) common.Hash

func (*DeltaLoggingStateDB) HasSelfDestructed

func (s *DeltaLoggingStateDB) HasSelfDestructed(addr common.Address) bool

func (*DeltaLoggingStateDB) IntermediateRoot

func (s *DeltaLoggingStateDB) IntermediateRoot(deleteEmptyObjects bool) common.Hash

func (*DeltaLoggingStateDB) PointCache

func (s *DeltaLoggingStateDB) PointCache() *utils.PointCache

func (*DeltaLoggingStateDB) Prepare

func (s *DeltaLoggingStateDB) Prepare(rules params.Rules, sender, coinbase common.Address, dest *common.Address, precompiles []common.Address, txAccesses types.AccessList)

func (*DeltaLoggingStateDB) PrepareSubstate

func (s *DeltaLoggingStateDB) PrepareSubstate(substate txcontext.WorldState, block uint64)

func (*DeltaLoggingStateDB) RevertToSnapshot

func (s *DeltaLoggingStateDB) RevertToSnapshot(id int)

func (*DeltaLoggingStateDB) SelfDestruct

func (s *DeltaLoggingStateDB) SelfDestruct(addr common.Address) uint256.Int

func (*DeltaLoggingStateDB) SelfDestruct6780

func (s *DeltaLoggingStateDB) SelfDestruct6780(addr common.Address) (uint256.Int, bool)

func (*DeltaLoggingStateDB) SetCode

func (s *DeltaLoggingStateDB) SetCode(addr common.Address, code []byte, reason tracing.CodeChangeReason) []byte

func (*DeltaLoggingStateDB) SetNonce

func (s *DeltaLoggingStateDB) SetNonce(addr common.Address, nonce uint64, reason tracing.NonceChangeReason)

func (*DeltaLoggingStateDB) SetState

func (s *DeltaLoggingStateDB) SetState(addr common.Address, key common.Hash, value common.Hash) common.Hash

func (*DeltaLoggingStateDB) SetTransientState

func (s *DeltaLoggingStateDB) SetTransientState(addr common.Address, key common.Hash, value common.Hash)

func (*DeltaLoggingStateDB) SetTxContext

func (s *DeltaLoggingStateDB) SetTxContext(thash common.Hash, ti int)

func (*DeltaLoggingStateDB) SlotInAccessList

func (s *DeltaLoggingStateDB) SlotInAccessList(addr common.Address, slot common.Hash) (addressOk bool, slotOk bool)

func (*DeltaLoggingStateDB) Snapshot

func (s *DeltaLoggingStateDB) Snapshot() int

func (*DeltaLoggingStateDB) StartBulkLoad

func (s *DeltaLoggingStateDB) StartBulkLoad(block uint64) (state.BulkLoad, error)

We intentionally do not wrap bulk-load operations because the delta replayer does not understand them. This keeps generated traces compatible with the delta debugger.

func (*DeltaLoggingStateDB) SubBalance

func (s *DeltaLoggingStateDB) SubBalance(addr common.Address, value *uint256.Int, reason tracing.BalanceChangeReason) uint256.Int

func (*DeltaLoggingStateDB) SubRefund

func (s *DeltaLoggingStateDB) SubRefund(amount uint64)

func (*DeltaLoggingStateDB) Witness

func (s *DeltaLoggingStateDB) Witness() *stateless.Witness

type LoggingStateDb

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

func (*LoggingStateDb) AccessEvents

func (s *LoggingStateDb) AccessEvents() *geth.AccessEvents

func (*LoggingStateDb) AddAddressToAccessList

func (s *LoggingStateDb) AddAddressToAccessList(addr common.Address)

func (*LoggingStateDb) AddBalance

func (s *LoggingStateDb) AddBalance(addr common.Address, value *uint256.Int, reason tracing.BalanceChangeReason) uint256.Int

func (*LoggingStateDb) AddLog

func (s *LoggingStateDb) AddLog(entry *types.Log)

func (*LoggingStateDb) AddPreimage

func (s *LoggingStateDb) AddPreimage(hash common.Hash, data []byte)

func (*LoggingStateDb) AddRefund

func (s *LoggingStateDb) AddRefund(amount uint64)

func (*LoggingStateDb) AddSlotToAccessList

func (s *LoggingStateDb) AddSlotToAccessList(addr common.Address, slot common.Hash)

func (*LoggingStateDb) AddressInAccessList

func (s *LoggingStateDb) AddressInAccessList(addr common.Address) bool

func (*LoggingStateDb) BeginBlock

func (s *LoggingStateDb) BeginBlock(blk uint64) error

func (*LoggingStateDb) BeginSyncPeriod

func (s *LoggingStateDb) BeginSyncPeriod(number uint64)

func (*LoggingStateDb) BeginTransaction

func (s *LoggingStateDb) BeginTransaction(tx uint32) error

func (*LoggingStateDb) Close

func (s *LoggingStateDb) Close() error

func (*LoggingStateDb) Commit

func (s *LoggingStateDb) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, error)

func (*LoggingStateDb) CreateAccount

func (s *LoggingStateDb) CreateAccount(addr common.Address)

func (*LoggingStateDb) CreateContract

func (s *LoggingStateDb) CreateContract(addr common.Address)

func (*LoggingStateDb) Empty

func (s *LoggingStateDb) Empty(addr common.Address) bool

func (*LoggingStateDb) EndBlock

func (s *LoggingStateDb) EndBlock() error

func (*LoggingStateDb) EndSyncPeriod

func (s *LoggingStateDb) EndSyncPeriod()

func (*LoggingStateDb) EndTransaction

func (s *LoggingStateDb) EndTransaction() error

func (*LoggingStateDb) Error

func (s *LoggingStateDb) Error() error

func (*LoggingStateDb) Exist

func (s *LoggingStateDb) Exist(addr common.Address) bool

func (*LoggingStateDb) Finalise

func (s *LoggingStateDb) Finalise(deleteEmptyObjects bool)

func (*LoggingStateDb) GetArchiveBlockHeight

func (s *LoggingStateDb) GetArchiveBlockHeight() (uint64, bool, error)

func (*LoggingStateDb) GetArchiveState

func (s *LoggingStateDb) GetArchiveState(block uint64) (state.NonCommittableStateDB, error)

func (*LoggingStateDb) GetBalance

func (s *LoggingStateDb) GetBalance(addr common.Address) *uint256.Int

func (*LoggingStateDb) GetCode

func (s *LoggingStateDb) GetCode(addr common.Address) []byte

func (*LoggingStateDb) GetCodeHash

func (s *LoggingStateDb) GetCodeHash(addr common.Address) common.Hash

func (*LoggingStateDb) GetCodeSize

func (s *LoggingStateDb) GetCodeSize(addr common.Address) int

func (*LoggingStateDb) GetCommittedState

func (s *LoggingStateDb) GetCommittedState(addr common.Address, key common.Hash) common.Hash

func (*LoggingStateDb) GetHash

func (s *LoggingStateDb) GetHash() (common.Hash, error)

func (*LoggingStateDb) GetLogs

func (s *LoggingStateDb) GetLogs(hash common.Hash, block uint64, blockHash common.Hash, blkTimestamp uint64) []*types.Log

func (*LoggingStateDb) GetMemoryUsage

func (s *LoggingStateDb) GetMemoryUsage() *state.MemoryUsage

func (*LoggingStateDb) GetNonce

func (s *LoggingStateDb) GetNonce(addr common.Address) uint64

func (*LoggingStateDb) GetRefund

func (s *LoggingStateDb) GetRefund() uint64

func (*LoggingStateDb) GetShadowDB

func (s *LoggingStateDb) GetShadowDB() state.StateDB

func (*LoggingStateDb) GetState

func (s *LoggingStateDb) GetState(addr common.Address, key common.Hash) common.Hash

func (*LoggingStateDb) GetStateAndCommittedState

func (s *LoggingStateDb) GetStateAndCommittedState(addr common.Address, key common.Hash) (common.Hash, common.Hash)

func (*LoggingStateDb) GetStorageRoot

func (s *LoggingStateDb) GetStorageRoot(addr common.Address) common.Hash

func (*LoggingStateDb) GetSubstatePostAlloc

func (s *LoggingStateDb) GetSubstatePostAlloc() txcontext.WorldState

func (*LoggingStateDb) GetTransientState

func (s *LoggingStateDb) GetTransientState(addr common.Address, key common.Hash) common.Hash

func (*LoggingStateDb) HasSelfDestructed

func (s *LoggingStateDb) HasSelfDestructed(addr common.Address) bool

func (*LoggingStateDb) IntermediateRoot

func (s *LoggingStateDb) IntermediateRoot(deleteEmptyObjects bool) common.Hash

func (*LoggingStateDb) PointCache

func (s *LoggingStateDb) PointCache() *utils.PointCache

PointCache returns the point cache used in computations.

func (*LoggingStateDb) Prepare

func (s *LoggingStateDb) Prepare(rules params.Rules, sender, coinbase common.Address, dest *common.Address, precompiles []common.Address, txAccesses types.AccessList)

func (*LoggingStateDb) PrepareSubstate

func (s *LoggingStateDb) PrepareSubstate(substate txcontext.WorldState, block uint64)

func (*LoggingStateDb) RevertToSnapshot

func (s *LoggingStateDb) RevertToSnapshot(id int)

func (*LoggingStateDb) SelfDestruct

func (s *LoggingStateDb) SelfDestruct(addr common.Address) uint256.Int

func (*LoggingStateDb) SelfDestruct6780

func (s *LoggingStateDb) SelfDestruct6780(addr common.Address) (uint256.Int, bool)

func (*LoggingStateDb) SetCode

func (s *LoggingStateDb) SetCode(addr common.Address, code []byte, reason tracing.CodeChangeReason) []byte

func (*LoggingStateDb) SetNonce

func (s *LoggingStateDb) SetNonce(addr common.Address, value uint64, reason tracing.NonceChangeReason)

func (*LoggingStateDb) SetState

func (s *LoggingStateDb) SetState(addr common.Address, key common.Hash, value common.Hash) common.Hash

func (*LoggingStateDb) SetTransientState

func (s *LoggingStateDb) SetTransientState(addr common.Address, key common.Hash, value common.Hash)

func (*LoggingStateDb) SetTxContext

func (s *LoggingStateDb) SetTxContext(thash common.Hash, ti int)

func (*LoggingStateDb) SlotInAccessList

func (s *LoggingStateDb) SlotInAccessList(addr common.Address, slot common.Hash) (addressOk bool, slotOk bool)

func (*LoggingStateDb) Snapshot

func (s *LoggingStateDb) Snapshot() int

func (*LoggingStateDb) StartBulkLoad

func (s *LoggingStateDb) StartBulkLoad(block uint64) (state.BulkLoad, error)

func (*LoggingStateDb) SubBalance

func (s *LoggingStateDb) SubBalance(addr common.Address, value *uint256.Int, reason tracing.BalanceChangeReason) uint256.Int

func (*LoggingStateDb) SubRefund

func (s *LoggingStateDb) SubRefund(amount uint64)

func (*LoggingStateDb) Witness

func (s *LoggingStateDb) Witness() *stateless.Witness

Witness retrieves the current state witness.

type ProfilerProxy

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

ProfilerProxy data structure for capturing and recording invoked StateDB operations.

func NewProfilerProxy

func NewProfilerProxy(db state.StateDB, anlt *analytics.IncrementalAnalytics, logLevel string) *ProfilerProxy

NewProfilerProxy creates a new StateDB profiler.

func (*ProfilerProxy) AccessEvents

func (p *ProfilerProxy) AccessEvents() *geth.AccessEvents

func (*ProfilerProxy) AddAddressToAccessList

func (p *ProfilerProxy) AddAddressToAccessList(addr common.Address)

AddAddressToAccessList adds an address to the access list.

func (*ProfilerProxy) AddBalance

func (p *ProfilerProxy) AddBalance(addr common.Address, amount *uint256.Int, reason tracing.BalanceChangeReason) uint256.Int

AddBalance adds amount to a contract address.

func (*ProfilerProxy) AddLog

func (p *ProfilerProxy) AddLog(log *types.Log)

AddLog adds a log entry.

func (*ProfilerProxy) AddPreimage

func (p *ProfilerProxy) AddPreimage(addr common.Hash, image []byte)

AddPreimage adds a SHA3 preimage.

func (*ProfilerProxy) AddRefund

func (p *ProfilerProxy) AddRefund(gas uint64)

AddRefund adds gas to the refund counter.

func (*ProfilerProxy) AddSlotToAccessList

func (p *ProfilerProxy) AddSlotToAccessList(addr common.Address, slot common.Hash)

AddSlotToAccessList adds the given (address, slot)-tuple to the access list

func (*ProfilerProxy) AddressInAccessList

func (p *ProfilerProxy) AddressInAccessList(addr common.Address) bool

AddressInAccessList checks whether an address is in the access list.

func (*ProfilerProxy) BeginBlock

func (p *ProfilerProxy) BeginBlock(number uint64) error

func (*ProfilerProxy) BeginSyncPeriod

func (p *ProfilerProxy) BeginSyncPeriod(number uint64)

func (*ProfilerProxy) BeginTransaction

func (p *ProfilerProxy) BeginTransaction(number uint32) error

func (*ProfilerProxy) Close

func (p *ProfilerProxy) Close() error

func (*ProfilerProxy) Commit

func (p *ProfilerProxy) Commit(block uint64, deleteEmptyObjects bool) (common.Hash, error)

func (*ProfilerProxy) CreateAccount

func (p *ProfilerProxy) CreateAccount(addr common.Address)

CreateAccount creates a new account.

func (*ProfilerProxy) CreateContract

func (p *ProfilerProxy) CreateContract(addr common.Address)

func (*ProfilerProxy) Empty

func (p *ProfilerProxy) Empty(addr common.Address) bool

Empty checks whether the contract is either non-existent or empty according to the EIP161 specification (balance = nonce = code = 0).

func (*ProfilerProxy) EndBlock

func (p *ProfilerProxy) EndBlock() error

func (*ProfilerProxy) EndSyncPeriod

func (p *ProfilerProxy) EndSyncPeriod()

func (*ProfilerProxy) EndTransaction

func (p *ProfilerProxy) EndTransaction() error

func (*ProfilerProxy) Error

func (p *ProfilerProxy) Error() error

func (*ProfilerProxy) Exist

func (p *ProfilerProxy) Exist(addr common.Address) bool

Exist checks whether the contract exists in the StateDB. Notably this also returns true for suicided accounts.

func (*ProfilerProxy) Finalise

func (p *ProfilerProxy) Finalise(deleteEmptyObjects bool)

Finalise the state in StateDB.

func (*ProfilerProxy) GetArchiveBlockHeight

func (p *ProfilerProxy) GetArchiveBlockHeight() (uint64, bool, error)

func (*ProfilerProxy) GetArchiveState

func (p *ProfilerProxy) GetArchiveState(block uint64) (state.NonCommittableStateDB, error)

func (*ProfilerProxy) GetBalance

func (p *ProfilerProxy) GetBalance(addr common.Address) *uint256.Int

GetBalance retrieves the amount of a contract address.

func (*ProfilerProxy) GetCode

func (p *ProfilerProxy) GetCode(addr common.Address) []byte

GetCode returns the EVM bytecode of a contract.

func (*ProfilerProxy) GetCodeHash

func (p *ProfilerProxy) GetCodeHash(addr common.Address) common.Hash

GetCodeHash returns the hash of the EVM bytecode.

func (*ProfilerProxy) GetCodeSize

func (p *ProfilerProxy) GetCodeSize(addr common.Address) int

GetCodeSize returns the EVM bytecode's size.

func (*ProfilerProxy) GetCommittedState

func (p *ProfilerProxy) GetCommittedState(addr common.Address, key common.Hash) common.Hash

GetCommittedState retrieves a value that is already committed.

func (*ProfilerProxy) GetHash

func (p *ProfilerProxy) GetHash() (common.Hash, error)

func (*ProfilerProxy) GetLogs

func (p *ProfilerProxy) GetLogs(hash common.Hash, block uint64, blockHash common.Hash, blkTimestamp uint64) []*types.Log

GetLogs retrieves log entries.

func (*ProfilerProxy) GetMemoryUsage

func (p *ProfilerProxy) GetMemoryUsage() *state.MemoryUsage

func (*ProfilerProxy) GetNonce

func (p *ProfilerProxy) GetNonce(addr common.Address) uint64

GetNonce retrieves the nonce of a contract address.

func (*ProfilerProxy) GetRefund

func (p *ProfilerProxy) GetRefund() uint64

GetRefund returns the current value of the refund counter.

func (*ProfilerProxy) GetShadowDB

func (p *ProfilerProxy) GetShadowDB() state.StateDB

func (*ProfilerProxy) GetState

func (p *ProfilerProxy) GetState(addr common.Address, key common.Hash) common.Hash

GetState retrieves a value from the StateDB.

func (*ProfilerProxy) GetStateAndCommittedState

func (p *ProfilerProxy) GetStateAndCommittedState(addr common.Address, key common.Hash) (common.Hash, common.Hash)

func (*ProfilerProxy) GetStorageRoot

func (p *ProfilerProxy) GetStorageRoot(addr common.Address) common.Hash

func (*ProfilerProxy) GetSubstatePostAlloc

func (p *ProfilerProxy) GetSubstatePostAlloc() txcontext.WorldState

GetSubstatePostAlloc gets substate post allocation.

func (*ProfilerProxy) GetTransientState

func (p *ProfilerProxy) GetTransientState(addr common.Address, key common.Hash) common.Hash

func (*ProfilerProxy) HasSelfDestructed

func (p *ProfilerProxy) HasSelfDestructed(addr common.Address) bool

HasSelfDestructed checks whether a contract has been suicided.

func (*ProfilerProxy) IntermediateRoot

func (p *ProfilerProxy) IntermediateRoot(deleteEmptyObjects bool) common.Hash

IntermediateRoot computes the current hash of the StateDB. It is called in between transactions to get the root hash that goes into transaction receipts.

func (*ProfilerProxy) PointCache

func (p *ProfilerProxy) PointCache() *utils.PointCache

PointCache returns the point cache used in computations.

func (*ProfilerProxy) Prepare

func (p *ProfilerProxy) Prepare(rules params.Rules, sender, coinbase common.Address, dest *common.Address, precompiles []common.Address, txAccesses types.AccessList)

Prepare handles the preparatory steps for executing a state transition with regards to both EIP-2929 and EIP-2930:

- Add sender to access list (2929) - Add destination to access list (2929) - Add precompiles to access list (2929) - Add the contents of the optional tx access list (2930)

This method should only be called if Berlin/2929+2930 is applicable at the current number.

func (*ProfilerProxy) PrepareSubstate

func (p *ProfilerProxy) PrepareSubstate(substate txcontext.WorldState, block uint64)

func (*ProfilerProxy) RevertToSnapshot

func (p *ProfilerProxy) RevertToSnapshot(snapshot int)

RevertToSnapshot reverts all state changes from a given revision.

func (*ProfilerProxy) SelfDestruct

func (p *ProfilerProxy) SelfDestruct(addr common.Address) uint256.Int

SelfDestruct marks the given account as self destructed. This clears the account balance. The account is still available until the state is committed; return a non-nil account after SelfDestruct.

func (*ProfilerProxy) SelfDestruct6780

func (p *ProfilerProxy) SelfDestruct6780(addr common.Address) (uint256.Int, bool)

func (*ProfilerProxy) SetCode

func (p *ProfilerProxy) SetCode(addr common.Address, code []byte, reason tracing.CodeChangeReason) []byte

SetCode sets the EVM bytecode of a contract.

func (*ProfilerProxy) SetNonce

func (p *ProfilerProxy) SetNonce(addr common.Address, nonce uint64, reason tracing.NonceChangeReason)

SetNonce sets the nonce of a contract address.

func (*ProfilerProxy) SetState

func (p *ProfilerProxy) SetState(addr common.Address, key common.Hash, value common.Hash) common.Hash

SetState sets a value in the StateDB.

func (*ProfilerProxy) SetTransientState

func (p *ProfilerProxy) SetTransientState(addr common.Address, key common.Hash, value common.Hash)

func (*ProfilerProxy) SetTxContext

func (p *ProfilerProxy) SetTxContext(thash common.Hash, ti int)

Prepare sets the current transaction hash and index.

func (*ProfilerProxy) SlotInAccessList

func (p *ProfilerProxy) SlotInAccessList(addr common.Address, slot common.Hash) (bool, bool)

SlotInAccessList checks whether the (address, slot)-tuple is in the access list.

func (*ProfilerProxy) Snapshot

func (p *ProfilerProxy) Snapshot() int

Snapshot returns an identifier for the current revision of the state.

func (*ProfilerProxy) StartBulkLoad

func (p *ProfilerProxy) StartBulkLoad(block uint64) (state.BulkLoad, error)

func (*ProfilerProxy) SubBalance

func (p *ProfilerProxy) SubBalance(addr common.Address, amount *uint256.Int, reason tracing.BalanceChangeReason) uint256.Int

SubBalance subtracts amount from a contract address.

func (*ProfilerProxy) SubRefund

func (p *ProfilerProxy) SubRefund(gas uint64)

SubRefund subtracts gas to the refund counter.

func (*ProfilerProxy) Witness

func (p *ProfilerProxy) Witness() *stateless.Witness

Witness retrieves the current state witness.

Jump to

Keyboard shortcuts

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