Skip to content

Qualify getLedgers history by provider retention - #73

Merged
kaankacar merged 1 commit into
mainfrom
fix-data-getledgers-retention
Aug 10, 2026
Merged

Qualify getLedgers history by provider retention#73
kaankacar merged 1 commit into
mainfrom
fix-data-getledgers-retention

Conversation

@kaankacar

Copy link
Copy Markdown
Contributor

Closes #52.

Applies the report, re-verified live while writing the fix: getHealth on the public testnet RPC returned oldestLedger: 3590554, latestLedger: 3711513, ledgerRetentionWindow: 120960, and getLedgers with startLedger: 2 failed with JSON-RPC -32600 — the error text itself says "must be between the oldest ledger ... for this rpc instance", which is the whole point: deep history is a property of the provider's data-lake integration, not of the method.

All four "back to genesis" references are qualified (RPC limitations bullet, the historical-data code comment, the Historical Data Access intro, and the Data Lake section), and per the issue's recommendation the code example now checks getHealth().oldestLedger before paging back.

The skill promised Infinite Scroll back to genesis unconditionally.
Reality, reproduced live against the public testnet RPC while writing
this: getHealth reports oldestLedger/ledgerRetentionWindow, and
getLedgers with startLedger=2 fails with -32600 ('must be between the
oldest ledger ... for this rpc instance'). Deep history is a property
of the provider's data-lake integration, not of the method.

All four references now say so, and the historical-data example
checks getHealth().oldestLedger before paging back.

Closes #52.
Copilot AI review requested due to automatic review settings July 20, 2026 19:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Jul 20, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-08-10 23:51 UTC

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@kaankacar

Copy link
Copy Markdown
Contributor Author

Verified before merging — both the failure mode and the fix's code, live.

The failure reproduces today, exactly as #52 recorded it. Raw JSON-RPC against the public SDF testnet instance:

getHealth  → oldestLedger: 3955974, latestLedger: 4076933, ledgerRetentionWindow: 120960
getLedgers(startLedger: 2) → -32600:
  "start ledger (2) must be between the oldest ledger: 3955974 and the
   latest ledger: 4076933 for this rpc instance"

The server's own error text ("for this rpc instance") is the finding in miniature — depth is a property of the instance, not the method.

The new code line was dry-run against the real SDK, not just read. With @stellar/stellar-sdk@16.2.0:

const { oldestLedger } = await rpc.getHealth();
// → 3955982 (number) — destructure works as written
rpc.getLedgers({ startLedger: 2, ... })
// → throws the same "for this rpc instance" error via the SDK path

rpc is also the variable name the rest of the file's examples already use (rpc.getAccount, rpc.sendTransaction, rpc.getLatestLedger), so the snippet drops in consistently.

Completeness: grepping the file for genesis / Infinite Scroll finds only the three qualified passages — no unqualified "back to genesis" claim survives, covering all four spots the issue flagged. The framing also now matches the official getLedgers reference word for word ("as long as the pages fall within the history retention of their corresponding RPC provider", "will return an error if startLedger is less than the oldest ledger stored in this node"). Adjacent links (Quasar) resolve; site build green. Merging.

@kaankacar
kaankacar merged commit 9e3d3fe into main Aug 10, 2026
7 checks passed
@kaankacar
kaankacar deleted the fix-data-getledgers-retention branch August 10, 2026 23:50
kaankacar added a commit that referenced this pull request Aug 11, 2026
Three scenarios per skill plus cross-skill routing checks and an
off-topic negative control, in the {skills, query, expected_behavior}
format with optional machine_checkable assertions. evals/README.md
documents the tiers (compile checks, LLM-judged behavior, trigger
checks), the baseline process, and how to run a scenario; the root
README links it and documents the 500-line router convention.

Scenario expectations reflect current protocol reality rather than the
July proposal where they diverged: Noir/UltraHonk verifies on-chain
since Protocol 26 (#72), MPP Channel mode is now Session (#71), and
getLedgers depth is provider-retention dependent (#73).
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.

sk-003: The data skill promises getLedgers history back to genesis despite provider retention limits

2 participants