Skip to content

feat(solana-indexer): add traits module#4508

Open
tilacog wants to merge 4 commits into
solana-indexer/PR2-bootstrapfrom
solana-indexer/PR3-bootstrap
Open

feat(solana-indexer): add traits module#4508
tilacog wants to merge 4 commits into
solana-indexer/PR2-bootstrapfrom
solana-indexer/PR3-bootstrap

Conversation

@tilacog

@tilacog tilacog commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

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

  • Added traits/store.rs:
    • Store trait, the PostgreSQL boundary.
  • Added traits/solana_client.rs:
    • SolanaClient trait, the Solana RPC boundary.
  • Skipped a trait for the Yellowstone gRPC system boundary. That one works better as a GrpcConnector trait bound on the Ingester struct (coming in the next PR).

How to test

  1. Build the crate: cargo check -p solana-indexer.
  2. Check that the new traits module is exported and both traits are reachable from the crate root.
  3. Stub implementations land in follow-up PRs, so there's no runtime behavior to verify here yet.

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.
@tilacog tilacog requested a review from a team as a code owner June 9, 2026 01:41

@gemini-code-assist gemini-code-assist Bot 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.

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.

Comment thread crates/solana-indexer/src/traits/store.rs Outdated
@socket-security

socket-security Bot commented Jun 9, 2026

Copy link
Copy Markdown

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.

View full report

@tilacog tilacog changed the title feat(solana-indexer): traits/ module feat(solana-indexer): add traits module Jun 9, 2026
@tilacog tilacog marked this pull request as draft June 9, 2026 11:00
@tilacog tilacog marked this pull request as ready for review June 9, 2026 11:35

@gemini-code-assist gemini-code-assist Bot 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.

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.

Comment thread crates/solana-indexer/src/traits/store.rs Outdated
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedsolana-client@​4.0.010010093100100

View full report

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