diff --git a/yarn-project/archiver/src/archiver/archiver.test.ts b/yarn-project/archiver/src/archiver/archiver.test.ts index 340706cd157a..66ae43ad02f2 100644 --- a/yarn-project/archiver/src/archiver/archiver.test.ts +++ b/yarn-project/archiver/src/archiver/archiver.test.ts @@ -5,7 +5,7 @@ import { sleep } from '@aztec/foundation/sleep'; import { ContractDeploymentEmitterAbi, InboxAbi, RollupAbi } from '@aztec/l1-artifacts'; import { ContractData, - ContractPublicData, + ContractDataAndBytecode, EncodedContractFunction, L2Block, L2BlockL2Logs, @@ -158,7 +158,7 @@ function makeContractDeploymentEvent(l1BlockNum: bigint, l2Block: L2Block) { // const contractData = ContractData.random(); const aztecAddress = AztecAddress.random(); const portalAddress = EthAddress.random(); - const contractData = new ContractPublicData(new ContractData(aztecAddress, portalAddress), [ + const contractData = new ContractDataAndBytecode(new ContractData(aztecAddress, portalAddress), [ EncodedContractFunction.random(), EncodedContractFunction.random(), ]); diff --git a/yarn-project/archiver/src/archiver/archiver.ts b/yarn-project/archiver/src/archiver/archiver.ts index 3019b0d23608..4650962cb148 100644 --- a/yarn-project/archiver/src/archiver/archiver.ts +++ b/yarn-project/archiver/src/archiver/archiver.ts @@ -6,8 +6,8 @@ import { DebugLogger, createDebugLogger } from '@aztec/foundation/log'; import { RunningPromise } from '@aztec/foundation/running-promise'; import { ContractData, + ContractDataAndBytecode, ContractDataSource, - ContractPublicData, EncodedContractFunction, INITIAL_L2_BLOCK_NUM, L1ToL2Message, @@ -221,9 +221,9 @@ export class Archiver implements L2BlockSource, L2LogsSource, ContractDataSource // store contracts for which we have retrieved L2 blocks const lastKnownL2BlockNum = retrievedBlocks.retrievedData[retrievedBlocks.retrievedData.length - 1].number; retrievedContracts.retrievedData.forEach(async ([contracts, l2BlockNum], index) => { - this.log(`Retrieved contract public data for l2 block number: ${index}`); + this.log(`Retrieved contract data and bytecode for l2 block number: ${index}`); if (l2BlockNum <= lastKnownL2BlockNum) { - await this.store.addL2ContractPublicData(contracts, l2BlockNum); + await this.store.addContractDataAndBytecode(contracts, l2BlockNum); } }); @@ -287,8 +287,8 @@ export class Archiver implements L2BlockSource, L2LogsSource, ContractDataSource * @param contractAddress - The contract data address. * @returns The contract data. */ - public getL2ContractPublicData(contractAddress: AztecAddress): Promise { - return this.store.getL2ContractPublicData(contractAddress); + public getContractDataAndBytecode(contractAddress: AztecAddress): Promise { + return this.store.getContractDataAndBytecode(contractAddress); } /** @@ -296,28 +296,28 @@ export class Archiver implements L2BlockSource, L2LogsSource, ContractDataSource * @param blockNum - The block number to get all contract data from. * @returns All new contract data in the block (if found). */ - public getL2ContractPublicDataInBlock(blockNum: number): Promise { - return this.store.getL2ContractPublicDataInBlock(blockNum); + public getContractDataAndBytecodeInBlock(blockNum: number): Promise { + return this.store.getContractDataAndBytecodeInBlock(blockNum); } /** - * Lookup the L2 contract info for this contract. + * Lookup the contract data for this contract. * Contains contract address & the ethereum portal address. * @param contractAddress - The contract data address. * @returns ContractData with the portal address (if we didn't throw an error). */ - public getL2ContractInfo(contractAddress: AztecAddress): Promise { - return this.store.getL2ContractInfo(contractAddress); + public getContractData(contractAddress: AztecAddress): Promise { + return this.store.getContractData(contractAddress); } /** - * Lookup the L2 contract info inside a block. + * Lookup the L2 contract data inside a block. * Contains contract address & the ethereum portal address. * @param l2BlockNum - The L2 block number to get the contract data from. * @returns ContractData with the portal address (if we didn't throw an error). */ - public getL2ContractInfoInBlock(l2BlockNum: number): Promise { - return this.store.getL2ContractInfoInBlock(l2BlockNum); + public getContractDataInBlock(l2BlockNum: number): Promise { + return this.store.getContractDataInBlock(l2BlockNum); } /** @@ -330,7 +330,7 @@ export class Archiver implements L2BlockSource, L2LogsSource, ContractDataSource contractAddress: AztecAddress, functionSelector: Buffer, ): Promise { - const contractData = await this.getL2ContractPublicData(contractAddress); + const contractData = await this.getContractDataAndBytecode(contractAddress); const result = contractData?.publicFunctions?.find(fn => fn.functionSelector.equals(functionSelector)); return result; } diff --git a/yarn-project/archiver/src/archiver/archiver_store.ts b/yarn-project/archiver/src/archiver/archiver_store.ts index 80fbfd82c66b..4fcef27ec7f6 100644 --- a/yarn-project/archiver/src/archiver/archiver_store.ts +++ b/yarn-project/archiver/src/archiver/archiver_store.ts @@ -2,7 +2,7 @@ import { Fr, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/circuits.js'; import { AztecAddress } from '@aztec/foundation/aztec-address'; import { ContractData, - ContractPublicData, + ContractDataAndBytecode, INITIAL_L2_BLOCK_NUM, L1ToL2Message, L2Block, @@ -14,7 +14,7 @@ import { L1ToL2MessageStore, PendingL1ToL2MessageStore } from './l1_to_l2_messag /** * Interface describing a data store to be used by the archiver to store all its relevant data - * (blocks, encrypted logs, aztec contract public data). + * (blocks, encrypted logs, aztec contract data and bytecode). */ export interface ArchiverDataStore { /** @@ -86,26 +86,26 @@ export interface ArchiverDataStore { getLogs(from: number, limit: number, logType: LogType): Promise; /** - * Store new Contract Public Data from an L2 block to the store's list. + * Store new Contract data and bytecode from an L2 block to the store's list. * @param data - List of contracts' data to be added. * @param blockNum - Number of the L2 block the contract data was deployed in. * @returns True if the operation is successful. */ - addL2ContractPublicData(data: ContractPublicData[], blockNum: number): Promise; + addContractDataAndBytecode(data: ContractDataAndBytecode[], blockNum: number): Promise; /** * Lookup the L2 contract data for a contract address. * @param contractAddress - The contract data address. * @returns The contract's public data. */ - getL2ContractPublicData(contractAddress: AztecAddress): Promise; + getContractDataAndBytecode(contractAddress: AztecAddress): Promise; /** - * Lookup all contract data in an L2 block. + * Lookup all contract data and bytecode in an L2 block. * @param blockNum - The block number to get all contract data from. - * @returns All contract public data in the block (if found). + * @returns All contract data and bytecode in the block (if found). */ - getL2ContractPublicDataInBlock(blockNum: number): Promise; + getContractDataAndBytecodeInBlock(blockNum: number): Promise; /** * Get basic info for an L2 contract. @@ -113,7 +113,7 @@ export interface ArchiverDataStore { * @param contractAddress - The contract data address. * @returns ContractData with the portal address (if we didn't throw an error). */ - getL2ContractInfo(contractAddress: AztecAddress): Promise; + getContractData(contractAddress: AztecAddress): Promise; /** * Get basic info for an all L2 contracts deployed in a block. @@ -121,7 +121,7 @@ export interface ArchiverDataStore { * @param l2BlockNum - Number of the L2 block where contracts were deployed. * @returns ContractData with the portal address (if we didn't throw an error). */ - getL2ContractInfoInBlock(l2BlockNum: number): Promise; + getContractDataInBlock(l2BlockNum: number): Promise; /** * Gets the number of the latest L2 block processed. @@ -160,7 +160,7 @@ export class MemoryArchiverStore implements ArchiverDataStore { /** * A sparse array containing all the contract data that have been fetched so far. */ - private contractPublicData: (ContractPublicData[] | undefined)[] = []; + private contractDataAndBytecode: (ContractDataAndBytecode[] | undefined)[] = []; /** * Contains all the confirmed L1 to L2 messages (i.e. messages that were consumed in an L2 block) @@ -235,16 +235,16 @@ export class MemoryArchiverStore implements ArchiverDataStore { } /** - * Store new Contract Public Data from an L2 block to the store's list. + * Store new Contract data and bytecode from an L2 block to the store's list. * @param data - List of contracts' data to be added. * @param blockNum - Number of the L2 block the contract data was deployed in. * @returns True if the operation is successful (always in this implementation). */ - public addL2ContractPublicData(data: ContractPublicData[], blockNum: number): Promise { - if (this.contractPublicData[blockNum]?.length) { - this.contractPublicData[blockNum]?.push(...data); + public addContractDataAndBytecode(data: ContractDataAndBytecode[], blockNum: number): Promise { + if (this.contractDataAndBytecode[blockNum]?.length) { + this.contractDataAndBytecode[blockNum]?.push(...data); } else { - this.contractPublicData[blockNum] = [...data]; + this.contractDataAndBytecode[blockNum] = [...data]; } return Promise.resolve(true); } @@ -315,10 +315,10 @@ export class MemoryArchiverStore implements ArchiverDataStore { * @param contractAddress - The contract data address. * @returns The contract's public data. */ - public getL2ContractPublicData(contractAddress: AztecAddress): Promise { + public getContractDataAndBytecode(contractAddress: AztecAddress): Promise { let result; - for (let i = INITIAL_L2_BLOCK_NUM; i < this.contractPublicData.length; i++) { - const contracts = this.contractPublicData[i]; + for (let i = INITIAL_L2_BLOCK_NUM; i < this.contractDataAndBytecode.length; i++) { + const contracts = this.contractDataAndBytecode[i]; const contract = contracts?.find(c => c.contractData.contractAddress.equals(contractAddress)); if (contract) { result = contract; @@ -331,13 +331,13 @@ export class MemoryArchiverStore implements ArchiverDataStore { /** * Lookup all contract data in an L2 block. * @param blockNum - The block number to get all contract data from. - * @returns All contract public data in the block (if found). + * @returns All contract data and bytecode in the block (if found). */ - public getL2ContractPublicDataInBlock(blockNum: number): Promise { + public getContractDataAndBytecodeInBlock(blockNum: number): Promise { if (blockNum > this.l2Blocks.length) { return Promise.resolve([]); } - return Promise.resolve(this.contractPublicData[blockNum] || []); + return Promise.resolve(this.contractDataAndBytecode[blockNum] || []); } /** @@ -346,7 +346,7 @@ export class MemoryArchiverStore implements ArchiverDataStore { * @param contractAddress - The contract data address. * @returns ContractData with the portal address (if we didn't throw an error). */ - public getL2ContractInfo(contractAddress: AztecAddress): Promise { + public getContractData(contractAddress: AztecAddress): Promise { if (contractAddress.isZero()) { return Promise.resolve(undefined); } @@ -366,7 +366,7 @@ export class MemoryArchiverStore implements ArchiverDataStore { * @param l2BlockNum - Number of the L2 block where contracts were deployed. * @returns ContractData with the portal address (if we didn't throw an error). */ - public getL2ContractInfoInBlock(l2BlockNum: number): Promise { + public getContractDataInBlock(l2BlockNum: number): Promise { if (l2BlockNum > this.l2Blocks.length) { return Promise.resolve([]); } diff --git a/yarn-project/archiver/src/archiver/data_retrieval.ts b/yarn-project/archiver/src/archiver/data_retrieval.ts index 55927f3a06bc..c7d27d6d0855 100644 --- a/yarn-project/archiver/src/archiver/data_retrieval.ts +++ b/yarn-project/archiver/src/archiver/data_retrieval.ts @@ -1,6 +1,6 @@ import { EthAddress } from '@aztec/foundation/eth-address'; import { Fr } from '@aztec/foundation/fields'; -import { ContractPublicData, L1ToL2Message, L2Block } from '@aztec/types'; +import { ContractDataAndBytecode, L1ToL2Message, L2Block } from '@aztec/types'; import { PublicClient } from 'viem'; @@ -73,7 +73,7 @@ export async function retrieveBlocks( * @param currentBlockNumber - Latest available block number in the ETH node. * @param searchStartBlock - The block number to use for starting the search. * @param blockHashMapping - A mapping from block number to relevant block hash. - * @returns An array of ContractPublicData and their equivalent L2 Block number along with the next eth block to search from.. + * @returns An array of ContractDataAndBytecode and their equivalent L2 Block number along with the next eth block to search from.. */ export async function retrieveNewContractData( publicClient: PublicClient, @@ -82,8 +82,8 @@ export async function retrieveNewContractData( currentBlockNumber: bigint, searchStartBlock: bigint, blockHashMapping: { [key: number]: Buffer | undefined }, -): Promise> { - let retrievedNewContracts: [ContractPublicData[], number][] = []; +): Promise> { + let retrievedNewContracts: [ContractDataAndBytecode[], number][] = []; do { if (searchStartBlock > currentBlockNumber) { break; diff --git a/yarn-project/archiver/src/archiver/eth_log_handlers.ts b/yarn-project/archiver/src/archiver/eth_log_handlers.ts index c85b8ac7244e..df9ebcf5bc30 100644 --- a/yarn-project/archiver/src/archiver/eth_log_handlers.ts +++ b/yarn-project/archiver/src/archiver/eth_log_handlers.ts @@ -5,7 +5,7 @@ import { ContractDeploymentEmitterAbi, InboxAbi, RollupAbi } from '@aztec/l1-art import { BufferReader, ContractData, - ContractPublicData, + ContractDataAndBytecode, EncodedContractFunction, L1Actor, L1ToL2Message, @@ -163,13 +163,13 @@ export async function getContractDeploymentLogs( * Processes newly received ContractDeployment logs. * @param blockHashMapping - A mapping from block number to relevant block hash. * @param logs - ContractDeployment logs. - * @returns The set of retrieved contract public data items. + * @returns The set of retrieved contract data and bytecode items. */ export function processContractDeploymentLogs( blockHashMapping: { [key: number]: Buffer | undefined }, logs: Log[], -): [ContractPublicData[], number][] { - const contractPublicData: [ContractPublicData[], number][] = []; +): [ContractDataAndBytecode[], number][] { + const contractDataAndBytecode: [ContractDataAndBytecode[], number][] = []; for (let i = 0; i < logs.length; i++) { const log = logs[i]; const l2BlockNum = Number(log.args.l2BlockNum); @@ -179,17 +179,17 @@ export function processContractDeploymentLogs( continue; } const publicFnsReader = BufferReader.asReader(Buffer.from(log.args.acir.slice(2), 'hex')); - const contractData = new ContractPublicData( + const contractData = new ContractDataAndBytecode( new ContractData(AztecAddress.fromString(log.args.aztecAddress), EthAddress.fromString(log.args.portalAddress)), publicFnsReader.readVector(EncodedContractFunction), ); - if (contractPublicData[i]) { - contractPublicData[i][0].push(contractData); + if (contractDataAndBytecode[i]) { + contractDataAndBytecode[i][0].push(contractData); } else { - contractPublicData[i] = [[contractData], l2BlockNum]; + contractDataAndBytecode[i] = [[contractData], l2BlockNum]; } } - return contractPublicData; + return contractDataAndBytecode; } /** diff --git a/yarn-project/aztec-cli/src/index.ts b/yarn-project/aztec-cli/src/index.ts index bf008ddbb50c..eb2bf3fda438 100644 --- a/yarn-project/aztec-cli/src/index.ts +++ b/yarn-project/aztec-cli/src/index.ts @@ -217,25 +217,25 @@ async function main() { .action(async (contractAddress, options) => { const client = createAztecRpcClient(options.rpcUrl); const address = AztecAddress.fromString(contractAddress); - const contractDataOrInfo = options.includeBytecode - ? await client.getContractData(address) - : await client.getContractInfo(address); + const contractDataWithOrWithoutBytecode = options.includeBytecode + ? await client.getContractDataAndBytecode(address) + : await client.getContractData(address); - if (!contractDataOrInfo) { + if (!contractDataWithOrWithoutBytecode) { log(`No contract data found at ${contractAddress}`); return; } let contractData: ContractData; - if ('contractData' in contractDataOrInfo) { - contractData = contractDataOrInfo.contractData; + if ('contractData' in contractDataWithOrWithoutBytecode) { + contractData = contractDataWithOrWithoutBytecode.contractData; } else { - contractData = contractDataOrInfo; + contractData = contractDataWithOrWithoutBytecode; } log(`\nContract Data: \nAddress: ${contractData.contractAddress.toString()}`); log(`Portal: ${contractData.portalContractAddress.toString()}`); - if ('bytecode' in contractDataOrInfo) { - log(`Bytecode: ${contractDataOrInfo.bytecode}`); + if ('bytecode' in contractDataWithOrWithoutBytecode) { + log(`Bytecode: ${contractDataWithOrWithoutBytecode.bytecode}`); } log('\n'); }); diff --git a/yarn-project/aztec-node/src/aztec-node/http-node.test.ts b/yarn-project/aztec-node/src/aztec-node/http-node.test.ts index 66b4a76bd8ad..d20d5933b380 100644 --- a/yarn-project/aztec-node/src/aztec-node/http-node.test.ts +++ b/yarn-project/aztec-node/src/aztec-node/http-node.test.ts @@ -3,7 +3,7 @@ import { randomBytes } from '@aztec/foundation/crypto'; import { Pedersen } from '@aztec/merkle-tree'; import { ContractData, - ContractPublicData, + ContractDataAndBytecode, L1ToL2Message, L2Block, L2BlockL2Logs, @@ -145,19 +145,19 @@ describe('HttpNode', () => { }); }); - describe('getContractData', () => { - it('should fetch and return contract public data', async () => { - const contractData = ContractPublicData.random(); + describe('getContractDataAndBytecode', () => { + it('should fetch and return contract data and bytecode', async () => { + const contractData = ContractDataAndBytecode.random(); const response = { contractData: contractData.toBuffer(), }; setFetchMock(response); - const result = await httpNode.getContractData(contractData.contractData.contractAddress); + const result = await httpNode.getContractDataAndBytecode(contractData.contractData.contractAddress); expect(fetch).toHaveBeenCalledWith( - `${TEST_URL}contract-data?address=${contractData.contractData.contractAddress.toString()}`, + `${TEST_URL}contract-data-and-bytecode?address=${contractData.contractData.contractAddress.toString()}`, ); expect(result).toEqual(contractData); }); @@ -170,9 +170,9 @@ describe('HttpNode', () => { const randomAddress = AztecAddress.random(); - const result = await httpNode.getContractData(randomAddress); + const result = await httpNode.getContractDataAndBytecode(randomAddress); - expect(fetch).toHaveBeenCalledWith(`${TEST_URL}contract-data?address=${randomAddress.toString()}`); + expect(fetch).toHaveBeenCalledWith(`${TEST_URL}contract-data-and-bytecode?address=${randomAddress.toString()}`); expect(result).toEqual(undefined); }); }); @@ -216,31 +216,31 @@ describe('HttpNode', () => { ); }); - describe('getContractInfo', () => { + describe('getContractData', () => { it('should fetch and return contract data', async () => { - const contractInfo = ContractData.random(); + const contractData = ContractData.random(); const response = { - contractInfo: contractInfo.toBuffer(), + contractData: contractData.toBuffer(), }; setFetchMock(response); - const result = await httpNode.getContractInfo(contractInfo.contractAddress); + const result = await httpNode.getContractData(contractData.contractAddress); - expect(fetch).toHaveBeenCalledWith(`${TEST_URL}contract-info?address=${contractInfo.contractAddress.toString()}`); - expect(result).toEqual(contractInfo); + expect(fetch).toHaveBeenCalledWith(`${TEST_URL}contract-data?address=${contractData.contractAddress.toString()}`); + expect(result).toEqual(contractData); }); it('should return undefined if contract data is not available', async () => { const response = { - contractInfo: undefined, + contractData: undefined, }; setFetchMock(response); const randomAddress = AztecAddress.random(); - const result = await httpNode.getContractInfo(randomAddress); + const result = await httpNode.getContractData(randomAddress); - expect(fetch).toHaveBeenCalledWith(`${TEST_URL}contract-info?address=${randomAddress.toString()}`); + expect(fetch).toHaveBeenCalledWith(`${TEST_URL}contract-data?address=${randomAddress.toString()}`); expect(result).toBeUndefined(); }); }); diff --git a/yarn-project/aztec-node/src/aztec-node/http-node.ts b/yarn-project/aztec-node/src/aztec-node/http-node.ts index 7ceb5ac69ffa..187f0cd72274 100644 --- a/yarn-project/aztec-node/src/aztec-node/http-node.ts +++ b/yarn-project/aztec-node/src/aztec-node/http-node.ts @@ -9,7 +9,7 @@ import { DebugLogger, createDebugLogger } from '@aztec/foundation/log'; import { AztecNode, ContractData, - ContractPublicData, + ContractDataAndBytecode, L1ToL2Message, L1ToL2MessageAndIndex, L2Block, @@ -110,20 +110,20 @@ export class HttpNode implements AztecNode { } /** - * Lookup the L2 contract data for this contract. + * Lookup the contract data for this contract. * Contains the ethereum portal address and bytecode. * @param contractAddress - The contract data address. * @returns The complete contract data including portal address & bytecode (if we didn't throw an error). */ - async getContractData(contractAddress: AztecAddress): Promise { - const url = new URL(`${this.baseUrl}/contract-data`); + async getContractDataAndBytecode(contractAddress: AztecAddress): Promise { + const url = new URL(`${this.baseUrl}/contract-data-and-bytecode`); url.searchParams.append('address', contractAddress.toString()); const response = await (await fetch(url.toString())).json(); if (!response || !response.contractData) { return undefined; } const contract = response.contractData as string; - return Promise.resolve(ContractPublicData.fromBuffer(Buffer.from(contract, 'hex'))); + return Promise.resolve(ContractDataAndBytecode.fromBuffer(Buffer.from(contract, 'hex'))); } /** @@ -150,19 +150,19 @@ export class HttpNode implements AztecNode { } /** - * Lookup the L2 contract info for this contract. + * Lookup the contract data for this contract. * Contains the ethereum portal address. * @param contractAddress - The contract data address. * @returns The contract's address & portal address. */ - async getContractInfo(contractAddress: AztecAddress): Promise { - const url = new URL(`${this.baseUrl}/contract-info`); + async getContractData(contractAddress: AztecAddress): Promise { + const url = new URL(`${this.baseUrl}/contract-data`); url.searchParams.append('address', contractAddress.toString()); const response = await (await fetch(url.toString())).json(); - if (!response || !response.contractInfo) { + if (!response || !response.contractData) { return undefined; } - const contract = response.contractInfo as string; + const contract = response.contractData as string; return Promise.resolve(ContractData.fromBuffer(Buffer.from(contract, 'hex'))); } diff --git a/yarn-project/aztec-node/src/aztec-node/server.ts b/yarn-project/aztec-node/src/aztec-node/server.ts index 5474dcfe6e8a..8c24c207e4b2 100644 --- a/yarn-project/aztec-node/src/aztec-node/server.ts +++ b/yarn-project/aztec-node/src/aztec-node/server.ts @@ -13,8 +13,8 @@ import { SequencerClient } from '@aztec/sequencer-client'; import { AztecNode, ContractData, + ContractDataAndBytecode, ContractDataSource, - ContractPublicData, L1ToL2MessageAndIndex, L1ToL2MessageSource, L2Block, @@ -164,18 +164,18 @@ export class AztecNodeService implements AztecNode { * @param contractAddress - The contract data address. * @returns The complete contract data including portal address & bytecode (if we didn't throw an error). */ - public async getContractData(contractAddress: AztecAddress): Promise { - return await this.contractDataSource.getL2ContractPublicData(contractAddress); + public async getContractDataAndBytecode(contractAddress: AztecAddress): Promise { + return await this.contractDataSource.getContractDataAndBytecode(contractAddress); } /** - * Lookup the L2 contract info for this contract. + * Lookup the contract data for this contract. * Contains the ethereum portal address . * @param contractAddress - The contract data address. * @returns The contract's address & portal address. */ - public async getContractInfo(contractAddress: AztecAddress): Promise { - return await this.contractDataSource.getL2ContractInfo(contractAddress); + public async getContractData(contractAddress: AztecAddress): Promise { + return await this.contractDataSource.getContractData(contractAddress); } /** diff --git a/yarn-project/aztec-rpc/src/aztec_rpc_http/aztec_rpc_http_server.ts b/yarn-project/aztec-rpc/src/aztec_rpc_http/aztec_rpc_http_server.ts index ed79814207c9..6359587c80e9 100644 --- a/yarn-project/aztec-rpc/src/aztec_rpc_http/aztec_rpc_http_server.ts +++ b/yarn-project/aztec-rpc/src/aztec_rpc_http/aztec_rpc_http_server.ts @@ -3,8 +3,8 @@ import { Fr, Point } from '@aztec/foundation/fields'; import { JsonRpcServer } from '@aztec/foundation/json-rpc/server'; import { ContractData, + ContractDataAndBytecode, ContractDeploymentTx, - ContractPublicData, L2BlockL2Logs, PrivateKey, Tx, @@ -30,7 +30,7 @@ export function getHttpRpcServer(aztecRpcServer: AztecRPCServer): JsonRpcServer AztecAddress, TxExecutionRequest, ContractData, - ContractPublicData, + ContractDataAndBytecode, TxHash, EthAddress, Point, diff --git a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts index 455a481d1d61..1551983a762c 100644 --- a/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts +++ b/yarn-project/aztec-rpc/src/aztec_rpc_server/aztec_rpc_server.ts @@ -20,7 +20,7 @@ import { AztecRPC, ContractDao, ContractData, - ContractPublicData, + ContractDataAndBytecode, DeployedContract, FunctionCall, INITIAL_L2_BLOCK_NUM, @@ -157,7 +157,7 @@ export class AztecRPCServer implements AztecRPC { } public async isContractDeployed(contractAddress: AztecAddress): Promise { - return !!(await this.node.getContractInfo(contractAddress)); + return !!(await this.node.getContractData(contractAddress)); } public async simulateTx(txRequest: TxExecutionRequest) { @@ -243,12 +243,12 @@ export class AztecRPCServer implements AztecRPC { return await this.node.getBlockHeight(); } - public async getContractData(contractAddress: AztecAddress): Promise { - return await this.node.getContractData(contractAddress); + public async getContractDataAndBytecode(contractAddress: AztecAddress): Promise { + return await this.node.getContractDataAndBytecode(contractAddress); } - public async getContractInfo(contractAddress: AztecAddress): Promise { - return await this.node.getContractInfo(contractAddress); + public async getContractData(contractAddress: AztecAddress): Promise { + return await this.node.getContractData(contractAddress); } public async getUnencryptedLogs(from: number, limit: number): Promise { diff --git a/yarn-project/aztec.js/src/aztec_rpc_client/aztec_rpc_client.ts b/yarn-project/aztec.js/src/aztec_rpc_client/aztec_rpc_client.ts index cbfd24f31519..5429fe7009ed 100644 --- a/yarn-project/aztec.js/src/aztec_rpc_client/aztec_rpc_client.ts +++ b/yarn-project/aztec.js/src/aztec_rpc_client/aztec_rpc_client.ts @@ -3,8 +3,8 @@ import { createJsonRpcClient, defaultFetch } from '@aztec/foundation/json-rpc/cl import { AztecRPC, ContractData, + ContractDataAndBytecode, ContractDeploymentTx, - ContractPublicData, L2BlockL2Logs, Tx, TxExecutionRequest, @@ -21,7 +21,7 @@ export const createAztecRpcClient = (url: string, fetch = defaultFetch): AztecRP AztecAddress, TxExecutionRequest, ContractData, - ContractPublicData, + ContractDataAndBytecode, TxHash, EthAddress, Point, diff --git a/yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts b/yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts index b69895ea44e1..88b101fe0539 100644 --- a/yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts +++ b/yarn-project/aztec.js/src/aztec_rpc_client/wallet.ts @@ -2,7 +2,7 @@ import { AztecAddress, Fr, PartialContractAddress, PrivateKey, PublicKey } from import { AztecRPC, ContractData, - ContractPublicData, + ContractDataAndBytecode, DeployedContract, FunctionCall, L2BlockL2Logs, @@ -67,11 +67,11 @@ export abstract class BaseWallet implements Wallet { viewTx(functionName: string, args: any[], to: AztecAddress, from?: AztecAddress | undefined): Promise { return this.rpc.viewTx(functionName, args, to, from); } - getContractData(contractAddress: AztecAddress): Promise { - return this.rpc.getContractData(contractAddress); + getContractDataAndBytecode(contractAddress: AztecAddress): Promise { + return this.rpc.getContractDataAndBytecode(contractAddress); } - getContractInfo(contractAddress: AztecAddress): Promise { - return this.rpc.getContractInfo(contractAddress); + getContractData(contractAddress: AztecAddress): Promise { + return this.rpc.getContractData(contractAddress); } getUnencryptedLogs(from: number, limit: number): Promise { return this.rpc.getUnencryptedLogs(from, limit); diff --git a/yarn-project/aztec.js/src/index.ts b/yarn-project/aztec.js/src/index.ts index 7bf192db4d32..7897f0a07562 100644 --- a/yarn-project/aztec.js/src/index.ts +++ b/yarn-project/aztec.js/src/index.ts @@ -10,7 +10,7 @@ export { AztecRPC, ContractData, ContractDeploymentTx, - ContractPublicData, + ContractDataAndBytecode, DeployedContract, FunctionCall, L2BlockL2Logs, diff --git a/yarn-project/end-to-end/src/fixtures/cross_chain_test_harness.ts b/yarn-project/end-to-end/src/fixtures/cross_chain_test_harness.ts index ad7f376068ee..d5411c944035 100644 --- a/yarn-project/end-to-end/src/fixtures/cross_chain_test_harness.ts +++ b/yarn-project/end-to-end/src/fixtures/cross_chain_test_harness.ts @@ -210,7 +210,7 @@ export class CrossChainTestHarness { async checkEntryIsNotInOutbox(withdrawAmount: bigint, callerOnL1: EthAddress = EthAddress.ZERO): Promise { this.logger('Ensure that the entry is not in outbox yet'); - const contractInfo = await this.aztecRpcServer.getContractInfo(this.l2Contract.address); + const contractData = await this.aztecRpcServer.getContractData(this.l2Contract.address); // 0xb460af94, selector for "withdraw(uint256,address,address)" const content = sha256ToField( Buffer.concat([ @@ -224,7 +224,7 @@ export class CrossChainTestHarness { Buffer.concat([ this.l2Contract.address.toBuffer(), new Fr(1).toBuffer(), // aztec version - contractInfo?.portalContractAddress.toBuffer32() ?? Buffer.alloc(32, 0), + contractData?.portalContractAddress.toBuffer32() ?? Buffer.alloc(32, 0), new Fr(this.publicClient.chain.id).toBuffer(), // chain id content.toBuffer(), ]), diff --git a/yarn-project/rollup-provider/src/app.ts b/yarn-project/rollup-provider/src/app.ts index 066c68bf8b6f..a18e1a7a42d9 100644 --- a/yarn-project/rollup-provider/src/app.ts +++ b/yarn-project/rollup-provider/src/app.ts @@ -93,20 +93,20 @@ export function appFactory(node: AztecNode, prefix: string) { ctx.status = 200; }); - router.get('/contract-data', async (ctx: Koa.Context) => { + router.get('/contract-data-and-bytecode', async (ctx: Koa.Context) => { const address = ctx.query.address; ctx.set('content-type', 'application/json'); ctx.body = { - contractData: await node.getContractData(AztecAddress.fromString(address as string)), + contractData: await node.getContractDataAndBytecode(AztecAddress.fromString(address as string)), }; ctx.status = 200; }); - router.get('/contract-info', async (ctx: Koa.Context) => { + router.get('/contract-data', async (ctx: Koa.Context) => { const address = ctx.query.address; ctx.set('content-type', 'application/json'); ctx.body = { - contractInfo: await node.getContractData(AztecAddress.fromString(address as string)), + contractData: await node.getContractData(AztecAddress.fromString(address as string)), }; ctx.status = 200; }); diff --git a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts index 58827da72522..bee646ba1f3d 100644 --- a/yarn-project/sequencer-client/src/publisher/l1-publisher.ts +++ b/yarn-project/sequencer-client/src/publisher/l1-publisher.ts @@ -1,6 +1,6 @@ import { createDebugLogger } from '@aztec/foundation/log'; import { InterruptableSleep } from '@aztec/foundation/sleep'; -import { ContractPublicData, L2Block } from '@aztec/types'; +import { ContractDataAndBytecode, L2Block } from '@aztec/types'; import { L2BlockReceiver } from '../receiver.js'; import { PublisherConfig } from './config.js'; @@ -40,7 +40,7 @@ export interface L1PublisherTxSender { sendEmitContractDeploymentTx( l2BlockNum: number, l2BlockHash: Buffer, - contractData: ContractPublicData[], + contractData: ContractDataAndBytecode[], ): Promise<(string | undefined)[]>; /** @@ -139,8 +139,12 @@ export class L1Publisher implements L2BlockReceiver { * @param contractData - The new contract data to publish. * @returns True once the tx has been confirmed and is successful, false on revert or interrupt, blocks otherwise. */ - public async processNewContractData(l2BlockNum: number, l2BlockHash: Buffer, contractData: ContractPublicData[]) { - let _contractData: ContractPublicData[] = []; + public async processNewContractData( + l2BlockNum: number, + l2BlockHash: Buffer, + contractData: ContractDataAndBytecode[], + ) { + let _contractData: ContractDataAndBytecode[] = []; while (!this.interrupted) { if (!(await this.checkFeeDistributorBalance())) { this.log(`Fee distributor ETH balance too low, awaiting top up...`); @@ -208,7 +212,11 @@ export class L1Publisher implements L2BlockReceiver { } } - private async sendEmitNewContractDataTx(l2BlockNum: number, l2BlockHash: Buffer, contractData: ContractPublicData[]) { + private async sendEmitNewContractDataTx( + l2BlockNum: number, + l2BlockHash: Buffer, + contractData: ContractDataAndBytecode[], + ) { while (!this.interrupted) { try { return await this.txSender.sendEmitContractDeploymentTx(l2BlockNum, l2BlockHash, contractData); diff --git a/yarn-project/sequencer-client/src/publisher/viem-tx-sender.ts b/yarn-project/sequencer-client/src/publisher/viem-tx-sender.ts index 5a3a91c4161c..464a26a7bc0b 100644 --- a/yarn-project/sequencer-client/src/publisher/viem-tx-sender.ts +++ b/yarn-project/sequencer-client/src/publisher/viem-tx-sender.ts @@ -1,7 +1,7 @@ import { createEthereumChain } from '@aztec/ethereum'; import { createDebugLogger } from '@aztec/foundation/log'; import { ContractDeploymentEmitterAbi, RollupAbi } from '@aztec/l1-artifacts'; -import { ContractPublicData } from '@aztec/types'; +import { ContractDataAndBytecode } from '@aztec/types'; import { GetContractReturnType, @@ -126,16 +126,16 @@ export class ViemTxSender implements L1PublisherTxSender { async sendEmitContractDeploymentTx( l2BlockNum: number, l2BlockHash: Buffer, - newContractData: ContractPublicData[], + newContractData: ContractDataAndBytecode[], ): Promise<(string | undefined)[]> { const hashes: string[] = []; - for (const contractPublicData of newContractData) { + for (const contractDataAndBytecode of newContractData) { const args = [ BigInt(l2BlockNum), - contractPublicData.contractData.contractAddress.toString() as Hex, - contractPublicData.contractData.portalContractAddress.toString() as Hex, + contractDataAndBytecode.contractData.contractAddress.toString() as Hex, + contractDataAndBytecode.contractData.portalContractAddress.toString() as Hex, `0x${l2BlockHash.toString('hex')}`, - `0x${contractPublicData.bytecode.toString('hex')}`, + `0x${contractDataAndBytecode.bytecode.toString('hex')}`, ] as const; const gas = await this.contractDeploymentEmitterContract.estimateGas.emitContractDeployment(args, { diff --git a/yarn-project/sequencer-client/src/sequencer/public_processor.test.ts b/yarn-project/sequencer-client/src/sequencer/public_processor.test.ts index 2262f57cbfcb..70ca8dcd7c8f 100644 --- a/yarn-project/sequencer-client/src/sequencer/public_processor.test.ts +++ b/yarn-project/sequencer-client/src/sequencer/public_processor.test.ts @@ -26,8 +26,8 @@ import { } from '@aztec/circuits.js/factories'; import { padArrayEnd } from '@aztec/foundation/collection'; import { + ContractDataAndBytecode, ContractDataSource, - ContractPublicData, EncodedContractFunction, FunctionCall, FunctionL2Logs, @@ -54,7 +54,7 @@ describe('public_processor', () => { let contractDataSource: MockProxy; let publicFunction: EncodedContractFunction; - let contractData: ContractPublicData; + let contractData: ContractDataAndBytecode; let proof: Proof; let root: Buffer; @@ -66,7 +66,7 @@ describe('public_processor', () => { publicProver = mock(); contractDataSource = mock(); - contractData = ContractPublicData.random(); + contractData = ContractDataAndBytecode.random(); publicFunction = EncodedContractFunction.random(); proof = makeEmptyProof(); root = Buffer.alloc(32, 5); @@ -74,7 +74,7 @@ describe('public_processor', () => { publicProver.getPublicCircuitProof.mockResolvedValue(proof); publicProver.getPublicKernelCircuitProof.mockResolvedValue(proof); db.getTreeInfo.mockResolvedValue({ root } as TreeInfo); - contractDataSource.getL2ContractPublicData.mockResolvedValue(contractData); + contractDataSource.getContractDataAndBytecode.mockResolvedValue(contractData); contractDataSource.getPublicFunction.mockResolvedValue(publicFunction); }); diff --git a/yarn-project/sequencer-client/src/sequencer/sequencer.ts b/yarn-project/sequencer-client/src/sequencer/sequencer.ts index 09c6c39f282d..332486468531 100644 --- a/yarn-project/sequencer-client/src/sequencer/sequencer.ts +++ b/yarn-project/sequencer-client/src/sequencer/sequencer.ts @@ -5,7 +5,7 @@ import { RunningPromise } from '@aztec/foundation/running-promise'; import { P2P } from '@aztec/p2p'; import { ContractData, - ContractPublicData, + ContractDataAndBytecode, L1ToL2MessageSource, L2Block, L2BlockSource, @@ -170,7 +170,7 @@ export class Sequencer { const block = await this.buildBlock(processedTxs, l1ToL2Messages, emptyTx, newGlobalVariables); this.log(`Assembled block ${block.number}`); - await this.publishContractPublicData(validTxs, block); + await this.publishContractDataAndBytecode(validTxs, block); await this.publishL2Block(block); this.log.info(`Submitted rollup block ${block.number} with ${processedTxs.length} transactions`); @@ -182,11 +182,11 @@ export class Sequencer { } /** - * Gets new contract public data from the txs and publishes it on chain. + * Gets new contract data and bytecode from the txs and publishes it on chain. * @param validTxs - The set of real transactions being published as part of the block. * @param block - The L2Block to be published. */ - protected async publishContractPublicData(validTxs: Tx[], block: L2Block) { + protected async publishContractDataAndBytecode(validTxs: Tx[], block: L2Block) { // Publishes contract data for txs to the network and awaits the tx to be mined this.state = SequencerState.PUBLISHING_CONTRACT_DATA; const newContractData = validTxs @@ -194,7 +194,7 @@ export class Sequencer { // Currently can only have 1 new contract per tx const newContract = tx.data?.end.newContracts[0]; if (newContract && tx.newContractPublicFunctions?.length) { - return new ContractPublicData( + return new ContractDataAndBytecode( new ContractData(newContract.contractAddress, newContract.portalContractAddress), tx.newContractPublicFunctions, ); @@ -203,7 +203,7 @@ export class Sequencer { .filter((cd): cd is Exclude => cd !== undefined); const blockHash = block.getCalldataHash(); - this.log(`Publishing contract public data with block hash ${blockHash.toString('hex')}`); + this.log(`Publishing contract data and bytecode with block hash ${blockHash.toString('hex')}`); const publishedContractData = await this.publisher.processNewContractData(block.number, blockHash, newContractData); if (publishedContractData) { diff --git a/yarn-project/sequencer-client/src/simulator/public_executor.ts b/yarn-project/sequencer-client/src/simulator/public_executor.ts index 6fdc09e90aa8..979f5917e6b0 100644 --- a/yarn-project/sequencer-client/src/simulator/public_executor.ts +++ b/yarn-project/sequencer-client/src/simulator/public_executor.ts @@ -43,7 +43,7 @@ class ContractsDataSourcePublicDB implements PublicContractsDB { return (await this.db.getPublicFunction(address, functionSelector))?.isInternal; } async getPortalContractAddress(address: AztecAddress): Promise { - return (await this.db.getL2ContractInfo(address))?.portalContractAddress; + return (await this.db.getContractData(address))?.portalContractAddress; } } diff --git a/yarn-project/types/src/contract_data.test.ts b/yarn-project/types/src/contract_data.test.ts index 923ba2b17b7a..f5e4ffab9af9 100644 --- a/yarn-project/types/src/contract_data.test.ts +++ b/yarn-project/types/src/contract_data.test.ts @@ -1,26 +1,28 @@ import { AztecAddress } from '@aztec/foundation/aztec-address'; import { EthAddress } from '@aztec/foundation/eth-address'; -import { ContractData, ContractPublicData, EncodedContractFunction } from './contract_data.js'; +import { ContractData, ContractDataAndBytecode, EncodedContractFunction } from './contract_data.js'; describe('ContractData', () => { const aztecAddress = AztecAddress.random(); const portalAddress = EthAddress.random(); it('serializes / deserializes correctly', () => { - const contractPublicData = new ContractPublicData(new ContractData(aztecAddress, portalAddress), [ + const contractDataAndBytecode = new ContractDataAndBytecode(new ContractData(aztecAddress, portalAddress), [ EncodedContractFunction.random(), EncodedContractFunction.random(), ]); - const buf = contractPublicData.toBuffer(); - const serContractData = ContractPublicData.fromBuffer(buf); - expect(contractPublicData.contractData.contractAddress.equals(serContractData.contractData.contractAddress)).toBe( - true, - ); + const buf = contractDataAndBytecode.toBuffer(); + const serContractData = ContractDataAndBytecode.fromBuffer(buf); expect( - contractPublicData.contractData.portalContractAddress.equals(serContractData.contractData.portalContractAddress), + contractDataAndBytecode.contractData.contractAddress.equals(serContractData.contractData.contractAddress), ).toBe(true); - expect(contractPublicData.bytecode?.equals(serContractData?.bytecode || Buffer.alloc(0))).toBe(true); + expect( + contractDataAndBytecode.contractData.portalContractAddress.equals( + serContractData.contractData.portalContractAddress, + ), + ).toBe(true); + expect(contractDataAndBytecode.bytecode?.equals(serContractData?.bytecode || Buffer.alloc(0))).toBe(true); }); it('serializes / deserializes correctly without bytecode', () => { diff --git a/yarn-project/types/src/contract_data.ts b/yarn-project/types/src/contract_data.ts index d65b7fe6101f..6c0bfb402868 100644 --- a/yarn-project/types/src/contract_data.ts +++ b/yarn-project/types/src/contract_data.ts @@ -16,31 +16,31 @@ export interface ContractDataSource { * Contains information such as the ethereum portal address and bytecode. * NOTE: This method works only for contracts that have public function bytecode. * @param contractAddress - The contract data address. - * @returns The full contract information (if found). + * @returns Contract data and bytecode or undefined if not found. */ - getL2ContractPublicData(contractAddress: AztecAddress): Promise; + getContractDataAndBytecode(contractAddress: AztecAddress): Promise; /** * Lookup the L2 contract base info for this contract. - * NOTE: This works for all Aztec contracts and will only return contractAddres / portalAddress. + * NOTE: This works for all Aztec contracts and will only return contractAddress / portalAddress. * @param contractAddress - The contract data address. - * @returns The aztec & etehereum portal address (if found). + * @returns The aztec & ethereum portal address (if found). */ - getL2ContractInfo(contractAddress: AztecAddress): Promise; + getContractData(contractAddress: AztecAddress): Promise; /** - * Lookup all contract public data in an L2 block. + * Lookup all contract data and bytecode in an L2 block. * @param blockNumber - The block number. * @returns Public data of contracts deployed in L2 block, including public function bytecode. */ - getL2ContractPublicDataInBlock(blockNumber: number): Promise; + getContractDataAndBytecodeInBlock(blockNumber: number): Promise; /** - * Lookup contract info in an L2 block. + * Lookup contract data in an L2 block. * @param blockNumber - The block number. * @returns Portal contract address info of contracts deployed in L2 block. */ - getL2ContractInfoInBlock(blockNumber: number): Promise; + getContractDataInBlock(blockNumber: number): Promise; /** * Returns a contract's encoded public function, given its function selector. @@ -103,9 +103,9 @@ export class EncodedContractFunction { /** * A contract data blob, containing L1 and L2 addresses, as well as public functions' bytecode. */ -export class ContractPublicData { +export class ContractDataAndBytecode { /** - * The contract's encoded ACIR code. This should become Brilling code once implemented. + * The contract's encoded ACIR code. This should become Brillig code once implemented. */ public bytecode: Buffer; constructor( @@ -120,7 +120,7 @@ export class ContractPublicData { public publicFunctions: EncodedContractFunction[], ) { if (!publicFunctions.length) { - throw Error('No public functions provided for ContractPublicData.'); + throw Error('No public functions provided for ContractDataAndBytecode.'); } this.bytecode = serializeBufferArrayToVector(publicFunctions.map(fn => fn.toBuffer())); } @@ -151,7 +151,7 @@ export class ContractPublicData { const reader = BufferReader.asReader(buffer); const contractData = reader.readObject(ContractData); const publicFns = reader.readVector(EncodedContractFunction); - return new ContractPublicData(contractData, publicFns); + return new ContractDataAndBytecode(contractData, publicFns); } /** @@ -160,15 +160,15 @@ export class ContractPublicData { * @returns Deserialized instance. */ static fromString(str: string) { - return ContractPublicData.fromBuffer(Buffer.from(str, 'hex')); + return ContractDataAndBytecode.fromBuffer(Buffer.from(str, 'hex')); } /** * Generate ContractData with random addresses. - * @returns A random ContractPublicData object. + * @returns A random ContractDataAndBytecode object. */ - static random(): ContractPublicData { - return new ContractPublicData(ContractData.random(), [ + static random(): ContractDataAndBytecode { + return new ContractDataAndBytecode(ContractData.random(), [ EncodedContractFunction.random(), EncodedContractFunction.random(), ]); diff --git a/yarn-project/types/src/interfaces/aztec-node.ts b/yarn-project/types/src/interfaces/aztec-node.ts index a4139e21f187..ad467311189b 100644 --- a/yarn-project/types/src/interfaces/aztec-node.ts +++ b/yarn-project/types/src/interfaces/aztec-node.ts @@ -4,7 +4,7 @@ import { Fr } from '@aztec/foundation/fields'; import { ContractCommitmentProvider, ContractData, - ContractPublicData, + ContractDataAndBytecode, DataCommitmentProvider, L1ToL2MessageProvider, L2Block, @@ -65,15 +65,15 @@ export interface AztecNode extends DataCommitmentProvider, L1ToL2MessageProvider * @param contractAddress - The contract data address. * @returns The complete contract data including portal address & bytecode (if we didn't throw an error). */ - getContractData(contractAddress: AztecAddress): Promise; + getContractDataAndBytecode(contractAddress: AztecAddress): Promise; /** - * Lookup the L2 contract info for this contract. + * Lookup the contract data for this contract. * Contains the ethereum portal address . * @param contractAddress - The contract data address. * @returns The contract's address & portal address. */ - getContractInfo(contractAddress: AztecAddress): Promise; + getContractData(contractAddress: AztecAddress): Promise; /** * Gets up to `limit` amount of logs starting from `from`. diff --git a/yarn-project/types/src/interfaces/aztec_rpc.ts b/yarn-project/types/src/interfaces/aztec_rpc.ts index 98ac75b0ce87..9631a20eadc5 100644 --- a/yarn-project/types/src/interfaces/aztec_rpc.ts +++ b/yarn-project/types/src/interfaces/aztec_rpc.ts @@ -2,7 +2,7 @@ import { AztecAddress, EthAddress, Fr, PartialContractAddress, PrivateKey, Publi import { ContractAbi } from '@aztec/foundation/abi'; import { ContractData, - ContractPublicData, + ContractDataAndBytecode, L2BlockL2Logs, Tx, TxExecutionRequest, @@ -160,15 +160,15 @@ export interface AztecRPC { * @param contractAddress - The contract data address. * @returns The complete contract data including portal address & bytecode (if we didn't throw an error). */ - getContractData(contractAddress: AztecAddress): Promise; + getContractDataAndBytecode(contractAddress: AztecAddress): Promise; /** - * Lookup the L2 contract info for this contract. + * Lookup the L2 contract data for this contract. * Contains the ethereum portal address . * @param contractAddress - The contract data address. * @returns The contract's address & portal address. */ - getContractInfo(contractAddress: AztecAddress): Promise; + getContractData(contractAddress: AztecAddress): Promise; /** * Gets L2 block unencrypted logs.