diff --git a/yarn-project/archiver/src/archiver/archiver.ts b/yarn-project/archiver/src/archiver/archiver.ts index c72c03b815f..c116f738515 100644 --- a/yarn-project/archiver/src/archiver/archiver.ts +++ b/yarn-project/archiver/src/archiver/archiver.ts @@ -36,7 +36,6 @@ import { isValidUnconstrainedFunctionMembershipProof, } from '@aztec/circuits.js'; import { createEthereumChain } from '@aztec/ethereum'; -import { type ContractArtifact } from '@aztec/foundation/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; @@ -766,12 +765,8 @@ export class Archiver implements ArchiveSource, Traceable { return; } - addContractArtifact(address: AztecAddress, artifact: ContractArtifact): Promise { - return this.store.addContractArtifact(address, artifact); - } - - getContractArtifact(address: AztecAddress): Promise { - return this.store.getContractArtifact(address); + registerContractFunctionNames(address: AztecAddress, names: Record): Promise { + return this.store.registerContractFunctionName(address, names); } getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise { @@ -1078,11 +1073,8 @@ class ArchiverStoreHelper getContractClassIds(): Promise { return this.store.getContractClassIds(); } - addContractArtifact(address: AztecAddress, contract: ContractArtifact): Promise { - return this.store.addContractArtifact(address, contract); - } - getContractArtifact(address: AztecAddress): Promise { - return this.store.getContractArtifact(address); + registerContractFunctionName(address: AztecAddress, names: Record): Promise { + return this.store.registerContractFunctionName(address, names); } getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise { return this.store.getContractFunctionName(address, selector); diff --git a/yarn-project/archiver/src/archiver/archiver_store.ts b/yarn-project/archiver/src/archiver/archiver_store.ts index 11d0abd7c35..d2056cba085 100644 --- a/yarn-project/archiver/src/archiver/archiver_store.ts +++ b/yarn-project/archiver/src/archiver/archiver_store.ts @@ -18,7 +18,7 @@ import { type PrivateLog, type UnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js'; -import { type ContractArtifact, type FunctionSelector } from '@aztec/foundation/abi'; +import { type FunctionSelector } from '@aztec/foundation/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type DataRetrieval } from './structs/data_retrieval.js'; @@ -261,12 +261,10 @@ export interface ArchiverDataStore { /** Returns the list of all class ids known by the archiver. */ getContractClassIds(): Promise; - addContractArtifact(address: AztecAddress, contract: ContractArtifact): Promise; - getContractArtifact(address: AztecAddress): Promise; - // TODO: These function names are in memory only as they are for development/debugging. They require the full contract // artifact supplied to the node out of band. This should be reviewed and potentially removed as part of // the node api cleanup process. + registerContractFunctionName(address: AztecAddress, names: Record): Promise; getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise; /** diff --git a/yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_store.test.ts b/yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_store.test.ts deleted file mode 100644 index 54fc9c7d69e..00000000000 --- a/yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_store.test.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { AztecAddress } from '@aztec/circuits.js'; -import { openTmpStore } from '@aztec/kv-store/lmdb'; -import { BenchmarkingContractArtifact } from '@aztec/noir-contracts.js/Benchmarking'; - -import { beforeEach } from '@jest/globals'; - -import { KVArchiverDataStore } from './kv_archiver_store.js'; - -describe('Contract Artifact Store', () => { - let archiverStore: KVArchiverDataStore; - - beforeEach(() => { - archiverStore = new KVArchiverDataStore(openTmpStore()); - }); - - it('Should add and return contract artifacts', async () => { - const artifact = BenchmarkingContractArtifact; - const address = AztecAddress.random(); - await archiverStore.addContractArtifact(address, artifact); - await expect(archiverStore.getContractArtifact(address)).resolves.toEqual(artifact); - }); -}); diff --git a/yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_store.ts b/yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_store.ts deleted file mode 100644 index 8e18df413f2..00000000000 --- a/yarn-project/archiver/src/archiver/kv_archiver_store/contract_artifacts_store.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { type AztecAddress } from '@aztec/circuits.js'; -import { type ContractArtifact } from '@aztec/foundation/abi'; -import { type AztecKVStore, type AztecMap } from '@aztec/kv-store'; -import { contractArtifactFromBuffer, contractArtifactToBuffer } from '@aztec/types/abi'; - -export class ContractArtifactsStore { - #contractArtifacts: AztecMap; - - constructor(db: AztecKVStore) { - this.#contractArtifacts = db.openMap('archiver_contract_artifacts'); - } - - addContractArtifact(address: AztecAddress, contractArtifact: ContractArtifact): Promise { - return this.#contractArtifacts.set(address.toString(), contractArtifactToBuffer(contractArtifact)); - } - - getContractArtifact(address: AztecAddress): ContractArtifact | undefined { - const contractArtifact = this.#contractArtifacts.get(address.toString()); - // TODO(@spalladino): AztecMap lies and returns Uint8Arrays instead of Buffers, hence the extra Buffer.from. - return contractArtifact && contractArtifactFromBuffer(Buffer.from(contractArtifact)); - } -} diff --git a/yarn-project/archiver/src/archiver/kv_archiver_store/kv_archiver_store.ts b/yarn-project/archiver/src/archiver/kv_archiver_store/kv_archiver_store.ts index b7dfaa60041..ac12a3ba185 100644 --- a/yarn-project/archiver/src/archiver/kv_archiver_store/kv_archiver_store.ts +++ b/yarn-project/archiver/src/archiver/kv_archiver_store/kv_archiver_store.ts @@ -17,7 +17,7 @@ import { type PrivateLog, type UnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js'; -import { type ContractArtifact, FunctionSelector } from '@aztec/foundation/abi'; +import { type FunctionSelector } from '@aztec/foundation/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { createLogger } from '@aztec/foundation/log'; import { type AztecKVStore } from '@aztec/kv-store'; @@ -26,7 +26,6 @@ import { type ArchiverDataStore, type ArchiverL1SynchPoint } from '../archiver_s import { type DataRetrieval } from '../structs/data_retrieval.js'; import { type L1Published } from '../structs/published.js'; import { BlockStore } from './block_store.js'; -import { ContractArtifactsStore } from './contract_artifacts_store.js'; import { ContractClassStore } from './contract_class_store.js'; import { ContractInstanceStore } from './contract_instance_store.js'; import { LogStore } from './log_store.js'; @@ -43,7 +42,6 @@ export class KVArchiverDataStore implements ArchiverDataStore { #messageStore: MessageStore; #contractClassStore: ContractClassStore; #contractInstanceStore: ContractInstanceStore; - #contractArtifactStore: ContractArtifactsStore; private functionNames = new Map(); #log = createLogger('archiver:data-store'); @@ -54,27 +52,22 @@ export class KVArchiverDataStore implements ArchiverDataStore { this.#messageStore = new MessageStore(db); this.#contractClassStore = new ContractClassStore(db); this.#contractInstanceStore = new ContractInstanceStore(db); - this.#contractArtifactStore = new ContractArtifactsStore(db); this.#nullifierStore = new NullifierStore(db); } - getContractArtifact(address: AztecAddress): Promise { - return Promise.resolve(this.#contractArtifactStore.getContractArtifact(address)); - } - // TODO: These function names are in memory only as they are for development/debugging. They require the full contract // artifact supplied to the node out of band. This should be reviewed and potentially removed as part of // the node api cleanup process. - getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise { + getContractFunctionName(_address: AztecAddress, selector: FunctionSelector): Promise { return Promise.resolve(this.functionNames.get(selector.toString())); } - async addContractArtifact(address: AztecAddress, contract: ContractArtifact): Promise { - await this.#contractArtifactStore.addContractArtifact(address, contract); - // Building tup this map of selectors to function names save expensive re-hydration of contract artifacts later - contract.functions.forEach(f => { - this.functionNames.set(FunctionSelector.fromNameAndParameters(f.name, f.parameters).toString(), f.name); - }); + registerContractFunctionName(_address: AztecAddress, names: Record): Promise { + for (const [selector, name] of Object.entries(names)) { + this.functionNames.set(selector, name); + } + + return Promise.resolve(); } getContractClass(id: Fr): Promise { diff --git a/yarn-project/archiver/src/archiver/memory_archiver_store/memory_archiver_store.ts b/yarn-project/archiver/src/archiver/memory_archiver_store/memory_archiver_store.ts index 1a31c8d14ce..fab9073e458 100644 --- a/yarn-project/archiver/src/archiver/memory_archiver_store/memory_archiver_store.ts +++ b/yarn-project/archiver/src/archiver/memory_archiver_store/memory_archiver_store.ts @@ -28,7 +28,7 @@ import { type PrivateLog, type UnconstrainedFunctionWithMembershipProof, } from '@aztec/circuits.js'; -import { type ContractArtifact, FunctionSelector } from '@aztec/foundation/abi'; +import { type FunctionSelector } from '@aztec/foundation/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { createLogger } from '@aztec/foundation/log'; @@ -68,8 +68,6 @@ export class MemoryArchiverStore implements ArchiverDataStore { */ private l1ToL2Messages = new L1ToL2MessageStore(); - private contractArtifacts: Map = new Map(); - private contractClasses: Map = new Map(); private bytecodeCommitments: Map = new Map(); @@ -86,6 +84,8 @@ export class MemoryArchiverStore implements ArchiverDataStore { private lastProvenL2BlockNumber: number = 0; private lastProvenL2EpochNumber: number = 0; + private functionNames = new Map(); + #log = createLogger('archiver:data-store'); constructor( @@ -730,26 +730,16 @@ export class MemoryArchiverStore implements ArchiverDataStore { }); } - public addContractArtifact(address: AztecAddress, contract: ContractArtifact): Promise { - this.contractArtifacts.set(address.toString(), contract); - return Promise.resolve(); - } - - public getContractArtifact(address: AztecAddress): Promise { - return Promise.resolve(this.contractArtifacts.get(address.toString())); + public getContractFunctionName(_address: AztecAddress, selector: FunctionSelector): Promise { + return Promise.resolve(this.functionNames.get(selector.toString())); } - async getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise { - const artifact = await this.getContractArtifact(address); - - if (!artifact) { - return undefined; + public registerContractFunctionName(_address: AztecAddress, names: Record): Promise { + for (const [selector, name] of Object.entries(names)) { + this.functionNames.set(selector, name); } - const func = artifact.functions.find(f => - FunctionSelector.fromNameAndParameters({ name: f.name, parameters: f.parameters }).equals(selector), - ); - return Promise.resolve(func?.name); + return Promise.resolve(); } public estimateSize(): { mappingSize: number; actualSize: number; numItems: number } { diff --git a/yarn-project/archiver/src/factory.ts b/yarn-project/archiver/src/factory.ts index 817770dcd52..018cbec57f9 100644 --- a/yarn-project/archiver/src/factory.ts +++ b/yarn-project/archiver/src/factory.ts @@ -4,6 +4,7 @@ import { computePublicBytecodeCommitment, getContractClassFromArtifact, } from '@aztec/circuits.js'; +import { FunctionSelector, FunctionType } from '@aztec/foundation/abi'; import { createLogger } from '@aztec/foundation/log'; import { type Maybe } from '@aztec/foundation/types'; import { type DataStoreConfig } from '@aztec/kv-store/config'; @@ -45,7 +46,15 @@ async function registerProtocolContracts(store: KVArchiverDataStore) { privateFunctions: [], unconstrainedFunctions: [], }; - await store.addContractArtifact(contract.address, contract.artifact); + + const functionNames: Record = {}; + for (const fn of contract.artifact.functions) { + if (fn.functionType === FunctionType.PUBLIC) { + functionNames[FunctionSelector.fromNameAndParameters(fn.name, fn.parameters).toString()] = fn.name; + } + } + + await store.registerContractFunctionName(contract.address, functionNames); const bytecodeCommitment = computePublicBytecodeCommitment(contractClassPublic.packedBytecode); await store.addContractClasses([contractClassPublic], [bytecodeCommitment], blockNumber); await store.addContractInstances([contract.instance], blockNumber); diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index 60e2ce1ca22..59ba35913fe 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -55,7 +55,6 @@ import { } from '@aztec/circuits.js'; import { computePublicDataTreeLeafSlot } from '@aztec/circuits.js/hash'; import { type L1ContractAddresses, createEthereumChain } from '@aztec/ethereum'; -import { type ContractArtifact } from '@aztec/foundation/abi'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { padArrayEnd } from '@aztec/foundation/collection'; import { type Logger, createLogger } from '@aztec/foundation/log'; @@ -901,10 +900,8 @@ export class AztecNodeService implements AztecNode, Traceable { return this.contractDataSource.addContractClass(contractClass); } - public addContractArtifact(address: AztecAddress, artifact: ContractArtifact): Promise { - this.log.info(`Adding contract artifact ${artifact.name} for ${address.toString()} via API`); - // TODO: Node should validate the artifact before accepting it - return this.contractDataSource.addContractArtifact(address, artifact); + public registerContractFunctionNames(_address: AztecAddress, names: Record): Promise { + return this.contractDataSource.registerContractFunctionNames(_address, names); } public flushTxs(): Promise { diff --git a/yarn-project/circuit-types/src/interfaces/archiver.test.ts b/yarn-project/circuit-types/src/interfaces/archiver.test.ts index 04aa0e0341d..4824b95365a 100644 --- a/yarn-project/circuit-types/src/interfaces/archiver.test.ts +++ b/yarn-project/circuit-types/src/interfaces/archiver.test.ts @@ -17,7 +17,6 @@ import { type JsonRpcTestContext, createJsonRpcTestSetup } from '@aztec/foundati import { fileURLToPath } from '@aztec/foundation/url'; import { loadContractArtifact } from '@aztec/types/abi'; -import { deepStrictEqual } from 'assert'; import { readFileSync } from 'fs'; import omit from 'lodash.omit'; import { resolve } from 'path'; @@ -223,15 +222,12 @@ describe('ArchiverApiSchema', () => { expect(result).toBe(1n); }); - it('getContractArtifact', async () => { - const result = await context.client.getContractArtifact(AztecAddress.random()); - deepStrictEqual(result, artifact); + it('registerContractFunctionNames', async () => { + await context.client.registerContractFunctionNames(AztecAddress.random(), { + [FunctionSelector.random().toString()]: 'test_fn', + }); }); - it('addContractArtifact', async () => { - await context.client.addContractArtifact(AztecAddress.random(), artifact); - }, 20_000); - it('getContract', async () => { const address = AztecAddress.random(); const result = await context.client.getContract(address); @@ -378,10 +374,9 @@ class MockArchiver implements ArchiverApi { expect(address).toBeInstanceOf(AztecAddress); return Promise.resolve(this.artifact); } - addContractArtifact(address: AztecAddress, contract: ContractArtifact): Promise { + registerContractFunctionNames(address: AztecAddress, names: Record): Promise { expect(address).toBeInstanceOf(AztecAddress); - // We use node's native assertion because jest's is too slow - deepStrictEqual(contract, this.artifact); + expect(names).toEqual(expect.any(Object)); return Promise.resolve(); } getL1ToL2Messages(blockNumber: bigint): Promise { diff --git a/yarn-project/circuit-types/src/interfaces/archiver.ts b/yarn-project/circuit-types/src/interfaces/archiver.ts index bf8ace98b60..302df9b5732 100644 --- a/yarn-project/circuit-types/src/interfaces/archiver.ts +++ b/yarn-project/circuit-types/src/interfaces/archiver.ts @@ -6,7 +6,6 @@ import { PrivateLog, PublicFunctionSchema, } from '@aztec/circuits.js'; -import { ContractArtifactSchema } from '@aztec/foundation/abi'; import { type ApiSchemaFor, optional, schemas } from '@aztec/foundation/schemas'; import { z } from 'zod'; @@ -69,8 +68,10 @@ export const ArchiverApiSchema: ApiSchemaFor = { getBytecodeCommitment: z.function().args(schemas.Fr).returns(schemas.Fr), getContract: z.function().args(schemas.AztecAddress).returns(ContractInstanceWithAddressSchema.optional()), getContractClassIds: z.function().args().returns(z.array(schemas.Fr)), - getContractArtifact: z.function().args(schemas.AztecAddress).returns(ContractArtifactSchema.optional()), - addContractArtifact: z.function().args(schemas.AztecAddress, ContractArtifactSchema).returns(z.void()), + registerContractFunctionNames: z + .function() + .args(schemas.AztecAddress, z.record(z.string(), z.string())) + .returns(z.void()), getL1ToL2Messages: z.function().args(schemas.BigInt).returns(z.array(schemas.Fr)), getL1ToL2MessageIndex: z.function().args(schemas.Fr).returns(schemas.BigInt.optional()), // TODO(#10007): Remove this method diff --git a/yarn-project/circuit-types/src/interfaces/aztec-node.test.ts b/yarn-project/circuit-types/src/interfaces/aztec-node.test.ts index 3bb4ee18185..53fee1105c6 100644 --- a/yarn-project/circuit-types/src/interfaces/aztec-node.test.ts +++ b/yarn-project/circuit-types/src/interfaces/aztec-node.test.ts @@ -19,13 +19,12 @@ import { getContractClassFromArtifact, } from '@aztec/circuits.js'; import { type L1ContractAddresses, L1ContractsNames } from '@aztec/ethereum'; -import { type ContractArtifact } from '@aztec/foundation/abi'; +import { type ContractArtifact, FunctionSelector } from '@aztec/foundation/abi'; import { memoize } from '@aztec/foundation/decorators'; import { type JsonRpcTestContext, createJsonRpcTestSetup } from '@aztec/foundation/json-rpc/test'; import { fileURLToPath } from '@aztec/foundation/url'; import { loadContractArtifact } from '@aztec/types/abi'; -import { deepStrictEqual } from 'assert'; import { readFileSync } from 'fs'; import omit from 'lodash.omit'; import times from 'lodash.times'; @@ -224,9 +223,11 @@ describe('AztecNodeApiSchema', () => { expect(response).toEqual(Object.fromEntries(ProtocolContractsNames.map(name => [name, expect.any(AztecAddress)]))); }); - it('addContractArtifact', async () => { - await context.client.addContractArtifact(AztecAddress.random(), artifact); - }, 20_000); + it('registerContractFunctionNames', async () => { + await context.client.registerContractFunctionNames(AztecAddress.random(), { + [FunctionSelector.random().toString()]: 'test_fn', + }); + }); it('getPrivateLogs', async () => { const response = await context.client.getPrivateLogs(1, 1); @@ -505,9 +506,7 @@ class MockAztecNode implements AztecNode { ) as ProtocolContractAddresses, ); } - addContractArtifact(address: AztecAddress, artifact: ContractArtifact): Promise { - expect(address).toBeInstanceOf(AztecAddress); - deepStrictEqual(artifact, this.artifact); + registerContractFunctionNames(_address: AztecAddress, _names: Record): Promise { return Promise.resolve(); } getPrivateLogs(_from: number, _limit: number): Promise { diff --git a/yarn-project/circuit-types/src/interfaces/aztec-node.ts b/yarn-project/circuit-types/src/interfaces/aztec-node.ts index e1979488813..f4b052b87fd 100644 --- a/yarn-project/circuit-types/src/interfaces/aztec-node.ts +++ b/yarn-project/circuit-types/src/interfaces/aztec-node.ts @@ -17,7 +17,6 @@ import { ProtocolContractAddressesSchema, } from '@aztec/circuits.js'; import { type L1ContractAddresses, L1ContractAddressesSchema } from '@aztec/ethereum'; -import { type ContractArtifact, ContractArtifactSchema } from '@aztec/foundation/abi'; import type { AztecAddress } from '@aztec/foundation/aztec-address'; import type { Fr } from '@aztec/foundation/fields'; import { createSafeJsonRpcClient, defaultFetch } from '@aztec/foundation/json-rpc/client'; @@ -287,7 +286,7 @@ export interface AztecNode * @param aztecAddress * @param artifact */ - addContractArtifact(address: AztecAddress, artifact: ContractArtifact): Promise; + registerContractFunctionNames(address: AztecAddress, names: Record): Promise; /** * Retrieves all private logs from up to `limit` blocks, starting from the block number `from`. @@ -534,7 +533,10 @@ export const AztecNodeApiSchema: ApiSchemaFor = { getProtocolContractAddresses: z.function().returns(ProtocolContractAddressesSchema), - addContractArtifact: z.function().args(schemas.AztecAddress, ContractArtifactSchema).returns(z.void()), + registerContractFunctionNames: z + .function() + .args(schemas.AztecAddress, z.record(z.string(), z.string())) + .returns(z.void()), getPrivateLogs: z.function().args(z.number(), z.number()).returns(z.array(PrivateLog.schema)), diff --git a/yarn-project/circuits.js/src/contract/interfaces/contract_data_source.ts b/yarn-project/circuits.js/src/contract/interfaces/contract_data_source.ts index 84ed5f4afd9..388a828b9cb 100644 --- a/yarn-project/circuits.js/src/contract/interfaces/contract_data_source.ts +++ b/yarn-project/circuits.js/src/contract/interfaces/contract_data_source.ts @@ -1,4 +1,4 @@ -import { type ContractArtifact, type FunctionSelector } from '@aztec/foundation/abi'; +import { type FunctionSelector } from '@aztec/foundation/abi'; import { type AztecAddress } from '@aztec/foundation/aztec-address'; import { type Fr } from '@aztec/foundation/fields'; @@ -45,11 +45,8 @@ export interface ContractDataSource { */ getContractClassIds(): Promise; - /** Returns a contract artifact. */ - getContractArtifact(address: AztecAddress): Promise; - /** Returns a function's name */ getContractFunctionName(address: AztecAddress, selector: FunctionSelector): Promise; - /** Registers a a contract artifact. */ - addContractArtifact(address: AztecAddress, contract: ContractArtifact): Promise; + /** Registers a function names. Useful for debugging. */ + registerContractFunctionNames(address: AztecAddress, names: Record): Promise; } diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index f919d5a137b..ec8c0226d61 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -52,6 +52,7 @@ import { type ContractArtifact, EventSelector, FunctionSelector, + FunctionType, encodeArguments, } from '@aztec/foundation/abi'; import { Fr, type Point } from '@aztec/foundation/fields'; @@ -240,8 +241,14 @@ export class PXEService implements PXE { await this.db.addContractArtifact(contractClassId, artifact); - // TODO: PXE may not want to broadcast the artifact to the network - await this.node.addContractArtifact(instance.address, artifact); + const functionNames: Record = {}; + for (const fn of artifact.functions) { + if (fn.functionType === FunctionType.PUBLIC) { + functionNames[FunctionSelector.fromNameAndParameters(fn.name, fn.parameters).toString()] = fn.name; + } + } + + await this.node.registerContractFunctionNames(instance.address, functionNames); // TODO(#10007): Node should get public contract class from the registration event, not from PXE registration await this.node.addContractClass({ ...contractClass, privateFunctions: [], unconstrainedFunctions: [] }); diff --git a/yarn-project/simulator/src/public/fixtures/index.ts b/yarn-project/simulator/src/public/fixtures/index.ts index 6789e8622d3..36c126c0ef3 100644 --- a/yarn-project/simulator/src/public/fixtures/index.ts +++ b/yarn-project/simulator/src/public/fixtures/index.ts @@ -4,6 +4,7 @@ import { BlockHeader, CallContext, type ContractClassPublic, + type ContractDataSource, type ContractInstanceWithAddress, DEFAULT_GAS_LIMIT, DEPLOYER_CONTRACT_ADDRESS, @@ -144,7 +145,7 @@ export function createTxForPublicCall( return tx; } -export class MockedAvmTestContractDataSource { +export class MockedAvmTestContractDataSource implements ContractDataSource { private fnName = 'public_dispatch'; private bytecode: Buffer; public fnSelector: FunctionSelector; @@ -218,7 +219,7 @@ export class MockedAvmTestContractDataSource { return Promise.resolve(this.fnName); } - addContractArtifact(_address: AztecAddress, _contract: ContractArtifact): Promise { + registerContractFunctionNames(_address: AztecAddress, _names: Record): Promise { return Promise.resolve(); } } diff --git a/yarn-project/txe/src/node/txe_node.ts b/yarn-project/txe/src/node/txe_node.ts index 35aa9266548..c798e9a9ae0 100644 --- a/yarn-project/txe/src/node/txe_node.ts +++ b/yarn-project/txe/src/node/txe_node.ts @@ -1,4 +1,4 @@ -import { type ContractArtifact, createLogger } from '@aztec/aztec.js'; +import { createLogger } from '@aztec/aztec.js'; import { type AztecNode, type EpochProofQuote, @@ -450,7 +450,7 @@ export class TXENode implements AztecNode { * @param aztecAddress * @param artifact */ - addContractArtifact(_address: AztecAddress, _artifact: ContractArtifact): Promise { + registerContractFunctionNames(_address: AztecAddress, _names: Record): Promise { throw new Error('TXE Node method addContractArtifact not implemented'); } diff --git a/yarn-project/txe/src/util/txe_public_contract_data_source.ts b/yarn-project/txe/src/util/txe_public_contract_data_source.ts index a56aeb40d8b..7d15b9d8d48 100644 --- a/yarn-project/txe/src/util/txe_public_contract_data_source.ts +++ b/yarn-project/txe/src/util/txe_public_contract_data_source.ts @@ -85,8 +85,8 @@ export class TXEPublicContractDataSource implements ContractDataSource { return Promise.resolve(func?.name); } - addContractArtifact(address: AztecAddress, contract: ContractArtifact): Promise { - return this.txeOracle.addContractArtifact(contract); + registerContractFunctionNames(_address: AztecAddress, _names: Record): Promise { + return Promise.resolve(); } // TODO(#10007): Remove this method.