Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIP-0045: update to match deployed types #961

Merged
merged 2 commits into from
Mar 19, 2024
Merged
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
68 changes: 47 additions & 21 deletions FIPS/fip-0045.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,21 @@ built-in storage market (or any future market).
```
struct Allocation {
// The verified client which allocated the DataCap.
Client: Address
Client: ActorID
// The provider (miner actor) which may claim the allocation.
Provider: Address
Provider: ActorID
// Identifier of the data to be committed.
Data: CID
// The (padded) size of data.
Size: uint64
// The minimum duration which the provider must commit to storing the piece to avoid
// early-termination penalties (epochs).
TermMinimum: uint64
TermMinimum: int64
// The maximum period for which a provider can earn quality-adjusted power
// for the piece (epochs).
TermMaximum: uint64
TermMaximum: int64
// The latest epoch by which a provider must commit data before the allocation expires.
Expiration: Epoch
Expiration: int64
// Whether the provider can commit the data in multiple pieces.
// This is initially un-used, but supports allocations larger than a full sector in the future.
AllowRanges: bool
Expand Down Expand Up @@ -129,7 +129,7 @@ struct State {

// Allocations indexed by client, then by ID.
Allocations: HAMT[Address]HAMT[AllocationID]Allocation

// Sequence number for allocation IDs.
// The value `0` is reserved for "no allocation"
NextAllocationId: AllocationID // uint64
Expand All @@ -150,7 +150,7 @@ The verified registry provides a new method to process removals, replacing `Rest

```
struct RemoveExpiredAllocationsParams {
Client: Address // client to clean up (need not be the caller)
Client: ActorID // client to clean up (need not be the caller)
AllocationIDs: []AllocationID // empty for "all", or specify a set
}

Expand Down Expand Up @@ -190,19 +190,19 @@ data, and corresponding benefit of incentivized storage power.
```
struct Claim {
// The provider storing the data (from allocation).
Provider: Address
Provider: ActorID
// The client which allocated the DataCap (from allocation).
Client: Address
Client: ActorID
// Identifier of the data committed (from allocation).
Data: CID
// The (padded) size of data (from allocation).
Size: uint64
// The minimum period which the provider must commit to storing the piece (from allocation).
TermMinimum: uint64
TermMinimum: int64
// The maximum period for which the provider can earn QA-power for the piece (from allocation).
TermMaximum: uint64
TermMaximum: int64
// The epoch at which the (first range of the) piece was committed.
TermStart: uint64
TermStart: int64
// ID of the provider's sector in which the data is committed.
Sector uint64
}
Expand All @@ -229,7 +229,7 @@ data cap tokens from its balance.
```
struct SectorAllocationClaim {
// Client of the allocation being claimed.
Client: Address
Client: ActorID
// The allocation being claimed.
AllocationID: AllocationID
// The piece data committed (either the allocations data, or a part of it).
Expand Down Expand Up @@ -266,7 +266,7 @@ The record of a claim may be removed after the term maximum has elapsed.

```
struct RemoveExpiredClaimsParams {
Provider: Address // provider to clean up (need not be the caller)
Provider: ActorID // provider to clean up (need not be the caller)
ClaimIDs: []ClaimID // empty for "all", or specify a set
}

Expand All @@ -292,7 +292,7 @@ A client of a claim may increase its maximum term up to `MaximumVerifiedAllocati

```
struct ClaimTerm {
Provider: Address // needed to find claim in state
Provider: ActorID // needed to find claim in state
ClaimID: ClaimID
TermMaximum: int64 // new duration in epochs from TermStart
}
Expand Down Expand Up @@ -379,19 +379,35 @@ The registry rejects the transfer if the sum of sizes does not match the amount
// A request to create an allocation with datacap tokens.
// Field semantics match the Allocation structure.
struct AllocationRequest {
Provider: Address
// The provider (miner actor) which may claim the allocation.
// (Historical note: network version 17 introduced this type with an Address for this field but
// it was switched to an ActorID for network version 18 and later.)
Provider: ActorID
// Identifier of the data to be committed.
Data: Cid
// The (padded) size of data.
Size: PaddedPieceSize
TermMin: ChainEpoch
TermMax: ChainEpoch
Expiration: ChainEpoch
// The minimum duration which the provider must commit to storing the piece to avoid
// early-termination penalties (epochs).
TermMin: int64
// The maximum period for which a provider can earn quality-adjusted power
// for the piece (epochs).
TermMax: int64
// The latest epoch by which a provider must commit data before the allocation expires.
Expiration: int64
}

// A request to extend the term of an existing claim with datacap tokens.
struct ClaimExtensionRequest {
Provider: Address
// The provider (miner actor) which may claim the allocation.
// (Historical note: network version 17 introduced this type with an Address for this field but
// it was switched to an ActorID for network version 18 and later.)
Provider: ActorID
// Identifier of the claim to be extended.
Claim: ClaimID
TermMax: ChainEpoch
// The new maximum period for which a provider can earn quality-adjusted power
// for the piece (epochs).
TermMax: int64
}

// Operator-data payload for a datacap token transfer receiver hook.
Expand Down Expand Up @@ -854,5 +870,15 @@ will then grant maximal per-byte quality-adjusted power for the sector's full li
Implementation is in progress on the `decouple-fil+` branch of the built-in actors repository:
https://github.com/filecoin-project/builtin-actors/tree/decouple-fil+.

## Historical notes

This FIP was originally accepted with "Address" in most places where "ActorID" is now used within
the types in this document. However, these were implemented and launched in network version 17 as
ActorID.

Both `ClaimExtensionRequest` and `AllocationRequest` were originally defined with an `Address` field
for the provider and this remained in the implementation for network version 17. However, this was
changed to `ActorID` for network version 18 and later.

## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
Loading