@aztec/archiver 0.83.1 → 0.84.0-alpha-testnet.1

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.
@@ -11,10 +11,10 @@ import { RunningPromise, makeLoggingErrorHandler } from '@aztec/foundation/runni
11
11
  import { count } from '@aztec/foundation/string';
12
12
  import { elapsed } from '@aztec/foundation/timer';
13
13
  import { InboxAbi } from '@aztec/l1-artifacts';
14
- import { ContractClassRegisteredEvent, PrivateFunctionBroadcastedEvent, UnconstrainedFunctionBroadcastedEvent } from '@aztec/protocol-contracts/class-registerer';
14
+ import { ContractClassRegisteredEvent, PrivateFunctionBroadcastedEvent, UtilityFunctionBroadcastedEvent } from '@aztec/protocol-contracts/class-registerer';
15
15
  import { ContractInstanceDeployedEvent, ContractInstanceUpdatedEvent } from '@aztec/protocol-contracts/instance-deployer';
16
16
  import { L2BlockSourceEvents } from '@aztec/stdlib/block';
17
- import { computePublicBytecodeCommitment, isValidPrivateFunctionMembershipProof, isValidUnconstrainedFunctionMembershipProof } from '@aztec/stdlib/contract';
17
+ import { computePublicBytecodeCommitment, isValidPrivateFunctionMembershipProof, isValidUtilityFunctionMembershipProof } from '@aztec/stdlib/contract';
18
18
  import { getEpochAtSlot, getEpochNumberAtTimestamp, getSlotAtTimestamp, getSlotRangeForEpoch, getTimestampRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
19
19
  import { Attributes, trackSpan } from '@aztec/telemetry-client';
20
20
  import { EventEmitter } from 'events';
@@ -731,7 +731,7 @@ var Operation = /*#__PURE__*/ function(Operation) {
731
731
  return true;
732
732
  }
733
733
  /**
734
- * Stores the functions that was broadcasted individually
734
+ * Stores the functions that were broadcasted individually
735
735
  *
736
736
  * @dev Beware that there is not a delete variant of this, since they are added to contract classes
737
737
  * and will be deleted as part of the class if needed.
@@ -740,13 +740,13 @@ var Operation = /*#__PURE__*/ function(Operation) {
740
740
  * @param _blockNum - The block number
741
741
  * @returns
742
742
  */ async #storeBroadcastedIndividualFunctions(allLogs, _blockNum) {
743
- // Filter out private and unconstrained function broadcast events
743
+ // Filter out private and utility function broadcast events
744
744
  const privateFnEvents = allLogs.filter((log)=>PrivateFunctionBroadcastedEvent.isPrivateFunctionBroadcastedEvent(log)).map((log)=>PrivateFunctionBroadcastedEvent.fromLog(log));
745
- const unconstrainedFnEvents = allLogs.filter((log)=>UnconstrainedFunctionBroadcastedEvent.isUnconstrainedFunctionBroadcastedEvent(log)).map((log)=>UnconstrainedFunctionBroadcastedEvent.fromLog(log));
745
+ const utilityFnEvents = allLogs.filter((log)=>UtilityFunctionBroadcastedEvent.isUtilityFunctionBroadcastedEvent(log)).map((log)=>UtilityFunctionBroadcastedEvent.fromLog(log));
746
746
  // Group all events by contract class id
747
747
  for (const [classIdString, classEvents] of Object.entries(groupBy([
748
748
  ...privateFnEvents,
749
- ...unconstrainedFnEvents
749
+ ...utilityFnEvents
750
750
  ], (e)=>e.contractClassId.toString()))){
751
751
  const contractClassId = Fr.fromHexString(classIdString);
752
752
  const contractClass = await this.getContractClass(contractClassId);
@@ -754,21 +754,21 @@ var Operation = /*#__PURE__*/ function(Operation) {
754
754
  this.#log.warn(`Skipping broadcasted functions as contract class ${contractClassId.toString()} was not found`);
755
755
  continue;
756
756
  }
757
- // Split private and unconstrained functions, and filter out invalid ones
757
+ // Split private and utility functions, and filter out invalid ones
758
758
  const allFns = classEvents.map((e)=>e.toFunctionWithMembershipProof());
759
- const privateFns = allFns.filter((fn)=>'unconstrainedFunctionsArtifactTreeRoot' in fn);
760
- const unconstrainedFns = allFns.filter((fn)=>'privateFunctionsArtifactTreeRoot' in fn);
759
+ const privateFns = allFns.filter((fn)=>'utilityFunctionsTreeRoot' in fn);
760
+ const utilityFns = allFns.filter((fn)=>'privateFunctionsArtifactTreeRoot' in fn);
761
761
  const privateFunctionsWithValidity = await Promise.all(privateFns.map(async (fn)=>({
762
762
  fn,
763
763
  valid: await isValidPrivateFunctionMembershipProof(fn, contractClass)
764
764
  })));
765
765
  const validPrivateFns = privateFunctionsWithValidity.filter(({ valid })=>valid).map(({ fn })=>fn);
766
- const unconstrainedFunctionsWithValidity = await Promise.all(unconstrainedFns.map(async (fn)=>({
766
+ const utilityFunctionsWithValidity = await Promise.all(utilityFns.map(async (fn)=>({
767
767
  fn,
768
- valid: await isValidUnconstrainedFunctionMembershipProof(fn, contractClass)
768
+ valid: await isValidUtilityFunctionMembershipProof(fn, contractClass)
769
769
  })));
770
- const validUnconstrainedFns = unconstrainedFunctionsWithValidity.filter(({ valid })=>valid).map(({ fn })=>fn);
771
- const validFnCount = validPrivateFns.length + validUnconstrainedFns.length;
770
+ const validUtilityFns = utilityFunctionsWithValidity.filter(({ valid })=>valid).map(({ fn })=>fn);
771
+ const validFnCount = validPrivateFns.length + validUtilityFns.length;
772
772
  if (validFnCount !== allFns.length) {
773
773
  this.#log.warn(`Skipping ${allFns.length - validFnCount} invalid functions`);
774
774
  }
@@ -776,7 +776,7 @@ var Operation = /*#__PURE__*/ function(Operation) {
776
776
  if (validFnCount > 0) {
777
777
  this.#log.verbose(`Storing ${validFnCount} functions for contract class ${contractClassId.toString()}`);
778
778
  }
779
- return await this.store.addFunctions(contractClassId, validPrivateFns, validUnconstrainedFns);
779
+ return await this.store.addFunctions(contractClassId, validPrivateFns, validUtilityFns);
780
780
  }
781
781
  return true;
782
782
  }
@@ -2,7 +2,7 @@ import type { Fr } from '@aztec/foundation/fields';
2
2
  import type { FunctionSelector } from '@aztec/stdlib/abi';
3
3
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
4
  import type { InBlock, L2Block } from '@aztec/stdlib/block';
5
- import type { ContractClassPublic, ContractInstanceUpdateWithAddress, ContractInstanceWithAddress, ExecutablePrivateFunctionWithMembershipProof, UnconstrainedFunctionWithMembershipProof } from '@aztec/stdlib/contract';
5
+ import type { ContractClassPublic, ContractInstanceUpdateWithAddress, ContractInstanceWithAddress, ExecutablePrivateFunctionWithMembershipProof, UtilityFunctionWithMembershipProof } from '@aztec/stdlib/contract';
6
6
  import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
7
7
  import type { LogFilter, PrivateLog, TxScopedL2Log } from '@aztec/stdlib/logs';
8
8
  import type { InboxLeaf } from '@aztec/stdlib/messaging';
@@ -183,7 +183,7 @@ export interface ArchiverDataStore {
183
183
  /**
184
184
  * Adds private functions to a contract class.
185
185
  */
186
- addFunctions(contractClassId: Fr, privateFunctions: ExecutablePrivateFunctionWithMembershipProof[], unconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[]): Promise<boolean>;
186
+ addFunctions(contractClassId: Fr, privateFunctions: ExecutablePrivateFunctionWithMembershipProof[], utilityFunctions: UtilityFunctionWithMembershipProof[]): Promise<boolean>;
187
187
  /**
188
188
  * Returns a contract instance given its address and the given block number, or undefined if not exists.
189
189
  * @param address - Address of the contract.
@@ -1 +1 @@
1
- {"version":3,"file":"archiver_store.d.ts","sourceRoot":"","sources":["../../src/archiver/archiver_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EACV,mBAAmB,EACnB,iCAAiC,EACjC,2BAA2B,EAC3B,4CAA4C,EAC5C,wCAAwC,EACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC3G,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,WAAW,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AAC;IAEpB;;;;OAIG;IACH,mBAAmB,CAAC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAAC;IAElH,+DAA+D;IAC/D,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IAKrC,kCAAkC,CAAC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAErG;;OAEG;IACH,YAAY,IAAI,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAEvF,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAExC,wCAAwC;IACxC,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
@@ -9,7 +9,7 @@ import { L2Block, wrapInBlock } from '@aztec/stdlib/block';
9
9
  import { SerializableContractInstance, computePublicBytecodeCommitment } from '@aztec/stdlib/contract';
10
10
  import { LogId, PrivateLog, PublicLog } from '@aztec/stdlib/logs';
11
11
  import { InboxLeaf } from '@aztec/stdlib/messaging';
12
- import { makeContractClassPublic, makeExecutablePrivateFunctionWithMembershipProof, makeUnconstrainedFunctionWithMembershipProof } from '@aztec/stdlib/testing';
12
+ import { makeContractClassPublic, makeExecutablePrivateFunctionWithMembershipProof, makeUtilityFunctionWithMembershipProof } from '@aztec/stdlib/testing';
13
13
  import '@aztec/stdlib/testing/jest';
14
14
  import { TxEffect, TxHash } from '@aztec/stdlib/tx';
15
15
  /**
@@ -408,18 +408,18 @@ import { TxEffect, TxHash } from '@aztec/stdlib/tx';
408
408
  const stored = await store.getContractClass(contractClass.id);
409
409
  expect(stored?.privateFunctions).toEqual(fns);
410
410
  });
411
- it('adds new unconstrained functions', async ()=>{
412
- const fns = times(3, makeUnconstrainedFunctionWithMembershipProof);
411
+ it('adds new utility functions', async ()=>{
412
+ const fns = times(3, makeUtilityFunctionWithMembershipProof);
413
413
  await store.addFunctions(contractClass.id, [], fns);
414
414
  const stored = await store.getContractClass(contractClass.id);
415
- expect(stored?.unconstrainedFunctions).toEqual(fns);
415
+ expect(stored?.utilityFunctions).toEqual(fns);
416
416
  });
417
- it('does not duplicate unconstrained functions', async ()=>{
418
- const fns = times(3, makeUnconstrainedFunctionWithMembershipProof);
417
+ it('does not duplicate utility functions', async ()=>{
418
+ const fns = times(3, makeUtilityFunctionWithMembershipProof);
419
419
  await store.addFunctions(contractClass.id, [], fns.slice(0, 1));
420
420
  await store.addFunctions(contractClass.id, [], fns);
421
421
  const stored = await store.getContractClass(contractClass.id);
422
- expect(stored?.unconstrainedFunctions).toEqual(fns);
422
+ expect(stored?.utilityFunctions).toEqual(fns);
423
423
  });
424
424
  });
425
425
  describe('getLogsByTags', ()=>{
@@ -1,6 +1,6 @@
1
1
  import { Fr } from '@aztec/foundation/fields';
2
2
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
3
- import type { ContractClassPublic, ExecutablePrivateFunctionWithMembershipProof, UnconstrainedFunctionWithMembershipProof } from '@aztec/stdlib/contract';
3
+ import type { ContractClassPublic, ExecutablePrivateFunctionWithMembershipProof, UtilityFunctionWithMembershipProof } from '@aztec/stdlib/contract';
4
4
  /**
5
5
  * LMDB implementation of the ArchiverDataStore interface.
6
6
  */
@@ -13,6 +13,6 @@ export declare class ContractClassStore {
13
13
  getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
14
14
  getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
15
15
  getContractClassIds(): Promise<Fr[]>;
16
- addFunctions(contractClassId: Fr, newPrivateFunctions: ExecutablePrivateFunctionWithMembershipProof[], newUnconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[]): Promise<boolean>;
16
+ addFunctions(contractClassId: Fr, newPrivateFunctions: ExecutablePrivateFunctionWithMembershipProof[], newUtilityFunctions: UtilityFunctionWithMembershipProof[]): Promise<boolean>;
17
17
  }
18
18
  //# sourceMappingURL=contract_class_store.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contract_class_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/contract_class_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EACV,mBAAmB,EAEnB,4CAA4C,EAC5C,wCAAwC,EACzC,MAAM,wBAAwB,CAAC;AAGhC;;GAEG;AACH,qBAAa,kBAAkB;;IAIjB,OAAO,CAAC,EAAE;gBAAF,EAAE,EAAE,iBAAiB;IAKnC,gBAAgB,CACpB,aAAa,EAAE,mBAAmB,EAClC,kBAAkB,EAAE,EAAE,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAQV,qBAAqB,CAAC,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7F,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAKlE,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC;IAKtD,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;IAIpC,YAAY,CAChB,eAAe,EAAE,EAAE,EACnB,mBAAmB,EAAE,4CAA4C,EAAE,EACnE,yBAAyB,EAAE,wCAAwC,EAAE,GACpE,OAAO,CAAC,OAAO,CAAC;CA4BpB"}
1
+ {"version":3,"file":"contract_class_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/contract_class_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AAExE,OAAO,KAAK,EACV,mBAAmB,EAEnB,4CAA4C,EAC5C,kCAAkC,EACnC,MAAM,wBAAwB,CAAC;AAGhC;;GAEG;AACH,qBAAa,kBAAkB;;IAIjB,OAAO,CAAC,EAAE;gBAAF,EAAE,EAAE,iBAAiB;IAKnC,gBAAgB,CACpB,aAAa,EAAE,mBAAmB,EAClC,kBAAkB,EAAE,EAAE,EACtB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,IAAI,CAAC;IAQV,qBAAqB,CAAC,aAAa,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ7F,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAKlE,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC;IAKtD,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;IAIpC,YAAY,CAChB,eAAe,EAAE,EAAE,EACnB,mBAAmB,EAAE,4CAA4C,EAAE,EACnE,mBAAmB,EAAE,kCAAkC,EAAE,GACxD,OAAO,CAAC,OAAO,CAAC;CA0BpB"}
@@ -42,23 +42,23 @@ import { Vector } from '@aztec/stdlib/types';
42
42
  async getContractClassIds() {
43
43
  return (await toArray(this.#contractClasses.keysAsync())).map((key)=>Fr.fromHexString(key));
44
44
  }
45
- async addFunctions(contractClassId, newPrivateFunctions, newUnconstrainedFunctions) {
45
+ async addFunctions(contractClassId, newPrivateFunctions, newUtilityFunctions) {
46
46
  await this.db.transactionAsync(async ()=>{
47
47
  const existingClassBuffer = await this.#contractClasses.getAsync(contractClassId.toString());
48
48
  if (!existingClassBuffer) {
49
49
  throw new Error(`Unknown contract class ${contractClassId} when adding private functions to store`);
50
50
  }
51
51
  const existingClass = deserializeContractClassPublic(existingClassBuffer);
52
- const { privateFunctions: existingPrivateFns, unconstrainedFunctions: existingUnconstrainedFns } = existingClass;
52
+ const { privateFunctions: existingPrivateFns, utilityFunctions: existingUtilityFns } = existingClass;
53
53
  const updatedClass = {
54
54
  ...existingClass,
55
55
  privateFunctions: [
56
56
  ...existingPrivateFns,
57
57
  ...newPrivateFunctions.filter((newFn)=>!existingPrivateFns.some((f)=>f.selector.equals(newFn.selector)))
58
58
  ],
59
- unconstrainedFunctions: [
60
- ...existingUnconstrainedFns,
61
- ...newUnconstrainedFunctions.filter((newFn)=>!existingUnconstrainedFns.some((f)=>f.selector.equals(newFn.selector)))
59
+ utilityFunctions: [
60
+ ...existingUtilityFns,
61
+ ...newUtilityFunctions.filter((newFn)=>!existingUtilityFns.some((f)=>f.selector.equals(newFn.selector)))
62
62
  ]
63
63
  };
64
64
  await this.#contractClasses.set(contractClassId.toString(), serializeContractClassPublic(updatedClass));
@@ -67,12 +67,12 @@ import { Vector } from '@aztec/stdlib/types';
67
67
  }
68
68
  }
69
69
  function serializeContractClassPublic(contractClass) {
70
- return serializeToBuffer(contractClass.l2BlockNumber, numToUInt8(contractClass.version), contractClass.artifactHash, contractClass.privateFunctions.length, contractClass.privateFunctions.map(serializePrivateFunction), contractClass.unconstrainedFunctions.length, contractClass.unconstrainedFunctions.map(serializeUnconstrainedFunction), contractClass.packedBytecode.length, contractClass.packedBytecode, contractClass.privateFunctionsRoot);
70
+ return serializeToBuffer(contractClass.l2BlockNumber, numToUInt8(contractClass.version), contractClass.artifactHash, contractClass.privateFunctions.length, contractClass.privateFunctions.map(serializePrivateFunction), contractClass.utilityFunctions.length, contractClass.utilityFunctions.map(serializeUtilityFunction), contractClass.packedBytecode.length, contractClass.packedBytecode, contractClass.privateFunctionsRoot);
71
71
  }
72
72
  function serializePrivateFunction(fn) {
73
- return serializeToBuffer(fn.selector, fn.vkHash, fn.bytecode.length, fn.bytecode, fn.functionMetadataHash, fn.artifactMetadataHash, fn.unconstrainedFunctionsArtifactTreeRoot, new Vector(fn.privateFunctionTreeSiblingPath), fn.privateFunctionTreeLeafIndex, new Vector(fn.artifactTreeSiblingPath), fn.artifactTreeLeafIndex);
73
+ return serializeToBuffer(fn.selector, fn.vkHash, fn.bytecode.length, fn.bytecode, fn.functionMetadataHash, fn.artifactMetadataHash, fn.utilityFunctionsTreeRoot, new Vector(fn.privateFunctionTreeSiblingPath), fn.privateFunctionTreeLeafIndex, new Vector(fn.artifactTreeSiblingPath), fn.artifactTreeLeafIndex);
74
74
  }
75
- function serializeUnconstrainedFunction(fn) {
75
+ function serializeUtilityFunction(fn) {
76
76
  return serializeToBuffer(fn.selector, fn.bytecode.length, fn.bytecode, fn.functionMetadataHash, fn.artifactMetadataHash, fn.privateFunctionsArtifactTreeRoot, new Vector(fn.artifactTreeSiblingPath), fn.artifactTreeLeafIndex);
77
77
  }
78
78
  function deserializeContractClassPublic(buffer) {
@@ -84,8 +84,8 @@ function deserializeContractClassPublic(buffer) {
84
84
  privateFunctions: reader.readVector({
85
85
  fromBuffer: deserializePrivateFunction
86
86
  }),
87
- unconstrainedFunctions: reader.readVector({
88
- fromBuffer: deserializeUnconstrainedFunction
87
+ utilityFunctions: reader.readVector({
88
+ fromBuffer: deserializeUtilityFunction
89
89
  }),
90
90
  packedBytecode: reader.readBuffer(),
91
91
  privateFunctionsRoot: reader.readObject(Fr)
@@ -99,14 +99,14 @@ function deserializePrivateFunction(buffer) {
99
99
  bytecode: reader.readBuffer(),
100
100
  functionMetadataHash: reader.readObject(Fr),
101
101
  artifactMetadataHash: reader.readObject(Fr),
102
- unconstrainedFunctionsArtifactTreeRoot: reader.readObject(Fr),
102
+ utilityFunctionsTreeRoot: reader.readObject(Fr),
103
103
  privateFunctionTreeSiblingPath: reader.readVector(Fr),
104
104
  privateFunctionTreeLeafIndex: reader.readNumber(),
105
105
  artifactTreeSiblingPath: reader.readVector(Fr),
106
106
  artifactTreeLeafIndex: reader.readNumber()
107
107
  };
108
108
  }
109
- function deserializeUnconstrainedFunction(buffer) {
109
+ function deserializeUtilityFunction(buffer) {
110
110
  const reader = BufferReader.asReader(buffer);
111
111
  return {
112
112
  selector: reader.readObject(FunctionSelector),
@@ -3,7 +3,7 @@ import type { AztecAsyncKVStore, StoreSize } from '@aztec/kv-store';
3
3
  import { FunctionSelector } from '@aztec/stdlib/abi';
4
4
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
5
  import type { L2Block } from '@aztec/stdlib/block';
6
- import type { ContractClassPublic, ContractInstanceUpdateWithAddress, ContractInstanceWithAddress, ExecutablePrivateFunctionWithMembershipProof, UnconstrainedFunctionWithMembershipProof } from '@aztec/stdlib/contract';
6
+ import type { ContractClassPublic, ContractInstanceUpdateWithAddress, ContractInstanceWithAddress, ExecutablePrivateFunctionWithMembershipProof, UtilityFunctionWithMembershipProof } from '@aztec/stdlib/contract';
7
7
  import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
8
8
  import { type LogFilter, PrivateLog, type TxScopedL2Log } from '@aztec/stdlib/logs';
9
9
  import type { InboxLeaf } from '@aztec/stdlib/messaging';
@@ -31,7 +31,7 @@ export declare class KVArchiverDataStore implements ArchiverDataStore {
31
31
  addContractClasses(data: ContractClassPublic[], bytecodeCommitments: Fr[], blockNumber: number): Promise<boolean>;
32
32
  deleteContractClasses(data: ContractClassPublic[], blockNumber: number): Promise<boolean>;
33
33
  getBytecodeCommitment(contractClassId: Fr): Promise<Fr | undefined>;
34
- addFunctions(contractClassId: Fr, privateFunctions: ExecutablePrivateFunctionWithMembershipProof[], unconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[]): Promise<boolean>;
34
+ addFunctions(contractClassId: Fr, privateFunctions: ExecutablePrivateFunctionWithMembershipProof[], utilityFunctions: UtilityFunctionWithMembershipProof[]): Promise<boolean>;
35
35
  addContractInstances(data: ContractInstanceWithAddress[], _blockNumber: number): Promise<boolean>;
36
36
  deleteContractInstances(data: ContractInstanceWithAddress[], _blockNumber: number): Promise<boolean>;
37
37
  addContractInstanceUpdates(data: ContractInstanceUpdateWithAddress[], blockNumber: number): Promise<boolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"kv_archiver_store.d.ts","sourceRoot":"","sources":["../../../src/archiver/kv_archiver_store/kv_archiver_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,mBAAmB,EACnB,iCAAiC,EACjC,2BAA2B,EAC3B,4CAA4C,EAC5C,wCAAwC,EACzC,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,4BAA4B,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC3G,OAAO,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAIvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAOhE,eAAO,M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AAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAQhE;;;;OAIG;IACH,oBAAoB,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,4BAA4B,CAAC;IAQ9E;;;OAGG;IACH,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC;IAI1C,sBAAsB,IAAI,OAAO,CAAC,MAAM,CAAC;IAInC,sBAAsB,CAAC,WAAW,EAAE,MAAM;IAI1C,4BAA4B,CAAC,aAAa,EAAE,MAAM;IAIlD,8BAA8B,CAAC,aAAa,EAAE,MAAM;IAI1D;;OAEG;IACG,aAAa,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAW7C,YAAY,IAAI,OAAO,CAAC,SAAS,CAAC;CAG1C"}
@@ -71,8 +71,8 @@ export const ARCHIVER_DB_VERSION = 1;
71
71
  getBytecodeCommitment(contractClassId) {
72
72
  return this.#contractClassStore.getBytecodeCommitment(contractClassId);
73
73
  }
74
- addFunctions(contractClassId, privateFunctions, unconstrainedFunctions) {
75
- return this.#contractClassStore.addFunctions(contractClassId, privateFunctions, unconstrainedFunctions);
74
+ addFunctions(contractClassId, privateFunctions, utilityFunctions) {
75
+ return this.#contractClassStore.addFunctions(contractClassId, privateFunctions, utilityFunctions);
76
76
  }
77
77
  async addContractInstances(data, _blockNumber) {
78
78
  return (await Promise.all(data.map((c)=>this.#contractInstanceStore.addContractInstance(c)))).every(Boolean);
package/dest/factory.js CHANGED
@@ -54,7 +54,7 @@ async function registerProtocolContracts(store) {
54
54
  const contractClassPublic = {
55
55
  ...contract.contractClass,
56
56
  privateFunctions: [],
57
- unconstrainedFunctions: []
57
+ utilityFunctions: []
58
58
  };
59
59
  const publicFunctionSignatures = contract.artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
60
60
  await store.registerContractFunctionSignatures(contract.address, publicFunctionSignatures);
@@ -1,11 +1,15 @@
1
1
  import { EthAddress } from '@aztec/foundation/eth-address';
2
+ import type { Fr } from '@aztec/foundation/fields';
3
+ import type { FunctionSelector } from '@aztec/stdlib/abi';
4
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
2
5
  import { L2Block, type L2BlockSource, type L2Tips } from '@aztec/stdlib/block';
6
+ import type { ContractClassPublic, ContractDataSource, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
3
7
  import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
4
8
  import { type BlockHeader, TxHash, TxReceipt } from '@aztec/stdlib/tx';
5
9
  /**
6
10
  * A mocked implementation of L2BlockSource to be used in tests.
7
11
  */
8
- export declare class MockL2BlockSource implements L2BlockSource {
12
+ export declare class MockL2BlockSource implements L2BlockSource, ContractDataSource {
9
13
  protected l2Blocks: L2Block[];
10
14
  private provenBlockNumber;
11
15
  private log;
@@ -85,5 +89,11 @@ export declare class MockL2BlockSource implements L2BlockSource {
85
89
  * @returns A promise that signals the l2 block source is now stopped.
86
90
  */
87
91
  stop(): Promise<void>;
92
+ getContractClass(_id: Fr): Promise<ContractClassPublic | undefined>;
93
+ getBytecodeCommitment(_id: Fr): Promise<Fr | undefined>;
94
+ getContract(_address: AztecAddress, _blockNumber?: number): Promise<ContractInstanceWithAddress | undefined>;
95
+ getContractClassIds(): Promise<Fr[]>;
96
+ getDebugFunctionName(_address: AztecAddress, _selector: FunctionSelector): Promise<string | undefined>;
97
+ registerContractFunctionSignatures(_address: AztecAddress, _signatures: string[]): Promise<void>;
88
98
  }
89
99
  //# sourceMappingURL=mock_l2_block_source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mock_l2_block_source.d.ts","sourceRoot":"","sources":["../../src/test/mock_l2_block_source.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,OAAO,EAAe,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC5F,OAAO,EAAE,K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AI,OAAO,CAAC,iBAAiB,CAAC;IAI5C;;;OAGG;IACI,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAK7B;;;OAGG;IACI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAK5B,gBAAgB,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC;IAInE,qBAAqB,CAAC,GAAG,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC;IAIvD,WAAW,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC;IAI5G,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC;IAIpC,oBAAoB,CAAC,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAItG,kCAAkC,CAAC,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAGjG"}
@@ -178,4 +178,22 @@ import { TxReceipt, TxStatus } from '@aztec/stdlib/tx';
178
178
  this.log.verbose('Stopping mock L2 block source');
179
179
  return Promise.resolve();
180
180
  }
181
+ getContractClass(_id) {
182
+ return Promise.resolve(undefined);
183
+ }
184
+ getBytecodeCommitment(_id) {
185
+ return Promise.resolve(undefined);
186
+ }
187
+ getContract(_address, _blockNumber) {
188
+ return Promise.resolve(undefined);
189
+ }
190
+ getContractClassIds() {
191
+ return Promise.resolve([]);
192
+ }
193
+ getDebugFunctionName(_address, _selector) {
194
+ return Promise.resolve(undefined);
195
+ }
196
+ registerContractFunctionSignatures(_address, _signatures) {
197
+ return Promise.resolve();
198
+ }
181
199
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/archiver",
3
- "version": "0.83.1",
3
+ "version": "0.84.0-alpha-testnet.1",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./dest/index.js",
@@ -64,17 +64,17 @@
64
64
  ]
65
65
  },
66
66
  "dependencies": {
67
- "@aztec/blob-lib": "0.83.1",
68
- "@aztec/blob-sink": "0.83.1",
69
- "@aztec/constants": "0.83.1",
70
- "@aztec/ethereum": "0.83.1",
71
- "@aztec/foundation": "0.83.1",
72
- "@aztec/kv-store": "0.83.1",
73
- "@aztec/l1-artifacts": "0.83.1",
74
- "@aztec/noir-protocol-circuits-types": "0.83.1",
75
- "@aztec/protocol-contracts": "0.83.1",
76
- "@aztec/stdlib": "0.83.1",
77
- "@aztec/telemetry-client": "0.83.1",
67
+ "@aztec/blob-lib": "0.84.0-alpha-testnet.1",
68
+ "@aztec/blob-sink": "0.84.0-alpha-testnet.1",
69
+ "@aztec/constants": "0.84.0-alpha-testnet.1",
70
+ "@aztec/ethereum": "0.84.0-alpha-testnet.1",
71
+ "@aztec/foundation": "0.84.0-alpha-testnet.1",
72
+ "@aztec/kv-store": "0.84.0-alpha-testnet.1",
73
+ "@aztec/l1-artifacts": "0.84.0-alpha-testnet.1",
74
+ "@aztec/noir-protocol-circuits-types": "0.84.0-alpha-testnet.1",
75
+ "@aztec/protocol-contracts": "0.84.0-alpha-testnet.1",
76
+ "@aztec/stdlib": "0.84.0-alpha-testnet.1",
77
+ "@aztec/telemetry-client": "0.84.0-alpha-testnet.1",
78
78
  "debug": "^4.3.4",
79
79
  "lodash.groupby": "^4.6.0",
80
80
  "lodash.omit": "^4.5.0",
@@ -10,7 +10,7 @@ import { InboxAbi } from '@aztec/l1-artifacts';
10
10
  import {
11
11
  ContractClassRegisteredEvent,
12
12
  PrivateFunctionBroadcastedEvent,
13
- UnconstrainedFunctionBroadcastedEvent,
13
+ UtilityFunctionBroadcastedEvent,
14
14
  } from '@aztec/protocol-contracts/class-registerer';
15
15
  import {
16
16
  ContractInstanceDeployedEvent,
@@ -31,10 +31,10 @@ import {
31
31
  type ContractDataSource,
32
32
  type ContractInstanceWithAddress,
33
33
  type ExecutablePrivateFunctionWithMembershipProof,
34
- type UnconstrainedFunctionWithMembershipProof,
34
+ type UtilityFunctionWithMembershipProof,
35
35
  computePublicBytecodeCommitment,
36
36
  isValidPrivateFunctionMembershipProof,
37
- isValidUnconstrainedFunctionMembershipProof,
37
+ isValidUtilityFunctionMembershipProof,
38
38
  } from '@aztec/stdlib/contract';
39
39
  import {
40
40
  type L1RollupConstants,
@@ -991,7 +991,7 @@ class ArchiverStoreHelper
991
991
  }
992
992
 
993
993
  /**
994
- * Stores the functions that was broadcasted individually
994
+ * Stores the functions that were broadcasted individually
995
995
  *
996
996
  * @dev Beware that there is not a delete variant of this, since they are added to contract classes
997
997
  * and will be deleted as part of the class if needed.
@@ -1001,17 +1001,17 @@ class ArchiverStoreHelper
1001
1001
  * @returns
1002
1002
  */
1003
1003
  async #storeBroadcastedIndividualFunctions(allLogs: ContractClassLog[], _blockNum: number) {
1004
- // Filter out private and unconstrained function broadcast events
1004
+ // Filter out private and utility function broadcast events
1005
1005
  const privateFnEvents = allLogs
1006
1006
  .filter(log => PrivateFunctionBroadcastedEvent.isPrivateFunctionBroadcastedEvent(log))
1007
1007
  .map(log => PrivateFunctionBroadcastedEvent.fromLog(log));
1008
- const unconstrainedFnEvents = allLogs
1009
- .filter(log => UnconstrainedFunctionBroadcastedEvent.isUnconstrainedFunctionBroadcastedEvent(log))
1010
- .map(log => UnconstrainedFunctionBroadcastedEvent.fromLog(log));
1008
+ const utilityFnEvents = allLogs
1009
+ .filter(log => UtilityFunctionBroadcastedEvent.isUtilityFunctionBroadcastedEvent(log))
1010
+ .map(log => UtilityFunctionBroadcastedEvent.fromLog(log));
1011
1011
 
1012
1012
  // Group all events by contract class id
1013
1013
  for (const [classIdString, classEvents] of Object.entries(
1014
- groupBy([...privateFnEvents, ...unconstrainedFnEvents], e => e.contractClassId.toString()),
1014
+ groupBy([...privateFnEvents, ...utilityFnEvents], e => e.contractClassId.toString()),
1015
1015
  )) {
1016
1016
  const contractClassId = Fr.fromHexString(classIdString);
1017
1017
  const contractClass = await this.getContractClass(contractClassId);
@@ -1020,27 +1020,27 @@ class ArchiverStoreHelper
1020
1020
  continue;
1021
1021
  }
1022
1022
 
1023
- // Split private and unconstrained functions, and filter out invalid ones
1023
+ // Split private and utility functions, and filter out invalid ones
1024
1024
  const allFns = classEvents.map(e => e.toFunctionWithMembershipProof());
1025
1025
  const privateFns = allFns.filter(
1026
- (fn): fn is ExecutablePrivateFunctionWithMembershipProof => 'unconstrainedFunctionsArtifactTreeRoot' in fn,
1026
+ (fn): fn is ExecutablePrivateFunctionWithMembershipProof => 'utilityFunctionsTreeRoot' in fn,
1027
1027
  );
1028
- const unconstrainedFns = allFns.filter(
1029
- (fn): fn is UnconstrainedFunctionWithMembershipProof => 'privateFunctionsArtifactTreeRoot' in fn,
1028
+ const utilityFns = allFns.filter(
1029
+ (fn): fn is UtilityFunctionWithMembershipProof => 'privateFunctionsArtifactTreeRoot' in fn,
1030
1030
  );
1031
1031
 
1032
1032
  const privateFunctionsWithValidity = await Promise.all(
1033
1033
  privateFns.map(async fn => ({ fn, valid: await isValidPrivateFunctionMembershipProof(fn, contractClass) })),
1034
1034
  );
1035
1035
  const validPrivateFns = privateFunctionsWithValidity.filter(({ valid }) => valid).map(({ fn }) => fn);
1036
- const unconstrainedFunctionsWithValidity = await Promise.all(
1037
- unconstrainedFns.map(async fn => ({
1036
+ const utilityFunctionsWithValidity = await Promise.all(
1037
+ utilityFns.map(async fn => ({
1038
1038
  fn,
1039
- valid: await isValidUnconstrainedFunctionMembershipProof(fn, contractClass),
1039
+ valid: await isValidUtilityFunctionMembershipProof(fn, contractClass),
1040
1040
  })),
1041
1041
  );
1042
- const validUnconstrainedFns = unconstrainedFunctionsWithValidity.filter(({ valid }) => valid).map(({ fn }) => fn);
1043
- const validFnCount = validPrivateFns.length + validUnconstrainedFns.length;
1042
+ const validUtilityFns = utilityFunctionsWithValidity.filter(({ valid }) => valid).map(({ fn }) => fn);
1043
+ const validFnCount = validPrivateFns.length + validUtilityFns.length;
1044
1044
  if (validFnCount !== allFns.length) {
1045
1045
  this.#log.warn(`Skipping ${allFns.length - validFnCount} invalid functions`);
1046
1046
  }
@@ -1049,7 +1049,7 @@ class ArchiverStoreHelper
1049
1049
  if (validFnCount > 0) {
1050
1050
  this.#log.verbose(`Storing ${validFnCount} functions for contract class ${contractClassId.toString()}`);
1051
1051
  }
1052
- return await this.store.addFunctions(contractClassId, validPrivateFns, validUnconstrainedFns);
1052
+ return await this.store.addFunctions(contractClassId, validPrivateFns, validUtilityFns);
1053
1053
  }
1054
1054
  return true;
1055
1055
  }
@@ -7,7 +7,7 @@ import type {
7
7
  ContractInstanceUpdateWithAddress,
8
8
  ContractInstanceWithAddress,
9
9
  ExecutablePrivateFunctionWithMembershipProof,
10
- UnconstrainedFunctionWithMembershipProof,
10
+ UtilityFunctionWithMembershipProof,
11
11
  } from '@aztec/stdlib/contract';
12
12
  import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
13
13
  import type { LogFilter, PrivateLog, TxScopedL2Log } from '@aztec/stdlib/logs';
@@ -221,7 +221,7 @@ export interface ArchiverDataStore {
221
221
  addFunctions(
222
222
  contractClassId: Fr,
223
223
  privateFunctions: ExecutablePrivateFunctionWithMembershipProof[],
224
- unconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[],
224
+ utilityFunctions: UtilityFunctionWithMembershipProof[],
225
225
  ): Promise<boolean>;
226
226
 
227
227
  /**
@@ -22,7 +22,7 @@ import { InboxLeaf } from '@aztec/stdlib/messaging';
22
22
  import {
23
23
  makeContractClassPublic,
24
24
  makeExecutablePrivateFunctionWithMembershipProof,
25
- makeUnconstrainedFunctionWithMembershipProof,
25
+ makeUtilityFunctionWithMembershipProof,
26
26
  } from '@aztec/stdlib/testing';
27
27
  import '@aztec/stdlib/testing/jest';
28
28
  import { TxEffect, TxHash } from '@aztec/stdlib/tx';
@@ -433,19 +433,19 @@ export function describeArchiverDataStore(
433
433
  expect(stored?.privateFunctions).toEqual(fns);
434
434
  });
435
435
 
436
- it('adds new unconstrained functions', async () => {
437
- const fns = times(3, makeUnconstrainedFunctionWithMembershipProof);
436
+ it('adds new utility functions', async () => {
437
+ const fns = times(3, makeUtilityFunctionWithMembershipProof);
438
438
  await store.addFunctions(contractClass.id, [], fns);
439
439
  const stored = await store.getContractClass(contractClass.id);
440
- expect(stored?.unconstrainedFunctions).toEqual(fns);
440
+ expect(stored?.utilityFunctions).toEqual(fns);
441
441
  });
442
442
 
443
- it('does not duplicate unconstrained functions', async () => {
444
- const fns = times(3, makeUnconstrainedFunctionWithMembershipProof);
443
+ it('does not duplicate utility functions', async () => {
444
+ const fns = times(3, makeUtilityFunctionWithMembershipProof);
445
445
  await store.addFunctions(contractClass.id, [], fns.slice(0, 1));
446
446
  await store.addFunctions(contractClass.id, [], fns);
447
447
  const stored = await store.getContractClass(contractClass.id);
448
- expect(stored?.unconstrainedFunctions).toEqual(fns);
448
+ expect(stored?.utilityFunctions).toEqual(fns);
449
449
  });
450
450
  });
451
451
 
@@ -7,7 +7,7 @@ import type {
7
7
  ContractClassPublic,
8
8
  ContractClassPublicWithBlockNumber,
9
9
  ExecutablePrivateFunctionWithMembershipProof,
10
- UnconstrainedFunctionWithMembershipProof,
10
+ UtilityFunctionWithMembershipProof,
11
11
  } from '@aztec/stdlib/contract';
12
12
  import { Vector } from '@aztec/stdlib/types';
13
13
 
@@ -60,7 +60,7 @@ export class ContractClassStore {
60
60
  async addFunctions(
61
61
  contractClassId: Fr,
62
62
  newPrivateFunctions: ExecutablePrivateFunctionWithMembershipProof[],
63
- newUnconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[],
63
+ newUtilityFunctions: UtilityFunctionWithMembershipProof[],
64
64
  ): Promise<boolean> {
65
65
  await this.db.transactionAsync(async () => {
66
66
  const existingClassBuffer = await this.#contractClasses.getAsync(contractClassId.toString());
@@ -69,7 +69,7 @@ export class ContractClassStore {
69
69
  }
70
70
 
71
71
  const existingClass = deserializeContractClassPublic(existingClassBuffer);
72
- const { privateFunctions: existingPrivateFns, unconstrainedFunctions: existingUnconstrainedFns } = existingClass;
72
+ const { privateFunctions: existingPrivateFns, utilityFunctions: existingUtilityFns } = existingClass;
73
73
 
74
74
  const updatedClass: Omit<ContractClassPublicWithBlockNumber, 'id'> = {
75
75
  ...existingClass,
@@ -77,11 +77,9 @@ export class ContractClassStore {
77
77
  ...existingPrivateFns,
78
78
  ...newPrivateFunctions.filter(newFn => !existingPrivateFns.some(f => f.selector.equals(newFn.selector))),
79
79
  ],
80
- unconstrainedFunctions: [
81
- ...existingUnconstrainedFns,
82
- ...newUnconstrainedFunctions.filter(
83
- newFn => !existingUnconstrainedFns.some(f => f.selector.equals(newFn.selector)),
84
- ),
80
+ utilityFunctions: [
81
+ ...existingUtilityFns,
82
+ ...newUtilityFunctions.filter(newFn => !existingUtilityFns.some(f => f.selector.equals(newFn.selector))),
85
83
  ],
86
84
  };
87
85
  await this.#contractClasses.set(contractClassId.toString(), serializeContractClassPublic(updatedClass));
@@ -98,8 +96,8 @@ function serializeContractClassPublic(contractClass: Omit<ContractClassPublicWit
98
96
  contractClass.artifactHash,
99
97
  contractClass.privateFunctions.length,
100
98
  contractClass.privateFunctions.map(serializePrivateFunction),
101
- contractClass.unconstrainedFunctions.length,
102
- contractClass.unconstrainedFunctions.map(serializeUnconstrainedFunction),
99
+ contractClass.utilityFunctions.length,
100
+ contractClass.utilityFunctions.map(serializeUtilityFunction),
103
101
  contractClass.packedBytecode.length,
104
102
  contractClass.packedBytecode,
105
103
  contractClass.privateFunctionsRoot,
@@ -114,7 +112,7 @@ function serializePrivateFunction(fn: ExecutablePrivateFunctionWithMembershipPro
114
112
  fn.bytecode,
115
113
  fn.functionMetadataHash,
116
114
  fn.artifactMetadataHash,
117
- fn.unconstrainedFunctionsArtifactTreeRoot,
115
+ fn.utilityFunctionsTreeRoot,
118
116
  new Vector(fn.privateFunctionTreeSiblingPath),
119
117
  fn.privateFunctionTreeLeafIndex,
120
118
  new Vector(fn.artifactTreeSiblingPath),
@@ -122,7 +120,7 @@ function serializePrivateFunction(fn: ExecutablePrivateFunctionWithMembershipPro
122
120
  );
123
121
  }
124
122
 
125
- function serializeUnconstrainedFunction(fn: UnconstrainedFunctionWithMembershipProof): Buffer {
123
+ function serializeUtilityFunction(fn: UtilityFunctionWithMembershipProof): Buffer {
126
124
  return serializeToBuffer(
127
125
  fn.selector,
128
126
  fn.bytecode.length,
@@ -142,7 +140,7 @@ function deserializeContractClassPublic(buffer: Buffer): Omit<ContractClassPubli
142
140
  version: reader.readUInt8() as 1,
143
141
  artifactHash: reader.readObject(Fr),
144
142
  privateFunctions: reader.readVector({ fromBuffer: deserializePrivateFunction }),
145
- unconstrainedFunctions: reader.readVector({ fromBuffer: deserializeUnconstrainedFunction }),
143
+ utilityFunctions: reader.readVector({ fromBuffer: deserializeUtilityFunction }),
146
144
  packedBytecode: reader.readBuffer(),
147
145
  privateFunctionsRoot: reader.readObject(Fr),
148
146
  };
@@ -156,7 +154,7 @@ function deserializePrivateFunction(buffer: Buffer | BufferReader): ExecutablePr
156
154
  bytecode: reader.readBuffer(),
157
155
  functionMetadataHash: reader.readObject(Fr),
158
156
  artifactMetadataHash: reader.readObject(Fr),
159
- unconstrainedFunctionsArtifactTreeRoot: reader.readObject(Fr),
157
+ utilityFunctionsTreeRoot: reader.readObject(Fr),
160
158
  privateFunctionTreeSiblingPath: reader.readVector(Fr),
161
159
  privateFunctionTreeLeafIndex: reader.readNumber(),
162
160
  artifactTreeSiblingPath: reader.readVector(Fr),
@@ -164,7 +162,7 @@ function deserializePrivateFunction(buffer: Buffer | BufferReader): ExecutablePr
164
162
  };
165
163
  }
166
164
 
167
- function deserializeUnconstrainedFunction(buffer: Buffer | BufferReader): UnconstrainedFunctionWithMembershipProof {
165
+ function deserializeUtilityFunction(buffer: Buffer | BufferReader): UtilityFunctionWithMembershipProof {
168
166
  const reader = BufferReader.asReader(buffer);
169
167
  return {
170
168
  selector: reader.readObject(FunctionSelector),
@@ -10,7 +10,7 @@ import type {
10
10
  ContractInstanceUpdateWithAddress,
11
11
  ContractInstanceWithAddress,
12
12
  ExecutablePrivateFunctionWithMembershipProof,
13
- UnconstrainedFunctionWithMembershipProof,
13
+ UtilityFunctionWithMembershipProof,
14
14
  } from '@aztec/stdlib/contract';
15
15
  import type { GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
16
16
  import { type LogFilter, PrivateLog, type TxScopedL2Log } from '@aztec/stdlib/logs';
@@ -117,9 +117,9 @@ export class KVArchiverDataStore implements ArchiverDataStore {
117
117
  addFunctions(
118
118
  contractClassId: Fr,
119
119
  privateFunctions: ExecutablePrivateFunctionWithMembershipProof[],
120
- unconstrainedFunctions: UnconstrainedFunctionWithMembershipProof[],
120
+ utilityFunctions: UtilityFunctionWithMembershipProof[],
121
121
  ): Promise<boolean> {
122
- return this.#contractClassStore.addFunctions(contractClassId, privateFunctions, unconstrainedFunctions);
122
+ return this.#contractClassStore.addFunctions(contractClassId, privateFunctions, utilityFunctions);
123
123
  }
124
124
 
125
125
  async addContractInstances(data: ContractInstanceWithAddress[], _blockNumber: number): Promise<boolean> {
package/src/factory.ts CHANGED
@@ -74,7 +74,7 @@ async function registerProtocolContracts(store: KVArchiverDataStore) {
74
74
  const contractClassPublic: ContractClassPublic = {
75
75
  ...contract.contractClass,
76
76
  privateFunctions: [],
77
- unconstrainedFunctions: [],
77
+ utilityFunctions: [],
78
78
  };
79
79
 
80
80
  const publicFunctionSignatures = contract.artifact.functions
@@ -1,15 +1,19 @@
1
1
  import { DefaultL1ContractsConfig } from '@aztec/ethereum';
2
2
  import { Buffer32 } from '@aztec/foundation/buffer';
3
3
  import { EthAddress } from '@aztec/foundation/eth-address';
4
+ import type { Fr } from '@aztec/foundation/fields';
4
5
  import { createLogger } from '@aztec/foundation/log';
6
+ import type { FunctionSelector } from '@aztec/stdlib/abi';
7
+ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
5
8
  import { L2Block, L2BlockHash, type L2BlockSource, type L2Tips } from '@aztec/stdlib/block';
9
+ import type { ContractClassPublic, ContractDataSource, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
6
10
  import { type L1RollupConstants, getSlotRangeForEpoch } from '@aztec/stdlib/epoch-helpers';
7
11
  import { type BlockHeader, TxHash, TxReceipt, TxStatus } from '@aztec/stdlib/tx';
8
12
 
9
13
  /**
10
14
  * A mocked implementation of L2BlockSource to be used in tests.
11
15
  */
12
- export class MockL2BlockSource implements L2BlockSource {
16
+ export class MockL2BlockSource implements L2BlockSource, ContractDataSource {
13
17
  protected l2Blocks: L2Block[] = [];
14
18
 
15
19
  private provenBlockNumber: number = 0;
@@ -221,4 +225,28 @@ export class MockL2BlockSource implements L2BlockSource {
221
225
  this.log.verbose('Stopping mock L2 block source');
222
226
  return Promise.resolve();
223
227
  }
228
+
229
+ getContractClass(_id: Fr): Promise<ContractClassPublic | undefined> {
230
+ return Promise.resolve(undefined);
231
+ }
232
+
233
+ getBytecodeCommitment(_id: Fr): Promise<Fr | undefined> {
234
+ return Promise.resolve(undefined);
235
+ }
236
+
237
+ getContract(_address: AztecAddress, _blockNumber?: number): Promise<ContractInstanceWithAddress | undefined> {
238
+ return Promise.resolve(undefined);
239
+ }
240
+
241
+ getContractClassIds(): Promise<Fr[]> {
242
+ return Promise.resolve([]);
243
+ }
244
+
245
+ getDebugFunctionName(_address: AztecAddress, _selector: FunctionSelector): Promise<string | undefined> {
246
+ return Promise.resolve(undefined);
247
+ }
248
+
249
+ registerContractFunctionSignatures(_address: AztecAddress, _signatures: string[]): Promise<void> {
250
+ return Promise.resolve();
251
+ }
224
252
  }