Avoid rehashing validated Graph execution metadata during Candidate loading
This commit is contained in:
@@ -130,7 +130,7 @@ export async function loadCheckedInstallationCandidate(
|
||||
const expectedGraph = graphExecutionRepresentation(plan, installation, kernel, queries);
|
||||
// The stored graph embeds the same kernel/query programs. Validate it in a
|
||||
// short-lived scope and retain the representation that shares those trees.
|
||||
await (async () => {
|
||||
const graphDigest = await (async () => {
|
||||
const input = await readJson(root, "graph-execution.json", scope);
|
||||
try {
|
||||
const digest = await hexDigestAsync(input.value);
|
||||
@@ -140,6 +140,7 @@ export async function loadCheckedInstallationCandidate(
|
||||
root,
|
||||
"Stored graph execution differs from checked inputs",
|
||||
);
|
||||
return digest;
|
||||
} finally {
|
||||
input.releaseTree();
|
||||
}
|
||||
@@ -168,7 +169,8 @@ export async function loadCheckedInstallationCandidate(
|
||||
return {
|
||||
reference,
|
||||
workspace: plan.definition.workspace.workspaceId,
|
||||
world: await hexDigestAsync(expectedGraph),
|
||||
// The checked representation was already compared with this digest.
|
||||
world: graphDigest,
|
||||
plan: kernel.plan as string,
|
||||
graphExecution: expectedGraph,
|
||||
provenance,
|
||||
|
||||
Reference in New Issue
Block a user