Skip to content

Commit f9579f0

Browse files
committed
fix(pxe): only skip sync for stub overrides, not on-chain class overrides
1 parent b5280d2 commit f9579f0

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

yarn-project/pxe/src/pxe.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,9 +1013,20 @@ export class PXE {
10131013
const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
10141014

10151015
if (hasOverriddenContracts) {
1016-
// Overridden contracts don't have a sync function, so calling sync on them would fail.
1017-
// We exclude them so the sync service skips them entirely.
1018-
this.contractSyncService.setExcludedFromSync(jobId, overriddenContracts);
1016+
// Skip sync for overrides whose class isn't published on chain (typically local-only stubs
1017+
// such as account stubs registered via pxe.registerContractClass). Their artifacts may be
1018+
// partial and break sync's nested utility execution. Overrides whose class is published
1019+
// on chain (e.g. fastForwardContractUpdate) have full artifacts and need sync to load
1020+
// pre-existing notes for the contract.
1021+
const stubAddresses = new Set<string>();
1022+
for (const [addrStr, override] of Object.entries(overrides!.contracts!)) {
1023+
if (!(await this.node.getContractClass(override.instance.currentContractClassId))) {
1024+
stubAddresses.add(addrStr);
1025+
}
1026+
}
1027+
if (stubAddresses.size > 0) {
1028+
this.contractSyncService.setExcludedFromSync(jobId, stubAddresses);
1029+
}
10191030
}
10201031

10211032
// Execution of private functions only; no proving, and no kernel logic.

0 commit comments

Comments
 (0)