@aztec/pxe 5.0.0-rc.2 → 5.0.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/block_synchronizer/block_synchronizer.d.ts +5 -3
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +7 -1
- package/dest/contract/contract_class_service.d.ts +31 -0
- package/dest/contract/contract_class_service.d.ts.map +1 -0
- package/dest/contract/contract_class_service.js +68 -0
- package/dest/{contract_sync → contract}/contract_sync_service.d.ts +7 -6
- package/dest/contract/contract_sync_service.d.ts.map +1 -0
- package/dest/{contract_sync → contract}/contract_sync_service.js +10 -30
- package/dest/contract/helpers.d.ts +7 -0
- package/dest/contract/helpers.d.ts.map +1 -0
- package/dest/contract/helpers.js +20 -0
- package/dest/contract_function_simulator/anchored_contract_data.d.ts +36 -0
- package/dest/contract_function_simulator/anchored_contract_data.d.ts.map +1 -0
- package/dest/contract_function_simulator/anchored_contract_data.js +54 -0
- package/dest/contract_function_simulator/aztec_node_read_cache.d.ts +39 -0
- package/dest/contract_function_simulator/aztec_node_read_cache.d.ts.map +1 -0
- package/dest/contract_function_simulator/aztec_node_read_cache.js +60 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +9 -3
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +31 -14
- package/dest/contract_function_simulator/execution_note_cache.d.ts +3 -9
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +8 -28
- package/dest/contract_function_simulator/index.d.ts +4 -2
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +2 -1
- package/dest/contract_function_simulator/noir-structs/fact.d.ts +5 -5
- package/dest/contract_function_simulator/noir-structs/fact.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/fact.js +2 -2
- package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts +3 -3
- package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/fact_collection.js +3 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +7 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/pending_tagged_log.d.ts +11 -0
- package/dest/contract_function_simulator/noir-structs/pending_tagged_log.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/pending_tagged_log.js +4 -0
- package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/provided_secret.js +1 -1
- package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts +8 -1
- package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.js +17 -0
- package/dest/contract_function_simulator/oracle/acir_callback.d.ts +7 -2
- package/dest/contract_function_simulator/oracle/acir_callback.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/acir_callback.js +55 -11
- package/dest/contract_function_simulator/oracle/legacy_oracle_registry.d.ts +39 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_registry.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_registry.js +107 -0
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +11 -7
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_registry.js +50 -10
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +48 -9
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +51 -30
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +10 -2
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +73 -32
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +23 -16
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +105 -60
- package/dest/debug/pxe_debug_utils.d.ts +2 -2
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.d.ts +2 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +1 -0
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +11 -5
- package/dest/entrypoints/client/lazy/index.d.ts +2 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +1 -0
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +11 -5
- package/dest/entrypoints/client/store.d.ts +14 -0
- package/dest/entrypoints/client/store.d.ts.map +1 -0
- package/dest/entrypoints/client/store.js +28 -0
- package/dest/entrypoints/server/index.d.ts +6 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +4 -1
- package/dest/entrypoints/server/store.d.ts +18 -0
- package/dest/entrypoints/server/store.d.ts.map +1 -0
- package/dest/entrypoints/server/store.js +28 -0
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +8 -2
- package/dest/error_enriching.d.ts +5 -3
- package/dest/error_enriching.d.ts.map +1 -1
- package/dest/error_enriching.js +12 -10
- package/dest/hooks/execution_hooks.d.ts +15 -4
- package/dest/hooks/execution_hooks.d.ts.map +1 -1
- package/dest/hooks/index.d.ts +3 -2
- package/dest/hooks/index.d.ts.map +1 -1
- package/dest/hooks/index.js +1 -0
- package/dest/hooks/resolve_custom_request.d.ts +23 -0
- package/dest/hooks/resolve_custom_request.d.ts.map +1 -0
- package/dest/hooks/resolve_custom_request.js +3 -0
- package/dest/hooks/resolve_tagging_secret_strategy.d.ts +10 -1
- package/dest/hooks/resolve_tagging_secret_strategy.d.ts.map +1 -1
- package/dest/hooks/resolve_tagging_secret_strategy.js +3 -3
- package/dest/logs/log_service.d.ts +5 -3
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +38 -17
- package/dest/notes/note_service.d.ts +1 -1
- package/dest/notes/note_service.js +1 -1
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +2 -2
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +6 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +17 -36
- package/dest/private_kernel/private_kernel_oracle.d.ts +4 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +17 -5
- package/dest/pxe.d.ts +81 -46
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +138 -104
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts +1 -1
- package/dest/storage/backwards_compatibility_tests/schema_tests.d.ts.map +1 -1
- package/dest/storage/backwards_compatibility_tests/schema_tests.js +31 -7
- package/dest/storage/contract_store/contract_store.d.ts +27 -24
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +63 -74
- package/dest/storage/fact_store/fact_service.d.ts +6 -4
- package/dest/storage/fact_store/fact_service.d.ts.map +1 -1
- package/dest/storage/fact_store/fact_service.js +19 -4
- package/dest/storage/fact_store/fact_store.d.ts +1 -1
- package/dest/storage/fact_store/fact_store.js +1 -1
- package/dest/storage/fact_store/index.d.ts +2 -1
- package/dest/storage/fact_store/index.d.ts.map +1 -1
- package/dest/storage/fact_store/index.js +1 -0
- package/dest/storage/fact_store/origin_state.d.ts +57 -0
- package/dest/storage/fact_store/origin_state.d.ts.map +1 -0
- package/dest/storage/fact_store/origin_state.js +53 -0
- package/dest/storage/metadata.d.ts +2 -2
- package/dest/storage/metadata.d.ts.map +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/store_identity.d.ts +35 -0
- package/dest/storage/store_identity.d.ts.map +1 -0
- package/dest/storage/store_identity.js +44 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +19 -3
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +48 -11
- package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts +17 -6
- package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/tagging_secret_sources_store.js +24 -11
- package/dest/tagging/constants.d.ts +2 -2
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +18 -9
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +6 -2
- package/package.json +17 -17
- package/src/block_synchronizer/block_synchronizer.ts +9 -1
- package/src/contract/contract_class_service.ts +83 -0
- package/src/{contract_sync → contract}/contract_sync_service.ts +18 -37
- package/src/contract/helpers.ts +35 -0
- package/src/contract_function_simulator/anchored_contract_data.ts +74 -0
- package/src/contract_function_simulator/aztec_node_read_cache.ts +89 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +56 -14
- package/src/contract_function_simulator/execution_note_cache.ts +7 -28
- package/src/contract_function_simulator/index.ts +7 -1
- package/src/contract_function_simulator/noir-structs/fact.ts +4 -4
- package/src/contract_function_simulator/noir-structs/fact_collection.ts +9 -4
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +6 -0
- package/src/contract_function_simulator/noir-structs/pending_tagged_log.ts +12 -0
- package/src/contract_function_simulator/noir-structs/provided_secret.ts +1 -1
- package/src/contract_function_simulator/noir-structs/resolved_tagging_strategy.ts +21 -0
- package/src/contract_function_simulator/oracle/acir_callback.ts +58 -12
- package/src/contract_function_simulator/oracle/legacy_oracle_registry.ts +147 -0
- package/src/contract_function_simulator/oracle/oracle_registry.ts +37 -7
- package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +49 -32
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +92 -41
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +149 -71
- package/src/debug/pxe_debug_utils.ts +1 -1
- package/src/entrypoints/client/bundle/index.ts +1 -0
- package/src/entrypoints/client/bundle/utils.ts +16 -4
- package/src/entrypoints/client/lazy/index.ts +1 -0
- package/src/entrypoints/client/lazy/utils.ts +16 -4
- package/src/entrypoints/client/store.ts +38 -0
- package/src/entrypoints/server/index.ts +6 -1
- package/src/entrypoints/server/store.ts +47 -0
- package/src/entrypoints/server/utils.ts +21 -7
- package/src/error_enriching.ts +26 -10
- package/src/hooks/execution_hooks.ts +14 -3
- package/src/hooks/index.ts +2 -0
- package/src/hooks/resolve_custom_request.ts +24 -0
- package/src/hooks/resolve_tagging_secret_strategy.ts +14 -0
- package/src/logs/log_service.ts +35 -11
- package/src/notes/note_service.ts +1 -1
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +11 -1
- package/src/private_kernel/private_kernel_execution_prover.ts +22 -52
- package/src/private_kernel/private_kernel_oracle.ts +23 -4
- package/src/pxe.ts +212 -143
- package/src/storage/backwards_compatibility_tests/__snapshots__/AddressStore.json +6 -6
- package/src/storage/backwards_compatibility_tests/__snapshots__/ContractStore.json +1 -1
- package/src/storage/backwards_compatibility_tests/__snapshots__/KeyStore.json +12 -12
- package/src/storage/backwards_compatibility_tests/__snapshots__/RecipientTaggingStore.json +11 -3
- package/src/storage/backwards_compatibility_tests/__snapshots__/SenderTaggingStore.json +12 -4
- package/src/storage/backwards_compatibility_tests/__snapshots__/TaggingSecretSourcesStore.json +3 -3
- package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +1 -1
- package/src/storage/backwards_compatibility_tests/schema_tests.ts +38 -4
- package/src/storage/contract_store/contract_store.ts +85 -92
- package/src/storage/fact_store/fact_service.ts +29 -5
- package/src/storage/fact_store/fact_store.ts +1 -1
- package/src/storage/fact_store/index.ts +10 -0
- package/src/storage/fact_store/origin_state.ts +75 -0
- package/src/storage/metadata.ts +1 -1
- package/src/storage/store_identity.ts +72 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +62 -15
- package/src/storage/tagging_store/tagging_secret_sources_store.ts +36 -15
- package/src/tagging/constants.ts +19 -9
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +1 -1
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +6 -2
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +0 -6
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +0 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +0 -51
- package/dest/contract_sync/contract_sync_service.d.ts.map +0 -1
- package/dest/contract_sync/helpers.d.ts +0 -28
- package/dest/contract_sync/helpers.d.ts.map +0 -1
- package/dest/contract_sync/helpers.js +0 -48
- package/src/contract_function_simulator/proxied_contract_data_source.ts +0 -60
- package/src/contract_sync/helpers.ts +0 -79
|
@@ -21,23 +21,27 @@ export {
|
|
|
21
21
|
ETH_ADDRESS,
|
|
22
22
|
EVENT_VALIDATION_REQUEST,
|
|
23
23
|
FIELD,
|
|
24
|
+
FIXED_ARRAY,
|
|
24
25
|
FUNCTION_SELECTOR,
|
|
25
26
|
LOG_RETRIEVAL_REQUEST,
|
|
26
27
|
LOG_RETRIEVAL_RESPONSE,
|
|
27
28
|
MEMBERSHIP_WITNESS,
|
|
28
|
-
MESSAGE_CONTEXT,
|
|
29
29
|
NOTE_SELECTOR,
|
|
30
30
|
NOTE_VALIDATION_REQUEST,
|
|
31
31
|
OPTION,
|
|
32
32
|
PENDING_TAGGED_LOG,
|
|
33
33
|
POINT,
|
|
34
34
|
PROVIDED_SECRET,
|
|
35
|
+
SLOT_NUMBER,
|
|
35
36
|
STR,
|
|
37
|
+
STRUCT,
|
|
36
38
|
U32,
|
|
39
|
+
tryFieldWidth,
|
|
37
40
|
type InputSlot,
|
|
38
41
|
type MaybePromise,
|
|
39
42
|
type OutputSlot,
|
|
40
43
|
type SlotShape,
|
|
44
|
+
type StructField,
|
|
41
45
|
type TypeMapping,
|
|
42
46
|
} from './oracle/oracle_type_mappings.js';
|
|
43
47
|
export { ExecutionNoteCache } from './execution_note_cache.js';
|
|
@@ -53,6 +57,7 @@ export { TxResolverService } from '../messages/tx_resolver_service.js';
|
|
|
53
57
|
export { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
54
58
|
export { PrivateExecutionOracle } from './oracle/private_execution_oracle.js';
|
|
55
59
|
export { buildACIRCallback, UnavailableOracleError } from './oracle/acir_callback.js';
|
|
60
|
+
export { LEGACY_ORACLE_REGISTRY } from './oracle/legacy_oracle_registry.js';
|
|
56
61
|
export { executePrivateFunction, extractPrivateCircuitPublicInputs } from './oracle/private_execution.js';
|
|
57
62
|
export { generateSimulatedProvingResult } from './contract_function_simulator.js';
|
|
58
63
|
export { packAsHintedNote } from './oracle/note_packing_utils.js';
|
|
@@ -66,6 +71,7 @@ export { EventValidationRequest } from './noir-structs/event_validation_request.
|
|
|
66
71
|
export type { LogRetrievalRequest } from './noir-structs/log_retrieval_request.js';
|
|
67
72
|
export type { LogRetrievalResponse } from './noir-structs/log_retrieval_response.js';
|
|
68
73
|
export { NoteValidationRequest } from './noir-structs/note_validation_request.js';
|
|
74
|
+
export type { PendingTaggedLog } from './noir-structs/pending_tagged_log.js';
|
|
69
75
|
export type { TxEffectData } from './noir-structs/tx_effect_data.js';
|
|
70
76
|
export type { ProvidedSecret } from './noir-structs/provided_secret.js';
|
|
71
77
|
export { ResolvedTx } from './noir-structs/resolved_tx.js';
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
|
|
3
|
+
import type { RetractableFactOrigin } from '../../storage/fact_store/index.js';
|
|
3
4
|
import type { EphemeralArray } from './ephemeral_array.js';
|
|
4
5
|
import type { Option } from './option.js';
|
|
5
|
-
import type { OriginBlock } from './origin_block.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* A single fact returned within a fact collection by the fact store oracles.
|
|
9
9
|
*
|
|
10
|
-
* A TS version of the `Fact` struct in `facts/mod.nr`. `originBlock` is `Some` for a retractable fact (
|
|
11
|
-
*
|
|
10
|
+
* A TS version of the `Fact` struct in `facts/mod.nr`. `originBlock` is `Some` for a retractable fact (carrying its
|
|
11
|
+
* origin block's current chain state) and `None` for a non-retractable one.
|
|
12
12
|
*/
|
|
13
|
-
export type Fact = { factTypeId: Fr; payload: EphemeralArray<Fr>; originBlock: Option<
|
|
13
|
+
export type Fact = { factTypeId: Fr; payload: EphemeralArray<Fr>; originBlock: Option<RetractableFactOrigin> };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
3
|
|
|
4
|
-
import type {
|
|
4
|
+
import type { FactWithOriginState, RetractableFactOrigin } from '../../storage/fact_store/index.js';
|
|
5
|
+
import { OriginBlockState } from '../../storage/fact_store/index.js';
|
|
5
6
|
import type { EphemeralArrayService } from '../ephemeral_array_service.js';
|
|
6
7
|
import { EphemeralArray } from './ephemeral_array.js';
|
|
7
8
|
import type { Fact } from './fact.js';
|
|
@@ -27,7 +28,7 @@ export function toNoirFactCollection(
|
|
|
27
28
|
scope: AztecAddress,
|
|
28
29
|
factCollectionTypeId: Fr,
|
|
29
30
|
factCollectionId: Fr,
|
|
30
|
-
facts:
|
|
31
|
+
facts: FactWithOriginState[],
|
|
31
32
|
): FactCollection {
|
|
32
33
|
return {
|
|
33
34
|
contractAddress,
|
|
@@ -37,12 +38,16 @@ export function toNoirFactCollection(
|
|
|
37
38
|
facts: EphemeralArray.fromValues(
|
|
38
39
|
service,
|
|
39
40
|
facts.map(
|
|
40
|
-
(fact:
|
|
41
|
+
(fact: FactWithOriginState): Fact => ({
|
|
41
42
|
factTypeId: fact.factTypeId,
|
|
42
43
|
payload: EphemeralArray.fromValues(service, fact.payload),
|
|
43
44
|
originBlock: fact.originBlock
|
|
44
45
|
? Option.some(fact.originBlock)
|
|
45
|
-
: Option.none<
|
|
46
|
+
: Option.none<RetractableFactOrigin>({
|
|
47
|
+
blockNumber: 0,
|
|
48
|
+
blockHash: Fr.ZERO,
|
|
49
|
+
blockState: OriginBlockState.Pending,
|
|
50
|
+
}),
|
|
46
51
|
}),
|
|
47
52
|
),
|
|
48
53
|
),
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import type { BlockHash } from '@aztec/stdlib/block';
|
|
2
4
|
import type { TxHash } from '@aztec/stdlib/tx';
|
|
5
|
+
import type { UInt64 } from '@aztec/stdlib/types';
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* Intermediate struct used to perform batch log retrieval by PXE. The `utilityBulkRetrieveLogs` oracle stores values of this
|
|
@@ -10,4 +13,7 @@ export type LogRetrievalResponse = {
|
|
|
10
13
|
txHash: TxHash;
|
|
11
14
|
uniqueNoteHashesInTx: Fr[];
|
|
12
15
|
firstNullifierInTx: Fr;
|
|
16
|
+
blockNumber: BlockNumber;
|
|
17
|
+
blockTimestamp: UInt64;
|
|
18
|
+
blockHash: BlockHash;
|
|
13
19
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
|
|
3
|
+
import type { ResolvedTx } from './resolved_tx.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Represents a pending tagged log as it is stored in the pending tagged log array to which the fetchTaggedLogs oracle
|
|
7
|
+
* inserts found private logs. A TS version of `pending_tagged_log.nr`.
|
|
8
|
+
*/
|
|
9
|
+
export type PendingTaggedLog = {
|
|
10
|
+
log: Fr[];
|
|
11
|
+
context: ResolvedTx;
|
|
12
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import type { AppTaggingSecretKind } from '@aztec/stdlib/logs';
|
|
3
3
|
|
|
4
|
-
/** A tagging secret an app supplies explicitly to `
|
|
4
|
+
/** A tagging secret an app supplies explicitly to `getPendingTaggedLogsV2` when PXE cannot derive it internally. */
|
|
5
5
|
export type ProvidedSecret = { secret: Fr; mode: AppTaggingSecretKind };
|
|
@@ -3,6 +3,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
// Keep in sync with aztec::messages::delivery::ResolvedTaggingStrategy
|
|
4
4
|
const NON_INTERACTIVE_HANDSHAKE = 1;
|
|
5
5
|
const UNCONSTRAINED_SECRET = 2;
|
|
6
|
+
const INTERACTIVE_HANDSHAKE = 3;
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* The tagging secret PXE hands to the contract after applying the wallet's {@link TaggingSecretStrategy} choice
|
|
@@ -13,6 +14,14 @@ export type ResolvedTaggingStrategy =
|
|
|
13
14
|
/** A non-interactive handshake: the recipient re-derives the secret from the onchain handshake registry. */
|
|
14
15
|
type: 'non-interactive-handshake';
|
|
15
16
|
}
|
|
17
|
+
| {
|
|
18
|
+
/**
|
|
19
|
+
* An interactive handshake: the registry obtains the recipient's signed authorization through the custom
|
|
20
|
+
* request oracle, and the recipient learns the secret while signing. Nothing announcing the handshake is
|
|
21
|
+
* published onchain.
|
|
22
|
+
*/
|
|
23
|
+
type: 'interactive-handshake';
|
|
24
|
+
}
|
|
16
25
|
| {
|
|
17
26
|
/**
|
|
18
27
|
* An app-siloed, recipient-directional secret, ready to use. Only sound for unconstrained delivery.
|
|
@@ -29,6 +38,8 @@ export function resolvedTaggingStrategyToFields(resolved: ResolvedTaggingStrateg
|
|
|
29
38
|
return [new Fr(NON_INTERACTIVE_HANDSHAKE), Fr.ZERO];
|
|
30
39
|
case 'unconstrained-secret':
|
|
31
40
|
return [new Fr(UNCONSTRAINED_SECRET), resolved.secret];
|
|
41
|
+
case 'interactive-handshake':
|
|
42
|
+
return [new Fr(INTERACTIVE_HANDSHAKE), Fr.ZERO];
|
|
32
43
|
}
|
|
33
44
|
}
|
|
34
45
|
|
|
@@ -36,10 +47,20 @@ export function resolvedTaggingStrategyToFields(resolved: ResolvedTaggingStrateg
|
|
|
36
47
|
export function resolvedTaggingStrategyFromFields(kind: number, secret: Fr): ResolvedTaggingStrategy {
|
|
37
48
|
switch (kind) {
|
|
38
49
|
case NON_INTERACTIVE_HANDSHAKE:
|
|
50
|
+
assertAbsentSecret(kind, secret);
|
|
39
51
|
return { type: 'non-interactive-handshake' };
|
|
52
|
+
case INTERACTIVE_HANDSHAKE:
|
|
53
|
+
assertAbsentSecret(kind, secret);
|
|
54
|
+
return { type: 'interactive-handshake' };
|
|
40
55
|
case UNCONSTRAINED_SECRET:
|
|
41
56
|
return { type: 'unconstrained-secret', secret };
|
|
42
57
|
default:
|
|
43
58
|
throw new Error(`Unrecognized resolved tagging strategy kind: ${kind}`);
|
|
44
59
|
}
|
|
45
60
|
}
|
|
61
|
+
|
|
62
|
+
function assertAbsentSecret(kind: number, secret: Fr): void {
|
|
63
|
+
if (!secret.isZero()) {
|
|
64
|
+
throw new Error(`Resolved tagging strategy ${kind} must not include a secret`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
@@ -2,7 +2,8 @@ import type { ACIRCallback, ACVMField } from '@aztec/simulator/client';
|
|
|
2
2
|
|
|
3
3
|
import { ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR } from '../../oracle_version.js';
|
|
4
4
|
import type { IMiscOracle, IPrivateExecutionOracle, IUtilityExecutionOracle } from './interfaces.js';
|
|
5
|
-
import {
|
|
5
|
+
import { LEGACY_ORACLE_REGISTRY, type LegacyOracleEntry } from './legacy_oracle_registry.js';
|
|
6
|
+
import { type NamedValue, ORACLE_REGISTRY, type OracleRegistryEntry, makeEntry } from './oracle_registry.js';
|
|
6
7
|
|
|
7
8
|
export class UnavailableOracleError extends Error {
|
|
8
9
|
constructor(oracleName: string) {
|
|
@@ -17,26 +18,71 @@ export class UnavailableOracleError extends Error {
|
|
|
17
18
|
* `aztec_{scope}_{methodName}` convention to resolve the handler, and calling the method directly. Unknown oracle
|
|
18
19
|
* names produce enhanced error messages based on the contract's oracle version.
|
|
19
20
|
*/
|
|
20
|
-
export function buildACIRCallback(
|
|
21
|
+
export function buildACIRCallback(
|
|
22
|
+
handler: OracleHandler,
|
|
23
|
+
registries: {
|
|
24
|
+
real?: Record<string, OracleRegistryEntry>;
|
|
25
|
+
legacy?: Record<string, LegacyOracleEntry>;
|
|
26
|
+
} = {},
|
|
27
|
+
): ACIRCallback {
|
|
28
|
+
const { real = ORACLE_REGISTRY, legacy: legacyRegistry = LEGACY_ORACLE_REGISTRY } = registries;
|
|
21
29
|
const target = {} as ACIRCallback;
|
|
22
|
-
for (const [oracleKey, entry] of Object.entries(
|
|
23
|
-
const
|
|
24
|
-
if (!match) {
|
|
25
|
-
throw new Error(`Oracle "${oracleKey}" does not follow the aztec_{scope}_{method} convention`);
|
|
26
|
-
}
|
|
27
|
-
const [, scope, methodName] = match;
|
|
30
|
+
for (const [oracleKey, entry] of Object.entries(real)) {
|
|
31
|
+
const { scope, methodName } = parseOracleName(oracleKey, 'Oracle');
|
|
28
32
|
target[oracleKey] = async (...inputs: ACVMField[][]) => {
|
|
29
33
|
assertHandlerSupportsScope(handler, scope);
|
|
30
34
|
const named = entry.deserializeParams(inputs);
|
|
31
|
-
const positional = named.map(p => p.value);
|
|
35
|
+
const positional = named.map((p: NamedValue) => p.value);
|
|
32
36
|
const result = await (handler as any)[methodName](...positional);
|
|
33
37
|
return entry.serializeReturn(result);
|
|
34
38
|
};
|
|
35
39
|
}
|
|
36
40
|
|
|
37
|
-
|
|
41
|
+
// Legacy oracle names: served for contracts compiled against a retired oracle version. Each reuses the current
|
|
42
|
+
// handler of its `modernOracle` and reshapes the wire (params and/or return) back to what the old bytecode expects.
|
|
43
|
+
for (const [legacyKey, legacy] of Object.entries(legacyRegistry)) {
|
|
44
|
+
const { scope } = parseOracleName(legacyKey, 'Legacy oracle');
|
|
45
|
+
if (legacyKey in target) {
|
|
46
|
+
throw new Error(`Legacy oracle "${legacyKey}" collides with a live oracle of the same name in the registry`);
|
|
47
|
+
}
|
|
48
|
+
const modernEntry = real[legacy.modernOracle];
|
|
49
|
+
const { methodName } = parseOracleName(legacy.modernOracle, 'Oracle');
|
|
50
|
+
// Override only the side whose wire changed; inherit the other from the modern entry.
|
|
51
|
+
const paramOverride = legacy.params;
|
|
52
|
+
const paramSource = paramOverride ? makeEntry({ params: [...paramOverride.legacyType] }) : modernEntry;
|
|
53
|
+
const returnOverride = legacy.returnType;
|
|
54
|
+
const returnSource = returnOverride ? makeEntry({ returnType: returnOverride.legacyType }) : modernEntry;
|
|
55
|
+
target[legacyKey] = async (...inputs: ACVMField[][]) => {
|
|
56
|
+
assertHandlerSupportsScope(handler, scope);
|
|
57
|
+
const legacyArgs = paramSource.deserializeParams(inputs).map(p => p.value);
|
|
58
|
+
const positional = paramOverride ? await paramOverride.mapping(legacyArgs) : legacyArgs;
|
|
59
|
+
const result = await (handler as any)[methodName](...positional);
|
|
60
|
+
return returnSource.serializeReturn(returnOverride ? returnOverride.mapping(result) : result);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
return new Proxy(target, makeUnknownOracleTrap(handler));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Parses an `aztec_{scope}_{method}` oracle name into its parts, throwing if it doesn't follow the convention. */
|
|
68
|
+
function parseOracleName(key: string, label: string): { scope: string; methodName: string } {
|
|
69
|
+
const match = key.match(/^aztec_(\w+?)_(.+)$/);
|
|
70
|
+
if (!match) {
|
|
71
|
+
throw new Error(`${label} "${key}" does not follow the aztec_{scope}_{method} convention`);
|
|
72
|
+
}
|
|
73
|
+
return { scope: match[1], methodName: match[2] };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Proxy trap for the callback table: a known oracle name passes through; an unknown one throws a diagnostic keyed on
|
|
78
|
+
* the contract's oracle version (version unknown, contract newer than this environment, or a same-version mismatch).
|
|
79
|
+
*/
|
|
80
|
+
function makeUnknownOracleTrap(handler: OracleHandler): ProxyHandler<ACIRCallback> {
|
|
81
|
+
return {
|
|
38
82
|
get(obj, prop: string) {
|
|
39
|
-
|
|
83
|
+
// Own-property check only: `in` would match inherited `Object.prototype` keys (e.g. `constructor`, `toString`)
|
|
84
|
+
// and return the built-in instead of falling through to the unknown-oracle diagnostic below.
|
|
85
|
+
if (Object.hasOwn(obj, prop)) {
|
|
40
86
|
return (obj as Record<string, unknown>)[prop];
|
|
41
87
|
}
|
|
42
88
|
|
|
@@ -76,7 +122,7 @@ export function buildACIRCallback(handler: OracleHandler): ACIRCallback {
|
|
|
76
122
|
}
|
|
77
123
|
};
|
|
78
124
|
},
|
|
79
|
-
}
|
|
125
|
+
};
|
|
80
126
|
}
|
|
81
127
|
|
|
82
128
|
type OracleHandler = IMiscOracle & (IUtilityExecutionOracle | IPrivateExecutionOracle);
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
import { MAX_NOTE_HASHES_PER_TX, PRIVATE_LOG_CIPHERTEXT_LEN, PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec/constants';
|
|
3
|
+
import { computeFeeJuiceMessageNullifier } from '@aztec/stdlib/messaging';
|
|
4
|
+
|
|
5
|
+
import type { EphemeralArray } from '../noir-structs/ephemeral_array.js';
|
|
6
|
+
import type { LogRetrievalResponse } from '../noir-structs/log_retrieval_response.js';
|
|
7
|
+
import { Option } from '../noir-structs/option.js';
|
|
8
|
+
import type { PendingTaggedLog } from '../noir-structs/pending_tagged_log.js';
|
|
9
|
+
import type { ResolvedTx } from '../noir-structs/resolved_tx.js';
|
|
10
|
+
import {
|
|
11
|
+
type InferDeserializedParams,
|
|
12
|
+
ORACLE_REGISTRY,
|
|
13
|
+
type OracleRegistryEntry,
|
|
14
|
+
type ParamTypes,
|
|
15
|
+
type RegistryParam,
|
|
16
|
+
} from './oracle_registry.js';
|
|
17
|
+
import {
|
|
18
|
+
AZTEC_ADDRESS,
|
|
19
|
+
EPHEMERAL_ARRAY,
|
|
20
|
+
FIELD,
|
|
21
|
+
FIXED_BOUNDED_VEC,
|
|
22
|
+
STRUCT,
|
|
23
|
+
TX_HASH,
|
|
24
|
+
type TypeMapping,
|
|
25
|
+
} from './oracle_type_mappings.js';
|
|
26
|
+
|
|
27
|
+
const LEGACY_LOG_RETRIEVAL_RESPONSE: TypeMapping<LegacyLogRetrievalResponse> = STRUCT([
|
|
28
|
+
{ name: 'logPayload', type: FIXED_BOUNDED_VEC(FIELD, PRIVATE_LOG_CIPHERTEXT_LEN) },
|
|
29
|
+
{ name: 'txHash', type: TX_HASH },
|
|
30
|
+
{ name: 'uniqueNoteHashesInTx', type: FIXED_BOUNDED_VEC(FIELD, MAX_NOTE_HASHES_PER_TX) },
|
|
31
|
+
{ name: 'firstNullifierInTx', type: FIELD },
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
// Block-less transaction context: the prefix of `ResolvedTx`'s wire carried by the original `getPendingTaggedLogs`
|
|
35
|
+
// oracle. Known as `MessageContext` in the Aztec.nr versions that call that oracle.
|
|
36
|
+
const LEGACY_MESSAGE_CONTEXT: TypeMapping<LegacyMessageContext> = STRUCT<LegacyMessageContext>([
|
|
37
|
+
{ name: 'txHash', type: TX_HASH },
|
|
38
|
+
{ name: 'uniqueNoteHashesInTx', type: FIXED_BOUNDED_VEC(FIELD, MAX_NOTE_HASHES_PER_TX) },
|
|
39
|
+
{ name: 'firstNullifierInTx', type: FIELD },
|
|
40
|
+
]);
|
|
41
|
+
|
|
42
|
+
const LEGACY_PENDING_TAGGED_LOG: TypeMapping<LegacyPendingTaggedLog> = STRUCT<LegacyPendingTaggedLog>([
|
|
43
|
+
{ name: 'log', type: FIXED_BOUNDED_VEC(FIELD, PRIVATE_LOG_SIZE_IN_FIELDS) },
|
|
44
|
+
{ name: 'context', type: LEGACY_MESSAGE_CONTEXT },
|
|
45
|
+
]);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Wire shapes that already-deployed contracts still call by their original oracle name, keyed by that retired name.
|
|
49
|
+
* New Aztec.nr calls the current name in `ORACLE_REGISTRY`; old bytecode keeps calling the name compiled into it and
|
|
50
|
+
* is served from here, so versioning an oracle's wire (e.g. adding return fields) stops being a breaking change.
|
|
51
|
+
*
|
|
52
|
+
* Append-only. Drop an entry only once the `ORACLE_VERSION_MAJOR` that introduced its successor is retired, since
|
|
53
|
+
* older contracts can no longer run against this environment.
|
|
54
|
+
*/
|
|
55
|
+
export const LEGACY_ORACLE_REGISTRY: Record<string, LegacyOracleEntry> = {
|
|
56
|
+
aztec_utl_getL1ToL2MembershipWitness: legacyOracle({
|
|
57
|
+
modernOracle: 'aztec_utl_getL1ToL2MembershipWitnessV2',
|
|
58
|
+
// The old wire passed the contract address and secret, the modern oracle takes the unsiloed nullifier (plus the
|
|
59
|
+
// address to silo it with) instead. We derive it here so already-deployed contracts that still emit the old call
|
|
60
|
+
// keep working.
|
|
61
|
+
//
|
|
62
|
+
// This is the fee juice message nullifier derivation: only contracts using that scheme call this retired oracle.
|
|
63
|
+
params: {
|
|
64
|
+
legacyType: [
|
|
65
|
+
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
66
|
+
{ name: 'messageHash', type: FIELD },
|
|
67
|
+
{ name: 'secret', type: FIELD },
|
|
68
|
+
],
|
|
69
|
+
mapping: async ([contractAddress, messageHash, secret]) => [
|
|
70
|
+
messageHash,
|
|
71
|
+
Option.some({ contractAddress, nullifier: await computeFeeJuiceMessageNullifier(messageHash, secret) }),
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
}),
|
|
75
|
+
aztec_utl_getLogsByTag: legacyOracle({
|
|
76
|
+
modernOracle: 'aztec_utl_getLogsByTagV2',
|
|
77
|
+
returnType: {
|
|
78
|
+
legacyType: EPHEMERAL_ARRAY(EPHEMERAL_ARRAY(LEGACY_LOG_RETRIEVAL_RESPONSE)),
|
|
79
|
+
// We can map this directly, since the new type is a superset of the old type
|
|
80
|
+
mapping: result => result as unknown as EphemeralArray<EphemeralArray<LegacyLogRetrievalResponse>>,
|
|
81
|
+
},
|
|
82
|
+
}),
|
|
83
|
+
aztec_utl_getPendingTaggedLogs: legacyOracle({
|
|
84
|
+
modernOracle: 'aztec_utl_getPendingTaggedLogsV2',
|
|
85
|
+
returnType: {
|
|
86
|
+
legacyType: EPHEMERAL_ARRAY(LEGACY_PENDING_TAGGED_LOG),
|
|
87
|
+
// We can map this directly, since `ResolvedTx` carries the legacy context's fields under the same names
|
|
88
|
+
mapping: result => result as unknown as EphemeralArray<LegacyPendingTaggedLog>,
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
type LegacyLogRetrievalResponse = Pick<
|
|
94
|
+
LogRetrievalResponse,
|
|
95
|
+
'logPayload' | 'txHash' | 'uniqueNoteHashesInTx' | 'firstNullifierInTx'
|
|
96
|
+
>;
|
|
97
|
+
|
|
98
|
+
type LegacyMessageContext = Pick<ResolvedTx, 'txHash' | 'uniqueNoteHashesInTx' | 'firstNullifierInTx'>;
|
|
99
|
+
|
|
100
|
+
type LegacyPendingTaggedLog = {
|
|
101
|
+
log: PendingTaggedLog['log'];
|
|
102
|
+
context: LegacyMessageContext;
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
type Registry = typeof ORACLE_REGISTRY;
|
|
106
|
+
|
|
107
|
+
/** The handler return value type of a modern oracle entry. */
|
|
108
|
+
type ReturnValueOf<K extends keyof Registry> = Registry[K] extends OracleRegistryEntry<any, infer R> ? R : never;
|
|
109
|
+
|
|
110
|
+
/** The modern handler's positional argument tuple, derived from the oracle's declared params. */
|
|
111
|
+
type HandlerArgsOf<K extends keyof Registry> = ParamTypes<ReturnType<Registry[K]['deserializeParams']>>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* A legacy oracle adapter, stored under the retired oracle name that already-deployed contracts still call. It reuses
|
|
115
|
+
* the handler of `modernOracle` and overrides only the wire side(s) that changed; an omitted side falls back to that
|
|
116
|
+
* modern entry.
|
|
117
|
+
*/
|
|
118
|
+
export interface LegacyOracleEntry {
|
|
119
|
+
/** The current oracle whose handler this reuses and whose param/return wire it inherits by default. */
|
|
120
|
+
modernOracle: keyof Registry;
|
|
121
|
+
/**
|
|
122
|
+
* Old param wire. `legacyType` deserializes the old wire; `mapping` bridges the deserialized legacy args to the
|
|
123
|
+
* modern handler's args. The mapping may be async. Omit when the param wire is unchanged.
|
|
124
|
+
*/
|
|
125
|
+
params?: {
|
|
126
|
+
legacyType: readonly RegistryParam[];
|
|
127
|
+
mapping: (legacyArgs: any) => readonly unknown[] | Promise<readonly unknown[]>;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Old return wire. `legacyType` serializes the subset the old contract reads; `mapping` bridges the handler's
|
|
131
|
+
* current result to that subset's value type. Omit when the return wire is unchanged.
|
|
132
|
+
*/
|
|
133
|
+
returnType?: { legacyType: TypeMapping; mapping: (result: any) => unknown };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function legacyOracle<K extends keyof Registry, W = never, const TLegacyParams extends RegistryParam[] = []>(entry: {
|
|
137
|
+
modernOracle: K;
|
|
138
|
+
params?: {
|
|
139
|
+
legacyType: [...TLegacyParams];
|
|
140
|
+
mapping: (
|
|
141
|
+
legacyArgs: ParamTypes<InferDeserializedParams<TLegacyParams>>,
|
|
142
|
+
) => HandlerArgsOf<K> | Promise<HandlerArgsOf<K>>;
|
|
143
|
+
};
|
|
144
|
+
returnType?: { legacyType: TypeMapping<W>; mapping: (result: ReturnValueOf<K>) => W };
|
|
145
|
+
}): LegacyOracleEntry {
|
|
146
|
+
return entry;
|
|
147
|
+
}
|
|
@@ -3,6 +3,7 @@ import { ARCHIVE_HEIGHT, NOTE_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { FieldReader } from '@aztec/foundation/serialize';
|
|
5
5
|
import { toACVMField } from '@aztec/simulator/client';
|
|
6
|
+
import type { UnsiloedMessageNullifier } from '@aztec/stdlib/messaging';
|
|
6
7
|
|
|
7
8
|
import {
|
|
8
9
|
ARRAY,
|
|
@@ -45,6 +46,7 @@ import {
|
|
|
45
46
|
RESOLVED_TAGGING_STRATEGY,
|
|
46
47
|
RESOLVED_TX,
|
|
47
48
|
STR,
|
|
49
|
+
STRUCT,
|
|
48
50
|
TX_EFFECT,
|
|
49
51
|
TX_HASH,
|
|
50
52
|
type TypeMapping,
|
|
@@ -139,6 +141,14 @@ export const ORACLE_REGISTRY = {
|
|
|
139
141
|
returnType: OPTION(MEMBERSHIP_WITNESS(ARCHIVE_HEIGHT)),
|
|
140
142
|
}),
|
|
141
143
|
|
|
144
|
+
aztec_utl_areBlockHashesInArchive: makeEntry({
|
|
145
|
+
params: [
|
|
146
|
+
{ name: 'anchorBlockHash', type: BLOCK_HASH },
|
|
147
|
+
{ name: 'blockHashes', type: EPHEMERAL_ARRAY(BLOCK_HASH) },
|
|
148
|
+
],
|
|
149
|
+
returnType: EPHEMERAL_ARRAY(BOOL),
|
|
150
|
+
}),
|
|
151
|
+
|
|
142
152
|
aztec_utl_getNullifierMembershipWitness: makeEntry({
|
|
143
153
|
params: [
|
|
144
154
|
{ name: 'blockHash', type: BLOCK_HASH },
|
|
@@ -183,11 +193,18 @@ export const ORACLE_REGISTRY = {
|
|
|
183
193
|
returnType: BOOL,
|
|
184
194
|
}),
|
|
185
195
|
|
|
186
|
-
|
|
196
|
+
aztec_utl_getL1ToL2MembershipWitnessV2: makeEntry({
|
|
187
197
|
params: [
|
|
188
|
-
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
189
198
|
{ name: 'messageHash', type: FIELD },
|
|
190
|
-
{
|
|
199
|
+
{
|
|
200
|
+
name: 'nullifier',
|
|
201
|
+
type: OPTION(
|
|
202
|
+
STRUCT<UnsiloedMessageNullifier>([
|
|
203
|
+
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
204
|
+
{ name: 'nullifier', type: FIELD },
|
|
205
|
+
]),
|
|
206
|
+
),
|
|
207
|
+
},
|
|
191
208
|
],
|
|
192
209
|
returnType: MESSAGE_LOAD_ORACLE_INPUTS,
|
|
193
210
|
}),
|
|
@@ -225,7 +242,7 @@ export const ORACLE_REGISTRY = {
|
|
|
225
242
|
returnType: BOUNDED_VEC(NOTE),
|
|
226
243
|
}),
|
|
227
244
|
|
|
228
|
-
|
|
245
|
+
aztec_utl_getPendingTaggedLogsV2: makeEntry({
|
|
229
246
|
params: [
|
|
230
247
|
{ name: 'scope', type: AZTEC_ADDRESS },
|
|
231
248
|
{ name: 'providedSecrets', type: EPHEMERAL_ARRAY(PROVIDED_SECRET) },
|
|
@@ -241,7 +258,7 @@ export const ORACLE_REGISTRY = {
|
|
|
241
258
|
],
|
|
242
259
|
}),
|
|
243
260
|
|
|
244
|
-
|
|
261
|
+
aztec_utl_getLogsByTagV2: makeEntry({
|
|
245
262
|
params: [{ name: 'requests', type: EPHEMERAL_ARRAY(LOG_RETRIEVAL_REQUEST) }],
|
|
246
263
|
returnType: EPHEMERAL_ARRAY(EPHEMERAL_ARRAY(LOG_RETRIEVAL_RESPONSE)),
|
|
247
264
|
}),
|
|
@@ -256,6 +273,11 @@ export const ORACLE_REGISTRY = {
|
|
|
256
273
|
returnType: OPTION(TX_EFFECT),
|
|
257
274
|
}),
|
|
258
275
|
|
|
276
|
+
aztec_utl_getTxEffects: makeEntry({
|
|
277
|
+
params: [{ name: 'txHashes', type: EPHEMERAL_ARRAY(TX_HASH) }],
|
|
278
|
+
returnType: EPHEMERAL_ARRAY(OPTION(TX_EFFECT)),
|
|
279
|
+
}),
|
|
280
|
+
|
|
259
281
|
aztec_utl_setCapsule: makeEntry({
|
|
260
282
|
params: [
|
|
261
283
|
{ name: 'contractAddress', type: AZTEC_ADDRESS },
|
|
@@ -562,6 +584,14 @@ export const ORACLE_REGISTRY = {
|
|
|
562
584
|
],
|
|
563
585
|
returnType: RESOLVED_TAGGING_STRATEGY,
|
|
564
586
|
}),
|
|
587
|
+
|
|
588
|
+
aztec_prv_resolveCustomRequest: makeEntry({
|
|
589
|
+
params: [
|
|
590
|
+
{ name: 'kind', type: FIELD },
|
|
591
|
+
{ name: 'payload', type: ARRAY(FIELD) },
|
|
592
|
+
],
|
|
593
|
+
returnType: ARRAY(FIELD),
|
|
594
|
+
}),
|
|
565
595
|
} satisfies Record<string, OracleRegistryEntry>;
|
|
566
596
|
|
|
567
597
|
// ─── Registry Infrastructure ─────────────────────────────────────────────────
|
|
@@ -635,7 +665,7 @@ export function makeEntry<const TParams extends RegistryParam[] = [], TReturnVal
|
|
|
635
665
|
}
|
|
636
666
|
|
|
637
667
|
/** A named oracle parameter with its TypeMapping. */
|
|
638
|
-
interface RegistryParam<TName extends string = string, T = any> {
|
|
668
|
+
export interface RegistryParam<TName extends string = string, T = any> {
|
|
639
669
|
name: TName;
|
|
640
670
|
type: TypeMapping<T>;
|
|
641
671
|
}
|
|
@@ -661,7 +691,7 @@ export type ParamTypes<T extends readonly NamedValue[]> = {
|
|
|
661
691
|
* @example `InferDeserializedParams<[RegistryParam<'addr', AztecAddress>, RegistryParam<'slot', Fr>]>`
|
|
662
692
|
* → `[NamedValue<'addr', AztecAddress>, NamedValue<'slot', Fr>]`
|
|
663
693
|
*/
|
|
664
|
-
type InferDeserializedParams<T extends RegistryParam[]> = {
|
|
694
|
+
export type InferDeserializedParams<T extends RegistryParam[]> = {
|
|
665
695
|
[K in keyof T]: T[K] extends RegistryParam<infer N, infer V> ? NamedValue<N, V> : never;
|
|
666
696
|
};
|
|
667
697
|
|