Merge pull request #4190 from filecoin-project/asr/post-lookback-finality
Set WinningPoStSectorSetLookback to finality post-v2 actors
This commit is contained in:
commit
0edecbd043
@ -56,8 +56,6 @@ const SealRandomnessLookback = policy.SealRandomnessLookback
|
|||||||
// Epochs
|
// Epochs
|
||||||
const TicketRandomnessLookback = abi.ChainEpoch(1)
|
const TicketRandomnessLookback = abi.ChainEpoch(1)
|
||||||
|
|
||||||
const WinningPoStSectorSetLookback = abi.ChainEpoch(10)
|
|
||||||
|
|
||||||
// /////
|
// /////
|
||||||
// Address
|
// Address
|
||||||
|
|
||||||
|
@ -51,7 +51,6 @@ var (
|
|||||||
SealRandomnessLookback = policy.SealRandomnessLookback
|
SealRandomnessLookback = policy.SealRandomnessLookback
|
||||||
|
|
||||||
TicketRandomnessLookback = abi.ChainEpoch(1)
|
TicketRandomnessLookback = abi.ChainEpoch(1)
|
||||||
WinningPoStSectorSetLookback = abi.ChainEpoch(10)
|
|
||||||
|
|
||||||
FilBase uint64 = 2_000_000_000
|
FilBase uint64 = 2_000_000_000
|
||||||
FilAllocStorageMining uint64 = 1_400_000_000
|
FilAllocStorageMining uint64 = 1_400_000_000
|
||||||
|
@ -106,3 +106,11 @@ func SetWPoStChallengeWindow(period abi.ChainEpoch) {
|
|||||||
miner2.WPoStChallengeWindow = period
|
miner2.WPoStChallengeWindow = period
|
||||||
miner2.WPoStProvingPeriod = period * abi.ChainEpoch(miner2.WPoStPeriodDeadlines)
|
miner2.WPoStProvingPeriod = period * abi.ChainEpoch(miner2.WPoStPeriodDeadlines)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetWinningPoStSectorSetLookback(nwVer network.Version) abi.ChainEpoch {
|
||||||
|
if nwVer <= network.Version3 {
|
||||||
|
return 10
|
||||||
|
}
|
||||||
|
|
||||||
|
return ChainFinality
|
||||||
|
}
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/filecoin-project/go-state-types/big"
|
"github.com/filecoin-project/go-state-types/big"
|
||||||
|
|
||||||
"github.com/filecoin-project/go-state-types/network"
|
"github.com/filecoin-project/go-state-types/network"
|
||||||
|
"github.com/filecoin-project/lotus/chain/actors/policy"
|
||||||
|
|
||||||
cid "github.com/ipfs/go-cid"
|
cid "github.com/ipfs/go-cid"
|
||||||
cbg "github.com/whyrusleeping/cbor-gen"
|
cbg "github.com/whyrusleeping/cbor-gen"
|
||||||
@ -29,7 +30,6 @@ import (
|
|||||||
exported2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/exported"
|
exported2 "github.com/filecoin-project/specs-actors/v2/actors/builtin/exported"
|
||||||
|
|
||||||
"github.com/filecoin-project/lotus/api"
|
"github.com/filecoin-project/lotus/api"
|
||||||
"github.com/filecoin-project/lotus/build"
|
|
||||||
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
init_ "github.com/filecoin-project/lotus/chain/actors/builtin/init"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
|
"github.com/filecoin-project/lotus/chain/actors/builtin/market"
|
||||||
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
"github.com/filecoin-project/lotus/chain/actors/builtin/miner"
|
||||||
@ -413,8 +413,9 @@ func ComputeState(ctx context.Context, sm *StateManager, height abi.ChainEpoch,
|
|||||||
|
|
||||||
func GetLookbackTipSetForRound(ctx context.Context, sm *StateManager, ts *types.TipSet, round abi.ChainEpoch) (*types.TipSet, error) {
|
func GetLookbackTipSetForRound(ctx context.Context, sm *StateManager, ts *types.TipSet, round abi.ChainEpoch) (*types.TipSet, error) {
|
||||||
var lbr abi.ChainEpoch
|
var lbr abi.ChainEpoch
|
||||||
if round > build.WinningPoStSectorSetLookback {
|
lb := policy.GetWinningPoStSectorSetLookback(sm.GetNtwkVersion(ctx, round))
|
||||||
lbr = round - build.WinningPoStSectorSetLookback
|
if round > lb {
|
||||||
|
lbr = round - lb
|
||||||
}
|
}
|
||||||
|
|
||||||
// more null blocks than our lookback
|
// more null blocks than our lookback
|
||||||
|
Loading…
Reference in New Issue
Block a user