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.