Skip to content

Commit f9ffb9d

Browse files
committed
Add ListAllocations/ListClaims verified registry methods.
1 parent 6e29c6c commit f9ffb9d

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

FIPS/fip-0076.md

+63
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,63 @@ struct GetDealSectorReturn {
561561
}
562562
```
563563

564+
### Verified registry actor
565+
566+
The built-in verified registry actor exports FRC-0042 methods to iterate all allocations and claims.
567+
`ListAllocations` returns all allocation IDs up to some caller-specified limit,
568+
and an opaque cursor which can be used to continue the listing where the first response left off.
569+
`ListClaims` similarly returns all claim IDs up to some limit, and a cursor for continuation.
570+
The order of iteration is undefined to the caller, and will match the internal HAMT structure's ordering.
571+
A cursor is tied to the actor state from which it was generated.
572+
Clients can only assume a cursor is valid for use immediately after it is returned.
573+
574+
```
575+
// Exported API
576+
struct ListAllocationsParams {
577+
Cursor: RawBytes,
578+
Limit: u64,
579+
}
580+
581+
struct AllocationKey {
582+
Client: ActorID,
583+
ID: AllocationID,
584+
}
585+
586+
struct ListAllocationsResponse {
587+
Allocations: Vec<AllocationKey>,
588+
NextCursor: Option<RawBytes>,
589+
}
590+
591+
struct ListClaimsParams {
592+
Cursor: RawBytes,
593+
Limit: u64,
594+
}
595+
596+
struct ClaimKey {
597+
Provider: ActorID,
598+
ID: ClaimID,
599+
}
600+
601+
struct ListClaimsResponse {
602+
Claims: Vec<ClaimKey>,
603+
NextCursor: Option<RawBytes>,
604+
}
605+
```
606+
607+
A cursor is a serialized representation of the HAMT root CID, the next client/provider ID,
608+
and the next allocation/claim ID for that client/provider.
609+
A cursor is rejected with `USR_ILLEGAL_ARGUMENT` if the HAMT root does not match the verified registry state,
610+
or the IDs do not exist.
611+
612+
```
613+
// Internal structure
614+
struct Cursor {
615+
Root: Cid,
616+
OuterKey: ActorID,
617+
InnerKey: u64, // Allocation or claim ID
618+
}
619+
620+
```
564621
### Migration
565622

566623
The built-in market actor's `ProviderSectors` mapping is initialised from the existing deal state
@@ -641,6 +698,12 @@ as a side effect of publishing a deal.
641698
The reason for this change is that verified allocations and deals are independent: a client can allocate DataCap
642699
without necessarily involving the built-in market actor, and save the SP significant gas costs by doing so.
643700

701+
### Verified registry iteration APIs
702+
703+
The methods to list allocations and claims provide simpler accessibility of these structures,
704+
since in many cases they may be the only on-chain representation of a "deal".
705+
The methods are primarily intended to be invoked from off-chain, replacing direct state inspection.
706+
644707
## Backwards Compatibility
645708

646709
This proposal deprecated the miner methods `PreCommitSector` (method 6), `PreCommitSectorBatch` (method 25),

0 commit comments

Comments
 (0)