Repository navigation
rpc: add checkpoint bounds to ListPackageVersions on the fullnode and kv-rpc - #28429
Open
nickvikeras wants to merge 1 commit into
Open
nickvikeras wants to merge 1 commit into
nickvikeras wants to merge 1 commit into
Conversation
This was referenced Oct 23, 2026
nickvikeras
force-pushed
the
nickv/object-versions-rpc
branch
2 times, most recently
from
November 3, 2026 00:46
1752a76 to
dd84d96
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 3, 2026 00:46
640f118 to
df527ee
Compare
nickvikeras
force-pushed
the
nickv/object-versions-rpc
branch
from
November 3, 2026 04:34
dd84d96 to
dd3d532
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 3, 2026 04:34
df527ee to
6f5cf19
Compare
nickvikeras
force-pushed
the
nickv/object-versions-rpc
branch
from
November 3, 2026 16:30
dd3d532 to
45e4f3f
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 3, 2026 16:30
6f5cf19 to
543aafc
Compare
nickvikeras
force-pushed
the
nickv/object-versions-rpc
branch
from
November 3, 2026 16:40
45e4f3f to
a52f497
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 3, 2026 16:40
543aafc to
c52173f
Compare
nickvikeras
force-pushed
the
nickv/object-versions-rpc
branch
from
November 4, 2026 15:26
a52f497 to
4bdc9ae
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 4, 2026 15:27
c52173f to
d3f6906
Compare
nickvikeras
force-pushed
the
nickv/object-versions-rpc
branch
from
November 4, 2026 17:00
4bdc9ae to
34ec19e
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 4, 2026 17:00
d3f6906 to
b04a6bb
Compare
nickvikeras
force-pushed
the
nickv/object-versions-rpc
branch
from
November 4, 2026 21:30
34ec19e to
5183c9d
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
2 times, most recently
from
November 4, 2026 22:38
b61575e to
b13122a
Compare
nickvikeras
changed the base branch from
nickv/object-versions-rpc
to
nickv/getpackage-bound-checks
November 4, 2026 22:38
nickvikeras
force-pushed
the
nickv/getpackage-bound-checks
branch
from
November 5, 2026 00:05
85e660e to
6bf75f5
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 5, 2026 00:05
b13122a to
54794ca
Compare
1 of 8 tasks
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 5, 2026 00:51
54794ca to
93b1d60
Compare
This was referenced Nov 5, 2026
Open
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 5, 2026 15:50
93b1d60 to
ce4c203
Compare
nickvikeras
force-pushed
the
nickv/getpackage-bound-checks
branch
2 times, most recently
from
November 5, 2026 19:20
a36789e to
1417925
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 5, 2026 19:20
ce4c203 to
ba2a79e
Compare
nickvikeras
marked this pull request as ready for review
November 5, 2026 19:25
nickvikeras
force-pushed
the
nickv/getpackage-bound-checks
branch
from
November 5, 2026 23:00
1417925 to
66c07eb
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 5, 2026 23:00
ba2a79e to
58da7ae
Compare
nickvikeras
force-pushed
the
nickv/getpackage-bound-checks
branch
from
November 6, 2026 00:47
66c07eb to
a4ee68b
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 6, 2026 00:47
58da7ae to
a99989c
Compare
nickvikeras
force-pushed
the
nickv/getpackage-bound-checks
branch
from
November 6, 2026 21:32
a4ee68b to
8b5c4a3
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
2 times, most recently
from
November 11, 2026 01:21
333b2fc to
437d9e8
Compare
nickvikeras
force-pushed
the
nickv/getpackage-bound-checks
branch
2 times, most recently
from
November 11, 2026 02:23
1ad5ebb to
757f605
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
3 times, most recently
from
November 13, 2026 11:11
e891968 to
51e5896
Compare
nickvikeras
force-pushed
the
nickv/getpackage-bound-checks
branch
2 times, most recently
from
November 14, 2026 03:01
4ee1050 to
e333d63
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
3 times, most recently
from
November 15, 2026 02:09
f363522 to
31b9436
Compare
nickvikeras
force-pushed
the
nickv/package-versions-checkpoint
branch
from
November 15, 2026 19:59
31b9436 to
ab57e7f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
GraphQL's
packageVersions,packageVersionsAfterandpackageVersionsBeforeare bounded by the checkpoint being viewed and still read Postgreskv_packagesfor it. This servesListPackageVersionsRequest.at_checkpointandPackageVersion.checkpoint(MystenLabs/sui-apis#41 on sui-apis#51; the bindings come from MystenLabs/sui-rust-sdk#341, which this PR pins) from the fullnode and kv-rpc, so they can move to gRPC. Stacked on #28573.Both backends end the ascending scan at the first version published after the bound. Errors match across them:
OUT_OF_RANGEwithErrorReasonABOVE_LATEST_AVAILABLEabove the highest indexed checkpoint,OUT_OF_RANGEwithBELOW_EARLIEST_AVAILABLEbelow the fullnode's object floor. Page tokens are unchanged.It also fixes checkpoint-pinned package reads that trusted restore rows (a package version with no publish checkpoint) too broadly:
ListPackageVersionsuses rpc: bound checkpoint-pinned reads, and report reads outside the indexed range as OUT_OF_RANGE #28577's shared bounds, so on a fork it rejects bounds below the fork checkpoint (RpcStateReader::get_lowest_checkpoint_with_index_history) instead of answering from restore rows. On a restored fullnode it returnsUNAVAILABLEwhile history is still backfilling, with or withoutat_checkpoint: until the backfill finishes, a system package's lineage lacks the versions published in the part of the window it has not reached, so even an unbounded listing would come back partial withOK.[L, T](at or below the restore checkpointT) can carry such an input, so the pipeline readsTfrom its restore state at startup and scans checkpoint inputs only up to it; pastT, and on a node that was never restored, it skips the scan.at_checkpointthat starts below the lowest version of the lineage the node stores, from version 1 or from a page token, is refused rather than answered with a history cut short.package_versionsrows outlive pruning, which deletes system-package versions replaced in place, and a restored node or a fork has no rows for the versions replaced before its history begins. The refusal followsGetPackage(rpc: serve the requested version of a system package from GetPackage #28555):UNIMPLEMENTED/NOT_SERVED_HERE(no_object_history) on nodes without object version history,INTERNALon a node that has pruned nothing (floor 0), and otherwiseOUT_OF_RANGE/BELOW_EARLIEST_AVAILABLEwithlowestAvailableCheckpointandlowestAvailableVersion, the lowest version the node stores (left out when it stores none of the versions it has rows for). The check scans rows upward from the start and stops at the first stored version: pruning deletes replaced versions oldest first, so every version after a stored one is stored too. It asks the store only about rows whose next row has the same storage ID, and about the last row. A listing withoutat_checkpointlists every row it reaches, including system-package versions whose packages are pruned. kv-rpc never prunes, so it has no such refusal.Known limitation, not changed here: a fork lists only package versions it has seeded or fetched.
Test plan
New tests:
list_package_versions.rs) and kv-rpc e2e (kv_rpc_tests.rs): publish checkpoint reported, bound cutting mid-lineage, bound before first publish (empty), bound above and exactly at the tip, pagination under a bound; fullnode floor test assertingOUT_OF_RANGEbelow the pruned object floor.rows_limitplus the publish-checkpoint filter, whichget_package_versions_bounds_by_publish_checkpointasserts by the number of rows read; kv-rpc handler bounds; rpc-store iterator reports unset checkpoints for restored rows;package_versionsrecords an in-place upgrade's input version without overwriting a recorded publish, a publish staged but not yet written (upgrade_input_finds_a_publish_staged_but_not_yet_written), or a publish earlier in the same batch (upgrade_input_finds_a_publish_earlier_in_the_same_batch); the processor scans checkpoint inputs only up to the restore checkpoint (process_scans_upgrade_inputs_only_up_to_the_restore_anchor).list_package_versions.rs:unpruned_lineage_is_stored_from_every_start,pruned_versions_refuse_ranges_starting_below_the_lowest_stored,versions_without_rows_refuse_ranges_starting_below_themandrows_with_no_stored_version_refuse_without_a_lowest_stored_versioncheck the scan's outcome and how many versions it asks the store about;refusal_below_lowest_stored_is_internal_on_a_node_that_pruned_nothingchecksINTERNALat floor 0 andBELOW_EARLIEST_AVAILABLEabove it.ListPackageVersionsrejects a bound below the fork checkpoint and serves one at it; the same test checks thatGetPackageat the fork checkpoint passes both bounds and finds the seeded package (whose response then fails only because it has no modules).test_system_package_listing_below_the_lowest_stored_version_is_refusedseeds a system package at version 3: anat_checkpointlisting from version 1, or from a page token at 1 or 2, getsBELOW_EARLIEST_AVAILABLEwithlowestAvailableVersion3, while one from 3, and one withoutat_checkpoint, list version 3.The
UpgradeInputpath is covered by unit tests of the processor and the commit step, not by a real system-package upgrade. The backfill gate on listings withoutat_checkpointhas no test: it reusesat_checkpoint_upper_bound, whose gate is tested in #28577, and no test drives a real restore. The lineage refusal is tested on the scan alone and on a fork, not on a node that has pruned a system-package version.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.
ListPackageVersionsreports each version's publish checkpoint and acceptsat_checkpointto list only versions published at or before a checkpoint. A bound above the highest indexed checkpoint fails withOUT_OF_RANGE/ABOVE_LATEST_AVAILABLE, and one below the floor withOUT_OF_RANGE/BELOW_EARLIEST_AVAILABLE. Withoutat_checkpoint, a full node lists versions only up to its highest indexed checkpoint, as kv-rpc does with its served height. On a full node, it returnsUNAVAILABLEwhile a restore is still backfilling history, with or withoutat_checkpoint. On a full node, a listing withat_checkpointthat starts below the lowest version of the package the node stores (such as system-package versions it has pruned, or that were replaced before it was restored from a snapshot) fails withOUT_OF_RANGE/BELOW_EARLIEST_AVAILABLE, whoselowestAvailableVersionnames that version.