@aztec-labs/pxe 6.0.0-rc.1 → 6.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dest/contract_function_simulator/contract_function_simulator.d.ts +1 -1
  2. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  3. package/dest/contract_function_simulator/contract_function_simulator.js +7 -1
  4. package/dest/contract_function_simulator/index.d.ts +3 -1
  5. package/dest/contract_function_simulator/index.d.ts.map +1 -1
  6. package/dest/contract_function_simulator/noir-structs/note_origin.d.ts +10 -0
  7. package/dest/contract_function_simulator/noir-structs/note_origin.d.ts.map +1 -0
  8. package/dest/contract_function_simulator/noir-structs/note_origin.js +1 -0
  9. package/dest/contract_function_simulator/noir-structs/nullifier_status.d.ts +9 -0
  10. package/dest/contract_function_simulator/noir-structs/nullifier_status.d.ts.map +1 -0
  11. package/dest/contract_function_simulator/noir-structs/nullifier_status.js +1 -0
  12. package/dest/contract_function_simulator/oracle/acir_callback.d.ts +5 -2
  13. package/dest/contract_function_simulator/oracle/acir_callback.d.ts.map +1 -1
  14. package/dest/contract_function_simulator/oracle/acir_callback.js +10 -10
  15. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +4 -3
  16. package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/oracle/oracle_registry.js +23 -6
  18. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +7 -3
  19. package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
  20. package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +21 -1
  21. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +3 -2
  22. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  23. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +16 -8
  24. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +17 -9
  25. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  26. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +44 -13
  27. package/dest/operation_queue.d.ts +6 -1
  28. package/dest/operation_queue.d.ts.map +1 -1
  29. package/dest/operation_queue.js +33 -3
  30. package/dest/oracle_version.d.ts +3 -3
  31. package/dest/oracle_version.js +3 -3
  32. package/dest/storage/fact_store/fact_service.d.ts +3 -3
  33. package/dest/storage/fact_store/fact_service.d.ts.map +1 -1
  34. package/dest/storage/fact_store/fact_store.d.ts +3 -3
  35. package/dest/storage/fact_store/fact_store.d.ts.map +1 -1
  36. package/dest/storage/fact_store/fact_store_keys.d.ts +3 -5
  37. package/dest/storage/fact_store/fact_store_keys.d.ts.map +1 -1
  38. package/dest/storage/fact_store/index.d.ts +2 -2
  39. package/dest/storage/fact_store/index.d.ts.map +1 -1
  40. package/dest/storage/fact_store/origin_state.d.ts +3 -3
  41. package/dest/storage/fact_store/origin_state.d.ts.map +1 -1
  42. package/dest/storage/fact_store/stored_fact.d.ts +5 -5
  43. package/dest/storage/fact_store/stored_fact.d.ts.map +1 -1
  44. package/package.json +18 -18
  45. package/src/contract_function_simulator/contract_function_simulator.ts +6 -1
  46. package/src/contract_function_simulator/index.ts +2 -0
  47. package/src/contract_function_simulator/noir-structs/note_origin.ts +11 -0
  48. package/src/contract_function_simulator/noir-structs/nullifier_status.ts +9 -0
  49. package/src/contract_function_simulator/oracle/acir_callback.ts +25 -14
  50. package/src/contract_function_simulator/oracle/oracle_registry.ts +16 -5
  51. package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +14 -2
  52. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +13 -10
  53. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +65 -15
  54. package/src/operation_queue.ts +36 -5
  55. package/src/oracle_version.ts +3 -3
  56. package/src/storage/fact_store/fact_service.ts +2 -2
  57. package/src/storage/fact_store/fact_store.ts +2 -2
  58. package/src/storage/fact_store/fact_store_keys.ts +2 -4
  59. package/src/storage/fact_store/index.ts +1 -1
  60. package/src/storage/fact_store/origin_state.ts +2 -2
  61. package/src/storage/fact_store/stored_fact.ts +3 -3
  62. package/dest/contract_function_simulator/noir-structs/origin_block.d.ts +0 -11
  63. package/dest/contract_function_simulator/noir-structs/origin_block.d.ts.map +0 -1
  64. package/dest/contract_function_simulator/noir-structs/origin_block.js +0 -5
  65. package/src/contract_function_simulator/noir-structs/origin_block.ts +0 -8
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/fact_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAClG,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,GACnC,MAAM,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/fact_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACrG,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,GACnC,MAAM,mBAAmB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { Fr } from '@aztec-labs/foundation/curves/bn254';
2
2
  import type { L2Tips } from '@aztec-labs/stdlib/block';
3
- import type { FactCollectionKey, OriginBlock } from './fact_store_keys.js';
3
+ import type { BlockReference, FactCollectionKey } from './fact_store_keys.js';
4
4
  import type { Fact } from './stored_fact.js';
5
5
  /**
6
6
  * Chain state of a retractable fact's origin block, mirroring the L2 chain tips.
@@ -35,7 +35,7 @@ export type TipBlockNumbers = {
35
35
  */
36
36
  export declare function anchoredTipBlockNumbers(tips: L2Tips, anchorBlockNumber: number): TipBlockNumbers;
