Update specs-actors

This commit is contained in:
Łukasz Magiera 2020-04-16 18:41:45 +02:00
parent f88e400d74
commit 98f3cab24e
6 changed files with 13 additions and 50 deletions

View File

@ -11,7 +11,6 @@ import (
"golang.org/x/xerrors"
"github.com/filecoin-project/go-address"
cborutil "github.com/filecoin-project/go-cbor-util"
"github.com/filecoin-project/specs-actors/actors/abi"
"github.com/filecoin-project/specs-actors/actors/abi/big"
"github.com/filecoin-project/specs-actors/actors/builtin"
@ -126,30 +125,12 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
// setup windowed post
{
provingPeriodBoundary := abi.ChainEpoch(0)
// TODO: Can drop, now done in constructor
err = vm.MutateState(ctx, maddr, func(cst cbor.IpldStore, st *miner.State) error {
panic("from some randomness")
st.ProvingPeriodBoundary = 0
fmt.Println("PROVINg BOUNDARY: #### ", st.Info.ProvingPeriodBoundary)
return nil
})
panic("todo, probably more cron stuff")
payload, err := cborutil.Dump(&miner.CronEventPayload{
EventType: miner.CronEventProvingPeriod,
})
if err != nil {
return cid.Undef, err
}
params := &power.EnrollCronEventParams{
EventEpoch: miner.WPoStProvingPeriod + provingPeriodBoundary, // TODO: correct ???
Payload: payload,
}
_, err = doExecValue(ctx, vm, builtin.StoragePowerActorAddr, maddr, big.Zero(), builtin.MethodsPower.EnrollCronEvent, mustEnc(params))
if err != nil {
return cid.Undef, xerrors.Errorf("failed to verify preseal deals miner: %w", err)
}
}
// Commit sectors
@ -226,28 +207,6 @@ func SetupStorageMiners(ctx context.Context, cs *store.ChainStore, sroot cid.Cid
return cid.Cid{}, xerrors.Errorf("put to sset: %w", err)
}
}
{
sectorBf := abi.NewBitField()
sectorBf.Set(uint64(preseal.SectorID))
payload, err := cborutil.Dump(&miner.CronEventPayload{
EventType: miner.CronEventPreCommitExpiry, // TODO: Review: Is this correct?
Sectors: &sectorBf,
})
if err != nil {
return cid.Undef, err
}
params := &power.EnrollCronEventParams{
EventEpoch: preseal.Deal.EndEpoch,
Payload: payload,
}
_, err = doExecValue(ctx, vm, builtin.StoragePowerActorAddr, maddr, big.Zero(), builtin.MethodsPower.EnrollCronEvent, mustEnc(params))
if err != nil {
return cid.Undef, xerrors.Errorf("failed to verify preseal deals miner: %w", err)
}
}
}
}

View File

