Documentation
¶
Index ¶
- Variables
- func Copy(ctx context.Context, from, to blockstore.Blockstore, root cid.Cid) error
- type ChainFork
- func (c *ChainFork) GetForkUpgrade() *config.ForkUpgradeConfig
- func (c *ChainFork) GetNtwkVersion(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) ParentState(ts *types.TipSet) cid.Cid
- 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) Start(ctx context.Context) error
- func (c *ChainFork) StateTree(ctx context.Context, st cid.Cid) (*vmstate.State, 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) 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 MigrationCache
- type MigrationFunc
- type MockFork
- func (mockFork *MockFork) GetForkUpgrade() *config.ForkUpgradeConfig
- func (mockFork *MockFork) GetNtwkVersion(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) Start(ctx context.Context) error
- type PreMigration
- type PreMigrationFunc
- type Upgrade
- type UpgradeSchedule
Constants ¶
This section is empty.
Variables ¶
View Source
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
Types ¶
type ChainFork ¶
type ChainFork struct {
// contains filtered or unexported fields
}
func NewChainFork ¶
func NewChainFork(ctx context.Context, cr chainReader, ipldstore cbor.IpldStore, bs blockstore.Blockstore, networkParams *config.NetworkParamsConfig) (*ChainFork, error)
func (*ChainFork) GetForkUpgrade ¶
func (c *ChainFork) GetForkUpgrade() *config.ForkUpgradeConfig
func (*ChainFork) GetNtwkVersion ¶
func (*ChainFork) HandleStateForks ¶
func (*ChainFork) HasExpensiveFork ¶
func (*ChainFork) PreUpgradeActorsV3 ¶ added in v0.9.1
func (*ChainFork) PreUpgradeActorsV4 ¶ added in v0.9.5
func (*ChainFork) PreUpgradeActorsV5 ¶ added in v0.9.7
func (*ChainFork) UpgradeActorsV2 ¶
func (*ChainFork) UpgradeActorsV3 ¶ added in v0.9.1
func (*ChainFork) UpgradeActorsV4 ¶ added in v0.9.5
func (*ChainFork) UpgradeActorsV5 ¶ added in v0.9.7
func (*ChainFork) UpgradeCalico ¶
func (*ChainFork) UpgradeFaucetBurnRecovery ¶
func (*ChainFork) UpgradeIgnition ¶
func (*ChainFork) UpgradeLiftoff ¶
func (*ChainFork) UpgradeRefuel ¶
type IFork ¶
type IFork interface {
HandleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, ts *types.TipSet) (cid.Cid, error)
GetNtwkVersion(ctx context.Context, height abi.ChainEpoch) network.Version
HasExpensiveFork(ctx context.Context, height abi.ChainEpoch) bool
GetForkUpgrade() *config.ForkUpgradeConfig
Start(ctx context.Context) error
}
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) GetNtwkVersion ¶
func (*MockFork) HandleStateForks ¶
func (*MockFork) HasExpensiveFork ¶
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 (UpgradeSchedule) Validate ¶
func (us UpgradeSchedule) Validate() error
Click to show internal directories.
Click to hide internal directories.