Skip to content

ledger-history: unify scan resolution over Bound<P> - #27725

Closed
wlmyng wants to merge 5 commits into
wlmyng/ledger-history-window-resolutionfrom
wlmyng/ledger-history-bound-unify
Closed

ledger-history: unify scan resolution over Bound<P>#27725
wlmyng wants to merge 5 commits into
wlmyng/ledger-history-window-resolutionfrom
wlmyng/ledger-history-bound-unify

Conversation

@wlmyng

@wlmyng wlmyng commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Description

Stacked on #27724. Unifies scan resolution over Bound<P>:

  • Lane-neutral names first: EventPositionIntraTxCoordinate and friends (Rust-side only; the wire Position::Events variant and the packed event_seq encoding are untouched), then cursor decode through Position::scalar()/intra_tx() accessors — a new per-transaction-indexed lane (ListPackages) extends the accessor rather than teaching another match about its variant.
  • Then 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>, one ResolvedScan<P>, one generic cursor-application body, and one generic resolve_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.

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

@wlmyng
wlmyng deployed to sui-typescript-aws-kms-test-env August 17, 2026 18:13 — with GitHub Actions Active
@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview Aug 17, 2026 7:33pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Aug 17, 2026 7:33pm
sui-kiosk Ignored Ignored Preview Aug 17, 2026 7:33pm

Request Review

wlmyng added 2 commits August 17, 2026 12:23
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
wlmyng force-pushed the wlmyng/ledger-history-window-resolution branch from 6661544 to 8955013 Compare August 17, 2026 19:25
wlmyng added 3 commits August 17, 2026 12:26
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
wlmyng force-pushed the wlmyng/ledger-history-bound-unify branch from ed0601e to 7c57071 Compare August 17, 2026 19:28
@wlmyng
wlmyng force-pushed the wlmyng/ledger-history-window-resolution branch 7 times, most recently from b57b49b to 8cffd7e Compare August 17, 2026 23:56
@wlmyng wlmyng closed this Aug 18, 2026
@wlmyng
wlmyng deleted the wlmyng/ledger-history-bound-unify branch August 19, 2026 07:15
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.

1 participant