diff --git a/chain/gen/genesis/miners.go b/chain/gen/genesis/miners.go index 0fb2f5741..d8cc1484c 100644 --- a/chain/gen/genesis/miners.go +++ b/chain/gen/genesis/miners.go @@ -143,7 +143,7 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid return cid.Undef, err } params := &power.EnrollCronEventParams{ - EventEpoch: miner.ProvingPeriod, + EventEpoch: miner.ProvingPeriod + power.WindowedPostChallengeDuration, Payload: payload, } @@ -208,9 +208,11 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid DealIDs: []abi.DealID{dealIDs[pi]}, Expiration: preseal.Deal.EndEpoch, }, - ActivationEpoch: 0, - DealWeight: dealWeight, - PledgeRequirement: pledge, + ActivationEpoch: 0, + DealWeight: dealWeight, + PledgeRequirement: pledge, + DeclaredFaultEpoch: -1, + DeclaredFaultDuration: -1, } err = vm.MutateState(ctx, maddr, func(cst cbor.IpldStore, st *miner.State) error { diff --git a/chain/stmgr/stmgr.go b/chain/stmgr/stmgr.go index d147bc791..dff0d9fe3 100644 --- a/chain/stmgr/stmgr.go +++ b/chain/stmgr/stmgr.go @@ -289,7 +289,6 @@ func (sm *StateManager) ApplyBlocks(ctx context.Context, pstate cid.Cid, bms []B } return st, rectroot, nil - } func (sm *StateManager) computeTipSetState(ctx context.Context, blks []*types.BlockHeader, cb ExecCallback) (cid.Cid, cid.Cid, error) { diff --git a/cmd/lotus-storage-miner/init.go b/cmd/lotus-storage-miner/init.go index a8034ebfd..bf552cd68 100644 --- a/cmd/lotus-storage-miner/init.go +++ b/cmd/lotus-storage-miner/init.go @@ -173,7 +173,7 @@ var initCmd = &cli.Command{ var localPaths []config.LocalPath if pssb := cctx.StringSlice("pre-sealed-sectors"); len(pssb) != 0 { - log.Infof("Setting up storage config with presealed sector", pssb) + log.Infof("Setting up storage config with presealed sector: %v", pssb) for _, psp := range pssb { psp, err := homedir.Expand(psp) diff --git a/storage/fpost_run.go b/storage/fpost_run.go index 5f79e62b0..dc38d7f4b 100644 --- a/storage/fpost_run.go +++ b/storage/fpost_run.go @@ -1,6 +1,7 @@ package storage import ( + "bytes" "context" "time" @@ -147,7 +148,11 @@ func (s *FPoStScheduler) runPost(ctx context.Context, eps abi.ChainEpoch, ts *ty challengeRound := eps - rand, err := s.api.ChainGetRandomness(ctx, ts.Key(), crypto.DomainSeparationTag_WindowedPoStChallengeSeed, challengeRound, s.actor.Bytes()) + buf := new(bytes.Buffer) + if err := s.actor.MarshalCBOR(buf); err != nil { + return nil, xerrors.Errorf("failed to marshal address to cbor: %w", err) + } + rand, err := s.api.ChainGetRandomness(ctx, ts.Key(), crypto.DomainSeparationTag_WindowedPoStChallengeSeed, challengeRound, buf.Bytes()) if err != nil { return nil, xerrors.Errorf("failed to get chain randomness for fpost (ts=%d; eps=%d): %w", ts.Height(), eps, err) } @@ -187,6 +192,15 @@ func (s *FPoStScheduler) runPost(ctx context.Context, eps abi.ChainEpoch, ts *ty return nil, xerrors.Errorf("running post failed: %w", err) } + if len(scandidates) == 0 { + return nil, xerrors.Errorf("received zero candidates back from generate fallback post") + } + + // TODO: until we figure out how fallback post is really supposed to work, + // let's just pass a single candidate... + scandidates = scandidates[:1] + proof = proof[:1] + elapsed := time.Since(tsStart) log.Infow("submitting PoSt", "pLen", len(proof), "elapsed", elapsed)