state

package
v2.0.0-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: GPL-3.0, LGPL-3.0 Imports: 8 Imported by: 0

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

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

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

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

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

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

GetLogData returns the log topics and data

func (*StateDB) GetPredicateStorageSlots

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

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

func (*StateDB) SelfDestruct

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

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

func (*StateDB) Selfdestruct6780

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

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

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

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