@aztec/pxe 5.0.0-rc.1 → 5.0.0-rc.2
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_stream_source.d.ts +5 -5
- package/dest/block_synchronizer/block_stream_source.d.ts.map +1 -1
- package/dest/block_synchronizer/block_stream_source.js +4 -29
- package/dest/block_synchronizer/block_synchronizer.d.ts +13 -11
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +43 -15
- package/dest/config/index.d.ts +2 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +11 -16
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +22 -18
- package/dest/contract_function_simulator/index.d.ts +15 -9
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +3 -7
- package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts +8 -27
- package/dest/contract_function_simulator/noir-structs/bounded_vec.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/bounded_vec.js +8 -23
- package/dest/contract_function_simulator/noir-structs/contract_class_log_data.d.ts +9 -0
- package/dest/contract_function_simulator/noir-structs/contract_class_log_data.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/contract_class_log_data.js +1 -0
- package/dest/contract_function_simulator/noir-structs/embedded_curve_point.d.ts +7 -0
- package/dest/contract_function_simulator/noir-structs/embedded_curve_point.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/embedded_curve_point.js +1 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/fact.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/fact.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/fact.js +6 -0
- package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts +27 -0
- package/dest/contract_function_simulator/noir-structs/fact_collection.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/fact_collection.js +29 -0
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +11 -12
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +6 -49
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +4 -8
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -60
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +2 -2
- package/dest/contract_function_simulator/noir-structs/option.d.ts +9 -11
- package/dest/contract_function_simulator/noir-structs/option.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/option.js +18 -13
- package/dest/contract_function_simulator/noir-structs/origin_block.d.ts +11 -0
- package/dest/contract_function_simulator/noir-structs/origin_block.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/origin_block.js +5 -0
- package/dest/contract_function_simulator/noir-structs/provided_secret.d.ts +5 -8
- 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 -14
- package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts +21 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tagging_strategy.js +33 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts +21 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/resolved_tx.js +50 -0
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts +14 -0
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.js +5 -0
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +6 -11
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/utility_context.js +1 -20
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -14
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.js +1 -24
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +81 -6
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_registry.js +128 -9
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +80 -36
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +926 -264
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +13 -8
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +80 -11
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +46 -20
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +119 -55
- package/dest/contract_sync/helpers.d.ts +7 -6
- package/dest/contract_sync/helpers.d.ts.map +1 -1
- package/dest/contract_sync/helpers.js +11 -16
- 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 +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 +1 -0
- package/dest/entrypoints/pxe_creation_options.d.ts +8 -2
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +1 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +0 -1
- 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 +3 -1
- package/dest/error_enriching.js +1 -1
- package/dest/hooks/execution_hooks.d.ts +16 -7
- package/dest/hooks/execution_hooks.d.ts.map +1 -1
- package/dest/hooks/execution_hooks.js +3 -3
- package/dest/hooks/index.d.ts +3 -3
- package/dest/hooks/index.d.ts.map +1 -1
- package/dest/hooks/resolve_tagging_secret_strategy.d.ts +41 -0
- package/dest/hooks/resolve_tagging_secret_strategy.d.ts.map +1 -0
- package/dest/hooks/resolve_tagging_secret_strategy.js +3 -0
- package/dest/logs/log_service.d.ts +6 -6
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +62 -28
- package/dest/messages/tx_resolver_service.d.ts +17 -0
- package/dest/messages/tx_resolver_service.d.ts.map +1 -0
- package/dest/messages/{message_context_service.js → tx_resolver_service.js} +8 -8
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +2 -2
- package/dest/private_kernel/hints/test_utils.js +1 -1
- package/dest/pxe.d.ts +46 -19
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +104 -52
- package/dest/storage/allowed_scopes.d.ts +6 -0
- package/dest/storage/allowed_scopes.d.ts.map +1 -0
- package/dest/storage/allowed_scopes.js +7 -0
- 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 +86 -33
- package/dest/storage/capsule_store/capsule_service.d.ts +1 -1
- package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_service.js +6 -9
- package/dest/storage/contract_store/contract_store.js +2 -2
- package/dest/storage/fact_store/fact_service.d.ts +20 -0
- package/dest/storage/fact_store/fact_service.d.ts.map +1 -0
- package/dest/storage/fact_store/fact_service.js +30 -0
- package/dest/storage/fact_store/fact_store.d.ts +95 -0
- package/dest/storage/fact_store/fact_store.d.ts.map +1 -0
- package/dest/storage/fact_store/fact_store.js +408 -0
- package/dest/storage/fact_store/fact_store_keys.d.ts +34 -0
- package/dest/storage/fact_store/fact_store_keys.d.ts.map +1 -0
- package/dest/storage/fact_store/fact_store_keys.js +50 -0
- package/dest/storage/fact_store/index.d.ts +5 -0
- package/dest/storage/fact_store/index.d.ts.map +1 -0
- package/dest/storage/fact_store/index.js +3 -0
- package/dest/storage/fact_store/stored_fact.d.ts +32 -0
- package/dest/storage/fact_store/stored_fact.d.ts.map +1 -0
- package/dest/storage/fact_store/stored_fact.js +64 -0
- package/dest/storage/index.d.ts +2 -1
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +1 -0
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/open_pxe_stores.d.ts +5 -3
- package/dest/storage/open_pxe_stores.d.ts.map +1 -1
- package/dest/storage/open_pxe_stores.js +5 -3
- package/dest/storage/tagging_store/index.d.ts +2 -2
- package/dest/storage/tagging_store/index.d.ts.map +1 -1
- package/dest/storage/tagging_store/index.js +1 -1
- package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts +40 -0
- package/dest/storage/tagging_store/tagging_secret_sources_store.d.ts.map +1 -0
- package/dest/storage/tagging_store/tagging_secret_sources_store.js +92 -0
- package/package.json +17 -17
- package/src/block_synchronizer/block_stream_source.ts +6 -45
- package/src/block_synchronizer/block_synchronizer.ts +56 -23
- package/src/config/index.ts +1 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +32 -31
- package/src/contract_function_simulator/index.ts +17 -8
- package/src/contract_function_simulator/noir-structs/bounded_vec.ts +12 -24
- package/src/contract_function_simulator/noir-structs/contract_class_log_data.ts +9 -0
- package/src/contract_function_simulator/noir-structs/embedded_curve_point.ts +4 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/fact.ts +13 -0
- package/src/contract_function_simulator/noir-structs/fact_collection.ts +59 -0
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +20 -46
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +7 -60
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +2 -2
- package/src/contract_function_simulator/noir-structs/option.ts +17 -11
- package/src/contract_function_simulator/noir-structs/origin_block.ts +8 -0
- package/src/contract_function_simulator/noir-structs/provided_secret.ts +3 -14
- package/src/contract_function_simulator/noir-structs/resolved_tagging_strategy.ts +45 -0
- package/src/contract_function_simulator/noir-structs/resolved_tx.ts +53 -0
- package/src/contract_function_simulator/noir-structs/tx_effect_data.ts +15 -0
- package/src/contract_function_simulator/noir-structs/utility_context.ts +5 -17
- package/src/contract_function_simulator/oracle/message_load_oracle_inputs.ts +6 -21
- package/src/contract_function_simulator/oracle/oracle_registry.ts +87 -79
- package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +641 -247
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +94 -14
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +206 -66
- package/src/contract_sync/helpers.ts +11 -18
- package/src/entrypoints/client/bundle/utils.ts +1 -0
- package/src/entrypoints/client/lazy/utils.ts +1 -0
- package/src/entrypoints/pxe_creation_options.ts +7 -1
- package/src/entrypoints/server/index.ts +0 -1
- package/src/entrypoints/server/utils.ts +3 -1
- package/src/error_enriching.ts +1 -1
- package/src/hooks/execution_hooks.ts +17 -8
- package/src/hooks/index.ts +6 -2
- package/src/hooks/resolve_tagging_secret_strategy.ts +46 -0
- package/src/logs/log_service.ts +71 -37
- package/src/messages/{message_context_service.ts → tx_resolver_service.ts} +16 -9
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/hints/test_utils.ts +1 -1
- package/src/pxe.ts +150 -54
- package/src/storage/allowed_scopes.ts +14 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/FactStore.json +40 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/L2TipsKVStore.json +1 -1
- package/src/storage/backwards_compatibility_tests/__snapshots__/TaggingSecretSourcesStore.json +30 -0
- package/src/storage/backwards_compatibility_tests/__snapshots__/opened_stores.json +21 -5
- package/src/storage/backwards_compatibility_tests/schema_tests.ts +88 -33
- package/src/storage/capsule_store/capsule_service.ts +8 -13
- package/src/storage/contract_store/contract_store.ts +2 -2
- package/src/storage/fact_store/fact_service.ts +45 -0
- package/src/storage/fact_store/fact_store.ts +487 -0
- package/src/storage/fact_store/fact_store_keys.ts +75 -0
- package/src/storage/fact_store/index.ts +4 -0
- package/src/storage/fact_store/stored_fact.ts +80 -0
- package/src/storage/index.ts +1 -0
- package/src/storage/metadata.ts +1 -1
- package/src/storage/open_pxe_stores.ts +6 -3
- package/src/storage/tagging_store/index.ts +1 -1
- package/src/storage/tagging_store/tagging_secret_sources_store.ts +117 -0
- package/dest/messages/message_context_service.d.ts +0 -17
- package/dest/messages/message_context_service.d.ts.map +0 -1
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +0 -14
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +0 -1
- package/dest/storage/tagging_store/sender_address_book_store.js +0 -36
- package/src/storage/backwards_compatibility_tests/__snapshots__/SenderAddressBookStore.json +0 -16
- package/src/storage/tagging_store/sender_address_book_store.ts +0 -48
package/dest/pxe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../src/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAqC,MAAM,uBAAuB,CAAC;AAIvF,OAAO,KAAK,EAAE,iBAAiB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;IAED;;;OAGG;IACI,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAE7C;IAED;;;;;;;;;OASG;IACI,OAAO,CAAC,SAAS,EAAE,kBAAkB,EAAE,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,eAAe,CAAC,CA4E9G;IAED;;;;;OAKG;IACI,SAAS,CACd,SAAS,EAAE,kBAAkB,EAC7B,EAAE,WAAW,EAAE,mBAA0B,EAAE,MAAM,EAAE,aAAa,EAAE,EAAE,aAAa,GAChF,OAAO,CAAC,eAAe,CAAC,CA2E1B;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,UAAU,CACf,SAAS,EAAE,kBAAkB,EAC7B,EACE,cAAc,EACd,gBAAwB,EACxB,kBAA0B,EAC1B,WAAkB,EAClB,SAAS,EACT,MAAM,EACN,aAAa,EACd,EAAE,cAAc,GAChB,OAAO,CAAC,kBAAkB,CAAC,CA4I7B;IAED;;;OAGG;IACI,cAAc,CACnB,IAAI,EAAE,YAAY,EAClB,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAE,kBAAmC,GACxD,OAAO,CAAC,sBAAsB,CAAC,CA6DjC;IAED;;;;;;;;;;;;OAYG;IACU,gBAAgB,CAC3B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA8B/B;IAED;;OAEG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAIjC;CACF"}
|
package/dest/pxe.js
CHANGED
|
@@ -20,7 +20,7 @@ import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
|
|
|
20
20
|
import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
|
|
21
21
|
import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
|
|
22
22
|
import { JobCoordinator } from './job_coordinator/job_coordinator.js';
|
|
23
|
-
import {
|
|
23
|
+
import { TxResolverService } from './messages/tx_resolver_service.js';
|
|
24
24
|
import { PrivateKernelExecutionProver } from './private_kernel/private_kernel_execution_prover.js';
|
|
25
25
|
import { PrivateKernelOracle } from './private_kernel/private_kernel_oracle.js';
|
|
26
26
|
import { openPxeStores } from './storage/open_pxe_stores.js';
|
|
@@ -30,20 +30,22 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
30
30
|
* manage private state of users.
|
|
31
31
|
*/ export class PXE {
|
|
32
32
|
node;
|
|
33
|
+
nodeDebug;
|
|
33
34
|
db;
|
|
34
35
|
blockStateSynchronizer;
|
|
35
36
|
keyStore;
|
|
36
37
|
contractStore;
|
|
37
38
|
noteStore;
|
|
38
39
|
capsuleStore;
|
|
40
|
+
factStore;
|
|
39
41
|
anchorBlockStore;
|
|
40
42
|
senderTaggingStore;
|
|
41
|
-
|
|
43
|
+
taggingSecretSourcesStore;
|
|
42
44
|
recipientTaggingStore;
|
|
43
45
|
addressStore;
|
|
44
46
|
privateEventStore;
|
|
45
47
|
contractSyncService;
|
|
46
|
-
|
|
48
|
+
txResolver;
|
|
47
49
|
l2TipsStore;
|
|
48
50
|
simulator;
|
|
49
51
|
proverEnabled;
|
|
@@ -56,22 +58,24 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
56
58
|
jobCoordinator;
|
|
57
59
|
debug;
|
|
58
60
|
hooks;
|
|
59
|
-
constructor(node, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore,
|
|
61
|
+
constructor(node, nodeDebug, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, factStore, anchorBlockStore, senderTaggingStore, taggingSecretSourcesStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, txResolver, l2TipsStore, simulator, proverEnabled, autoSync, proofCreator, protocolContractsProvider, preloadedContractsProvider, log, jobQueue, jobCoordinator, debug, hooks){
|
|
60
62
|
this.node = node;
|
|
63
|
+
this.nodeDebug = nodeDebug;
|
|
61
64
|
this.db = db;
|
|
62
65
|
this.blockStateSynchronizer = blockStateSynchronizer;
|
|
63
66
|
this.keyStore = keyStore;
|
|
64
67
|
this.contractStore = contractStore;
|
|
65
68
|
this.noteStore = noteStore;
|
|
66
69
|
this.capsuleStore = capsuleStore;
|
|
70
|
+
this.factStore = factStore;
|
|
67
71
|
this.anchorBlockStore = anchorBlockStore;
|
|
68
72
|
this.senderTaggingStore = senderTaggingStore;
|
|
69
|
-
this.
|
|
73
|
+
this.taggingSecretSourcesStore = taggingSecretSourcesStore;
|
|
70
74
|
this.recipientTaggingStore = recipientTaggingStore;
|
|
71
75
|
this.addressStore = addressStore;
|
|
72
76
|
this.privateEventStore = privateEventStore;
|
|
73
77
|
this.contractSyncService = contractSyncService;
|
|
74
|
-
this.
|
|
78
|
+
this.txResolver = txResolver;
|
|
75
79
|
this.l2TipsStore = l2TipsStore;
|
|
76
80
|
this.simulator = simulator;
|
|
77
81
|
this.proverEnabled = proverEnabled;
|
|
@@ -91,7 +95,7 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
91
95
|
* can be contacted.
|
|
92
96
|
*
|
|
93
97
|
* @returns A promise that resolves PXE is ready to be used.
|
|
94
|
-
*/ static async create({ node, store, proofCreator, simulator, protocolContractsProvider, preloadedContractsProvider, config, loggerOrSuffix, hooks }) {
|
|
98
|
+
*/ static async create({ node, nodeDebug, store, proofCreator, simulator, protocolContractsProvider, preloadedContractsProvider, config, loggerOrSuffix, hooks }) {
|
|
95
99
|
// Extract bindings from the logger, or use empty bindings if a string suffix is provided.
|
|
96
100
|
const bindings = loggerOrSuffix && typeof loggerOrSuffix !== 'string' ? loggerOrSuffix.getBindings() : undefined;
|
|
97
101
|
const log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:service:${loggerOrSuffix}` : `pxe:service`) : loggerOrSuffix;
|
|
@@ -104,10 +108,10 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
104
108
|
// not return a genesis block (older node or test fixture) we fall back to the static constant.
|
|
105
109
|
const initialBlockHash = (await node.getBlock(BlockNumber.ZERO))?.hash ?? GENESIS_BLOCK_HEADER_HASH;
|
|
106
110
|
const proverEnabled = config.proverEnabled !== undefined ? config.proverEnabled : info.realProofs;
|
|
107
|
-
const { addressStore, privateEventStore, contractStore, noteStore, anchorBlockStore, senderTaggingStore,
|
|
111
|
+
const { addressStore, privateEventStore, contractStore, noteStore, anchorBlockStore, senderTaggingStore, taggingSecretSourcesStore, recipientTaggingStore, capsuleStore, keyStore, l2TipsStore, factStore } = openPxeStores(store, initialBlockHash);
|
|
108
112
|
const contractSyncService = new ContractSyncService(node, contractStore, noteStore, createLogger('pxe:contract_sync', bindings));
|
|
109
|
-
const
|
|
110
|
-
const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, l2TipsStore, contractSyncService, config, bindings);
|
|
113
|
+
const txResolver = new TxResolverService(node);
|
|
114
|
+
const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, factStore, l2TipsStore, contractSyncService, config, bindings);
|
|
111
115
|
const jobCoordinator = new JobCoordinator(store, bindings);
|
|
112
116
|
jobCoordinator.registerStores([
|
|
113
117
|
capsuleStore,
|
|
@@ -115,11 +119,12 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
115
119
|
recipientTaggingStore,
|
|
116
120
|
privateEventStore,
|
|
117
121
|
noteStore,
|
|
122
|
+
factStore,
|
|
118
123
|
contractSyncService
|
|
119
124
|
]);
|
|
120
125
|
const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
|
|
121
126
|
const jobQueue = new SerialQueue();
|
|
122
|
-
const pxe = new PXE(node, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore,
|
|
127
|
+
const pxe = new PXE(node, nodeDebug, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, factStore, anchorBlockStore, senderTaggingStore, taggingSecretSourcesStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, txResolver, l2TipsStore, simulator, proverEnabled, config.autoSync, proofCreator, protocolContractsProvider, preloadedContractsProvider, log, jobQueue, jobCoordinator, debugUtils, hooks);
|
|
123
128
|
debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#executeUtility.bind(pxe));
|
|
124
129
|
pxe.jobQueue.start();
|
|
125
130
|
await Promise.all([
|
|
@@ -141,12 +146,13 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
141
146
|
l2TipsStore: this.l2TipsStore,
|
|
142
147
|
senderTaggingStore: this.senderTaggingStore,
|
|
143
148
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
144
|
-
|
|
149
|
+
taggingSecretSourcesStore: this.taggingSecretSourcesStore,
|
|
145
150
|
capsuleStore: this.capsuleStore,
|
|
151
|
+
factStore: this.factStore,
|
|
146
152
|
privateEventStore: this.privateEventStore,
|
|
147
153
|
simulator: this.simulator,
|
|
148
154
|
contractSyncService: this.contractSyncService,
|
|
149
|
-
|
|
155
|
+
txResolver: this.txResolver,
|
|
150
156
|
hooks: this.hooks
|
|
151
157
|
});
|
|
152
158
|
}
|
|
@@ -217,8 +223,6 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
217
223
|
try {
|
|
218
224
|
await this.contractSyncService.ensureContractSynced(contractAddress, functionSelector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
|
|
219
225
|
const result = await contractFunctionSimulator.run(txRequest, {
|
|
220
|
-
contractAddress,
|
|
221
|
-
selector: functionSelector,
|
|
222
226
|
anchorBlockHeader,
|
|
223
227
|
scopes,
|
|
224
228
|
jobId,
|
|
@@ -360,50 +364,98 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
360
364
|
return accountCompleteAddress;
|
|
361
365
|
}
|
|
362
366
|
/**
|
|
363
|
-
* Registers a
|
|
367
|
+
* Registers a source from which this PXE derives the tagging secrets it scans for to discover incoming private logs.
|
|
368
|
+
* See {@link TaggingSecretSource} for the meaning of each variant. Does nothing if the source is already registered.
|
|
364
369
|
*
|
|
365
|
-
* After
|
|
366
|
-
*
|
|
367
|
-
*
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
370
|
+
* After a new source is added we clear the cache tracking which contracts have finished syncing, so every contract
|
|
371
|
+
* re-syncs against the new source's logs (whose notes/events could belong to any contract). Already-discovered
|
|
372
|
+
* notes/events are not discarded.
|
|
373
|
+
*/ async registerTaggingSecretSource(source) {
|
|
374
|
+
let wasAdded;
|
|
375
|
+
switch(source.kind){
|
|
376
|
+
case 'address-derived':
|
|
377
|
+
wasAdded = await this.#registerSender(source.sender);
|
|
378
|
+
break;
|
|
379
|
+
case 'arbitrary-secret':
|
|
380
|
+
wasAdded = await this.#registerArbitrarySecret(source.recipient, source.secret);
|
|
381
|
+
break;
|
|
382
|
+
default:
|
|
383
|
+
{
|
|
384
|
+
const _ = source;
|
|
385
|
+
throw new Error('Unhandled tagging secret source kind');
|
|
386
|
+
}
|
|
379
387
|
}
|
|
380
|
-
const wasAdded = await this.senderAddressBookStore.addSender(sender);
|
|
381
388
|
if (wasAdded) {
|
|
382
|
-
|
|
383
|
-
// Wipe the entire sync cache: the new sender's tagged logs could contain notes/events for any contract, so
|
|
384
|
-
// all contracts must re-sync to discover them. Queued to avoid wiping while a job is in flight.
|
|
389
|
+
// Queued to avoid wiping while a job is in flight.
|
|
385
390
|
await this.#putInJobQueue(()=>Promise.resolve(this.contractSyncService.wipe()));
|
|
386
|
-
} else {
|
|
387
|
-
this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
|
|
388
391
|
}
|
|
389
|
-
return sender;
|
|
390
392
|
}
|
|
391
393
|
/**
|
|
392
|
-
*
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
394
|
+
* Removes a previously registered tagging secret source. Does nothing if it was not registered.
|
|
395
|
+
*/ async removeTaggingSecretSource(source) {
|
|
396
|
+
switch(source.kind){
|
|
397
|
+
case 'address-derived':
|
|
398
|
+
{
|
|
399
|
+
const { sender } = source;
|
|
400
|
+
const wasRemoved = await this.taggingSecretSourcesStore.removeSender(sender);
|
|
401
|
+
this.log.info(wasRemoved ? `Removed sender:\n ${sender.toString()}` : `Sender:\n "${sender.toString()}"\n not registered in PXE.`);
|
|
402
|
+
break;
|
|
403
|
+
}
|
|
404
|
+
case 'arbitrary-secret':
|
|
405
|
+
{
|
|
406
|
+
const { recipient, secret } = source;
|
|
407
|
+
const wasRemoved = await this.taggingSecretSourcesStore.removeSharedSecret(recipient, secret);
|
|
408
|
+
this.log.info(wasRemoved ? `Removed shared secret for recipient:\n ${recipient.toString()}` : `Shared secret not registered for recipient:\n ${recipient.toString()}`);
|
|
409
|
+
break;
|
|
410
|
+
}
|
|
411
|
+
default:
|
|
412
|
+
{
|
|
413
|
+
const _ = source;
|
|
414
|
+
throw new Error('Unhandled tagging secret source kind');
|
|
415
|
+
}
|
|
416
|
+
}
|
|
396
417
|
}
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
418
|
+
async getTaggingSecretSources(filter) {
|
|
419
|
+
const [senders, secrets] = await Promise.all([
|
|
420
|
+
this.taggingSecretSourcesStore.getSenders(),
|
|
421
|
+
this.taggingSecretSourcesStore.getAllSharedSecrets()
|
|
422
|
+
]);
|
|
423
|
+
const sources = [
|
|
424
|
+
...senders.map((sender)=>({
|
|
425
|
+
kind: 'address-derived',
|
|
426
|
+
sender
|
|
427
|
+
})),
|
|
428
|
+
...secrets.map(({ recipient, secret })=>({
|
|
429
|
+
kind: 'arbitrary-secret',
|
|
430
|
+
recipient,
|
|
431
|
+
secret
|
|
432
|
+
}))
|
|
433
|
+
];
|
|
434
|
+
return filter?.kind ? sources.filter((source)=>source.kind === filter.kind) : sources;
|
|
435
|
+
}
|
|
436
|
+
/** Registers a sender, skipping addresses that belong to a local account. Returns whether it was newly added. */ async #registerSender(address) {
|
|
437
|
+
if (!await address.isValid()) {
|
|
438
|
+
throw new Error(`Address ${address} is not valid: it does not correspond to a point on the Grumpkin curve. Cannot register it as a sender.`);
|
|
439
|
+
}
|
|
440
|
+
const accounts = await this.keyStore.getAccounts();
|
|
441
|
+
if (accounts.some((a)=>a.equals(address))) {
|
|
442
|
+
this.log.info(`Sender:\n "${address.toString()}"\n already registered.`);
|
|
443
|
+
return false;
|
|
444
|
+
}
|
|
445
|
+
const wasAdded = await this.taggingSecretSourcesStore.addSender(address);
|
|
446
|
+
this.log.info(wasAdded ? `Added sender:\n ${address.toString()}` : `Sender:\n "${address.toString()}"\n already registered.`);
|
|
447
|
+
return wasAdded;
|
|
448
|
+
}
|
|
449
|
+
/** Registers a directly-provided shared secret scoped to a recipient. Returns whether it was newly added. */ async #registerArbitrarySecret(recipient, secret) {
|
|
450
|
+
if (!await recipient.isValid()) {
|
|
451
|
+
throw new Error(`Recipient ${recipient} is not valid: it does not correspond to a point on the Grumpkin curve. Cannot register a shared secret for it.`);
|
|
452
|
+
}
|
|
453
|
+
if (secret.isZero() || !secret.isOnCurve()) {
|
|
454
|
+
throw new Error(`Shared secret ${secret} is not a valid non-zero point on the Grumpkin curve.`);
|
|
406
455
|
}
|
|
456
|
+
const wasAdded = await this.taggingSecretSourcesStore.addSharedSecret(recipient, secret);
|
|
457
|
+
this.log.info(wasAdded ? `Added shared secret for recipient:\n ${recipient.toString()}` : `Shared secret already registered for recipient:\n ${recipient.toString()}`);
|
|
458
|
+
return wasAdded;
|
|
407
459
|
}
|
|
408
460
|
/**
|
|
409
461
|
* Retrieves the user accounts registered on this PXE.
|
|
@@ -446,7 +498,7 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
446
498
|
await this.contractStore.addContractArtifact(artifact, contractClass);
|
|
447
499
|
const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
|
|
448
500
|
if (publicFunctionSignatures.length > 0) {
|
|
449
|
-
await this.
|
|
501
|
+
await this.nodeDebug?.registerContractFunctionSignatures(publicFunctionSignatures);
|
|
450
502
|
}
|
|
451
503
|
} else {
|
|
452
504
|
// Otherwise, make sure there is an artifact already registered for that class id
|
|
@@ -483,7 +535,7 @@ import { persistSenderTaggingIndexRangesForTx } from './tagging/index.js';
|
|
|
483
535
|
}
|
|
484
536
|
const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
|
|
485
537
|
if (publicFunctionSignatures.length > 0) {
|
|
486
|
-
await this.
|
|
538
|
+
await this.nodeDebug?.registerContractFunctionSignatures(publicFunctionSignatures);
|
|
487
539
|
}
|
|
488
540
|
currentInstance.currentContractClassId = contractClass.id;
|
|
489
541
|
await Promise.all([
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
|
+
/**
|
|
3
|
+
* Asserts that `scope` is one of `allowedScopes`, throwing otherwise.
|
|
4
|
+
*/
|
|
5
|
+
export declare function assertAllowedScope(scope: AztecAddress, allowedScopes: AztecAddress[]): void;
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxsb3dlZF9zY29wZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL2FsbG93ZWRfc2NvcGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUUzRDs7R0FFRztBQUNILHdCQUFnQixrQkFBa0IsQ0FBQyxLQUFLLEVBQUUsWUFBWSxFQUFFLGFBQWEsRUFBRSxZQUFZLEVBQUUsR0FBRyxJQUFJLENBUTNGIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"allowed_scopes.d.ts","sourceRoot":"","sources":["../../src/storage/allowed_scopes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,GAAG,IAAI,CAQ3F"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Asserts that `scope` is one of `allowedScopes`, throwing otherwise.
|
|
3
|
+
*/ export function assertAllowedScope(scope, allowedScopes) {
|
|
4
|
+
if (!allowedScopes.some((allowed)=>allowed.equals(scope))) {
|
|
5
|
+
throw new Error(`Scope ${scope.toString()} is not in the allowed scopes list: [${allowedScopes.map((s)=>s.toString()).join(', ')}]. See https://docs.aztec.network/errors/10`);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
@@ -12,4 +12,4 @@ export type SchemaTest = {
|
|
|
12
12
|
snapshotStore: (kvStore: AztecAsyncKVStore) => Promise<Record<string, unknown>>;
|
|
13
13
|
};
|
|
14
14
|
export declare const SCHEMA_TESTS: readonly SchemaTest[];
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZW1hX3Rlc3RzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9iYWNrd2FyZHNfY29tcGF0aWJpbGl0eV90ZXN0cy9zY2hlbWFfdGVzdHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUUEsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQXlDekQ7Ozs7OztHQU1HO0FBQ0gsTUFBTSxNQUFNLFVBQVUsR0FBRztJQUN2QixJQUFJLEVBQUUsTUFBTSxDQUFDO0lBQ2IsWUFBWSxFQUFFLENBQUMsT0FBTyxFQUFFLGlCQUFpQixLQUFLLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUM1RCxhQUFhLEVBQUUsQ0FBQyxPQUFPLEVBQUUsaUJBQWlCLEtBQUssT0FBTyxDQUFDLE1BQU0sQ0FBQyxNQUFNLEVBQUUsT0FBTyxDQUFDLENBQUMsQ0FBQztDQUNqRixDQUFDO0FBRUYsZUFBTyxNQUFNLFlBQVksRUFBRSxTQUFTLFVBQVUsRUEwakI3QyxDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema_tests.d.ts","sourceRoot":"","sources":["../../../src/storage/backwards_compatibility_tests/schema_tests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema_tests.d.ts","sourceRoot":"","sources":["../../../src/storage/backwards_compatibility_tests/schema_tests.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAyCzD;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,aAAa,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACjF,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EA0jB7C,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* eslint-disable camelcase */ import { CONTRACT_CLASS_LOG_SIZE_IN_FIELDS, PRIVATE_LOG_SIZE_IN_FIELDS } from '@aztec/constants';
|
|
2
2
|
import { BlockNumber, CheckpointNumber, IndexWithinCheckpoint, SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import { Point } from '@aztec/foundation/curves/grumpkin';
|
|
4
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
6
|
import { KeyStore } from '@aztec/key-store';
|
|
6
7
|
import { L2TipsKVStore } from '@aztec/kv-store/stores';
|
|
@@ -21,9 +22,11 @@ import { AddressStore } from '../address_store/address_store.js';
|
|
|
21
22
|
import { AnchorBlockStore } from '../anchor_block_store/index.js';
|
|
22
23
|
import { CapsuleStore } from '../capsule_store/capsule_store.js';
|
|
23
24
|
import { ContractStore } from '../contract_store/contract_store.js';
|
|
25
|
+
import { FactStore } from '../fact_store/fact_store.js';
|
|
26
|
+
import { FactCollectionKey } from '../fact_store/fact_store_keys.js';
|
|
24
27
|
import { NoteStore } from '../note_store/note_store.js';
|
|
25
28
|
import { PrivateEventStore } from '../private_event_store/private_event_store.js';
|
|
26
|
-
import { RecipientTaggingStore,
|
|
29
|
+
import { RecipientTaggingStore, SenderTaggingStore, TaggingSecretSourcesStore } from '../tagging_store/index.js';
|
|
27
30
|
import { snapshotArray, snapshotMap, snapshotSingleton } from './kv_store_snapshot.js';
|
|
28
31
|
export const SCHEMA_TESTS = [
|
|
29
32
|
{
|
|
@@ -51,7 +54,7 @@ export const SCHEMA_TESTS = [
|
|
|
51
54
|
const anchorBlockStore = new AnchorBlockStore(kvStore);
|
|
52
55
|
// Each primitive field gets a distinct prime so any reorder shows up in the snapshot diff. An all-zero
|
|
53
56
|
// `BlockHeader.empty()` would silently pass through same-width field swaps.
|
|
54
|
-
await anchorBlockStore.setHeader(new BlockHeader(new AppendOnlyTreeSnapshot(new Fr(2n), 3), new StateReference(new AppendOnlyTreeSnapshot(new Fr(5n), 7), new PartialStateReference(new AppendOnlyTreeSnapshot(new Fr(11n), 13), new AppendOnlyTreeSnapshot(new Fr(17n), 19), new AppendOnlyTreeSnapshot(new Fr(23n), 29))), new Fr(31n), new GlobalVariables(new Fr(37n), new Fr(41n), BlockNumber(43), SlotNumber(47), 53n, EthAddress.fromField(new Fr(59n)), AztecAddress.
|
|
57
|
+
await anchorBlockStore.setHeader(new BlockHeader(new AppendOnlyTreeSnapshot(new Fr(2n), 3), new StateReference(new AppendOnlyTreeSnapshot(new Fr(5n), 7), new PartialStateReference(new AppendOnlyTreeSnapshot(new Fr(11n), 13), new AppendOnlyTreeSnapshot(new Fr(17n), 19), new AppendOnlyTreeSnapshot(new Fr(23n), 29))), new Fr(31n), new GlobalVariables(new Fr(37n), new Fr(41n), BlockNumber(43), SlotNumber(47), 53n, EthAddress.fromField(new Fr(59n)), AztecAddress.fromBigIntUnsafe(61n), new GasFees(67n, 71n)), new Fr(73n), new Fr(79n)));
|
|
55
58
|
},
|
|
56
59
|
snapshotStore: async (kvStore)=>({
|
|
57
60
|
header: await snapshotSingleton(kvStore.openSingleton('header'))
|
|
@@ -62,8 +65,8 @@ export const SCHEMA_TESTS = [
|
|
|
62
65
|
writeToStore: async (kvStore)=>{
|
|
63
66
|
const capsuleStore = new CapsuleStore(kvStore);
|
|
64
67
|
const jobId = 'fixture-job';
|
|
65
|
-
const contractAddress = AztecAddress.
|
|
66
|
-
const scope = AztecAddress.
|
|
68
|
+
const contractAddress = AztecAddress.fromBigIntUnsafe(2n);
|
|
69
|
+
const scope = AztecAddress.fromBigIntUnsafe(3n);
|
|
67
70
|
// Three setCapsule calls (2-element, 1-element, 0-element value vector) pin every value-encoding length case.
|
|
68
71
|
capsuleStore.setCapsule(contractAddress, new Fr(5n), [
|
|
69
72
|
new Fr(7n),
|
|
@@ -127,7 +130,7 @@ export const SCHEMA_TESTS = [
|
|
|
127
130
|
await contractStore.addContractInstance(new SerializableContractInstance({
|
|
128
131
|
version: 2,
|
|
129
132
|
salt: new Fr(73n),
|
|
130
|
-
deployer: AztecAddress.
|
|
133
|
+
deployer: AztecAddress.fromBigIntUnsafe(79n),
|
|
131
134
|
currentContractClassId: new Fr(83n),
|
|
132
135
|
originalContractClassId: new Fr(89n),
|
|
133
136
|
initializationHash: new Fr(97n),
|
|
@@ -136,7 +139,7 @@ export const SCHEMA_TESTS = [
|
|
|
136
139
|
// are exposed as `hash_public_key` digests. Constructor signature is
|
|
137
140
|
// `(npkMHash, ivpkM, ovpkMHash, tpkMHash, mspkMHash, fbpkMHash)`.
|
|
138
141
|
publicKeys: new PublicKeys(new Fr(41n), new PublicKey(new Fr(47n), new Fr(53n)), new Fr(59n), new Fr(67n), new Fr(71n), new Fr(73n))
|
|
139
|
-
}).withAddress(AztecAddress.
|
|
142
|
+
}).withAddress(AztecAddress.fromBigIntUnsafe(101n)));
|
|
140
143
|
},
|
|
141
144
|
snapshotStore: async (kvStore)=>({
|
|
142
145
|
contract_artifacts: await snapshotMap(kvStore.openMap('contract_artifacts')),
|
|
@@ -144,6 +147,49 @@ export const SCHEMA_TESTS = [
|
|
|
144
147
|
contracts_instances: await snapshotMap(kvStore.openMap('contracts_instances'))
|
|
145
148
|
})
|
|
146
149
|
},
|
|
150
|
+
{
|
|
151
|
+
name: 'FactStore',
|
|
152
|
+
writeToStore: async (kvStore)=>{
|
|
153
|
+
const factStore = new FactStore(kvStore);
|
|
154
|
+
const jobId = 'fixture-job';
|
|
155
|
+
const contract = AztecAddress.fromBigIntUnsafe(100n);
|
|
156
|
+
const scope = AztecAddress.fromBigIntUnsafe(1n);
|
|
157
|
+
const factCollectionTypeId = new Fr(7n);
|
|
158
|
+
const keyA = FactCollectionKey.from({
|
|
159
|
+
contractAddress: contract,
|
|
160
|
+
scope,
|
|
161
|
+
factCollectionTypeId,
|
|
162
|
+
factCollectionId: new Fr(0xaan)
|
|
163
|
+
});
|
|
164
|
+
const keyB = FactCollectionKey.from({
|
|
165
|
+
contractAddress: contract,
|
|
166
|
+
scope,
|
|
167
|
+
factCollectionTypeId,
|
|
168
|
+
factCollectionId: new Fr(0xbbn)
|
|
169
|
+
});
|
|
170
|
+
// A collection whose only fact is retractable (origin block 6): pruned on a reorg above block 6.
|
|
171
|
+
await factStore.recordFact(keyA, new Fr(3n), [
|
|
172
|
+
new Fr(5n)
|
|
173
|
+
], {
|
|
174
|
+
blockNumber: 6,
|
|
175
|
+
blockHash: new Fr(2n)
|
|
176
|
+
}, jobId);
|
|
177
|
+
// A collection with a non-retractable and a retractable fact.
|
|
178
|
+
await factStore.recordFact(keyB, new Fr(1n), [
|
|
179
|
+
new Fr(9n)
|
|
180
|
+
], undefined, jobId);
|
|
181
|
+
await factStore.recordFact(keyB, new Fr(2n), [], {
|
|
182
|
+
blockNumber: 5,
|
|
183
|
+
blockHash: new Fr(1n)
|
|
184
|
+
}, jobId);
|
|
185
|
+
await kvStore.transactionAsync(()=>factStore.commit(jobId));
|
|
186
|
+
},
|
|
187
|
+
snapshotStore: async (kvStore)=>({
|
|
188
|
+
facts: await snapshotMap(kvStore.openMap('facts')),
|
|
189
|
+
facts_by_collection: await snapshotMap(kvStore.openMultiMap('facts_by_collection')),
|
|
190
|
+
facts_by_block: await snapshotMap(kvStore.openMultiMap('facts_by_block'))
|
|
191
|
+
})
|
|
192
|
+
},
|
|
147
193
|
{
|
|
148
194
|
name: 'KeyStore',
|
|
149
195
|
writeToStore: async (kvStore)=>{
|
|
@@ -159,7 +205,7 @@ export const SCHEMA_TESTS = [
|
|
|
159
205
|
writeToStore: async (kvStore)=>{
|
|
160
206
|
const l2TipsStore = new L2TipsKVStore(kvStore, 'pxe', GENESIS_BLOCK_HEADER_HASH);
|
|
161
207
|
const block = buildL2Block();
|
|
162
|
-
const publishedCheckpoint = new PublishedCheckpoint(new Checkpoint(new AppendOnlyTreeSnapshot(new Fr(2n), 3), new CheckpointHeader(new Fr(5n), new Fr(7n), new Fr(11n), new Fr(13n), new Fr(17n), SlotNumber(19), 23n, EthAddress.fromField(new Fr(29n)), AztecAddress.
|
|
208
|
+
const publishedCheckpoint = new PublishedCheckpoint(new Checkpoint(new AppendOnlyTreeSnapshot(new Fr(2n), 3), new CheckpointHeader(new Fr(5n), new Fr(7n), new Fr(11n), new Fr(13n), new Fr(17n), SlotNumber(19), 23n, EthAddress.fromField(new Fr(29n)), AztecAddress.fromBigIntUnsafe(31n), new GasFees(37n, 41n), new Fr(43n), new Fr(47n)), [
|
|
163
209
|
block
|
|
164
210
|
], CheckpointNumber(47), 53n), new L1PublishedData(59n, 61n, new Fr(67n).toString()), []);
|
|
165
211
|
// `'blocks-added'` writes to `pxe_l2_tips` (proposed tag) and `pxe_l2_block_hashes`.
|
|
@@ -176,7 +222,10 @@ export const SCHEMA_TESTS = [
|
|
|
176
222
|
number: BlockNumber(71),
|
|
177
223
|
hash: new Fr(73n).toString()
|
|
178
224
|
},
|
|
179
|
-
checkpoint:
|
|
225
|
+
checkpoint: {
|
|
226
|
+
number: publishedCheckpoint.checkpoint.number,
|
|
227
|
+
hash: publishedCheckpoint.checkpoint.hash().toString()
|
|
228
|
+
}
|
|
180
229
|
});
|
|
181
230
|
// `'chain-proven'` writes the 'proven' tag. `'finalized'` is omitted because its handler runs delete-before
|
|
182
231
|
// logic that would depend on the order of preceding events.
|
|
@@ -205,30 +254,30 @@ export const SCHEMA_TESTS = [
|
|
|
205
254
|
const jobId = 'fixture-job';
|
|
206
255
|
// Two contracts so `note_nullifiers_by_contract` exhibits both a multi-value row (contractA → {n1, n2}) and a
|
|
207
256
|
// single-value row (contractB → {n3}).
|
|
208
|
-
const contractA = AztecAddress.
|
|
209
|
-
const contractB = AztecAddress.
|
|
210
|
-
const scopeX = AztecAddress.
|
|
211
|
-
const scopeY = AztecAddress.
|
|
257
|
+
const contractA = AztecAddress.fromBigIntUnsafe(2n);
|
|
258
|
+
const contractB = AztecAddress.fromBigIntUnsafe(3n);
|
|
259
|
+
const scopeX = AztecAddress.fromBigIntUnsafe(5n);
|
|
260
|
+
const scopeY = AztecAddress.fromBigIntUnsafe(7n);
|
|
212
261
|
// note1: active, will be added under two scopes to exercise the multi-element scopes vector encoding in
|
|
213
262
|
// `StoredNote.toBuffer`.
|
|
214
263
|
const note1 = new NoteDao(new Note([
|
|
215
264
|
new Fr(13n),
|
|
216
265
|
new Fr(17n),
|
|
217
266
|
new Fr(19n)
|
|
218
|
-
]), contractA, AztecAddress.
|
|
267
|
+
]), contractA, AztecAddress.fromBigIntUnsafe(23n), new Fr(29n), new Fr(31n), new Fr(37n), new Fr(41n), new Fr(43n), TxHash.fromField(new Fr(47n)), BlockNumber(53), new Fr(59n).toString(), 61, 67);
|
|
219
268
|
// note2: same contract as note1 → produces the multi-value row in `note_nullifiers_by_contract`.
|
|
220
269
|
const note2 = new NoteDao(new Note([
|
|
221
270
|
new Fr(71n),
|
|
222
271
|
new Fr(73n),
|
|
223
272
|
new Fr(79n)
|
|
224
|
-
]), contractA, AztecAddress.
|
|
273
|
+
]), contractA, AztecAddress.fromBigIntUnsafe(83n), new Fr(89n), new Fr(97n), new Fr(101n), new Fr(103n), new Fr(107n), TxHash.fromField(new Fr(109n)), BlockNumber(113), new Fr(127n).toString(), 131, 137);
|
|
225
274
|
// note3: different contract; will be nullified to populate `note_nullifications_by_nullifier` and exercise the
|
|
226
275
|
// append-only nullification record written by `applyNullifiers`.
|
|
227
276
|
const note3 = new NoteDao(new Note([
|
|
228
277
|
new Fr(139n),
|
|
229
278
|
new Fr(149n),
|
|
230
279
|
new Fr(151n)
|
|
231
|
-
]), contractB, AztecAddress.
|
|
280
|
+
]), contractB, AztecAddress.fromBigIntUnsafe(157n), new Fr(163n), new Fr(167n), new Fr(173n), new Fr(179n), new Fr(181n), TxHash.fromField(new Fr(191n)), BlockNumber(193), new Fr(197n).toString(), 199, 211);
|
|
232
281
|
// Adding note1 twice with different scopes triggers `addScope` on the staged StoredNote, producing a 2-element
|
|
233
282
|
// scope vector in the committed buffer.
|
|
234
283
|
await noteStore.addNotes([
|
|
@@ -269,12 +318,12 @@ export const SCHEMA_TESTS = [
|
|
|
269
318
|
const jobId = 'fixture-job';
|
|
270
319
|
// Two (contract, selector) pairs and two block numbers so each multimap exhibits both a multi-value row
|
|
271
320
|
// (contractA/selectorA → {e1, e2} and blockN1 → {e1, e2}) and a contrasting single-value row.
|
|
272
|
-
const contractA = AztecAddress.
|
|
273
|
-
const contractB = AztecAddress.
|
|
321
|
+
const contractA = AztecAddress.fromBigIntUnsafe(2n);
|
|
322
|
+
const contractB = AztecAddress.fromBigIntUnsafe(3n);
|
|
274
323
|
const selectorA = EventSelector.fromField(new Fr(5n));
|
|
275
324
|
const selectorB = EventSelector.fromField(new Fr(7n));
|
|
276
|
-
const scopeX = AztecAddress.
|
|
277
|
-
const scopeY = AztecAddress.
|
|
325
|
+
const scopeX = AztecAddress.fromBigIntUnsafe(11n);
|
|
326
|
+
const scopeY = AztecAddress.fromBigIntUnsafe(13n);
|
|
278
327
|
const blockN1 = BlockNumber(17);
|
|
279
328
|
const blockN2 = BlockNumber(19);
|
|
280
329
|
// event1: rich fixture. Re-stored under scopeY below to exercise the `addScope` branch and produce a 2-element
|
|
@@ -348,8 +397,8 @@ export const SCHEMA_TESTS = [
|
|
|
348
397
|
writeToStore: async (kvStore)=>{
|
|
349
398
|
const recipientTaggingStore = new RecipientTaggingStore(kvStore);
|
|
350
399
|
const jobId = 'fixture-job';
|
|
351
|
-
const secretA = new AppTaggingSecret(new Fr(2n), AztecAddress.
|
|
352
|
-
const secretB = new AppTaggingSecret(new Fr(5n), AztecAddress.
|
|
400
|
+
const secretA = new AppTaggingSecret(new Fr(2n), AztecAddress.fromBigIntUnsafe(3n));
|
|
401
|
+
const secretB = new AppTaggingSecret(new Fr(5n), AztecAddress.fromBigIntUnsafe(7n));
|
|
353
402
|
await recipientTaggingStore.updateHighestFinalizedIndex(secretA, 11, jobId);
|
|
354
403
|
await recipientTaggingStore.updateHighestAgedIndex(secretA, 13, jobId);
|
|
355
404
|
await recipientTaggingStore.updateHighestFinalizedIndex(secretB, 17, jobId);
|
|
@@ -361,15 +410,19 @@ export const SCHEMA_TESTS = [
|
|
|
361
410
|
})
|
|
362
411
|
},
|
|
363
412
|
{
|
|
364
|
-
name: '
|
|
413
|
+
name: 'TaggingSecretSourcesStore',
|
|
365
414
|
writeToStore: async (kvStore)=>{
|
|
366
|
-
const
|
|
367
|
-
await
|
|
368
|
-
await
|
|
369
|
-
await
|
|
415
|
+
const taggingSecretSourcesStore = new TaggingSecretSourcesStore(kvStore);
|
|
416
|
+
await taggingSecretSourcesStore.addSender(AztecAddress.fromBigIntUnsafe(2n));
|
|
417
|
+
await taggingSecretSourcesStore.addSender(AztecAddress.fromBigIntUnsafe(3n));
|
|
418
|
+
await taggingSecretSourcesStore.addSender(AztecAddress.fromBigIntUnsafe(5n));
|
|
419
|
+
await taggingSecretSourcesStore.addSharedSecret(AztecAddress.fromBigIntUnsafe(7n), new Point(new Fr(2n), new Fr(3n)));
|
|
420
|
+
await taggingSecretSourcesStore.addSharedSecret(AztecAddress.fromBigIntUnsafe(7n), new Point(new Fr(5n), new Fr(7n)));
|
|
421
|
+
await taggingSecretSourcesStore.addSharedSecret(AztecAddress.fromBigIntUnsafe(11n), new Point(new Fr(13n), new Fr(17n)));
|
|
370
422
|
},
|
|
371
423
|
snapshotStore: async (kvStore)=>({
|
|
372
|
-
|
|
424
|
+
senders: await snapshotMap(kvStore.openMap('senders')),
|
|
425
|
+
recipient_shared_secrets: await snapshotMap(kvStore.openMultiMap('recipient_shared_secrets'))
|
|
373
426
|
})
|
|
374
427
|
},
|
|
375
428
|
{
|
|
@@ -377,9 +430,9 @@ export const SCHEMA_TESTS = [
|
|
|
377
430
|
writeToStore: async (kvStore)=>{
|
|
378
431
|
const senderTaggingStore = new SenderTaggingStore(kvStore);
|
|
379
432
|
const jobId = 'fixture-job';
|
|
380
|
-
const secretA = new AppTaggingSecret(new Fr(2n), AztecAddress.
|
|
381
|
-
const secretB = new AppTaggingSecret(new Fr(5n), AztecAddress.
|
|
382
|
-
const secretC = new AppTaggingSecret(new Fr(11n), AztecAddress.
|
|
433
|
+
const secretA = new AppTaggingSecret(new Fr(2n), AztecAddress.fromBigIntUnsafe(3n));
|
|
434
|
+
const secretB = new AppTaggingSecret(new Fr(5n), AztecAddress.fromBigIntUnsafe(7n));
|
|
435
|
+
const secretC = new AppTaggingSecret(new Fr(11n), AztecAddress.fromBigIntUnsafe(13n));
|
|
383
436
|
const txHashA = TxHash.fromBigInt(17n);
|
|
384
437
|
const txHashB = TxHash.fromBigInt(19n);
|
|
385
438
|
const txHashC = TxHash.fromBigInt(23n);
|
|
@@ -462,7 +515,7 @@ export const SCHEMA_TESTS = [
|
|
|
462
515
|
* We use distinct values to make a snapshot diff sensitive to regressions of specific fields, and same-width reorders.
|
|
463
516
|
*/ function buildL2Block() {
|
|
464
517
|
const archive = new AppendOnlyTreeSnapshot(new Fr(101n), 103);
|
|
465
|
-
const header = new BlockHeader(new AppendOnlyTreeSnapshot(new Fr(107n), 109), new StateReference(new AppendOnlyTreeSnapshot(new Fr(113n), 127), new PartialStateReference(new AppendOnlyTreeSnapshot(new Fr(131n), 137), new AppendOnlyTreeSnapshot(new Fr(139n), 149), new AppendOnlyTreeSnapshot(new Fr(151n), 157))), new Fr(163n), new GlobalVariables(new Fr(167n), new Fr(173n), BlockNumber(179), SlotNumber(181), 191n, EthAddress.fromField(new Fr(193n)), AztecAddress.
|
|
518
|
+
const header = new BlockHeader(new AppendOnlyTreeSnapshot(new Fr(107n), 109), new StateReference(new AppendOnlyTreeSnapshot(new Fr(113n), 127), new PartialStateReference(new AppendOnlyTreeSnapshot(new Fr(131n), 137), new AppendOnlyTreeSnapshot(new Fr(139n), 149), new AppendOnlyTreeSnapshot(new Fr(151n), 157))), new Fr(163n), new GlobalVariables(new Fr(167n), new Fr(173n), BlockNumber(179), SlotNumber(181), 191n, EthAddress.fromField(new Fr(193n)), AztecAddress.fromBigIntUnsafe(197n), new GasFees(199n, 211n)), new Fr(223n), new Fr(227n));
|
|
466
519
|
const txEffect = new TxEffect(RevertCode.REVERTED, TxHash.fromBigInt(229n), new Fr(233n), [
|
|
467
520
|
new Fr(239n)
|
|
468
521
|
], [
|
|
@@ -478,12 +531,12 @@ export const SCHEMA_TESTS = [
|
|
|
478
531
|
277n
|
|
479
532
|
], PRIVATE_LOG_SIZE_IN_FIELDS), 3)
|
|
480
533
|
], [
|
|
481
|
-
new PublicLog(AztecAddress.
|
|
534
|
+
new PublicLog(AztecAddress.fromBigIntUnsafe(281n), [
|
|
482
535
|
new Fr(283n),
|
|
483
536
|
new Fr(293n)
|
|
484
537
|
])
|
|
485
538
|
], [
|
|
486
|
-
new ContractClassLog(AztecAddress.
|
|
539
|
+
new ContractClassLog(AztecAddress.fromBigIntUnsafe(307n), new ContractClassLogFields(paddedFrs([
|
|
487
540
|
311n,
|
|
488
541
|
313n,
|
|
489
542
|
317n
|
|
@@ -18,4 +18,4 @@ export declare class CapsuleService {
|
|
|
18
18
|
readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, jobId: string, scope: AztecAddress): Promise<Fr[][]>;
|
|
19
19
|
setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string, scope: AztecAddress): Promise<void>;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fwc3VsZV9zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9jYXBzdWxlX3N0b3JlL2NhcHN1bGVfc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPL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BTSxFQUNiLEtBQUssRUFBRSxZQUFZLEdBQ2xCLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FHZjtJQUVELG9CQUFvQixDQUNsQixlQUFlLEVBQUUsWUFBWSxFQUM3QixRQUFRLEVBQUUsRUFBRSxFQUNaLE9BQU8sRUFBRSxFQUFFLEVBQUUsRUFBRSxFQUNmLEtBQUssRUFBRSxNQUFNLEVBQ2IsS0FBSyxFQUFFLFlBQVksR0FDbEIsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUdmO0lBRUQsZ0JBQWdCLENBQUMsZUFBZSxFQUFFLFlBQVksRUFBRSxRQUFRLEVBQUUsRUFBRSxFQUFFLEtBQUssRUFBRSxNQUFNLEVBQUUsS0FBSyxFQUFFLFlBQVksR0FBRyxPQUFPLENBQUMsRUFBRSxFQUFFLEVBQUUsQ0FBQyxDQUdqSDtJQUVELGVBQWUsQ0FBQyxlQUFlLEVBQUUsWUFBWSxFQUFFLFFBQVEsRUFBRSxFQUFFLEVBQUUsT0FBTyxFQUFFLEVBQUUsRUFBRSxFQUFFLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsWUFBWSxpQkFHL0c7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capsule_service.d.ts","sourceRoot":"","sources":["../../../src/storage/capsule_store/capsule_service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"capsule_service.d.ts","sourceRoot":"","sources":["../../../src/storage/capsule_store/capsule_service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6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