headstate

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2026 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migrator

type Migrator struct{}

Migrator consolidates the deprecated per-field contract layout into a single Contract record per address, written via state.WriteContract:

ContractClassHash[addr]
ContractNonce[addr]
ContractDeploymentHeight[addr]
          │
          ▼
Contract[addr] = { ClassHash, Nonce, DeployedHeight }

StorageRoot is left zero — the running node lazily backfills it on the contract's first storage write.

Each address discovered in the ContractClassHash bucket is processed by one of ingestorCount worker goroutines that read the three old fields into a shared db.Batch; a single committer drains batches to disk. Once every address has been migrated, the three deprecated buckets are wiped via DeleteRange.

Re-run safe: an address whose Contract record already exists is skipped (via state.HasContract), and the trailing wipe re-issues DeleteRange over the (possibly already empty) ranges.

func (Migrator) Before

func (Migrator) Before([]byte) error

func (Migrator) Migrate

func (Migrator) Migrate(
	ctx context.Context,
	database db.KeyValueStore,
	_ *networks.Network,
	logger log.StructuredLogger,
) ([]byte, error)

Jump to

Keyboard shortcuts

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