From e65c39f4ff4260e8ab1f5ed10d0568450a6f97d2 Mon Sep 17 00:00:00 2001 From: steviez Date: Tue, 11 Feb 2025 01:00:31 -0600 Subject: [PATCH] ledger-tool: Allow dead slots for slot command when metadata absent The slot command will reject dead slots by default. This behavior can be overridden by passing --allow-dead-slots. Additionally, in the event that transaction metadata is missing or the slot is incomplete in the blockstore, a best effort attempt will be made to get as much data out as possible. This fallback case did not have the allow dead slots parameter plumbed through, so hook it up to allow fetching dead, partial slots --- ledger-tool/src/output.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ledger-tool/src/output.rs b/ledger-tool/src/output.rs index bc66b656bd5d0f..68ec48e5a48692 100644 --- a/ledger-tool/src/output.rs +++ b/ledger-tool/src/output.rs @@ -586,7 +586,11 @@ pub fn output_slot( Err(_) => { // Transaction metadata could be missing, try to fetch just the // entries and leave the metadata fields empty - let entries = blockstore.get_slot_entries(slot, /*shred_start_index:*/ 0)?; + let entries = blockstore.get_slot_entries_with_shred_info( + slot, + /*shred_start_index:*/ 0, + allow_dead_slots, + )?; let blockhash = entries .last()