Skip to content

Commit 042a19c

Browse files
authored
FIP-0045: update to match deployed types (#961)
* Many of the type fields marked as Address in here were launched in nv9 as ActorID. * AllocationRequest and ClaimExtensionRequest went live in nv9 with Provider as Address but in nv10 switched to ActorID. * ClaimExtensionRequest was never adjusted in go-state-types to ActorID so has been unable to successfully parse or pass on these to builtin-actors. ExtendClaimTerms appears to have been the only mechanism used to extend claim terms since this FIP. * Minor: updated all epoch fields to match within this FIP, I chose to use int64 which is the base type used in implementations. * Add missing docs for AllocationRequest and ClaimExtensionRequest fields. * Added historical notes section.
1 parent 35e89b2 commit 042a19c

File tree

1 file changed

+47
-21
lines changed

1 file changed

+47
-21
lines changed

FIPS/fip-0045.md

+47-21
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,21 @@ built-in storage market (or any future market).
8484
```
8585
struct Allocation {
8686
// The verified client which allocated the DataCap.
87-
Client: Address
87+
Client: ActorID
8888
// The provider (miner actor) which may claim the allocation.
89-
Provider: Address
89+
Provider: ActorID
9090
// Identifier of the data to be committed.
9191
Data: CID
9292
// The (padded) size of data.
9393
Size: uint64
9494
// The minimum duration which the provider must commit to storing the piece to avoid
9595
// early-termination penalties (epochs).
96-
TermMinimum: uint64
96+
TermMinimum: int64
9797
// The maximum period for which a provider can earn quality-adjusted power
9898
// for the piece (epochs).
99-
TermMaximum: uint64
99+
TermMaximum: int64
100100
// The latest epoch by which a provider must commit data before the allocation expires.
101-
Expiration: Epoch
101+
Expiration: int64
102102
// Whether the provider can commit the data in multiple pieces.
103103
// This is initially un-used, but supports allocations larger than a full sector in the future.
104104
AllowRanges: bool
@@ -129,7 +129,7 @@ struct State {
129129
130130
// Allocations indexed by client, then by ID.
131131
Allocations: HAMT[Address]HAMT[AllocationID]Allocation
132-
132+
133133
// Sequence number for allocation IDs.
134134
// The value `0` is reserved for "no allocation"
135135
NextAllocationId: AllocationID // uint64
@@ -150,7 +150,7 @@ The verified registry provides a new method to process removals, replacing `Rest
150150

151151
```
152152
struct RemoveExpiredAllocationsParams {
153-
Client: Address // client to clean up (need not be the caller)
153+
Client: ActorID // client to clean up (need not be the caller)
154154
AllocationIDs: []AllocationID // empty for "all", or specify a set
155155
}
156156
@@ -190,19 +190,19 @@ data, and corresponding benefit of incentivized storage power.
190190
```
191191
struct Claim {
192192
// The provider storing the data (from allocation).
193-
Provider: Address
193+
Provider: ActorID
194194
// The client which allocated the DataCap (from allocation).
195-
Client: Address
195+
Client: ActorID
196196
// Identifier of the data committed (from allocation).
197197
Data: CID
198198
// The (padded) size of data (from allocation).
199199
Size: uint64
200200
// The minimum period which the provider must commit to storing the piece (from allocation).
201-
TermMinimum: uint64
201+
TermMinimum: int64
202202
// The maximum period for which the provider can earn QA-power for the piece (from allocation).
203-
TermMaximum: uint64
203+
TermMaximum: int64
204204
// The epoch at which the (first range of the) piece was committed.
205-
TermStart: uint64
205+
TermStart: int64
206206
// ID of the provider's sector in which the data is committed.
207207
Sector uint64
208208
}
@@ -229,7 +229,7 @@ data cap tokens from its balance.
229229
```
230230
struct SectorAllocationClaim {
231231
// Client of the allocation being claimed.
232-
Client: Address
232+
Client: ActorID
233233
// The allocation being claimed.
234234
AllocationID: AllocationID
235235
// The piece data committed (either the allocations data, or a part of it).
@@ -266,7 +266,7 @@ The record of a claim may be removed after the term maximum has elapsed.
266266

267267
```
268268
struct RemoveExpiredClaimsParams {
269-
Provider: Address // provider to clean up (need not be the caller)
269+
Provider: ActorID // provider to clean up (need not be the caller)
270270
ClaimIDs: []ClaimID // empty for "all", or specify a set
271271
}
272272
@@ -292,7 +292,7 @@ A client of a claim may increase its maximum term up to `MaximumVerifiedAllocati
292292

293293
```
294294
struct ClaimTerm {
295-
Provider: Address // needed to find claim in state
295+
Provider: ActorID // needed to find claim in state
296296
ClaimID: ClaimID
297297
TermMaximum: int64 // new duration in epochs from TermStart
298298
}
@@ -379,19 +379,35 @@ The registry rejects the transfer if the sum of sizes does not match the amount
379379
// A request to create an allocation with datacap tokens.
380380
// Field semantics match the Allocation structure.
381381
struct AllocationRequest {
382-
Provider: Address
382+
// The provider (miner actor) which may claim the allocation.
383+
// (Historical note: network version 17 introduced this type with an Address for this field but
384+
// it was switched to an ActorID for network version 18 and later.)
385+
Provider: ActorID
386+
// Identifier of the data to be committed.
383387
Data: Cid
388+
// The (padded) size of data.
384389
Size: PaddedPieceSize
385-
TermMin: ChainEpoch
386-
TermMax: ChainEpoch
387-
Expiration: ChainEpoch
390+
// The minimum duration which the provider must commit to storing the piece to avoid
391+
// early-termination penalties (epochs).
392+
TermMin: int64
393+
// The maximum period for which a provider can earn quality-adjusted power
394+
// for the piece (epochs).
395+
TermMax: int64
396+
// The latest epoch by which a provider must commit data before the allocation expires.
397+
Expiration: int64
388398
}
389399
390400
// A request to extend the term of an existing claim with datacap tokens.
391401
struct ClaimExtensionRequest {
392-
Provider: Address
402+
// The provider (miner actor) which may claim the allocation.
403+
// (Historical note: network version 17 introduced this type with an Address for this field but
404+
// it was switched to an ActorID for network version 18 and later.)
405+
Provider: ActorID
406+
// Identifier of the claim to be extended.
393407
Claim: ClaimID
394-
TermMax: ChainEpoch
408+
// The new maximum period for which a provider can earn quality-adjusted power
409+
// for the piece (epochs).
410+
TermMax: int64
395411
}
396412
397413
// Operator-data payload for a datacap token transfer receiver hook.
@@ -854,5 +870,15 @@ will then grant maximal per-byte quality-adjusted power for the sector's full li
854870
Implementation is in progress on the `decouple-fil+` branch of the built-in actors repository:
855871
https://github.com/filecoin-project/builtin-actors/tree/decouple-fil+.
856872

873+
## Historical notes
874+
875+
This FIP was originally accepted with "Address" in most places where "ActorID" is now used within
876+
the types in this document. However, these were implemented and launched in network version 17 as
877+
ActorID.
878+
879+
Both `ClaimExtensionRequest` and `AllocationRequest` were originally defined with an `Address` field
880+
for the provider and this remained in the implementation for network version 17. However, this was
881+
changed to `ActorID` for network version 18 and later.
882+
857883
## Copyright
858884
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).

0 commit comments

Comments
 (0)