Skip to main content

unknown_package_response

Function unknown_package_response 

Source
pub fn unknown_package_response(
    request: &ListPackageVersionsRequest,
    highest_indexed: u64,
) -> Result<ListPackageVersionsResponse>
Expand description

The answer to a request in cursor mode for a package the server does not know as of highest_indexed, the highest checkpoint it has indexed (kv-rpc: its served height): no version of it was published at or below that checkpoint. Public so other implementors of MovePackageService answer such requests the same way. Check the request’s checkpoint range with check_checkpoint_range first.

A first page, with neither after nor before, is NotFound, as GetPackage answers. A request with a cursor minted above highest_indexed (see PackageVersionCursor) continues a listing from a replica ahead of this server, which may know a package published since; it is answered as a listing of a lineage with no version at this server’s height, in which every cursor lies past the tip: a descending listing whose range reaches past the tip is OutOfRange (ABOVE_LATEST_AVAILABLE, bound “cursor”, at the highest checkpoint a cursor was minted at), and every other listing is an empty page ending as PackageVersionsQuery::end_reason ends one, LEDGER_TIP ascending without a closer bound. The response has no cursor field, so the client resumes with its own. With every cursor minted at or below highest_indexed, the minting server did not know the package either, or the cursor is forged, and the request is NotFound. The cursors are validated first, as for a package the server knows: they must name one lineage, though whether it is the requested package’s cannot be checked without the package.