Calculate depositMinimum for upgrading as replaced sector's Initialpledge
This commit is contained in:
parent
98f00b510f
commit
7de7e65dbc
2
extern/storage-sealing/states_sealing.go
vendored
2
extern/storage-sealing/states_sealing.go
vendored
@ -205,7 +205,7 @@ func (m *Sealing) handlePreCommitting(ctx statemachine.Context, sector SectorInf
|
||||
log.Infof("submitting precommit for sector %d (deposit: %s): ", sector.SectorNumber, deposit)
|
||||
mcid, err := m.api.SendMsg(ctx.Context(), waddr, m.maddr, builtin.MethodsMiner.PreCommitSector, deposit, m.feeCfg.MaxPreCommitGasFee, enc.Bytes())
|
||||
if err != nil {
|
||||
if params.ReplaceSectorDeadline > 0 {
|
||||
if params.ReplaceCapacity {
|
||||
m.remarkForUpgrade(params.ReplaceSectorNumber)
|
||||
}
|
||||
return ctx.Send(SectorChainPreCommitFailed{xerrors.Errorf("pushing message to mpool: %w", err)})
|
||||
|
10
extern/storage-sealing/upgrade_queue.go
vendored
10
extern/storage-sealing/upgrade_queue.go
vendored
@ -57,18 +57,18 @@ func (m *Sealing) tryUpgradeSector(ctx context.Context, params *miner.SectorPreC
|
||||
params.ReplaceSectorDeadline = loc.Deadline
|
||||
params.ReplaceSectorPartition = loc.Partition
|
||||
|
||||
ri, err := m.GetSectorInfo(*replace)
|
||||
ri, err := m.api.StateSectorGetInfo(ctx, m.maddr, *replace, nil)
|
||||
if err != nil {
|
||||
log.Errorf("error calling GetSectorInfo for replaced sector: %+v", err)
|
||||
log.Errorf("error calling StateSectorGetInfo for replaced sector: %+v", err)
|
||||
return big.Zero()
|
||||
}
|
||||
|
||||
if params.Expiration < ri.PreCommitInfo.Expiration {
|
||||
if params.Expiration < ri.Expiration {
|
||||
// TODO: Some limit on this
|
||||
params.Expiration = ri.PreCommitInfo.Expiration
|
||||
params.Expiration = ri.Expiration
|
||||
}
|
||||
|
||||
return ri.PreCommitDeposit
|
||||
return ri.InitialPledge
|
||||
}
|
||||
|
||||
return big.Zero()
|
||||
|
Loading…
Reference in New Issue
Block a user