state

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: GPL-3.0, LGPL-3.0 Imports: 8 Imported by: 11

Documentation

Overview

Package state provides a caching layer atop the Ethereum state trie.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDatabase

func NewDatabase(db ethdb.Database) ethstate.Database

func NewDatabaseWithConfig

func NewDatabaseWithConfig(db ethdb.Database, config *triedb.Config) ethstate.Database

func NewDatabaseWithNodeDB

func NewDatabaseWithNodeDB(db ethdb.Database, tdb *triedb.Database) ethstate.Database

Types

type Database

type Database = ethstate.Database

type Dump

type Dump = ethstate.Dump

type DumpAccount

type DumpAccount = ethstate.DumpAccount

type DumpCollector

type DumpCollector = ethstate.DumpCollector

type DumpConfig

type DumpConfig = ethstate.DumpConfig

type StateDB

type StateDB struct {
	*ethstate.StateDB
	// contains filtered or unexported fields
}

StateDB wraps go-ethereum's StateDB with minimal extensions

func New

func New(root common.Hash, db Database, snaps *snapshot.Tree) (*StateDB, error)

New creates a new state from a given trie.

func (*StateDB) AddBalanceMultiCoin added in v0.8.1

func (s *StateDB) AddBalanceMultiCoin(addr common.Address, coinID common.Hash, amount *big.Int)

AddBalanceMultiCoin adds amount to the multi-coin balance for addr and coinID

func (*StateDB) AddLog added in v0.8.1

func (s *StateDB) AddLog(addr common.Address, topics []common.Hash, data []byte, blockNumber uint64)

AddLog adds a log entry - wrapper to match vm.StateDB interface

func (*StateDB) Copy

func (s *StateDB) Copy() *StateDB

Copy creates a deep, independent copy of the state. It overrides the embedded StateDB's Copy to ensure our wrapper type is returned.

func (*StateDB) GetBalanceMultiCoin added in v0.8.1

func (s *StateDB) GetBalanceMultiCoin(addr common.Address, coinID common.Hash) *big.Int

GetBalanceMultiCoin returns the multi-coin balance for addr and coinID

func (*StateDB) GetCommittedStateAP1 added in v0.8.1

func (s *StateDB) GetCommittedStateAP1(addr common.Address, hash common.Hash) common.Hash

GetCommittedStateAP1 retrieves a value from the committed storage for AP1

func (*StateDB) GetLogData added in v0.8.1

func (s *StateDB) GetLogData() (topics [][]common.Hash, data [][]byte)

GetLogData returns the log topics and data

func (*StateDB) GetPredicateStorageSlots added in v0.8.1

func (s *StateDB) GetPredicateStorageSlots(address common.Address, index int) ([]byte, bool)

GetPredicateStorageSlots returns predicate storage slots

func (*StateDB) GetTxHash

func (s *StateDB) GetTxHash() common.Hash

GetTxHash returns the current transaction hash

func (*StateDB) Logs added in v0.8.1

func (s *StateDB) Logs() []*evmtypes.Log

func (*StateDB) SelfDestruct added in v0.8.1

func (s *StateDB) SelfDestruct(addr common.Address)

SelfDestruct marks the account for deletion - wrapper to match vm.StateDB interface

func (*StateDB) Selfdestruct6780 added in v0.8.1

func (s *StateDB) Selfdestruct6780(addr common.Address)

Selfdestruct6780 marks the account for deletion per EIP-6780 - wrapper to match vm.StateDB interface

func (*StateDB) SetCode added in v0.8.1

func (s *StateDB) SetCode(addr common.Address, code []byte)

SetCode sets the code for an account - wrapper to match vm.StateDB interface

func (*StateDB) SetPredicateStorageSlots added in v0.8.1

func (s *StateDB) SetPredicateStorageSlots(address common.Address, predicates [][]byte)

SetPredicateStorageSlots sets predicate storage slots

func (*StateDB) SetState

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

SetState sets the storage state - wrapper to match vm.StateDB interface

func (*StateDB) SetTxContext

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

SetTxContext sets the current transaction hash and index

func (*StateDB) SubBalanceMultiCoin added in v0.8.1

func (s *StateDB) SubBalanceMultiCoin(addr common.Address, coinID common.Hash, amount *big.Int)

SubBalanceMultiCoin subtracts amount from the multi-coin balance for addr and coinID

type Trie

type Trie = ethstate.Trie

Directories

Path Synopsis
Package snapshot implements a journalled, dynamic state dump.
Package snapshot implements a journalled, dynamic state dump.

Jump to

Keyboard shortcuts

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