Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Change miner.Sectors AMT bitwidth to 5. Move constants to state files. #1333

Merged
merged 1 commit into from
Dec 17, 2020
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
4 changes: 4 additions & 0 deletions actors/builtin/market/market_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const (
ProviderCollateral
)

// Bitwidth of AMTs determined empirically from mutation patterns and projections of mainnet data.
const ProposalsAmtBitwidth = 5
const StatesAmtBitwidth = 6

type State struct {
Proposals cid.Cid // AMT[DealID]DealProposal
States cid.Cid // AMT[DealID]DealState
Expand Down
8 changes: 0 additions & 8 deletions actors/builtin/market/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ var DealMaxDuration = abi.ChainEpoch(540 * builtin.EpochsInDay) // PARAM_SPEC
// DealMaxLabelSize is the maximum size of a deal label.
const DealMaxLabelSize = 256

// Bitwidth of proposals AMT determined empirically from mutation patterns and
// projections of mainnet data.
const ProposalsAmtBitwidth = 5

// Bitwidth of states AMT determined empirically from mutation patterns and
// projections of mainnet data.
const StatesAmtBitwidth = 6

// Bounds (inclusive) on deal duration
func DealDurationBounds(_ abi.PaddedPieceSize) (min abi.ChainEpoch, max abi.ChainEpoch) {
return DealMinDuration, DealMaxDuration
Expand Down
3 changes: 2 additions & 1 deletion actors/builtin/miner/deadline_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ type Deadline struct {
FaultyPower PowerPair
}

const DeadlinePartitionsAmtBitwidth = 3
// Bitwidth of AMTs determined empirically from mutation patterns and projections of mainnet data.
const DeadlinePartitionsAmtBitwidth = 3 // Usually a small array
const DeadlineExpirationAmtBitwidth = 5

//
Expand Down
3 changes: 2 additions & 1 deletion actors/builtin/miner/miner_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ type State struct {
EarlyTerminations bitfield.BitField
}

// Bitwidth of AMTs determined empirically from mutation patterns and projections of mainnet data.
const PrecommitExpiryAmtBitwidth = 6
const SectorsAmtBitwidth = 6
const SectorsAmtBitwidth = 5

type MinerInfo struct {
// Account that owns this miner.
Expand Down
4 changes: 1 addition & 3 deletions actors/builtin/miner/partition_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ type Partition struct {
RecoveringPower PowerPair
}

// Bitwidth of partition expiration AMT determined empirically from mutation
// patterns and projections of mainnet data.
// Bitwidth of AMTs determined empirically from mutation patterns and projections of mainnet data.
const PartitionExpirationAmtBitwidth = 4

const PartitionEarlyTerminationArrayAmtBitwidth = 3

// Value type for a pair of raw and QA power.
Expand Down