diff --git a/api/api_full.go b/api/api_full.go index f2585b927..55e958850 100644 --- a/api/api_full.go +++ b/api/api_full.go @@ -319,7 +319,6 @@ type FullNode interface { StateSectorExpiration(context.Context, address.Address, abi.SectorNumber, types.TipSetKey) (*SectorExpiration, error) // StateSectorPartition finds deadline/partition with the specified sector StateSectorPartition(ctx context.Context, maddr address.Address, sectorNumber abi.SectorNumber, tok types.TipSetKey) (*SectorLocation, error) - StatePledgeCollateral(context.Context, types.TipSetKey) (types.BigInt, error) // StateSearchMsg searches for a message in the chain, and returns its receipt and the tipset where it was executed StateSearchMsg(context.Context, cid.Cid) (*MsgLookup, error) // StateWaitMsg looks back in the chain for a message. If not found, it blocks until the diff --git a/api/apistruct/struct.go b/api/apistruct/struct.go index 49a0c2afc..4ecea5bde 100644 --- a/api/apistruct/struct.go +++ b/api/apistruct/struct.go @@ -164,7 +164,6 @@ type FullNodeStruct struct { StateReplay func(context.Context, types.TipSetKey, cid.Cid) (*api.InvocResult, error) `perm:"read"` StateGetActor func(context.Context, address.Address, types.TipSetKey) (*types.Actor, error) `perm:"read"` StateReadState func(context.Context, address.Address, types.TipSetKey) (*api.ActorState, error) `perm:"read"` - StatePledgeCollateral func(context.Context, types.TipSetKey) (types.BigInt, error) `perm:"read"` StateWaitMsg func(ctx context.Context, cid cid.Cid, confidence uint64) (*api.MsgLookup, error) `perm:"read"` StateSearchMsg func(context.Context, cid.Cid) (*api.MsgLookup, error) `perm:"read"` StateListMiners func(context.Context, types.TipSetKey) ([]address.Address, error) `perm:"read"` @@ -738,10 +737,6 @@ func (c *FullNodeStruct) StateReadState(ctx context.Context, addr address.Addres return c.Internal.StateReadState(ctx, addr, tsk) } -func (c *FullNodeStruct) StatePledgeCollateral(ctx context.Context, tsk types.TipSetKey) (types.BigInt, error) { - return c.Internal.StatePledgeCollateral(ctx, tsk) -} - func (c *FullNodeStruct) StateWaitMsg(ctx context.Context, msgc cid.Cid, confidence uint64) (*api.MsgLookup, error) { return c.Internal.StateWaitMsg(ctx, msgc, confidence) } diff --git a/cli/state.go b/cli/state.go index 71bf236c7..57b1409c2 100644 --- a/cli/state.go +++ b/cli/state.go @@ -52,7 +52,6 @@ var stateCmd = &cli.Command{ statePowerCmd, stateSectorsCmd, stateActiveSectorsCmd, - statePledgeCollateralCmd, stateListActorsCmd, stateListMinersCmd, stateCircSupplyCmd, @@ -386,33 +385,6 @@ var stateReplaySetCmd = &cli.Command{ }, } -var statePledgeCollateralCmd = &cli.Command{ - Name: "pledge-collateral", - Usage: "Get minimum miner pledge collateral", - Action: func(cctx *cli.Context) error { - api, closer, err := GetFullNodeAPI(cctx) - if err != nil { - return err - } - defer closer() - - ctx := ReqContext(cctx) - - ts, err := LoadTipSet(ctx, cctx, api) - if err != nil { - return err - } - - coll, err := api.StatePledgeCollateral(ctx, ts.Key()) - if err != nil { - return err - } - - fmt.Println(types.FIL(coll)) - return nil - }, -} - var stateGetDealSetCmd = &cli.Command{ Name: "get-deal", Usage: "View on-chain deal info", diff --git a/cmd/lotus-storage-miner/init.go b/cmd/lotus-storage-miner/init.go index 73956430b..6e21893db 100644 --- a/cmd/lotus-storage-miner/init.go +++ b/cmd/lotus-storage-miner/init.go @@ -7,6 +7,7 @@ import ( "encoding/binary" "encoding/json" "fmt" + "github.com/filecoin-project/specs-actors/actors/abi/big" "io/ioutil" "os" "path/filepath" @@ -614,11 +615,6 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID, return address.Undef, err } - collateral, err := api.StatePledgeCollateral(ctx, types.EmptyTSK) - if err != nil { - return address.Undef, err - } - spt, err := ffiwrapper.SealProofTypeFromSectorSize(abi.SectorSize(ssize)) if err != nil { return address.Undef, err @@ -637,7 +633,7 @@ func createStorageMiner(ctx context.Context, api lapi.FullNode, peerid peer.ID, createStorageMinerMsg := &types.Message{ To: builtin.StoragePowerActorAddr, From: owner, - Value: types.BigAdd(collateral, types.BigDiv(collateral, types.NewInt(100))), + Value: big.Zero(), Method: builtin.MethodsPower.CreateMiner, Params: params, diff --git a/node/impl/full/state.go b/node/impl/full/state.go index b94c3ab53..4f08d324d 100644 --- a/node/impl/full/state.go +++ b/node/impl/full/state.go @@ -258,37 +258,6 @@ func (a *StateAPI) StateMinerPower(ctx context.Context, addr address.Address, ts }, nil } -func (a *StateAPI) StatePledgeCollateral(ctx context.Context, tsk types.TipSetKey) (types.BigInt, error) { - /*ts, err := a.Chain.GetTipSetFromKey(tsk) - if err != nil { - return types.EmptyInt, xerrors.Errorf("loading tipset %s: %w", tsk, err) - } - - param, err := actors.SerializeParams(&actors.PledgeCollateralParams{Size: types.NewInt(0)}) - if err != nil { - return types.NewInt(0), err - } - - ret, aerr := a.StateManager.Call(ctx, &types.Message{ - From: actors.StoragePowerAddress, - To: actors.StoragePowerAddress, - Method: actors.SPAMethods.PledgeCollateralForSize, - - Params: param, - }, ts) - if aerr != nil { - return types.NewInt(0), xerrors.Errorf("failed to get miner worker addr: %w", err) - } - - if ret.MsgRct.ExitCode != 0 { - return types.NewInt(0), xerrors.Errorf("failed to get miner worker addr (exit code %d)", ret.MsgRct.ExitCode) - } - - return types.BigFromBytes(ret.Return), nil*/ - log.Error("TODO StatePledgeCollateral") - return big.Zero(), nil -} - func (a *StateAPI) StateCall(ctx context.Context, msg *types.Message, tsk types.TipSetKey) (*api.InvocResult, error) { ts, err := a.Chain.GetTipSetFromKey(tsk) if err != nil {