fix(rpc-engine): don't fetch the pruned block (#18589)

This commit is contained in:
MIHAO PARK
2025-09-26 16:17:10 +02:00
committed by GitHub
parent 0299160e93
commit 74c4cdbf09

View File

@@ -580,7 +580,13 @@ where
end = best_block;
}
// Check if the requested range starts before the earliest available block due to pruning/expiry
let earliest_block = inner.provider.earliest_block_number().unwrap_or(0);
for num in start..=end {
if num < earliest_block {
result.push(None);
continue;
}
let block_result = inner.provider.block(BlockHashOrNumber::Number(num));
match block_result {
Ok(block) => {