@aztec/stdlib 1.0.0-nightly.20250708 → 1.0.0-staging.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +6 -3
- package/dest/abi/index.d.ts +0 -1
- package/dest/abi/index.d.ts.map +1 -1
- package/dest/abi/index.js +0 -1
- package/dest/block/l2_block.d.ts +0 -7
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +0 -8
- package/dest/block/l2_block_stream/l2_block_stream.js +1 -1
- package/dest/gas/gas.d.ts +0 -1
- package/dest/gas/gas.d.ts.map +1 -1
- package/dest/gas/gas.js +0 -3
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +1 -3
- package/dest/interfaces/client.d.ts +0 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/client.js +0 -1
- package/dest/interfaces/configs.d.ts +0 -10
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +1 -3
- package/dest/interfaces/proving-job.d.ts +18 -18
- package/dest/interfaces/pxe.d.ts +0 -2
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/server.d.ts +1 -3
- package/dest/interfaces/server.d.ts.map +1 -1
- package/dest/interfaces/server.js +1 -3
- package/dest/interfaces/tx-collector.d.ts +15 -0
- package/dest/interfaces/tx-collector.d.ts.map +1 -0
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +6 -6
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.js +20 -18
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +10 -7
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +32 -17
- package/dest/kernel/hints/build_transient_data_hints.d.ts +1 -2
- package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_transient_data_hints.js +8 -7
- package/dest/kernel/hints/index.d.ts +1 -0
- package/dest/kernel/hints/index.d.ts.map +1 -1
- package/dest/kernel/hints/index.js +1 -0
- package/dest/kernel/hints/note_hash_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/note_hash_read_request_hints.js +4 -4
- package/dest/kernel/hints/nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/nullifier_read_request_hints.js +4 -4
- package/dest/kernel/hints/read_request_hints.d.ts +17 -17
- package/dest/kernel/hints/read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/read_request_hints.js +28 -28
- package/dest/kernel/hints/rollup_validation_requests.d.ts +34 -0
- package/dest/kernel/hints/rollup_validation_requests.d.ts.map +1 -0
- package/dest/kernel/hints/rollup_validation_requests.js +55 -0
- package/dest/kernel/index.d.ts +0 -1
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +0 -1
- package/dest/kernel/private_accumulated_data.d.ts +15 -16
- package/dest/kernel/private_accumulated_data.d.ts.map +1 -1
- package/dest/kernel/private_accumulated_data.js +3 -3
- package/dest/kernel/private_circuit_public_inputs.d.ts +25 -26
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +15 -33
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts +0 -9
- package/dest/kernel/private_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_circuit_public_inputs.js +4 -8
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts +1 -10
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_private_inputs.js +6 -9
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts +4 -11
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +18 -20
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts +4 -4
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +10 -9
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts +11 -11
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +12 -11
- package/dest/kernel/private_validation_requests.d.ts +20 -8
- package/dest/kernel/private_validation_requests.d.ts.map +1 -1
- package/dest/kernel/private_validation_requests.js +21 -9
- package/dest/kernel/utils/order_and_comparison.d.ts +3 -0
- package/dest/kernel/utils/order_and_comparison.d.ts.map +1 -1
- package/dest/kernel/utils/order_and_comparison.js +19 -0
- package/dest/messaging/l2_to_l1_message.d.ts +0 -2
- package/dest/messaging/l2_to_l1_message.d.ts.map +1 -1
- package/dest/messaging/l2_to_l1_message.js +0 -7
- package/dest/p2p/block_proposal.d.ts +1 -8
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +8 -21
- package/dest/p2p/consensus_payload.d.ts +11 -3
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +22 -13
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +3 -5
- package/dest/tests/factories.d.ts +2 -0
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +22 -20
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +12 -14
- package/dest/tx/include_by_timestamp.d.ts +54 -0
- package/dest/tx/include_by_timestamp.d.ts.map +1 -0
- package/dest/tx/include_by_timestamp.js +72 -0
- package/dest/tx/index.d.ts +1 -0
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +1 -0
- package/dest/tx/private_execution_result.d.ts +2 -2
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +11 -11
- package/dest/tx/simulated_tx.js +1 -1
- package/dest/tx/tx.d.ts +2 -7
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +0 -8
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/abi/decoder.ts +6 -3
- package/src/abi/index.ts +0 -1
- package/src/block/l2_block.ts +0 -16
- package/src/block/l2_block_stream/l2_block_stream.ts +1 -1
- package/src/gas/gas.ts +0 -4
- package/src/interfaces/aztec-node-admin.ts +1 -8
- package/src/interfaces/client.ts +0 -1
- package/src/interfaces/configs.ts +0 -6
- package/src/interfaces/pxe.ts +0 -2
- package/src/interfaces/server.ts +1 -3
- package/src/interfaces/tx-collector.ts +17 -0
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +30 -28
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +59 -28
- package/src/kernel/hints/build_transient_data_hints.ts +11 -9
- package/src/kernel/hints/index.ts +1 -0
- package/src/kernel/hints/note_hash_read_request_hints.ts +16 -4
- package/src/kernel/hints/nullifier_read_request_hints.ts +16 -4
- package/src/kernel/hints/read_request_hints.ts +22 -22
- package/src/kernel/hints/rollup_validation_requests.ts +71 -0
- package/src/kernel/index.ts +0 -1
- package/src/kernel/private_accumulated_data.ts +23 -23
- package/src/kernel/private_circuit_public_inputs.ts +68 -92
- package/src/kernel/private_kernel_circuit_public_inputs.ts +1 -9
- package/src/kernel/private_kernel_tail_circuit_private_inputs.ts +4 -13
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +20 -20
- package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +7 -7
- package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +10 -16
- package/src/kernel/private_validation_requests.ts +50 -19
- package/src/kernel/utils/order_and_comparison.ts +25 -0
- package/src/messaging/l2_to_l1_message.ts +0 -9
- package/src/p2p/block_proposal.ts +5 -23
- package/src/p2p/consensus_payload.ts +29 -10
- package/src/p2p/topic_type.ts +1 -3
- package/src/tests/factories.ts +26 -33
- package/src/tests/mocks.ts +9 -7
- package/src/tx/include_by_timestamp.ts +90 -0
- package/src/tx/index.ts +1 -0
- package/src/tx/private_execution_result.ts +9 -11
- package/src/tx/simulated_tx.ts +2 -2
- package/src/tx/tx.ts +1 -14
- package/src/versioning/versioning.ts +3 -0
- package/dest/abi/authorization_selector.d.ts +0 -52
- package/dest/abi/authorization_selector.d.ts.map +0 -1
- package/dest/abi/authorization_selector.js +0 -70
- package/dest/interfaces/tx_provider.d.ts +0 -24
- package/dest/interfaces/tx_provider.d.ts.map +0 -1
- package/dest/kernel/claimed_length_array.d.ts +0 -34
- package/dest/kernel/claimed_length_array.d.ts.map +0 -1
- package/dest/kernel/claimed_length_array.js +0 -58
- package/src/abi/authorization_selector.ts +0 -95
- package/src/interfaces/tx_provider.ts +0 -16
- package/src/kernel/claimed_length_array.ts +0 -104
- /package/dest/interfaces/{tx_provider.js → tx-collector.js} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_ENQUEUED_CALLS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PRIVATE_LOGS_PER_TX } from '@aztec/constants';
|
|
2
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
2
|
+
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
3
3
|
import { ScopedCountedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
4
|
-
import { ClaimedLengthArray } from './claimed_length_array.js';
|
|
5
4
|
import { ScopedCountedLogHash } from './log_hash.js';
|
|
6
5
|
import { ScopedNoteHash } from './note_hash.js';
|
|
7
6
|
import { ScopedNullifier } from './nullifier.js';
|
|
@@ -16,62 +15,62 @@ export declare class PrivateAccumulatedData {
|
|
|
16
15
|
/**
|
|
17
16
|
* The new note hashes made in this transaction.
|
|
18
17
|
*/
|
|
19
|
-
noteHashes:
|
|
18
|
+
noteHashes: Tuple<ScopedNoteHash, typeof MAX_NOTE_HASHES_PER_TX>;
|
|
20
19
|
/**
|
|
21
20
|
* The new nullifiers made in this transaction.
|
|
22
21
|
*/
|
|
23
|
-
nullifiers:
|
|
22
|
+
nullifiers: Tuple<ScopedNullifier, typeof MAX_NULLIFIERS_PER_TX>;
|
|
24
23
|
/**
|
|
25
24
|
* All the new L2 to L1 messages created in this transaction.
|
|
26
25
|
*/
|
|
27
|
-
l2ToL1Msgs:
|
|
26
|
+
l2ToL1Msgs: Tuple<ScopedCountedL2ToL1Message, typeof MAX_L2_TO_L1_MSGS_PER_TX>;
|
|
28
27
|
/**
|
|
29
28
|
* Accumulated logs from all the previous kernel iterations.
|
|
30
29
|
*/
|
|
31
|
-
privateLogs:
|
|
30
|
+
privateLogs: Tuple<ScopedPrivateLogData, typeof MAX_PRIVATE_LOGS_PER_TX>;
|
|
32
31
|
/**
|
|
33
32
|
* Accumulated contract class logs from all the previous kernel iterations.
|
|
34
33
|
* Note: Truncated to 31 bytes to fit in Fr.
|
|
35
34
|
*/
|
|
36
|
-
contractClassLogsHashes:
|
|
35
|
+
contractClassLogsHashes: Tuple<ScopedCountedLogHash, typeof MAX_CONTRACT_CLASS_LOGS_PER_TX>;
|
|
37
36
|
/**
|
|
38
37
|
* Accumulated public call requests from all the previous kernel iterations.
|
|
39
38
|
*/
|
|
40
|
-
publicCallRequests:
|
|
39
|
+
publicCallRequests: Tuple<CountedPublicCallRequest, typeof MAX_ENQUEUED_CALLS_PER_TX>;
|
|
41
40
|
/**
|
|
42
41
|
* Current private call stack.
|
|
43
42
|
*/
|
|
44
|
-
privateCallStack:
|
|
43
|
+
privateCallStack: Tuple<PrivateCallRequest, typeof MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX>;
|
|
45
44
|
constructor(
|
|
46
45
|
/**
|
|
47
46
|
* The new note hashes made in this transaction.
|
|
48
47
|
*/
|
|
49
|
-
noteHashes:
|
|
48
|
+
noteHashes: Tuple<ScopedNoteHash, typeof MAX_NOTE_HASHES_PER_TX>,
|
|
50
49
|
/**
|
|
51
50
|
* The new nullifiers made in this transaction.
|
|
52
51
|
*/
|
|
53
|
-
nullifiers:
|
|
52
|
+
nullifiers: Tuple<ScopedNullifier, typeof MAX_NULLIFIERS_PER_TX>,
|
|
54
53
|
/**
|
|
55
54
|
* All the new L2 to L1 messages created in this transaction.
|
|
56
55
|
*/
|
|
57
|
-
l2ToL1Msgs:
|
|
56
|
+
l2ToL1Msgs: Tuple<ScopedCountedL2ToL1Message, typeof MAX_L2_TO_L1_MSGS_PER_TX>,
|
|
58
57
|
/**
|
|
59
58
|
* Accumulated logs from all the previous kernel iterations.
|
|
60
59
|
*/
|
|
61
|
-
privateLogs:
|
|
60
|
+
privateLogs: Tuple<ScopedPrivateLogData, typeof MAX_PRIVATE_LOGS_PER_TX>,
|
|
62
61
|
/**
|
|
63
62
|
* Accumulated contract class logs from all the previous kernel iterations.
|
|
64
63
|
* Note: Truncated to 31 bytes to fit in Fr.
|
|
65
64
|
*/
|
|
66
|
-
contractClassLogsHashes:
|
|
65
|
+
contractClassLogsHashes: Tuple<ScopedCountedLogHash, typeof MAX_CONTRACT_CLASS_LOGS_PER_TX>,
|
|
67
66
|
/**
|
|
68
67
|
* Accumulated public call requests from all the previous kernel iterations.
|
|
69
68
|
*/
|
|
70
|
-
publicCallRequests:
|
|
69
|
+
publicCallRequests: Tuple<CountedPublicCallRequest, typeof MAX_ENQUEUED_CALLS_PER_TX>,
|
|
71
70
|
/**
|
|
72
71
|
* Current private call stack.
|
|
73
72
|
*/
|
|
74
|
-
privateCallStack:
|
|
73
|
+
privateCallStack: Tuple<PrivateCallRequest, typeof MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX>);
|
|
75
74
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
76
75
|
toString(): `0x${string}`;
|
|
77
76
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_accumulated_data.d.ts","sourceRoot":"","sources":["../../src/kernel/private_accumulated_data.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,oCAAoC,EACpC,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"private_accumulated_data.d.ts","sourceRoot":"","sources":["../../src/kernel/private_accumulated_data.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,oCAAoC,EACpC,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;;GAGG;AACH,qBAAa,sBAAsB;IAE/B;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,cAAc,EAAE,OAAO,sBAAsB,CAAC;IACvE;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,eAAe,EAAE,OAAO,qBAAqB,CAAC;IACvE;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,0BAA0B,EAAE,OAAO,wBAAwB,CAAC;IACrF;;OAEG;IACI,WAAW,EAAE,KAAK,CAAC,oBAAoB,EAAE,OAAO,uBAAuB,CAAC;IAC/E;;;OAGG;IACI,uBAAuB,EAAE,KAAK,CAAC,oBAAoB,EAAE,OAAO,8BAA8B,CAAC;IAClG;;OAEG;IACI,kBAAkB,EAAE,KAAK,CAAC,wBAAwB,EAAE,OAAO,yBAAyB,CAAC;IAC5F;;OAEG;IACI,gBAAgB,EAAE,KAAK,CAAC,kBAAkB,EAAE,OAAO,oCAAoC,CAAC;;IA5B/F;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,cAAc,EAAE,OAAO,sBAAsB,CAAC;IACvE;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,eAAe,EAAE,OAAO,qBAAqB,CAAC;IACvE;;OAEG;IACI,UAAU,EAAE,KAAK,CAAC,0BAA0B,EAAE,OAAO,wBAAwB,CAAC;IACrF;;OAEG;IACI,WAAW,EAAE,KAAK,CAAC,oBAAoB,EAAE,OAAO,uBAAuB,CAAC;IAC/E;;;OAGG;IACI,uBAAuB,EAAE,KAAK,CAAC,oBAAoB,EAAE,OAAO,8BAA8B,CAAC;IAClG;;OAEG;IACI,kBAAkB,EAAE,KAAK,CAAC,wBAAwB,EAAE,OAAO,yBAAyB,CAAC;IAC5F;;OAEG;IACI,gBAAgB,EAAE,KAAK,CAAC,kBAAkB,EAAE,OAAO,oCAAoC,CAAC;IAGjG,QAAQ;IAYR,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,sBAAsB;IAaxE;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,MAAM,CAAC,KAAK;CAWb"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_ENQUEUED_CALLS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, MAX_PRIVATE_LOGS_PER_TX } from '@aztec/constants';
|
|
2
|
+
import { makeTuple } from '@aztec/foundation/array';
|
|
2
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
4
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
5
|
import { ScopedCountedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
5
|
-
import { ClaimedLengthArray, ClaimedLengthArrayFromBuffer } from './claimed_length_array.js';
|
|
6
6
|
import { ScopedCountedLogHash } from './log_hash.js';
|
|
7
7
|
import { ScopedNoteHash } from './note_hash.js';
|
|
8
8
|
import { ScopedNullifier } from './nullifier.js';
|
|
@@ -56,7 +56,7 @@ import { CountedPublicCallRequest } from './public_call_request.js';
|
|
|
56
56
|
* @returns Deserialized object.
|
|
57
57
|
*/ static fromBuffer(buffer) {
|
|
58
58
|
const reader = BufferReader.asReader(buffer);
|
|
59
|
-
return new PrivateAccumulatedData(reader.
|
|
59
|
+
return new PrivateAccumulatedData(reader.readArray(MAX_NOTE_HASHES_PER_TX, ScopedNoteHash), reader.readArray(MAX_NULLIFIERS_PER_TX, ScopedNullifier), reader.readArray(MAX_L2_TO_L1_MSGS_PER_TX, ScopedCountedL2ToL1Message), reader.readArray(MAX_PRIVATE_LOGS_PER_TX, ScopedPrivateLogData), reader.readArray(MAX_CONTRACT_CLASS_LOGS_PER_TX, ScopedCountedLogHash), reader.readArray(MAX_ENQUEUED_CALLS_PER_TX, CountedPublicCallRequest), reader.readArray(MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, PrivateCallRequest));
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Deserializes from a string, corresponding to a write in cpp.
|
|
@@ -66,6 +66,6 @@ import { CountedPublicCallRequest } from './public_call_request.js';
|
|
|
66
66
|
return PrivateAccumulatedData.fromBuffer(hexToBuffer(str));
|
|
67
67
|
}
|
|
68
68
|
static empty() {
|
|
69
|
-
return new PrivateAccumulatedData(
|
|
69
|
+
return new PrivateAccumulatedData(makeTuple(MAX_NOTE_HASHES_PER_TX, ScopedNoteHash.empty), makeTuple(MAX_NULLIFIERS_PER_TX, ScopedNullifier.empty), makeTuple(MAX_L2_TO_L1_MSGS_PER_TX, ScopedCountedL2ToL1Message.empty), makeTuple(MAX_PRIVATE_LOGS_PER_TX, ScopedPrivateLogData.empty), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ScopedCountedLogHash.empty), makeTuple(MAX_ENQUEUED_CALLS_PER_TX, CountedPublicCallRequest.empty), makeTuple(MAX_PRIVATE_CALL_STACK_LENGTH_PER_TX, PrivateCallRequest.empty));
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL, MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASHES_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL } from '@aztec/constants';
|
|
2
2
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
-
import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
|
|
3
|
+
import { BufferReader, FieldReader, type Tuple } from '@aztec/foundation/serialize';
|
|
4
4
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
5
5
|
import { KeyValidationRequestAndGenerator } from '../kernel/hints/key_validation_request_and_generator.js';
|
|
6
6
|
import { CountedLogHash } from '../kernel/log_hash.js';
|
|
@@ -9,9 +9,8 @@ import { PrivateLogData } from '../kernel/private_log_data.js';
|
|
|
9
9
|
import { CountedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
10
10
|
import { BlockHeader } from '../tx/block_header.js';
|
|
11
11
|
import { CallContext } from '../tx/call_context.js';
|
|
12
|
+
import { IncludeByTimestamp } from '../tx/include_by_timestamp.js';
|
|
12
13
|
import { TxContext } from '../tx/tx_context.js';
|
|
13
|
-
import type { UInt64 } from '../types/shared.js';
|
|
14
|
-
import { ClaimedLengthArray } from './claimed_length_array.js';
|
|
15
14
|
import { ReadRequest } from './hints/read_request.js';
|
|
16
15
|
import { NoteHash } from './note_hash.js';
|
|
17
16
|
import { Nullifier } from './nullifier.js';
|
|
@@ -43,35 +42,35 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
43
42
|
/**
|
|
44
43
|
* The highest timestamp of a block in which the transaction can still be included.
|
|
45
44
|
*/
|
|
46
|
-
includeByTimestamp:
|
|
45
|
+
includeByTimestamp: IncludeByTimestamp;
|
|
47
46
|
/**
|
|
48
47
|
* Read requests created by the corresponding function call.
|
|
49
48
|
*/
|
|
50
|
-
noteHashReadRequests:
|
|
49
|
+
noteHashReadRequests: Tuple<ReadRequest, typeof MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>;
|
|
51
50
|
/**
|
|
52
51
|
* Nullifier read requests created by the corresponding function call.
|
|
53
52
|
*/
|
|
54
|
-
nullifierReadRequests:
|
|
53
|
+
nullifierReadRequests: Tuple<ReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_CALL>;
|
|
55
54
|
/**
|
|
56
55
|
* Key validation requests and generators created by the corresponding function call.
|
|
57
56
|
*/
|
|
58
|
-
keyValidationRequestsAndGenerators:
|
|
57
|
+
keyValidationRequestsAndGenerators: Tuple<KeyValidationRequestAndGenerator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_CALL>;
|
|
59
58
|
/**
|
|
60
59
|
* New note hashes created by the corresponding function call.
|
|
61
60
|
*/
|
|
62
|
-
noteHashes:
|
|
61
|
+
noteHashes: Tuple<NoteHash, typeof MAX_NOTE_HASHES_PER_CALL>;
|
|
63
62
|
/**
|
|
64
63
|
* New nullifiers created by the corresponding function call.
|
|
65
64
|
*/
|
|
66
|
-
nullifiers:
|
|
65
|
+
nullifiers: Tuple<Nullifier, typeof MAX_NULLIFIERS_PER_CALL>;
|
|
67
66
|
/**
|
|
68
67
|
* Private call requests made within the current kernel iteration.
|
|
69
68
|
*/
|
|
70
|
-
privateCallRequests:
|
|
69
|
+
privateCallRequests: Tuple<PrivateCallRequest, typeof MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL>;
|
|
71
70
|
/**
|
|
72
71
|
* Public call stack at the current kernel iteration.
|
|
73
72
|
*/
|
|
74
|
-
publicCallRequests:
|
|
73
|
+
publicCallRequests: Tuple<CountedPublicCallRequest, typeof MAX_ENQUEUED_CALLS_PER_CALL>;
|
|
75
74
|
/**
|
|
76
75
|
* Hash of the public teardown function.
|
|
77
76
|
*/
|
|
@@ -79,15 +78,15 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
79
78
|
/**
|
|
80
79
|
* New L2 to L1 messages created by the corresponding function call.
|
|
81
80
|
*/
|
|
82
|
-
l2ToL1Msgs:
|
|
81
|
+
l2ToL1Msgs: Tuple<CountedL2ToL1Message, typeof MAX_L2_TO_L1_MSGS_PER_CALL>;
|
|
83
82
|
/**
|
|
84
83
|
* Logs emitted in this function call.
|
|
85
84
|
*/
|
|
86
|
-
privateLogs:
|
|
85
|
+
privateLogs: Tuple<PrivateLogData, typeof MAX_PRIVATE_LOGS_PER_CALL>;
|
|
87
86
|
/**
|
|
88
87
|
* Hash of the contract class logs emitted in this function call.
|
|
89
88
|
*/
|
|
90
|
-
contractClassLogsHashes:
|
|
89
|
+
contractClassLogsHashes: Tuple<CountedLogHash, typeof MAX_CONTRACT_CLASS_LOGS_PER_CALL>;
|
|
91
90
|
/**
|
|
92
91
|
* The side effect counter at the start of this call.
|
|
93
92
|
*/
|
|
@@ -132,35 +131,35 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
132
131
|
/**
|
|
133
132
|
* The highest timestamp of a block in which the transaction can still be included.
|
|
134
133
|
*/
|
|
135
|
-
includeByTimestamp:
|
|
134
|
+
includeByTimestamp: IncludeByTimestamp,
|
|
136
135
|
/**
|
|
137
136
|
* Read requests created by the corresponding function call.
|
|
138
137
|
*/
|
|
139
|
-
noteHashReadRequests:
|
|
138
|
+
noteHashReadRequests: Tuple<ReadRequest, typeof MAX_NOTE_HASH_READ_REQUESTS_PER_CALL>,
|
|
140
139
|
/**
|
|
141
140
|
* Nullifier read requests created by the corresponding function call.
|
|
142
141
|
*/
|
|
143
|
-
nullifierReadRequests:
|
|
142
|
+
nullifierReadRequests: Tuple<ReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,
|
|
144
143
|
/**
|
|
145
144
|
* Key validation requests and generators created by the corresponding function call.
|
|
146
145
|
*/
|
|
147
|
-
keyValidationRequestsAndGenerators:
|
|
146
|
+
keyValidationRequestsAndGenerators: Tuple<KeyValidationRequestAndGenerator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_CALL>,
|
|
148
147
|
/**
|
|
149
148
|
* New note hashes created by the corresponding function call.
|
|
150
149
|
*/
|
|
151
|
-
noteHashes:
|
|
150
|
+
noteHashes: Tuple<NoteHash, typeof MAX_NOTE_HASHES_PER_CALL>,
|
|
152
151
|
/**
|
|
153
152
|
* New nullifiers created by the corresponding function call.
|
|
154
153
|
*/
|
|
155
|
-
nullifiers:
|
|
154
|
+
nullifiers: Tuple<Nullifier, typeof MAX_NULLIFIERS_PER_CALL>,
|
|
156
155
|
/**
|
|
157
156
|
* Private call requests made within the current kernel iteration.
|
|
158
157
|
*/
|
|
159
|
-
privateCallRequests:
|
|
158
|
+
privateCallRequests: Tuple<PrivateCallRequest, typeof MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL>,
|
|
160
159
|
/**
|
|
161
160
|
* Public call stack at the current kernel iteration.
|
|
162
161
|
*/
|
|
163
|
-
publicCallRequests:
|
|
162
|
+
publicCallRequests: Tuple<CountedPublicCallRequest, typeof MAX_ENQUEUED_CALLS_PER_CALL>,
|
|
164
163
|
/**
|
|
165
164
|
* Hash of the public teardown function.
|
|
166
165
|
*/
|
|
@@ -168,15 +167,15 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
168
167
|
/**
|
|
169
168
|
* New L2 to L1 messages created by the corresponding function call.
|
|
170
169
|
*/
|
|
171
|
-
l2ToL1Msgs:
|
|
170
|
+
l2ToL1Msgs: Tuple<CountedL2ToL1Message, typeof MAX_L2_TO_L1_MSGS_PER_CALL>,
|
|
172
171
|
/**
|
|
173
172
|
* Logs emitted in this function call.
|
|
174
173
|
*/
|
|
175
|
-
privateLogs:
|
|
174
|
+
privateLogs: Tuple<PrivateLogData, typeof MAX_PRIVATE_LOGS_PER_CALL>,
|
|
176
175
|
/**
|
|
177
176
|
* Hash of the contract class logs emitted in this function call.
|
|
178
177
|
*/
|
|
179
|
-
contractClassLogsHashes:
|
|
178
|
+
contractClassLogsHashes: Tuple<CountedLogHash, typeof MAX_CONTRACT_CLASS_LOGS_PER_CALL>,
|
|
180
179
|
/**
|
|
181
180
|
* The side effect counter at the start of this call.
|
|
182
181
|
*/
|
|
@@ -221,7 +220,7 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
221
220
|
* @param fields - Object with fields.
|
|
222
221
|
* @returns The array.
|
|
223
222
|
*/
|
|
224
|
-
static getFields(fields: FieldsOf<PrivateCircuitPublicInputs>): readonly [CallContext, Fr, Fr, Fr, boolean,
|
|
223
|
+
static getFields(fields: FieldsOf<PrivateCircuitPublicInputs>): readonly [CallContext, Fr, Fr, Fr, boolean, IncludeByTimestamp, [ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest], [ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest, ReadRequest], [KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator, KeyValidationRequestAndGenerator], [NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash, NoteHash], [Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier, Nullifier], [PrivateCallRequest, PrivateCallRequest, PrivateCallRequest, PrivateCallRequest, PrivateCallRequest], [CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest, CountedPublicCallRequest], PublicCallRequest, [CountedL2ToL1Message, CountedL2ToL1Message], [PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData, PrivateLogData], [CountedLogHash], Fr, Fr, BlockHeader, TxContext];
|
|
225
224
|
/**
|
|
226
225
|
* Serialize this as a buffer.
|
|
227
226
|
* @returns The buffer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_circuit_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,2BAA2B,EAC3B,oCAAoC,EACpC,0BAA0B,EAC1B,wBAAwB,EACxB,oCAAoC,EACpC,uBAAuB,EACvB,oCAAoC,EACpC,sCAAsC,EACtC,yBAAyB,
|
|
1
|
+
{"version":3,"file":"private_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_circuit_public_inputs.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL, MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASHES_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL } from '@aztec/constants';
|
|
1
|
+
import { MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL, MAX_KEY_VALIDATION_REQUESTS_PER_CALL, MAX_L2_TO_L1_MSGS_PER_CALL, MAX_NOTE_HASHES_PER_CALL, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, MAX_NULLIFIERS_PER_CALL, MAX_NULLIFIER_READ_REQUESTS_PER_CALL, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, MAX_PRIVATE_LOGS_PER_CALL, PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
|
+
import { makeTuple } from '@aztec/foundation/array';
|
|
2
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
4
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
|
-
import { BufferReader, FieldReader,
|
|
5
|
+
import { BufferReader, FieldReader, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
5
6
|
import { KeyValidationRequestAndGenerator } from '../kernel/hints/key_validation_request_and_generator.js';
|
|
6
7
|
import { CountedLogHash } from '../kernel/log_hash.js';
|
|
7
8
|
import { PrivateCallRequest } from '../kernel/private_call_request.js';
|
|
@@ -9,12 +10,13 @@ import { PrivateLogData } from '../kernel/private_log_data.js';
|
|
|
9
10
|
import { CountedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
10
11
|
import { BlockHeader } from '../tx/block_header.js';
|
|
11
12
|
import { CallContext } from '../tx/call_context.js';
|
|
13
|
+
import { IncludeByTimestamp } from '../tx/include_by_timestamp.js';
|
|
12
14
|
import { TxContext } from '../tx/tx_context.js';
|
|
13
|
-
import { ClaimedLengthArray, ClaimedLengthArrayFromBuffer, ClaimedLengthArrayFromFields } from './claimed_length_array.js';
|
|
14
15
|
import { ReadRequest } from './hints/read_request.js';
|
|
15
16
|
import { NoteHash } from './note_hash.js';
|
|
16
17
|
import { Nullifier } from './nullifier.js';
|
|
17
18
|
import { CountedPublicCallRequest, PublicCallRequest } from './public_call_request.js';
|
|
19
|
+
import { isEmptyArray } from './utils/order_and_comparison.js';
|
|
18
20
|
/**
|
|
19
21
|
* Public inputs to a private circuit.
|
|
20
22
|
*/ export class PrivateCircuitPublicInputs {
|
|
@@ -121,20 +123,20 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
|
|
|
121
123
|
* @returns The deserialized instance.
|
|
122
124
|
*/ static fromBuffer(buffer) {
|
|
123
125
|
const reader = BufferReader.asReader(buffer);
|
|
124
|
-
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readBoolean(), reader.
|
|
126
|
+
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readBoolean(), reader.readObject(IncludeByTimestamp), reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_KEY_VALIDATION_REQUESTS_PER_CALL, KeyValidationRequestAndGenerator), reader.readArray(MAX_NOTE_HASHES_PER_CALL, NoteHash), reader.readArray(MAX_NULLIFIERS_PER_CALL, Nullifier), reader.readArray(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PrivateCallRequest), reader.readArray(MAX_ENQUEUED_CALLS_PER_CALL, CountedPublicCallRequest), reader.readObject(PublicCallRequest), reader.readArray(MAX_L2_TO_L1_MSGS_PER_CALL, CountedL2ToL1Message), reader.readArray(MAX_PRIVATE_LOGS_PER_CALL, PrivateLogData), reader.readArray(MAX_CONTRACT_CLASS_LOGS_PER_CALL, CountedLogHash), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(BlockHeader), reader.readObject(TxContext));
|
|
125
127
|
}
|
|
126
128
|
static fromFields(fields) {
|
|
127
129
|
const reader = FieldReader.asReader(fields);
|
|
128
|
-
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readField(), reader.readField(), reader.readField(), reader.readBoolean(), reader.
|
|
130
|
+
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readField(), reader.readField(), reader.readField(), reader.readBoolean(), reader.readObject(IncludeByTimestamp), reader.readArray(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest), reader.readArray(MAX_KEY_VALIDATION_REQUESTS_PER_CALL, KeyValidationRequestAndGenerator), reader.readArray(MAX_NOTE_HASHES_PER_CALL, NoteHash), reader.readArray(MAX_NULLIFIERS_PER_CALL, Nullifier), reader.readArray(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PrivateCallRequest), reader.readArray(MAX_ENQUEUED_CALLS_PER_CALL, CountedPublicCallRequest), reader.readObject(PublicCallRequest), reader.readArray(MAX_L2_TO_L1_MSGS_PER_CALL, CountedL2ToL1Message), reader.readArray(MAX_PRIVATE_LOGS_PER_CALL, PrivateLogData), reader.readArray(MAX_CONTRACT_CLASS_LOGS_PER_CALL, CountedLogHash), reader.readField(), reader.readField(), reader.readObject(BlockHeader), reader.readObject(TxContext));
|
|
129
131
|
}
|
|
130
132
|
/**
|
|
131
133
|
* Create an empty PrivateCircuitPublicInputs.
|
|
132
134
|
* @returns An empty PrivateCircuitPublicInputs object.
|
|
133
135
|
*/ static empty() {
|
|
134
|
-
return new PrivateCircuitPublicInputs(CallContext.empty(), Fr.ZERO, Fr.ZERO, Fr.ZERO, false,
|
|
136
|
+
return new PrivateCircuitPublicInputs(CallContext.empty(), Fr.ZERO, Fr.ZERO, Fr.ZERO, false, IncludeByTimestamp.empty(), makeTuple(MAX_NOTE_HASH_READ_REQUESTS_PER_CALL, ReadRequest.empty), makeTuple(MAX_NULLIFIER_READ_REQUESTS_PER_CALL, ReadRequest.empty), makeTuple(MAX_KEY_VALIDATION_REQUESTS_PER_CALL, KeyValidationRequestAndGenerator.empty), makeTuple(MAX_NOTE_HASHES_PER_CALL, NoteHash.empty), makeTuple(MAX_NULLIFIERS_PER_CALL, Nullifier.empty), makeTuple(MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL, PrivateCallRequest.empty), makeTuple(MAX_ENQUEUED_CALLS_PER_CALL, CountedPublicCallRequest.empty), PublicCallRequest.empty(), makeTuple(MAX_L2_TO_L1_MSGS_PER_CALL, CountedL2ToL1Message.empty), makeTuple(MAX_PRIVATE_LOGS_PER_CALL, PrivateLogData.empty), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_CALL, CountedLogHash.empty), Fr.ZERO, Fr.ZERO, BlockHeader.empty(), TxContext.empty());
|
|
135
137
|
}
|
|
136
138
|
isEmpty() {
|
|
137
|
-
return this.callContext.isEmpty() && this.argsHash.isZero() && this.returnsHash.isZero() && this.minRevertibleSideEffectCounter.isZero() && !this.isFeePayer &&
|
|
139
|
+
return this.callContext.isEmpty() && this.argsHash.isZero() && this.returnsHash.isZero() && this.minRevertibleSideEffectCounter.isZero() && !this.isFeePayer && this.includeByTimestamp.isEmpty() && isEmptyArray(this.noteHashReadRequests) && isEmptyArray(this.nullifierReadRequests) && isEmptyArray(this.keyValidationRequestsAndGenerators) && isEmptyArray(this.noteHashes) && isEmptyArray(this.nullifiers) && isEmptyArray(this.privateCallRequests) && isEmptyArray(this.publicCallRequests) && this.publicTeardownCallRequest.isEmpty() && isEmptyArray(this.l2ToL1Msgs) && isEmptyArray(this.privateLogs) && isEmptyArray(this.contractClassLogsHashes) && this.startSideEffectCounter.isZero() && this.endSideEffectCounter.isZero() && this.historicalHeader.isEmpty() && this.txContext.isEmpty();
|
|
138
140
|
}
|
|
139
141
|
/**
|
|
140
142
|
* Serialize into a field array. Low-level utility.
|
|
@@ -169,36 +171,16 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
|
|
|
169
171
|
* Serialize this as a buffer.
|
|
170
172
|
* @returns The buffer.
|
|
171
173
|
*/ toBuffer() {
|
|
172
|
-
|
|
173
|
-
// return serializeToBuffer(...PrivateCircuitPublicInputs.getFields(this));
|
|
174
|
-
return serializeToBuffer([
|
|
175
|
-
this.callContext,
|
|
176
|
-
this.argsHash,
|
|
177
|
-
this.returnsHash,
|
|
178
|
-
this.minRevertibleSideEffectCounter,
|
|
179
|
-
this.isFeePayer,
|
|
180
|
-
bigintToUInt64BE(this.includeByTimestamp),
|
|
181
|
-
this.noteHashReadRequests,
|
|
182
|
-
this.nullifierReadRequests,
|
|
183
|
-
this.keyValidationRequestsAndGenerators,
|
|
184
|
-
this.noteHashes,
|
|
185
|
-
this.nullifiers,
|
|
186
|
-
this.privateCallRequests,
|
|
187
|
-
this.publicCallRequests,
|
|
188
|
-
this.publicTeardownCallRequest,
|
|
189
|
-
this.l2ToL1Msgs,
|
|
190
|
-
this.privateLogs,
|
|
191
|
-
this.contractClassLogsHashes,
|
|
192
|
-
this.startSideEffectCounter,
|
|
193
|
-
this.endSideEffectCounter,
|
|
194
|
-
this.historicalHeader,
|
|
195
|
-
this.txContext
|
|
196
|
-
]);
|
|
174
|
+
return serializeToBuffer(...PrivateCircuitPublicInputs.getFields(this));
|
|
197
175
|
}
|
|
198
176
|
/**
|
|
199
177
|
* Serialize this as a field array.
|
|
200
178
|
*/ toFields() {
|
|
201
|
-
|
|
179
|
+
const fields = serializeToFields(...PrivateCircuitPublicInputs.getFields(this));
|
|
180
|
+
if (fields.length !== PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH) {
|
|
181
|
+
throw new Error(`Invalid number of fields for PrivateCircuitPublicInputs. Expected ${PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH}, got ${fields.length}`);
|
|
182
|
+
}
|
|
183
|
+
return fields;
|
|
202
184
|
}
|
|
203
185
|
toJSON() {
|
|
204
186
|
return this.toBuffer();
|
|
@@ -2,7 +2,6 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
2
2
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
3
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
4
4
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
5
|
-
import type { UInt64 } from '../types/shared.js';
|
|
6
5
|
import { PrivateAccumulatedData } from './private_accumulated_data.js';
|
|
7
6
|
import { PrivateValidationRequests } from './private_validation_requests.js';
|
|
8
7
|
import { PublicCallRequest } from './public_call_request.js';
|
|
@@ -34,10 +33,6 @@ export declare class PrivateKernelCircuitPublicInputs {
|
|
|
34
33
|
* The address of the fee payer for the transaction
|
|
35
34
|
*/
|
|
36
35
|
feePayer: AztecAddress;
|
|
37
|
-
/**
|
|
38
|
-
* The timestamp by which the transaction must be included in a block.
|
|
39
|
-
*/
|
|
40
|
-
includeByTimestamp: UInt64;
|
|
41
36
|
/**
|
|
42
37
|
* Wether this is a private only tx or not
|
|
43
38
|
*/
|
|
@@ -71,10 +66,6 @@ export declare class PrivateKernelCircuitPublicInputs {
|
|
|
71
66
|
* The address of the fee payer for the transaction
|
|
72
67
|
*/
|
|
73
68
|
feePayer: AztecAddress,
|
|
74
|
-
/**
|
|
75
|
-
* The timestamp by which the transaction must be included in a block.
|
|
76
|
-
*/
|
|
77
|
-
includeByTimestamp: UInt64,
|
|
78
69
|
/**
|
|
79
70
|
* Wether this is a private only tx or not
|
|
80
71
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_circuit_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"private_kernel_circuit_public_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_circuit_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D;;GAEG;AACH,qBAAa,gCAAgC;IAEzC;;OAEG;IACI,SAAS,EAAE,cAAc;IAChC;;OAEG;IACI,8BAA8B,EAAE,EAAE;IACzC;;OAEG;IACI,kBAAkB,EAAE,yBAAyB;IACpD;;OAEG;IACI,GAAG,EAAE,sBAAsB;IAClC;;OAEG;IACI,yBAAyB,EAAE,iBAAiB;IACnD;;OAEG;IACI,QAAQ,EAAE,YAAY;IAC7B;;OAEG;IACI,aAAa,EAAE,OAAO;IAC7B;;OAEG;IACI,qBAAqB,EAAE,EAAE;;IA/BhC;;OAEG;IACI,SAAS,EAAE,cAAc;IAChC;;OAEG;IACI,8BAA8B,EAAE,EAAE;IACzC;;OAEG;IACI,kBAAkB,EAAE,yBAAyB;IACpD;;OAEG;IACI,GAAG,EAAE,sBAAsB;IAClC;;OAEG;IACI,yBAAyB,EAAE,iBAAiB;IACnD;;OAEG;IACI,QAAQ,EAAE,YAAY;IAC7B;;OAEG;IACI,aAAa,EAAE,OAAO;IAC7B;;OAEG;IACI,qBAAqB,EAAE,EAAE;IAGlC,MAAM,KAAK,MAAM,yEAEhB;IAED,MAAM;IAIN,QAAQ;IAaR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,gCAAgC;IAclF,MAAM,CAAC,KAAK;CAYb"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/fields';
|
|
2
2
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
3
|
-
import { BufferReader,
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
5
5
|
import { TxConstantData } from '../tx/tx_constant_data.js';
|
|
6
6
|
import { PrivateAccumulatedData } from './private_accumulated_data.js';
|
|
@@ -15,7 +15,6 @@ import { PublicCallRequest } from './public_call_request.js';
|
|
|
15
15
|
end;
|
|
16
16
|
publicTeardownCallRequest;
|
|
17
17
|
feePayer;
|
|
18
|
-
includeByTimestamp;
|
|
19
18
|
isPrivateOnly;
|
|
20
19
|
claimedFirstNullifier;
|
|
21
20
|
constructor(/**
|
|
@@ -31,8 +30,6 @@ import { PublicCallRequest } from './public_call_request.js';
|
|
|
31
30
|
*/ publicTeardownCallRequest, /**
|
|
32
31
|
* The address of the fee payer for the transaction
|
|
33
32
|
*/ feePayer, /**
|
|
34
|
-
* The timestamp by which the transaction must be included in a block.
|
|
35
|
-
*/ includeByTimestamp, /**
|
|
36
33
|
* Wether this is a private only tx or not
|
|
37
34
|
*/ isPrivateOnly, /**
|
|
38
35
|
* The nullifier that will be used for nonce generation
|
|
@@ -43,7 +40,6 @@ import { PublicCallRequest } from './public_call_request.js';
|
|
|
43
40
|
this.end = end;
|
|
44
41
|
this.publicTeardownCallRequest = publicTeardownCallRequest;
|
|
45
42
|
this.feePayer = feePayer;
|
|
46
|
-
this.includeByTimestamp = includeByTimestamp;
|
|
47
43
|
this.isPrivateOnly = isPrivateOnly;
|
|
48
44
|
this.claimedFirstNullifier = claimedFirstNullifier;
|
|
49
45
|
}
|
|
@@ -54,7 +50,7 @@ import { PublicCallRequest } from './public_call_request.js';
|
|
|
54
50
|
return this.toBuffer();
|
|
55
51
|
}
|
|
56
52
|
toBuffer() {
|
|
57
|
-
return serializeToBuffer(this.constants, this.minRevertibleSideEffectCounter, this.validationRequests, this.end, this.publicTeardownCallRequest, this.feePayer,
|
|
53
|
+
return serializeToBuffer(this.constants, this.minRevertibleSideEffectCounter, this.validationRequests, this.end, this.publicTeardownCallRequest, this.feePayer, this.isPrivateOnly, this.claimedFirstNullifier);
|
|
58
54
|
}
|
|
59
55
|
/**
|
|
60
56
|
* Deserializes from a buffer or reader, corresponding to a write in cpp.
|
|
@@ -62,9 +58,9 @@ import { PublicCallRequest } from './public_call_request.js';
|
|
|
62
58
|
* @returns A new instance of PrivateKernelInnerCircuitPublicInputs.
|
|
63
59
|
*/ static fromBuffer(buffer) {
|
|
64
60
|
const reader = BufferReader.asReader(buffer);
|
|
65
|
-
return new PrivateKernelCircuitPublicInputs(reader.readObject(TxConstantData), reader.readObject(Fr), reader.readObject(PrivateValidationRequests), reader.readObject(PrivateAccumulatedData), reader.readObject(PublicCallRequest), reader.readObject(AztecAddress), reader.
|
|
61
|
+
return new PrivateKernelCircuitPublicInputs(reader.readObject(TxConstantData), reader.readObject(Fr), reader.readObject(PrivateValidationRequests), reader.readObject(PrivateAccumulatedData), reader.readObject(PublicCallRequest), reader.readObject(AztecAddress), reader.readBoolean(), reader.readObject(Fr));
|
|
66
62
|
}
|
|
67
63
|
static empty() {
|
|
68
|
-
return new PrivateKernelCircuitPublicInputs(TxConstantData.empty(), Fr.zero(), PrivateValidationRequests.empty(), PrivateAccumulatedData.empty(), PublicCallRequest.empty(), AztecAddress.ZERO,
|
|
64
|
+
return new PrivateKernelCircuitPublicInputs(TxConstantData.empty(), Fr.zero(), PrivateValidationRequests.empty(), PrivateAccumulatedData.empty(), PublicCallRequest.empty(), AztecAddress.ZERO, false, Fr.zero());
|
|
69
65
|
}
|
|
70
66
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
2
|
-
import type { UInt64 } from '../types/shared.js';
|
|
3
2
|
import { PaddedSideEffectAmounts } from './padded_side_effects.js';
|
|
4
3
|
import { PrivateKernelData } from './private_kernel_data.js';
|
|
5
4
|
/**
|
|
@@ -14,10 +13,6 @@ export declare class PrivateKernelTailCircuitPrivateInputs {
|
|
|
14
13
|
* The number of the padded side effects.
|
|
15
14
|
*/
|
|
16
15
|
paddedSideEffectAmounts: PaddedSideEffectAmounts;
|
|
17
|
-
/**
|
|
18
|
-
* The timestamp by which the transaction must be included in a block.
|
|
19
|
-
*/
|
|
20
|
-
includeByTimestampUpperBound: UInt64;
|
|
21
16
|
constructor(
|
|
22
17
|
/**
|
|
23
18
|
* The previous kernel data
|
|
@@ -26,11 +21,7 @@ export declare class PrivateKernelTailCircuitPrivateInputs {
|
|
|
26
21
|
/**
|
|
27
22
|
* The number of the padded side effects.
|
|
28
23
|
*/
|
|
29
|
-
paddedSideEffectAmounts: PaddedSideEffectAmounts
|
|
30
|
-
/**
|
|
31
|
-
* The timestamp by which the transaction must be included in a block.
|
|
32
|
-
*/
|
|
33
|
-
includeByTimestampUpperBound: UInt64);
|
|
24
|
+
paddedSideEffectAmounts: PaddedSideEffectAmounts);
|
|
34
25
|
isForPublic(): boolean;
|
|
35
26
|
/**
|
|
36
27
|
* Serialize this as a buffer.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_tail_circuit_private_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_tail_circuit_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"private_kernel_tail_circuit_private_inputs.d.ts","sourceRoot":"","sources":["../../src/kernel/private_kernel_tail_circuit_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAG7D;;GAEG;AACH,qBAAa,qCAAqC;IAE9C;;OAEG;IACI,cAAc,EAAE,iBAAiB;IACxC;;OAEG;IACI,uBAAuB,EAAE,uBAAuB;;IAPvD;;OAEG;IACI,cAAc,EAAE,iBAAiB;IACxC;;OAEG;IACI,uBAAuB,EAAE,uBAAuB;IAGzD,WAAW;IAOX;;;OAGG;IACH,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,qCAAqC;CAOxF"}
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
import { BufferReader,
|
|
1
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
2
2
|
import { PaddedSideEffectAmounts } from './padded_side_effects.js';
|
|
3
3
|
import { PrivateKernelData } from './private_kernel_data.js';
|
|
4
|
+
import { countAccumulatedItems } from './utils/order_and_comparison.js';
|
|
4
5
|
/**
|
|
5
6
|
* Input to the private kernel circuit - tail call.
|
|
6
7
|
*/ export class PrivateKernelTailCircuitPrivateInputs {
|
|
7
8
|
previousKernel;
|
|
8
9
|
paddedSideEffectAmounts;
|
|
9
|
-
includeByTimestampUpperBound;
|
|
10
10
|
constructor(/**
|
|
11
11
|
* The previous kernel data
|
|
12
12
|
*/ previousKernel, /**
|
|
13
13
|
* The number of the padded side effects.
|
|
14
|
-
*/ paddedSideEffectAmounts
|
|
15
|
-
* The timestamp by which the transaction must be included in a block.
|
|
16
|
-
*/ includeByTimestampUpperBound){
|
|
14
|
+
*/ paddedSideEffectAmounts){
|
|
17
15
|
this.previousKernel = previousKernel;
|
|
18
16
|
this.paddedSideEffectAmounts = paddedSideEffectAmounts;
|
|
19
|
-
this.includeByTimestampUpperBound = includeByTimestampUpperBound;
|
|
20
17
|
}
|
|
21
18
|
isForPublic() {
|
|
22
|
-
return this.previousKernel.publicInputs.end.publicCallRequests
|
|
19
|
+
return countAccumulatedItems(this.previousKernel.publicInputs.end.publicCallRequests) > 0 || !this.previousKernel.publicInputs.publicTeardownCallRequest.isEmpty();
|
|
23
20
|
}
|
|
24
21
|
/**
|
|
25
22
|
* Serialize this as a buffer.
|
|
26
23
|
* @returns The buffer.
|
|
27
24
|
*/ toBuffer() {
|
|
28
|
-
return serializeToBuffer(this.previousKernel, this.paddedSideEffectAmounts
|
|
25
|
+
return serializeToBuffer(this.previousKernel, this.paddedSideEffectAmounts);
|
|
29
26
|
}
|
|
30
27
|
/**
|
|
31
28
|
* Deserializes from a buffer or reader.
|
|
@@ -33,6 +30,6 @@ import { PrivateKernelData } from './private_kernel_data.js';
|
|
|
33
30
|
* @returns The deserialized instance.
|
|
34
31
|
*/ static fromBuffer(buffer) {
|
|
35
32
|
const reader = BufferReader.asReader(buffer);
|
|
36
|
-
return new PrivateKernelTailCircuitPrivateInputs(reader.readObject(PrivateKernelData), reader.readObject(PaddedSideEffectAmounts)
|
|
33
|
+
return new PrivateKernelTailCircuitPrivateInputs(reader.readObject(PrivateKernelData), reader.readObject(PaddedSideEffectAmounts));
|
|
37
34
|
}
|
|
38
35
|
}
|