minor fix
This commit is contained in:
commit
5930bf6d93
@ -146,15 +146,15 @@ type FullNodeStruct struct {
|
|||||||
WalletDelete func(context.Context, address.Address) error `perm:"write"`
|
WalletDelete func(context.Context, address.Address) error `perm:"write"`
|
||||||
WalletValidateAddress func(context.Context, string) (address.Address, error) `perm:"read"`
|
WalletValidateAddress func(context.Context, string) (address.Address, error) `perm:"read"`
|
||||||
|
|
||||||
ClientImport func(ctx context.Context, ref api.FileRef) (*api.ImportRes, error) `perm:"admin"`
|
ClientImport func(ctx context.Context, ref api.FileRef) (*api.ImportRes, error) `perm:"admin"`
|
||||||
ClientListImports func(ctx context.Context) ([]api.Import, error) `perm:"write"`
|
ClientListImports func(ctx context.Context) ([]api.Import, error) `perm:"write"`
|
||||||
ClientRemoveImport func(ctx context.Context, importID multistore.StoreID) error `perm:"admin"`
|
ClientRemoveImport func(ctx context.Context, importID multistore.StoreID) error `perm:"admin"`
|
||||||
ClientHasLocal func(ctx context.Context, root cid.Cid) (bool, error) `perm:"write"`
|
ClientHasLocal func(ctx context.Context, root cid.Cid) (bool, error) `perm:"write"`
|
||||||
ClientFindData func(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) `perm:"read"`
|
ClientFindData func(ctx context.Context, root cid.Cid, piece *cid.Cid) ([]api.QueryOffer, error) `perm:"read"`
|
||||||
ClientMinerQueryOffer func(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) `perm:"read"`
|
ClientMinerQueryOffer func(ctx context.Context, miner address.Address, root cid.Cid, piece *cid.Cid) (api.QueryOffer, error) `perm:"read"`
|
||||||
ClientStartDeal func(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) `perm:"admin"`
|
ClientStartDeal func(ctx context.Context, params *api.StartDealParams) (*cid.Cid, error) `perm:"admin"`
|
||||||
ClientGetDealInfo func(context.Context, cid.Cid) (*api.DealInfo, error) `perm:"read"`
|
ClientGetDealInfo func(context.Context, cid.Cid) (*api.DealInfo, error) `perm:"read"`
|
||||||
ClientGetDealStatus func(context.Context, uint64) (string, error)
|
ClientGetDealStatus func(context.Context, uint64) (string, error) `perm:"read"`
|
||||||
ClientListDeals func(ctx context.Context) ([]api.DealInfo, error) `perm:"write"`
|
ClientListDeals func(ctx context.Context) ([]api.DealInfo, error) `perm:"write"`
|
||||||
ClientGetDealUpdates func(ctx context.Context) (<-chan api.DealInfo, error) `perm:"read"`
|
ClientGetDealUpdates func(ctx context.Context) (<-chan api.DealInfo, error) `perm:"read"`
|
||||||
ClientRetrieve func(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error `perm:"admin"`
|
ClientRetrieve func(ctx context.Context, order api.RetrievalOrder, ref *api.FileRef) error `perm:"admin"`
|
||||||
|
@ -340,6 +340,18 @@ var runCmd = &cli.Command{
|
|||||||
Usage: "process ProveCommitSector messages",
|
Usage: "process ProveCommitSector messages",
|
||||||
Value: true,
|
Value: true,
|
||||||
},
|
},
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "windowed-post",
|
||||||
|
EnvVars: []string{"LOTUS_PCR_WINDOWED_POST"},
|
||||||
|
Usage: "process SubmitWindowedPoSt messages and refund gas fees",
|
||||||
|
Value: false,
|
||||||
|
},
|
||||||
|
&cli.BoolFlag{
|
||||||
|
Name: "storage-deals",
|
||||||
|
EnvVars: []string{"LOTUS_PCR_STORAGE_DEALS"},
|
||||||
|
Usage: "process PublishStorageDeals messages and refund gas fees",
|
||||||
|
Value: false,
|
||||||
|
},
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "head-delay",
|
Name: "head-delay",
|
||||||
EnvVars: []string{"LOTUS_PCR_HEAD_DELAY"},
|
EnvVars: []string{"LOTUS_PCR_HEAD_DELAY"},
|
||||||
@ -376,6 +388,18 @@ var runCmd = &cli.Command{
|
|||||||
Usage: "percent of refund to issue",
|
Usage: "percent of refund to issue",
|
||||||
Value: 110,
|
Value: 110,
|
||||||
},
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "pre-fee-cap-max",
|
||||||
|
EnvVars: []string{"LOTUS_PCR_PRE_FEE_CAP_MAX"},
|
||||||
|
Usage: "messages with a fee cap larger than this will be skipped when processing pre commit messages",
|
||||||
|
Value: "0.0000000001",
|
||||||
|
},
|
||||||
|
&cli.StringFlag{
|
||||||
|
Name: "prove-fee-cap-max",
|
||||||
|
EnvVars: []string{"LOTUS_PCR_PROVE_FEE_CAP_MAX"},
|
||||||
|
Usage: "messages with a prove cap larger than this will be skipped when processing pre commit messages",
|
||||||
|
Value: "0.0000000001",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
go func() {
|
go func() {
|
||||||
@ -419,6 +443,8 @@ var runCmd = &cli.Command{
|
|||||||
dryRun := cctx.Bool("dry-run")
|
dryRun := cctx.Bool("dry-run")
|
||||||
preCommitEnabled := cctx.Bool("pre-commit")
|
preCommitEnabled := cctx.Bool("pre-commit")
|
||||||
proveCommitEnabled := cctx.Bool("prove-commit")
|
proveCommitEnabled := cctx.Bool("prove-commit")
|
||||||
|
windowedPoStEnabled := cctx.Bool("windowed-post")
|
||||||
|
publishStorageDealsEnabled := cctx.Bool("storage-deals")
|
||||||
aggregateTipsets := cctx.Int("aggregate-tipsets")
|
aggregateTipsets := cctx.Int("aggregate-tipsets")
|
||||||
minerRecoveryEnabled := cctx.Bool("miner-recovery")
|
minerRecoveryEnabled := cctx.Bool("miner-recovery")
|
||||||
minerRecoveryPeriod := abi.ChainEpoch(int64(cctx.Int("miner-recovery-period")))
|
minerRecoveryPeriod := abi.ChainEpoch(int64(cctx.Int("miner-recovery-period")))
|
||||||
@ -426,6 +452,16 @@ var runCmd = &cli.Command{
|
|||||||
minerRecoveryCutoff := uint64(cctx.Int("miner-recovery-cutoff"))
|
minerRecoveryCutoff := uint64(cctx.Int("miner-recovery-cutoff"))
|
||||||
minerRecoveryBonus := uint64(cctx.Int("miner-recovery-bonus"))
|
minerRecoveryBonus := uint64(cctx.Int("miner-recovery-bonus"))
|
||||||
|
|
||||||
|
preFeeCapMax, err := types.ParseFIL(cctx.String("pre-fee-cap-max"))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
proveFeeCapMax, err := types.ParseFIL(cctx.String("prove-fee-cap-max"))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
rf := &refunder{
|
rf := &refunder{
|
||||||
api: api,
|
api: api,
|
||||||
wallet: from,
|
wallet: from,
|
||||||
@ -436,6 +472,10 @@ var runCmd = &cli.Command{
|
|||||||
dryRun: dryRun,
|
dryRun: dryRun,
|
||||||
preCommitEnabled: preCommitEnabled,
|
preCommitEnabled: preCommitEnabled,
|
||||||
proveCommitEnabled: proveCommitEnabled,
|
proveCommitEnabled: proveCommitEnabled,
|
||||||
|
windowedPoStEnabled: windowedPoStEnabled,
|
||||||
|
publishStorageDealsEnabled: publishStorageDealsEnabled,
|
||||||
|
preFeeCapMax: types.BigInt(preFeeCapMax),
|
||||||
|
proveFeeCapMax: types.BigInt(proveFeeCapMax),
|
||||||
}
|
}
|
||||||
|
|
||||||
var refunds *MinersRefund = NewMinersRefund()
|
var refunds *MinersRefund = NewMinersRefund()
|
||||||
@ -587,7 +627,12 @@ type refunder struct {
|
|||||||
dryRun bool
|
dryRun bool
|
||||||
preCommitEnabled bool
|
preCommitEnabled bool
|
||||||
proveCommitEnabled bool
|
proveCommitEnabled bool
|
||||||
|
windowedPoStEnabled bool
|
||||||
|
publishStorageDealsEnabled bool
|
||||||
threshold big.Int
|
threshold big.Int
|
||||||
|
|
||||||
|
preFeeCapMax big.Int
|
||||||
|
proveFeeCapMax big.Int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *refunder) FindMiners(ctx context.Context, tipset *types.TipSet, refunds *MinersRefund, owner, worker, control bool) (*MinersRefund, error) {
|
func (r *refunder) FindMiners(ctx context.Context, tipset *types.TipSet, refunds *MinersRefund, owner, worker, control bool) (*MinersRefund, error) {
|
||||||
@ -815,6 +860,147 @@ func (r *refunder) EnsureMinerMinimums(ctx context.Context, tipset *types.TipSet
|
|||||||
return refunds, nil
|
return refunds, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (r *refunder) processTipsetStorageMarketActor(ctx context.Context, tipset *types.TipSet, msg api.Message, recp *types.MessageReceipt) (bool, string, types.BigInt, error) {
|
||||||
|
|
||||||
|
m := msg.Message
|
||||||
|
refundValue := types.NewInt(0)
|
||||||
|
var messageMethod string
|
||||||
|
|
||||||
|
switch m.Method {
|
||||||
|
case builtin.MethodsMarket.PublishStorageDeals:
|
||||||
|
if !r.publishStorageDealsEnabled {
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
messageMethod = "PublishStorageDeals"
|
||||||
|
|
||||||
|
if recp.ExitCode != exitcode.Ok {
|
||||||
|
log.Debugw("skipping non-ok exitcode message", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "exitcode", recp.ExitCode)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
refundValue = types.BigMul(types.NewInt(uint64(recp.GasUsed)), tipset.Blocks()[0].ParentBaseFee)
|
||||||
|
}
|
||||||
|
|
||||||
|
return true, messageMethod, refundValue, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (r *refunder) processTipsetStorageMinerActor(ctx context.Context, tipset *types.TipSet, msg api.Message, recp *types.MessageReceipt) (bool, string, types.BigInt, error) {
|
||||||
|
|
||||||
|
m := msg.Message
|
||||||
|
refundValue := types.NewInt(0)
|
||||||
|
var messageMethod string
|
||||||
|
|
||||||
|
switch m.Method {
|
||||||
|
case builtin.MethodsMiner.SubmitWindowedPoSt:
|
||||||
|
if !r.windowedPoStEnabled {
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
messageMethod = "SubmitWindowedPoSt"
|
||||||
|
|
||||||
|
if recp.ExitCode != exitcode.Ok {
|
||||||
|
log.Debugw("skipping non-ok exitcode message", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "exitcode", recp.ExitCode)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
refundValue = types.BigMul(types.NewInt(uint64(recp.GasUsed)), tipset.Blocks()[0].ParentBaseFee)
|
||||||
|
case builtin.MethodsMiner.ProveCommitSector:
|
||||||
|
if !r.proveCommitEnabled {
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
messageMethod = "ProveCommitSector"
|
||||||
|
|
||||||
|
if recp.ExitCode != exitcode.Ok {
|
||||||
|
log.Debugw("skipping non-ok exitcode message", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "exitcode", recp.ExitCode)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.GasFeeCap.GreaterThan(r.proveFeeCapMax) {
|
||||||
|
log.Debugw("skipping high fee cap message", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "gas_fee_cap", m.GasFeeCap, "fee_cap_max", r.proveFeeCapMax)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var sn abi.SectorNumber
|
||||||
|
|
||||||
|
var proveCommitSector miner0.ProveCommitSectorParams
|
||||||
|
if err := proveCommitSector.UnmarshalCBOR(bytes.NewBuffer(m.Params)); err != nil {
|
||||||
|
log.Warnw("failed to decode provecommit params", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
sn = proveCommitSector.SectorNumber
|
||||||
|
|
||||||
|
// We use the parent tipset key because precommit information is removed when ProveCommitSector is executed
|
||||||
|
precommitChainInfo, err := r.api.StateSectorPreCommitInfo(ctx, m.To, sn, tipset.Parents())
|
||||||
|
if err != nil {
|
||||||
|
log.Warnw("failed to get precommit info for sector", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", sn)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
precommitTipset, err := r.api.ChainGetTipSetByHeight(ctx, precommitChainInfo.PreCommitEpoch, tipset.Key())
|
||||||
|
if err != nil {
|
||||||
|
log.Warnf("failed to lookup precommit epoch", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", sn)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
collateral, err := r.api.StateMinerInitialPledgeCollateral(ctx, m.To, precommitChainInfo.Info, precommitTipset.Key())
|
||||||
|
if err != nil {
|
||||||
|
log.Warnw("failed to get initial pledge collateral", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", sn)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
collateral = big.Sub(collateral, precommitChainInfo.PreCommitDeposit)
|
||||||
|
if collateral.LessThan(big.Zero()) {
|
||||||
|
log.Debugw("skipping zero pledge collateral difference", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", sn)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
refundValue = collateral
|
||||||
|
if r.refundPercent > 0 {
|
||||||
|
refundValue = types.BigMul(types.BigDiv(refundValue, types.NewInt(100)), types.NewInt(uint64(r.refundPercent)))
|
||||||
|
}
|
||||||
|
case builtin.MethodsMiner.PreCommitSector:
|
||||||
|
if !r.preCommitEnabled {
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
messageMethod = "PreCommitSector"
|
||||||
|
|
||||||
|
if recp.ExitCode != exitcode.Ok {
|
||||||
|
log.Debugw("skipping non-ok exitcode message", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "exitcode", recp.ExitCode)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
if m.GasFeeCap.GreaterThan(r.preFeeCapMax) {
|
||||||
|
log.Debugw("skipping high fee cap message", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "gas_fee_cap", m.GasFeeCap, "fee_cap_max", r.preFeeCapMax)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var precommitInfo miner.SectorPreCommitInfo
|
||||||
|
if err := precommitInfo.UnmarshalCBOR(bytes.NewBuffer(m.Params)); err != nil {
|
||||||
|
log.Warnw("failed to decode precommit params", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
collateral, err := r.api.StateMinerInitialPledgeCollateral(ctx, m.To, precommitInfo, tipset.Key())
|
||||||
|
if err != nil {
|
||||||
|
log.Warnw("failed to calculate initial pledge collateral", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", precommitInfo.SectorNumber)
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
refundValue = collateral
|
||||||
|
if r.refundPercent > 0 {
|
||||||
|
refundValue = types.BigMul(types.BigDiv(refundValue, types.NewInt(100)), types.NewInt(uint64(r.refundPercent)))
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
return false, messageMethod, types.NewInt(0), nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return true, messageMethod, refundValue, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (r *refunder) ProcessTipset(ctx context.Context, tipset *types.TipSet, refunds *MinersRefund) (*MinersRefund, error) {
|
func (r *refunder) ProcessTipset(ctx context.Context, tipset *types.TipSet, refunds *MinersRefund) (*MinersRefund, error) {
|
||||||
cids := tipset.Cids()
|
cids := tipset.Cids()
|
||||||
if len(cids) == 0 {
|
if len(cids) == 0 {
|
||||||
@ -850,91 +1036,30 @@ func (r *refunder) ProcessTipset(ctx context.Context, tipset *types.TipSet, refu
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if !a.IsStorageMinerActor() {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
var messageMethod string
|
var messageMethod string
|
||||||
|
|
||||||
switch m.Method {
|
if m.To == builtin.StorageMarketActorAddr {
|
||||||
case builtin.MethodsMiner.ProveCommitSector:
|
var err error
|
||||||
if !r.proveCommitEnabled {
|
var processed bool
|
||||||
continue
|
processed, messageMethod, refundValue, err = r.processTipsetStorageMarketActor(ctx, tipset, msg, recps[i])
|
||||||
}
|
|
||||||
|
|
||||||
messageMethod = "ProveCommitSector"
|
|
||||||
|
|
||||||
if recps[i].ExitCode != exitcode.Ok {
|
|
||||||
log.Debugw("skipping non-ok exitcode message", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "exitcode", recps[i].ExitCode)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
var sn abi.SectorNumber
|
|
||||||
|
|
||||||
var proveCommitSector miner0.ProveCommitSectorParams
|
|
||||||
if err := proveCommitSector.UnmarshalCBOR(bytes.NewBuffer(m.Params)); err != nil {
|
|
||||||
log.Warnw("failed to decode provecommit params", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
sn = proveCommitSector.SectorNumber
|
|
||||||
|
|
||||||
// We use the parent tipset key because precommit information is removed when ProveCommitSector is executed
|
|
||||||
precommitChainInfo, err := r.api.StateSectorPreCommitInfo(ctx, m.To, sn, tipset.Parents())
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warnw("failed to get precommit info for sector", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", sn)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if !processed {
|
||||||
precommitTipset, err := r.api.ChainGetTipSetByHeight(ctx, precommitChainInfo.PreCommitEpoch, tipset.Key())
|
|
||||||
if err != nil {
|
|
||||||
log.Warnf("failed to lookup precommit epoch", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", sn)
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
collateral, err := r.api.StateMinerInitialPledgeCollateral(ctx, m.To, precommitChainInfo.Info, precommitTipset.Key())
|
|
||||||
if err != nil {
|
|
||||||
log.Warnw("failed to get initial pledge collateral", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", sn)
|
|
||||||
}
|
|
||||||
|
|
||||||
collateral = big.Sub(collateral, precommitChainInfo.PreCommitDeposit)
|
|
||||||
if collateral.LessThan(big.Zero()) {
|
|
||||||
log.Debugw("skipping zero pledge collateral difference", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", sn)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
refundValue = collateral
|
|
||||||
case builtin.MethodsMiner.PreCommitSector:
|
|
||||||
if !r.preCommitEnabled {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
messageMethod = "PreCommitSector"
|
|
||||||
|
|
||||||
if recps[i].ExitCode != exitcode.Ok {
|
|
||||||
log.Debugw("skipping non-ok exitcode message", "method", messageMethod, "cid", msg.Cid, "miner", m.To, "exitcode", recps[i].ExitCode)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
var precommitInfo miner.SectorPreCommitInfo
|
|
||||||
if err := precommitInfo.UnmarshalCBOR(bytes.NewBuffer(m.Params)); err != nil {
|
|
||||||
log.Warnw("failed to decode precommit params", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
collateral, err := r.api.StateMinerInitialPledgeCollateral(ctx, m.To, precommitInfo, tipset.Key())
|
|
||||||
if err != nil {
|
|
||||||
log.Warnw("failed to calculate initial pledge collateral", "err", err, "method", messageMethod, "cid", msg.Cid, "miner", m.To, "sector_number", precommitInfo.SectorNumber)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
refundValue = collateral
|
|
||||||
default:
|
|
||||||
continue
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.refundPercent > 0 {
|
if a.IsStorageMinerActor() {
|
||||||
refundValue = types.BigMul(types.BigDiv(refundValue, types.NewInt(100)), types.NewInt(uint64(r.refundPercent)))
|
var err error
|
||||||
|
var processed bool
|
||||||
|
processed, messageMethod, refundValue, err = r.processTipsetStorageMinerActor(ctx, tipset, msg, recps[i])
|
||||||
|
if err != nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
if !processed {
|
||||||
|
continue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Debugw(
|
log.Debugw(
|
||||||
|
Loading…
Reference in New Issue
Block a user