fork

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2021 License: Apache-2.0, MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrExpensiveFork = errors.New("refusing explicit call due to state fork at epoch")

Functions

func ActorStore

func ActorStore(ctx context.Context, bs blockstore.Blockstore) adt.Store

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(cr chainReader, ipldstore cbor.IpldStore, bs blockstore.Blockstore, forkUpgrade *config.ForkUpgradeConfig) (*ChainFork, error)

func (*ChainFork) GetForkUpgrade

func (c *ChainFork) GetForkUpgrade() *config.ForkUpgradeConfig

func (*ChainFork) GetNtwkVersion

func (c *ChainFork) GetNtwkVersion(ctx context.Context, height abi.ChainEpoch) network.Version

func (*ChainFork) HandleStateForks

func (c *ChainFork) HandleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, ts *block.TipSet) (cid.Cid, error)

func (*ChainFork) HasExpensiveFork

func (c *ChainFork) HasExpensiveFork(ctx context.Context, height abi.ChainEpoch) bool

func (*ChainFork) ParentState

func (c *ChainFork) ParentState(ts *block.TipSet) cid.Cid

func (*ChainFork) StateTree

func (c *ChainFork) StateTree(ctx context.Context, st cid.Cid) (*vmstate.State, error)

func (*ChainFork) UpgradeActorsV2

func (c *ChainFork) UpgradeActorsV2(ctx context.Context, root cid.Cid, epoch abi.ChainEpoch, ts *block.TipSet) (cid.Cid, error)

func (*ChainFork) UpgradeCalico

func (c *ChainFork) UpgradeCalico(ctx context.Context, root cid.Cid, epoch abi.ChainEpoch, ts *block.TipSet) (cid.Cid, error)

func (*ChainFork) UpgradeFaucetBurnRecovery

func (c *ChainFork) UpgradeFaucetBurnRecovery(ctx context.Context, root cid.Cid, epoch abi.ChainEpoch, ts *block.TipSet) (cid.Cid, error)

func (*ChainFork) UpgradeIgnition

func (c *ChainFork) UpgradeIgnition(ctx context.Context, root cid.Cid, epoch abi.ChainEpoch, ts *block.TipSet) (cid.Cid, error)

func (*ChainFork) UpgradeLiftoff

func (c *ChainFork) UpgradeLiftoff(ctx context.Context, root cid.Cid, epoch abi.ChainEpoch, ts *block.TipSet) (cid.Cid, error)

func (*ChainFork) UpgradeRefuel

func (c *ChainFork) UpgradeRefuel(ctx context.Context, root cid.Cid, epoch abi.ChainEpoch, ts *block.TipSet) (cid.Cid, error)

type IFork

type IFork interface {
	HandleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, ts *block.TipSet) (cid.Cid, error)
	GetNtwkVersion(ctx context.Context, height abi.ChainEpoch) network.Version
	HasExpensiveFork(ctx context.Context, height abi.ChainEpoch) bool
	GetForkUpgrade() *config.ForkUpgradeConfig
}

type MockFork

type MockFork struct{}

func NewMockFork

func NewMockFork() *MockFork

func (*MockFork) GetForkUpgrade

func (mockFork *MockFork) GetForkUpgrade() *config.ForkUpgradeConfig

func (*MockFork) GetNtwkVersion

func (mockFork *MockFork) GetNtwkVersion(ctx context.Context, height abi.ChainEpoch) network.Version

func (*MockFork) HandleStateForks

func (mockFork *MockFork) HandleStateForks(ctx context.Context, root cid.Cid, height abi.ChainEpoch, ts *block.TipSet) (cid.Cid, error)

func (*MockFork) HasExpensiveFork

func (mockFork *MockFork) HasExpensiveFork(ctx context.Context, height abi.ChainEpoch) bool

type Upgrade

type Upgrade struct {
	Height    abi.ChainEpoch
	Network   network.Version
	Expensive bool
	Migration UpgradeFunc
}

type UpgradeFunc

type UpgradeFunc func(ctx context.Context, oldState cid.Cid, height abi.ChainEpoch, ts *block.TipSet) (newState cid.Cid, err error)

UpgradeFunc is a migration function run at every upgrade.

  • 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 UpgradeSchedule

type UpgradeSchedule []Upgrade

func (UpgradeSchedule) Validate

func (us UpgradeSchedule) Validate() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL