chain: wire CheckProofSubmissions to computeTipSetState

This commit is contained in:
Łukasz Magiera 2019-11-14 00:14:02 +01:00
parent e48949b41f
commit 0241e31129
2 changed files with 20 additions and 2 deletions

View File

@ -125,8 +125,8 @@ type maMethods struct {
GetSectorSize uint64
UpdatePeerID uint64
ChangeWorker uint64
IsLate uint64
CheckMiner uint64
IsLate uint64
CheckMiner uint64
DeclareFaults uint64
SlashConsensusFault uint64
}

View File

@ -187,6 +187,24 @@ func (sm *StateManager) computeTipSetState(ctx context.Context, blks []*types.Bl
}
}
// TODO: cron actor
ret, err := vmi.ApplyMessage(ctx, &types.Message{
To: actors.StoragePowerAddress,
From: actors.StoragePowerAddress,
Nonce: blks[0].Height,
Value: types.NewInt(0),
GasPrice: types.NewInt(0),
GasLimit: types.NewInt(1 << 30), // Make super sure this is never too little
Method: actors.SPAMethods.CheckProofSubmissions,
Params: nil,
})
if err != nil {
return cid.Undef, cid.Undef, err
}
if ret.ExitCode != 0 {
return cid.Undef, cid.Undef, xerrors.Errorf("CheckProofSubmissions exit was non-zero: %d", ret.ExitCode)
}
bs := amt.WrapBlockstore(sm.cs.Blockstore())
rectroot, err := amt.FromArray(bs, receipts)
if err != nil {