@aztec/pxe 0.0.1-commit.3100065 → 0.0.1-commit.330febf
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/bin/check_oracle_version.js +5 -46
- package/dest/bin/index.d.ts +2 -2
- package/dest/bin/index.d.ts.map +1 -1
- package/dest/bin/index.js +1 -1
- package/dest/bin/oracle_version_helpers.d.ts +8 -39
- package/dest/bin/oracle_version_helpers.d.ts.map +1 -1
- package/dest/bin/oracle_version_helpers.js +10 -239
- package/dest/block_synchronizer/block_synchronizer.d.ts +3 -5
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +5 -18
- package/dest/config/package_info.js +1 -1
- package/dest/contract/contract_class_service.d.ts +1 -8
- package/dest/contract/contract_class_service.d.ts.map +1 -1
- package/dest/contract/contract_class_service.js +8 -40
- package/dest/contract/helpers.d.ts +1 -1
- package/dest/contract/helpers.d.ts.map +1 -1
- package/dest/contract/helpers.js +3 -3
- package/dest/contract/skip_sync_contracts.d.ts +11 -0
- package/dest/contract/skip_sync_contracts.d.ts.map +1 -0
- package/dest/contract/skip_sync_contracts.js +18 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +1 -8
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +5 -20
- package/dest/contract_function_simulator/index.d.ts +3 -3
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -2
- package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts +7 -9
- package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/resolved_tx.js +3 -44
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.js +2 -2
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +4 -3
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_registry.js +15 -6
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +87 -35
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +297 -287
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +11 -8
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +15 -4
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +168 -53
- 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 +10 -4
- 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 +10 -4
- 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 +42 -0
- package/dest/entrypoints/server/index.d.ts +2 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -0
- 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/events/event_service.d.ts +13 -6
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +13 -13
- package/dest/logs/log_service.d.ts +15 -6
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +25 -32
- package/dest/messages/tx_resolver_service.d.ts +18 -7
- package/dest/messages/tx_resolver_service.d.ts.map +1 -1
- package/dest/messages/tx_resolver_service.js +13 -7
- package/dest/node/benchmarked_node.d.ts +20 -0
- package/dest/node/benchmarked_node.d.ts.map +1 -0
- package/dest/node/benchmarked_node.js +94 -0
- package/dest/node/caching_aztec_node.d.ts +24 -0
- package/dest/node/caching_aztec_node.d.ts.map +1 -0
- package/dest/node/caching_aztec_node.js +267 -0
- package/dest/notes/note_service.d.ts +13 -7
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +10 -10
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +5 -5
- package/dest/private_kernel/batch_planner.d.ts +1 -1
- package/dest/private_kernel/batch_planner.d.ts.map +1 -1
- package/dest/private_kernel/batch_planner.js +1 -1
- 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 +45 -5
- package/dest/pxe.d.ts +1 -1
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +39 -19
- package/dest/storage/contract_store/contract_store.d.ts +1 -1
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +2 -2
- 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 -2
- package/dest/storage/fact_store/index.d.ts.map +1 -1
- package/dest/storage/fact_store/index.js +1 -1
- package/dest/storage/fact_store/origin_state.d.ts +4 -2
- package/dest/storage/fact_store/origin_state.d.ts.map +1 -1
- package/dest/storage/fact_store/origin_state.js +8 -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 +41 -10
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +81 -29
- package/dest/tagging/constants.d.ts +10 -1
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +19 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts +29 -8
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
- package/dest/tagging/get_all_logs_by_tags.js +29 -10
- package/dest/tagging/index.d.ts +3 -3
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +2 -2
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +10 -5
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.js +69 -38
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +6 -3
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +23 -38
- package/dest/tagging/sender_sync/utils/classify_pending_txs.d.ts +22 -0
- package/dest/tagging/sender_sync/utils/classify_pending_txs.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/classify_pending_txs.js +61 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +15 -5
- 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 +36 -35
- package/dest/tagging/sender_sync/utils/resolve_pending_txs.d.ts +29 -0
- package/dest/tagging/sender_sync/utils/resolve_pending_txs.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/resolve_pending_txs.js +41 -0
- package/dest/tagging/sender_sync/utils/test_utils.d.ts +16 -0
- package/dest/tagging/sender_sync/utils/test_utils.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/test_utils.js +24 -0
- package/dest/tagging/testing/tag_query_test_utils.d.ts +6 -0
- package/dest/tagging/testing/tag_query_test_utils.d.ts.map +1 -0
- package/dest/tagging/testing/tag_query_test_utils.js +10 -0
- package/package.json +17 -17
- package/src/bin/check_oracle_version.ts +5 -56
- package/src/bin/index.ts +1 -5
- package/src/bin/oracle_version_helpers.ts +11 -292
- package/src/block_synchronizer/block_synchronizer.ts +6 -23
- package/src/config/package_info.ts +1 -1
- package/src/contract/contract_class_service.ts +8 -46
- package/src/contract/helpers.ts +3 -3
- package/src/contract/skip_sync_contracts.ts +23 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +5 -20
- package/src/contract_function_simulator/index.ts +23 -3
- package/src/contract_function_simulator/noir-structs/resolved_tx.ts +11 -45
- package/src/contract_function_simulator/noir-structs/tx_effect_data.ts +4 -3
- package/src/contract_function_simulator/oracle/oracle_registry.ts +12 -8
- package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +301 -198
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +19 -9
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +184 -56
- package/src/entrypoints/client/bundle/index.ts +1 -0
- package/src/entrypoints/client/bundle/utils.ts +15 -3
- package/src/entrypoints/client/lazy/index.ts +1 -0
- package/src/entrypoints/client/lazy/utils.ts +15 -3
- package/src/entrypoints/client/store.ts +54 -0
- package/src/entrypoints/server/index.ts +1 -0
- package/src/entrypoints/server/store.ts +47 -0
- package/src/entrypoints/server/utils.ts +21 -7
- package/src/events/event_service.ts +24 -14
- package/src/logs/log_service.ts +41 -39
- package/src/messages/tx_resolver_service.ts +26 -15
- package/src/node/benchmarked_node.ts +140 -0
- package/src/node/caching_aztec_node.ts +406 -0
- package/src/notes/note_service.ts +20 -14
- package/src/oracle_version.ts +5 -5
- package/src/private_kernel/batch_planner.ts +0 -1
- package/src/private_kernel/private_kernel_execution_prover.ts +90 -4
- package/src/pxe.ts +40 -21
- package/src/storage/contract_store/contract_store.ts +2 -1
- package/src/storage/fact_store/fact_store.ts +1 -1
- package/src/storage/fact_store/index.ts +1 -0
- package/src/storage/fact_store/origin_state.ts +10 -1
- package/src/storage/store_identity.ts +72 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +113 -41
- package/src/tagging/constants.ts +22 -0
- package/src/tagging/get_all_logs_by_tags.ts +47 -11
- package/src/tagging/index.ts +7 -2
- package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +116 -62
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +27 -57
- package/src/tagging/sender_sync/utils/classify_pending_txs.ts +91 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +46 -40
- package/src/tagging/sender_sync/utils/resolve_pending_txs.ts +64 -0
- package/src/tagging/sender_sync/utils/test_utils.ts +46 -0
- package/src/tagging/testing/tag_query_test_utils.ts +11 -0
- package/dest/contract_function_simulator/aztec_node_read_cache.d.ts +0 -39
- package/dest/contract_function_simulator/aztec_node_read_cache.d.ts.map +0 -1
- package/dest/contract_function_simulator/aztec_node_read_cache.js +0 -60
- package/dest/contract_function_simulator/benchmarked_node.d.ts +0 -9
- package/dest/contract_function_simulator/benchmarked_node.d.ts.map +0 -1
- package/dest/contract_function_simulator/benchmarked_node.js +0 -77
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +0 -17
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +0 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +0 -60
- package/src/contract_function_simulator/aztec_node_read_cache.ts +0 -89
- package/src/contract_function_simulator/benchmarked_node.ts +0 -103
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +0 -66
|
@@ -93,4 +93,4 @@ export declare class ContractStore {
|
|
|
93
93
|
getDebugFunctionName(contractClassId: Fr, selector: FunctionSelector): Promise<string>;
|
|
94
94
|
getFunctionCall(functionName: string, args: any[], to: AztecAddress, contractClassId: Fr): Promise<FunctionCall>;
|
|
95
95
|
}
|
|
96
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
96
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3Rfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2NvbnRyYWN0X3N0b3JlL2NvbnRyYWN0X3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDN0QsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRXBELE9BQU8sRUFBRSxZQUFZLEVBQWlDLE1BQU0sNkJBQTZCLENBQUM7QUFDMUYsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBaUIsTUFBTSxpQkFBaUIsQ0FBQztBQUN4RSxPQUFPLEVBQ0wsS0FBSyxnQkFBZ0IsRUFDckIsS0FBSyxnQ0FBZ0MsRUFDckMsWUFBWSxFQUNaLEtBQUsscUJBQXFCLEVBQzFCLGdCQUFnQixFQVNqQixNQUFNLG1CQUFtQixDQUFDO0FBQzNCLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUMzRCxPQUFPLEVBQ0wsS0FBSyx1QkFBdUIsRUFDNUIsS0FBSyxtQkFBbUIsRUFDeEIsS0FBSyxtQ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,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAO5C;IAEY,8BAA8B,CAAC,eAAe,EAAE,EAAE,GAAG,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CAI3G;IAED;;;;;;OAMG;IACU,4BAA4B,CACvC,eAAe,EAAE,EAAE,EACnB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,iBAAiB,CAAC,OAAO,oBAAoB,CAAC,GAAG,SAAS,CAAC,CAGrE;IAEY,oBAAoB,CAAC,eAAe,EAAE,EAAE,+BAGpD;IAEY,oBAAoB,CAAC,eAAe,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,mBAIhF;IAEY,eAAe,CAC1B,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,GAAG,EAAE,EACX,EAAE,EAAE,YAAY,EAChB,eAAe,EAAE,EAAE,GAClB,OAAO,CAAC,YAAY,CAAC,CA0BvB;CACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import { toArray } from '@aztec/foundation/iterable';
|
|
3
3
|
import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import { FunctionCall, FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, findFunctionAbiBySelector, findFunctionArtifactBySelector, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
|
|
4
|
+
import { FunctionCall, FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, findFunctionAbiBySelector, findFunctionArtifactBySelector, getFunctionDebugMetadata, getFunctionReturnType } from '@aztec/stdlib/abi';
|
|
5
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
6
|
import { SerializableContractInstancePreimage, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
7
7
|
import { PrivateFunctionsTree } from './private_functions_tree.js';
|
|
@@ -262,7 +262,7 @@ const VERSION = 1;
|
|
|
262
262
|
hideMsgSender: false,
|
|
263
263
|
isStatic: functionDao.isStatic,
|
|
264
264
|
args: encodeArguments(functionDao, args),
|
|
265
|
-
|
|
265
|
+
returnType: getFunctionReturnType(functionDao)
|
|
266
266
|
});
|
|
267
267
|
}
|
|
268
268
|
}
|
|
@@ -42,7 +42,7 @@ export declare class FactStore implements StagedStore {
|
|
|
42
42
|
logger: import("@aztec/foundation/log").Logger;
|
|
43
43
|
constructor(store: AztecAsyncKVStore);
|
|
44
44
|
/**
|
|
45
|
-
* Records a fact in a collection
|
|
45
|
+
* Records a fact in a collection.
|
|
46
46
|
*
|
|
47
47
|
* The collection is created implicitly on the first fact recorded for its key: recording into an existing collection
|
|
48
48
|
* just adds to it.
|
|
@@ -46,7 +46,7 @@ import { StoredFact, factKeyStrOf } from './stored_fact.js';
|
|
|
46
46
|
this.#jobLocks = new Map();
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
|
-
* Records a fact in a collection
|
|
49
|
+
* Records a fact in a collection.
|
|
50
50
|
*
|
|
51
51
|
* The collection is created implicitly on the first fact recorded for its key: recording into an existing collection
|
|
52
52
|
* just adds to it.
|
|
@@ -2,5 +2,5 @@ export { FactStore, type FactCollection } from './fact_store.js';
|
|
|
2
2
|
export { FactService } from './fact_service.js';
|
|
3
3
|
export { FactCollectionKey, FactCollectionTypeKey, type OriginBlock } from './fact_store_keys.js';
|
|
4
4
|
export type { Fact } from './stored_fact.js';
|
|
5
|
-
export { OriginBlockState, classifyOriginBlockState, anchoredTipBlockNumbers, toFactWithOriginState, type TipBlockNumbers, type RetractableFactOrigin, type FactWithOriginState, type FactCollectionWithOriginState, } from './origin_state.js';
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
export { OriginBlockState, classifyOriginBlockState, originBlockStateFromNumber, anchoredTipBlockNumbers, toFactWithOriginState, type TipBlockNumbers, type RetractableFactOrigin, type FactWithOriginState, type FactCollectionWithOriginState, } from './origin_state.js';
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2ZhY3Rfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLGNBQWMsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ2pFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNoRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUscUJBQXFCLEVBQUUsS0FBSyxXQUFXLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRyxZQUFZLEVBQUUsSUFBSSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDN0MsT0FBTyxFQUNMLGdCQUFnQixFQUNoQix3QkFBd0IsRUFDeEIsMEJBQTBCLEVBQzFCLHVCQUF1QixFQUN2QixxQkFBcUIsRUFDckIsS0FBSyxlQUFlLEVBQ3BCLEtBQUsscUJBQXFCLEVBQzFCLEtBQUssbUJBQW1CLEVBQ3hCLEtBQUssNkJBQTZCLEdBQ25DLE1BQU0sbUJBQW1CLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/fact_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAClG,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,GACnC,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/fact_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAClG,YAAY,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACL,gBAAgB,EAChB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,KAAK,eAAe,EACpB,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,GACnC,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { FactStore } from './fact_store.js';
|
|
2
2
|
export { FactService } from './fact_service.js';
|
|
3
3
|
export { FactCollectionKey, FactCollectionTypeKey } from './fact_store_keys.js';
|
|
4
|
-
export { OriginBlockState, classifyOriginBlockState, anchoredTipBlockNumbers, toFactWithOriginState } from './origin_state.js';
|
|
4
|
+
export { OriginBlockState, classifyOriginBlockState, originBlockStateFromNumber, anchoredTipBlockNumbers, toFactWithOriginState } from './origin_state.js';
|
|
@@ -10,7 +10,7 @@ import type { Fact } from './stored_fact.js';
|
|
|
10
10
|
* - `Finalized`: L1-finalized.
|
|
11
11
|
*
|
|
12
12
|
* The numeric discriminants must stay in sync with the Noir `OriginBlockState` in
|
|
13
|
-
* `noir-projects/aztec-nr/aztec/src/facts/origin_state.nr`: PXE serializes this value into the `Fact` oracle response
|
|
13
|
+
* `noir-projects/labs/aztec-nr/aztec/src/facts/origin_state.nr`: PXE serializes this value into the `Fact` oracle response
|
|
14
14
|
* and Noir deserializes it via `from_u8`, which rejects any value outside this set.
|
|
15
15
|
*/
|
|
16
16
|
export declare enum OriginBlockState {
|
|
@@ -18,6 +18,8 @@ export declare enum OriginBlockState {
|
|
|
18
18
|
Proven = 2,
|
|
19
19
|
Finalized = 3
|
|
20
20
|
}
|
|
21
|
+
/** Parses a numeric origin-block-state discriminant, rejecting unknown values. */
|
|
22
|
+
export declare function originBlockStateFromNumber(value: number): OriginBlockState;
|
|
21
23
|
/** The two chain-tip block numbers needed to classify an origin block (`finalized <= proven` always holds). */
|
|
22
24
|
export type TipBlockNumbers = {
|
|
23
25
|
provenBlockNumber: number;
|
|
@@ -54,4 +56,4 @@ export type FactCollectionWithOriginState = {
|
|
|
54
56
|
export declare function classifyOriginBlockState(blockNumber: number, tips: TipBlockNumbers): OriginBlockState;
|
|
55
57
|
/** Enriches a stored fact with the chain state of its origin block (when retractable). */
|
|
56
58
|
export declare function toFactWithOriginState(fact: Fact, tips: TipBlockNumbers): FactWithOriginState;
|
|
57
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
59
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JpZ2luX3N0YXRlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9mYWN0X3N0b3JlL29yaWdpbl9zdGF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUN6RCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUVsRCxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBRSxXQUFXLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUM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E,CAAC;IAAC,OAAO,EAAE,EAAE,EAAE,CAAC;IAAC,WAAW,EAAE,qBAAqB,GAAG,SAAS,CAAA;CAAE,CAAC;AAEpH,8DAA8D;AAC9D,MAAM,MAAM,6BAA6B,GAAG;IAAE,GAAG,EAAE,iBAAiB,CAAC;IAAC,KAAK,EAAE,mBAAmB,EAAE,CAAA;CAAE,CAAC;AAErG;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,eAAe,GAAG,gBAAgB,CAQrG;AAED,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,eAAe,GAAG,mBAAmB,CAS5F"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - `Finalized`: L1-finalized.
|
|
7
7
|
*
|
|
8
8
|
* The numeric discriminants must stay in sync with the Noir `OriginBlockState` in
|
|
9
|
-
* `noir-projects/aztec-nr/aztec/src/facts/origin_state.nr`: PXE serializes this value into the `Fact` oracle response
|
|
9
|
+
* `noir-projects/labs/aztec-nr/aztec/src/facts/origin_state.nr`: PXE serializes this value into the `Fact` oracle response
|
|
10
10
|
* and Noir deserializes it via `from_u8`, which rejects any value outside this set.
|
|
11
11
|
*/ export var OriginBlockState = /*#__PURE__*/ function(OriginBlockState) {
|
|
12
12
|
OriginBlockState[OriginBlockState["Pending"] = 1] = "Pending";
|
|
@@ -14,6 +14,13 @@
|
|
|
14
14
|
OriginBlockState[OriginBlockState["Finalized"] = 3] = "Finalized";
|
|
15
15
|
return OriginBlockState;
|
|
16
16
|
}({});
|
|
17
|
+
/** Parses a numeric origin-block-state discriminant, rejecting unknown values. */ export function originBlockStateFromNumber(value) {
|
|
18
|
+
if (!(value in OriginBlockState)) {
|
|
19
|
+
const validNames = Object.keys(OriginBlockState).filter((k)=>isNaN(Number(k)));
|
|
20
|
+
throw new Error(`Invalid OriginBlockState value ${value}, expected one of ${validNames.join(', ')}`);
|
|
21
|
+
}
|
|
22
|
+
return value;
|
|
23
|
+
}
|
|
17
24
|
/**
|
|
18
25
|
* Projects the live chain tips to the block numbers used for classification, capped at the anchor block.
|
|
19
26
|
*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
3
|
+
/** The triple that determine which physical store a logical store name maps to. */
|
|
4
|
+
export type StoreIdentity = {
|
|
5
|
+
/** Chain ID of the L1 the rollup is deployed to. */
|
|
6
|
+
l1ChainId: number;
|
|
7
|
+
/** Address of the rollup contract the store's data pertains to. */
|
|
8
|
+
rollupAddress: EthAddress;
|
|
9
|
+
/** Schema version of the data held in the store. */
|
|
10
|
+
schemaVersion: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Composes the store-name discriminator for a store identity. Two identities map to the same physical store iff
|
|
14
|
+
* their slugs are equal, so the format must stay stable: `<l1ChainId>-<rollupAddress>-v<schemaVersion>` — changing
|
|
15
|
+
* it orphans every existing store.
|
|
16
|
+
*/
|
|
17
|
+
export declare function storeIdentitySlug({ l1ChainId, rollupAddress, schemaVersion }: StoreIdentity): string;
|
|
18
|
+
/** Composes the physical store name for a logical store name and identity. */
|
|
19
|
+
export declare function effectiveStoreName(name: string, identity: StoreIdentity): string;
|
|
20
|
+
/**
|
|
21
|
+
* Invariant check for stores whose physical name carries their identity: the recorded version can
|
|
22
|
+
* only disagree with the expected one if there is a store-naming bug.
|
|
23
|
+
*/
|
|
24
|
+
export declare function assertStoreIdentity(store: AztecAsyncKVStore, storeName: string, identity: StoreIdentity): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Thrown when a store's recorded identity does not match the identity it was opened under. Since the identity is
|
|
27
|
+
* part of the physical store name, this can only indicate a store-naming bug; the store is left untouched.
|
|
28
|
+
*/
|
|
29
|
+
export declare class StoreIdentityMismatchError extends Error {
|
|
30
|
+
readonly storeName: string;
|
|
31
|
+
readonly expected: string;
|
|
32
|
+
readonly actual: string;
|
|
33
|
+
constructor(storeName: string, expected: string, actual: string);
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmVfaWRlbnRpdHkuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL3N0b3JlX2lkZW50aXR5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFHekQsbUZBQW1GO0FBQ25GLE1BQU0sTUFBTSxhQUFhLEdBQUc7SUFDMUIsb0RBQW9EO0lBQ3BELFNBQVMsRUFBRSxNQUFNLENBQUM7SUFDbEIsbUVBQW1FO0lBQ25FLGFBQWEsRUFBRSxVQUFVLENBQUM7SUFDMUIsb0RBQW9EO0lBQ3BELGFBQWEsRUFBRSxNQUFNLENBQUM7Q0FDdkIsQ0FBQztBQUVGOzs7O0dBSUc7QUFDSCx3QkFBZ0IsaUJBQWlCLENBQUMsRUFBRSxTQUFTLEVBQUUsYUFBYSxFQUFFLGFBQWEsRUFBRSxFQUFFLGFBQWEsR0FBRyxNQUFNLENBRXBHO0FBRUQsOEVBQThFO0FBQzlFLHdCQUFnQixrQkFBa0IsQ0FBQyxJQUFJLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxhQUFhLEdBQUcsTUFBTSxDQUVoRjtBQUVEOzs7R0FHRztBQUNILHdCQUFzQixtQkFBbUIsQ0FDdkMsS0FBSyxFQUFFLGlCQUFpQixFQUN4QixTQUFTLEVBQUUsTUFBTSxFQUNqQixRQUFRLEVBQUUsYUFBYSxHQUN0QixPQUFPLENBQUMsSUFBSSxDQUFDL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MAAM,EACjB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EAO/B;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { DatabaseVersion } from '@aztec/stdlib/database-version/version';
|
|
2
|
+
/**
|
|
3
|
+
* Composes the store-name discriminator for a store identity. Two identities map to the same physical store iff
|
|
4
|
+
* their slugs are equal, so the format must stay stable: `<l1ChainId>-<rollupAddress>-v<schemaVersion>` — changing
|
|
5
|
+
* it orphans every existing store.
|
|
6
|
+
*/ export function storeIdentitySlug({ l1ChainId, rollupAddress, schemaVersion }) {
|
|
7
|
+
return `${l1ChainId}-${rollupAddress.toString()}-v${schemaVersion}`;
|
|
8
|
+
}
|
|
9
|
+
/** Composes the physical store name for a logical store name and identity. */ export function effectiveStoreName(name, identity) {
|
|
10
|
+
return `${name}_${storeIdentitySlug(identity)}`;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Invariant check for stores whose physical name carries their identity: the recorded version can
|
|
14
|
+
* only disagree with the expected one if there is a store-naming bug.
|
|
15
|
+
*/ export async function assertStoreIdentity(store, storeName, identity) {
|
|
16
|
+
const expected = new DatabaseVersion(identity.schemaVersion, identity.rollupAddress);
|
|
17
|
+
const singleton = store.openSingleton('dbVersion');
|
|
18
|
+
const stored = await singleton.getAsync();
|
|
19
|
+
if (stored === undefined) {
|
|
20
|
+
await singleton.set(expected.toBuffer().toString('utf-8'));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
let storedVersion;
|
|
24
|
+
try {
|
|
25
|
+
storedVersion = DatabaseVersion.fromBuffer(Buffer.from(stored, 'utf-8'));
|
|
26
|
+
} catch {
|
|
27
|
+
throw new StoreIdentityMismatchError(storeName, expected.toString(), stored);
|
|
28
|
+
}
|
|
29
|
+
if (!storedVersion.equals(expected)) {
|
|
30
|
+
throw new StoreIdentityMismatchError(storeName, expected.toString(), storedVersion.toString());
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Thrown when a store's recorded identity does not match the identity it was opened under. Since the identity is
|
|
35
|
+
* part of the physical store name, this can only indicate a store-naming bug; the store is left untouched.
|
|
36
|
+
*/ export class StoreIdentityMismatchError extends Error {
|
|
37
|
+
storeName;
|
|
38
|
+
expected;
|
|
39
|
+
actual;
|
|
40
|
+
constructor(storeName, expected, actual){
|
|
41
|
+
super(`Store '${storeName}' records identity ${actual} but was opened as ${expected}. ` + `Refusing to open; data was NOT modified.`), this.storeName = storeName, this.expected = expected, this.actual = actual;
|
|
42
|
+
this.name = 'StoreIdentityMismatchError';
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -2,6 +2,11 @@ import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
|
2
2
|
import { AppTaggingSecret, type TaggingIndexRange } from '@aztec/stdlib/logs';
|
|
3
3
|
import { TxEffect, TxHash } from '@aztec/stdlib/tx';
|
|
4
4
|
import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
|
|
5
|
+
/** A tx still awaiting finalization, and the highest tagging index it used for one secret. */
|
|
6
|
+
export type PendingTx = {
|
|
7
|
+
txHash: string;
|
|
8
|
+
highestIndex: number;
|
|
9
|
+
};
|
|
5
10
|
/**
|
|
6
11
|
* Data provider of tagging data used when syncing the sender tagging indexes. The recipient counterpart of this class
|
|
7
12
|
* is called RecipientTaggingStore. We have the data stores separate for sender and recipient because
|
|
@@ -19,10 +24,11 @@ export declare class SenderTaggingStore implements StagedStore {
|
|
|
19
24
|
commit(jobId: string): Promise<void>;
|
|
20
25
|
discardStaged(jobId: string): Promise<void>;
|
|
21
26
|
/**
|
|
22
|
-
* Stores pending index ranges.
|
|
27
|
+
* Stores pending index ranges, rejecting any range that disagrees with an already-stored one.
|
|
23
28
|
* @remarks If the same (secret, txHash) pair already exists in the db with an equal range, it's a no-op. This is
|
|
24
29
|
* expected to happen because whenever we start sync we start from the last finalized index and we can have pending
|
|
25
|
-
* ranges already stored from previous syncs. If the ranges differ, it throws an error as that indicates a bug
|
|
30
|
+
* ranges already stored from previous syncs. If the ranges differ, it throws an error as that indicates a bug in
|
|
31
|
+
* callers that record indexes at prove time. Discovery from onchain logs must use `mergePendingIndexes` instead.
|
|
26
32
|
* @param ranges - The tagging index ranges containing the directional app tagging secrets and the index ranges that are
|
|
27
33
|
* to be stored in the db.
|
|
28
34
|
* @param txHash - The tx in which the tagging indexes were used in private logs.
|
|
@@ -33,16 +39,30 @@ export declare class SenderTaggingStore implements StagedStore {
|
|
|
33
39
|
*/
|
|
34
40
|
storePendingIndexes(ranges: TaggingIndexRange[], txHash: TxHash, jobId: string): Promise<void>;
|
|
35
41
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
42
|
+
* Stores pending index ranges, widening an existing entry for the same (secret, txHash) pair to the union of the
|
|
43
|
+
* stored and incoming ranges instead of throwing on a mismatch. Discovery from onchain logs needs this: it may see
|
|
44
|
+
* only the surviving (non-revertible phase) sub-range of a partially reverted tx recorded at prove time (the
|
|
45
|
+
* finalized receipt step of the sync resolves that difference), or indexes beyond a partially discovered entry
|
|
46
|
+
* when a tx from another PXE straddles a sync window boundary. Callers that record indexes at prove time must use
|
|
47
|
+
* `storePendingIndexes` instead, so that a range disagreement surfaces as a bug rather than being absorbed.
|
|
48
|
+
* @param ranges - The tagging index ranges containing the directional app tagging secrets and the index ranges that are
|
|
49
|
+
* to be stored in the db.
|
|
50
|
+
* @param txHash - The tx in which the tagging indexes were used in private logs.
|
|
51
|
+
* @param jobId - job context for staged writes to this store. See `JobCoordinator` for more details.
|
|
52
|
+
* @throws If the highestIndex is further than window length from the highest finalized index for the same secret.
|
|
53
|
+
* @throws If the lowestIndex is lower than or equal to the last finalized index for the same secret.
|
|
54
|
+
*/
|
|
55
|
+
mergePendingIndexes(ranges: TaggingIndexRange[], txHash: TxHash, jobId: string): Promise<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Returns the pending txs whose highest index falls within [startIndex, endIndex) for a given directional app
|
|
58
|
+
* tagging secret. The highest index is what decides whether a tx belongs to the window, so it alone is matched
|
|
59
|
+
* against the bounds, and it is also the only index a caller needs: a tx whose highest index is onchain has every
|
|
60
|
+
* lower one onchain too. A secret holds at most one entry per tx hash, so no tx hash appears twice in the result.
|
|
39
61
|
* @param secret - The directional app tagging secret to query pending indexes for.
|
|
40
62
|
* @param startIndex - The lower bound of the index range (inclusive).
|
|
41
63
|
* @param endIndex - The upper bound of the index range (exclusive).
|
|
42
|
-
* @returns An array of unique transaction hashes for pending transactions that contain indexes in the range
|
|
43
|
-
* [startIndex, endIndex). Returns an empty array if no pending indexes exist in the range.
|
|
44
64
|
*/
|
|
45
|
-
|
|
65
|
+
getPendingTxs(secret: AppTaggingSecret, startIndex: number, endIndex: number, jobId: string): Promise<PendingTx[]>;
|
|
46
66
|
/**
|
|
47
67
|
* Returns the last (highest) finalized index for a given secret.
|
|
48
68
|
* @param secret - The secret to get the last finalized index for.
|
|
@@ -62,9 +82,18 @@ export declare class SenderTaggingStore implements StagedStore {
|
|
|
62
82
|
dropPendingIndexes(txHashes: TxHash[], jobId: string): Promise<void>;
|
|
63
83
|
/**
|
|
64
84
|
* Updates pending indexes corresponding to the given transaction hashes to be finalized and prunes any lower pending
|
|
65
|
-
* indexes.
|
|
85
|
+
* indexes. Applies to every secret the txs used, so the caller must hold tx-level evidence that the whole tx
|
|
86
|
+
* finalized. Callers holding evidence about a single secret must use {@link finalizePendingIndexesOfSecret} instead.
|
|
66
87
|
*/
|
|
67
88
|
finalizePendingIndexes(txHashes: TxHash[], jobId: string): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Same as {@link finalizePendingIndexes}, but restricted to the pending indexes of a single secret.
|
|
91
|
+
*
|
|
92
|
+
* Finalizing every secret off single-secret evidence would be unsound: a tx whose execution partially reverted can
|
|
93
|
+
* have all of one secret's tags onchain and none of another's, and the second secret's indexes must not be recorded
|
|
94
|
+
* as finalized when they never reached the chain.
|
|
95
|
+
*/
|
|
96
|
+
finalizePendingIndexesOfSecret(secret: AppTaggingSecret, txHashes: TxHash[], jobId: string): Promise<void>;
|
|
68
97
|
/**
|
|
69
98
|
* Handles finalization of pending indexes for a transaction whose execution was partially reverted.
|
|
70
99
|
* Recomputes the siloed tags for each pending index of the given tx and checks which ones appear in the
|
|
@@ -75,4 +104,6 @@ export declare class SenderTaggingStore implements StagedStore {
|
|
|
75
104
|
*/
|
|
76
105
|
finalizePendingIndexesOfAPartiallyRevertedTx(txEffect: TxEffect, jobId: string): Promise<void>;
|
|
77
106
|
}
|
|
78
|
-
|
|
107
|
+
/** Builds the error thrown when a pending tag index is at or past the unfinalized tagging window end. */
|
|
108
|
+
export declare function windowExceededError(highestIndex: number, windowEnd: number, finalizedIndex: number | undefined): Error;
|
|
109
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZGVyX3RhZ2dpbmdfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL3RhZ2dpbmdfc3RvcmUvc2VuZGVyX3RhZ2dpbmdfc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFDeEUsT0FBTyxFQUFFLGdCQUFnQixFQUFhLEtBQUssaUJBQWlCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUN6RixPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRXBELE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLDBDQUEwQyxDQUFDO0FBRzVFLDhGQUE4RjtBQUM5RixNQUFNLE1BQU0sU0FBUyxHQUFHO0lBQUUsTUFBTSxFQUFFLE1BQU0sQ0FBQztJQUFDLFlBQVksRUFBRSxNQUFNLENBQUE7Q0FBRSx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{ UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/constants.js';
|
|
2
|
+
import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN, unfinalizedTaggingIndexesWindowEnd } from '../../tagging/constants.js';
|
|
4
3
|
/**
|
|
5
4
|
* Data provider of tagging data used when syncing the sender tagging indexes. The recipient counterpart of this class
|
|
6
5
|
* is called RecipientTaggingStore. We have the data stores separate for sender and recipient because
|
|
@@ -100,10 +99,11 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/constants.
|
|
|
100
99
|
return Promise.resolve();
|
|
101
100
|
}
|
|
102
101
|
/**
|
|
103
|
-
* Stores pending index ranges.
|
|
102
|
+
* Stores pending index ranges, rejecting any range that disagrees with an already-stored one.
|
|
104
103
|
* @remarks If the same (secret, txHash) pair already exists in the db with an equal range, it's a no-op. This is
|
|
105
104
|
* expected to happen because whenever we start sync we start from the last finalized index and we can have pending
|
|
106
|
-
* ranges already stored from previous syncs. If the ranges differ, it throws an error as that indicates a bug
|
|
105
|
+
* ranges already stored from previous syncs. If the ranges differ, it throws an error as that indicates a bug in
|
|
106
|
+
* callers that record indexes at prove time. Discovery from onchain logs must use `mergePendingIndexes` instead.
|
|
107
107
|
* @param ranges - The tagging index ranges containing the directional app tagging secrets and the index ranges that are
|
|
108
108
|
* to be stored in the db.
|
|
109
109
|
* @param txHash - The tx in which the tagging indexes were used in private logs.
|
|
@@ -112,6 +112,25 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/constants.
|
|
|
112
112
|
* @throws If the lowestIndex is lower than or equal to the last finalized index for the same secret.
|
|
113
113
|
* @throws If a different range already exists for the same (secret, txHash) pair.
|
|
114
114
|
*/ storePendingIndexes(ranges, txHash, jobId) {
|
|
115
|
+
return this.#storePendingIndexes(ranges, txHash, jobId, false);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Stores pending index ranges, widening an existing entry for the same (secret, txHash) pair to the union of the
|
|
119
|
+
* stored and incoming ranges instead of throwing on a mismatch. Discovery from onchain logs needs this: it may see
|
|
120
|
+
* only the surviving (non-revertible phase) sub-range of a partially reverted tx recorded at prove time (the
|
|
121
|
+
* finalized receipt step of the sync resolves that difference), or indexes beyond a partially discovered entry
|
|
122
|
+
* when a tx from another PXE straddles a sync window boundary. Callers that record indexes at prove time must use
|
|
123
|
+
* `storePendingIndexes` instead, so that a range disagreement surfaces as a bug rather than being absorbed.
|
|
124
|
+
* @param ranges - The tagging index ranges containing the directional app tagging secrets and the index ranges that are
|
|
125
|
+
* to be stored in the db.
|
|
126
|
+
* @param txHash - The tx in which the tagging indexes were used in private logs.
|
|
127
|
+
* @param jobId - job context for staged writes to this store. See `JobCoordinator` for more details.
|
|
128
|
+
* @throws If the highestIndex is further than window length from the highest finalized index for the same secret.
|
|
129
|
+
* @throws If the lowestIndex is lower than or equal to the last finalized index for the same secret.
|
|
130
|
+
*/ mergePendingIndexes(ranges, txHash, jobId) {
|
|
131
|
+
return this.#storePendingIndexes(ranges, txHash, jobId, true);
|
|
132
|
+
}
|
|
133
|
+
#storePendingIndexes(ranges, txHash, jobId, mergeExisting) {
|
|
115
134
|
if (ranges.length === 0) {
|
|
116
135
|
return Promise.resolve();
|
|
117
136
|
}
|
|
@@ -132,11 +151,9 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/constants.
|
|
|
132
151
|
})));
|
|
133
152
|
// Process in memory and validate
|
|
134
153
|
for (const { range, secretStr, pendingData, finalizedIndex } of rangeData){
|
|
135
|
-
|
|
136
|
-
if (range.highestIndex
|
|
137
|
-
throw
|
|
138
|
-
Tagging window length ${UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN} is configured too low. Contact the Aztec team
|
|
139
|
-
to increase it!`);
|
|
154
|
+
const windowEnd = unfinalizedTaggingIndexesWindowEnd(finalizedIndex);
|
|
155
|
+
if (range.highestIndex >= windowEnd) {
|
|
156
|
+
throw windowExceededError(range.highestIndex, windowEnd, finalizedIndex);
|
|
140
157
|
}
|
|
141
158
|
// Throw if the lowest index is lower than or equal to the last finalized index
|
|
142
159
|
if (finalizedIndex !== undefined && range.lowestIndex <= finalizedIndex) {
|
|
@@ -144,39 +161,57 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/constants.
|
|
|
144
161
|
}
|
|
145
162
|
// Check if an entry with the same txHash already exists
|
|
146
163
|
const existingEntry = pendingData.find((entry)=>entry.txHash === txHashStr);
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
throw new Error(`Conflicting range for secret ${secretStr} and txHash ${txHashStr}: ` + `existing [${existingEntry.lowestIndex}, ${existingEntry.highestIndex}] vs ` + `new [${range.lowestIndex}, ${range.highestIndex}]`);
|
|
151
|
-
}
|
|
152
|
-
// Exact duplicate — skip
|
|
153
|
-
} else {
|
|
154
|
-
this.#writePendingIndexes(jobId, secretStr, [
|
|
164
|
+
let updatedPending;
|
|
165
|
+
if (!existingEntry) {
|
|
166
|
+
updatedPending = [
|
|
155
167
|
...pendingData,
|
|
156
168
|
{
|
|
157
169
|
lowestIndex: range.lowestIndex,
|
|
158
170
|
highestIndex: range.highestIndex,
|
|
159
171
|
txHash: txHashStr
|
|
160
172
|
}
|
|
161
|
-
]
|
|
173
|
+
];
|
|
174
|
+
} else if (mergeExisting) {
|
|
175
|
+
// Widen the entry to the union of both ranges, never shrink it: replacing would drop prove-time
|
|
176
|
+
// indexes the chain doesn't show (partially reverted tx), and skipping would drop onchain indexes
|
|
177
|
+
// discovered in a later sync window (tx straddling the window boundary).
|
|
178
|
+
const lowestIndex = Math.min(existingEntry.lowestIndex, range.lowestIndex);
|
|
179
|
+
const highestIndex = Math.max(existingEntry.highestIndex, range.highestIndex);
|
|
180
|
+
if (lowestIndex !== existingEntry.lowestIndex || highestIndex !== existingEntry.highestIndex) {
|
|
181
|
+
updatedPending = pendingData.map((entry)=>entry === existingEntry ? {
|
|
182
|
+
lowestIndex,
|
|
183
|
+
highestIndex,
|
|
184
|
+
txHash: entry.txHash
|
|
185
|
+
} : entry);
|
|
186
|
+
}
|
|
187
|
+
} else if (existingEntry.lowestIndex !== range.lowestIndex || existingEntry.highestIndex !== range.highestIndex) {
|
|
188
|
+
// Different ranges for the same (secret, txHash) indicate a bug in callers that record indexes at prove
|
|
189
|
+
// time.
|
|
190
|
+
throw new Error(`Conflicting range for secret ${secretStr} and txHash ${txHashStr}: ` + `existing [${existingEntry.lowestIndex}, ${existingEntry.highestIndex}] vs ` + `new [${range.lowestIndex}, ${range.highestIndex}]`);
|
|
191
|
+
}
|
|
192
|
+
// Remaining cases (a merge whose union equals the stored range, or an identical range without
|
|
193
|
+
// mergeExisting): duplicate evidence, nothing to write.
|
|
194
|
+
if (updatedPending) {
|
|
195
|
+
this.#writePendingIndexes(jobId, secretStr, updatedPending);
|
|
162
196
|
}
|
|
163
197
|
}
|
|
164
198
|
});
|
|
165
199
|
}
|
|
166
200
|
/**
|
|
167
|
-
* Returns the
|
|
168
|
-
*
|
|
169
|
-
*
|
|
201
|
+
* Returns the pending txs whose highest index falls within [startIndex, endIndex) for a given directional app
|
|
202
|
+
* tagging secret. The highest index is what decides whether a tx belongs to the window, so it alone is matched
|
|
203
|
+
* against the bounds, and it is also the only index a caller needs: a tx whose highest index is onchain has every
|
|
204
|
+
* lower one onchain too. A secret holds at most one entry per tx hash, so no tx hash appears twice in the result.
|
|
170
205
|
* @param secret - The directional app tagging secret to query pending indexes for.
|
|
171
206
|
* @param startIndex - The lower bound of the index range (inclusive).
|
|
172
207
|
* @param endIndex - The upper bound of the index range (exclusive).
|
|
173
|
-
|
|
174
|
-
* [startIndex, endIndex). Returns an empty array if no pending indexes exist in the range.
|
|
175
|
-
*/ getTxHashesOfPendingIndexes(secret, startIndex, endIndex, jobId) {
|
|
208
|
+
*/ getPendingTxs(secret, startIndex, endIndex, jobId) {
|
|
176
209
|
return this.#store.transactionAsync(async ()=>{
|
|
177
210
|
const existing = await this.#readPendingIndexes(jobId, secret.toString());
|
|
178
|
-
|
|
179
|
-
|
|
211
|
+
return existing.filter((entry)=>entry.highestIndex >= startIndex && entry.highestIndex < endIndex).map((entry)=>({
|
|
212
|
+
txHash: entry.txHash,
|
|
213
|
+
highestIndex: entry.highestIndex
|
|
214
|
+
}));
|
|
180
215
|
});
|
|
181
216
|
}
|
|
182
217
|
/**
|
|
@@ -282,13 +317,26 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/constants.
|
|
|
282
317
|
}
|
|
283
318
|
/**
|
|
284
319
|
* Updates pending indexes corresponding to the given transaction hashes to be finalized and prunes any lower pending
|
|
285
|
-
* indexes.
|
|
286
|
-
|
|
320
|
+
* indexes. Applies to every secret the txs used, so the caller must hold tx-level evidence that the whole tx
|
|
321
|
+
* finalized. Callers holding evidence about a single secret must use {@link finalizePendingIndexesOfSecret} instead.
|
|
322
|
+
*/ finalizePendingIndexes(txHashes, jobId) {
|
|
323
|
+
return this.#finalizePendingIndexes(txHashes, jobId);
|
|
324
|
+
}
|
|
325
|
+
/**
|
|
326
|
+
* Same as {@link finalizePendingIndexes}, but restricted to the pending indexes of a single secret.
|
|
327
|
+
*
|
|
328
|
+
* Finalizing every secret off single-secret evidence would be unsound: a tx whose execution partially reverted can
|
|
329
|
+
* have all of one secret's tags onchain and none of another's, and the second secret's indexes must not be recorded
|
|
330
|
+
* as finalized when they never reached the chain.
|
|
331
|
+
*/ finalizePendingIndexesOfSecret(secret, txHashes, jobId) {
|
|
332
|
+
return this.#finalizePendingIndexes(txHashes, jobId, secret.toString());
|
|
333
|
+
}
|
|
334
|
+
async #finalizePendingIndexes(txHashes, jobId, onlySecret) {
|
|
287
335
|
if (txHashes.length === 0) {
|
|
288
336
|
return;
|
|
289
337
|
}
|
|
290
338
|
const txHashStrings = new Set(txHashes.map((tx)=>tx.toString()));
|
|
291
|
-
const secretsWithData = await this.#getSecretsWithPendingData(jobId);
|
|
339
|
+
const secretsWithData = (await this.#getSecretsWithPendingData(jobId)).filter(({ secret })=>onlySecret === undefined || secret === onlySecret);
|
|
292
340
|
for (const { secret, pendingData, lastFinalized } of secretsWithData){
|
|
293
341
|
let currentPending = pendingData;
|
|
294
342
|
let currentFinalized = lastFinalized;
|
|
@@ -372,3 +420,7 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/constants.
|
|
|
372
420
|
}
|
|
373
421
|
}
|
|
374
422
|
}
|
|
423
|
+
/** Builds the error thrown when a pending tag index is at or past the unfinalized tagging window end. */ export function windowExceededError(highestIndex, windowEnd, finalizedIndex) {
|
|
424
|
+
const finalizedDescription = finalizedIndex === undefined ? 'no index finalized yet' : `highest finalized index ${finalizedIndex}`;
|
|
425
|
+
return new Error(`Highest used index ${highestIndex} is at or past the window end ${windowEnd} (${finalizedDescription}). ` + `Tagging window length ${UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN} is configured too low. ` + `Contact the Aztec team to increase it!`);
|
|
426
|
+
}
|
|
@@ -1,2 +1,11 @@
|
|
|
1
1
|
export declare const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN: number;
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Exclusive upper bound of the tag indexes that can exist for a secret whose highest finalized index is
|
|
4
|
+
* `finalizedIndex` (undefined when nothing is finalized yet). The sender store refuses pending indexes at or past it,
|
|
5
|
+
* and both sender and recipient sync scan exactly up to it. Every absolute window bound must come from this helper:
|
|
6
|
+
* a site with a wider or narrower bound lets a tx land at an index the syncs never scan, so two stores sharing the
|
|
7
|
+
* secret could later pick a colliding index.
|
|
8
|
+
*/
|
|
9
|
+
export declare function unfinalizedTaggingIndexesWindowEnd(finalizedIndex: number | undefined): number;
|
|
10
|
+
export declare const INITIAL_CONSTRAINED_PROBE_LEN = 2;
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGFnZ2luZy9jb25zdGFudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbUJBLGVBQU8sTUFBTSxzQ0FBc0MsUUFBK0IsQ0FBQztBQUVuRjs7Ozs7O0dBTUc7QUFDSCx3QkFBZ0Isa0NBQWtDLENBQUMsY0FBYyxFQUFFLE1BQU0sR0FBRyxTQUFTLEdBQUcsTUFBTSxDQUc3RjtBQVVELGVBQU8sTUFBTSw2QkFBNkIsSUFBSSxDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/tagging/constants.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,sCAAsC,QAA+B,CAAC"}
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/tagging/constants.ts"],"names":[],"mappings":"AAmBA,eAAO,MAAM,sCAAsC,QAA+B,CAAC;AAEnF;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG7F;AAUD,eAAO,MAAM,6BAA6B,IAAI,CAAC"}
|
|
@@ -17,3 +17,22 @@ import { MAX_PRIVATE_LOGS_PER_TX } from '@aztec/constants';
|
|
|
17
17
|
// reserved at log emission time, before squashing is decided, and the kernel's reset/squash loop is not bounded by
|
|
18
18
|
// MAX_PRIVATE_LOGS_PER_TX. No fixed window value closes that gap.
|
|
19
19
|
export const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = MAX_PRIVATE_LOGS_PER_TX + 20;
|
|
20
|
+
/**
|
|
21
|
+
* Exclusive upper bound of the tag indexes that can exist for a secret whose highest finalized index is
|
|
22
|
+
* `finalizedIndex` (undefined when nothing is finalized yet). The sender store refuses pending indexes at or past it,
|
|
23
|
+
* and both sender and recipient sync scan exactly up to it. Every absolute window bound must come from this helper:
|
|
24
|
+
* a site with a wider or narrower bound lets a tx land at an index the syncs never scan, so two stores sharing the
|
|
25
|
+
* secret could later pick a colliding index.
|
|
26
|
+
*/ export function unfinalizedTaggingIndexesWindowEnd(finalizedIndex) {
|
|
27
|
+
const windowStart = finalizedIndex === undefined ? 0 : finalizedIndex + 1;
|
|
28
|
+
return windowStart + UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN;
|
|
29
|
+
}
|
|
30
|
+
// The number of tags probed per constrained secret in the first round.
|
|
31
|
+
//
|
|
32
|
+
// The probe doubles each round (2, 4, 8, ..., capped at UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN) while every probed
|
|
33
|
+
// index is a hit, stopping at the first missing tag. Constrained delivery is gapless, so a single missing tag proves
|
|
34
|
+
// the stream has ended: at steady state this turns a full WINDOW_LEN probe into two tags. A secret K logs behind
|
|
35
|
+
// catches up in ~log2(K) round-trips while the probe is still doubling (2, 4, 8, 16, 32), but once it saturates the cap
|
|
36
|
+
// and advances WINDOW_LEN tags per round, deeper catch-up is linear at ~K/WINDOW_LEN rounds. Either way it beats both
|
|
37
|
+
// the full window every round and one round per log.
|
|
38
|
+
export const INITIAL_CONSTRAINED_PROBE_LEN = 2;
|