Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update L2 block structure #3924

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions yarn-project/types/src/l2_block.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.
*/
Expand Down
33 changes: 33 additions & 0 deletions yarn-project/types/src/tx/tx_effect.ts
Original file line number Diff line number Diff line change
@@ -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,
) {}
}