@ -225,7 +225,7 @@ func GetMinerFaults(ctx context.Context, sm *StateManager, ts *types.TipSet, mad
return nil, xerrors.Errorf("(get ssize) failed to load miner actor state: %w", err)
}
faults, err := mas.Faults.All(miner.MaxFaultsCount)
faults, err := mas.Faults.All(miner.SectorsMax)
if err != nil {
return nil, xerrors.Errorf("reading fault bit set: %w", err)
}
@ -372,12 +372,12 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch,
}
func GetProvingSetRaw(ctx context.Context, sm *StateManager, mas miner.State) ([]*api.ChainSectorInfo, error) {
notProving, err := abi.BitFieldUnion(mas.Faults, mas.Recoveries, mas.NewSectors)
notProving, err := abi.BitFieldUnion(mas.Faults, mas.Recoveries)
if err != nil {
return nil, err
}
provset, err := LoadSectorsFromSet(ctx, sm.cs.Blockstore(), mas.Sectors, &notProving)
provset, err := LoadSectorsFromSet(ctx, sm.cs.Blockstore(), mas.Sectors, notProving)
if err != nil {
return nil, xerrors.Errorf("failed to get proving set: %w", err)
}

View File

@ -135,7 +135,7 @@ func (ps pricedSyscalls) VerifyPoSt(vi abi.WindowPoStVerifyInfo) error {
// the "parent grinding fault", in which case it must be the sibling of h1 (same parent tipset) and one of the
// blocks in the parent of h2 (i.e. h2's grandparent).
// Returns nil and an error if the headers don't prove a fault.
func (ps pricedSyscalls) VerifyConsensusFault(h1 []byte, h2 []byte, extra []byte, earliest abi.ChainEpoch) (*runtime.ConsensusFault, error) {
func (ps pricedSyscalls) VerifyConsensusFault(h1 []byte, h2 []byte, extra []byte) (*runtime.ConsensusFault, error) {
ps.chargeGas(ps.pl.OnVerifyConsensusFault())
return ps.under.VerifyConsensusFault(h1, h2, extra, earliest)
return ps.under.VerifyConsensusFault(h1, h2, extra)
}

View File

@ -49,7 +49,7 @@ func (ss *syscallShim) HashBlake2b(data []byte) [32]byte {
panic("NYI")
}
func (ss *syscallShim) VerifyConsensusFault(a, b, extra []byte, epoch abi.ChainEpoch) (*runtime.ConsensusFault, error) {
func (ss *syscallShim) VerifyConsensusFault(a, b, extra []byte) (*runtime.ConsensusFault, error) {
panic("NYI")
}

2
go.mod
View File

@ -25,7 +25,7 @@ require (
github.com/filecoin-project/go-paramfetch v0.0.2-0.20200218225740-47c639bab663
github.com/filecoin-project/go-statestore v0.1.0
github.com/filecoin-project/sector-storage v0.0.0-20200411000242-61616264b16d
github.com/filecoin-project/specs-actors v0.0.0-20200415170224-54c7b2a42e71
github.com/filecoin-project/specs-actors v0.0.0-20200416120818-2fbe2e4dee24
github.com/filecoin-project/specs-storage v0.0.0-20200410185809-9fbaaa08f275
github.com/filecoin-project/storage-fsm v0.0.0-20200415180041-afc45d4b6e8b
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1

4
go.sum
View File

@ -143,6 +143,8 @@ github.com/filecoin-project/go-bitfield v0.0.0-20200309034705-8c7ac40bd550 h1:ao
github.com/filecoin-project/go-bitfield v0.0.0-20200309034705-8c7ac40bd550/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw=
github.com/filecoin-project/go-bitfield v0.0.0-20200415174627-536a2ee8529d h1:ufxUB1ssNdti7SgDNnHXZ863F8g04/yx+EW4ygvGcSU=
github.com/filecoin-project/go-bitfield v0.0.0-20200415174627-536a2ee8529d/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw=
github.com/filecoin-project/go-bitfield v0.0.0-20200416002808-b3ee67ec9060 h1:/3qjGMn6ukXgZJHsIbuwGL7ipla8DOV3uHZDBJkBYfU=
github.com/filecoin-project/go-bitfield v0.0.0-20200416002808-b3ee67ec9060/go.mod h1:iodsLxOFZnqKtjj2zkgqzoGNrv6vUqj69AT/J8DKXEw=
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2 h1:av5fw6wmm58FYMgJeoB/lK9XXrgdugYiTqkdxjTy9k8=
github.com/filecoin-project/go-cbor-util v0.0.0-20191219014500-08c40a1e63a2/go.mod h1:pqTiPHobNkOVM5thSRsHYjyQfq7O5QSCMhvuu9JoDlg=
github.com/filecoin-project/go-crypto v0.0.0-20191218222705-effae4ea9f03 h1:2pMXdBnCiXjfCYx/hLqFxccPoqsSveQFxVLvNxy9bus=
@ -186,6 +188,8 @@ github.com/filecoin-project/specs-actors v0.0.0-20200415152026-b48e5d7dfd1b/go.m
github.com/filecoin-project/specs-actors v0.0.0-20200415163419-910af9a5064e/go.mod h1:M2HNOBpYbgXl/V4GmJFOsY7lQNuAmOtrCQMa6Yfpfrc=
github.com/filecoin-project/specs-actors v0.0.0-20200415170224-54c7b2a42e71 h1:kmU2Y+QIuUQG+1lELiLdcX/UMd+BVkSlX8jnii87+ZY=
github.com/filecoin-project/specs-actors v0.0.0-20200415170224-54c7b2a42e71/go.mod h1:M2HNOBpYbgXl/V4GmJFOsY7lQNuAmOtrCQMa6Yfpfrc=
github.com/filecoin-project/specs-actors v0.0.0-20200416120818-2fbe2e4dee24 h1:r/a/rs912gOE5Z5AzKJXa7jHu3asRt/cHO30odPTMoE=
github.com/filecoin-project/specs-actors v0.0.0-20200416120818-2fbe2e4dee24/go.mod h1:qNIpwxs7WCtxbcbG4ZiS+Wf3qn36eyfqktlXJhi46X4=
github.com/filecoin-project/specs-storage v0.0.0-20200410185809-9fbaaa08f275 h1:6OTcpsTQBQM0f/A67oEi4E4YtYd6fzkMqbU8cPIWMMs=
github.com/filecoin-project/specs-storage v0.0.0-20200410185809-9fbaaa08f275/go.mod h1:xJ1/xl9+8zZeSSSFmDC3Wr6uusCTxyYPI0VeNVSFmPE=
github.com/filecoin-project/storage-fsm v0.0.0-20200413200947-069c3b2468ca h1:TejufIAWDpEVqFUCszDpgOEzXBWuTVltsDQL/3F8Jxo=