From 8080cc9d74856e5b3496e72fb81bfd553101e0fd Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 11 Jan 2024 16:31:02 +0000 Subject: [PATCH 1/2] tx effect class --- yarn-project/types/src/tx/tx_effect.ts | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 yarn-project/types/src/tx/tx_effect.ts diff --git a/yarn-project/types/src/tx/tx_effect.ts b/yarn-project/types/src/tx/tx_effect.ts new file mode 100644 index 00000000000..bbec0da8c6d --- /dev/null +++ b/yarn-project/types/src/tx/tx_effect.ts @@ -0,0 +1,33 @@ +import { Fr } from '@aztec/circuits.js'; + +import { ContractData } from '../contract_data.js'; +import { TxL2Logs } from '../logs/tx_l2_logs.js'; +import { PublicDataWrite } from '../public_data_write.js'; + +/** Effects of a tx on the network state. */ +export class TxEffect { + constructor( + /** Note hashes emitted in this tx. */ + public readonly noteHashes: Fr[], + /** Nullifiers emitted in this tx. */ + public readonly nullifiers: Fr[], + /** The L2 to L1 messages produced by this tx. */ + public readonly l2ToL1Msgs: Fr[], + /** Contract data of contracts deployed in this tx. */ + public readonly contracts: ContractData[], + /** The public data writes created by this tx. */ + public readonly publicWrites: PublicDataWrite[], + /** + * Encrypted logs emitted by this tx. + * @remarks Only private function emit encrypted logs and for this reason length of `encryptedLogs.functionLogs` + * is equal to the number of private function invocations in the tx. + */ + public readonly encryptedLogs: TxL2Logs, + /** + * Encrypted logs emitted by this tx. + * @remarks Both private and public functions can emit unencrypted logs and for this reason length of + * `unencryptedLogs.functionLogs` is equal to the number of all function invocations in the tx. + */ + public readonly unencryptedLogs: TxL2Logs, + ) {} +} From f602ec761eface143108691463e2f8a0a17a70ba Mon Sep 17 00:00:00 2001 From: benesjan Date: Thu, 11 Jan 2024 16:31:12 +0000 Subject: [PATCH 2/2] gutting block --- yarn-project/types/src/l2_block.ts | 36 ------------------------------ 1 file changed, 36 deletions(-) diff --git a/yarn-project/types/src/l2_block.ts b/yarn-project/types/src/l2_block.ts index 834f9172969..bfa962f0818 100644 --- a/yarn-project/types/src/l2_block.ts +++ b/yarn-project/types/src/l2_block.ts @@ -40,23 +40,7 @@ export class L2Block { */ public numberOfTxs: number; - /** - * Encrypted logs emitted by txs in this block. - * @remarks `L2BlockL2Logs.txLogs` array has to match number of txs in this block and has to be in the same order - * (e.g. logs from the first tx on the first place...). - * @remarks Only private function can emit encrypted logs and for this reason length of - * `newEncryptedLogs.txLogs.functionLogs` is equal to the number of private function invocations in the tx. - */ - public newEncryptedLogs?: L2BlockL2Logs; - /** - * Unencrypted logs emitted by txs in this block. - * @remarks `L2BlockL2Logs.txLogs` array has to match number of txs in this block and has to be in the same order - * (e.g. logs from the first tx on the first place...). - * @remarks Both private and public functions can emit unencrypted logs and for this reason length of - * `newUnencryptedLogs.txLogs.functionLogs` is equal to the number of all function invocations in the tx. - */ - public newUnencryptedLogs?: L2BlockL2Logs; #l1BlockNumber?: bigint; @@ -65,30 +49,10 @@ export class L2Block { public archive: AppendOnlyTreeSnapshot, /** L2 block header. */ public header: Header, - /** - * The commitments to be inserted into the note hash tree. - */ - public newCommitments: Fr[], - /** - * The nullifiers to be inserted into the nullifier tree. - */ - public newNullifiers: Fr[], - /** - * The public data writes to be inserted into the public data tree. - */ - public newPublicDataWrites: PublicDataWrite[], - /** - * The L2 to L1 messages to be inserted into the messagebox on L1. - */ - public newL2ToL1Msgs: Fr[], /** * The contracts leafs to be inserted into the contract tree. */ public newContracts: Fr[], - /** - * The aztec address and ethereum address for the deployed contract and its portal contract. - */ - public newContractData: ContractData[], /** * The L1 to L2 messages to be inserted into the L2 toL2 message tree. */