fix(squid-sdk): strip vote transactions in the Solana RPC source, matching Portal numbering - #558
Open
abernatskiy wants to merge 1 commit into
Open
fix(squid-sdk): strip vote transactions in the Solana RPC source, matching Portal numbering#558abernatskiy wants to merge 1 commit into
abernatskiy wants to merge 1 commit into
Conversation
…ching Portal numbering The Portal dataset producers (solana-ingest --no-votes, solana-data-service) call removeVoteTransactions() BEFORE mapRpcBlock(): vote transactions are dropped and the survivors keep their original getBlock positions via the stamped _index, which becomes transactionIndex. The RPC adapter fed raw blocks straight into normalization, so its transactionIndex counted votes and every item id embedding it disagreed with Portal-sourced data whenever a vote preceded the transaction in the block. - apply removeVoteTransactions() before normalization in the adapter's block mapping (extracted as mapRawBlock for testability) - declare @subsquid/solana-rpc-data ^1.0.0 as an optional peer (it is a hard dependency of @subsquid/solana-rpc, so it is always present when the RPC path is usable) and include it in the missing-peer translation - regression test: a vote preceding a payload transaction must not shift the payload's transactionIndex Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S2n1VHrhUa2szzVMW3mrkY
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.
Problem
The Portal Solana dataset producers (
solana-ingest --no-votes,solana-data-service) callremoveVoteTransactions()beforemapRpcBlock(): vote transactions are dropped, and the surviving transactions keep their originalgetBlockpositions via the stamped_index, which normalization adopts astransactionIndex. This is also the contract encoded insolana-normalization's LFS conformance fixtures.The
solana/rpcadapter fed raw blocks straight into normalization, so itstransactionIndexcounted vote transactions — and every item id embedding the index disagreed with Portal-sourced data whenever a vote preceded the transaction in the raw block order. A fallback switching betweenportalandrpcsources would emit different ids for the same on-chain event.Fix
removeVoteTransactions()before normalization in the adapter's block mapping (extracted asmapRawBlockfor testability, mirroring the exportedcoarseRequest).@subsquid/solana-rpc-data ^1.0.0as an optional peer + devDep. It is a hard dependency of@subsquid/solana-rpc, so it is always installed whenever the RPC path is usable; the missing-peer translation covers it.Testing
transactionIndex(asserts index 1, not a post-filter 0) — fails without the fix.transactionIndexcomponent on every block where votes precede the matched transaction.🤖 Generated with Claude Code
https://claude.ai/code/session_01S2n1VHrhUa2szzVMW3mrkY