Documentation ¶
Index ¶
- func ActorHeadKey(addr address.Address, head cid.Cid) string
- func MigrateStateTree(ctx context.Context, store cbor.IpldStore, actorsManifest cid.Cid, ...) (cid.Cid, error)
- func UpdatePendingProposals(ctx context.Context, store adt.Store, changedProposalCIDs map[int64]cidSwap, ...) (cid.Cid, error)
- func UpdateProposals(ctx context.Context, store adt.Store, proposalsRoot cid.Cid, ...) (cid.Cid, map[int64]cidSwap, error)
- type Config
- type Logger
- type MemMigrationCache
- func (m *MemMigrationCache) Clone() *MemMigrationCache
- func (m *MemMigrationCache) Load(key string, loadFunc func() (cid.Cid, error)) (cid.Cid, error)
- func (m *MemMigrationCache) Read(key string) (bool, cid.Cid, error)
- func (m *MemMigrationCache) Update(other *MemMigrationCache)
- func (m *MemMigrationCache) Write(key string, c cid.Cid) error
- type MigrationCache
- type StringKey
- type TestLogger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ActorHeadKey ¶
func ActorHeadKey(addr address.Address, head cid.Cid) string
func MigrateStateTree ¶
func MigrateStateTree(ctx context.Context, store cbor.IpldStore, actorsManifest cid.Cid, actorsRootIn cid.Cid, priorEpoch abi.ChainEpoch, cfg Config, log Logger, cache MigrationCache) (cid.Cid, error)
Migrates the filecoin state tree starting from the global state tree and upgrading all actor state. The store must support concurrent writes (even if the configured worker count is 1).
func UpdatePendingProposals ¶
func UpdatePendingProposals(ctx context.Context, store adt.Store, changedProposalCIDs map[int64]cidSwap, pendingProposalsRoot cid.Cid) (cid.Cid, error)
This rebuilds pendingproposals after all the CIDs have changed when the labels are of a different type in dealProposal. A proposal in Proposals is pending if its dealID is not a member of States, or if the LastUpdatedEpoch field is market.EpochUndefined.
func UpdateProposals ¶
func UpdateProposals(ctx context.Context, store adt.Store, proposalsRoot cid.Cid, statesRoot cid.Cid) (cid.Cid, map[int64]cidSwap, error)
MapProposals converts proposals with invalid i.e. non-utf8 string label serializations into proposals with byte label serializations. For those proposals with
(1) a serialization that changed (2) a cid in pending proposals map
it returns a map from deal id to (old cid, new cid)
Types ¶
type Config ¶
type Config struct { // Number of migration worker goroutines to run. // More workers enables higher CPU utilization doing migration computations (including state encoding) MaxWorkers uint // Capacity of the queue of jobs available to workers (zero for unbuffered). // A queue length of hundreds to thousands improves throughput at the cost of memory. JobQueueSize uint // Capacity of the queue receiving migration results from workers, for persisting (zero for unbuffered). // A queue length of tens to hundreds improves throughput at the cost of memory. ResultQueueSize uint // Time between progress logs to emit. // Zero (the default) results in no progress logs. ProgressLogPeriod time.Duration }
Config parameterizes a state tree migration
type MemMigrationCache ¶
func NewMemMigrationCache ¶
func NewMemMigrationCache() *MemMigrationCache
func (*MemMigrationCache) Clone ¶
func (m *MemMigrationCache) Clone() *MemMigrationCache
func (*MemMigrationCache) Load ¶
func (m *MemMigrationCache) Load(key string, loadFunc func() (cid.Cid, error)) (cid.Cid, error)
func (*MemMigrationCache) Read ¶
func (m *MemMigrationCache) Read(key string) (bool, cid.Cid, error)
func (*MemMigrationCache) Update ¶
func (m *MemMigrationCache) Update(other *MemMigrationCache)
func (*MemMigrationCache) Write ¶
func (m *MemMigrationCache) Write(key string, c cid.Cid) error
type MigrationCache ¶
type MigrationCache interface { Write(key string, newCid cid.Cid) error Read(key string) (bool, cid.Cid, error) Load(key string, loadFunc func() (cid.Cid, error)) (cid.Cid, error) }
Migrates from v15 to v16
This migration only updates the actor code CIDs in the state tree. MigrationCache stores and loads cached data. Its implementation must be threadsafe