Skip to content

Commit

Permalink
chore: bump public call depth
Browse files Browse the repository at this point in the history
  • Loading branch information
fcarreiro committed Apr 18, 2024
1 parent cb1e25b commit f101569
Show file tree
Hide file tree
Showing 12 changed files with 28 additions and 20 deletions.
4 changes: 2 additions & 2 deletions l1-contracts/src/core/libraries/ConstantsGen.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ library Constants {
uint256 internal constant MAX_NEW_NOTE_HASHES_PER_CALL = 16;
uint256 internal constant MAX_NEW_NULLIFIERS_PER_CALL = 16;
uint256 internal constant MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL = 4;
uint256 internal constant MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL = 4;
uint256 internal constant MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL = 16;
uint256 internal constant MAX_NEW_L2_TO_L1_MSGS_PER_CALL = 2;
uint256 internal constant MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL = 16;
uint256 internal constant MAX_PUBLIC_DATA_READS_PER_CALL = 16;
Expand All @@ -31,7 +31,7 @@ library Constants {
uint256 internal constant MAX_NEW_NOTE_HASHES_PER_TX = 64;
uint256 internal constant MAX_NEW_NULLIFIERS_PER_TX = 64;
uint256 internal constant MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX = 8;
uint256 internal constant MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX = 8;
uint256 internal constant MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX = 32;
uint256 internal constant MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX = 32;
uint256 internal constant MAX_PUBLIC_DATA_READS_PER_TX = 32;
uint256 internal constant MAX_NEW_L2_TO_L1_MSGS_PER_TX = 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = 0x24185d8e88fe796dec6e400f3d6c7572cefd85cea80591f268f08a9350992c48;
let test_data_empty_hash = 0x2cbdfd59ceb55fcc4dbe43b9d6f052f5ca448ef5990b005b9927e578b1b69b6c;
assert_eq(hash, test_data_empty_hash);
}
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,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 = 0x24ea9ab3fc039778bef8e7212f6a09feec1019db19b449333b523a08b812ee88;
let test_data_empty_hash = 0x2c1ec6595f8d43f5fc983441bc75a84d2384008f5bd7a1d499da057130abe6cd;
assert_eq(hash, test_data_empty_hash);
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,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 = 0x134d01b778664dbc1ffa953008ce28f72b0cb258533776f10df59a59d791e972;
let test_data_call_stack_item_request_hash = 0x23066ad690c088120f8397cfeb2ef5608d4517342c7ff9fcb713009933ef1c61;
assert_eq(call_stack_item.hash(), test_data_call_stack_item_request_hash);
}

