pub async fn execute_in_sandbox(
        &self,
        _vm_permit: VmPermit,
        connection: Connection<'static, Core>,
        action: SandboxAction,
        block_args: &BlockArgs,
        state_override: Option<StateOverride>,
    ) -> anyhow::Result<SandboxExecutionOutput> {
        let (env, storage) = self
            .prepare_env_and_storage(connection, block_args, &action)
            .await?;

        let storage = if let Some(state_override) = state_override {
            tokio::task::spawn_blocking(|| apply_state_override(storage, state_override))
                .await
                .context("applying state override panicked")?
        } else {
            // Do not spawn a new thread in the most frequent case.
            StorageWithOverrides::new(storage)
        };

        let (execution_args, tracing_params) = action.into_parts();
        self.engine
            .execute_in_sandbox(storage, env, execution_args, tracing_params)
            .await
    }
This method assumes that (block with number `resolved_block_number` is present in DB)
or (`block_id` is `pending` and block with number `resolved_block_number - 1` is present in DB)
core/node/api_server/src/execution_sandbox/execute.rs