@aztec/stdlib 0.0.1-commit.8f9871590 → 0.0.1-commit.9117c5f5a
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 +1 -1
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +1 -4
- package/dest/abi/encoder.d.ts +1 -1
- package/dest/abi/encoder.d.ts.map +1 -1
- package/dest/abi/encoder.js +9 -5
- package/dest/auth_witness/auth_witness.js +3 -3
- package/dest/avm/avm.d.ts +300 -300
- package/dest/avm/avm_proving_request.d.ts +166 -166
- package/dest/avm/revert_code.d.ts +16 -1
- package/dest/avm/revert_code.d.ts.map +1 -1
- package/dest/avm/revert_code.js +15 -5
- package/dest/block/block_data.d.ts +52 -0
- package/dest/block/block_data.d.ts.map +1 -0
- package/dest/block/block_data.js +12 -0
- package/dest/block/index.d.ts +2 -1
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block_source.d.ts +20 -1
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +10 -0
- package/dest/checkpoint/checkpoint.d.ts +6 -1
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +5 -4
- package/dest/checkpoint/checkpoint_data.d.ts +120 -0
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_data.js +26 -0
- package/dest/checkpoint/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -0
- package/dest/checkpoint/published_checkpoint.d.ts +11 -2
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +1 -2
- package/dest/config/sequencer-config.d.ts +2 -2
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +6 -0
- package/dest/contract/contract_address.js +4 -4
- package/dest/contract/contract_class.d.ts +2 -3
- package/dest/contract/contract_class.d.ts.map +1 -1
- package/dest/contract/contract_class_id.js +3 -3
- package/dest/contract/private_function.js +2 -2
- package/dest/file-store/local.d.ts +3 -3
- package/dest/file-store/local.d.ts.map +1 -1
- package/dest/file-store/local.js +13 -4
- package/dest/file-store/s3.d.ts +1 -1
- package/dest/file-store/s3.d.ts.map +1 -1
- package/dest/file-store/s3.js +11 -3
- package/dest/ha-signing/config.d.ts +101 -0
- package/dest/ha-signing/config.d.ts.map +1 -0
- package/dest/ha-signing/config.js +92 -0
- package/dest/ha-signing/index.d.ts +3 -0
- package/dest/ha-signing/index.d.ts.map +1 -0
- package/dest/ha-signing/index.js +2 -0
- package/dest/ha-signing/types.d.ts +85 -0
- package/dest/ha-signing/types.d.ts.map +1 -0
- package/dest/ha-signing/types.js +32 -0
- package/dest/hash/hash.js +11 -11
- package/dest/hash/map_slot.js +2 -2
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +5 -0
- package/dest/interfaces/aztec-node-admin.d.ts +30 -2
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +9 -3
- package/dest/interfaces/configs.d.ts +17 -2
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +4 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +2 -2
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/p2p.d.ts +3 -8
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +2 -2
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +1 -1
- package/dest/kernel/hints/build_note_hash_read_request_hints.d.ts +3 -3
- 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 +13 -10
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts +3 -3
- package/dest/kernel/hints/build_nullifier_read_request_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_nullifier_read_request_hints.js +13 -10
- package/dest/kernel/hints/build_transient_data_hints.d.ts +5 -2
- package/dest/kernel/hints/build_transient_data_hints.d.ts.map +1 -1
- package/dest/kernel/hints/build_transient_data_hints.js +9 -3
- package/dest/kernel/hints/index.d.ts +2 -2
- package/dest/kernel/hints/index.js +2 -2
- package/dest/kernel/hints/key_validation_request_and_separator.d.ts +24 -0
- package/dest/kernel/hints/key_validation_request_and_separator.d.ts.map +1 -0
- package/dest/kernel/hints/{key_validation_request_and_generator.js → key_validation_request_and_separator.js} +12 -15
- package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts → scoped_key_validation_request_and_separator.d.ts} +8 -8
- package/dest/kernel/hints/{scoped_key_validation_request_and_generator.d.ts.map → scoped_key_validation_request_and_separator.d.ts.map} +1 -1
- package/dest/kernel/hints/{scoped_key_validation_request_and_generator.js → scoped_key_validation_request_and_separator.js} +6 -6
- package/dest/kernel/private_circuit_public_inputs.d.ts +6 -6
- package/dest/kernel/private_circuit_public_inputs.js +11 -11
- package/dest/kernel/private_to_public_kernel_circuit_public_inputs.js +2 -2
- package/dest/kernel/private_to_rollup_kernel_circuit_public_inputs.js +2 -2
- package/dest/kernel/private_validation_requests.d.ts +3 -3
- package/dest/kernel/private_validation_requests.js +9 -9
- package/dest/keys/derivation.js +8 -8
- package/dest/keys/key_types.d.ts +3 -3
- package/dest/keys/key_types.d.ts.map +1 -1
- package/dest/keys/public_keys.js +2 -2
- package/dest/keys/utils.js +5 -5
- package/dest/logs/debug_log_store.d.ts +30 -0
- package/dest/logs/debug_log_store.d.ts.map +1 -0
- package/dest/logs/debug_log_store.js +30 -0
- package/dest/logs/extended_directional_app_tagging_secret.d.ts +47 -0
- package/dest/logs/extended_directional_app_tagging_secret.d.ts.map +1 -0
- package/dest/logs/{directional_app_tagging_secret.js → extended_directional_app_tagging_secret.js} +23 -15
- package/dest/logs/index.d.ts +3 -2
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +2 -1
- package/dest/logs/pre_tag.d.ts +16 -11
- package/dest/logs/pre_tag.d.ts.map +1 -1
- package/dest/logs/pre_tag.js +2 -2
- package/dest/logs/private_log.d.ts +2 -2
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/siloed_tag.d.ts +5 -3
- package/dest/logs/siloed_tag.d.ts.map +1 -1
- package/dest/logs/siloed_tag.js +6 -1
- package/dest/logs/tag.js +1 -1
- package/dest/p2p/attestation_utils.d.ts +11 -1
- package/dest/p2p/attestation_utils.d.ts.map +1 -1
- package/dest/p2p/attestation_utils.js +45 -0
- package/dest/p2p/block_proposal.d.ts +2 -2
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +2 -4
- package/dest/p2p/checkpoint_proposal.d.ts +2 -2
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +1 -1
- package/dest/p2p/client_type.d.ts +2 -5
- package/dest/p2p/client_type.d.ts.map +1 -1
- package/dest/p2p/client_type.js +0 -7
- package/dest/p2p/index.d.ts +1 -2
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +0 -1
- package/dest/p2p/topic_type.d.ts +3 -4
- package/dest/p2p/topic_type.d.ts.map +1 -1
- package/dest/p2p/topic_type.js +7 -24
- package/dest/rollup/checkpoint_header.d.ts +2 -2
- package/dest/rollup/checkpoint_header.js +2 -2
- package/dest/tests/factories.d.ts +3 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +18 -10
- package/dest/tests/mocks.d.ts +2 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +5 -5
- package/dest/tx/block_header.js +2 -2
- package/dest/tx/global_variables.d.ts +4 -4
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/profiling.d.ts +4 -4
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +3 -3
- package/dest/tx/protocol_contracts.d.ts +1 -1
- package/dest/tx/protocol_contracts.d.ts.map +1 -1
- package/dest/tx/protocol_contracts.js +2 -2
- package/dest/tx/public_simulation_output.d.ts +4 -2
- package/dest/tx/public_simulation_output.d.ts.map +1 -1
- package/dest/tx/public_simulation_output.js +7 -3
- package/dest/tx/tx_receipt.d.ts +16 -2
- package/dest/tx/tx_receipt.d.ts.map +1 -1
- package/dest/tx/tx_receipt.js +11 -3
- package/dest/tx/tx_request.js +2 -2
- package/package.json +10 -10
- package/src/abi/decoder.ts +1 -4
- package/src/abi/encoder.ts +8 -5
- package/src/auth_witness/auth_witness.ts +3 -3
- package/src/avm/revert_code.ts +15 -0
- package/src/block/block_data.ts +26 -0
- package/src/block/index.ts +1 -0
- package/src/block/l2_block_source.ts +22 -0
- package/src/block/l2_block_stream/l2_block_stream.ts +21 -0
- package/src/checkpoint/checkpoint.ts +5 -3
- package/src/checkpoint/checkpoint_data.ts +51 -0
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/published_checkpoint.ts +3 -1
- package/src/config/sequencer-config.ts +11 -1
- package/src/contract/contract_address.ts +4 -4
- package/src/contract/contract_class.ts +3 -3
- package/src/contract/contract_class_id.ts +3 -3
- package/src/contract/private_function.ts +2 -2
- package/src/file-store/local.ts +15 -5
- package/src/file-store/s3.ts +12 -3
- package/src/ha-signing/config.ts +149 -0
- package/src/ha-signing/index.ts +18 -0
- package/src/ha-signing/types.ts +112 -0
- package/src/hash/hash.ts +11 -11
- package/src/hash/map_slot.ts +2 -2
- package/src/interfaces/archiver.ts +5 -0
- package/src/interfaces/aztec-node-admin.ts +23 -0
- package/src/interfaces/configs.ts +12 -1
- package/src/interfaces/merkle_tree_operations.ts +1 -1
- package/src/interfaces/p2p.ts +2 -13
- package/src/interfaces/validator.ts +1 -1
- package/src/kernel/hints/build_note_hash_read_request_hints.ts +14 -18
- package/src/kernel/hints/build_nullifier_read_request_hints.ts +15 -18
- package/src/kernel/hints/build_transient_data_hints.ts +17 -2
- package/src/kernel/hints/index.ts +2 -2
- package/src/kernel/hints/{key_validation_request_and_generator.ts → key_validation_request_and_separator.ts} +12 -15
- package/src/kernel/hints/{scoped_key_validation_request_and_generator.ts → scoped_key_validation_request_and_separator.ts} +10 -10
- package/src/kernel/private_circuit_public_inputs.ts +10 -10
- package/src/kernel/private_to_public_kernel_circuit_public_inputs.ts +2 -2
- package/src/kernel/private_to_rollup_kernel_circuit_public_inputs.ts +2 -2
- package/src/kernel/private_validation_requests.ts +8 -8
- package/src/keys/derivation.ts +8 -8
- package/src/keys/key_types.ts +6 -2
- package/src/keys/public_keys.ts +2 -2
- package/src/keys/utils.ts +5 -5
- package/src/logs/debug_log_store.ts +54 -0
- package/src/logs/{directional_app_tagging_secret.ts → extended_directional_app_tagging_secret.ts} +24 -16
- package/src/logs/index.ts +2 -1
- package/src/logs/pre_tag.ts +5 -5
- package/src/logs/siloed_tag.ts +8 -2
- package/src/logs/tag.ts +1 -1
- package/src/p2p/attestation_utils.ts +56 -0
- package/src/p2p/block_proposal.ts +1 -3
- package/src/p2p/checkpoint_proposal.ts +1 -1
- package/src/p2p/client_type.ts +0 -6
- package/src/p2p/index.ts +0 -1
- package/src/p2p/topic_type.ts +8 -15
- package/src/rollup/checkpoint_header.ts +2 -2
- package/src/tests/factories.ts +20 -11
- package/src/tests/mocks.ts +7 -3
- package/src/tx/block_header.ts +2 -2
- package/src/tx/global_variables.ts +3 -3
- package/src/tx/profiling.ts +5 -5
- package/src/tx/protocol_contracts.ts +2 -2
- package/src/tx/public_simulation_output.ts +4 -0
- package/src/tx/tx_receipt.ts +10 -0
- package/src/tx/tx_request.ts +2 -2
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts +0 -30
- package/dest/kernel/hints/key_validation_request_and_generator.d.ts.map +0 -1
- package/dest/logs/directional_app_tagging_secret.d.ts +0 -40
- package/dest/logs/directional_app_tagging_secret.d.ts.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { MAX_NOTE_HASH_READ_REQUESTS_PER_TX } from '@aztec/constants';
|
|
2
2
|
import { NoteHashReadRequestHintsBuilder } from './note_hash_read_request_hints.js';
|
|
3
3
|
import { PendingReadHint, ReadRequestActionEnum, ReadRequestResetActions } from './read_request_hints.js';
|
|
4
|
-
import { ScopedValueCache } from './scoped_value_cache.js';
|
|
5
4
|
export function isValidNoteHashReadRequest(readRequest, noteHash) {
|
|
6
5
|
return noteHash.value.equals(readRequest.value) && noteHash.contractAddress.equals(readRequest.contractAddress) && readRequest.counter > noteHash.counter;
|
|
7
6
|
}
|
|
8
|
-
export function getNoteHashReadRequestResetActions(noteHashReadRequests, noteHashes
|
|
7
|
+
export function getNoteHashReadRequestResetActions(noteHashReadRequests, noteHashes) {
|
|
9
8
|
const resetActions = ReadRequestResetActions.empty(MAX_NOTE_HASH_READ_REQUESTS_PER_TX);
|
|
10
9
|
const noteHashMap = new Map();
|
|
11
10
|
noteHashes.getActiveItems().forEach((noteHash, index)=>{
|
|
@@ -17,15 +16,19 @@ export function getNoteHashReadRequestResetActions(noteHashReadRequests, noteHas
|
|
|
17
16
|
});
|
|
18
17
|
noteHashMap.set(value, arr);
|
|
19
18
|
});
|
|
20
|
-
const futureNoteHashMap = new ScopedValueCache(futureNoteHashes);
|
|
21
19
|
for(let i = 0; i < noteHashReadRequests.claimedLength; ++i){
|
|
22
20
|
const readRequest = noteHashReadRequests.array[i];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
resetActions.actions[i] = ReadRequestActionEnum.READ_AS_PENDING;
|
|
26
|
-
resetActions.pendingReadHints.push(new PendingReadHint(i, pendingNoteHash.index));
|
|
27
|
-
} else if (!futureNoteHashMap.get(readRequest).find((futureNoteHash)=>isValidNoteHashReadRequest(readRequest, futureNoteHash))) {
|
|
21
|
+
if (readRequest.contractAddress.isZero()) {
|
|
22
|
+
// Settled read: empty contract address means resolve against the note hash tree.
|
|
28
23
|
resetActions.actions[i] = ReadRequestActionEnum.READ_AS_SETTLED;
|
|
24
|
+
} else {
|
|
25
|
+
// Pending read: non-empty contract address means match against a pending note hash.
|
|
26
|
+
const pendingNoteHash = noteHashMap.get(readRequest.value.toBigInt())?.find((n)=>isValidNoteHashReadRequest(readRequest, n.noteHash));
|
|
27
|
+
if (pendingNoteHash) {
|
|
28
|
+
resetActions.actions[i] = ReadRequestActionEnum.READ_AS_PENDING;
|
|
29
|
+
resetActions.pendingReadHints.push(new PendingReadHint(i, pendingNoteHash.index));
|
|
30
|
+
}
|
|
31
|
+
// Otherwise, the read request may be resolved by a future note hash. Leave as NOOP.
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
return resetActions;
|
|
@@ -67,7 +70,7 @@ export async function buildNoteHashReadRequestHintsFromResetActions(oracle, note
|
|
|
67
70
|
});
|
|
68
71
|
return builder.toHints();
|
|
69
72
|
}
|
|
70
|
-
export async function buildNoteHashReadRequestHints(oracle, noteHashReadRequests, noteHashes,
|
|
71
|
-
const resetActions = getNoteHashReadRequestResetActions(noteHashReadRequests, noteHashes
|
|
73
|
+
export async function buildNoteHashReadRequestHints(oracle, noteHashReadRequests, noteHashes, maxPending = MAX_NOTE_HASH_READ_REQUESTS_PER_TX, maxSettled = MAX_NOTE_HASH_READ_REQUESTS_PER_TX) {
|
|
74
|
+
const resetActions = getNoteHashReadRequestResetActions(noteHashReadRequests, noteHashes);
|
|
72
75
|
return await buildNoteHashReadRequestHintsFromResetActions(oracle, noteHashReadRequests, noteHashes, resetActions, maxPending, maxSettled);
|
|
73
76
|
}
|
|
@@ -11,12 +11,12 @@ interface NullifierMembershipWitnessWithPreimage {
|
|
|
11
11
|
membershipWitness: MembershipWitness<typeof NULLIFIER_TREE_HEIGHT>;
|
|
12
12
|
leafPreimage: NullifierLeafPreimage;
|
|
13
13
|
}
|
|
14
|
-
export declare function getNullifierReadRequestResetActions(nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>, nullifiers: ClaimedLengthArray<ScopedNullifier, typeof MAX_NULLIFIERS_PER_TX
|
|
14
|
+
export declare function getNullifierReadRequestResetActions(nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>, nullifiers: ClaimedLengthArray<ScopedNullifier, typeof MAX_NULLIFIERS_PER_TX>): ReadRequestResetActions<typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>;
|
|
15
15
|
export declare function buildNullifierReadRequestHintsFromResetActions<PENDING extends number, SETTLED extends number>(oracle: {
|
|
16
16
|
getNullifierMembershipWitness(nullifier: Fr): Promise<NullifierMembershipWitnessWithPreimage>;
|
|
17
17
|
}, nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>, resetActions: ReadRequestResetActions<typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>, maxPending?: PENDING, maxSettled?: SETTLED): Promise<import("./nullifier_read_request_hints.js").NullifierReadRequestHints<PENDING, SETTLED>>;
|
|
18
18
|
export declare function buildNullifierReadRequestHints<PENDING extends number, SETTLED extends number>(oracle: {
|
|
19
19
|
getNullifierMembershipWitness(nullifier: Fr): Promise<NullifierMembershipWitnessWithPreimage>;
|
|
20
|
-
}, nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>, nullifiers: ClaimedLengthArray<ScopedNullifier, typeof MAX_NULLIFIERS_PER_TX>,
|
|
20
|
+
}, nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_TX>, nullifiers: ClaimedLengthArray<ScopedNullifier, typeof MAX_NULLIFIERS_PER_TX>, maxPending?: PENDING, maxSettled?: SETTLED): Promise<import("./nullifier_read_request_hints.js").NullifierReadRequestHints<PENDING, SETTLED>>;
|
|
21
21
|
export {};
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGRfbnVsbGlmaWVyX3JlYWRfcmVxdWVzdF9oaW50cy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2tlcm5lbC9oaW50cy9idWlsZF9udWxsaWZpZXJfcmVhZF9yZXF1ZXN0X2hpbnRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLHFCQUFxQixFQUMxQixrQ0FBa0MsRUFDbEMsS0FBSyxxQkFBcUIsRUFDM0IsTUFBTSxrQkFBa0IsQ0FBQztBQUMxQixPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUU1RCxPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQzNFLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFDckUsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFFdkQsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDdEQsT0FBTyxFQUEwQyx1QkFBdUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRTFHLHdCQUFnQiwyQkFBMkIsQ0FBQyxXQUFXLEVBQUUsaUJBQWlCLEVBQUUsU0FBUyxFQUFFLGVBQWUsV0FNckc7QUFFRCxVQUFVLHNDQUFzQztJQUM5QyxpQkFBaU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VBQVUsRUFBRSxrQkFBa0IsQ0FBQyxlQUFlLEVBQUUsT0FBTyxxQkFBcUIsQ0FBQyxFQUM3RSxVQUFVLEdBQUUsT0FBdUQsRUFDbkUsVUFBVSxHQUFFLE9BQXVELG9HQVVwRSJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_nullifier_read_request_hints.d.ts","sourceRoot":"","sources":["../../../src/kernel/hints/build_nullifier_read_request_hints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,kCAAkC,EAClC,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAA0C,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"build_nullifier_read_request_hints.d.ts","sourceRoot":"","sources":["../../../src/kernel/hints/build_nullifier_read_request_hints.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,qBAAqB,EAC1B,kCAAkC,EAClC,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACr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E,UAAU,GAAE,OAAuD,EACnE,UAAU,GAAE,OAAuD,oGAUpE"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { MAX_NULLIFIER_READ_REQUESTS_PER_TX } from '@aztec/constants';
|
|
2
2
|
import { NullifierReadRequestHintsBuilder } from './nullifier_read_request_hints.js';
|
|
3
3
|
import { PendingReadHint, ReadRequestActionEnum, ReadRequestResetActions } from './read_request_hints.js';
|
|
4
|
-
import { ScopedValueCache } from './scoped_value_cache.js';
|
|
5
4
|
export function isValidNullifierReadRequest(readRequest, nullifier) {
|
|
6
5
|
return readRequest.value.equals(nullifier.value) && nullifier.contractAddress.equals(readRequest.contractAddress) && readRequest.counter > nullifier.counter;
|
|
7
6
|
}
|
|
8
|
-
export function getNullifierReadRequestResetActions(nullifierReadRequests, nullifiers
|
|
7
|
+
export function getNullifierReadRequestResetActions(nullifierReadRequests, nullifiers) {
|
|
9
8
|
const resetActions = ReadRequestResetActions.empty(MAX_NULLIFIER_READ_REQUESTS_PER_TX);
|
|
10
9
|
const nullifierMap = new Map();
|
|
11
10
|
nullifiers.getActiveItems().forEach((nullifier, index)=>{
|
|
@@ -17,15 +16,19 @@ export function getNullifierReadRequestResetActions(nullifierReadRequests, nulli
|
|
|
17
16
|
});
|
|
18
17
|
nullifierMap.set(value, arr);
|
|
19
18
|
});
|
|
20
|
-
const futureNullifiersMap = new ScopedValueCache(futureNullifiers);
|
|
21
19
|
for(let i = 0; i < nullifierReadRequests.claimedLength; ++i){
|
|
22
20
|
const readRequest = nullifierReadRequests.array[i];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
resetActions.actions[i] = ReadRequestActionEnum.READ_AS_PENDING;
|
|
26
|
-
resetActions.pendingReadHints.push(new PendingReadHint(i, pendingNullifier.index));
|
|
27
|
-
} else if (!futureNullifiersMap.get(readRequest).some((futureNullifier)=>isValidNullifierReadRequest(readRequest, futureNullifier))) {
|
|
21
|
+
if (readRequest.contractAddress.isZero()) {
|
|
22
|
+
// Settled read: empty contract address means resolve against the nullifier tree.
|
|
28
23
|
resetActions.actions[i] = ReadRequestActionEnum.READ_AS_SETTLED;
|
|
24
|
+
} else {
|
|
25
|
+
// Pending read: non-empty contract address means match against a pending nullifier.
|
|
26
|
+
const pendingNullifier = nullifierMap.get(readRequest.value.toBigInt())?.find(({ nullifier })=>isValidNullifierReadRequest(readRequest, nullifier));
|
|
27
|
+
if (pendingNullifier) {
|
|
28
|
+
resetActions.actions[i] = ReadRequestActionEnum.READ_AS_PENDING;
|
|
29
|
+
resetActions.pendingReadHints.push(new PendingReadHint(i, pendingNullifier.index));
|
|
30
|
+
}
|
|
31
|
+
// Otherwise, the read request may be resolved by a future nullifier. Leave as NOOP.
|
|
29
32
|
}
|
|
30
33
|
}
|
|
31
34
|
return resetActions;
|
|
@@ -54,7 +57,7 @@ export async function buildNullifierReadRequestHintsFromResetActions(oracle, nul
|
|
|
54
57
|
}
|
|
55
58
|
return builder.toHints();
|
|
56
59
|
}
|
|
57
|
-
export async function buildNullifierReadRequestHints(oracle, nullifierReadRequests, nullifiers,
|
|
58
|
-
const resetActions = getNullifierReadRequestResetActions(nullifierReadRequests, nullifiers
|
|
60
|
+
export async function buildNullifierReadRequestHints(oracle, nullifierReadRequests, nullifiers, maxPending = MAX_NULLIFIER_READ_REQUESTS_PER_TX, maxSettled = MAX_NULLIFIER_READ_REQUESTS_PER_TX) {
|
|
61
|
+
const resetActions = getNullifierReadRequestResetActions(nullifierReadRequests, nullifiers);
|
|
59
62
|
return await buildNullifierReadRequestHintsFromResetActions(oracle, nullifierReadRequests, resetActions, maxPending, maxSettled);
|
|
60
63
|
}
|
|
@@ -2,10 +2,13 @@ import type { Tuple } from '@aztec/foundation/serialize';
|
|
|
2
2
|
import type { ClaimedLengthArray } from '../claimed_length_array.js';
|
|
3
3
|
import type { ScopedNoteHash } from '../note_hash.js';
|
|
4
4
|
import type { ScopedNullifier } from '../nullifier.js';
|
|
5
|
+
import type { PrivateLogData, ScopedPrivateLogData } from '../private_log_data.js';
|
|
5
6
|
import type { ScopedReadRequest } from './read_request.js';
|
|
6
7
|
import { TransientDataSquashingHint } from './transient_data_squashing_hint.js';
|
|
7
|
-
export declare function buildTransientDataHints<NOTE_HASHES_LEN extends number, NULLIFIERS_LEN extends number>(noteHashes: ClaimedLengthArray<ScopedNoteHash, NOTE_HASHES_LEN>, nullifiers: ClaimedLengthArray<ScopedNullifier, NULLIFIERS_LEN>, futureNoteHashReads: ScopedReadRequest[], futureNullifierReads: ScopedReadRequest[], noteHashNullifierCounterMap: Map<number, number>, splitCounter: number): {
|
|
8
|
+
export declare function buildTransientDataHints<NOTE_HASHES_LEN extends number, NULLIFIERS_LEN extends number>(noteHashes: ClaimedLengthArray<ScopedNoteHash, NOTE_HASHES_LEN>, nullifiers: ClaimedLengthArray<ScopedNullifier, NULLIFIERS_LEN>, futureNoteHashReads: ScopedReadRequest[], futureNullifierReads: ScopedReadRequest[], futureLogs: PrivateLogData[], noteHashNullifierCounterMap: Map<number, number>, splitCounter: number): {
|
|
8
9
|
numTransientData: number;
|
|
9
10
|
hints: Tuple<TransientDataSquashingHint, NULLIFIERS_LEN>;
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
+
/** Counts private logs that are linked to squashed note hashes and would be removed along with them. */
|
|
13
|
+
export declare function countSquashedLogs<NOTE_HASHES_LEN extends number, LOGS_LEN extends number>(noteHashes: ClaimedLengthArray<ScopedNoteHash, NOTE_HASHES_LEN>, privateLogs: ClaimedLengthArray<ScopedPrivateLogData, LOGS_LEN>, squashingHints: TransientDataSquashingHint[]): number;
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGRfdHJhbnNpZW50X2RhdGFfaGludHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9rZXJuZWwvaGludHMvYnVpbGRfdHJhbnNpZW50X2RhdGFfaGludHMudHMiXSwibmFtZXMiO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sd0dBQXdHO0FBQ3hHLHdCQUFnQixpQkFBaUIsQ0FBQyxlQUFlLFNBQVMsTUFBTSxFQUFFLFFBQVEsU0FBUyxNQUFNLEVBQ3ZGLFVBQVUsRUFBRSxrQkFBa0IsQ0FBQyxjQUFjLEVBQUUsZUFBZSxDQUFDLEVBQy9ELFdBQVcsRUFBRSxrQkFBa0IsQ0FBQyxvQkFBb0IsRUFBRSxRQUFRLENBQUMsRUFDL0QsY0FBYyxFQUFFLDBCQUEwQixFQUFFLEdBQzNDLE1BQU0sQ0FHUiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_transient_data_hints.d.ts","sourceRoot":"","sources":["../../../src/kernel/hints/build_transient_data_hints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"build_transient_data_hints.d.ts","sourceRoot":"","sources":["../../../src/kernel/hints/build_transient_data_hints.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAGnF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAEhF,wBAAgB,uBAAuB,CAAC,eAAe,SAAS,MAAM,EAAE,cAAc,SAAS,MAAM,EACnG,UAAU,EAAE,kBAAkB,CAAC,cAAc,EAAE,eAAe,CAAC,EAC/D,UAAU,EAAE,kBAAkB,CAAC,eAAe,EAAE,cAAc,CAAC,EAC/D,mBAAmB,EAAE,iBAAiB,EAAE,EACxC,oBAAoB,EAAE,iBAAiB,EAAE,EACzC,UAAU,EAAE,cAAc,EAAE,EAC5B,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAChD,YAAY,EAAE,MAAM,GACnB;IAAE,gBAAgB,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC,0BAA0B,EAAE,cAAc,CAAC,CAAA;CAAE,CA8DxF;AAED,wGAAwG;AACxG,wBAAgB,iBAAiB,CAAC,eAAe,SAAS,MAAM,EAAE,QAAQ,SAAS,MAAM,EACvF,UAAU,EAAE,kBAAkB,CAAC,cAAc,EAAE,eAAe,CAAC,EAC/D,WAAW,EAAE,kBAAkB,CAAC,oBAAoB,EAAE,QAAQ,CAAC,EAC/D,cAAc,EAAE,0BAA0B,EAAE,GAC3C,MAAM,CAGR"}
|
|
@@ -3,17 +3,19 @@ import { isValidNoteHashReadRequest } from './build_note_hash_read_request_hints
|
|
|
3
3
|
import { isValidNullifierReadRequest } from './build_nullifier_read_request_hints.js';
|
|
4
4
|
import { ScopedValueCache } from './scoped_value_cache.js';
|
|
5
5
|
import { TransientDataSquashingHint } from './transient_data_squashing_hint.js';
|
|
6
|
-
export function buildTransientDataHints(noteHashes, nullifiers, futureNoteHashReads, futureNullifierReads, noteHashNullifierCounterMap, splitCounter) {
|
|
6
|
+
export function buildTransientDataHints(noteHashes, nullifiers, futureNoteHashReads, futureNullifierReads, futureLogs, noteHashNullifierCounterMap, splitCounter) {
|
|
7
7
|
const futureNoteHashReadsMap = new ScopedValueCache(futureNoteHashReads);
|
|
8
8
|
const futureNullifierReadsMap = new ScopedValueCache(futureNullifierReads);
|
|
9
|
+
const futureLogNoteHashCounters = new Set(futureLogs.filter((l)=>l.noteHashCounter > 0).map((l)=>l.noteHashCounter));
|
|
9
10
|
const nullifierIndexMap = new Map();
|
|
10
11
|
nullifiers.getActiveItems().forEach((n, i)=>nullifierIndexMap.set(n.counter, i));
|
|
11
12
|
const hints = [];
|
|
12
13
|
for(let noteHashIndex = 0; noteHashIndex < noteHashes.claimedLength; noteHashIndex++){
|
|
13
14
|
const noteHash = noteHashes.array[noteHashIndex];
|
|
14
15
|
const noteHashNullifierCounter = noteHashNullifierCounterMap.get(noteHash.counter);
|
|
15
|
-
// The note hash might not be linked to a nullifier or it might be read in the future
|
|
16
|
-
|
|
16
|
+
// The note hash might not be linked to a nullifier, or it might be read in the future, or a future log might be
|
|
17
|
+
// linked to it.
|
|
18
|
+
if (!noteHashNullifierCounter || futureNoteHashReadsMap.get(noteHash).find((read)=>isValidNoteHashReadRequest(read, noteHash)) || futureLogNoteHashCounters.has(noteHash.counter)) {
|
|
17
19
|
continue;
|
|
18
20
|
}
|
|
19
21
|
const nullifierIndex = nullifierIndexMap.get(noteHashNullifierCounter);
|
|
@@ -48,3 +50,7 @@ export function buildTransientDataHints(noteHashes, nullifiers, futureNoteHashRe
|
|
|
48
50
|
hints: padArrayEnd(hints, noActionHint, nullifiers.array.length)
|
|
49
51
|
};
|
|
50
52
|
}
|
|
53
|
+
/** Counts private logs that are linked to squashed note hashes and would be removed along with them. */ export function countSquashedLogs(noteHashes, privateLogs, squashingHints) {
|
|
54
|
+
const squashedNoteHashCounters = new Set(squashingHints.map((h)=>noteHashes.array[h.noteHashIndex].counter));
|
|
55
|
+
return privateLogs.getActiveItems().filter((l)=>squashedNoteHashCounters.has(l.inner.noteHashCounter)).length;
|
|
56
|
+
}
|
|
@@ -6,10 +6,10 @@ export * from './note_hash_read_request_hints.js';
|
|
|
6
6
|
export * from './nullifier_read_request_hints.js';
|
|
7
7
|
export * from './read_request_hints.js';
|
|
8
8
|
export * from './key_validation_hint.js';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './key_validation_request_and_separator.js';
|
|
10
10
|
export * from './read_request.js';
|
|
11
11
|
export * from './key_validation_request.js';
|
|
12
|
-
export * from './
|
|
12
|
+
export * from './scoped_key_validation_request_and_separator.js';
|
|
13
13
|
export * from './transient_data_squashing_hint.js';
|
|
14
14
|
export * from './private_kernel_reset_hints.js';
|
|
15
15
|
export * from './tree_leaf_read_request.js';
|
|
@@ -6,10 +6,10 @@ export * from './note_hash_read_request_hints.js';
|
|
|
6
6
|
export * from './nullifier_read_request_hints.js';
|
|
7
7
|
export * from './read_request_hints.js';
|
|
8
8
|
export * from './key_validation_hint.js';
|
|
9
|
-
export * from './
|
|
9
|
+
export * from './key_validation_request_and_separator.js';
|
|
10
10
|
export * from './read_request.js';
|
|
11
11
|
export * from './key_validation_request.js';
|
|
12
|
-
export * from './
|
|
12
|
+
export * from './scoped_key_validation_request_and_separator.js';
|
|
13
13
|
export * from './transient_data_squashing_hint.js';
|
|
14
14
|
export * from './private_kernel_reset_hints.js';
|
|
15
15
|
export * from './tree_leaf_read_request.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
|
|
3
|
+
import { KeyValidationRequest } from './key_validation_request.js';
|
|
4
|
+
/**
|
|
5
|
+
* Request for validating keys used in the app, along with a domain separator for the key type.
|
|
6
|
+
*/
|
|
7
|
+
export declare class KeyValidationRequestAndSeparator {
|
|
8
|
+
/** The key validation request. */
|
|
9
|
+
readonly request: KeyValidationRequest;
|
|
10
|
+
/** Domain separator for the key type, used along with sk_m to derive the sk_app stored in the request. */
|
|
11
|
+
readonly keyTypeDomainSeparator: Fr;
|
|
12
|
+
constructor(
|
|
13
|
+
/** The key validation request. */
|
|
14
|
+
request: KeyValidationRequest,
|
|
15
|
+
/** Domain separator for the key type, used along with sk_m to derive the sk_app stored in the request. */
|
|
16
|
+
keyTypeDomainSeparator: Fr);
|
|
17
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
18
|
+
static fromBuffer(buffer: Buffer | BufferReader): KeyValidationRequestAndSeparator;
|
|
19
|
+
toFields(): Fr[];
|
|
20
|
+
static fromFields(fields: Fr[] | FieldReader): KeyValidationRequestAndSeparator;
|
|
21
|
+
isEmpty(): boolean;
|
|
22
|
+
static empty(): KeyValidationRequestAndSeparator;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5X3ZhbGlkYXRpb25fcmVxdWVzdF9hbmRfc2VwYXJhdG9yLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMva2VybmVsL2hpbnRzL2tleV92YWxpZGF0aW9uX3JlcXVlc3RfYW5kX3NlcGFyYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxFQUFFLFlBQVksRUFBRSxXQUFXLEVBQXFCLE1BQU0sNkJBQTZCLENBQUM7QUFFM0YsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFFbkU7O0dBRUc7QUFDSCxxQkFBYSxnQ0FBZ0M7SUFFekMsa0NBQWtDO2FBQ2xCLE9BQU8sRUFBRSxvQkFBb0I7SUFDN0MsMEdBQTBHO2FBQzFGLHNCQUFzQixFQUFFLEVBQUU7SUFKNUM7SUFDRSxrQ0FBa0M7SUFDbEIsT0FBTyxFQUFFLG9CQUFvQjtJQUM3QywwR0FBMEc7SUFDMUYsc0JBQXNCLEVBQUUsRUFBRSxFQUN4QztJQUVKLFFBQVEsNEJBRVA7SUFFRCxNQUFNLENBQUMsVUFBVSxDQUFDLE1BQU0sRUFBRSxNQUFNLEdBQUcsWUFBWSxvQ0FHOUM7SUFFRCxRQUFRLElBQUksRUFBRSxFQUFFLENBUWY7SUFFRCxNQUFNLENBQUMsVUFBVSxDQUFDLE1BQU0sRUFBRSxFQUFFLEVBQUUsR0FBRyxXQUFXLEdBQUcsZ0NBQWdDLENBRzlFO0lBRUQsT0FBTyxZQUVOO0lBRUQsTUFBTSxDQUFDLEtBQUsscUNBRVg7Q0FDRiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"key_validation_request_and_separator.d.ts","sourceRoot":"","sources":["../../../src/kernel/hints/key_validation_request_and_separator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE;;GAEG;AACH,qBAAa,gCAAgC;IAEzC,kCAAkC;aAClB,OAAO,EAAE,oBAAoB;IAC7C,0GAA0G;aAC1F,sBAAsB,EAAE,EAAE;IAJ5C;IACE,kCAAkC;IAClB,OAAO,EAAE,oBAAoB;IAC7C,0GAA0G;IAC1F,sBAAsB,EAAE,EAAE,EACxC;IAEJ,QAAQ,4BAEP;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,oCAG9C;IAED,QAAQ,IAAI,EAAE,EAAE,CAQf;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,gCAAgC,CAG9E;IAED,OAAO,YAEN;IAED,MAAM,CAAC,KAAK,qCAEX;CACF"}
|
|
@@ -3,42 +3,39 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
import { KeyValidationRequest } from './key_validation_request.js';
|
|
5
5
|
/**
|
|
6
|
-
* Request for validating keys used in the app
|
|
7
|
-
*/ export class
|
|
6
|
+
* Request for validating keys used in the app, along with a domain separator for the key type.
|
|
7
|
+
*/ export class KeyValidationRequestAndSeparator {
|
|
8
8
|
request;
|
|
9
|
-
|
|
10
|
-
constructor(/** The key validation request. */ request, /**
|
|
11
|
-
* The generator index which can be used along with sk_m to derive the sk_app stored in the request.
|
|
12
|
-
* Note: This generator constrains that a correct key type gets validated in the kernel.
|
|
13
|
-
*/ skAppGenerator){
|
|
9
|
+
keyTypeDomainSeparator;
|
|
10
|
+
constructor(/** The key validation request. */ request, /** Domain separator for the key type, used along with sk_m to derive the sk_app stored in the request. */ keyTypeDomainSeparator){
|
|
14
11
|
this.request = request;
|
|
15
|
-
this.
|
|
12
|
+
this.keyTypeDomainSeparator = keyTypeDomainSeparator;
|
|
16
13
|
}
|
|
17
14
|
toBuffer() {
|
|
18
|
-
return serializeToBuffer(this.request, this.
|
|
15
|
+
return serializeToBuffer(this.request, this.keyTypeDomainSeparator);
|
|
19
16
|
}
|
|
20
17
|
static fromBuffer(buffer) {
|
|
21
18
|
const reader = BufferReader.asReader(buffer);
|
|
22
|
-
return new
|
|
19
|
+
return new KeyValidationRequestAndSeparator(reader.readObject(KeyValidationRequest), Fr.fromBuffer(reader));
|
|
23
20
|
}
|
|
24
21
|
toFields() {
|
|
25
22
|
const fields = [
|
|
26
23
|
...this.request.toFields(),
|
|
27
|
-
this.
|
|
24
|
+
this.keyTypeDomainSeparator
|
|
28
25
|
];
|
|
29
26
|
if (fields.length !== KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH) {
|
|
30
|
-
throw new Error(`Invalid number of fields for
|
|
27
|
+
throw new Error(`Invalid number of fields for KeyValidationRequestAndSeparator. Expected ${KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH}, got ${fields.length}`);
|
|
31
28
|
}
|
|
32
29
|
return fields;
|
|
33
30
|
}
|
|
34
31
|
static fromFields(fields) {
|
|
35
32
|
const reader = FieldReader.asReader(fields);
|
|
36
|
-
return new
|
|
33
|
+
return new KeyValidationRequestAndSeparator(KeyValidationRequest.fromFields(reader), reader.readField());
|
|
37
34
|
}
|
|
38
35
|
isEmpty() {
|
|
39
|
-
return this.request.isEmpty() && this.
|
|
36
|
+
return this.request.isEmpty() && this.keyTypeDomainSeparator.isZero();
|
|
40
37
|
}
|
|
41
38
|
static empty() {
|
|
42
|
-
return new
|
|
39
|
+
return new KeyValidationRequestAndSeparator(KeyValidationRequest.empty(), Fr.ZERO);
|
|
43
40
|
}
|
|
44
41
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
|
|
3
3
|
import { AztecAddress } from '../../aztec-address/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { KeyValidationRequestAndSeparator } from './key_validation_request_and_separator.js';
|
|
5
5
|
/**
|
|
6
6
|
* Request for validating keys used in the app.
|
|
7
7
|
*/
|
|
8
|
-
export declare class
|
|
9
|
-
readonly request:
|
|
8
|
+
export declare class ScopedKeyValidationRequestAndSeparator {
|
|
9
|
+
readonly request: KeyValidationRequestAndSeparator;
|
|
10
10
|
readonly contractAddress: AztecAddress;
|
|
11
|
-
constructor(request:
|
|
11
|
+
constructor(request: KeyValidationRequestAndSeparator, contractAddress: AztecAddress);
|
|
12
12
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
13
|
-
static fromBuffer(buffer: Buffer | BufferReader):
|
|
13
|
+
static fromBuffer(buffer: Buffer | BufferReader): ScopedKeyValidationRequestAndSeparator;
|
|
14
14
|
toFields(): Fr[];
|
|
15
|
-
static fromFields(fields: Fr[] | FieldReader):
|
|
15
|
+
static fromFields(fields: Fr[] | FieldReader): ScopedKeyValidationRequestAndSeparator;
|
|
16
16
|
isEmpty(): boolean;
|
|
17
|
-
static empty():
|
|
17
|
+
static empty(): ScopedKeyValidationRequestAndSeparator;
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=data:application/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1 @@
|
|
|
1
|
-
{"version":3,"file":"
|
|
1
|
+
{"version":3,"file":"scoped_key_validation_request_and_separator.d.ts","sourceRoot":"","sources":["../../../src/kernel/hints/scoped_key_validation_request_and_separator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,gCAAgC,EAAE,MAAM,2CAA2C,CAAC;AAE7F;;GAEG;AACH,qBAAa,sCAAsC;aAE/B,OAAO,EAAE,gCAAgC;aACzC,eAAe,EAAE,YAAY;IAF/C,YACkB,OAAO,EAAE,gCAAgC,EACzC,eAAe,EAAE,YAAY,EAC3C;IAEJ,QAAQ,4BAEP;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,0CAM9C;IAED,QAAQ,IAAI,EAAE,EAAE,CAQf;IAED,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,sCAAsC,CAMpF;IAED,OAAO,YAEN;IAED,MAAM,CAAC,KAAK,2CAEX;CACF"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { BufferReader, FieldReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
3
|
import { AztecAddress } from '../../aztec-address/index.js';
|
|
4
|
-
import {
|
|
4
|
+
import { KeyValidationRequestAndSeparator } from './key_validation_request_and_separator.js';
|
|
5
5
|
/**
|
|
6
6
|
* Request for validating keys used in the app.
|
|
7
|
-
*/ export class
|
|
7
|
+
*/ export class ScopedKeyValidationRequestAndSeparator {
|
|
8
8
|
request;
|
|
9
9
|
contractAddress;
|
|
10
10
|
constructor(request, contractAddress){
|
|
@@ -16,7 +16,7 @@ import { KeyValidationRequestAndGenerator } from './key_validation_request_and_g
|
|
|
16
16
|
}
|
|
17
17
|
static fromBuffer(buffer) {
|
|
18
18
|
const reader = BufferReader.asReader(buffer);
|
|
19
|
-
return new
|
|
19
|
+
return new ScopedKeyValidationRequestAndSeparator(KeyValidationRequestAndSeparator.fromBuffer(reader), AztecAddress.fromBuffer(reader));
|
|
20
20
|
}
|
|
21
21
|
toFields() {
|
|
22
22
|
const fields = [
|
|
@@ -24,18 +24,18 @@ import { KeyValidationRequestAndGenerator } from './key_validation_request_and_g
|
|
|
24
24
|
this.contractAddress.toField()
|
|
25
25
|
];
|
|
26
26
|
if (fields.length !== SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH) {
|
|
27
|
-
throw new Error(`Invalid number of fields for
|
|
27
|
+
throw new Error(`Invalid number of fields for ScopedKeyValidationRequestAndSeparator. Expected ${SCOPED_KEY_VALIDATION_REQUEST_AND_GENERATOR_LENGTH}, got ${fields.length}`);
|
|
28
28
|
}
|
|
29
29
|
return fields;
|
|
30
30
|
}
|
|
31
31
|
static fromFields(fields) {
|
|
32
32
|
const reader = FieldReader.asReader(fields);
|
|
33
|
-
return new
|
|
33
|
+
return new ScopedKeyValidationRequestAndSeparator(KeyValidationRequestAndSeparator.fromFields(reader), AztecAddress.fromFields(reader));
|
|
34
34
|
}
|
|
35
35
|
isEmpty() {
|
|
36
36
|
return this.request.isEmpty() && this.contractAddress.isZero();
|
|
37
37
|
}
|
|
38
38
|
static empty() {
|
|
39
|
-
return new
|
|
39
|
+
return new ScopedKeyValidationRequestAndSeparator(KeyValidationRequestAndSeparator.empty(), AztecAddress.ZERO);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
@@ -2,7 +2,7 @@ import { MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL, MAX_KEY_
|
|
|
2
2
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
|
|
4
4
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
5
|
-
import {
|
|
5
|
+
import { KeyValidationRequestAndSeparator } from '../kernel/hints/key_validation_request_and_separator.js';
|
|
6
6
|
import { CountedLogHash } from '../kernel/log_hash.js';
|
|
7
7
|
import { PrivateCallRequest } from '../kernel/private_call_request.js';
|
|
8
8
|
import { PrivateLogData } from '../kernel/private_log_data.js';
|
|
@@ -81,9 +81,9 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
81
81
|
*/
|
|
82
82
|
nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_CALL>;
|
|
83
83
|
/**
|
|
84
|
-
* Key validation requests and
|
|
84
|
+
* Key validation requests and separators created by the corresponding function call.
|
|
85
85
|
*/
|
|
86
|
-
|
|
86
|
+
keyValidationRequestsAndSeparators: ClaimedLengthArray<KeyValidationRequestAndSeparator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_CALL>;
|
|
87
87
|
/**
|
|
88
88
|
* Private call requests made within the current kernel iteration.
|
|
89
89
|
*/
|
|
@@ -178,9 +178,9 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
178
178
|
*/
|
|
179
179
|
nullifierReadRequests: ClaimedLengthArray<ScopedReadRequest, typeof MAX_NULLIFIER_READ_REQUESTS_PER_CALL>,
|
|
180
180
|
/**
|
|
181
|
-
* Key validation requests and
|
|
181
|
+
* Key validation requests and separators created by the corresponding function call.
|
|
182
182
|
*/
|
|
183
|
-
|
|
183
|
+
keyValidationRequestsAndSeparators: ClaimedLengthArray<KeyValidationRequestAndSeparator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_CALL>,
|
|
184
184
|
/**
|
|
185
185
|
* Private call requests made within the current kernel iteration.
|
|
186
186
|
*/
|
|
@@ -237,7 +237,7 @@ export declare class PrivateCircuitPublicInputs {
|
|
|
237
237
|
* @param fields - Object with fields.
|
|
238
238
|
* @returns The array.
|
|
239
239
|
*/
|
|
240
|
-
static getFields(fields: FieldsOf<PrivateCircuitPublicInputs>): readonly [CallContext, Fr, Fr, BlockHeader, TxContext, Fr, boolean, bigint, Fr, Fr, Fr, Fr, ClaimedLengthArray<ScopedReadRequest, 16>, ClaimedLengthArray<ScopedReadRequest, 16>, ClaimedLengthArray<
|
|
240
|
+
static getFields(fields: FieldsOf<PrivateCircuitPublicInputs>): readonly [CallContext, Fr, Fr, BlockHeader, TxContext, Fr, boolean, bigint, Fr, Fr, Fr, Fr, ClaimedLengthArray<ScopedReadRequest, 16>, ClaimedLengthArray<ScopedReadRequest, 16>, ClaimedLengthArray<KeyValidationRequestAndSeparator, 16>, ClaimedLengthArray<PrivateCallRequest, 8>, ClaimedLengthArray<CountedPublicCallRequest, 32>, PublicCallRequest, ClaimedLengthArray<NoteHash, 16>, ClaimedLengthArray<Nullifier, 16>, ClaimedLengthArray<CountedL2ToL1Message, 8>, ClaimedLengthArray<PrivateLogData, 16>, ClaimedLengthArray<CountedLogHash, 1>];
|
|
241
241
|
/**
|
|
242
242
|
* Serialize this as a buffer.
|
|
243
243
|
* @returns The buffer.
|
|
@@ -2,7 +2,7 @@ import { MAX_CONTRACT_CLASS_LOGS_PER_CALL, MAX_ENQUEUED_CALLS_PER_CALL, MAX_KEY_
|
|
|
2
2
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
4
|
import { BufferReader, FieldReader, bigintToUInt64BE, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
5
|
-
import {
|
|
5
|
+
import { KeyValidationRequestAndSeparator } from '../kernel/hints/key_validation_request_and_separator.js';
|
|
6
6
|
import { CountedLogHash } from '../kernel/log_hash.js';
|
|
7
7
|
import { PrivateCallRequest } from '../kernel/private_call_request.js';
|
|
8
8
|
import { PrivateLogData } from '../kernel/private_log_data.js';
|
|
@@ -32,7 +32,7 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
|
|
|
32
32
|
expectedRevertibleSideEffectCounter;
|
|
33
33
|
noteHashReadRequests;
|
|
34
34
|
nullifierReadRequests;
|
|
35
|
-
|
|
35
|
+
keyValidationRequestsAndSeparators;
|
|
36
36
|
privateCallRequests;
|
|
37
37
|
publicCallRequests;
|
|
38
38
|
publicTeardownCallRequest;
|
|
@@ -74,8 +74,8 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
|
|
|
74
74
|
*/ noteHashReadRequests, /**
|
|
75
75
|
* Nullifier read requests created by the corresponding function call.
|
|
76
76
|
*/ nullifierReadRequests, /**
|
|
77
|
-
* Key validation requests and
|
|
78
|
-
*/
|
|
77
|
+
* Key validation requests and separators created by the corresponding function call.
|
|
78
|
+
*/ keyValidationRequestsAndSeparators, /**
|
|
79
79
|
* Private call requests made within the current kernel iteration.
|
|
80
80
|
*/ privateCallRequests, /**
|
|
81
81
|
* Public call stack at the current kernel iteration.
|
|
@@ -106,7 +106,7 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
|
|
|
106
106
|
this.expectedRevertibleSideEffectCounter = expectedRevertibleSideEffectCounter;
|
|
107
107
|
this.noteHashReadRequests = noteHashReadRequests;
|
|
108
108
|
this.nullifierReadRequests = nullifierReadRequests;
|
|
109
|
-
this.
|
|
109
|
+
this.keyValidationRequestsAndSeparators = keyValidationRequestsAndSeparators;
|
|
110
110
|
this.privateCallRequests = privateCallRequests;
|
|
111
111
|
this.publicCallRequests = publicCallRequests;
|
|
112
112
|
this.publicTeardownCallRequest = publicTeardownCallRequest;
|
|
@@ -129,20 +129,20 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
|
|
|
129
129
|
* @returns The deserialized instance.
|
|
130
130
|
*/ static fromBuffer(buffer) {
|
|
131
131
|
const reader = BufferReader.asReader(buffer);
|
|
132
|
-
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(BlockHeader), reader.readObject(TxContext), reader.readObject(Fr), reader.readBoolean(), reader.readUInt64(), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(
|
|
132
|
+
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(BlockHeader), reader.readObject(TxContext), reader.readObject(Fr), reader.readBoolean(), reader.readUInt64(), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(Fr), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(KeyValidationRequestAndSeparator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL)), reader.readObject(PublicCallRequest), reader.readObject(ClaimedLengthArrayFromBuffer(NoteHash, MAX_NOTE_HASHES_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(Nullifier, MAX_NULLIFIERS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromBuffer(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL)));
|
|
133
133
|
}
|
|
134
134
|
static fromFields(fields) {
|
|
135
135
|
const reader = FieldReader.asReader(fields);
|
|
136
|
-
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readField(), reader.readField(), reader.readObject(BlockHeader), reader.readObject(TxContext), reader.readField(), reader.readBoolean(), reader.readU64(), reader.readField(), reader.readField(), reader.readField(), reader.readField(), reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(
|
|
136
|
+
return new PrivateCircuitPublicInputs(reader.readObject(CallContext), reader.readField(), reader.readField(), reader.readObject(BlockHeader), reader.readObject(TxContext), reader.readField(), reader.readBoolean(), reader.readU64(), reader.readField(), reader.readField(), reader.readField(), reader.readField(), reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(KeyValidationRequestAndSeparator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL)), reader.readObject(PublicCallRequest), reader.readObject(ClaimedLengthArrayFromFields(NoteHash, MAX_NOTE_HASHES_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(Nullifier, MAX_NULLIFIERS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL)), reader.readObject(ClaimedLengthArrayFromFields(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL)));
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Create an empty PrivateCircuitPublicInputs.
|
|
140
140
|
* @returns An empty PrivateCircuitPublicInputs object.
|
|
141
141
|
*/ static empty() {
|
|
142
|
-
return new PrivateCircuitPublicInputs(CallContext.empty(), Fr.ZERO, Fr.ZERO, BlockHeader.empty(), TxContext.empty(), Fr.ZERO, false, 0n, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, ClaimedLengthArray.empty(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL), ClaimedLengthArray.empty(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL), ClaimedLengthArray.empty(
|
|
142
|
+
return new PrivateCircuitPublicInputs(CallContext.empty(), Fr.ZERO, Fr.ZERO, BlockHeader.empty(), TxContext.empty(), Fr.ZERO, false, 0n, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, ClaimedLengthArray.empty(ScopedReadRequest, MAX_NOTE_HASH_READ_REQUESTS_PER_CALL), ClaimedLengthArray.empty(ScopedReadRequest, MAX_NULLIFIER_READ_REQUESTS_PER_CALL), ClaimedLengthArray.empty(KeyValidationRequestAndSeparator, MAX_KEY_VALIDATION_REQUESTS_PER_CALL), ClaimedLengthArray.empty(PrivateCallRequest, MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL), ClaimedLengthArray.empty(CountedPublicCallRequest, MAX_ENQUEUED_CALLS_PER_CALL), PublicCallRequest.empty(), ClaimedLengthArray.empty(NoteHash, MAX_NOTE_HASHES_PER_CALL), ClaimedLengthArray.empty(Nullifier, MAX_NULLIFIERS_PER_CALL), ClaimedLengthArray.empty(CountedL2ToL1Message, MAX_L2_TO_L1_MSGS_PER_CALL), ClaimedLengthArray.empty(PrivateLogData, MAX_PRIVATE_LOGS_PER_CALL), ClaimedLengthArray.empty(CountedLogHash, MAX_CONTRACT_CLASS_LOGS_PER_CALL));
|
|
143
143
|
}
|
|
144
144
|
isEmpty() {
|
|
145
|
-
return this.callContext.isEmpty() && this.argsHash.isZero() && this.returnsHash.isZero() && this.anchorBlockHeader.isEmpty() && this.txContext.isEmpty() && this.minRevertibleSideEffectCounter.isZero() && !this.isFeePayer && !this.expirationTimestamp && this.startSideEffectCounter.isZero() && this.endSideEffectCounter.isZero() && this.expectedNonRevertibleSideEffectCounter.isZero() && this.expectedRevertibleSideEffectCounter.isZero() && this.noteHashReadRequests.isEmpty() && this.nullifierReadRequests.isEmpty() && this.
|
|
145
|
+
return this.callContext.isEmpty() && this.argsHash.isZero() && this.returnsHash.isZero() && this.anchorBlockHeader.isEmpty() && this.txContext.isEmpty() && this.minRevertibleSideEffectCounter.isZero() && !this.isFeePayer && !this.expirationTimestamp && this.startSideEffectCounter.isZero() && this.endSideEffectCounter.isZero() && this.expectedNonRevertibleSideEffectCounter.isZero() && this.expectedRevertibleSideEffectCounter.isZero() && this.noteHashReadRequests.isEmpty() && this.nullifierReadRequests.isEmpty() && this.keyValidationRequestsAndSeparators.isEmpty() && this.privateCallRequests.isEmpty() && this.publicCallRequests.isEmpty() && this.publicTeardownCallRequest.isEmpty() && this.noteHashes.isEmpty() && this.nullifiers.isEmpty() && this.l2ToL1Msgs.isEmpty() && this.privateLogs.isEmpty() && this.contractClassLogsHashes.isEmpty();
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
148
|
* Serialize into a field array. Low-level utility.
|
|
@@ -164,7 +164,7 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
|
|
|
164
164
|
fields.expectedRevertibleSideEffectCounter,
|
|
165
165
|
fields.noteHashReadRequests,
|
|
166
166
|
fields.nullifierReadRequests,
|
|
167
|
-
fields.
|
|
167
|
+
fields.keyValidationRequestsAndSeparators,
|
|
168
168
|
fields.privateCallRequests,
|
|
169
169
|
fields.publicCallRequests,
|
|
170
170
|
fields.publicTeardownCallRequest,
|
|
@@ -196,7 +196,7 @@ import { CountedPublicCallRequest, PublicCallRequest } from './public_call_reque
|
|
|
196
196
|
this.expectedRevertibleSideEffectCounter,
|
|
197
197
|
this.noteHashReadRequests,
|
|
198
198
|
this.nullifierReadRequests,
|
|
199
|
-
this.
|
|
199
|
+
this.keyValidationRequestsAndSeparators,
|
|
200
200
|
this.privateCallRequests,
|
|
201
201
|
this.publicCallRequests,
|
|
202
202
|
this.publicTeardownCallRequest,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DomainSeparator, PRIVATE_TO_PUBLIC_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
3
3
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
4
|
import { BufferReader, bigintToUInt64BE, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
@@ -60,7 +60,7 @@ export class PrivateToPublicKernelCircuitPublicInputs {
|
|
|
60
60
|
return fields;
|
|
61
61
|
}
|
|
62
62
|
hash() {
|
|
63
|
-
return poseidon2HashWithSeparator(this.toFields(),
|
|
63
|
+
return poseidon2HashWithSeparator(this.toFields(), DomainSeparator.PUBLIC_TX_HASH);
|
|
64
64
|
}
|
|
65
65
|
toJSON() {
|
|
66
66
|
return this.toBuffer();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DomainSeparator, PRIVATE_TO_ROLLUP_KERNEL_CIRCUIT_PUBLIC_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
3
3
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
4
|
import { BufferReader, bigintToUInt64BE, serializeToBuffer, serializeToFields } from '@aztec/foundation/serialize';
|
|
@@ -79,6 +79,6 @@ import { PrivateToRollupAccumulatedData } from './private_to_rollup_accumulated_
|
|
|
79
79
|
return fields;
|
|
80
80
|
}
|
|
81
81
|
hash() {
|
|
82
|
-
return poseidon2HashWithSeparator(this.toFields(),
|
|
82
|
+
return poseidon2HashWithSeparator(this.toFields(), DomainSeparator.PRIVATE_TX_HASH);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { MAX_KEY_VALIDATION_REQUESTS_PER_TX, MAX_NOTE_HASH_READ_REQUESTS_PER_TX, MAX_NULLIFIER_READ_REQUESTS_PER_TX } from '@aztec/constants';
|
|
2
2
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
3
|
import { inspect } from 'util';
|
|
4
|
-
import {
|
|
4
|
+
import { ScopedKeyValidationRequestAndSeparator } from '../kernel/hints/scoped_key_validation_request_and_separator.js';
|
|
5
5
|
import { ClaimedLengthArray } from './claimed_length_array.js';
|
|
6
6
|
import { ScopedReadRequest } from './hints/read_request.js';
|
|
7
7
|
/**
|
|
@@ -19,7 +19,7 @@ export declare class PrivateValidationRequests {
|
|
|
19
19
|
/**
|
|
20
20
|
* All the key validation requests made in this transaction.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
scopedKeyValidationRequestsAndSeparators: ClaimedLengthArray<ScopedKeyValidationRequestAndSeparator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX>;
|
|
23
23
|
constructor(
|
|
24
24
|
/**
|
|
25
25
|
* All the read requests made in this transaction.
|
|
@@ -32,7 +32,7 @@ export declare class PrivateValidationRequests {
|
|
|
32
32
|
/**
|
|
33
33
|
* All the key validation requests made in this transaction.
|
|
34
34
|
*/
|
|
35
|
-
|
|
35
|
+
scopedKeyValidationRequestsAndSeparators: ClaimedLengthArray<ScopedKeyValidationRequestAndSeparator, typeof MAX_KEY_VALIDATION_REQUESTS_PER_TX>);
|
|
36
36
|
getSize(): number;
|
|
37
37
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
38
38
|
toString(): `0x${string}`;
|