refactor: consolidate ledger-history window resolution and cursor application 2/5 - #27752
Merged
Conversation
wlmyng
temporarily deployed
to
sui-typescript-aws-kms-test-env
August 19, 2026 01:53 — with
GitHub Actions
Inactive
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Aug 19, 2026
wlmyng
force-pushed
the
wlmyng/resolved-range-consolidation
branch
from
August 19, 2026 05:38
1c21f01 to
888e2ee
Compare
wlmyng
temporarily deployed
to
sui-typescript-aws-kms-test-env
August 19, 2026 05:38 — with
GitHub Actions
Inactive
wlmyng
force-pushed
the
wlmyng/resolved-range-consolidation
branch
from
August 19, 2026 05:46
888e2ee to
b33651d
Compare
wlmyng
temporarily deployed
to
sui-typescript-aws-kms-test-env
August 19, 2026 05:46 — with
GitHub Actions
Inactive
wlmyng
force-pushed
the
wlmyng/resolved-range-consolidation
branch
from
August 19, 2026 06:24
b33651d to
8e9bdc8
Compare
wlmyng
temporarily deployed
to
sui-typescript-aws-kms-test-env
August 19, 2026 06:24 — with
GitHub Actions
Inactive
wlmyng
marked this pull request as ready for review
August 19, 2026 06:31
wlmyng
temporarily deployed
to
sui-typescript-aws-kms-test-env
August 19, 2026 06:31 — with
GitHub Actions
Inactive
wlmyng
requested review from
a team,
amnn,
evan-wall-mysten,
nickvikeras and
tpham-mysten
August 19, 2026 06:31
nickvikeras
approved these changes
Aug 20, 2026
Same behavior on sui-kv-rpc and sui-rpc-api to unconditionally project cp to tx range before is_empty() check, since we always do a lookup for the terminal cursor. This will help eliminate the special case empty_at for ResolvedXRange, as empty windows instead ride the same projection path.
CheckpointRange::from_request + .resolve(options) was a two-step every handler sequenced across two places. ResolvedCheckpointRange::from_request fuses them into one call — the intermediate struct dissolves, its fields becoming locals of the fused body; validation, tip clamp, cursor clamps, and exhaustion attribution are preserved branch for branch. Both backends keep their existing error precedence: the window-bounds check stands alone as validate_checkpoint_bounds, called before read-mask and options parsing as before (the fused resolution re-runs it harmlessly). The fullnode handlers' private ledger_read copy is deleted in favor of the shared helper.
…onto the records
ResolvedIntraTxRange gains a one-call resolve from the checkpoint window,
and both records take over cursor application from QueryOptions:
options.apply_{intra_tx_,}cursor_bounds(record) becomes
record.apply_cursor_bounds(&options). Squash of three mechanical moves;
behavior unchanged.
…fore_cursor Extracts each cursor arm from ResolvedIntraTxRange::apply_cursor_bounds into its own method and reshapes both onto &mut self. Squash of three extraction steps; behavior preserved, pinned by the per-arm test family this adds.
…tra-tx rewrite Same per-arm extraction for ResolvedRange, ending with the two lanes' apply_after/before_cursor pairs structurally parallel — their remaining semantic differences now sit side by side for the alignment PR. Behavior preserved: the after-Item-at-u64::MAX admission keeps its legacy short-circuit (terminal at the cursor's own coordinate, before-arm skipped), expressed as the arm's ControlFlow::Break.
wlmyng
force-pushed
the
wlmyng/resolved-range-consolidation
branch
from
August 20, 2026 23:01
8e9bdc8 to
aada168
Compare
wlmyng
temporarily deployed
to
sui-typescript-aws-kms-test-env
August 20, 2026 23:01 — with
GitHub Actions
Inactive
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
Second of the stack (on top of the rename PR). Behavior-preserving consolidation of ledger-history window resolution and cursor application:
checkpoint_to_tx_rangebecomes empty-safe on kv, so empty windows ride the same projection path as non-empty ones instead of a special-cased boundary lookup.CheckpointRange::from_request+.resolve(options)fuse into oneResolvedCheckpointRange::from_requestcall; the intermediate struct dissolves. Both backends keep their existing error precedence via a standalonevalidate_checkpoint_boundscalled before read-mask/options parsing, exactly where the old validation sat — the fullnode handlers' privateledger_readcopy of the same check is deleted in favor of the shared helper.QueryOptionsonto the records, and both lanes'apply_cursor_boundsare restructured into per-armapply_after_cursor/apply_before_cursorwith the same shape.Test plan
LedgerTipCheckpointBoundResolved*Rangeresolveorients entry/terminal checkpoints by orderingTests on
ResolvedRangeandResolvedIntraTxRangearound cursor tightening, after/before + ascending/descending.Which cursor owns the terminal frame when both are present and applied, when one is rejected, when
beforeoverridesafter.Every commit compiles and passes the scoped suites individually.
Release notes