Skip to content

move_package: make GetPackage at_checkpoint fail closed above the indexed tip - #35

Merged
bmwill merged 2 commits into
MystenLabs:mainfrom
nickvikeras:nickv/at-checkpoint-doc
Sep 21, 2026
Merged

bmwill merged 2 commits into
MystenLabs:mainfrom
nickvikeras:nickv/at-checkpoint-doc

Conversation

@nickvikeras

@nickvikeras nickvikeras commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Description

GetPackageResponse.Package carries no checkpoint, so a client asking for at_checkpoint = N that silently receives the "latest known" version has no way to tell the answer is not exact as of N, and can persist wrong lineage data downstream. Reword the at_checkpoint contract to fail closed: the bound must be at or below the server's highest indexed checkpoint, and larger values are NOT_FOUND.

Also fixes the package_id doc, which described the lineage lookup as version-only although at_checkpoint uses it too.

Implementation on both backends: MystenLabs/sui#27762. SDK vendoring follows in sui-rust-sdk.

Second commit: EndOfEpochTransactionKind.FORWARDING_ADDRESS_REGISTRY_CREATE = 14 was added only to sui-rust-sdk's vendored copy (MystenLabs/sui-rust-sdk#288) and never landed here; a full make update-protos in the SDK would silently drop it. Syncs transaction.proto to the SDK copy.

Test plan

Doc-only; buf format and buf lint clean.

@nickvikeras
nickvikeras marked this pull request as ready for review September 21, 2026 18:35
@nickvikeras
nickvikeras requested a review from bmwill as a code owner September 21, 2026 18:35
@bmwill
bmwill merged commit 187995d into MystenLabs:main Sep 21, 2026
1 check passed
nickvikeras added a commit to MystenLabs/sui that referenced this pull request Sep 23, 2026
## Description 

Extend `MovePackageService.GetPackage` so that graphql can move to grpc
and deprecate `kv_packages` on postgres

Calling with package_id still fetches the exact package.

Additionally, only one of the two can be provided:
- version: return the lineage's package at exactly this version.
- at_checkpoint: return the latest lineage package that existed at or
before this checkpoint. The bound must be at or below the highest
checkpoint the server has indexed; larger values are `NOT_FOUND` rather
than clamped, so a successful answer is exact as of that checkpoint
(`Package` carries no checkpoint, so a client could not detect a clamped
answer). Contract docs: MystenLabs/sui-apis#35,
MystenLabs/sui-rust-sdk#315.

Implement on sui-rpc-api and sui-kv-rpc

MystenLabs/sui-rust-sdk#305

## Test plan 

unit tests in relevant files and e2e tests

---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] Indexing Framework:

---------

Co-authored-by: Nick <nickvikeras@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants