Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 89 additions & 17 deletions builtin/v16/miner/cbor_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions builtin/v16/miner/deadline_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"golang.org/x/xerrors"

"github.com/filecoin-project/go-bitfield"
abi "github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
"github.com/filecoin-project/go-state-types/builtin/v16/util/adt"
xc "github.com/filecoin-project/go-state-types/exitcode"
Expand Down Expand Up @@ -76,6 +77,14 @@ type Deadline struct {
// These proofs may be disputed via DisputeWindowedPoSt. Successfully
// disputed window PoSts are removed from the snapshot.
OptimisticPoStSubmissionsSnapshot cid.Cid

// Memoized sum of all non-terminated power in partitions, including active, faulty, and
// unproven. Used to cap the daily fee as a proportion of expected block reward.
LivePower PowerPair

// Memoized sum of daily fee payable to the network for the active sectors
// in this deadline.
DailyFee abi.TokenAmount
}

type WindowedPoSt struct {
Expand Down
2 changes: 1 addition & 1 deletion builtin/v16/miner/invariants.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func CheckStateInvariants(st *State, store adt.Store, balance abi.TokenAmount) (
acc.Require(allocated,
"on chain sector's sector number has not been allocated %d", sno)

for _, dealID := range sector.DealIDs {
for _, dealID := range sector.DeprecatedDealIDs {
minerSummary.Deals[dealID] = DealSummary{
SectorStart: sector.Activation,
SectorExpiration: sector.Expiration,
Expand Down
15 changes: 14 additions & 1 deletion builtin/v16/miner/miner_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ type SectorOnChainInfo struct {
SectorNumber abi.SectorNumber
SealProof abi.RegisteredSealProof // The seal proof type implies the PoSt proof/s
SealedCID cid.Cid // CommR
DealIDs []abi.DealID
DeprecatedDealIDs []abi.DealID
Activation abi.ChainEpoch // Epoch during which the sector proof was accepted
Expiration abi.ChainEpoch // Epoch during which the sector expires
DealWeight abi.DealWeight // Integral of active deals over sector lifetime
Expand All @@ -181,6 +181,19 @@ type SectorOnChainInfo struct {
ReplacedDayReward abi.TokenAmount // Day reward of this sector before its power was most recently updated
SectorKeyCID *cid.Cid // The original SealedSectorCID, only gets set on the first ReplicaUpdate
Flags SectorOnChainInfoFlags // Additional flags
// The total fee payable per day for this sector. The value of this field is set at the time of
// sector activation, extension and whenever a sector's QAP is changed. This fee is payable for
// the lifetime of the sector and is aggregated in the deadline's `daily_fee` field.
//
// This field is not included in the serialised form of the struct prior to the activation of
// FIP-0100, and is added as the 16th element of the array after that point only for new sectors
// or sectors that are updated after that point. For old sectors, the value of this field will
// always be zero.
//
// This field is OPTIONAL, meaning that it may present as a nil BigInt (not a nil pointer).
// If FeeDeduction.Nil() then it should be treated the same as if it were zero (but cannot be
// used in place of a zero value).
DailyFee abi.TokenAmount `cborgen:"optional"`
}

func (st *State) GetInfo(store adt.Store) (*MinerInfo, error) {
Expand Down
7 changes: 7 additions & 0 deletions builtin/v16/miner/miner_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,13 @@ type ExpirationSet struct {
OnTimePledge abi.TokenAmount // Pledge total for the on-time sectors
ActivePower PowerPair // Power that is currently active (not faulty)
FaultyPower PowerPair // Power that is currently faulty
// Adjustment to the daily fee recorded for the deadline associated with this expiration set
// to account for expiring sectors.
//
// This field is OPTIONAL, meaning that it may present as a nil BigInt (not a nil pointer).
// If FeeDeduction.Nil() then it should be treated the same as if it were zero (but cannot be
// used in place of a zero value).
FeeDeduction abi.TokenAmount `cborgen:"optional"`
}

// A queue of expiration sets by epoch, representing the on-time or early termination epoch for a collection of sectors.
Expand Down
Loading
Loading