37
37
  /** A retractable fact's origin block annotated with that block's current chain state. */
38
- export type RetractableFactOrigin = OriginBlock & {
38
+ export type RetractableFactOrigin = BlockReference & {
39
39
  blockState: OriginBlockState;
40
40
  };
41
41
  /** A fact enriched with origin-block state. `originBlock` is undefined for a non-retractable fact. */
@@ -56,4 +56,4 @@ export type FactCollectionWithOriginState = {
56
56
  export declare function classifyOriginBlockState(blockNumber: number, tips: TipBlockNumbers): OriginBlockState;
57
57
  /** Enriches a stored fact with the chain state of its origin block (when retractable). */
58
58
  export declare function toFactWithOriginState(fact: Fact, tips: TipBlockNumbers): FactWithOriginState;
59
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JpZ2luX3N0YXRlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9mYWN0X3N0b3JlL29yaWdpbl9zdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQztBQUM5RCxPQUFPLEtBQUssRUFBRSxNQ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AAI,EAAE,eAAe,GAAG,gBAAgB,CAQrG;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,GAAG,mBAAmB,CAS5F"}
@@ -1,11 +1,11 @@
1
1
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
2
2
  import { BufferReader } from '@aztec-labs/foundation/serialize';
3
- import { FactCollectionKey, type OriginBlock } from './fact_store_keys.js';
3
+ import { type BlockReference, FactCollectionKey } from './fact_store_keys.js';
4
4
  /** A fact as returned by the fact store. */
5
5
  export type Fact = {
6
6
  factTypeId: Fr;
7
7
  payload: Fr[];
8
- originBlock: OriginBlock | undefined;
8
+ originBlock: BlockReference | undefined;
9
9
  };
10
10
  /**
11
11
  * A single immutable fact belonging to a fact collection.
@@ -14,8 +14,8 @@ export declare class StoredFact {
14
14
  readonly factCollectionKey: FactCollectionKey;
15
15
  readonly factTypeId: Fr;
16
16
  readonly payload: Fr[];
17
- readonly originBlock: OriginBlock | undefined;
18
- constructor(factCollectionKey: FactCollectionKey, factTypeId: Fr, payload: Fr[], originBlock: OriginBlock | undefined);
17
+ readonly originBlock: BlockReference | undefined;
18
+ constructor(factCollectionKey: FactCollectionKey, factTypeId: Fr, payload: Fr[], originBlock: BlockReference | undefined);
19
19
  /** Whether this fact is deleted on block pruning (true) or survives reorgs (false). */
20
20
  get isRetractable(): boolean;
21
21
  /** Stable digest of the payload, used for fact idempotency. */
@@ -29,4 +29,4 @@ export declare class StoredFact {
29
29
  * Builds the serialized key that identifies a fact in the store.
30
30
  */
31
31
  export declare function factKeyStrOf(fact: StoredFact): string;
32
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmVkX2ZhY3QuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2ZhY3Rfc3RvcmUvc3RvcmVkX2ZhY3QudHMiXSwibm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AAM,CAGrD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec-labs/pxe",
3
- "version": "6.0.0-rc.1",
3
+ "version": "6.0.0-rc.2",
4
4
  "type": "module",
5
5
  "typedocOptions": {
6
6
  "entryPoints": [
@@ -71,21 +71,21 @@
71
71
  ]
72
72
  },
73
73
  "dependencies": {
74
- "@aztec-foundation/bb.js": "6.0.0-rc.1",
75
- "@aztec-foundation/noir-acvm_js": "6.0.0-rc.1",
76
- "@aztec-foundation/noir-noirc_abi": "6.0.0-rc.1",
77
- "@aztec-foundation/noir-types": "6.0.0-rc.1",
78
- "@aztec-labs/bb-prover": "6.0.0-rc.1",
79
- "@aztec-labs/constants": "6.0.0-rc.1",
80
- "@aztec-labs/ethereum": "6.0.0-rc.1",
81
- "@aztec-labs/foundation": "6.0.0-rc.1",
82
- "@aztec-labs/key-store": "6.0.0-rc.1",
83
- "@aztec-labs/kv-store": "6.0.0-rc.1",
84
- "@aztec-labs/noir-protocol-circuits-types": "6.0.0-rc.1",
85
- "@aztec-labs/protocol-contracts": "6.0.0-rc.1",
86
- "@aztec-labs/simulator": "6.0.0-rc.1",
87
- "@aztec-labs/standard-contracts": "6.0.0-rc.1",
88
- "@aztec-labs/stdlib": "6.0.0-rc.1",
74
+ "@aztec-foundation/bb.js": "6.0.0-rc.5",
75
+ "@aztec-foundation/noir-acvm_js": "6.0.0-rc.5",
76
+ "@aztec-foundation/noir-noirc_abi": "6.0.0-rc.5",
77
+ "@aztec-foundation/noir-types": "6.0.0-rc.5",
78
+ "@aztec-labs/bb-prover": "6.0.0-rc.2",
79
+ "@aztec-labs/constants": "6.0.0-rc.2",
80
+ "@aztec-labs/ethereum": "6.0.0-rc.2",
81
+ "@aztec-labs/foundation": "6.0.0-rc.2",
82
+ "@aztec-labs/key-store": "6.0.0-rc.2",
83
+ "@aztec-labs/kv-store": "6.0.0-rc.2",
84
+ "@aztec-labs/noir-protocol-circuits-types": "6.0.0-rc.2",
85
+ "@aztec-labs/protocol-contracts": "6.0.0-rc.2",
86
+ "@aztec-labs/simulator": "6.0.0-rc.2",
87
+ "@aztec-labs/standard-contracts": "6.0.0-rc.2",
88
+ "@aztec-labs/stdlib": "6.0.0-rc.2",
89
89
  "koa": "^2.16.1",
90
90
  "koa-router": "^13.1.1",
91
91
  "lodash.omit": "^4.5.0",
@@ -94,8 +94,8 @@
94
94
  "viem": "npm:@aztec/viem@2.38.3"
95
95
  },
96
96
  "devDependencies": {
97
- "@aztec-labs/noir-test-contracts.js": "6.0.0-rc.1",
98
- "@aztec-labs/world-state": "6.0.0-rc.1",
97
+ "@aztec-labs/noir-test-contracts.js": "6.0.0-rc.2",
98
+ "@aztec-labs/world-state": "6.0.0-rc.2",
99
99
  "@jest/globals": "^30.0.0",
100
100
  "@types/jest": "^30.0.0",
101
101
  "@types/lodash.omit": "^4.5.7",
@@ -732,7 +732,12 @@ export async function generateSimulatedProvingResult(
732
732
  );
733
733
  gasUsed = meterGasUsed(revertibleData, isPrivateOnlyTx).add(meterGasUsed(nonRevertibleData, isPrivateOnlyTx));
734
734
  if (publicTeardownCallRequest) {
735
- gasUsed = gasUsed.add(privateExecutionResult.entrypoint.publicInputs.txContext.gasSettings.teardownGasLimits);
735
+ // The teardown call is dispatched by the AVM like any other enqueued public call, so it consumes the startup
736
+ // gas on top of its gas limits.
737
+ const teardownStartupGas = Gas.from({ daGas: 0, l2Gas: FIXED_AVM_STARTUP_L2_GAS });
738
+ gasUsed = gasUsed
739
+ .add(privateExecutionResult.entrypoint.publicInputs.txContext.gasSettings.teardownGasLimits)
740
+ .add(teardownStartupGas);
736
741
  }
737
742
 
738
743
  inputsForPublic = new PartialPrivateTailPublicInputsForPublic(
@@ -79,6 +79,8 @@ export { pickNotes } from './pick_notes.js';
79
79
  export type { IMiscOracle, IUtilityExecutionOracle, IPrivateExecutionOracle } from './oracle/interfaces.js';
80
80
  export type { FactCollection } from './noir-structs/fact_collection.js';
81
81
  export type { NoteData } from './noir-structs/note_data.js';
82
+ export type { NullifierStatus } from './noir-structs/nullifier_status.js';
83
+ export type { NoteOrigin } from './noir-structs/note_origin.js';
82
84
  export type { ResolvedTaggingStrategy } from './noir-structs/resolved_tagging_strategy.js';
83
85
  export { TxResolverService } from '../messages/tx_resolver_service.js';
84
86
  export { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
@@ -0,0 +1,11 @@
1
+ import type { Fr } from '@aztec-labs/foundation/curves/bn254';
2
+
3
+ import type { BlockReference } from '../../storage/fact_store/index.js';
4
+
5
+ /** TypeScript counterpart of `NoteOrigin` in Aztec.nr. */
6
+ export type NoteOrigin = {
7
+ /** Hash of the tx that created the note. */
8
+ txHash: Fr;
9
+ /** The block that tx was included in. */
10
+ block: BlockReference;
11
+ };
@@ -0,0 +1,9 @@
1
+ import type { BlockReference } from '../../storage/fact_store/index.js';
2
+ import type { Option } from './option.js';
3
+
4
+ /** TypeScript counterpart of `NullifierStatus` in Aztec.nr. */
5
+ export type NullifierStatus = {
6
+ exists: boolean;
7
+ /** The block the nullifier was included in. Absent when it does not exist or is pending in the current transaction. */
8
+ originBlock: Option<BlockReference>;
9
+ };
@@ -24,7 +24,10 @@ export class UnavailableOracleError extends Error {
24
24
  export function buildACIRCallback(
25
25
  handler: OracleHandler,
26
26
  options: {
27
- /** The contract whose function the callback is built for. */
27
+ /**
28
+ * The contract whose function the callback is built for. Protocol contracts are only served the protocol oracles,
29
+ * which no other contract is served.
30
+ */
28
31
  contractAddress?: AztecAddress;
29
32
  currentRegistry?: Record<string, OracleRegistryEntry>;
30
33
  legacyRegistry?: Record<string, LegacyOracleEntry>;
@@ -37,6 +40,18 @@ export function buildACIRCallback(
37
40
  legacyRegistry = LEGACY_ORACLE_REGISTRY,
38
41
  protocolRegistry = PROTOCOL_ORACLE_REGISTRY,
39
42
  } = options;
43
+ const calledByProtocolContract = contractAddress !== undefined && isProtocolContract(contractAddress);
44
+ const target = calledByProtocolContract
45
+ ? buildProtocolOracleCallbacks(handler, protocolRegistry)
46
+ : buildCurrentAndLegacyOracleCallbacks(handler, currentRegistry, legacyRegistry);
47
+ return new Proxy(target, makeUnknownOracleTrap(handler, calledByProtocolContract));
48
+ }
49
+
50
+ function buildCurrentAndLegacyOracleCallbacks(
51
+ handler: OracleHandler,
52
+ currentRegistry: Record<string, OracleRegistryEntry>,
53
+ legacyRegistry: Record<string, LegacyOracleEntry>,
54
+ ): ACIRCallback {
40
55
  const target = {} as ACIRCallback;
41
56
  for (const [oracleKey, entry] of Object.entries(currentRegistry)) {
42
57
  const { oracleKind, methodName } = parseOracleName(oracleKey, 'Oracle');
@@ -72,27 +87,23 @@ export function buildACIRCallback(
72
87
  };
73
88
  }
74
89
 
75
- // Protocol oracle names: served to protocol contracts only, each with its own wire.
76
- const calledByProtocolContract = contractAddress !== undefined && isProtocolContract(contractAddress);
90
+ return target;
91
+ }
92
+
93
+ function buildProtocolOracleCallbacks(
94
+ handler: OracleHandler,
95
+ protocolRegistry: Record<string, ProtocolOracleEntry>,
96
+ ): ACIRCallback {
97
+ const target = {} as ACIRCallback;
77
98
  for (const [protocolKey, protocol] of Object.entries(protocolRegistry)) {
78
- if (protocolKey in target) {
79
- throw new Error(`Protocol oracle "${protocolKey}" collides with another oracle of the same name`);
80
- }
81
99
  const wire = makeEntry({ params: [...protocol.params], returnType: protocol.returnType });
82
100
  target[protocolKey] = async (...inputs: ACVMField[][]) => {
83
- if (!calledByProtocolContract) {
84
- const caller = contractAddress ?? 'a caller that is not a contract';
85
- throw new Error(
86
- `Oracle '${protocolKey}' can only be called by protocol contracts, but was called by ${caller}`,
87
- );
88
- }
89
101
  assertHandlerSupportsOracleKind(handler, protocol.oracleKind);
90
102
  const args = wire.deserializeParams(inputs).map(p => p.value);
91
103
  return wire.serializeReturn(await protocol.serve(handler, args));
92
104
  };
93
105
  }
94
-
95
- return new Proxy(target, makeUnknownOracleTrap(handler, calledByProtocolContract));
106
+ return target;
96
107
  }
97
108
 
98
109
  /** Parses an `aztec_{oracleKind}_{method}` oracle name into its parts, throwing if it doesn't follow the convention. */
@@ -11,6 +11,7 @@ import {
11
11
  BLOCK_HASH,
12
12
  BLOCK_HEADER,
13
13
  BLOCK_NUMBER,
14
+ BLOCK_REFERENCE,
14
15
  BOOL,
15
16
  BOUNDED_VEC,
16
17
  CALL_PRIVATE_RESULT,
@@ -29,11 +30,12 @@ import {
29
30
  MEMBERSHIP_WITNESS,
30
31
  type MaybePromise,
31
32
  NOTE,
33
+ NOTE_ORIGIN,
32
34
  NOTE_SELECTOR,
33
35
  NOTE_VALIDATION_REQUEST,
34
36
  NULLIFIER_MEMBERSHIP_WITNESS,
37
+ NULLIFIER_STATUS,
35
38
  OPTION,
36
- ORIGIN_BLOCK,
37
39
  type OutputSlot,
38
40
  PENDING_TAGGED_LOG,
39
41
  POINT,
@@ -184,9 +186,9 @@ export const ORACLE_REGISTRY = {
184
186
  returnType: OPTION(PUBLIC_KEYS_AND_PARTIAL_ADDRESS),
185
187
  }),
186
188
 
187
- aztec_utl_doesNullifierExist: makeEntry({
188
- params: [{ name: 'innerNullifier', type: FIELD }],
189
- returnType: BOOL,
189
+ aztec_utl_getNullifierStatuses: makeEntry({
190
+ params: [{ name: 'innerNullifiers', type: EPHEMERAL_ARRAY(FIELD) }],
191
+ returnType: EPHEMERAL_ARRAY(NULLIFIER_STATUS),
190
192
  }),
191
193
 
192
194
  aztec_utl_getL1ToL2MembershipWitnessV2: makeEntry({
@@ -238,6 +240,15 @@ export const ORACLE_REGISTRY = {
238
240
  returnType: BOUNDED_VEC(NOTE),
239
241
  }),
240
242
 
243
+ aztec_utl_getSettledNoteOrigin: makeEntry({
244
+ params: [
245
+ { name: 'noteHash', type: FIELD },
246
+ { name: 'contractAddress', type: AZTEC_ADDRESS },
247
+ { name: 'noteNonce', type: FIELD },
248
+ ],
249
+ returnType: OPTION(NOTE_ORIGIN),
250
+ }),
251
+
241
252
  aztec_utl_getPendingTaggedLogsV2: makeEntry({
242
253
  params: [
243
254
  { name: 'scope', type: AZTEC_ADDRESS },
@@ -348,7 +359,7 @@ export const ORACLE_REGISTRY = {
348
359
  { name: 'factCollectionId', type: FIELD },
349
360
  { name: 'factTypeId', type: FIELD },
350
361
  { name: 'payload', type: EPHEMERAL_ARRAY(FIELD) },
351
- { name: 'originBlock', type: OPTION(ORIGIN_BLOCK) },
362
+ { name: 'originBlock', type: OPTION(BLOCK_REFERENCE) },
352
363
  ],
353
364
  }),
354
365
 
@@ -50,7 +50,7 @@ import {
50
50
  } from '@aztec-labs/stdlib/tx';
51
51
 
52
52
  import {
53
- type OriginBlock,
53
+ type BlockReference,
54
54
  type OriginBlockState,
55
55
  type RetractableFactOrigin,
56
56
  originBlockStateFromNumber,
@@ -65,8 +65,10 @@ import type { FactCollection } from '../noir-structs/fact_collection.js';
65
65
  import { type LogRetrievalRequest, type LogSource, logSourceFromField } from '../noir-structs/log_retrieval_request.js';
66
66
  import type { LogRetrievalResponse } from '../noir-structs/log_retrieval_response.js';
67
67
  import type { NoteData } from '../noir-structs/note_data.js';
68
+ import type { NoteOrigin } from '../noir-structs/note_origin.js';
68
69
  import { NoteValidationRequest } from '../noir-structs/note_validation_request.js';
69
70
  import type { NullifierMembershipWitnessData } from '../noir-structs/nullifier_membership_witness_data.js';
71
+ import type { NullifierStatus } from '../noir-structs/nullifier_status.js';
70
72
  import { Option } from '../noir-structs/option.js';
71
73
  import type { PendingTaggedLog } from '../noir-structs/pending_tagged_log.js';
72
74
  import type { ProvidedSecret } from '../noir-structs/provided_secret.js';
@@ -543,11 +545,21 @@ export const PENDING_TAGGED_LOG: TypeMapping<PendingTaggedLog> = STRUCT([
543
545
  { name: 'context', type: RESOLVED_TX },
544
546
  ]);
545
547
 
546
- export const ORIGIN_BLOCK: TypeMapping<OriginBlock> = STRUCT([
548
+ export const BLOCK_REFERENCE: TypeMapping<BlockReference> = STRUCT([
547
549
  { name: 'blockNumber', type: U32 },
548
550
  { name: 'blockHash', type: FIELD },
549
551
  ]);
550
552
 
553
+ export const NULLIFIER_STATUS: TypeMapping<NullifierStatus> = STRUCT([
554
+ { name: 'exists', type: BOOL },
555
+ { name: 'originBlock', type: OPTION(BLOCK_REFERENCE) },
556
+ ]);
557
+
558
+ export const NOTE_ORIGIN: TypeMapping<NoteOrigin> = STRUCT([
559
+ { name: 'txHash', type: FIELD },
560
+ { name: 'block', type: BLOCK_REFERENCE },
561
+ ]);
562
+
551
563
  const ORIGIN_BLOCK_STATE: TypeMapping<OriginBlockState> = SCALAR({
552
564
  kind: 'origin-block-state',
553
565
  serialization: { fn: v => [new Fr(v)] },
@@ -45,6 +45,7 @@ import { ExecutionTaggingIndexCache } from '../execution_tagging_index_cache.js'
45
45
  import type { HashedValuesCache } from '../hashed_values_cache.js';
46
46
  import { BoundedVec } from '../noir-structs/bounded_vec.js';
47
47
  import type { NoteData } from '../noir-structs/note_data.js';
48
+ import type { NullifierStatus } from '../noir-structs/nullifier_status.js';
48
49
  import { Option } from '../noir-structs/option.js';
49
50
  import type { ResolvedTaggingStrategy } from '../noir-structs/resolved_tagging_strategy.js';
50
51
  import { pickNotes } from '../pick_notes.js';
@@ -417,21 +418,23 @@ export class PrivateExecutionOracle extends UtilityExecutionOracle implements IP
417
418
  return Promise.resolve(preimage);
418
419
  }
419
420
 
420
- override async doesNullifierExist(innerNullifier: Fr): Promise<boolean> {
421
- // This oracle must be overridden because while utility execution can only meaningfully check if a nullifier exists
422
- // in the synched block, during private execution there's also the possibility of it being pending, i.e. created
423
- // in the current transaction.
421
+ protected override async getSiloedNullifierStatuses(siloedNullifiers: Fr[]): Promise<NullifierStatus[]> {
422
+ // This must be overridden because while utility execution can only meaningfully check if a nullifier exists in
423
+ // the anchor block, during private execution there's also the possibility of it being pending, i.e. created in
424
+ // the current transaction.
424
425
 
425
- this.logger.debug(`Checking existence of inner nullifier ${innerNullifier}`, {
426
+ this.logger.debug(`Checking existence of ${siloedNullifiers.length} nullifiers`, {
426
427
  contractAddress: this.contractAddress,
428
+ siloedNullifiers,
427
429
  });
428
430
 
429
- const nullifier = (await siloNullifier(this.contractAddress, innerNullifier)).toBigInt();
431
+ const pendingNullifiers = this.noteCache.getNullifiers(this.contractAddress);
432
+ const isPending = siloedNullifiers.map(nullifier => pendingNullifiers.has(nullifier.toBigInt()));
433
+ const settledStatuses = await super.getSiloedNullifierStatuses(siloedNullifiers.filter((_, i) => !isPending[i]));
430
434
 
431
- return (
432
- this.noteCache.getNullifiers(this.contractAddress).has(nullifier) ||
433
- (await super.doesNullifierExist(innerNullifier))
434
- );
435
+ const pendingStatus: NullifierStatus = { exists: true, originBlock: Option.none() };
436
+ let nextSettled = 0;
437
+ return isPending.map(pending => (pending ? pendingStatus : settledStatuses[nextSettled++]));
435
438
  }
436
439
 
437
440
  /**
@@ -5,7 +5,7 @@ import {
5
5
  PRIVATE_LOG_CIPHERTEXT_LEN,
6
6
  } from '@aztec-labs/constants';
7
7
  import type { BlockNumber } from '@aztec-labs/foundation/branded-types';
8
- import { uniqueBy } from '@aztec-labs/foundation/collection';
8
+ import { chunk, uniqueBy } from '@aztec-labs/foundation/collection';
9
9
  import { Aes128 } from '@aztec-labs/foundation/crypto/aes128';
10
10
  import { Fr } from '@aztec-labs/foundation/curves/bn254';
11
11
  import { Point } from '@aztec-labs/foundation/curves/grumpkin';
@@ -28,12 +28,12 @@ import { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
28
28
  import { BlockHash, type BlockParameter, type L2TipsProvider } from '@aztec-labs/stdlib/block';
29
29
  import type { CompleteAddress, ContractInstancePreimageWithAddress, PartialAddress } from '@aztec-labs/stdlib/contract';
30
30
  import { siloNullifier } from '@aztec-labs/stdlib/hash';
31
- import type { AztecNode } from '@aztec-labs/stdlib/interfaces/server';
31
+ import { type AztecNode, MAX_RPC_LEN } from '@aztec-labs/stdlib/interfaces/client';
32
32
  import type { KeyValidationRequest } from '@aztec-labs/stdlib/kernel';
33
33
  import { PublicKeys, computeAddressSecret, hashPublicKey } from '@aztec-labs/stdlib/keys';
34
34
  import { AppTaggingSecret, FlatPublicLogs, appSiloEcdhSharedSecret } from '@aztec-labs/stdlib/logs';
35
35
  import { type UnsiloedMessageNullifier, getL1ToL2MessageWitness } from '@aztec-labs/stdlib/messaging';
36
- import type { NoteStatus } from '@aztec-labs/stdlib/note';
36
+ import { NoteStatus } from '@aztec-labs/stdlib/note';
37
37
  import { MerkleTreeId } from '@aztec-labs/stdlib/trees';
38
38
  import {
39
39
  type BlockHeader,
@@ -58,7 +58,7 @@ import type { AddressStore } from '../../storage/address_store/address_store.js'
58
58
  import { assertAllowedScope } from '../../storage/allowed_scopes.js';
59
59
  import type { CapsuleService } from '../../storage/capsule_store/capsule_service.js';
60
60
  import { FactCollectionKey, FactCollectionTypeKey, anchoredTipBlockNumbers } from '../../storage/fact_store/index.js';
61
- import type { FactService, OriginBlock } from '../../storage/fact_store/index.js';
61
+ import type { BlockReference, FactService } from '../../storage/fact_store/index.js';
62
62
  import type { NoteStore } from '../../storage/note_store/note_store.js';
63
63
  import type { PrivateEventStore } from '../../storage/private_event_store/private_event_store.js';
64
64
  import type { ChangeSetId } from '../../storage/staged_write_coordinator.js';
@@ -74,11 +74,13 @@ import { type FactCollection, emptyFactCollection, toNoirFactCollection } from '
74
74
  import type { LogRetrievalRequest } from '../noir-structs/log_retrieval_request.js';
75
75
  import type { LogRetrievalResponse } from '../noir-structs/log_retrieval_response.js';
76
76
  import type { NoteData } from '../noir-structs/note_data.js';
77
+ import type { NoteOrigin } from '../noir-structs/note_origin.js';
77
78
  import type { NoteValidationRequest } from '../noir-structs/note_validation_request.js';
78
79
  import {
79
80
  type NullifierMembershipWitnessData,
80
81
  toNullifierMembershipWitnessData,
81
82
  } from '../noir-structs/nullifier_membership_witness_data.js';
83
+ import type { NullifierStatus } from '../noir-structs/nullifier_status.js';
82
84
  import { Option } from '../noir-structs/option.js';
83
85
  import type { PendingTaggedLog } from '../noir-structs/pending_tagged_log.js';
84
86
  import type { ProvidedSecret } from '../noir-structs/provided_secret.js';
@@ -506,17 +508,65 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
506
508
  }
507
509
 
508
510
  /**
509
- * Check if a nullifier exists in the nullifier tree.
510
- * @param innerNullifier - The inner nullifier.
511
- * @returns A boolean indicating whether the nullifier exists in the tree or not.
511
+ * Returns the tx and block in which a settled note of the executing contract was created, or `None` if no such note
512
+ * is known. Nullified notes are also returned.
512
513
  */
513
- public async doesNullifierExist(innerNullifier: Fr) {
514
- const [nullifier, anchor] = await allToCompletion([
515
- siloNullifier(this.contractAddress, innerNullifier!),
516
- this.anchorBlockHeader.toBlockParameter(),
517
- ]);
518
- const [leafIndex] = await this.aztecNode.findLeavesIndexes(anchor, MerkleTreeId.NULLIFIER_TREE, [nullifier]);
519
- return leafIndex?.data !== undefined;
514
+ public async getSettledNoteOrigin(
515
+ noteHash: Fr,
516
+ contractAddress: AztecAddress,
517
+ noteNonce: Fr,
518
+ ): Promise<Option<NoteOrigin>> {
519
+ this.#assertOwnContract(contractAddress);
520
+
521
+ // The store is only indexed by contract, so this scans all of the contract's notes. The query is rare enough and
522
+ // stores are small enough that this is not a concern.
523
+ const notes = await this.noteStore.getNotes(
524
+ { contractAddress, status: NoteStatus.ACTIVE_OR_NULLIFIED, scopes: this.scopes },
525
+ this.changeSetId,
526
+ );
527
+ const note = notes.find(note => note.noteHash.equals(noteHash) && note.noteNonce.equals(noteNonce));
528
+
529
+ return note
530
+ ? Option.some({
531
+ txHash: note.txHash.hash,
532
+ block: { blockNumber: note.l2BlockNumber, blockHash: Fr.fromHexString(note.l2BlockHash) },
533
+ })
534
+ : Option.none();
535
+ }
536
+
537
+ /**
538
+ * Returns the status of each inner nullifier: whether it exists in the nullifier tree at the anchor block and, if
539
+ * so, the block it was inserted in. Results are aligned with the input.
540
+ */
541
+ public async getNullifierStatuses(innerNullifiers: EphemeralArray<Fr>): Promise<EphemeralArray<NullifierStatus>> {
542
+ const siloedNullifiers = await allToCompletion(
543
+ innerNullifiers
544
+ .readAll(this.ephemeralArrayService)
545
+ .map(innerNullifier => siloNullifier(this.contractAddress, innerNullifier)),
546
+ );
547
+ const statuses = await this.getSiloedNullifierStatuses(siloedNullifiers);
548
+ return EphemeralArray.fromValues(this.ephemeralArrayService, statuses);
549
+ }
550
+
551
+ /** Looks up siloed nullifiers in the nullifier tree at the anchor block, returning one status per input. */
552
+ protected async getSiloedNullifierStatuses(siloedNullifiers: Fr[]): Promise<NullifierStatus[]> {
553
+ const anchor = await this.anchorBlockHeader.toBlockParameter();
554
+ const leaves = (
555
+ await allToCompletion(
556
+ chunk(siloedNullifiers, MAX_RPC_LEN).map(batch =>
557
+ this.aztecNode.findLeavesIndexes(anchor, MerkleTreeId.NULLIFIER_TREE, batch),
558
+ ),
559
+ )
560
+ ).flat();
561
+ return leaves.map(
562
+ (leaf): NullifierStatus =>
563
+ leaf
564
+ ? {
565
+ exists: true,
566
+ originBlock: Option.some({ blockNumber: leaf.l2BlockNumber, blockHash: leaf.l2BlockHash.toFr() }),
567
+ }
568
+ : { exists: false, originBlock: Option.none() },
569
+ );
520
570
  }
521
571
 
522
572
  /**
@@ -787,7 +837,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
787
837
  factCollectionId: Fr,
788
838
  factTypeId: Fr,
789
839
  payload: EphemeralArray<Fr>,
790
- originBlock: Option<OriginBlock>,
840
+ originBlock: Option<BlockReference>,
791
841
  ): Promise<void> {
792
842
  this.#assertOwnContract(contractAddress);
793
843
  return this.factService.recordFact(
@@ -37,6 +37,10 @@ export type SyncedOperationContext = {
37
37
  * {@link StagedWriteCoordinator}): staged writes are committed if the operation succeeds and discarded if it throws.
38
38
  */
39
39
  export class OperationQueue {
40
+ private static readonly WARN_QUEUE_DEPTH = 10;
41
+ private static readonly WARN_WAIT_MS = 30_000;
42
+ private static readonly WARN_INTERVAL_MS = 60_000;
43
+ private lastPressureWarningAt = -Infinity;
40
44
  private readonly queue = new SerialQueue();
41
45
  private readonly node: CachingAztecNode;
42
46
  private readonly synchronizer: BlockSynchronizer;
@@ -72,13 +76,40 @@ export class OperationQueue {
72
76
  */
73
77
  public run<T>(fn: () => Promise<T>): Promise<T> {
74
78
  // TODO(#12636): relax the conditions under which we forbid concurrency.
75
- if (this.queue.length() != 0) {
76
- this.log.warn(
77
- `PXE is already processing ${this.queue.length()} operations, concurrent execution is not supported. Will run once those are complete.`,
78
- );
79
+ const queued = new Timer();
80
+ const queueDepth = this.queue.length();
81
+ if (queueDepth >= OperationQueue.WARN_QUEUE_DEPTH) {
82
+ this.warnQueuePressure('depth', queueDepth, 0);
79
83
  }
84
+ const waitWarning = setTimeout(() => {
85
+ this.warnQueuePressure('wait', this.queue.length(), queued.ms());
86
+ }, OperationQueue.WARN_WAIT_MS);
80
87
 
81
- return this.queue.put(fn);
88
+ return this.queue
89
+ .put(() => {
90
+ clearTimeout(waitWarning);
91
+ this.log.debug('Starting queued PXE operation', {
92
+ eventName: 'pxe_operation_started',
93
+ queueDepth,
94
+ waitMs: queued.ms(),
95
+ });
96
+ return fn();
97
+ })
98
+ .finally(() => clearTimeout(waitWarning));
99
+ }
100
+
101
+ private warnQueuePressure(reason: 'depth' | 'wait', queueDepth: number, waitMs: number): void {
102
+ const now = Date.now();
103
+ if (now - this.lastPressureWarningAt < OperationQueue.WARN_INTERVAL_MS) {
104
+ return;
105
+ }
106
+ this.lastPressureWarningAt = now;
107
+ this.log.warn('PXE operation queue is congested', {
108
+ eventName: 'pxe_operation_queue_pressure',
109
+ reason,
110
+ queueDepth,
111
+ waitMs,
112
+ });
82
113
  }
83
114
 
84
115
  /**
@@ -10,8 +10,8 @@
10
10
  /// used to provide helpful error messages if a contract calls an oracle that doesn't exist. We don't throw immediately
11
11
  /// if AZTEC_NR_MINOR > PXE_MINOR because if a contract is updated to use a newer Aztec.nr dependency without actually
12
12
  /// using any of the new oracles then there is no reason to throw.
13
- export const ORACLE_VERSION_MAJOR = 31;
14
- export const ORACLE_VERSION_MINOR = 0;
13
+ export const ORACLE_VERSION_MAJOR = 32;
14
+ export const ORACLE_VERSION_MINOR = 1;
15
15
 
16
16
  /// This hash is computed from `ORACLE_REGISTRY` (each oracle's name, ordered parameter names and
17
17
  /// types, and return type) and is used to detect when the oracle interface changes. When it does, you need to either:
@@ -19,7 +19,7 @@ export const ORACLE_VERSION_MINOR = 0;
19
19
  /// - increment only `ORACLE_VERSION_MINOR` if the change is additive (a new oracle was added).
20
20
  ///
21
21
  /// These constants must be kept in sync between this file and `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
22
- export const ORACLE_INTERFACE_HASH = '34050955eaba2373f10bb168a41d8ea2634cf1bb3b86048cd168fe784fc82a73';
22
+ export const ORACLE_INTERFACE_HASH = 'f597d4c9e2b7d578e1b26ae757bfdc3bf698593cb82893dd80aad59442eecb7c';
23
23
 
24
24
  /// The oracle interface served to the protocol contracts, which is versioned separately from the Aztec.nr one above.
25
25
  /// It is a single number that must match exactly: protocol contracts are only rebuilt when they are redeployed on a
@@ -4,7 +4,7 @@ import type { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
4
4
  import { assertAllowedScope } from '../allowed_scopes.js';
5
5
  import type { ChangeSetId } from '../staged_write_coordinator.js';
6
6
  import type { FactStore } from './fact_store.js';
7
- import type { FactCollectionKey, FactCollectionTypeKey, OriginBlock } from './fact_store_keys.js';
7
+ import type { BlockReference, FactCollectionKey, FactCollectionTypeKey } from './fact_store_keys.js';
8
8
  import {
9
9
  type FactCollectionWithOriginState,
10
10
  type FactWithOriginState,
@@ -29,7 +29,7 @@ export class FactService {
29
29
  factCollectionKey: FactCollectionKey,
30
30
  factTypeId: Fr,
31
31
  payload: Fr[],
32
- originBlock: OriginBlock | undefined,
32
+ originBlock: BlockReference | undefined,
33
33
  changeSetId: ChangeSetId,
34
34
  ): Promise<void> {
35
35
  assertAllowedScope(factCollectionKey.scope, this.allowedScopes);