Skip to content

feat(solana-indexer): add types module scaffolding#4506

Open
tilacog wants to merge 3 commits into
mainfrom
solana-indexer/PR2-bootstrap
Open

feat(solana-indexer): add types module scaffolding#4506
tilacog wants to merge 3 commits into
mainfrom
solana-indexer/PR2-bootstrap

Conversation

@tilacog

@tilacog tilacog commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Description

Adds the type definitions for the types/ module listed in the crate-layout spec.

This is PR 2 in the sequence; later PRs (traits (PR 3), then component structs (PR 4)) consume these types.

Changes

  • Added crates/solana-indexer/src/types/ with one file per module from the spec:

    • wire.rs: wire-format types, for the Yellowstone gRPC protobuf types
    • channel.rs: payload types for messages exchanged between the Ingester and Decoder component
    • events.rs: domain event taxonomy
    • commitment.rs: types for tracking Solana commitment levels
    • dead_letter.rs: dead-letter primitives
    • recovery.rs: recovery state
    • errors.rs: error types for this crate
    • tx.rs: transaction context
    • metrics.rs: observability counters
  • Declared pub mod types; in lib.rs so the module compiles.

How to test

  1. cargo check -p solana-indexer
  2. cargo +nightly fmt --all -- --check
  3. cargo clippy --locked --workspace --all-features --all-targets -- -D warnings

No unit tests are included: the modules contain only type definitions, with no logic to exercise until the traits in PR 3 are introduced.

@tilacog tilacog requested a review from a team as a code owner June 8, 2026 20:47

@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 solana-indexer crate, which defines domain types for a Solana settlement indexer, including channel messages, commitment tracking, dead-letter handling, errors, events, metrics, recovery flows, and transaction helpers. A high-severity issue was identified in channel.rs where the PartialEvent struct is missing the half: PartialHalf field described in its documentation, which is required for the watchdog to reconstruct events. Adding this field also means PartialEvent must derive Clone instead of Copy due to heap-allocated types in PartialHalf.

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 on lines +44 to +50
#[derive(Debug, Clone, Copy)]
pub struct PartialEvent {
/// Slot the partial was observed at.
pub slot: u64,
/// Transaction signature the partial corresponds to.
pub signature: Signature,
}

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.

high

The doc comment for PartialEvent states that "each delivery carries the half that just landed," but the struct definition is missing the half: PartialHalf field. Without this field, the watchdog cannot receive or hold the actual data halves to match and reconstruct the full event. Additionally, since PartialHalf contains heap-allocated Box types, PartialEvent cannot derive Copy and should only derive Debug, Clone.

Suggested change
#[derive(Debug, Clone, Copy)]
pub struct PartialEvent {
/// Slot the partial was observed at.
pub slot: u64,
/// Transaction signature the partial corresponds to.
pub signature: Signature,
}
#[derive(Debug, Clone)]
pub struct PartialEvent {
/// Slot the partial was observed at.
pub slot: u64,
/// Transaction signature the partial corresponds to.
pub signature: Signature,
/// The half that just landed.
pub half: PartialHalf,
}

@tilacog tilacog changed the title feat(solana-indexer): add types module scaffolding feat(solana-indexer): add types module scaffolding Jun 8, 2026
tilacog added 2 commits June 8, 2026 18:06
Local tombi was 0.9.0; CI uses 1.1.0 which produces different output.
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