feat(solana-indexer): add traits module#4508
Conversation
Introduces the traits/ module per the PR-sequence plan. The trait surface is intentionally narrow: it covers only what the consumer components need, not the full surface of the underlying library. traits/store.rs: - Store (PostgreSQL boundary) traits/solana_client.rs: - SolanaClient (RPC boundary) We don't need a trait to represent the Yelllowstone gRPC system boundary because that can be represented by a trait bound in the (upcoming) Ingester struct implementation.
There was a problem hiding this comment.
Code Review
This pull request introduces the SolanaClient and Store traits to abstract external dependencies (Solana RPC and PostgreSQL persistence) for the solana-indexer crate, along with updating dependency configurations and refactoring recovery-flow types. Feedback on the Store trait suggests returning Result<(), StoreError> instead of () for write_dead_letter and record_lost_slot_range to ensure robust error handling for database operations.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
traits module
There was a problem hiding this comment.
Code Review
This pull request introduces the SolanaClient and Store traits to abstract external Solana RPC calls and PostgreSQL persistence for the indexer. It also refactors related types and dependencies. The feedback suggests using std::ops::RangeInclusive<u64> instead of std::ops::Range<u64> in the Store trait to avoid potential off-by-one errors when recording lost slot ranges.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Description
Adds the
traits/module as laid out in the PR sequence plan, carrying over the two traits that sit on the indexer's external boundaries.The trait surface stays small on purpose: each one only covers what the consumer components actually need, not the full API of the underlying library. That keeps the abstractions thin and tied to real call sites.
Changes
traits/store.rs:Storetrait, the PostgreSQL boundary.traits/solana_client.rs:SolanaClienttrait, the Solana RPC boundary.GrpcConnectortrait bound on theIngesterstruct (coming in the next PR).How to test
cargo check -p solana-indexer.traitsmodule is exported and both traits are reachable from the crate root.