pub async fn ensure_not_pruned_block(
        &self,
        block: api::BlockId,
        storage: &mut Connection<'_, Core>,
    ) -> Result<(), BlockArgsError> {
        let first_l2_block = self
            .first_l2_block(storage)
            .await
            .map_err(BlockArgsError::Database)?;
        match block {
            api::BlockId::Number(api::BlockNumber::Number(number))
                if number < first_l2_block.0.into() =>
            {
                Err(BlockArgsError::Pruned(first_l2_block))
            }
            api::BlockId::Number(api::BlockNumber::Earliest)
                if first_l2_block > L2BlockNumber(0) =>
            {
                Err(BlockArgsError::Pruned(first_l2_block))
            }
            _ => Ok(()),
        }
    }
Checks whether a block with the specified ID is pruned and returns an error if it is.
The `Err` variant wraps the first non-pruned L2 block.
core/node/api_server/src/execution_sandbox/mod.rs