Documentation
¶
Overview ¶
Package statedifflength backfills BlockCommitments.StateDiffLength for blocks stored before that field existed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
Migrator reads each block's state update, computes StateDiff.Length(), and rewrites the block's commitments with it. Pre-existing blocks stored 0 for the missing field, which this replaces with the real value.
Work is fanned out across reader goroutines that each fill their own write batch; a single committer drains them to disk. On a graceful shutdown the committed blocks form a contiguous range — the source emits in order and the pipeline drains everything it emitted — so the migration checkpoints the next block to resume from. After an error or crash it restarts from the oldest retained block, which is safe because re-deriving a length is idempotent.