Expand All @@ -87,7 +87,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 = 0x0c0d60d424315af5f106a802b250c27c613a9ec1c0f583c6ad806cf22fe66a13;
let test_data_call_stack_item_hash = 0x1ef9292cf3383605672c06dd50a12c251aa1f037cd826c0fc70d8ee5324e88c4;
assert_eq(call_stack_item.hash(), test_data_call_stack_item_hash);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,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 = 0x1092820bc987359300ff136abf020d58218e1b3484e03d756c76e81ac56ccbf7;
let test_data_empty_hash = 0x048912d56248af479f8d7ecedbba7092d27741b10075a989e040f8e3242a7a3f;
assert_eq(hash, test_data_empty_hash);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ global ARGS_LENGTH: u64 = 16;
global MAX_NEW_NOTE_HASHES_PER_CALL: u64 = 16;
global MAX_NEW_NULLIFIERS_PER_CALL: u64 = 16;
global MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL: u64 = 4;
global MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL: u64 = 4;
global MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL: u64 = 16;
global MAX_NEW_L2_TO_L1_MSGS_PER_CALL: u64 = 2;
global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_CALL: u64 = 16;
global MAX_PUBLIC_DATA_READS_PER_CALL: u64 = 16;
Expand All @@ -40,7 +40,7 @@ global MAX_UNENCRYPTED_LOGS_PER_CALL: u64 = 4; // If modifying, update DEPLOYER_
global MAX_NEW_NOTE_HASHES_PER_TX: u64 = 64;
global MAX_NEW_NULLIFIERS_PER_TX: u64 = 64;
global MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX: u64 = 8;
global MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX: u64 = 8;
global MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX: u64 = 32;
global MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX: u64 = 32;
global MAX_PUBLIC_DATA_READS_PER_TX: u64 = 32;
global MAX_NEW_L2_TO_L1_MSGS_PER_TX: u64 = 2;
Expand Down
4 changes: 2 additions & 2 deletions yarn-project/circuits.js/src/constants.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const ARGS_LENGTH = 16;
export const MAX_NEW_NOTE_HASHES_PER_CALL = 16;
export const MAX_NEW_NULLIFIERS_PER_CALL = 16;
export const MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL = 4;
export const MAX_PUBLIC_CALL_STACK_LENGTH_PER_CALL = 4;
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 = 16;
export const MAX_PUBLIC_DATA_READS_PER_CALL = 16;
Expand All @@ -17,7 +17,7 @@ export const MAX_UNENCRYPTED_LOGS_PER_CALL = 4;
export const MAX_NEW_NOTE_HASHES_PER_TX = 64;
export const MAX_NEW_NULLIFIERS_PER_TX = 64;
export const MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX = 8;
export const MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX = 8;
export const MAX_PUBLIC_CALL_STACK_LENGTH_PER_TX = 32;
export const MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX = 32;
export const MAX_PUBLIC_DATA_READS_PER_TX = 32;
export const MAX_NEW_L2_TO_L1_MSGS_PER_TX = 2;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x24185d8e88fe796dec6e400f3d6c7572cefd85cea80591f268f08a9350992c48>`;
exports[`PrivateCallStackItem computes empty item hash 1`] = `Fr<0x2cbdfd59ceb55fcc4dbe43b9d6f052f5ca448ef5990b005b9927e578b1b69b6c>`;

exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x2e5307580ef277146cc3c6a9d9210c6e317d9b6a033755f509e6161d0eaf576a>`;
exports[`PrivateCallStackItem computes hash 1`] = `Fr<0x13b91b02b88b9856b5ccb70b03484cd04e3621ade4db047514ce1ccb66ffea11>`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PrivateCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x24ea9ab3fc039778bef8e7212f6a09feec1019db19b449333b523a08b812ee88>`;
exports[`PrivateCircuitPublicInputs computes empty inputs hash 1`] = `Fr<0x2c1ec6595f8d43f5fc983441bc75a84d2384008f5bd7a1d499da057130abe6cd>`;

exports[`PrivateCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x144c861f88d1ba68fc7e72f7a578546207bbf785e4a23278601662d85cd25d12>`;
exports[`PrivateCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x27af129fd883d6a50669a5cdd0c0ce91d67b6ddeccfe4df6cd3e5207f77e1cf1>`;
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x0c0d60d424315af5f106a802b250c27c613a9ec1c0f583c6ad806cf22fe66a13"`;
exports[`PublicCallStackItem Computes a callstack item hash 1`] = `"0x1ef9292cf3383605672c06dd50a12c251aa1f037cd826c0fc70d8ee5324e88c4"`;

exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x134d01b778664dbc1ffa953008ce28f72b0cb258533776f10df59a59d791e972"`;
exports[`PublicCallStackItem Computes a callstack item request hash 1`] = `"0x23066ad690c088120f8397cfeb2ef5608d4517342c7ff9fcb713009933ef1c61"`;

exports[`PublicCallStackItem computes hash 1`] = `Fr<0x2c7d4c31cdb4762c88686417968228c7d102e205e89cb157a34365eef5bfb15c>`;
exports[`PublicCallStackItem computes empty item hash 1`] = `Fr<0x0eef6f20d1f73de870f781dad46a843966eb560e2b684752c82cd2bd45f97a34>`;

exports[`PublicCallStackItem computes hash 1`] = `Fr<0x1571225ac99b706576b42ca98a76865ac6057c17bec38f22f6a78793d4b201b6>`;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`PublicCircuitPublicInputs computes empty item hash 1`] = `Fr<0x1092820bc987359300ff136abf020d58218e1b3484e03d756c76e81ac56ccbf7>`;
exports[`PublicCircuitPublicInputs computes empty item hash 1`] = `Fr<0x048912d56248af479f8d7ecedbba7092d27741b10075a989e040f8e3242a7a3f>`;

exports[`PublicCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x251dcf0ab2afb050857487a1545e99cc12ddd7655154f89b8aab1d7872845173>`;
exports[`PublicCircuitPublicInputs hash matches snapshot 1`] = `Fr<0x15e41ce024b6e97478b456f670cfdd712aefe2504fd5145116e9ab7a26672d02>`;
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ describe('PublicCallStackItem', () => {
expect(hash).toMatchSnapshot();
});

it('computes empty item hash', () => {
const item = PublicCallStackItem.empty();
const hash = item.hash();
expect(hash).toMatchSnapshot();
});

it('Computes a callstack item request hash', () => {
const callStack = PublicCallStackItem.empty();

Expand Down

0 comments on commit f101569

Please sign in to comment.