ledger-history: unify scan resolution over Bound<P> - #27725
Closed
wlmyng wants to merge 5 commits into
Closed
Conversation
wlmyng
deployed
to
sui-typescript-aws-kms-test-env
August 17, 2026 18:13 — with
GitHub Actions
Active
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
8 tasks
wlmyng
force-pushed
the
wlmyng/ledger-history-bound-unify
branch
from
August 17, 2026 18:36
4afe0bd to
ed0601e
Compare
wlmyng
deployed
to
sui-typescript-aws-kms-test-env
August 17, 2026 18:36 — with
GitHub Actions
Active
8 tasks
Same behavior on sui-kv-rpc and sui-rpc-api to unconditionally project cp to tx range before is_empty() check. 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. kv handlers previously validated checkpoint bounds before options; they now build options first, matching the fullnode order, so on a request with both invalid the options error wins on both backends.
wlmyng
force-pushed
the
wlmyng/ledger-history-window-resolution
branch
from
August 17, 2026 19:25
6661544 to
8955013
Compare
EventPosition -> IntraTxCoordinate, EventScanBounds -> IntraTxScanBounds, ResolvedEventRange -> ResolvedIntraTxRange, apply_event_cursor_bounds -> apply_intra_tx_cursor_bounds. Rust-side vocabulary only — the wire Position::Events variant and the packed event_seq encoding are untouched. The coordinate space is (tx_seq, index-within-tx); events are its first lane, ListPackages the next. Known residue: the coordinate's field is still named event_index — renaming it is deferred to a compiler-assisted pass.
Position::scalar() and Position::intra_tx() name the two scan-key projections on the wire type; the query_options extractors delegate to them instead of matching variants. A new per-transaction-indexed lane (ListPackages) extends intra_tx() rather than teaching another match about its variant.
One ScanBounds<P> for every lane (P: the lane's comparison key — u64 for checkpoint/transaction sequence, IntraTxCoordinate for sub-transaction lanes), one TerminalRecord<T> for the terminal edge, one ResolvedScan<P>, and ONE generic apply_cursor_bounds body replacing the scalar and intra-tx copies. The per-lane resolve_scan/resolve_intra_tx_scan pair collapses into one generic resolve_scan<P> — endpoints pick the lane by type. ScanCoordinate::from_cursor delegates to the Position accessors; from_boundary places store fenceposts in lane coordinates. Scalar lanes keep their eager Item-resume resolution (Excluded(N) -> Included(N+1)) inside their lane bound, preserving tie and emptiness semantics exactly; the symbolic form everywhere is a separate, sign-off-gated change. Behavior-preserving — the characterization pins replay unchanged.
wlmyng
force-pushed
the
wlmyng/ledger-history-bound-unify
branch
from
August 17, 2026 19:28
ed0601e to
7c57071
Compare
wlmyng
force-pushed
the
wlmyng/ledger-history-window-resolution
branch
7 times, most recently
from
August 17, 2026 23:56
b57b49b to
8cffd7e
Compare
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
Stacked on #27724. Unifies scan resolution over
Bound<P>:EventPosition→IntraTxCoordinateand friends (Rust-side only; the wirePosition::Eventsvariant and the packedevent_seqencoding are untouched), then cursor decode throughPosition::scalar()/intra_tx()accessors — a new per-transaction-indexed lane (ListPackages) extends the accessor rather than teaching anothermatchabout its variant.ScanBounds<P>for every lane (P= the lane's comparison key:u64for checkpoint/transaction sequence,IntraTxCoordinatefor sub-transaction lanes), oneTerminalRecord<T>, oneResolvedScan<P>, one generic cursor-application body, and one genericresolve_scan<P>entry point — endpoints pick the lane by type.Scalar lanes keep their eager Item-resume resolution (
Excluded(N)→Included(N+1)at decode), preserving tie and emptiness semantics exactly; the symbolic form everywhere is a separate, sign-off-gated change (this PR exists to make that change a ~20-line, pin-enumerated diff).Test plan
The characterization suite (#27718) replays bit-for-bit on this branch — behavior-preserving is measured, not claimed. Each commit individually clippy-clean.
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.