diff --git a/actors/builtin/power/power_test.go b/actors/builtin/power/power_test.go index d0946a138..2712e07f7 100644 --- a/actors/builtin/power/power_test.go +++ b/actors/builtin/power/power_test.go @@ -330,8 +330,8 @@ func TestPowerAndPledgeAccounting(t *testing.T) { proof abi.RegisteredPoStProof expectedMiners int64 }{{ - proof: abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, // 2K sectors have zero consensus minimum - expectedMiners: 1, + proof: abi.RegisteredPoStProof_StackedDrgWindow2KiBV1, + expectedMiners: 0, }, { proof: abi.RegisteredPoStProof_StackedDrgWindow32GiBV1, expectedMiners: 0, @@ -411,7 +411,7 @@ func TestPowerAndPledgeAccounting(t *testing.T) { actor.checkState(rt) }) - t.Run("consensus minimum power depends on proof type", func(t *testing.T) { + t.Run("power gets added when miner crosses minPower but not before", func(t *testing.T) { // Setup four miners above threshold rt := builder.Build(t) actor.constructAndVerify(rt) @@ -431,21 +431,16 @@ func TestPowerAndPledgeAccounting(t *testing.T) { expectedTotal := mul(powerUnit, 4) actor.expectTotalPowerEager(rt, expectedTotal, expectedTotal) - // miner 5 uses 64GiB sectors and has a higher minimum - actor.createMiner(rt, owner, owner, miner5, tutil.NewActorAddr(t, "m5"), abi.PeerID("m5"), - nil, abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, big.Zero()) - - power64Unit, err := builtin.ConsensusMinerMinPower(abi.RegisteredPoStProof_StackedDrgWindow64GiBV1) - require.NoError(t, err) - assert.True(t, power64Unit.GreaterThan(powerUnit)) + actor.createMinerBasic(rt, owner, owner, miner5) + belowLimitUnit := big.Div(powerUnit, big.NewInt(2)) // below limit actors power is not added - actor.updateClaimedPower(rt, miner5, powerUnit, powerUnit) + actor.updateClaimedPower(rt, miner5, belowLimitUnit, belowLimitUnit) actor.expectMinersAboveMinPower(rt, 4) actor.expectTotalPowerEager(rt, expectedTotal, expectedTotal) // just below limit - delta := big.Subtract(power64Unit, powerUnit, big.NewInt(1)) + delta := big.Subtract(powerUnit, belowLimitUnit, big.NewInt(1)) actor.updateClaimedPower(rt, miner5, delta, delta) actor.expectMinersAboveMinPower(rt, 4) actor.expectTotalPowerEager(rt, expectedTotal, expectedTotal) @@ -453,7 +448,7 @@ func TestPowerAndPledgeAccounting(t *testing.T) { // at limit power is added actor.updateClaimedPower(rt, miner5, big.NewInt(1), big.NewInt(1)) actor.expectMinersAboveMinPower(rt, 5) - newExpectedTotal := big.Add(expectedTotal, power64Unit) + newExpectedTotal := big.Add(expectedTotal, powerUnit) actor.expectTotalPowerEager(rt, newExpectedTotal, newExpectedTotal) actor.checkState(rt) }) diff --git a/actors/builtin/sector.go b/actors/builtin/sector.go index 049b723f4..5771ba945 100644 --- a/actors/builtin/sector.go +++ b/actors/builtin/sector.go @@ -98,15 +98,15 @@ type PoStProofPolicy struct { var PoStProofPolicies = map[stabi.RegisteredPoStProof]*PoStProofPolicy{ stabi.RegisteredPoStProof_StackedDrgWindow2KiBV1: { WindowPoStPartitionSectors: 2, - ConsensusMinerMinPower: stabi.NewStoragePower(0), + ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow8MiBV1: { WindowPoStPartitionSectors: 2, - ConsensusMinerMinPower: stabi.NewStoragePower(16 << 20), + ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow512MiBV1: { WindowPoStPartitionSectors: 2, - ConsensusMinerMinPower: stabi.NewStoragePower(1 << 30), + ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, stabi.RegisteredPoStProof_StackedDrgWindow32GiBV1: { WindowPoStPartitionSectors: 2349, @@ -114,7 +114,7 @@ var PoStProofPolicies = map[stabi.RegisteredPoStProof]*PoStProofPolicy{ }, stabi.RegisteredPoStProof_StackedDrgWindow64GiBV1: { WindowPoStPartitionSectors: 2300, - ConsensusMinerMinPower: stabi.NewStoragePower(20 << 40), + ConsensusMinerMinPower: stabi.NewStoragePower(10 << 40), }, // Winning PoSt proof types omitted. } diff --git a/actors/states/election_test.go b/actors/states/election_test.go index a148201d5..b6aba8ee5 100644 --- a/actors/states/election_test.go +++ b/actors/states/election_test.go @@ -118,13 +118,6 @@ func TestMinerEligibleAtLookback(t *testing.T) { power: pow32GiBMin, eligible: true, }, { - // bigger sector size requires higher minimum - consensusMiners: power.ConsensusMinerMinMiners, - minerProof: abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, - power: pow32GiBMin, - eligible: false, - }, { - // bigger sector size requires higher minimum consensusMiners: power.ConsensusMinerMinMiners, minerProof: abi.RegisteredPoStProof_StackedDrgWindow64GiBV1, power: pow64GiBMin,