Repository navigation
Description
Problem
During transaction persistence, getSignaturesForAddress can expose a finalized signature whose getTransaction response is still null. The TEE query filter omits that unresolved transaction, so a limit-one signature query intermittently returns an empty list.
This was reproduced with an unmodified, source-built v1.0.0 validator and the original filtering implementation. There were 2 empty responses in 3,200 filter queries and 37 null transactions in 8,000 direct signature/transaction lookup pairs. The two internal null batches captured during empty filter responses returned HTTP 200 with correct response IDs; later diagnostic single lookups found both transactions.
Ledger::write_transaction currently writes address indexes, the slot index, and transaction status separately before writing transaction bytes. Readers can observe a partially published transaction.
Reproduction
- Build v1.0.0 at
cc327754fb46b51e7f9c4fda00c9948f7393c04aand run it locally in ephemeral mode with isolated storage and zero transaction fees. - Submit valid Magic noop transactions using the standard test authority. Put the queried account in the writable group and follow it with 90 readonly accounts. The noop changes no account data; this ordering exposes the queried account's index before the remaining indexes are written.
- While transactions are being submitted, repeatedly call
getSignaturesForAddresswithlimit: 1, then immediately fetch the returned signature with a batchedgetTransactioncall using JSON encoding and confirmed commitment. Eight concurrent workers reproduced the intermittent null response without injected delays or fabricated RPC results. - Run the original TEE query filter against that validator and poll the same limit-one query to observe the resulting empty list.
The concurrent ledger regression test_signature_index_only_exposes_complete_transactions also reproduced the failure: an indexed signature at slot 1 had no complete transaction.
Expected
A signature published by the ledger must resolve to its transaction bytes and matching metadata. Publish transaction data, status, and all lookup indexes atomically, without requiring filtering retries. Preserve existing storage formats and cached counts.
Context
The affected path is magicblock-ledger/src/store/api.rs, in Ledger::write_transaction. The local reproduction used v1.0.0 and a Solana devnet upstream; all workload submissions targeted only the local validator.
The same non-atomic ordering exists in the inspected v0.16 source, so this does not establish that v1 introduced the race. The local capture proves this mechanism; raw upstream traces from the deployed TEE were unavailable to establish that every production occurrence shares it.
Publishing the transaction and indexes in one RocksDB batch eliminated the local failures: 0 empty responses in 3,200 filter queries and 0 null transactions in 8,000 raw lookup pairs, while observing new signatures during the run.
Activity