2019-12-19 18:46:30 +00:00
|
|
|
package stmgr
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"github.com/ipfs/go-cid"
|
2019-12-19 20:00:59 +00:00
|
|
|
"golang.org/x/xerrors"
|
2019-12-19 18:46:30 +00:00
|
|
|
|
|
|
|
"github.com/filecoin-project/lotus/build"
|
|
|
|
)
|
|
|
|
|
2019-12-19 20:00:59 +00:00
|
|
|
func (sm *StateManager) handleStateForks(ctx context.Context, pstate cid.Cid, height, parentH uint64) (_ cid.Cid, err error) {
|
|
|
|
for i := parentH; i < height; i++ {
|
|
|
|
switch i {
|
|
|
|
case build.ForkNoPowerEPSUpdates:
|
|
|
|
pstate, err = sm.forkNoPowerEPS(ctx, pstate)
|
|
|
|
if err != nil {
|
|
|
|
return cid.Undef, xerrors.Errorf("executing state fork in epoch %d: %w", i, err)
|
|
|
|
}
|
2019-12-20 07:29:56 +00:00
|
|
|
|
|
|
|
log.Infof("forkNoPowerEPS state: %s", pstate)
|
2019-12-19 20:00:59 +00:00
|
|
|
}
|
2019-12-19 18:46:30 +00:00
|
|
|
}
|
2019-12-19 20:00:59 +00:00
|
|
|
|
|
|
|
return pstate, nil
|
2019-12-19 18:46:30 +00:00
|
|
|
}
|