From 0bd3f39308bf78eee513a2265c6ee5cbb1bcb075 Mon Sep 17 00:00:00 2001 From: Leila Wang Date: Fri, 23 Aug 2024 17:14:57 +0000 Subject: [PATCH] Update constants and tests. --- l1-contracts/src/core/libraries/ConstantsGen.sol | 5 +++-- yarn-project/circuits.js/src/constants.gen.ts | 5 +++-- yarn-project/simulator/src/public/side_effect_trace.test.ts | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index e5b0a08205f..8e874cc4772 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -162,6 +162,7 @@ library Constants { uint256 internal constant SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH = 6; uint256 internal constant PARTIAL_STATE_REFERENCE_LENGTH = 6; uint256 internal constant READ_REQUEST_LENGTH = 2; + uint256 internal constant TREE_LEAF_READ_REQUEST_LENGTH = 2; uint256 internal constant LOG_HASH_LENGTH = 3; uint256 internal constant SCOPED_LOG_HASH_LENGTH = 4; uint256 internal constant ENCRYPTED_LOG_HASH_LENGTH = 4; @@ -188,14 +189,14 @@ library Constants { uint256 internal constant SCOPED_READ_REQUEST_LEN = 3; uint256 internal constant PUBLIC_DATA_READ_LENGTH = 2; uint256 internal constant PRIVATE_VALIDATION_REQUESTS_LENGTH = 772; - uint256 internal constant PUBLIC_VALIDATION_REQUESTS_LENGTH = 514; + uint256 internal constant PUBLIC_VALIDATION_REQUESTS_LENGTH = 770; uint256 internal constant PUBLIC_DATA_UPDATE_REQUEST_LENGTH = 3; uint256 internal constant COMBINED_ACCUMULATED_DATA_LENGTH = 610; uint256 internal constant COMBINED_CONSTANT_DATA_LENGTH = 43; uint256 internal constant PRIVATE_ACCUMULATED_DATA_LENGTH = 1336; uint256 internal constant PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 2167; uint256 internal constant PUBLIC_ACCUMULATED_DATA_LENGTH = 1311; - uint256 internal constant PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 3629; + uint256 internal constant PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 3885; uint256 internal constant KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 663; uint256 internal constant CONSTANT_ROLLUP_DATA_LENGTH = 12; uint256 internal constant BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH = 29; diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index 71ba8886eba..be173d699f8 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -146,6 +146,7 @@ export const KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH = 5; export const SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH = 6; export const PARTIAL_STATE_REFERENCE_LENGTH = 6; export const READ_REQUEST_LENGTH = 2; +export const TREE_LEAF_READ_REQUEST_LENGTH = 2; export const LOG_HASH_LENGTH = 3; export const SCOPED_LOG_HASH_LENGTH = 4; export const ENCRYPTED_LOG_HASH_LENGTH = 4; @@ -172,14 +173,14 @@ export const AGGREGATION_OBJECT_LENGTH = 16; export const SCOPED_READ_REQUEST_LEN = 3; export const PUBLIC_DATA_READ_LENGTH = 2; export const PRIVATE_VALIDATION_REQUESTS_LENGTH = 772; -export const PUBLIC_VALIDATION_REQUESTS_LENGTH = 514; +export const PUBLIC_VALIDATION_REQUESTS_LENGTH = 770; export const PUBLIC_DATA_UPDATE_REQUEST_LENGTH = 3; export const COMBINED_ACCUMULATED_DATA_LENGTH = 610; export const COMBINED_CONSTANT_DATA_LENGTH = 43; export const PRIVATE_ACCUMULATED_DATA_LENGTH = 1336; export const PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 2167; export const PUBLIC_ACCUMULATED_DATA_LENGTH = 1311; -export const PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 3629; +export const PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 3885; export const KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 663; export const CONSTANT_ROLLUP_DATA_LENGTH = 12; export const BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH = 29; diff --git a/yarn-project/simulator/src/public/side_effect_trace.test.ts b/yarn-project/simulator/src/public/side_effect_trace.test.ts index 63224eafddf..8ea72de1493 100644 --- a/yarn-project/simulator/src/public/side_effect_trace.test.ts +++ b/yarn-project/simulator/src/public/side_effect_trace.test.ts @@ -102,8 +102,8 @@ describe('Side Effect Trace', () => { //storageAddress: contractAddress, value: utxo, //exists: exists, - counter: startCounter, - //leafIndex: leafIndex, + // counter: startCounter, + leafIndex, }, ]); expect(pxResult.avmCircuitHints.noteHashExists.items).toEqual([{ key: startCounterFr, value: new Fr(exists) }]); @@ -180,7 +180,7 @@ describe('Side Effect Trace', () => { expect(pxResult.l1ToL2MsgReadRequests).toEqual([ { value: utxo, - counter: startCounter, + leafIndex, }, ]); expect(pxResult.avmCircuitHints.l1ToL2MessageExists.items).toEqual([