Skip to content

Commit 028f86a

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

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
@@ -1006,9 +1006,20 @@ export class PXE {
10061006
const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
10071007

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

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

0 commit comments

Comments
 (0)