diff --git a/barretenberg/cpp/pil/avm/constants_gen.pil b/barretenberg/cpp/pil/avm/constants_gen.pil index 6a5a6e1ab14e..adf6902b83c8 100644 --- a/barretenberg/cpp/pil/avm/constants_gen.pil +++ b/barretenberg/cpp/pil/avm/constants_gen.pil @@ -6,9 +6,9 @@ namespace constants(256); pol MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2; pol MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 32; pol MAX_PUBLIC_DATA_READS_PER_CALL = 32; - pol MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 32; - pol MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 32; - pol MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 32; + pol MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 16; + pol MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 16; + pol MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 16; pol MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL = 16; pol MAX_UNENCRYPTED_LOGS_PER_CALL = 4; pol SENDER_SELECTOR = 0; @@ -27,13 +27,13 @@ namespace constants(256); pol START_SIDE_EFFECT_COUNTER = 37; pol TRANSACTION_FEE_SELECTOR = 40; pol START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0; - pol START_NULLIFIER_EXISTS_OFFSET = 32; - pol START_NULLIFIER_NON_EXISTS_OFFSET = 64; - pol START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 96; - pol START_SSTORE_WRITE_OFFSET = 112; - pol START_SLOAD_WRITE_OFFSET = 144; - pol START_EMIT_NOTE_HASH_WRITE_OFFSET = 176; - pol START_EMIT_NULLIFIER_WRITE_OFFSET = 192; - pol START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 208; - pol START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 210; + pol START_NULLIFIER_EXISTS_OFFSET = 16; + pol START_NULLIFIER_NON_EXISTS_OFFSET = 32; + pol START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 48; + pol START_SSTORE_WRITE_OFFSET = 64; + pol START_SLOAD_WRITE_OFFSET = 96; + pol START_EMIT_NOTE_HASH_WRITE_OFFSET = 128; + pol START_EMIT_NULLIFIER_WRITE_OFFSET = 144; + pol START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 160; + pol START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 162; diff --git a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp index 5491bd8a5866..36cdae9545be 100644 --- a/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp +++ b/barretenberg/cpp/src/barretenberg/relations/generated/avm/main.hpp @@ -1481,7 +1481,7 @@ template class mainImpl { Avm_DECLARE_VIEWS(128); auto tmp = (main_sel_op_emit_note_hash * - (kernel_kernel_out_offset - (kernel_emit_note_hash_write_offset + FF(176)))); + (kernel_kernel_out_offset - (kernel_emit_note_hash_write_offset + FF(128)))); tmp *= scaling_factor; std::get<128>(evals) += tmp; } @@ -1499,8 +1499,8 @@ template class mainImpl { auto tmp = (main_sel_op_nullifier_exists * (kernel_kernel_out_offset - - ((main_ib * (kernel_nullifier_exists_write_offset + FF(32))) + - ((-main_ib + FF(1)) * (kernel_nullifier_non_exists_write_offset + FF(64)))))); + ((main_ib * (kernel_nullifier_exists_write_offset + FF(16))) + + ((-main_ib + FF(1)) * (kernel_nullifier_non_exists_write_offset + FF(32)))))); tmp *= scaling_factor; std::get<130>(evals) += tmp; } @@ -1525,7 +1525,7 @@ template class mainImpl { Avm_DECLARE_VIEWS(133); auto tmp = (main_sel_op_emit_nullifier * - (kernel_kernel_out_offset - (kernel_emit_nullifier_write_offset + FF(192)))); + (kernel_kernel_out_offset - (kernel_emit_nullifier_write_offset + FF(144)))); tmp *= scaling_factor; std::get<133>(evals) += tmp; } @@ -1542,7 +1542,7 @@ template class mainImpl { Avm_DECLARE_VIEWS(135); auto tmp = (main_sel_op_l1_to_l2_msg_exists * - (kernel_kernel_out_offset - (kernel_l1_to_l2_msg_exists_write_offset + FF(96)))); + (kernel_kernel_out_offset - (kernel_l1_to_l2_msg_exists_write_offset + FF(48)))); tmp *= scaling_factor; std::get<135>(evals) += tmp; } @@ -1559,7 +1559,7 @@ template class mainImpl { Avm_DECLARE_VIEWS(137); auto tmp = (main_sel_op_emit_unencrypted_log * - (kernel_kernel_out_offset - (kernel_emit_unencrypted_log_write_offset + FF(210)))); + (kernel_kernel_out_offset - (kernel_emit_unencrypted_log_write_offset + FF(162)))); tmp *= scaling_factor; std::get<137>(evals) += tmp; } @@ -1576,7 +1576,7 @@ template class mainImpl { Avm_DECLARE_VIEWS(139); auto tmp = (main_sel_op_emit_l2_to_l1_msg * - (kernel_kernel_out_offset - (kernel_emit_l2_to_l1_msg_write_offset + FF(208)))); + (kernel_kernel_out_offset - (kernel_emit_l2_to_l1_msg_write_offset + FF(160)))); tmp *= scaling_factor; std::get<139>(evals) += tmp; } @@ -1592,7 +1592,7 @@ template class mainImpl { { Avm_DECLARE_VIEWS(141); - auto tmp = (main_sel_op_sload * (kernel_kernel_out_offset - (kernel_sload_write_offset + FF(144)))); + auto tmp = (main_sel_op_sload * (kernel_kernel_out_offset - (kernel_sload_write_offset + FF(96)))); tmp *= scaling_factor; std::get<141>(evals) += tmp; } @@ -1608,7 +1608,7 @@ template class mainImpl { { Avm_DECLARE_VIEWS(143); - auto tmp = (main_sel_op_sstore * (kernel_kernel_out_offset - (kernel_sstore_write_offset + FF(112)))); + auto tmp = (main_sel_op_sstore * (kernel_kernel_out_offset - (kernel_sstore_write_offset + FF(64)))); tmp *= scaling_factor; std::get<143>(evals) += tmp; } diff --git a/barretenberg/cpp/src/barretenberg/vm/avm_trace/aztec_constants.hpp b/barretenberg/cpp/src/barretenberg/vm/avm_trace/aztec_constants.hpp index 88c186725999..abf69ae1c0bd 100644 --- a/barretenberg/cpp/src/barretenberg/vm/avm_trace/aztec_constants.hpp +++ b/barretenberg/cpp/src/barretenberg/vm/avm_trace/aztec_constants.hpp @@ -7,9 +7,9 @@ #define MAX_NEW_L2_TO_L1_MSGS_PER_CALL 2 #define MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL 32 #define MAX_PUBLIC_DATA_READS_PER_CALL 32 -#define MAX_NOTE_HASH_READ_REQUESTS_PER_CALL 32 -#define MAX_NULLIFIER_READ_REQUESTS_PER_CALL 32 -#define MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL 32 +#define MAX_NOTE_HASH_READ_REQUESTS_PER_CALL 16 +#define MAX_NULLIFIER_READ_REQUESTS_PER_CALL 16 +#define MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL 16 #define MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL 16 #define MAX_UNENCRYPTED_LOGS_PER_CALL 4 #define AZTEC_ADDRESS_LENGTH 1 @@ -30,7 +30,7 @@ #define STATE_REFERENCE_LENGTH 8 #define TOTAL_FEES_LENGTH 1 #define HEADER_LENGTH 23 -#define PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH 578 +#define PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH 482 #define PUBLIC_CONTEXT_INPUTS_LENGTH 41 #define SENDER_SELECTOR 0 #define ADDRESS_SELECTOR 1 @@ -48,12 +48,12 @@ #define START_SIDE_EFFECT_COUNTER 37 #define TRANSACTION_FEE_SELECTOR 40 #define START_NOTE_HASH_EXISTS_WRITE_OFFSET 0 -#define START_NULLIFIER_EXISTS_OFFSET 32 -#define START_NULLIFIER_NON_EXISTS_OFFSET 64 -#define START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET 96 -#define START_SSTORE_WRITE_OFFSET 112 -#define START_SLOAD_WRITE_OFFSET 144 -#define START_EMIT_NOTE_HASH_WRITE_OFFSET 176 -#define START_EMIT_NULLIFIER_WRITE_OFFSET 192 -#define START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET 208 -#define START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET 210 +#define START_NULLIFIER_EXISTS_OFFSET 16 +#define START_NULLIFIER_NON_EXISTS_OFFSET 32 +#define START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET 48 +#define START_SSTORE_WRITE_OFFSET 64 +#define START_SLOAD_WRITE_OFFSET 96 +#define START_EMIT_NOTE_HASH_WRITE_OFFSET 128 +#define START_EMIT_NULLIFIER_WRITE_OFFSET 144 +#define START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET 160 +#define START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET 162 diff --git a/l1-contracts/src/core/libraries/ConstantsGen.sol b/l1-contracts/src/core/libraries/ConstantsGen.sol index 49e9d30ba7f3..2d13d85bb09c 100644 --- a/l1-contracts/src/core/libraries/ConstantsGen.sol +++ b/l1-contracts/src/core/libraries/ConstantsGen.sol @@ -22,9 +22,9 @@ library Constants { uint256 internal constant MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2; uint256 internal constant MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 32; uint256 internal constant MAX_PUBLIC_DATA_READS_PER_CALL = 32; - uint256 internal constant MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 32; - uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 32; - uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 32; + uint256 internal constant MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 16; + uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 16; + uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 16; uint256 internal constant MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL = 16; uint256 internal constant MAX_KEY_VALIDATION_REQUESTS_PER_CALL = 16; uint256 internal constant MAX_NOTE_ENCRYPTED_LOGS_PER_CALL = 16; @@ -39,9 +39,9 @@ library Constants { uint256 internal constant MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX = 64; uint256 internal constant MAX_PUBLIC_DATA_READS_PER_TX = 64; uint256 internal constant MAX_NEW_L2_TO_L1_MSGS_PER_TX = 8; - uint256 internal constant MAX_NOTE_HASH_READ_REQUESTS_PER_TX = 128; - uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_TX = 128; - uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 128; + uint256 internal constant MAX_NOTE_HASH_READ_REQUESTS_PER_TX = 64; + uint256 internal constant MAX_NULLIFIER_READ_REQUESTS_PER_TX = 64; + uint256 internal constant MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 64; uint256 internal constant MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX = 64; uint256 internal constant MAX_KEY_VALIDATION_REQUESTS_PER_TX = 64; uint256 internal constant MAX_NOTE_ENCRYPTED_LOGS_PER_TX = 64; @@ -149,22 +149,22 @@ library Constants { uint256 internal constant TX_REQUEST_LENGTH = 13; uint256 internal constant TOTAL_FEES_LENGTH = 1; uint256 internal constant HEADER_LENGTH = 23; - uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 457; - uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 578; - uint256 internal constant PRIVATE_CALL_STACK_ITEM_LENGTH = 460; + uint256 internal constant PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 393; + uint256 internal constant PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 482; + uint256 internal constant PRIVATE_CALL_STACK_ITEM_LENGTH = 396; uint256 internal constant PUBLIC_CONTEXT_INPUTS_LENGTH = 41; uint256 internal constant AGGREGATION_OBJECT_LENGTH = 16; uint256 internal constant SCOPED_READ_REQUEST_LEN = 3; uint256 internal constant PUBLIC_DATA_READ_LENGTH = 2; - uint256 internal constant VALIDATION_REQUESTS_LENGTH = 1602; + uint256 internal constant VALIDATION_REQUESTS_LENGTH = 1026; uint256 internal constant PUBLIC_DATA_UPDATE_REQUEST_LENGTH = 3; uint256 internal constant COMBINED_ACCUMULATED_DATA_LENGTH = 333; uint256 internal constant COMBINED_CONSTANT_DATA_LENGTH = 40; uint256 internal constant CALL_REQUEST_LENGTH = 7; uint256 internal constant PRIVATE_ACCUMULATED_DATA_LENGTH = 1152; - uint256 internal constant PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 2803; + uint256 internal constant PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 2227; uint256 internal constant PUBLIC_ACCUMULATED_DATA_LENGTH = 983; - uint256 internal constant PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 3834; + uint256 internal constant PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 3258; uint256 internal constant KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 383; uint256 internal constant CONSTANT_ROLLUP_DATA_LENGTH = 14; uint256 internal constant BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH = 31; @@ -200,13 +200,13 @@ library Constants { uint256 internal constant START_SIDE_EFFECT_COUNTER = 37; uint256 internal constant TRANSACTION_FEE_SELECTOR = 40; uint256 internal constant START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0; - uint256 internal constant START_NULLIFIER_EXISTS_OFFSET = 32; - uint256 internal constant START_NULLIFIER_NON_EXISTS_OFFSET = 64; - uint256 internal constant START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 96; - uint256 internal constant START_SSTORE_WRITE_OFFSET = 112; - uint256 internal constant START_SLOAD_WRITE_OFFSET = 144; - uint256 internal constant START_EMIT_NOTE_HASH_WRITE_OFFSET = 176; - uint256 internal constant START_EMIT_NULLIFIER_WRITE_OFFSET = 192; - uint256 internal constant START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 208; - uint256 internal constant START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 210; + uint256 internal constant START_NULLIFIER_EXISTS_OFFSET = 16; + uint256 internal constant START_NULLIFIER_NON_EXISTS_OFFSET = 32; + uint256 internal constant START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 48; + uint256 internal constant START_SSTORE_WRITE_OFFSET = 64; + uint256 internal constant START_SLOAD_WRITE_OFFSET = 96; + uint256 internal constant START_EMIT_NOTE_HASH_WRITE_OFFSET = 128; + uint256 internal constant START_EMIT_NULLIFIER_WRITE_OFFSET = 144; + uint256 internal constant START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 160; + uint256 internal constant START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 162; } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_stack_item.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_stack_item.nr index 80ef09922600..bf322ef6adbe 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_stack_item.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_call_stack_item.nr @@ -85,6 +85,6 @@ fn empty_hash() { let hash = item.hash(); // Value from private_call_stack_item.test.ts "computes empty item hash" test - let test_data_empty_hash = 0x22786e4f971661d2e49095e6b038e5170bc47b795253916d5657c4bdd1df50bf; + let test_data_empty_hash = 0x157022d579f892f06461fb895cdf5550b24329e15e7a41df14f9dad582fa1bc5; assert_eq(hash, test_data_empty_hash); } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr index b8871423e59e..e0b364dee9dd 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/private_circuit_public_inputs.nr @@ -250,6 +250,6 @@ fn empty_hash() { let inputs = PrivateCircuitPublicInputs::empty(); let hash = inputs.hash(); // Value from private_circuit_public_inputs.test.ts "computes empty item hash" test - let test_data_empty_hash = 0x1970bf189adc837d1769f9f44a8b55c97d45690e7744859b71b647e808ee8622; + let test_data_empty_hash = 0x1eb5048b5bdcea5ba66519ecd1cbdb9e18fd957d52830b2bcb309f4ce9bcfbd3; assert_eq(hash, test_data_empty_hash); } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_stack_item.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_stack_item.nr index 16a3aec2144c..891985268ef6 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_stack_item.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_call_stack_item.nr @@ -70,7 +70,7 @@ mod tests { let call_stack_item = PublicCallStackItem { contract_address, public_inputs, is_execution_request: true, function_data }; // Value from public_call_stack_item.test.ts "Computes a callstack item request hash" test - let test_data_call_stack_item_request_hash = 0x2751111aa213d9d21279da53531bf90c2da272cf3f959e2a2a1dfceb487bf102; + let test_data_call_stack_item_request_hash = 0x022a2b82af83606ae5a8d4955ef6215e54025193356318aefbde3b5026952953; assert_eq(call_stack_item.hash(), test_data_call_stack_item_request_hash); } @@ -88,7 +88,7 @@ mod tests { let call_stack_item = PublicCallStackItem { contract_address, public_inputs, is_execution_request: false, function_data }; // Value from public_call_stack_item.test.ts "Computes a callstack item hash" test - let test_data_call_stack_item_hash = 0x1860d00d9602966e398c6d585216baba2ffa8c5eddda5faee041136665d8482a; + let test_data_call_stack_item_hash = 0x23a1d22e7bf37df7d68e8fcbfb7e016c060194b7915e3771e2dcd72cea26e427; assert_eq(call_stack_item.hash(), test_data_call_stack_item_hash); } } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr index cd76145a67eb..34da6c7df027 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/abis/public_circuit_public_inputs.nr @@ -201,6 +201,6 @@ fn empty_hash() { let hash = inputs.hash(); // Value from public_circuit_public_inputs.test.ts "computes empty item hash" test - let test_data_empty_hash = 0x01681b19fb7fe21aa9c2cf9fb47520149f46edd679b2e7c2b2c4a279fd685125; + let test_data_empty_hash = 0x2e08158f3f0d9a94e3f17338aadc3733a15bf5d163f94cef1afd8a47b446d789; assert_eq(hash, test_data_empty_hash); } diff --git a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr index b7aa2f9faea8..14855e03d455 100644 --- a/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr +++ b/noir-projects/noir-protocol-circuits/crates/types/src/constants.nr @@ -29,9 +29,9 @@ global MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL: u32 = 16; global MAX_NEW_L2_TO_L1_MSGS_PER_CALL: u32 = 2; global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL: u32 = 32; global MAX_PUBLIC_DATA_READS_PER_CALL: u32 = 32; -global MAX_NOTE_HASH_READ_REQUESTS_PER_CALL: u32 = 32; -global MAX_NULLIFIER_READ_REQUESTS_PER_CALL: u32 = 32; -global MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL: u32 = 32; +global MAX_NOTE_HASH_READ_REQUESTS_PER_CALL: u32 = 16; +global MAX_NULLIFIER_READ_REQUESTS_PER_CALL: u32 = 16; +global MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL: u32 = 16; global MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL: u32 = 16; global MAX_KEY_VALIDATION_REQUESTS_PER_CALL: u32 = 16; global MAX_NOTE_ENCRYPTED_LOGS_PER_CALL: u32 = 16; @@ -52,9 +52,9 @@ global PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u32 = 1; global MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u32 = 64; // MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX + PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX; global MAX_PUBLIC_DATA_READS_PER_TX: u32 = 64; global MAX_NEW_L2_TO_L1_MSGS_PER_TX: u32 = 8; -global MAX_NOTE_HASH_READ_REQUESTS_PER_TX: u32 = 128; -global MAX_NULLIFIER_READ_REQUESTS_PER_TX: u32 = 128; -global MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX: u32 = 128; +global MAX_NOTE_HASH_READ_REQUESTS_PER_TX: u32 = 64; +global MAX_NULLIFIER_READ_REQUESTS_PER_TX: u32 = 64; +global MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX: u32 = 64; global MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX: u32 = 64; // TODO: for large multisends we might run out of key validation requests here but not dealing with this now as // databus will hopefully make the issue go away. @@ -65,7 +65,7 @@ global MAX_UNENCRYPTED_LOGS_PER_TX: u32 = 8; // docs:end:constants // KERNEL CIRCUIT PRIVATE INPUTS CONSTANTS -// global MAX_PUBLIC_DATA_HINTS: u32 = MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX + MAX_PUBLIC_DATA_READS_PER_TX; +// global MAX_PUBLIC_DATA_HINTS: u32 = MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX + MAX_PUBLIC_DATA_READS_PER_TX; // FIX: Sadly, writing this as above causes a type error in type_conversion.ts. global MAX_PUBLIC_DATA_HINTS: u32 = 128; diff --git a/yarn-project/circuits.js/package.json b/yarn-project/circuits.js/package.json index 1444de37a2d8..524b4a622104 100644 --- a/yarn-project/circuits.js/package.json +++ b/yarn-project/circuits.js/package.json @@ -97,4 +97,4 @@ ] ] } -} \ No newline at end of file +} diff --git a/yarn-project/circuits.js/src/constants.gen.ts b/yarn-project/circuits.js/src/constants.gen.ts index 57f4a7d2690a..6be3599a270b 100644 --- a/yarn-project/circuits.js/src/constants.gen.ts +++ b/yarn-project/circuits.js/src/constants.gen.ts @@ -8,9 +8,9 @@ export const MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL = 16; export const MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2; export const MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 32; export const MAX_PUBLIC_DATA_READS_PER_CALL = 32; -export const MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 32; -export const MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 32; -export const MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 32; +export const MAX_NOTE_HASH_READ_REQUESTS_PER_CALL = 16; +export const MAX_NULLIFIER_READ_REQUESTS_PER_CALL = 16; +export const MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_CALL = 16; export const MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_CALL = 16; export const MAX_KEY_VALIDATION_REQUESTS_PER_CALL = 16; export const MAX_NOTE_ENCRYPTED_LOGS_PER_CALL = 16; @@ -25,9 +25,9 @@ export const PROTOCOL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX = 1; export const MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX = 64; export const MAX_PUBLIC_DATA_READS_PER_TX = 64; export const MAX_NEW_L2_TO_L1_MSGS_PER_TX = 8; -export const MAX_NOTE_HASH_READ_REQUESTS_PER_TX = 128; -export const MAX_NULLIFIER_READ_REQUESTS_PER_TX = 128; -export const MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 128; +export const MAX_NOTE_HASH_READ_REQUESTS_PER_TX = 64; +export const MAX_NULLIFIER_READ_REQUESTS_PER_TX = 64; +export const MAX_NULLIFIER_NON_EXISTENT_READ_REQUESTS_PER_TX = 64; export const MAX_L1_TO_L2_MSG_READ_REQUESTS_PER_TX = 64; export const MAX_KEY_VALIDATION_REQUESTS_PER_TX = 64; export const MAX_NOTE_ENCRYPTED_LOGS_PER_TX = 64; @@ -133,22 +133,22 @@ export const TX_CONTEXT_LENGTH = 9; export const TX_REQUEST_LENGTH = 13; export const TOTAL_FEES_LENGTH = 1; export const HEADER_LENGTH = 23; -export const PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 457; -export const PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 578; -export const PRIVATE_CALL_STACK_ITEM_LENGTH = 460; +export const PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH = 393; +export const PUBLIC_CIRCUIT_PUBLIC_INPUTS_LENGTH = 482; +export const PRIVATE_CALL_STACK_ITEM_LENGTH = 396; export const PUBLIC_CONTEXT_INPUTS_LENGTH = 41; export const AGGREGATION_OBJECT_LENGTH = 16; export const SCOPED_READ_REQUEST_LEN = 3; export const PUBLIC_DATA_READ_LENGTH = 2; -export const VALIDATION_REQUESTS_LENGTH = 1602; +export const VALIDATION_REQUESTS_LENGTH = 1026; export const PUBLIC_DATA_UPDATE_REQUEST_LENGTH = 3; export const COMBINED_ACCUMULATED_DATA_LENGTH = 333; export const COMBINED_CONSTANT_DATA_LENGTH = 40; export const CALL_REQUEST_LENGTH = 7; export const PRIVATE_ACCUMULATED_DATA_LENGTH = 1152; -export const PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 2803; +export const PRIVATE_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 2227; export const PUBLIC_ACCUMULATED_DATA_LENGTH = 983; -export const PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 3834; +export const PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 3258; export const KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH = 383; export const CONSTANT_ROLLUP_DATA_LENGTH = 14; export const BASE_OR_MERGE_PUBLIC_INPUTS_LENGTH = 31; @@ -184,15 +184,15 @@ export const END_GLOBAL_VARIABLES = 37; export const START_SIDE_EFFECT_COUNTER = 37; export const TRANSACTION_FEE_SELECTOR = 40; export const START_NOTE_HASH_EXISTS_WRITE_OFFSET = 0; -export const START_NULLIFIER_EXISTS_OFFSET = 32; -export const START_NULLIFIER_NON_EXISTS_OFFSET = 64; -export const START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 96; -export const START_SSTORE_WRITE_OFFSET = 112; -export const START_SLOAD_WRITE_OFFSET = 144; -export const START_EMIT_NOTE_HASH_WRITE_OFFSET = 176; -export const START_EMIT_NULLIFIER_WRITE_OFFSET = 192; -export const START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 208; -export const START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 210; +export const START_NULLIFIER_EXISTS_OFFSET = 16; +export const START_NULLIFIER_NON_EXISTS_OFFSET = 32; +export const START_L1_TO_L2_MSG_EXISTS_WRITE_OFFSET = 48; +export const START_SSTORE_WRITE_OFFSET = 64; +export const START_SLOAD_WRITE_OFFSET = 96; +export const START_EMIT_NOTE_HASH_WRITE_OFFSET = 128; +export const START_EMIT_NULLIFIER_WRITE_OFFSET = 144; +export const START_EMIT_L2_TO_L1_MSG_WRITE_OFFSET = 160; +export const START_EMIT_UNENCRYPTED_LOG_WRITE_OFFSET = 162; export enum GeneratorIndex { NOTE_HASH = 1, NOTE_HASH_NONCE = 2, diff --git a/yarn-project/circuits.js/src/structs/__snapshots__/private_call_stack_item.test.ts.snap b/yarn-project/circuits.js/src/structs/__snapshots__/private_call_stack_item.test.ts.snap index 13c372ae95ed..72fe84f15cef 100644 --- a/yarn-project/circuits.js/src/structs/__snapshots__/private_call_stack_item.test.ts.snap +++ b/yarn-project/circuits.js/src/structs/__snapshots__/private_call_stack_item.test.ts.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x22786e4f971661d2e49095e6b038e5170bc47b795253916d5657c4bdd1df50bf>`; +exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x157022d579f892f06461fb895cdf5550b24329e15e7a41df14f9dad582fa1bc5>`; -exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x059371f1444280bcc61a6cc118c825cf19ec48d99a1d83329c423173ffcd1ba5>`; +exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x029b1573da033e679c68a55e05987602c5e73419c4fdfdd6104e178a9a360834>`; diff --git a/yarn-project/circuits.js/src/structs/__snapshots__/private_circuit_public_inputs.test.ts.snap b/yarn-project/circuits.js/src/structs/__snapshots__/private_circuit_public_inputs.test.ts.snap index 6689b80d3f24..676f8aca3577 100644 --- a/yarn-project/circuits.js/src/structs/__snapshots__/private_circuit_public_inputs.test.ts.snap +++ b/yarn-project/circuits.js/src/structs/__snapshots__/private_circuit_public_inputs.test.ts.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PrivateCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x1970bf189adc837d1769f9f44a8b55c97d45690e7744859b71b647e808ee8622>`; +exports[`PrivateCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x1eb5048b5bdcea5ba66519ecd1cbdb9e18fd957d52830b2bcb309f4ce9bcfbd3>`; -exports[`PrivateCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x23557986e5b094bee30a103a2966383adbe3dae3caf67daba63c9853ce2bb927>`; +exports[`PrivateCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x0b02f49b7283dacf553c5cfc0615c979fdd1cd146a1d4e71c78610345a711d22>`; diff --git a/yarn-project/circuits.js/src/structs/__snapshots__/public_call_stack_item.test.ts.snap b/yarn-project/circuits.js/src/structs/__snapshots__/public_call_stack_item.test.ts.snap index df58d2f111ea..4db396c18cd1 100644 --- a/yarn-project/circuits.js/src/structs/__snapshots__/public_call_stack_item.test.ts.snap +++ b/yarn-project/circuits.js/src/structs/__snapshots__/public_call_stack_item.test.ts.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x1860d00d9602966e398c6d585216baba2ffa8c5eddda5faee041136665d8482a"`; +exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x23a1d22e7bf37df7d68e8fcbfb7e016c060194b7915e3771e2dcd72cea26e427"`; -exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x2751111aa213d9d21279da53531bf90c2da272cf3f959e2a2a1dfceb487bf102"`; +exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x022a2b82af83606ae5a8d4955ef6215e54025193356318aefbde3b5026952953"`; -exports[`PublicCallStackItem computes empty item hash 1`] = `Fr<0x2c9346c79caabece80bfe330b9e45ed4dde78099e01a013da690485738a42af2>`; +exports[`PublicCallStackItem computes empty item hash 1`] = `Fr<0x211932b705c9a5dbbaf2433d2ee4b0a896ef9fb720a4efbe7c1e783747c36588>`; -exports[`PublicCallStackItem computes hash 1`] = `Fr<0x272aa1a005b7839cdc8b72f50d2020529da11a5245f3c11481c29ce8b55e0da2>`; +exports[`PublicCallStackItem computes hash 1`] = `Fr<0x2d9862fe4fb3db6fe24996cbc3064346aa4551ccd41246c1ca6b002b8b0201fd>`; diff --git a/yarn-project/circuits.js/src/structs/__snapshots__/public_circuit_public_inputs.test.ts.snap b/yarn-project/circuits.js/src/structs/__snapshots__/public_circuit_public_inputs.test.ts.snap index 5194415896aa..df8a677f2983 100644 --- a/yarn-project/circuits.js/src/structs/__snapshots__/public_circuit_public_inputs.test.ts.snap +++ b/yarn-project/circuits.js/src/structs/__snapshots__/public_circuit_public_inputs.test.ts.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`PublicCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x01681b19fb7fe21aa9c2cf9fb47520149f46edd679b2e7c2b2c4a279fd685125>`; +exports[`PublicCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x2e08158f3f0d9a94e3f17338aadc3733a15bf5d163f94cef1afd8a47b446d789>`; -exports[`PublicCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x162be1c50854010ab8ab30efde30e9fb05c8d441c0d5942bb0eace875f584c64>`; +exports[`PublicCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x17718899a1af9292f21e6cceab91915edf7dc356c0e7e7354340d25f91e935cf>`;