[docs-agent] Add Solana historical account state snapshots guide#1303
Open
JackReacher0807 wants to merge 3 commits into
Open
[docs-agent] Add Solana historical account state snapshots guide#1303JackReacher0807 wants to merge 3 commits into
JackReacher0807 wants to merge 3 commits into
Conversation
New MDX page at content/api-reference/solana/historical-account-state.mdx covering the two supported workflows for reconstructing point-in-time Solana account state: forward snapshotting via Yellowstone gRPC subscriptions and historical backfill via getSignaturesForAddress + getTransaction replay. Includes guidance on sampling cadence, filter options, gRPC reconnect via from_slot replay, and a trade-offs comparison. Added under the Solana section in docs.yml alongside AccountsDB Infrastructure. Refs DOCS-84 Requested-by: @SahilAujla
🔗 Preview Mode
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6293362b1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
🔍 Link CheckStatus: ❌ Failed Summary
Broken links (8) — click to expandErrors per inputErrors in ./content/wallets/wallet-integrations/privy/jwt-auth-migration.mdx
Errors in ./content/wallets/wallet-integrations/privy/signer-migration-overview.mdx
Errors in ./content/api-reference/arbitrum-nova/arbitrum-nova-deprecation-notice.mdx
Errors in ./content/wallets/pages/recipes/programmatic-wallet-creation.mdx
Errors in ./content/tutorials/smart-wallets/learn-account-abstraction/introduction-to-account-abstraction.mdx
Errors in ./content/api-reference/data/webhooks/custom-webhooks-quickstart/custom-webhooks-quickstart.mdx
Errors in ./content/wallets/pages/recipes/onramp-funds.mdx
|
Addresses codex review feedback on PR #1303: a single Solana slot can contain multiple writes to the same account, so indexing by (pubkey, slot) alone makes 'latest version at or before slot N' ambiguous and can return an earlier intra-slot state. Update the storage layout and the SQL example to use (pubkey, slot, write_version) for indexing and ORDER BY slot DESC, write_version DESC LIMIT 1 for the snapshot lookup. Add a paragraph explaining what write_version is and why the tie-break matters. Refs DOCS-84 Requested-by: @SahilAujla
deepakbnsl
reviewed
May 15, 2026
Addresses review feedback from @deepakbnsl on PR #1303. The original workflow B description and TypeScript example implied that getTransaction is sufficient to reconstruct arbitrary program account data, which is incorrect — getTransaction returns pre/post lamport balances, pre/post token balances, inner instructions, and log messages, but NOT pre/post account data blobs. Changes: * New 'What getTransaction provides' subsection enumerates what the response actually contains and explicitly notes the absence of pre/post account data fields. * New Warning callout scoping workflow B to SOL lamport balances, SPL token balances, and program-emitted log events. Documents that arbitrary program account data reconstruction requires either a starting data snapshot + program-specific instruction decoding, or comprehensive event logs from the program. * Rewrote the Pattern subsection to be concrete about reading meta.postBalances at the target account index, and clarified that meta.preBalances at T+1 equals meta.postBalances at the most recent earlier touching transaction so the post-side is the canonical value per slot. * Rewrote 'When you need program-account state, not just a single account' as 'When you need program-account state, not just balances' with the correct guidance: enumerate via getProgramAccounts for current data, start workflow A for ongoing changes, treat the subscription start as the history-begins-here marker. External-snapshot bootstrap or program-side replay flagged as out-of-scope for this guide. * Replaced the TypeScript example with a concrete lamport-balance backfill that locates the target account's index in transaction.message.accountKeys and persists meta.postBalances[i]. Added a note about extending to token balances and log events. * Updated the workflow comparison table: 'Reconstruction effort' row replaced with 'Data captured' to clearly distinguish what each workflow returns (full account bytes vs balances + log events only). * Updated the closing 'combine the two' paragraph to reflect the correct combined workflow. Refs DOCS-84 Requested-by: @SahilAujla
deepakbnsl
approved these changes
May 15, 2026
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.
Summary
Adds a new MDX page at
content/api-reference/solana/historical-account-state.mdxdocumenting the two supported workflows for reconstructing historical Solana account state at any cadence (hourly, daily, slot-level):SubscribeUpdateAccountkeyed by(pubkey, slot), query "state at hour H" as the latest row withslot <= block_at(H). Covers filter options, the up-to-6000-slotfrom_slotreplay window for disconnects, and how to enumerate the initial account set via paginatedgetProgramAccountsthrough Alchemy's AccountsDB Infrastructure.getSignaturesForAddress+getTransactionand apply each transaction's effect on the account in slot order. Covers when to combine withgetProgramAccountsfor program-wide state, and references the 20x archival speedup from Alchemy's Solana stack.The page also explains the underlying Solana RPC limitation (
minContextSlotis a freshness floor, not a historical at-slot read), discusses sampling-cadence trade-offs (store-every-update vs materialized rollups), and ends with a side-by-side workflow comparison table plus links to AccountsDB Infrastructure, Yellowstone gRPC, the Solana API FAQ archival section, and the Built-for-Solana blog posts.Generic title; no customer or DeFi-protocol names in the page copy.
Nav entry added to
content/docs.ymlunderSolana→Quickstart, immediately afterAccounts DB Infrastructure.Linear
DOCS-84 — https://linear.app/alchemyapi/issue/DOCS-84/docs-add-solana-historical-account-state-snapshots-guide
Requested by
@SahilAujla (via Slack thread)