diff --git a/yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts b/yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts index 688ae67ef1c1..d59d6c4d1995 100644 --- a/yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts +++ b/yarn-project/pxe/src/contract_function_simulator/oracle/utility_execution_oracle.ts @@ -995,6 +995,11 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra /** Runs a query concurrently with a validation that the block hash is not ahead of the anchor block. */ async #queryWithBlockHashNotAfterAnchor(blockHash: BlockHash, query: () => Promise): Promise { + const anchorHash = await this.anchorBlockHeader.hash(); + if (blockHash.equals(anchorHash)) { + return query(); + } + const [response] = await Promise.all([ query(), (async () => { @@ -1006,7 +1011,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra if (header.getBlockNumber() > this.anchorBlockHeader.getBlockNumber()) { throw new Error( - `Made a node query with a reference block hash ${blockHash} with block number ${header.getBlockNumber()}, which is ahead of the anchor block number ${this.anchorBlockHeader.getBlockNumber()} (from anchor block hash ${await this.anchorBlockHeader.hash()}).`, + `Made a node query with a reference block hash ${blockHash} with block number ${header.getBlockNumber()}, which is ahead of the anchor block number ${this.anchorBlockHeader.getBlockNumber()} (from anchor block hash ${anchorHash}).`, ); } })(),