tests(solana-indexer) PR 5.2: Add unit tests for solana-indexer ingester component#4550
Conversation
Local tombi was 0.9.0; CI uses 1.1.0 which produces different output.
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.
Fills in the ingester run loop for the solana-indexer.
- Create crates/solana-indexer/src/indexer/ingester/tests.rs with mock-stream tests covering tx/account/slot forwarding, ignored updates, malformed tx skipping, stream errors, clean shutdown, and closed decoder receiver. - Link the test module in ingester.rs with #[cfg(test)] mod tests. - Extend types::wire re-exports to cover the geyser types used by the tests, keeping imports local to the crate's wire surface.
There was a problem hiding this comment.
Code Review
This pull request adds a comprehensive suite of unit tests for the Ingester component, covering transaction and account updates, slot updates, ignored messages, malformed signatures, and stream error handling. To support these tests, additional Yellowstone gRPC proto types are exported in wire.rs. No critical issues found.
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.
solana-indexer ingester component
Patches remote memory exhaustion DoS in quinn-proto via unbounded out-of-order stream reassembly. Transitive dep via solana-client.
Patches remote memory exhaustion DoS in quinn-proto via unbounded out-of-order stream reassembly. Transitive dep via solana-client.
solana-indexer ingester componentsolana-indexer ingester component
solana-indexer ingester componentsolana-indexer ingester component
solana-indexer ingester componentsolana-indexer ingester component
| #[tokio::test] | ||
| async fn transaction_update_with_valid_signature_is_forwarded() { | ||
| let signature = signature(1); | ||
| let (mut ingester, mut rx, _) = ingester(stream::iter(vec![tx_update(42, 1)])); |
There was a problem hiding this comment.
| let (mut ingester, mut rx, _) = ingester(stream::iter(vec![tx_update(42, 1)])); | |
| let (mut ingester, mut rx, _) = ingester(stream::iter([tx_update(42, 1)])); |
No needed to first create a vector.
| update_oneof: Some(UpdateOneof::Transaction(SubscribeUpdateTransaction { | ||
| slot: 2, | ||
| transaction: Some(SubscribeUpdateTransactionInfo { | ||
| signature: vec![1, 2, 3], |
There was a problem hiding this comment.
This is (most likely) not a valid signature which is a good indicator that this should use a proper new type to encode things like the size requirements of a signature.
There was a problem hiding this comment.
The size requirement is already enforced, no? Signature here is solana_sdk::Signature, a [u8; 64] newtype, and Signature::try_from rejects anything that isn't 64 bytes. That vec![1, 2, 3] is the proto wire field, and this test exists to prove we reject it at the boundary. A crate-local wrapper would just forward to the same check, so it'd add indirection without new validation.
There was a problem hiding this comment.
That vec![1, 2, 3] is the proto wire field
Ah, that type comes like that from the geyser crate. Still seems odd to me that they don't have stricter size requirements on the wire format but I guess we have no choice then. Also perhaps I'm missing something and solana signatures can have variable length.
- openssl 0.10.75 → 0.10.80 (fixes CVE-2026-41676/78/81/98, CVE-2026-42327, CVE-2026-44662, CVE-2026-45784, CVE-2026-41677) - rand 0.8.5 → 0.8.6 (fixes GHSA-cq8v-f236-94qc)
… DeadLetterReason
No usage site compares Commitment values with == — all code uses match.
…otstrap # Conflicts: # Cargo.lock
…ootstrap # Conflicts: # Cargo.lock
…ootstrap # Conflicts: # Cargo.lock
….2-bootstrap # Conflicts: # Cargo.lock # crates/solana-indexer/src/indexer/ingester.rs
…ootstrap # Conflicts: # crates/solana-indexer/src/lib.rs
…-bootstrap # Conflicts: # crates/solana-indexer/src/indexer/ingester.rs
…-bootstrap # Conflicts: # crates/solana-indexer/src/indexer/ingester.rs
…ootstrap # Conflicts: # Cargo.lock # crates/solana-indexer/src/types/errors.rs
…bootstrap # Conflicts: # Cargo.lock # crates/solana-indexer/src/indexer/decoder.rs # crates/solana-indexer/src/indexer/ingester.rs # crates/solana-indexer/src/indexer/watchdog.rs # crates/solana-indexer/src/types/mod.rs # crates/solana-indexer/src/types/recovery.rs # crates/solana-indexer/src/types/wire.rs
This PR adds a mock stream test suite for the Solana
ingestercomponent.It covers transaction, account, and slot forwarding, plus handling of ignored updates, malformed transactions, stream errors, clean shutdown, and closed decoder receivers.
This is a follow-up PR to #4549