From 47f53a0b58ff80155a69b20ee98fa7ef8f5135a8 Mon Sep 17 00:00:00 2001 From: benesjan Date: Wed, 17 Jan 2024 15:51:09 +0000 Subject: [PATCH] not exposing helpers in yarn-project --- .../aztecjs-getting-started.md | 15 ---- yarn-project/archiver/src/archiver/config.ts | 2 - .../aztec.js/src/contract/contract.test.ts | 2 - yarn-project/end-to-end/src/fixtures/utils.ts | 17 +---- .../src/integration_l1_publisher.test.ts | 76 +------------------ .../ethereum/src/deploy_l1_contracts.ts | 32 -------- .../ethereum/src/l1_contract_addresses.ts | 8 -- .../scripts/generate-artifacts.sh | 4 - .../src/pxe_service/test/pxe_service.test.ts | 2 - yarn-project/sequencer-client/src/config.ts | 2 - 10 files changed, 2 insertions(+), 158 deletions(-) diff --git a/docs/docs/dev_docs/getting_started/aztecjs-getting-started.md b/docs/docs/dev_docs/getting_started/aztecjs-getting-started.md index db038a69592..f71af8aa883 100644 --- a/docs/docs/dev_docs/getting_started/aztecjs-getting-started.md +++ b/docs/docs/dev_docs/getting_started/aztecjs-getting-started.md @@ -140,9 +140,6 @@ A successful run should show something like this: token }, token contractDeploymentEmitterAddress: EthAddress { token buffer: - token }, - token decoderHelperAddress: EthAddress { - token buffer: token } token } token } +0ms @@ -189,9 +186,6 @@ Now that we have our accounts loaded, let's move on to deploy our pre-compiled t token }, token contractDeploymentEmitterAddress: EthAddress { token buffer: - token }, - token decoderHelperAddress: EthAddress { - token buffer: token } token } token } +0ms @@ -244,9 +238,6 @@ Running now should yield output: token }, token contractDeploymentEmitterAddress: EthAddress { token buffer: - token }, - token decoderHelperAddress: EthAddress { - token buffer: token } token } token } +0ms @@ -309,9 +300,6 @@ Our output should now look like this: token }, token contractDeploymentEmitterAddress: EthAddress { token buffer: - token }, - token decoderHelperAddress: EthAddress { - token buffer: token } token } token } +0ms @@ -369,9 +357,6 @@ Our complete output should now be something like: token }, token contractDeploymentEmitterAddress: EthAddress { token buffer: - token }, - token decoderHelperAddress: EthAddress { - token buffer: token } token } token } +0ms diff --git a/yarn-project/archiver/src/archiver/config.ts b/yarn-project/archiver/src/archiver/config.ts index 29f9731063a..6ec2e2fa994 100644 --- a/yarn-project/archiver/src/archiver/config.ts +++ b/yarn-project/archiver/src/archiver/config.ts @@ -73,8 +73,6 @@ export function getConfigEnvVars(): ArchiverConfig { contractDeploymentEmitterAddress: CONTRACT_DEPLOYMENT_EMITTER_ADDRESS ? EthAddress.fromString(CONTRACT_DEPLOYMENT_EMITTER_ADDRESS) : EthAddress.ZERO, - decoderHelperAddress: EthAddress.ZERO, - headerDecoderHelperAddress: EthAddress.ZERO, }; return { rpcUrl: ETHEREUM_HOST || 'http://127.0.0.1:8545/', diff --git a/yarn-project/aztec.js/src/contract/contract.test.ts b/yarn-project/aztec.js/src/contract/contract.test.ts index 87ce41999c2..8f05d08a139 100644 --- a/yarn-project/aztec.js/src/contract/contract.test.ts +++ b/yarn-project/aztec.js/src/contract/contract.test.ts @@ -26,8 +26,6 @@ describe('Contract Class', () => { inboxAddress: EthAddress.random(), outboxAddress: EthAddress.random(), contractDeploymentEmitterAddress: EthAddress.random(), - decoderHelperAddress: EthAddress.random(), - headerDecoderHelperAddress: EthAddress.random(), }; const mockNodeInfo: NodeInfo = { nodeVersion: 'vx.x.x', diff --git a/yarn-project/end-to-end/src/fixtures/utils.ts b/yarn-project/end-to-end/src/fixtures/utils.ts index efa8afd4610..949f8c46034 100644 --- a/yarn-project/end-to-end/src/fixtures/utils.ts +++ b/yarn-project/end-to-end/src/fixtures/utils.ts @@ -22,10 +22,6 @@ import { import { ContractDeploymentEmitterAbi, ContractDeploymentEmitterBytecode, - DecoderHelperAbi, - DecoderHelperBytecode, - HeaderDecoderHelperAbi, - HeaderDecoderHelperBytecode, InboxAbi, InboxBytecode, OutboxAbi, @@ -33,7 +29,7 @@ import { RegistryAbi, RegistryBytecode, RollupAbi, - RollupBytecode, + RollupBytecode } from '@aztec/l1-artifacts'; import { PXEService, PXEServiceConfig, createPXEService, getPXEServiceConfig } from '@aztec/pxe'; import { SequencerClient } from '@aztec/sequencer-client'; @@ -73,7 +69,6 @@ export const setupL1Contracts = async ( l1RpcUrl: string, account: HDAccount | PrivateKeyAccount, logger: DebugLogger, - deployDecoderHelpers = false, ) => { const l1Artifacts: L1ContractArtifactsForDeployment = { contractDeploymentEmitter: { @@ -97,16 +92,6 @@ export const setupL1Contracts = async ( contractBytecode: RollupBytecode, }, }; - if (deployDecoderHelpers) { - l1Artifacts.decoderHelper = { - contractAbi: DecoderHelperAbi, - contractBytecode: DecoderHelperBytecode, - }; - l1Artifacts.headerDecoderHelper = { - contractAbi: HeaderDecoderHelperAbi, - contractBytecode: HeaderDecoderHelperBytecode, - }; - } return await deployL1Contracts(l1RpcUrl, account, localAnvil, logger, l1Artifacts); }; diff --git a/yarn-project/end-to-end/src/integration_l1_publisher.test.ts b/yarn-project/end-to-end/src/integration_l1_publisher.test.ts index 65aa168a7c8..8d294a3ab95 100644 --- a/yarn-project/end-to-end/src/integration_l1_publisher.test.ts +++ b/yarn-project/end-to-end/src/integration_l1_publisher.test.ts @@ -28,7 +28,7 @@ import { } from '@aztec/circuits.js/factories'; import { createEthereumChain } from '@aztec/ethereum'; import { makeTuple, range } from '@aztec/foundation/array'; -import { DecoderHelperAbi, HeaderDecoderHelperAbi, InboxAbi, OutboxAbi, RollupAbi } from '@aztec/l1-artifacts'; +import { InboxAbi, OutboxAbi, RollupAbi } from '@aztec/l1-artifacts'; import { EmptyRollupProver, L1Publisher, @@ -79,8 +79,6 @@ describe('L1Publisher integration', () => { let rollupAddress: Address; let inboxAddress: Address; let outboxAddress: Address; - let decoderHelperAddress: Address; - let headerDecoderHelperAddress: Address; let rollup: GetContractReturnType>; let inbox: GetContractReturnType< @@ -89,8 +87,6 @@ describe('L1Publisher integration', () => { WalletClient >; let outbox: GetContractReturnType>; - let decoderHelper: GetContractReturnType>; - let headerDecoderHelper: GetContractReturnType>; let publisher: L1Publisher; let l2Proof: Buffer; @@ -118,8 +114,6 @@ describe('L1Publisher integration', () => { rollupAddress = getAddress(l1ContractAddresses.rollupAddress.toString()); inboxAddress = getAddress(l1ContractAddresses.inboxAddress.toString()); outboxAddress = getAddress(l1ContractAddresses.outboxAddress.toString()); - decoderHelperAddress = getAddress(l1ContractAddresses.decoderHelperAddress.toString()); - headerDecoderHelperAddress = getAddress(l1ContractAddresses.headerDecoderHelperAddress.toString()); // Set up contract instances rollup = getContract({ @@ -138,16 +132,6 @@ describe('L1Publisher integration', () => { abi: OutboxAbi, publicClient, }); - decoderHelper = getContract({ - address: decoderHelperAddress!, - abi: DecoderHelperAbi, - publicClient, - }); - headerDecoderHelper = getContract({ - address: headerDecoderHelperAddress!, - abi: HeaderDecoderHelperAbi, - publicClient, - }); builderDb = await MerkleTrees.new(levelup((memdown as any)())).then(t => t.asLatest()); const vks = getVerificationKeys(); @@ -429,35 +413,6 @@ describe('L1Publisher integration', () => { }); expect(ethTx.input).toEqual(expectedData); - const headerDecoderArgs = [`0x${block.header.toBuffer().toString('hex')}`] as const; - const decodedHeader = await headerDecoderHelper.read.decode(headerDecoderArgs); - - expect(Number(block.header.globalVariables.chainId.toBigInt())).toEqual( - Number(decodedHeader.globalVariables.chainId), - ); - expect(Number(block.header.globalVariables.version.toBigInt())).toEqual( - Number(decodedHeader.globalVariables.version), - ); - expect(block.number).toEqual(Number(decodedHeader.globalVariables.blockNumber)); - expect(Number(block.header.globalVariables.timestamp.toBigInt())).toEqual( - Number(decodedHeader.globalVariables.timestamp), - ); - - const receivedLastArchiveRoot = Fr.fromString(decodedHeader.lastArchiveRoot); - const expectedLastArchiveRoot = block.header.lastArchive.root; - expect(expectedLastArchiveRoot).toEqual(receivedLastArchiveRoot); - - const archiveInRollup = Fr.fromString(await rollup.read.archive()); - expect(block.archive.root).toEqual(archiveInRollup); - - const decoderArgs = [`0x${block.bodyToBuffer().toString('hex')}`] as const; - const decodedConsumables = await decoderHelper.read.computeConsumables(decoderArgs); - - // TODO(#4031): Re-enable these checks - // expect(block.getPublicInputsHash().toBuffer()).toEqual(hexStringToBuffer(decodedRes[3].toString())); - // expect(block.getCalldataHash()).toEqual(hexStringToBuffer(decodedHashes[0].toString())); - expect(block.getL1ToL2MessagesHash()).toEqual(hexStringToBuffer(decodedConsumables[1].toString())); - // check that values have been consumed from the inbox for (let j = 0; j < l1ToL2Messages.length; j++) { if (l1ToL2Messages[j].isZero()) { @@ -525,35 +480,6 @@ describe('L1Publisher integration', () => { ], }); expect(ethTx.input).toEqual(expectedData); - - const headerDecoderArgs = [`0x${block.header.toBuffer().toString('hex')}`] as const; - const decodedHeader = await headerDecoderHelper.read.decode(headerDecoderArgs); - - expect(Number(block.header.globalVariables.chainId.toBigInt())).toEqual( - Number(decodedHeader.globalVariables.chainId), - ); - expect(Number(block.header.globalVariables.version.toBigInt())).toEqual( - Number(decodedHeader.globalVariables.version), - ); - expect(block.number).toEqual(Number(decodedHeader.globalVariables.blockNumber)); - expect(Number(block.header.globalVariables.timestamp.toBigInt())).toEqual( - Number(decodedHeader.globalVariables.timestamp), - ); - - const receivedLastArchiveRoot = Fr.fromString(decodedHeader.lastArchiveRoot); - const expectedLastArchiveRoot = block.header.lastArchive.root; - expect(expectedLastArchiveRoot).toEqual(receivedLastArchiveRoot); - - const archiveInRollup = Fr.fromString(await rollup.read.archive()); - expect(block.archive.root).toEqual(archiveInRollup); - - const decoderArgs = [`0x${block.bodyToBuffer().toString('hex')}`] as const; - const decodedConsumables = await decoderHelper.read.computeConsumables(decoderArgs); - - // TODO(#4031): Re-enable these checks - // expect(block.getPublicInputsHash().toBuffer()).toEqual(hexStringToBuffer(decodedRes[3].toString())); - // expect(block.getCalldataHash()).toEqual(hexStringToBuffer(decodedHashes[0].toString())); - expect(block.getL1ToL2MessagesHash()).toEqual(hexStringToBuffer(decodedConsumables[1].toString())); } }, 60_000); }); diff --git a/yarn-project/ethereum/src/deploy_l1_contracts.ts b/yarn-project/ethereum/src/deploy_l1_contracts.ts index 0fdeb6339ac..319243b3c12 100644 --- a/yarn-project/ethereum/src/deploy_l1_contracts.ts +++ b/yarn-project/ethereum/src/deploy_l1_contracts.ts @@ -60,14 +60,6 @@ export interface L1ContractArtifactsForDeployment { * Contract deployment emitter artifacts */ contractDeploymentEmitter: ContractArtifacts; - /** - * Decoder contract artifacts - */ - decoderHelper?: ContractArtifacts; - /** - * Header decoder contract artifacts - */ - headerDecoderHelper?: ContractArtifacts; /** * Inbox contract artifacts */ @@ -169,36 +161,12 @@ export const deployL1Contracts = async ( ); logger(`Deployed contract deployment emitter at ${contractDeploymentEmitterAddress}`); - let decoderHelperAddress: EthAddress | undefined; - if (contractsToDeploy.decoderHelper) { - decoderHelperAddress = await deployL1Contract( - walletClient, - publicClient, - contractsToDeploy.decoderHelper.contractAbi, - contractsToDeploy.decoderHelper.contractBytecode, - ); - logger(`Deployed DecoderHelper at ${decoderHelperAddress}`); - } - - let headerDecoderHelperAddress: EthAddress | undefined; - if (contractsToDeploy.headerDecoderHelper) { - headerDecoderHelperAddress = await deployL1Contract( - walletClient, - publicClient, - contractsToDeploy.headerDecoderHelper.contractAbi, - contractsToDeploy.headerDecoderHelper.contractBytecode, - ); - logger(`Deployed HeaderDecoderHelper at ${headerDecoderHelperAddress}`); - } - const l1Contracts: L1ContractAddresses = { rollupAddress, registryAddress, inboxAddress, outboxAddress, contractDeploymentEmitterAddress, - decoderHelperAddress: decoderHelperAddress ?? EthAddress.ZERO, - headerDecoderHelperAddress: headerDecoderHelperAddress ?? EthAddress.ZERO, }; return { diff --git a/yarn-project/ethereum/src/l1_contract_addresses.ts b/yarn-project/ethereum/src/l1_contract_addresses.ts index 8b46c7c60d6..19fdc4a4e0b 100644 --- a/yarn-project/ethereum/src/l1_contract_addresses.ts +++ b/yarn-project/ethereum/src/l1_contract_addresses.ts @@ -24,12 +24,4 @@ export interface L1ContractAddresses { * Data Emitter Address. */ contractDeploymentEmitterAddress: EthAddress; - /** - * Decoder Helper Address. - */ - decoderHelperAddress: EthAddress; - /** - * Header Decoder Helper Address. - */ - headerDecoderHelperAddress: EthAddress; } diff --git a/yarn-project/l1-artifacts/scripts/generate-artifacts.sh b/yarn-project/l1-artifacts/scripts/generate-artifacts.sh index 6c485e056e9..eae121bdcd3 100755 --- a/yarn-project/l1-artifacts/scripts/generate-artifacts.sh +++ b/yarn-project/l1-artifacts/scripts/generate-artifacts.sh @@ -10,10 +10,6 @@ target_dir=./generated # - a .{CONTRACT_NAME}Abi.ts containing the contract ABI. CONTRACTS=( - "l1-contracts:DecoderHelper" - "l1-contracts:HeaderDecoderHelper" - "l1-contracts:TxsDecoderHelper" - "l1-contracts:MessagesDecoderHelper" "l1-contracts:Registry" "l1-contracts:Inbox" "l1-contracts:Outbox" diff --git a/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts b/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts index 5363c6008b6..b365c03f3ad 100644 --- a/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts +++ b/yarn-project/pxe/src/pxe_service/test/pxe_service.test.ts @@ -30,8 +30,6 @@ async function createPXEService(): Promise { inboxAddress: EthAddress.random(), outboxAddress: EthAddress.random(), contractDeploymentEmitterAddress: EthAddress.random(), - decoderHelperAddress: EthAddress.random(), - headerDecoderHelperAddress: EthAddress.random(), }; node.getL1ContractAddresses.mockResolvedValue(mockedContracts); diff --git a/yarn-project/sequencer-client/src/config.ts b/yarn-project/sequencer-client/src/config.ts index 6b14f491923..bccbe1e6231 100644 --- a/yarn-project/sequencer-client/src/config.ts +++ b/yarn-project/sequencer-client/src/config.ts @@ -58,8 +58,6 @@ export function getConfigEnvVars(): SequencerClientConfig { contractDeploymentEmitterAddress: CONTRACT_DEPLOYMENT_EMITTER_ADDRESS ? EthAddress.fromString(CONTRACT_DEPLOYMENT_EMITTER_ADDRESS) : EthAddress.ZERO, - decoderHelperAddress: EthAddress.ZERO, - headerDecoderHelperAddress: EthAddress.ZERO, }; return {