actors: Rename some storageminer stuff to match the spec
This commit is contained in:
parent
3e5654d575
commit
a4c0610cc3
@ -22,22 +22,27 @@ import (
|
|||||||
type StorageMinerActor struct{}
|
type StorageMinerActor struct{}
|
||||||
|
|
||||||
type StorageMinerActorState struct {
|
type StorageMinerActorState struct {
|
||||||
// Contains mostly static info about this miner
|
// PreCommittedSectors is the set of sectors that have been committed to but not
|
||||||
Info cid.Cid
|
// yet had their proofs submitted
|
||||||
|
PreCommittedSectors map[string]*UnprovenSector
|
||||||
// Collateral that is waiting to be withdrawn.
|
|
||||||
DePledgedCollateral types.BigInt
|
|
||||||
|
|
||||||
// Time at which the depledged collateral may be withdrawn.
|
|
||||||
DePledgeTime types.BigInt
|
|
||||||
|
|
||||||
// All sectors this miner has committed.
|
// All sectors this miner has committed.
|
||||||
Sectors cid.Cid
|
Sectors cid.Cid
|
||||||
|
|
||||||
|
// TODO: Spec says 'StagedCommittedSectors', which one is it?
|
||||||
|
|
||||||
// Sectors this miner is currently mining. It is only updated
|
// Sectors this miner is currently mining. It is only updated
|
||||||
// when a PoSt is submitted (not as each new sector commitment is added).
|
// when a PoSt is submitted (not as each new sector commitment is added).
|
||||||
ProvingSet cid.Cid
|
ProvingSet cid.Cid
|
||||||
|
|
||||||
|
// TODO: these:
|
||||||
|
// SectorTable
|
||||||
|
// SectorExpirationQueue
|
||||||
|
// ChallengeStatus
|
||||||
|
|
||||||
|
// Contains mostly static info about this miner
|
||||||
|
Info cid.Cid
|
||||||
|
|
||||||
// Faulty sectors reported since last SubmitPost,
|
// Faulty sectors reported since last SubmitPost,
|
||||||
// up to the current proving period's challenge time.
|
// up to the current proving period's challenge time.
|
||||||
CurrentFaultSet types.BitField
|
CurrentFaultSet types.BitField
|
||||||
@ -53,10 +58,6 @@ type StorageMinerActorState struct {
|
|||||||
// removal penalization is needed.
|
// removal penalization is needed.
|
||||||
NextDoneSet types.BitField
|
NextDoneSet types.BitField
|
||||||
|
|
||||||
// UnprovenSectors is the set of sectors that have been committed to but not
|
|
||||||
// yet had their proofs submitted
|
|
||||||
UnprovenSectors map[string]*UnprovenSector
|
|
||||||
|
|
||||||
// Amount of power this miner has.
|
// Amount of power this miner has.
|
||||||
Power types.BigInt
|
Power types.BigInt
|
||||||
|
|
||||||
@ -89,6 +90,8 @@ type MinerInfo struct {
|
|||||||
|
|
||||||
// Amount of space in each sector committed to the network by this miner.
|
// Amount of space in each sector committed to the network by this miner.
|
||||||
SectorSize uint64
|
SectorSize uint64
|
||||||
|
|
||||||
|
// SubsectorCount
|
||||||
}
|
}
|
||||||
|
|
||||||
type UnprovenSector struct {
|
type UnprovenSector struct {
|
||||||
@ -106,7 +109,8 @@ type StorageMinerConstructorParams struct {
|
|||||||
|
|
||||||
type maMethods struct {
|
type maMethods struct {
|
||||||
Constructor uint64
|
Constructor uint64
|
||||||
CommitSector uint64
|
PreCommitSector uint64
|
||||||
|
ProveCommitSector uint64
|
||||||
SubmitPoSt uint64
|
SubmitPoSt uint64
|
||||||
SlashStorageFault uint64
|
SlashStorageFault uint64
|
||||||
GetCurrentProvingSet uint64
|
GetCurrentProvingSet uint64
|
||||||
@ -121,32 +125,33 @@ type maMethods struct {
|
|||||||
ChangeWorker uint64
|
ChangeWorker uint64
|
||||||
IsSlashed uint64
|
IsSlashed uint64
|
||||||
IsLate uint64
|
IsLate uint64
|
||||||
AddFaults uint64
|
DeclareFaults uint64
|
||||||
SlashConsensusFault uint64
|
SlashConsensusFault uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
var MAMethods = maMethods{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18}
|
var MAMethods = maMethods{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19}
|
||||||
|
|
||||||
func (sma StorageMinerActor) Exports() []interface{} {
|
func (sma StorageMinerActor) Exports() []interface{} {
|
||||||
return []interface{}{
|
return []interface{}{
|
||||||
1: sma.StorageMinerConstructor,
|
1: sma.StorageMinerConstructor,
|
||||||
2: sma.CommitSector,
|
2: sma.PreCommitSector,
|
||||||
3: sma.SubmitPoSt,
|
3: sma.ProveCommitSector,
|
||||||
//4: sma.SlashStorageFault,
|
4: sma.SubmitPoSt,
|
||||||
//5: sma.GetCurrentProvingSet,
|
//5: sma.SlashStorageFault,
|
||||||
//6: sma.ArbitrateDeal,
|
//6: sma.GetCurrentProvingSet,
|
||||||
//7: sma.DePledge,
|
//7: sma.ArbitrateDeal,
|
||||||
8: sma.GetOwner,
|
//8: sma.DePledge,
|
||||||
9: sma.GetWorkerAddr,
|
9: sma.GetOwner,
|
||||||
10: sma.GetPower,
|
10: sma.GetWorkerAddr,
|
||||||
11: sma.GetPeerID,
|
11: sma.GetPower, // TODO: Remove
|
||||||
12: sma.GetSectorSize,
|
12: sma.GetPeerID,
|
||||||
13: sma.UpdatePeerID,
|
13: sma.GetSectorSize,
|
||||||
//14: sma.ChangeWorker,
|
14: sma.UpdatePeerID,
|
||||||
//15: sma.IsSlashed,
|
//15: sma.ChangeWorker,
|
||||||
//16: sma.IsLate,
|
//16: sma.IsSlashed,
|
||||||
17: sma.AddFaults,
|
//17: sma.IsLate,
|
||||||
18: sma.SlashConsensusFault,
|
18: sma.DeclareFaults,
|
||||||
|
19: sma.SlashConsensusFault,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,7 +211,7 @@ func (sma StorageMinerActor) StorageMinerConstructor(act *types.Actor, vmctx typ
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type OnChainSealVerifyInfo struct {
|
type SectorPreCommitInfo struct {
|
||||||
CommD []byte // TODO: update proofs code
|
CommD []byte // TODO: update proofs code
|
||||||
CommR []byte
|
CommR []byte
|
||||||
|
|
||||||
@ -215,7 +220,7 @@ type OnChainSealVerifyInfo struct {
|
|||||||
SectorNumber uint64
|
SectorNumber uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sma StorageMinerActor) CommitSector(act *types.Actor, vmctx types.VMContext, params *OnChainSealVerifyInfo) ([]byte, ActorError) {
|
func (sma StorageMinerActor) PreCommitSector(act *types.Actor, vmctx types.VMContext, params *SectorPreCommitInfo) ([]byte, ActorError) {
|
||||||
ctx := vmctx.Context()
|
ctx := vmctx.Context()
|
||||||
oldstate, self, err := loadState(vmctx)
|
oldstate, self, err := loadState(vmctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -249,7 +254,7 @@ func (sma StorageMinerActor) CommitSector(act *types.Actor, vmctx types.VMContex
|
|||||||
return nil, aerrors.New(4, "not enough collateral")
|
return nil, aerrors.New(4, "not enough collateral")
|
||||||
}
|
}
|
||||||
|
|
||||||
self.UnprovenSectors[uintToStringKey(params.SectorNumber)] = &UnprovenSector{
|
self.PreCommittedSectors[uintToStringKey(params.SectorNumber)] = &UnprovenSector{
|
||||||
CommR: params.CommR,
|
CommR: params.CommR,
|
||||||
CommD: params.CommD,
|
CommD: params.CommD,
|
||||||
SubmitHeight: vmctx.BlockHeight(),
|
SubmitHeight: vmctx.BlockHeight(),
|
||||||
@ -272,13 +277,13 @@ func uintToStringKey(i uint64) string {
|
|||||||
return string(buf[:n])
|
return string(buf[:n])
|
||||||
}
|
}
|
||||||
|
|
||||||
type SubmitSectorProofParams struct {
|
type SectorProveCommitInfo struct {
|
||||||
Proof []byte
|
Proof []byte
|
||||||
SectorID uint64
|
SectorID uint64
|
||||||
DealIDs []uint64
|
DealIDs []uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sma StorageMinerActor) SubmitSectorProof(act *types.Actor, vmctx types.VMContext, params *SubmitSectorProofParams) ([]byte, ActorError) {
|
func (sma StorageMinerActor) ProveCommitSector(act *types.Actor, vmctx types.VMContext, params *SectorProveCommitInfo) ([]byte, ActorError) {
|
||||||
ctx := vmctx.Context()
|
ctx := vmctx.Context()
|
||||||
oldstate, self, err := loadState(vmctx)
|
oldstate, self, err := loadState(vmctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -290,11 +295,11 @@ func (sma StorageMinerActor) SubmitSectorProof(act *types.Actor, vmctx types.VMC
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
us, ok := self.UnprovenSectors[uintToStringKey(params.SectorID)]
|
us, ok := self.PreCommittedSectors[uintToStringKey(params.SectorID)]
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, aerrors.New(1, "no pre-commitment found for sector")
|
return nil, aerrors.New(1, "no pre-commitment found for sector")
|
||||||
}
|
}
|
||||||
delete(self.UnprovenSectors, uintToStringKey(params.SectorID))
|
delete(self.PreCommittedSectors, uintToStringKey(params.SectorID))
|
||||||
|
|
||||||
// TODO: ensure normalization to ID address
|
// TODO: ensure normalization to ID address
|
||||||
maddr := vmctx.Message().To
|
maddr := vmctx.Message().To
|
||||||
@ -319,7 +324,7 @@ func (sma StorageMinerActor) SubmitSectorProof(act *types.Actor, vmctx types.VMC
|
|||||||
// Note: As written here, every miners first PoSt will only be over one sector.
|
// Note: As written here, every miners first PoSt will only be over one sector.
|
||||||
// We could set up a 'grace period' for starting mining that would allow miners
|
// We could set up a 'grace period' for starting mining that would allow miners
|
||||||
// to submit several sectors for their first proving period. Alternatively, we
|
// to submit several sectors for their first proving period. Alternatively, we
|
||||||
// could simply make the 'CommitSector' call take multiple sectors at a time.
|
// could simply make the 'PreCommitSector' call take multiple sectors at a time.
|
||||||
//
|
//
|
||||||
// Note: Proving period is a function of sector size; small sectors take less
|
// Note: Proving period is a function of sector size; small sectors take less
|
||||||
// time to prove than large sectors do. Sector size is selected when pledging.
|
// time to prove than large sectors do. Sector size is selected when pledging.
|
||||||
@ -697,11 +702,11 @@ type PaymentVerifyParams struct {
|
|||||||
Proof []byte
|
Proof []byte
|
||||||
}
|
}
|
||||||
|
|
||||||
type AddFaultsParams struct {
|
type DeclareFaultsParams struct {
|
||||||
Faults types.BitField
|
Faults types.BitField
|
||||||
}
|
}
|
||||||
|
|
||||||
func (sma StorageMinerActor) AddFaults(act *types.Actor, vmctx types.VMContext, params *AddFaultsParams) ([]byte, ActorError) {
|
func (sma StorageMinerActor) DeclareFaults(act *types.Actor, vmctx types.VMContext, params *DeclareFaultsParams) ([]byte, ActorError) {
|
||||||
oldstate, self, aerr := loadState(vmctx)
|
oldstate, self, aerr := loadState(vmctx)
|
||||||
if aerr != nil {
|
if aerr != nil {
|
||||||
return nil, aerr
|
return nil, aerr
|
||||||
|
@ -329,6 +329,7 @@ func powerLookup(ctx context.Context, vmctx types.VMContext, self *StoragePowerS
|
|||||||
return types.EmptyInt, aerrors.New(1, "miner not registered with storage power actor")
|
return types.EmptyInt, aerrors.New(1, "miner not registered with storage power actor")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Use local amt
|
||||||
ret, err := vmctx.Send(miner, MAMethods.GetPower, types.NewInt(0), nil)
|
ret, err := vmctx.Send(miner, MAMethods.GetPower, types.NewInt(0), nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return types.EmptyInt, aerrors.Wrap(err, "invoke Miner.GetPower")
|
return types.EmptyInt, aerrors.Wrap(err, "invoke Miner.GetPower")
|
||||||
|
@ -197,24 +197,28 @@ func (t *StorageMinerActorState) MarshalCBOR(w io.Writer) error {
|
|||||||
_, err := w.Write(cbg.CborNull)
|
_, err := w.Write(cbg.CborNull)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err := w.Write([]byte{141}); err != nil {
|
if _, err := w.Write([]byte{139}); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.t.Info (cid.Cid)
|
// t.t.PreCommittedSectors (map[string]*actors.UnprovenSector)
|
||||||
|
if err := cbg.CborWriteHeader(w, cbg.MajMap, uint64(len(t.PreCommittedSectors))); err != nil {
|
||||||
if err := cbg.WriteCid(w, t.Info); err != nil {
|
|
||||||
return xerrors.Errorf("failed to write cid field t.Info: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.t.DePledgedCollateral (types.BigInt)
|
|
||||||
if err := t.DePledgedCollateral.MarshalCBOR(w); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.t.DePledgeTime (types.BigInt)
|
for k, v := range t.PreCommittedSectors {
|
||||||
if err := t.DePledgeTime.MarshalCBOR(w); err != nil {
|
|
||||||
return err
|
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(k)))); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if _, err := w.Write([]byte(k)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if err := v.MarshalCBOR(w); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.t.Sectors (cid.Cid)
|
// t.t.Sectors (cid.Cid)
|
||||||
@ -229,6 +233,12 @@ func (t *StorageMinerActorState) MarshalCBOR(w io.Writer) error {
|
|||||||
return xerrors.Errorf("failed to write cid field t.ProvingSet: %w", err)
|
return xerrors.Errorf("failed to write cid field t.ProvingSet: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// t.t.Info (cid.Cid)
|
||||||
|
|
||||||
|
if err := cbg.WriteCid(w, t.Info); err != nil {
|
||||||
|
return xerrors.Errorf("failed to write cid field t.Info: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
// t.t.CurrentFaultSet (types.BitField)
|
// t.t.CurrentFaultSet (types.BitField)
|
||||||
if err := t.CurrentFaultSet.MarshalCBOR(w); err != nil {
|
if err := t.CurrentFaultSet.MarshalCBOR(w); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -244,26 +254,6 @@ func (t *StorageMinerActorState) MarshalCBOR(w io.Writer) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.t.UnprovenSectors (map[string]*actors.UnprovenSector)
|
|
||||||
if err := cbg.CborWriteHeader(w, cbg.MajMap, uint64(len(t.UnprovenSectors))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
for k, v := range t.UnprovenSectors {
|
|
||||||
|
|
||||||
if _, err := w.Write(cbg.CborEncodeMajorType(cbg.MajTextString, uint64(len(k)))); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
if _, err := w.Write([]byte(k)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err := v.MarshalCBOR(w); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// t.t.Power (types.BigInt)
|
// t.t.Power (types.BigInt)
|
||||||
if err := t.Power.MarshalCBOR(w); err != nil {
|
if err := t.Power.MarshalCBOR(w); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -297,92 +287,11 @@ func (t *StorageMinerActorState) UnmarshalCBOR(r io.Reader) error {
|
|||||||
return fmt.Errorf("cbor input should be of type array")
|
return fmt.Errorf("cbor input should be of type array")
|
||||||
}
|
}
|
||||||
|
|
||||||
if extra != 13 {
|
if extra != 11 {
|
||||||
return fmt.Errorf("cbor input had wrong number of fields")
|
return fmt.Errorf("cbor input had wrong number of fields")
|
||||||
}
|
}
|
||||||
|
|
||||||
// t.t.Info (cid.Cid)
|
// t.t.PreCommittedSectors (map[string]*actors.UnprovenSector)
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
c, err := cbg.ReadCid(br)
|
|
||||||
if err != nil {
|
|
||||||
return xerrors.Errorf("failed to read cid field t.Info: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Info = c
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.t.DePledgedCollateral (types.BigInt)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.DePledgedCollateral.UnmarshalCBOR(br); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.t.DePledgeTime (types.BigInt)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.DePledgeTime.UnmarshalCBOR(br); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.t.Sectors (cid.Cid)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
c, err := cbg.ReadCid(br)
|
|
||||||
if err != nil {
|
|
||||||
return xerrors.Errorf("failed to read cid field t.Sectors: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.Sectors = c
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.t.ProvingSet (cid.Cid)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
c, err := cbg.ReadCid(br)
|
|
||||||
if err != nil {
|
|
||||||
return xerrors.Errorf("failed to read cid field t.ProvingSet: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
t.ProvingSet = c
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.t.CurrentFaultSet (types.BitField)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.CurrentFaultSet.UnmarshalCBOR(br); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.t.NextFaultSet (types.BitField)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.NextFaultSet.UnmarshalCBOR(br); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.t.NextDoneSet (types.BitField)
|
|
||||||
|
|
||||||
{
|
|
||||||
|
|
||||||
if err := t.NextDoneSet.UnmarshalCBOR(br); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
// t.t.UnprovenSectors (map[string]*actors.UnprovenSector)
|
|
||||||
|
|
||||||
maj, extra, err = cbg.CborReadHeader(br)
|
maj, extra, err = cbg.CborReadHeader(br)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -392,10 +301,10 @@ func (t *StorageMinerActorState) UnmarshalCBOR(r io.Reader) error {
|
|||||||
return fmt.Errorf("expected a map (major type 5)")
|
return fmt.Errorf("expected a map (major type 5)")
|
||||||
}
|
}
|
||||||
if extra > 4096 {
|
if extra > 4096 {
|
||||||
return fmt.Errorf("t.UnprovenSectors: map too large")
|
return fmt.Errorf("t.PreCommittedSectors: map too large")
|
||||||
}
|
}
|
||||||
|
|
||||||
t.UnprovenSectors = make(map[string]*UnprovenSector, extra)
|
t.PreCommittedSectors = make(map[string]*UnprovenSector, extra)
|
||||||
|
|
||||||
for i, l := 0, int(extra); i < l; i++ {
|
for i, l := 0, int(extra); i < l; i++ {
|
||||||
|
|
||||||
@ -432,7 +341,70 @@ func (t *StorageMinerActorState) UnmarshalCBOR(r io.Reader) error {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
t.UnprovenSectors[k] = v
|
t.PreCommittedSectors[k] = v
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.t.Sectors (cid.Cid)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
c, err := cbg.ReadCid(br)
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("failed to read cid field t.Sectors: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Sectors = c
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.t.ProvingSet (cid.Cid)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
c, err := cbg.ReadCid(br)
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("failed to read cid field t.ProvingSet: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.ProvingSet = c
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.t.Info (cid.Cid)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
c, err := cbg.ReadCid(br)
|
||||||
|
if err != nil {
|
||||||
|
return xerrors.Errorf("failed to read cid field t.Info: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
|
t.Info = c
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.t.CurrentFaultSet (types.BitField)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
if err := t.CurrentFaultSet.UnmarshalCBOR(br); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.t.NextFaultSet (types.BitField)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
if err := t.NextFaultSet.UnmarshalCBOR(br); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
// t.t.NextDoneSet (types.BitField)
|
||||||
|
|
||||||
|
{
|
||||||
|
|
||||||
|
if err := t.NextDoneSet.UnmarshalCBOR(br); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// t.t.Power (types.BigInt)
|
// t.t.Power (types.BigInt)
|
||||||
@ -565,7 +537,7 @@ func (t *StorageMinerConstructorParams) UnmarshalCBOR(r io.Reader) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *OnChainSealVerifyInfo) MarshalCBOR(w io.Writer) error {
|
func (t *SectorPreCommitInfo) MarshalCBOR(w io.Writer) error {
|
||||||
if t == nil {
|
if t == nil {
|
||||||
_, err := w.Write(cbg.CborNull)
|
_, err := w.Write(cbg.CborNull)
|
||||||
return err
|
return err
|
||||||
@ -610,7 +582,7 @@ func (t *OnChainSealVerifyInfo) MarshalCBOR(w io.Writer) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *OnChainSealVerifyInfo) UnmarshalCBOR(r io.Reader) error {
|
func (t *SectorPreCommitInfo) UnmarshalCBOR(r io.Reader) error {
|
||||||
br := cbg.GetPeeker(r)
|
br := cbg.GetPeeker(r)
|
||||||
|
|
||||||
maj, extra, err := cbg.CborReadHeader(br)
|
maj, extra, err := cbg.CborReadHeader(br)
|
||||||
|
@ -50,7 +50,7 @@ func main() {
|
|||||||
actors.AccountActorState{},
|
actors.AccountActorState{},
|
||||||
actors.StorageMinerActorState{},
|
actors.StorageMinerActorState{},
|
||||||
actors.StorageMinerConstructorParams{},
|
actors.StorageMinerConstructorParams{},
|
||||||
actors.OnChainSealVerifyInfo{},
|
actors.SectorPreCommitInfo{},
|
||||||
actors.UnprovenSector{},
|
actors.UnprovenSector{},
|
||||||
actors.MinerInfo{},
|
actors.MinerInfo{},
|
||||||
actors.SubmitPoStParams{},
|
actors.SubmitPoStParams{},
|
||||||
|
@ -176,7 +176,7 @@ func (m *Miner) commitSector(ctx context.Context, sinfo sectorbuilder.SectorSeal
|
|||||||
return xerrors.Errorf("getting sector deals failed: %w", err)
|
return xerrors.Errorf("getting sector deals failed: %w", err)
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
params := &actors.OnChainSealVerifyInfo{
|
params := &actors.SectorPreCommitInfo{
|
||||||
CommD: sinfo.CommD[:],
|
CommD: sinfo.CommD[:],
|
||||||
CommR: sinfo.CommR[:],
|
CommR: sinfo.CommR[:],
|
||||||
Proof: sinfo.Proof,
|
Proof: sinfo.Proof,
|
||||||
@ -193,7 +193,7 @@ func (m *Miner) commitSector(ctx context.Context, sinfo sectorbuilder.SectorSeal
|
|||||||
msg := &types.Message{
|
msg := &types.Message{
|
||||||
To: m.maddr,
|
To: m.maddr,
|
||||||
From: m.worker,
|
From: m.worker,
|
||||||
Method: actors.MAMethods.CommitSector,
|
Method: actors.MAMethods.PreCommitSector,
|
||||||
Params: enc,
|
Params: enc,
|
||||||
Value: types.NewInt(0), // TODO: need to ensure sufficient collateral
|
Value: types.NewInt(0), // TODO: need to ensure sufficient collateral
|
||||||
GasLimit: types.NewInt(1000000 /* i dont know help */),
|
GasLimit: types.NewInt(1000000 /* i dont know help */),
|
||||||
|
Loading…
Reference in New Issue
Block a user