diff --git a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr index fb0077e9d787..1b5ac82bf091 100644 --- a/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr +++ b/noir-projects/noir-contracts/contracts/contract_class_registerer_contract/src/main.nr @@ -44,7 +44,6 @@ pub contract ContractClassRegisterer { artifact_hash: Field, private_functions_root: Field, public_bytecode_commitment: Field, - emit: bool, ) { // TODO: Validate public_bytecode_commitment is the correct commitment of packed_public_bytecode // TODO: We should be able to remove public_bytecode_commitment from the input if it's calculated in this function @@ -103,18 +102,14 @@ pub contract ContractClassRegisterer { ], ); - // TODO(#10007): Drop this conditional and always emit the bytecode. We allow skipping the broadcast - // as a stopgap solution to allow txs to fit in Sepolia when we broadcast public bytecode. - if emit { - let event = ContractClassRegistered { - contract_class_id, - version: 1, - artifact_hash, - private_functions_root, - packed_public_bytecode, - }; - emit_contract_class_log(&mut context, event.serialize_non_standard()); - } + let event = ContractClassRegistered { + contract_class_id, + version: 1, + artifact_hash, + private_functions_root, + packed_public_bytecode, + }; + emit_contract_class_log(&mut context, event.serialize_non_standard()); } #[private] diff --git a/yarn-project/archiver/package.json b/yarn-project/archiver/package.json index 1786fba99e39..b4995016d04a 100644 --- a/yarn-project/archiver/package.json +++ b/yarn-project/archiver/package.json @@ -71,7 +71,6 @@ "@aztec/foundation": "workspace:^", "@aztec/kv-store": "workspace:^", "@aztec/l1-artifacts": "workspace:^", - "@aztec/noir-contracts.js": "workspace:^", "@aztec/noir-protocol-circuits-types": "workspace:^", "@aztec/protocol-contracts": "workspace:^", "@aztec/stdlib": "workspace:^", diff --git a/yarn-project/archiver/src/archiver/archiver.ts b/yarn-project/archiver/src/archiver/archiver.ts index b920b246b9d1..8a3d54201f41 100644 --- a/yarn-project/archiver/src/archiver/archiver.ts +++ b/yarn-project/archiver/src/archiver/archiver.ts @@ -825,16 +825,6 @@ export class Archiver extends EventEmitter implements ArchiveSource, Traceable { return this.store.getContractClassIds(); } - // TODO(#10007): Remove this method - async addContractClass(contractClass: ContractClassPublic): Promise { - await this.store.addContractClasses( - [contractClass], - [await computePublicBytecodeCommitment(contractClass.packedBytecode)], - 0, - ); - return; - } - registerContractFunctionSignatures(address: AztecAddress, signatures: string[]): Promise { return this.store.registerContractFunctionSignatures(address, signatures); } @@ -916,15 +906,6 @@ class ArchiverStoreHelper constructor(private readonly store: ArchiverDataStore) {} - // TODO(#10007): Remove this method - addContractClasses( - contractClasses: ContractClassPublic[], - bytecodeCommitments: Fr[], - blockNum: number, - ): Promise { - return this.store.addContractClasses(contractClasses, bytecodeCommitments, blockNum); - } - /** * Extracts and stores contract classes out of ContractClassRegistered events emitted by the class registerer contract. * @param allLogs - All logs emitted in a bunch of blocks. diff --git a/yarn-project/archiver/src/factory.ts b/yarn-project/archiver/src/factory.ts index 1c1de02f7d59..cffc08d05f9a 100644 --- a/yarn-project/archiver/src/factory.ts +++ b/yarn-project/archiver/src/factory.ts @@ -2,18 +2,12 @@ import type { BlobSinkClientInterface } from '@aztec/blob-sink/client'; import { createLogger } from '@aztec/foundation/log'; import type { DataStoreConfig } from '@aztec/kv-store/config'; import { createStore } from '@aztec/kv-store/lmdb-v2'; -import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; -import { TokenBridgeContractArtifact } from '@aztec/noir-contracts.js/TokenBridge'; import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree'; import { protocolContractNames, protocolContractTreeRoot } from '@aztec/protocol-contracts'; import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle'; import { FunctionType, decodeFunctionSignature } from '@aztec/stdlib/abi'; import type { L2BlockSourceEventEmitter } from '@aztec/stdlib/block'; -import { - type ContractClassPublic, - computePublicBytecodeCommitment, - getContractClassFromArtifact, -} from '@aztec/stdlib/contract'; +import { type ContractClassPublic, computePublicBytecodeCommitment } from '@aztec/stdlib/contract'; import type { ArchiverApi, Service } from '@aztec/stdlib/interfaces/server'; import { getComponentsVersionsFromConfig } from '@aztec/stdlib/versioning'; import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client'; @@ -45,7 +39,6 @@ export async function createArchiver( ); const archiverStore = new KVArchiverDataStore(store, config.maxLogs); await registerProtocolContracts(archiverStore); - await registerCommonContracts(archiverStore); return Archiver.createAndSync(config, archiverStore, { telemetry, blobSinkClient }, opts.blockUntilSync); } @@ -86,22 +79,3 @@ async function registerProtocolContracts(store: KVArchiverDataStore) { await store.addContractInstances([contract.instance], blockNumber); } } - -// TODO(#10007): Remove this method. We are explicitly registering these contracts -// here to ensure they are available to all nodes and all prover nodes, since the PXE -// was tweaked to automatically push contract classes to the node it is registered, -// but other nodes in the network may require the contract classes to be registered as well. -// TODO(#10007): Remove the dependency on noir-contracts.js from this package once we remove this. -async function registerCommonContracts(store: KVArchiverDataStore) { - const blockNumber = 0; - const artifacts = [TokenBridgeContractArtifact, TokenContractArtifact]; - const classes = await Promise.all( - artifacts.map(async artifact => ({ - ...(await getContractClassFromArtifact(artifact)), - privateFunctions: [], - unconstrainedFunctions: [], - })), - ); - const bytecodeCommitments = await Promise.all(classes.map(x => computePublicBytecodeCommitment(x.packedBytecode))); - await store.addContractClasses(classes, bytecodeCommitments, blockNumber); -} diff --git a/yarn-project/archiver/tsconfig.json b/yarn-project/archiver/tsconfig.json index 9c8c348f66ca..a376e396483d 100644 --- a/yarn-project/archiver/tsconfig.json +++ b/yarn-project/archiver/tsconfig.json @@ -27,9 +27,6 @@ { "path": "../l1-artifacts" }, - { - "path": "../noir-contracts.js" - }, { "path": "../noir-protocol-circuits-types" }, diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index ebc2ad8dc046..82463cb700b1 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -8,7 +8,6 @@ import { type NOTE_HASH_TREE_HEIGHT, type NULLIFIER_TREE_HEIGHT, type PUBLIC_DATA_TREE_HEIGHT, - REGISTERER_CONTRACT_ADDRESS, } from '@aztec/constants'; import { EpochCache } from '@aztec/epoch-cache'; import { type L1ContractAddresses, createEthereumChain } from '@aztec/ethereum'; @@ -49,7 +48,7 @@ import type { ProtocolContractAddresses, } from '@aztec/stdlib/contract'; import type { GasFees } from '@aztec/stdlib/gas'; -import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/stdlib/hash'; +import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash'; import type { AztecNode, AztecNodeAdmin, @@ -69,8 +68,8 @@ import { import type { LogFilter, PrivateLog, TxScopedL2Log } from '@aztec/stdlib/logs'; import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging'; import { P2PClientType } from '@aztec/stdlib/p2p'; -import { MerkleTreeId, NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees'; import type { NullifierLeafPreimage, PublicDataTreeLeaf, PublicDataTreeLeafPreimage } from '@aztec/stdlib/trees'; +import { MerkleTreeId, NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees'; import { type BlockHeader, PublicSimulationOutput, @@ -369,25 +368,8 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable { return Promise.resolve(this.l1ChainId); } - public async getContractClass(id: Fr): Promise { - const klazz = await this.contractDataSource.getContractClass(id); - - // TODO(#10007): Remove this check. This is needed only because we're manually registering - // some contracts in the archiver so they are available to all nodes (see `registerCommonContracts` - // in `archiver/src/factory.ts`), but we still want clients to send the registration tx in order - // to emit the corresponding nullifier, which is now being checked. Note that this method - // is only called by the PXE to check if a contract is publicly registered. - if (klazz) { - const classNullifier = await siloNullifier(AztecAddress.fromNumber(REGISTERER_CONTRACT_ADDRESS), id); - const worldState = await this.#getWorldState('latest'); - const [index] = await worldState.findLeafIndices(MerkleTreeId.NULLIFIER_TREE, [classNullifier.toBuffer()]); - this.log.debug(`Registration nullifier ${classNullifier} for contract class ${id} found at index ${index}`); - if (index === undefined) { - return undefined; - } - } - - return klazz; + public getContractClass(id: Fr): Promise { + return this.contractDataSource.getContractClass(id); } public getContract(address: AztecAddress): Promise { @@ -951,12 +933,6 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable { }); } - // TODO(#10007): Remove this method - public addContractClass(contractClass: ContractClassPublic): Promise { - this.log.info(`Adding contract class via API ${contractClass.id}`); - return this.contractDataSource.addContractClass(contractClass); - } - public registerContractFunctionSignatures(_address: AztecAddress, signatures: string[]): Promise { return this.contractDataSource.registerContractFunctionSignatures(_address, signatures); } diff --git a/yarn-project/aztec.js/src/contract/deploy_method.ts b/yarn-project/aztec.js/src/contract/deploy_method.ts index 95522bc7994c..bd652993aeb7 100644 --- a/yarn-project/aztec.js/src/contract/deploy_method.ts +++ b/yarn-project/aztec.js/src/contract/deploy_method.ts @@ -94,9 +94,6 @@ export class DeployMethod extends Bas public async request(options: DeployOptions = {}): Promise> { const deployment = await this.getDeploymentFunctionCalls(options); - // NOTE: MEGA HACK. Remove with #10007 - // register the contract after generating deployment function calls in order to publicly register the class and (optioanlly) emit its bytecode - // // TODO: Should we add the contracts to the DB here, or once the tx has been sent or mined? // Note that we need to run this registerContract here so it's available when computeFeeOptionsFromEstimatedGas // runs, since it needs the contract to have been registered in order to estimate gas for its initialization, diff --git a/yarn-project/aztec.js/src/deployment/register_class.ts b/yarn-project/aztec.js/src/deployment/register_class.ts index 4cd770c00a1c..5fa30e6c30fd 100644 --- a/yarn-project/aztec.js/src/deployment/register_class.ts +++ b/yarn-project/aztec.js/src/deployment/register_class.ts @@ -9,27 +9,15 @@ import type { ContractFunctionInteraction } from '../contract/contract_function_ import { getRegistererContract } from '../contract/protocol_contracts.js'; import type { Wallet } from '../wallet/index.js'; -const defaultEmitPublicBytecode = - // guard against `process` not being defined (e.g. in the browser) - typeof process === 'object' && typeof process.env === 'object' - ? ['1', 'true', 'yes', ''].includes(process.env.AZTEC_EMIT_PUBLIC_BYTECODE ?? '') - : true; - /** Sets up a call to register a contract class given its artifact. */ export async function registerContractClass( wallet: Wallet, artifact: ContractArtifact, - emitPublicBytecode = defaultEmitPublicBytecode, ): Promise { const { artifactHash, privateFunctionsRoot, publicBytecodeCommitment, packedBytecode } = await getContractClassFromArtifact(artifact); const registerer = await getRegistererContract(wallet); - const fn = registerer.methods.register( - artifactHash, - privateFunctionsRoot, - publicBytecodeCommitment, - emitPublicBytecode, - ); + const fn = registerer.methods.register(artifactHash, privateFunctionsRoot, publicBytecodeCommitment); const encodedBytecode = bufferAsFields(packedBytecode, MAX_PACKED_PUBLIC_BYTECODE_SIZE_IN_FIELDS); fn.addCapsule( diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts index 6e5230ccc3b5..724fcaca269d 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract/contract_class_registration.test.ts @@ -1,4 +1,3 @@ -import type { AztecNodeService } from '@aztec/aztec-node'; import { AztecAddress, type AztecNode, @@ -24,7 +23,6 @@ import { import { writeTestData } from '@aztec/foundation/testing/files'; import { StatefulTestContract } from '@aztec/noir-contracts.js/StatefulTest'; import { TestContract } from '@aztec/noir-contracts.js/Test'; -import { TokenContractArtifact } from '@aztec/noir-contracts.js/Token'; import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi'; import type { ContractClassIdPreimage } from '@aztec/stdlib/contract'; import { PublicKeys } from '@aztec/stdlib/keys'; @@ -52,49 +50,25 @@ describe('e2e_deploy_contract contract class registration', () => { beforeAll(async () => { artifact = StatefulTestContract.artifact; - registrationTxReceipt = await registerContractClass(wallet, artifact, false).then(c => c.send().wait()); + registrationTxReceipt = await registerContractClass(wallet, artifact).then(c => c.send().wait()); contractClass = await getContractClassFromArtifact(artifact); - - // TODO(#10007) Remove this call. Node should get the bytecode from the event broadcast. - expect(await aztecNode.getContractClass(contractClass.id)).toBeUndefined(); - await aztecNode.addContractClass({ ...contractClass, privateFunctions: [], unconstrainedFunctions: [] }); + expect(await aztecNode.getContractClass(contractClass.id)).toBeDefined(); }); describe('registering a contract class', () => { - it('optionally emits public bytecode', async () => { - const registrationTxReceipt = await registerContractClass(wallet, TestContract.artifact, true).then(c => + it('emits public bytecode', async () => { + const registrationTxReceipt = await registerContractClass(wallet, TestContract.artifact).then(c => c.send().wait(), ); const logs = await aztecNode.getContractClassLogs({ txHash: registrationTxReceipt.txHash }); expect(logs.logs.length).toEqual(1); - - // TODO(#10007): The below is temporary as it's commented out on a below test - const logData = logs.logs[0].log.toBuffer(); - writeTestData('yarn-project/protocol-contracts/fixtures/ContractClassRegisteredEventData.hex', logData); - }); - - // TODO(#10007) Remove this test. We should always broadcast public bytecode. - it('bypasses broadcast if exceeds bytecode limit for event size', async () => { - const logs = await aztecNode.getContractClassLogs({ txHash: registrationTxReceipt.txHash }); - expect(logs.logs.length).toEqual(0); - }); - - // TODO(#10007) Remove this test as well. - it('starts archiver with pre-registered common contracts', async () => { - const { id: classId } = await getContractClassFromArtifact(TokenContractArtifact); - // The node checks the registration nullifier - expect(await aztecNode.getContractClass(classId)).toBeUndefined(); - // But the archiver does not - const archiver = (aztecNode as AztecNodeService).getContractDataSource(); - expect(await archiver.getContractClass(classId)).toBeDefined(); }); it('registers the contract class on the node', async () => { - // TODO(#10007) Enable this. - // const logs = await aztecNode.getContractClassLogs({ txHash: registrationTxReceipt.txHash }); - // expect(logs.logs.length).toEqual(1); - // const logData = logs.logs[0].log.toBuffer(); - // writeTestData('yarn-project/protocol-contracts/fixtures/ContractClassRegisteredEventData.hex', logData); + const logs = await aztecNode.getContractClassLogs({ txHash: registrationTxReceipt.txHash }); + expect(logs.logs.length).toEqual(1); + const logData = logs.logs[0].log.toBuffer(); + writeTestData('yarn-project/protocol-contracts/fixtures/ContractClassRegisteredEventData.hex', logData); const registeredClass = await aztecNode.getContractClass(contractClass.id); expect(registeredClass).toBeDefined(); diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts index 26f2e7472903..6a4e5050126d 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract/deploy_method.test.ts @@ -7,7 +7,6 @@ import { type PXE, type Wallet, createPXEClient, - getContractClassFromArtifact, makeFetch, } from '@aztec/aztec.js'; import { CounterContract } from '@aztec/noir-contracts.js/Counter'; @@ -56,15 +55,6 @@ describe('e2e_deploy_contract deploy method', () => { ).toBeTrue(); }); - // TODO(#10007): Remove this test. Common contracts (ie token contracts) are only distinguished - // because we're manually adding them to the archiver to support provernet. - it('registers a contract class for a common contract', async () => { - const { id: tokenContractClass } = await getContractClassFromArtifact(TokenContract.artifact); - expect((await pxe.getContractClassMetadata(tokenContractClass)).isContractClassPubliclyRegistered).toBeFalse(); - await TokenContract.deploy(wallet, wallet.getAddress(), 'TOKEN', 'TKN', 18n).send().deployed(); - expect((await pxe.getContractClassMetadata(tokenContractClass)).isContractClassPubliclyRegistered).toBeTrue(); - }); - it('publicly universally deploys and initializes a contract', async () => { const owner = wallet.getAddress(); const opts = { universalDeploy: true }; diff --git a/yarn-project/end-to-end/src/e2e_deploy_contract/legacy.test.ts b/yarn-project/end-to-end/src/e2e_deploy_contract/legacy.test.ts index 0616a7ddb7af..ac1496d36178 100644 --- a/yarn-project/end-to-end/src/e2e_deploy_contract/legacy.test.ts +++ b/yarn-project/end-to-end/src/e2e_deploy_contract/legacy.test.ts @@ -1,6 +1,7 @@ import { AztecAddress, ContractDeployer, + type DeployOptions, Fr, type Logger, type PXE, @@ -84,16 +85,19 @@ describe('e2e_deploy_contract legacy', () => { await expect(deployer.deploy().send({ contractAddressSalt }).wait()).rejects.toThrow(/dropped/); }); - // TODO(#10007): Reenable this test. - it.skip('should not deploy a contract which failed the public part of the execution', async () => { + it('should not deploy a contract which failed the public part of the execution', async () => { // This test requires at least another good transaction to go through in the same block as the bad one. const artifact = TokenContractArtifact; const initArgs = ['TokenName', 'TKN', 18] as const; const goodDeploy = StatefulTestContract.deploy(wallet, wallet.getAddress(), wallet.getAddress(), 42); const badDeploy = new ContractDeployer(artifact, wallet).deploy(AztecAddress.ZERO, ...initArgs); - const firstOpts = { skipPublicSimulation: true, skipClassRegistration: true, skipInstanceDeploy: true }; - const secondOpts = { skipPublicSimulation: true }; + const firstOpts: DeployOptions = { + skipPublicSimulation: true, + skipClassRegistration: true, + skipPublicDeployment: true, + }; + const secondOpts: DeployOptions = { skipPublicSimulation: true }; await Promise.all([goodDeploy.prove(firstOpts), badDeploy.prove(secondOpts)]); const [goodTx, badTx] = [goodDeploy.send(firstOpts), badDeploy.send(secondOpts)]; diff --git a/yarn-project/pxe/src/pxe_service/pxe_service.ts b/yarn-project/pxe/src/pxe_service/pxe_service.ts index a2ba436e4ee2..ffe2d502f166 100644 --- a/yarn-project/pxe/src/pxe_service/pxe_service.ts +++ b/yarn-project/pxe/src/pxe_service/pxe_service.ts @@ -380,9 +380,6 @@ export class PXEService implements PXE { .filter(fn => fn.functionType === FunctionType.PUBLIC) .map(fn => decodeFunctionSignature(fn.name, fn.parameters)); await this.node.registerContractFunctionSignatures(instance.address, publicFunctionSignatures); - - // TODO(#10007): Node should get public contract class from the registration event, not from PXE registration - await this.node.addContractClass({ ...contractClass, privateFunctions: [], unconstrainedFunctions: [] }); } else { // Otherwise, make sure there is an artifact already registered for that class id artifact = await this.contractDataProvider.getContractArtifact(instance.currentContractClassId); @@ -421,8 +418,6 @@ export class PXEService implements PXE { .map(fn => decodeFunctionSignature(fn.name, fn.parameters)); await this.node.registerContractFunctionSignatures(contractAddress, publicFunctionSignatures); - // TODO(#10007): Node should get public contract class from the registration event, not from PXE registration - await this.node.addContractClass({ ...contractClass, privateFunctions: [], unconstrainedFunctions: [] }); currentInstance.currentContractClassId = contractClass.id; await this.contractDataProvider.addContractInstance(currentInstance); this.log.info(`Updated contract ${artifact.name} at ${contractAddress.toString()} to class ${contractClass.id}`); diff --git a/yarn-project/stdlib/src/contract/interfaces/contract_data_source.ts b/yarn-project/stdlib/src/contract/interfaces/contract_data_source.ts index ec4d4f114f57..ae064d7ede9b 100644 --- a/yarn-project/stdlib/src/contract/interfaces/contract_data_source.ts +++ b/yarn-project/stdlib/src/contract/interfaces/contract_data_source.ts @@ -20,12 +20,6 @@ export interface ContractDataSource { getBytecodeCommitment(id: Fr): Promise; - /** - * Adds a contract class to the database. - * TODO(#10007): Remove this method - */ - addContractClass(contractClass: ContractClassPublic): Promise; - /** * Returns a publicly deployed contract instance given its address. * @param address - Address of the deployed contract. diff --git a/yarn-project/stdlib/src/interfaces/archiver.test.ts b/yarn-project/stdlib/src/interfaces/archiver.test.ts index ab381b0bbb39..3136a58bc032 100644 --- a/yarn-project/stdlib/src/interfaces/archiver.test.ts +++ b/yarn-project/stdlib/src/interfaces/archiver.test.ts @@ -243,15 +243,6 @@ describe('ArchiverApiSchema', () => { }); }); - it('addContractClass', async () => { - const contractClass = await getContractClassFromArtifact(artifact); - await context.client.addContractClass({ - ...omit(contractClass, 'publicBytecodeCommitment'), - unconstrainedFunctions: [], - privateFunctions: [], - }); - }); - it('getL1Constants', async () => { const result = await context.client.getL1Constants(); expect(result).toEqual(EmptyL1RollupConstants); @@ -407,9 +398,6 @@ class MockArchiver implements ArchiverApi { expect(l1ToL2Message).toBeInstanceOf(Fr); return Promise.resolve(1n); } - addContractClass(_contractClass: ContractClassPublic): Promise { - return Promise.resolve(); - } getL1Constants(): Promise { return Promise.resolve(EmptyL1RollupConstants); } diff --git a/yarn-project/stdlib/src/interfaces/archiver.ts b/yarn-project/stdlib/src/interfaces/archiver.ts index 4f23e7b76148..01f3a89094c9 100644 --- a/yarn-project/stdlib/src/interfaces/archiver.ts +++ b/yarn-project/stdlib/src/interfaces/archiver.ts @@ -77,8 +77,6 @@ export const ArchiverApiSchema: ApiSchemaFor = { registerContractFunctionSignatures: z.function().args(schemas.AztecAddress, z.array(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 - addContractClass: z.function().args(ContractClassPublicSchema).returns(z.void()), getContractFunctionName: z .function() .args(schemas.AztecAddress, schemas.FunctionSelector) diff --git a/yarn-project/stdlib/src/interfaces/aztec-node.test.ts b/yarn-project/stdlib/src/interfaces/aztec-node.test.ts index baeea47a6a84..7ff5871d7ec1 100644 --- a/yarn-project/stdlib/src/interfaces/aztec-node.test.ts +++ b/yarn-project/stdlib/src/interfaces/aztec-node.test.ts @@ -346,11 +346,6 @@ describe('AztecNodeApiSchema', () => { expect(response).toBe('enr:-'); }); - it('addContractClass', async () => { - const contractClass = await getContractClassFromArtifact(artifact); - await context.client.addContractClass({ ...contractClass, unconstrainedFunctions: [], privateFunctions: [] }); - }); - it('getWorldStateSyncStatus', async () => { const response = await context.client.getWorldStateSyncStatus(); expect(response).toEqual(await handler.getWorldStateSyncStatus()); @@ -629,7 +624,4 @@ class MockAztecNode implements AztecNode { getEncodedEnr(): Promise { return Promise.resolve('enr:-'); } - addContractClass(_contractClass: ContractClassPublic): Promise { - return Promise.resolve(); - } } diff --git a/yarn-project/stdlib/src/interfaces/aztec-node.ts b/yarn-project/stdlib/src/interfaces/aztec-node.ts index cf742de318e1..913425c8c5c6 100644 --- a/yarn-project/stdlib/src/interfaces/aztec-node.ts +++ b/yarn-project/stdlib/src/interfaces/aztec-node.ts @@ -436,13 +436,6 @@ export interface AztecNode * Returns the ENR of this node for peer discovery, if available. */ getEncodedEnr(): Promise; - - /** - * Adds a contract class bypassing the registerer. - * TODO(#10007): Remove this method. - * @param contractClass - The class to register. - */ - addContractClass(contractClass: ContractClassPublic): Promise; } export const AztecNodeApiSchema: ApiSchemaFor = { @@ -584,9 +577,6 @@ export const AztecNodeApiSchema: ApiSchemaFor = { getContract: z.function().args(schemas.AztecAddress).returns(ContractInstanceWithAddressSchema.optional()), getEncodedEnr: z.function().returns(z.string().optional()), - - // TODO(#10007): Remove this method - addContractClass: z.function().args(ContractClassPublicSchema).returns(z.void()), }; export function createAztecNodeClient( diff --git a/yarn-project/txe/src/node/txe_node.ts b/yarn-project/txe/src/node/txe_node.ts index b372dc8bd7c0..14030feaf461 100644 --- a/yarn-project/txe/src/node/txe_node.ts +++ b/yarn-project/txe/src/node/txe_node.ts @@ -642,15 +642,6 @@ export class TXENode implements AztecNode { throw new Error('TXE Node method getEncodedEnr not implemented'); } - /** - * Adds a contract class bypassing the registerer. - * TODO(#10007): Remove this method. - * @param contractClass - The class to register. - */ - addContractClass(_contractClass: ContractClassPublic): Promise { - throw new Error('TXE Node method addContractClass not implemented'); - } - /** * Method to fetch the current base fees. * @returns The current base fees. 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 55dabb0892ed..189b70827733 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 @@ -84,10 +84,4 @@ export class TXEPublicContractDataSource implements ContractDataSource { registerContractFunctionSignatures(_address: AztecAddress, _signatures: []): Promise { return Promise.resolve(); } - - // TODO(#10007): Remove this method. - addContractClass(_contractClass: ContractClassPublic): Promise { - // We don't really need to do anything for the txe here - return Promise.resolve(); - } } diff --git a/yarn-project/yarn.lock b/yarn-project/yarn.lock index 4deebb6e8cfa..73328905f582 100644 --- a/yarn-project/yarn.lock +++ b/yarn-project/yarn.lock @@ -92,7 +92,6 @@ __metadata: "@aztec/foundation": "workspace:^" "@aztec/kv-store": "workspace:^" "@aztec/l1-artifacts": "workspace:^" - "@aztec/noir-contracts.js": "workspace:^" "@aztec/noir-protocol-circuits-types": "workspace:^" "@aztec/protocol-contracts": "workspace:^" "@aztec/stdlib": "workspace:^"