feat(solana-indexer): add types module scaffolding#4506
Conversation
There was a problem hiding this comment.
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.
| #[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, | ||
| } |
There was a problem hiding this comment.
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.
| #[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, | |
| } |
types module scaffolding
Local tombi was 0.9.0; CI uses 1.1.0 which produces different output.
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 typeschannel.rs: payload types for messages exchanged between the Ingester and Decoder componentevents.rs: domain event taxonomycommitment.rs: types for tracking Solana commitment levelsdead_letter.rs: dead-letter primitivesrecovery.rs: recovery stateerrors.rs: error types for this cratetx.rs: transaction contextmetrics.rs: observability countersDeclared
pub mod types;inlib.rsso the module compiles.How to test
cargo check -p solana-indexercargo +nightly fmt --all -- --checkcargo clippy --locked --workspace --all-features --all-targets -- -D warningsNo unit tests are included: the modules contain only type definitions, with no logic to exercise until the traits in PR 3 are introduced.