Documentation
¶
Index ¶
- Variables
- func Copy(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid) error
- func LiteMigration(ctx context.Context, bstore blockstoreutil.Blockstore, ...) (cid.Cid, error)
- type ChainFork
- func (c *ChainFork) GetForkUpgrade() *config.ForkUpgradeConfig
- func (c *ChainFork) GetNetworkVersion(ctx context.Context, height abi.ChainEpoch) network.Version
- func (c *ChainFork) HandleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
- func (c *ChainFork) HasExpensiveFork(ctx context.Context, height abi.ChainEpoch) bool
- func (c *ChainFork) HasExpensiveForkBetween(parent, height abi.ChainEpoch) bool
- func (c *ChainFork) ParentState(ts *types.TipSet) cid.Cid
- func (c *ChainFork) PreUpgradeActorsV10(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV11(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV12(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV13(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV14(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV15(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV16(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV17(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV3(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV4(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV5(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV6(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV7(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV8(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) PreUpgradeActorsV9(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) error
- func (c *ChainFork) Start(ctx context.Context) error
- func (c *ChainFork) StateTree(ctx context.Context, st cid.Cid) (*vmstate.State, error)
- func (c *ChainFork) UpgradeActorsV10(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV11(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV12(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV13(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV14(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV15(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV16(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV16Fix(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV17(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV2(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV3(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV4(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV5(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV6(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV7(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV8(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeActorsV9(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeCalico(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeFaucetBurnRecovery(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeIgnition(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeLiftoff(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- func (c *ChainFork) UpgradeRefuel(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ...) (cid.Cid, error)
- type IFork
- type Migration
- type MigrationCache
- type MigrationFunc
- type MockFork
- func (mockFork *MockFork) GetForkUpgrade() *config.ForkUpgradeConfig
- func (mockFork *MockFork) GetNetworkVersion(ctx context.Context, height abi.ChainEpoch) network.Version
- func (mockFork *MockFork) HandleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
- func (mockFork *MockFork) HasExpensiveFork(ctx context.Context, height abi.ChainEpoch) bool
- func (mockFork *MockFork) HasExpensiveForkBetween(parent, height abi.ChainEpoch) bool
- func (mockFork *MockFork) Start(ctx context.Context) error
- type PreMigration
- type PreMigrationFunc
- type Upgrade
- type UpgradeSchedule
Constants ¶
This section is empty.
Variables ¶
var ( MigrationMaxWorkerCount int EnvMigrationMaxWorkerCount = "VENUS_MIGRATION_MAX_WORKER_COUNT" )
var ErrExpensiveFork = errors.New("refusing explicit call due to state fork at epoch")
Functions ¶
func Copy ¶
func Copy(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid) error
func LiteMigration ¶ added in v1.6.0
func LiteMigration(ctx context.Context, bstore blockstoreutil.Blockstore, newActorsManifestCid cid.Cid, root cid.Cid, oldAv actorstypes.Version, newAv actorstypes.Version, oldStateTreeVersion vmstate.StateTreeVersion, newStateTreeVersion vmstate.StateTreeVersion) (cid.Cid, error)
Types ¶
type ChainFork ¶
type ChainFork struct {
// contains filtered or unexported fields
}
func NewChainFork ¶
func NewChainFork(ctx context.Context, cr chainReader, ipldstore cbor.IpldStore, bs blockstoreutil.Blockstore, networkParams *config.NetworkParamsConfig, metadataDs dstore.Batching, ) (*ChainFork, error)
func (*ChainFork) GetForkUpgrade ¶
func (c *ChainFork) GetForkUpgrade() *config.ForkUpgradeConfig
func (*ChainFork) GetNetworkVersion ¶ added in v1.2.0
func (*ChainFork) HandleStateForks ¶
func (*ChainFork) HasExpensiveFork ¶
func (*ChainFork) HasExpensiveForkBetween ¶ added in v1.6.0
func (c *ChainFork) HasExpensiveForkBetween(parent, height abi.ChainEpoch) bool
Returns true executing tipsets between the specified heights would trigger an expensive migration. NOTE: migrations occurring _at_ the target height are not included, as they're executed _after_ the target height.
func (*ChainFork) ParentState ¶
func (*ChainFork) PreUpgradeActorsV10 ¶ added in v1.10.0
func (c *ChainFork) PreUpgradeActorsV10(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) error
func (*ChainFork) PreUpgradeActorsV11 ¶ added in v1.11.0
func (c *ChainFork) PreUpgradeActorsV11(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV12 ¶ added in v1.14.0
func (c *ChainFork) PreUpgradeActorsV12(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) error
func (*ChainFork) PreUpgradeActorsV13 ¶ added in v1.15.0
func (c *ChainFork) PreUpgradeActorsV13(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) error
func (*ChainFork) PreUpgradeActorsV14 ¶ added in v1.16.0
func (c *ChainFork) PreUpgradeActorsV14(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV15 ¶ added in v1.17.0
func (c *ChainFork) PreUpgradeActorsV15(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV16 ¶ added in v1.18.0
func (c *ChainFork) PreUpgradeActorsV16(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV17 ¶ added in v1.19.0
func (c *ChainFork) PreUpgradeActorsV17(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) error
func (*ChainFork) PreUpgradeActorsV3 ¶ added in v0.9.1
func (c *ChainFork) PreUpgradeActorsV3(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV4 ¶ added in v0.9.5
func (c *ChainFork) PreUpgradeActorsV4(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV5 ¶ added in v0.9.7
func (c *ChainFork) PreUpgradeActorsV5(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV6 ¶ added in v1.1.0
func (c *ChainFork) PreUpgradeActorsV6(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV7 ¶ added in v1.2.0
func (c *ChainFork) PreUpgradeActorsV7(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV8 ¶ added in v1.6.0
func (c *ChainFork) PreUpgradeActorsV8(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) error
func (*ChainFork) PreUpgradeActorsV9 ¶ added in v1.8.0
func (c *ChainFork) PreUpgradeActorsV9(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) error
func (*ChainFork) UpgradeActorsV10 ¶ added in v1.10.0
func (c *ChainFork) UpgradeActorsV10(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV11 ¶ added in v1.11.0
func (c *ChainFork) UpgradeActorsV11(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV12 ¶ added in v1.14.0
func (c *ChainFork) UpgradeActorsV12(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV13 ¶ added in v1.15.0
func (c *ChainFork) UpgradeActorsV13(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV14 ¶ added in v1.16.0
func (c *ChainFork) UpgradeActorsV14(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV15 ¶ added in v1.17.0
func (c *ChainFork) UpgradeActorsV15(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV16 ¶ added in v1.18.0
func (c *ChainFork) UpgradeActorsV16(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV16Fix ¶ added in v1.18.1
func (c *ChainFork) UpgradeActorsV16Fix( ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet, ) (cid.Cid, error)
UpgradeActorsV16Fix should _not_ be used on mainnet. It performs an upgrade to v16.0.1 on top of the existing v16.0.0 that was already deployed. The actual mainnet upgrade is performed with UpgradeActorsV16 with the v16.0.1 bundle. This upgrade performs an inefficient form of the migration that go-state-types normally performs.
func (*ChainFork) UpgradeActorsV17 ¶ added in v1.19.0
func (c *ChainFork) UpgradeActorsV17(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV2 ¶
func (c *ChainFork) UpgradeActorsV2(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV3 ¶ added in v0.9.1
func (c *ChainFork) UpgradeActorsV3(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV4 ¶ added in v0.9.5
func (c *ChainFork) UpgradeActorsV4(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV5 ¶ added in v0.9.7
func (c *ChainFork) UpgradeActorsV5(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV6 ¶ added in v1.1.0
func (c *ChainFork) UpgradeActorsV6(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV7 ¶ added in v1.2.0
func (c *ChainFork) UpgradeActorsV7(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV8 ¶ added in v1.6.0
func (c *ChainFork) UpgradeActorsV8(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeActorsV9 ¶ added in v1.8.0
func (c *ChainFork) UpgradeActorsV9(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeCalico ¶
func (c *ChainFork) UpgradeCalico(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeFaucetBurnRecovery ¶
func (c *ChainFork) UpgradeFaucetBurnRecovery(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeIgnition ¶
func (c *ChainFork) UpgradeIgnition(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeLiftoff ¶
func (c *ChainFork) UpgradeLiftoff(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
func (*ChainFork) UpgradeRefuel ¶
func (c *ChainFork) UpgradeRefuel(ctx context.Context, cache MigrationCache, root cid.Cid, epoch abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
type IFork ¶
type IFork interface {
HandleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
GetNetworkVersion(ctx context.Context, height abi.ChainEpoch) network.Version
HasExpensiveFork(ctx context.Context, height abi.ChainEpoch) bool
HasExpensiveForkBetween(parent, height abi.ChainEpoch) bool
GetForkUpgrade() *config.ForkUpgradeConfig
Start(ctx context.Context) error
}
type Migration ¶ added in v1.10.0
type Migration struct {
// contains filtered or unexported fields
}
type MigrationCache ¶ added in v0.9.1
type MigrationCache interface {
Write(key string, value cid.Cid) error
Read(key string) (bool, cid.Cid, error)
Load(key string, loadFunc func() (cid.Cid, error)) (cid.Cid, error)
}
MigrationCache can be used to cache information used by a migration. This is primarily useful to "pre-compute" some migration state ahead of time, and make it accessible in the migration itself.
type MigrationFunc ¶ added in v0.9.1
type MigrationFunc func( ctx context.Context, cache MigrationCache, oldState cid.Cid, height abi.ChainEpoch, ts *types.TipSet, ) (newState cid.Cid, err error)
MigrationFunc is a migration function run at every upgrade.
- The cache is a per-upgrade cache, pre-populated by pre-migrations.
- The oldState is the state produced by the upgrade epoch.
- The returned newState is the new state that will be used by the next epoch.
- The height is the upgrade epoch height (already executed).
- The tipset is the tipset for the last non-null block before the upgrade. Do not assume that ts.Height() is the upgrade height.
type MockFork ¶
type MockFork struct{}
func (*MockFork) GetForkUpgrade ¶
func (mockFork *MockFork) GetForkUpgrade() *config.ForkUpgradeConfig
func (*MockFork) GetNetworkVersion ¶ added in v1.2.0
func (*MockFork) HandleStateForks ¶
func (*MockFork) HasExpensiveFork ¶
func (*MockFork) HasExpensiveForkBetween ¶ added in v1.6.0
func (mockFork *MockFork) HasExpensiveForkBetween(parent, height abi.ChainEpoch) bool
type PreMigration ¶ added in v0.9.1
type PreMigration struct {
// PreMigration is the pre-migration function to run at the specified time. This function is
// run asynchronously and must abort promptly when canceled.
PreMigration PreMigrationFunc
// StartWithin specifies that this pre-migration should be started at most StartWithin
// epochs before the upgrade.
StartWithin abi.ChainEpoch
// DontStartWithin specifies that this pre-migration should not be started DontStartWithin
// epochs before the final upgrade epoch.
//
// This should be set such that the pre-migration is likely to complete before StopWithin.
DontStartWithin abi.ChainEpoch
// StopWithin specifies that this pre-migration should be stopped StopWithin epochs of the
// final upgrade epoch.
StopWithin abi.ChainEpoch
}
PreMigration describes a pre-migration step to prepare for a network state upgrade. Pre-migrations are optimizations, are not guaranteed to run, and may be canceled and/or run multiple times.
type PreMigrationFunc ¶ added in v0.9.1
type PreMigrationFunc func( ctx context.Context, cache MigrationCache, oldState cid.Cid, height abi.ChainEpoch, ts *types.TipSet, ) error
PreMigrationFunc is a function run _before_ a network upgrade to pre-compute part of the network upgrade and speed it up.
type Upgrade ¶
type Upgrade struct {
Height abi.ChainEpoch
Network network.Version
Expensive bool
Migration MigrationFunc
// PreMigrations specifies a set of pre-migration functions to run at the indicated epochs.
// These functions should fill the given cache with information that can speed up the
// eventual full migration at the upgrade epoch.
PreMigrations []PreMigration
}
type UpgradeSchedule ¶
type UpgradeSchedule []Upgrade
func DefaultUpgradeSchedule ¶ added in v1.2.0
func DefaultUpgradeSchedule(cf *ChainFork, upgradeHeight *config.ForkUpgradeConfig) UpgradeSchedule
func (UpgradeSchedule) Validate ¶
func (us UpgradeSchedule) Validate() error