Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
making space for private_kernel_vk_tree_root
Browse files Browse the repository at this point in the history
benesjan committed Dec 1, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 768c704 commit 40ade4d
Showing 32 changed files with 131 additions and 83 deletions.
2 changes: 1 addition & 1 deletion circuits/cpp/src/aztec3/constants.hpp
Original file line number Diff line number Diff line change
@@ -315,7 +315,7 @@ constexpr size_t VIEW_NOTE_ORACLE_RETURN_LENGTH = MAX_NOTES_PER_PAGE * (MAX_NOTE

constexpr size_t CALL_CONTEXT_LENGTH = 7;
// Must be updated if any data is added into the block hash calculation.
constexpr size_t BLOCK_HEADER_LENGTH = 7;
constexpr size_t BLOCK_HEADER_LENGTH = 8;
constexpr size_t FUNCTION_DATA_LENGTH = 4;
constexpr size_t CONTRACT_DEPLOYMENT_DATA_LENGTH = 6;

12 changes: 6 additions & 6 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
@@ -70,18 +70,18 @@ library Constants {
uint256 internal constant MAX_NOTES_PER_PAGE = 10;
uint256 internal constant VIEW_NOTE_ORACLE_RETURN_LENGTH = 212;
uint256 internal constant CALL_CONTEXT_LENGTH = 7;
uint256 internal constant BLOCK_HEADER_LENGTH = 7;
uint256 internal constant BLOCK_HEADER_LENGTH = 8;
uint256 internal constant FUNCTION_DATA_LENGTH = 4;
uint256 internal constant CONTRACT_DEPLOYMENT_DATA_LENGTH = 6;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 155;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 156;
uint256 internal constant CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH = 3;
uint256 internal constant CONTRACT_STORAGE_READ_LENGTH = 2;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 142;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 143;
uint256 internal constant GET_NOTES_ORACLE_RETURN_LENGTH = 674;
uint256 internal constant EMPTY_NULLIFIED_COMMITMENT = 1000000;
uint256 internal constant CALL_PRIVATE_FUNCTION_RETURN_SIZE = 161;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 87;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 144;
uint256 internal constant CALL_PRIVATE_FUNCTION_RETURN_SIZE = 162;
uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 88;
uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 145;
uint256 internal constant COMMITMENTS_NUM_BYTES_PER_BASE_ROLLUP = 4096;
uint256 internal constant NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP = 4096;
uint256 internal constant PUBLIC_DATA_WRITES_NUM_BYTES_PER_BASE_ROLLUP = 2048;
4 changes: 2 additions & 2 deletions yarn-project/acir-simulator/src/acvm/deserialize.ts
Original file line number Diff line number Diff line change
@@ -169,7 +169,7 @@ export function extractPrivateCircuitPublicInputs(
witnessReader.readField(),
witnessReader.readField(),
witnessReader.readField(),
// Fr.ZERO, // TODO(#3441)
Fr.ZERO, // TODO(#3441)
witnessReader.readField(),
witnessReader.readField(),
);
@@ -261,7 +261,7 @@ export function extractPublicCircuitPublicInputs(partialWitness: ACVMWitness, ac
witnessReader.readField(),
witnessReader.readField(),
witnessReader.readField(),
// Fr.ZERO, // TODO(#3441)
Fr.ZERO, // TODO(#3441)
witnessReader.readField(),
witnessReader.readField(),
);
2 changes: 1 addition & 1 deletion yarn-project/acir-simulator/src/client/view_data_oracle.ts
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ export class ViewDataOracle extends TypedOracle {
block.endContractTreeSnapshot.root,
block.endL1ToL2MessagesTreeSnapshot.root,
block.endBlocksTreeSnapshot.root,
// new Fr(0), // TODO(#3441) privateKernelVkTreeRoot is not present in L2Block and it's not yet populated in noir
new Fr(0), // TODO(#3441) privateKernelVkTreeRoot is not present in L2Block and it's not yet populated in noir
block.endPublicDataTreeRoot,
block.globalVariables.hash(),
);
2 changes: 1 addition & 1 deletion yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
@@ -510,7 +510,7 @@ export class AztecNodeService implements AztecNode {
roots[MerkleTreeId.CONTRACT_TREE],
roots[MerkleTreeId.L1_TO_L2_MESSAGES_TREE],
roots[MerkleTreeId.BLOCKS_TREE],
// Fr.ZERO, // TODO(#3441)
Fr.ZERO, // TODO(#3441)
roots[MerkleTreeId.PUBLIC_DATA_TREE],
globalsHash,
);
12 changes: 6 additions & 6 deletions yarn-project/aztec-nr/aztec/src/abi.nr
Original file line number Diff line number Diff line change
@@ -148,7 +148,7 @@ struct BlockHeader {
contract_tree_root : Field,
l1_to_l2_messages_tree_root : Field,
blocks_tree_root: Field,
// private_kernel_vk_tree_root : Field, // TODO(#3441)
private_kernel_vk_tree_root : Field,
public_data_tree_root: Field,
global_variables_hash: Field,
}
@@ -163,7 +163,7 @@ impl BlockHeader {
self.contract_tree_root,
self.l1_to_l2_messages_tree_root,
self.blocks_tree_root,
// self.private_kernel_vk_tree_root, // TODO(#3441)
self.private_kernel_vk_tree_root,
self.public_data_tree_root,
self.global_variables_hash,
]
@@ -176,9 +176,9 @@ impl BlockHeader {
contract_tree_root: deserialized[2],
l1_to_l2_messages_tree_root: deserialized[3],
blocks_tree_root: deserialized[4],
// private_kernel_vk_tree_root: deserialized[5], // TODO(#3441)
public_data_tree_root: deserialized[5],
global_variables_hash: deserialized[6],
private_kernel_vk_tree_root: deserialized[5],
public_data_tree_root: deserialized[6],
global_variables_hash: deserialized[7],
}
}

@@ -189,7 +189,7 @@ impl BlockHeader {
contract_tree_root: 0,
l1_to_l2_messages_tree_root: 0,
blocks_tree_root: 0,
// private_kernel_vk_tree_root: 0, // TODO(#3441)
private_kernel_vk_tree_root: 0,
public_data_tree_root: 0,
global_variables_hash: 0
}
12 changes: 6 additions & 6 deletions yarn-project/aztec-nr/aztec/src/constants_gen.nr
Original file line number Diff line number Diff line change
@@ -98,22 +98,22 @@ global MAX_NOTES_PER_PAGE: Field = 10;
// VIEW_NOTE_ORACLE_RETURN_LENGTH = MAX_NOTES_PER_PAGE * (MAX_NOTE_FIELDS_LENGTH + 1) + 2;
global VIEW_NOTE_ORACLE_RETURN_LENGTH: Field = 212;
global CALL_CONTEXT_LENGTH: Field = 7;
global BLOCK_HEADER_LENGTH: Field = 7;
global BLOCK_HEADER_LENGTH: Field = 8;
global FUNCTION_DATA_LENGTH: Field = 4;
global CONTRACT_DEPLOYMENT_DATA_LENGTH: Field = 6;
// Change this ONLY if you have changed the PrivateCircuitPublicInputs structure.
// In other words, if the structure/size of the public inputs of a function call changes then we
// should change this constant as well as the offsets in private_call_stack_item.nr
global PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 155;
global PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 156;
global CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH: Field = 3;
global CONTRACT_STORAGE_READ_LENGTH: Field = 2;
// Change this ONLY if you have changed the PublicCircuitPublicInputs structure.
global PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 142;
global PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH: Field = 143;
global GET_NOTES_ORACLE_RETURN_LENGTH: Field = 674;
global EMPTY_NULLIFIED_COMMITMENT: Field = 1000000;
global CALL_PRIVATE_FUNCTION_RETURN_SIZE: Field = 161;
global PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 87;
global PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 144;
global CALL_PRIVATE_FUNCTION_RETURN_SIZE: Field = 162;
global PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 88;
global PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH: Field = 145;
global COMMITMENTS_NUM_BYTES_PER_BASE_ROLLUP: Field = 4096;
global NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP: Field = 4096;
global PUBLIC_DATA_WRITES_NUM_BYTES_PER_BASE_ROLLUP: Field = 2048;
2 changes: 1 addition & 1 deletion yarn-project/aztec-nr/aztec/src/context.nr
Original file line number Diff line number Diff line change
@@ -296,7 +296,7 @@ impl PrivateContext {
contract_tree_root : fields[147],
l1_to_l2_messages_tree_root : fields[148],
blocks_tree_root : fields[149],
// private_kernel_vk_tree_root: 0, // TODO(#3441)
private_kernel_vk_tree_root: 0, // TODO(#3441)
public_data_tree_root: fields[150],
global_variables_hash: fields[151],
},
24 changes: 18 additions & 6 deletions yarn-project/aztec.js/src/artifacts/ecdsa_account_contract.json

Large diffs are not rendered by default.

24 changes: 18 additions & 6 deletions yarn-project/aztec.js/src/artifacts/schnorr_account_contract.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

12 changes: 7 additions & 5 deletions yarn-project/circuits.js/src/abis/abis.test.ts
Original file line number Diff line number Diff line change
@@ -130,19 +130,21 @@ describe('abis', () => {
const contractTreeRoot = new Fr(3n);
const l1ToL2MessagesTreeRoot = new Fr(4n);
const blocksTreeRoot = new Fr(5n);
const publicDataTreeRoot = new Fr(6n);
const privateKernelVkTreeRoot = new Fr(6n);
const publicDataTreeRoot = new Fr(7n);
const globals = GlobalVariables.from({
chainId: new Fr(7n),
version: new Fr(8n),
blockNumber: new Fr(9n),
timestamp: new Fr(10n),
chainId: new Fr(8n),
version: new Fr(9n),
blockNumber: new Fr(10n),
timestamp: new Fr(11n),
});
const blockHeader = new BlockHeader(
noteHashTreeRoot,
nullifierTreeRoot,
contractTreeRoot,
l1ToL2MessagesTreeRoot,
blocksTreeRoot,
privateKernelVkTreeRoot,
publicDataTreeRoot,
globals.hash(),
);
12 changes: 6 additions & 6 deletions yarn-project/circuits.js/src/constants.gen.ts
Original file line number Diff line number Diff line change
@@ -56,18 +56,18 @@ export const GET_NOTE_ORACLE_RETURN_LENGTH = 23;
export const MAX_NOTES_PER_PAGE = 10;
export const VIEW_NOTE_ORACLE_RETURN_LENGTH = 212;
export const CALL_CONTEXT_LENGTH = 7;
export const BLOCK_HEADER_LENGTH = 7;
export const BLOCK_HEADER_LENGTH = 8;
export const FUNCTION_DATA_LENGTH = 4;
export const CONTRACT_DEPLOYMENT_DATA_LENGTH = 6;
export const PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 155;
export const PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 156;
export const CONTRACT_STORAGE_UPDATE_REQUEST_LENGTH = 3;
export const CONTRACT_STORAGE_READ_LENGTH = 2;
export const PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 142;
export const PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 143;
export const GET_NOTES_ORACLE_RETURN_LENGTH = 674;
export const EMPTY_NULLIFIED_COMMITMENT = 1000000;
export const CALL_PRIVATE_FUNCTION_RETURN_SIZE = 161;
export const PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 87;
export const PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 144;
export const CALL_PRIVATE_FUNCTION_RETURN_SIZE = 162;
export const PUBLIC_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 88;
export const PRIVATE_CIRCUIT_PUBLIC_INPUTS_HASH_INPUT_LENGTH = 145;
export const COMMITMENTS_NUM_BYTES_PER_BASE_ROLLUP = 4096;
export const NULLIFIERS_NUM_BYTES_PER_BASE_ROLLUP = 4096;
export const PUBLIC_DATA_WRITES_NUM_BYTES_PER_BASE_ROLLUP = 2048;
25 changes: 8 additions & 17 deletions yarn-project/circuits.js/src/structs/kernel/block_header.ts
Original file line number Diff line number Diff line change
@@ -39,7 +39,7 @@ export class BlockHeader {
/**
* Root of the private kernel vk tree at the time of when this information was assembled.
*/
// public privateKernelVkTreeRoot: Fr, // TODO(#3441) future enhancement
public privateKernelVkTreeRoot: Fr,
/**
* Current public state tree hash.
*/
@@ -61,7 +61,7 @@ export class BlockHeader {
Fr.random(),
Fr.random(),
Fr.random(),
// Fr.random(),
Fr.random(),
Fr.random(),
Fr.random(),
);
@@ -74,7 +74,7 @@ export class BlockHeader {
fields.contractTreeRoot,
fields.l1ToL2MessagesTreeRoot,
fields.blocksTreeRoot,
// fields.privateKernelVkTreeRoot,
fields.privateKernelVkTreeRoot,
fields.publicDataTreeRoot,
fields.globalVariablesHash,
] as const;
@@ -99,8 +99,8 @@ export class BlockHeader {
this.nullifierTreeRoot,
this.contractTreeRoot,
this.l1ToL2MessagesTreeRoot,
this.blocksTreeRoot, // TODO(#3441) Note private_kernel_vk_tree_root, is not included yet as
// it is not present in noir,
this.blocksTreeRoot,
this.privateKernelVkTreeRoot,
this.publicDataTreeRoot,
this.globalVariablesHash,
];
@@ -120,7 +120,7 @@ export class BlockHeader {
Fr.fromBuffer(reader),
Fr.fromBuffer(reader),
Fr.fromBuffer(reader),
// Fr.fromBuffer(reader),
Fr.fromBuffer(reader),
Fr.fromBuffer(reader),
Fr.fromBuffer(reader),
);
@@ -137,22 +137,13 @@ export class BlockHeader {
this.contractTreeRoot.isZero() &&
this.l1ToL2MessagesTreeRoot.isZero() &&
this.blocksTreeRoot.isZero() &&
// this.privateKernelVkTreeRoot.isZero() &&
this.privateKernelVkTreeRoot.isZero() &&
this.publicDataTreeRoot.isZero() &&
this.globalVariablesHash.isZero()
);
}

static empty() {
return new BlockHeader(
Fr.ZERO,
Fr.ZERO,
Fr.ZERO,
Fr.ZERO,
Fr.ZERO,
// Fr.ZERO,
Fr.ZERO,
Fr.ZERO,
);
return new BlockHeader(Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO);
}
}
2 changes: 1 addition & 1 deletion yarn-project/circuits.js/src/tests/factories.ts
Original file line number Diff line number Diff line change
@@ -126,7 +126,7 @@ export function makeBlockHeader(seed: number): BlockHeader {
fr(seed + 2),
fr(seed + 3),
fr(seed + 4),
// fr(seed + 5), // TODO(#3441)
fr(seed + 5),
fr(seed + 6),
fr(seed + 7),
);
Original file line number Diff line number Diff line change
@@ -47,6 +47,7 @@ impl RootRollupInputs {
contract_tree_root: right.end_contract_tree_snapshot.root,
l1_to_l2_messages_tree_root: new_l1_to_l2_messages_tree_snapshot.root,
blocks_tree_root: self.start_blocks_tree_snapshot.root,
private_kernel_vk_tree_root: 0, // TODO(#3441)
public_data_tree_root: right.end_public_data_tree_root,
global_variables_hash: left.constants.global_variables.hash(),
};
Original file line number Diff line number Diff line change
@@ -21,5 +21,5 @@ global BLOCK_HEADER = BlockHeader {
l1_to_l2_messages_tree_root: 0,
public_data_tree_root: 0,
global_variables_hash: 0,
// private_kernel_vk_tree_root: 0, // TODO(#3441)
private_kernel_vk_tree_root: 0,
};
6 changes: 3 additions & 3 deletions yarn-project/noir-protocol-circuits/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -109,7 +109,7 @@ describe('Private kernel', () => {
Fr.fromString('0x1864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f80'),
Fr.fromString('0x1864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f80'),
Fr.fromString('0x1759d221795419503f86c032e8f8762f2b739e74835099584b6531f5f27390fe'),
// Fr.ZERO, // TODO(#3441)
Fr.ZERO, // TODO(#3441)
Fr.fromString('0x0ccaafdc9c353743970d4e305ae73641ce694f07db67886d2769c9ed88e969d8'),
Fr.fromString('0x200569267c0f73ac89aaa414239398db9445dd4ad3a8cf37015cd55b8d4c5e8d'),
);
@@ -221,7 +221,7 @@ describe('Private kernel', () => {
Fr.fromString('0x1864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f80'),
Fr.fromString('0x1864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f80'),
Fr.fromString('0x1759d221795419503f86c032e8f8762f2b739e74835099584b6531f5f27390fe'),
// Fr.ZERO, // TODO(#3441)
Fr.ZERO, // TODO(#3441)
Fr.fromString('0x0ccaafdc9c353743970d4e305ae73641ce694f07db67886d2769c9ed88e969d8'),
Fr.fromString('0x200569267c0f73ac89aaa414239398db9445dd4ad3a8cf37015cd55b8d4c5e8d'),
);
@@ -281,7 +281,7 @@ describe('Private kernel', () => {
Fr.fromString('0x2f7255183443071e94e90651593c46342978e689e1f4f3e402616fa59633b974'),
Fr.fromString('0x1864fcdaa80ff2719154fa7c8a9050662972707168d69eac9db6fd3110829f80'),
Fr.fromString('0x0b5dc49ca51b087630220a0d988be8b94a5a1e1f599c94cd9f6bd557008ad85b'),
// Fr.ZERO, // TODO(#3441)
Fr.ZERO, // TODO(#3441)
Fr.fromString('0x0ccaafdc9c353743970d4e305ae73641ce694f07db67886d2769c9ed88e969d8'),
Fr.fromString('0x13773ca7810cb23562420f51fb9fe9c5fdf596271fc9ab78d768bca514bd6a0f'),
);
Original file line number Diff line number Diff line change
@@ -92,7 +92,7 @@ describe('Noir<>Circuits.js type conversion test suite', () => {
new Fr(37n),
new Fr(38n),
new Fr(39n),
// new Fr(40n), // TODO(#3441)
new Fr(40n),
new Fr(41n),
new Fr(42n),
);
4 changes: 2 additions & 2 deletions yarn-project/noir-protocol-circuits/src/type_conversion.ts
Original file line number Diff line number Diff line change
@@ -446,7 +446,7 @@ export function mapBlockHeaderToNoir(blockHeader: BlockHeader): BlockHeaderNoir
l1_to_l2_messages_tree_root: mapFieldToNoir(blockHeader.l1ToL2MessagesTreeRoot),
public_data_tree_root: mapFieldToNoir(blockHeader.publicDataTreeRoot),
global_variables_hash: mapFieldToNoir(blockHeader.globalVariablesHash),
// private_kernel_vk_tree_root: mapFieldToNoir(blockHeader.privateKernelVkTreeRoot),
private_kernel_vk_tree_root: mapFieldToNoir(blockHeader.privateKernelVkTreeRoot),
};
}

@@ -462,7 +462,7 @@ export function mapBlockHeaderFromNoir(blockHeader: BlockHeaderNoir): BlockHeade
mapFieldFromNoir(blockHeader.contract_tree_root),
mapFieldFromNoir(blockHeader.l1_to_l2_messages_tree_root),
mapFieldFromNoir(blockHeader.blocks_tree_root),
// mapFieldFromNoir(blockHeader.private_kernel_vk_tree_root),
mapFieldFromNoir(blockHeader.private_kernel_vk_tree_root),
mapFieldFromNoir(blockHeader.public_data_tree_root),
mapFieldFromNoir(blockHeader.global_variables_hash),
);
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@ export interface BlockHeader {
contract_tree_root: Field;
l1_to_l2_messages_tree_root: Field;
blocks_tree_root: Field;
private_kernel_vk_tree_root: Field;
public_data_tree_root: Field;
global_variables_hash: Field;
}
Original file line number Diff line number Diff line change
@@ -93,6 +93,7 @@ export interface BlockHeader {
contract_tree_root: Field;
l1_to_l2_messages_tree_root: Field;
blocks_tree_root: Field;
private_kernel_vk_tree_root: Field;
public_data_tree_root: Field;
global_variables_hash: Field;
}
Original file line number Diff line number Diff line change
@@ -93,6 +93,7 @@ export interface BlockHeader {
contract_tree_root: Field;
l1_to_l2_messages_tree_root: Field;
blocks_tree_root: Field;
private_kernel_vk_tree_root: Field;
public_data_tree_root: Field;
global_variables_hash: Field;
}
Original file line number Diff line number Diff line change
@@ -93,6 +93,7 @@ export interface BlockHeader {
contract_tree_root: Field;
l1_to_l2_messages_tree_root: Field;
blocks_tree_root: Field;
private_kernel_vk_tree_root: Field;
public_data_tree_root: Field;
global_variables_hash: Field;
}
Original file line number Diff line number Diff line change
@@ -93,6 +93,7 @@ export interface BlockHeader {
contract_tree_root: Field;
l1_to_l2_messages_tree_root: Field;
blocks_tree_root: Field;
private_kernel_vk_tree_root: Field;
public_data_tree_root: Field;
global_variables_hash: Field;
}
Original file line number Diff line number Diff line change
@@ -93,6 +93,7 @@ export interface BlockHeader {
contract_tree_root: Field;
l1_to_l2_messages_tree_root: Field;
blocks_tree_root: Field;
private_kernel_vk_tree_root: Field;
public_data_tree_root: Field;
global_variables_hash: Field;
}
2 changes: 1 addition & 1 deletion yarn-project/pxe/src/database/memory_db.ts
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ export class MemoryDB extends MemoryContractDatabase implements Database {
roots[MerkleTreeId.CONTRACT_TREE],
roots[MerkleTreeId.L1_TO_L2_MESSAGES_TREE],
roots[MerkleTreeId.BLOCKS_TREE],
// Fr.ZERO, // TODO(#3441)
Fr.ZERO, // TODO(#3441)
roots[MerkleTreeId.PUBLIC_DATA_TREE],
this.globalVariablesHash,
);
4 changes: 2 additions & 2 deletions yarn-project/pxe/src/synchronizer/synchronizer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AztecAddress, BlockHeader, PublicKey } from '@aztec/circuits.js';
import { AztecAddress, BlockHeader, Fr, PublicKey } from '@aztec/circuits.js';
import { DebugLogger, createDebugLogger } from '@aztec/foundation/log';
import { InterruptibleSleep } from '@aztec/foundation/sleep';
import { AztecNode, INITIAL_L2_BLOCK_NUM, KeyStore, L2BlockContext, L2BlockL2Logs, LogType } from '@aztec/types';
@@ -205,7 +205,7 @@ export class Synchronizer {
block.endContractTreeSnapshot.root,
block.endL1ToL2MessagesTreeSnapshot.root,
block.endBlocksTreeSnapshot.root,
// Fr.ZERO, // TODO(#3441)
Fr.ZERO, // TODO(#3441)
block.endPublicDataTreeRoot,
latestBlock.block.globalVariables.hash(),
);
Original file line number Diff line number Diff line change
@@ -151,6 +151,7 @@ describe('sequencer/solo_block_builder', () => {
rootRollupOutput.endContractTreeSnapshot.root,
rootRollupOutput.endL1ToL2MessagesTreeSnapshot.root,
rootRollupOutput.endBlocksTreeSnapshot.root,
Fr.ZERO, // TODO(#3441)
rootRollupOutput.endPublicDataTreeRoot,
globalVariables.hash(),
);
@@ -265,7 +266,7 @@ describe('sequencer/solo_block_builder', () => {
builder = new SoloBlockBuilder(builderDb, vks, simulator, prover);
});

it('builds an L2 block using mock simulator', async () => {
it.only('builds an L2 block using mock simulator', async () => {
// Assemble a fake transaction
const txs = await buildMockSimulatorInputs();

Original file line number Diff line number Diff line change
@@ -349,6 +349,7 @@ export class SoloBlockBuilder implements BlockBuilder {
contractTreeRoot,
l1ToL2MessageTreeRoot,
blocksTreeRoot,
Fr.ZERO, // TODO(#3441)
publicDataTreeRoot,
globals.hash(),
);
2 changes: 1 addition & 1 deletion yarn-project/sequencer-client/src/sequencer/utils.ts
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ export async function getBlockHeader(
Fr.fromBuffer(roots.contractDataTreeRoot),
Fr.fromBuffer(roots.l1Tol2MessagesTreeRoot),
Fr.fromBuffer(roots.blocksTreeRoot),
// Fr.ZERO, // TODO(#3441)
Fr.ZERO, // TODO(#3441)
Fr.fromBuffer(roots.publicDataTreeRoot),
prevBlockGlobalVariables.hash(),
);
12 changes: 11 additions & 1 deletion yarn-project/world-state/src/world-state-db/merkle_trees.ts
Original file line number Diff line number Diff line change
@@ -227,7 +227,17 @@ export class MerkleTrees implements MerkleTreeDb {

private async _getCurrentBlockHash(globalsHash: Fr, includeUncommitted: boolean): Promise<Fr> {
const roots = (await this._getAllTreeRoots(includeUncommitted)).map(root => Fr.fromBuffer(root));
const blockHeader = new BlockHeader(roots[0], roots[1], roots[2], roots[3], roots[4], roots[5], globalsHash);
const privateKernelVkTreeRoot = Fr.ZERO; // TODO(#3441)
const blockHeader = new BlockHeader(
roots[0],
roots[1],
roots[2],
roots[3],
roots[4],
privateKernelVkTreeRoot,
roots[5],
globalsHash,
);
return blockHeader.blockHash();
}

0 comments on commit 40ade4d

Please sign in to comment.