@aztec/pxe 0.0.1-commit.a5db02d → 0.0.1-commit.aa0c64f
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 +3 -8
- 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 -25
- package/dest/bin/oracle_version_helpers.d.ts.map +1 -1
- package/dest/bin/oracle_version_helpers.js +11 -219
- package/dest/config/package_info.js +1 -1
- 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 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +5 -3
- 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 +3 -3
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_registry.js +6 -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 +286 -286
- 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 +5 -6
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +2 -2
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +2 -1
- package/dest/entrypoints/client/store.d.ts +1 -1
- package/dest/entrypoints/client/store.d.ts.map +1 -1
- package/dest/entrypoints/client/store.js +16 -2
- package/dest/logs/log_service.d.ts +1 -1
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +7 -2
- package/dest/messages/tx_resolver_service.d.ts +2 -2
- package/dest/messages/tx_resolver_service.d.ts.map +1 -1
- package/dest/messages/tx_resolver_service.js +7 -2
- package/dest/oracle_version.d.ts +1 -1
- package/dest/oracle_version.js +2 -2
- 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/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 +3 -1
- package/dest/storage/fact_store/origin_state.d.ts.map +1 -1
- package/dest/storage/fact_store/origin_state.js +7 -0
- package/dest/tagging/constants.d.ts +2 -1
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +9 -0
- package/dest/tagging/index.d.ts +2 -2
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +1 -1
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +9 -4
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.js +60 -25
- 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 +3 -10
- package/src/bin/index.ts +1 -5
- package/src/bin/oracle_version_helpers.ts +11 -268
- package/src/config/package_info.ts +1 -1
- 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 -3
- 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 +7 -8
- package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +285 -197
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +12 -7
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +8 -3
- package/src/entrypoints/client/store.ts +23 -7
- package/src/logs/log_service.ts +7 -2
- package/src/messages/tx_resolver_service.ts +8 -8
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/batch_planner.ts +0 -1
- package/src/private_kernel/private_kernel_execution_prover.ts +90 -4
- 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 +9 -0
- package/src/tagging/constants.ts +10 -0
- package/src/tagging/index.ts +1 -1
- package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +103 -46
- package/src/tagging/testing/tag_query_test_utils.ts +11 -0
|
@@ -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';
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JpZ2luX3N0YXRlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmN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AM,eAAe,GAAG;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1F;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,eAAe,CAKhG;AAED,yFAAyF;AACzF,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG;IAAE,UAAU,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAEnF,sGAAsG;AACtG,MAAM,MAAM,mBAAmB,GAAG;IAAE,UAAU,EAAE,EAAE,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"}
|
|
@@ -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
|
*
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export declare const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN: number;
|
|
2
|
-
|
|
2
|
+
export declare const INITIAL_CONSTRAINED_PROBE_LEN = 2;
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdGFnZ2luZy9jb25zdGFudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBbUJBLGVBQU8sTUFBTSxzQ0FBc0MsUUFBK0IsQ0FBQztBQVVuRixlQUFPLE1BQU0sNkJBQTZCLElBQUksQ0FBQyJ9
|
|
@@ -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;AAUnF,eAAO,MAAM,6BAA6B,IAAI,CAAC"}
|
|
@@ -17,3 +17,12 @@ 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
|
+
// The number of tags probed per constrained secret in the first round.
|
|
21
|
+
//
|
|
22
|
+
// The probe doubles each round (2, 4, 8, ..., capped at UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN) while every probed
|
|
23
|
+
// index is a hit, stopping at the first missing tag. Constrained delivery is gapless, so a single missing tag proves
|
|
24
|
+
// the stream has ended: at steady state this turns a full WINDOW_LEN probe into two tags. A secret K logs behind
|
|
25
|
+
// catches up in ~log2(K) round-trips while the probe is still doubling (2, 4, 8, 16, 32), but once it saturates the cap
|
|
26
|
+
// and advances WINDOW_LEN tags per round, deeper catch-up is linear at ~K/WINDOW_LEN rounds. Either way it beats both
|
|
27
|
+
// the full window every round and one round per log.
|
|
28
|
+
export const INITIAL_CONSTRAINED_PROBE_LEN = 2;
|
package/dest/tagging/index.d.ts
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
export { syncTaggedPrivateLogs } from './recipient_sync/sync_tagged_private_logs.js';
|
|
12
12
|
export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
|
|
13
13
|
export { persistSenderTaggingIndexRangesForTx } from './persist_sender_tagging_index_ranges.js';
|
|
14
|
-
export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from './constants.js';
|
|
14
|
+
export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN, INITIAL_CONSTRAINED_PROBE_LEN } from './constants.js';
|
|
15
15
|
export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract } from './get_all_logs_by_tags.js';
|
|
16
16
|
export { AppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
|
|
17
17
|
export { type PreTag, type TaggingIndexRange } from '@aztec/stdlib/logs';
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWdnaW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7R0FTRztBQUVILE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBQ3JGLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBQ3hGLE9BQU8sRUFBRSxvQ0FBb0MsRUFBRSxNQUFNLDBDQUEwQyxDQUFDO0FBQ2hHLE9BQU8sRUFBRSxzQ0FBc0MsRUFBRSw2QkFBNkIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3ZHLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxrQ0FBa0MsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBR3hHLE9BQU8sRUFBRSxnQkFBZ0IsRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDdEUsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFFLEtBQUssaUJBQWlCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,oCAAoC,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,sCAAsC,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,oCAAoC,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,sCAAsC,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AACvG,OAAO,EAAE,uBAAuB,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAGxG,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dest/tagging/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/ export { syncTaggedPrivateLogs } from './recipient_sync/sync_tagged_private_logs.js';
|
|
11
11
|
export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
|
|
12
12
|
export { persistSenderTaggingIndexRangesForTx } from './persist_sender_tagging_index_ranges.js';
|
|
13
|
-
export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from './constants.js';
|
|
13
|
+
export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN, INITIAL_CONSTRAINED_PROBE_LEN } from './constants.js';
|
|
14
14
|
export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract } from './get_all_logs_by_tags.js';
|
|
15
15
|
// Re-export tagging-related types from stdlib
|
|
16
16
|
export { AppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
|
|
@@ -54,9 +54,14 @@ import type { RecipientTaggingStore } from '../../storage/tagging_store/recipien
|
|
|
54
54
|
* - The lower bound is `highestFinalizedIndex + 1`. The `highestAgedIndex` mechanism is unnecessary because
|
|
55
55
|
* the nullifier chain prevents out-of-order index usage: no device can fill in a lower index after a higher
|
|
56
56
|
* one is already on-chain.
|
|
57
|
-
* -
|
|
58
|
-
*
|
|
59
|
-
*
|
|
57
|
+
* - Because the sequence is gapless, the scan stops at the first missing index: that gap proves the sequence has
|
|
58
|
+
* ended and no further logs exist. We exploit this with a doubling first-miss probe (see
|
|
59
|
+
* `INITIAL_CONSTRAINED_PROBE_LEN` in ../constants.ts), so a
|
|
60
|
+
* steady-state sync with no new logs costs two tags instead of the whole window. The probe length is in-memory
|
|
61
|
+
* state scoped to one sync call, so every sync restarts at the initial probe.
|
|
62
|
+
* - The upper bound is the same as unconstrained: `highestFinalizedIndex + WINDOW_LEN`. Advancing the probe is
|
|
63
|
+
* decoupled from persisting the finalized index, so unfinalized logs at the top of the run are still fetched
|
|
64
|
+
* while only the finalized prefix is persisted.
|
|
60
65
|
*
|
|
61
66
|
* # Batching across secrets
|
|
62
67
|
*
|
|
@@ -66,4 +71,4 @@ import type { RecipientTaggingStore } from '../../storage/tagging_store/recipien
|
|
|
66
71
|
* advanced are kept for the next iteration.
|
|
67
72
|
*/
|
|
68
73
|
export declare function syncTaggedPrivateLogs(secrets: AppTaggingSecret[], aztecNode: AztecNode, taggingStore: RecipientTaggingStore, anchorBlockHeader: BlockHeader, finalizedBlockNumber: BlockNumber, jobId: string): Promise<LogResult[]>;
|
|
69
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
74
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY190YWdnZWRfcHJpdmF0ZV9sb2dzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGFnZ2luZy9yZWNpcGllbnRfc3luYy9zeW5jX3RhZ2dlZF9wcml2YXRlX2xvZ3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRzlELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLFNBQVMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXRFLE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBRXBELE9BQU8sS0FBSyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sd0RBQXdELENBQUM7QUFLcEc7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQWtFRztBQUNILHdCQUFzQixxQkFBcUIsQ0FDekMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLEVBQzNCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLFlBQVksRUFBRSxxQkFBcUIsRUFDbkMsaUJBQWlCLEVBQUUsV0FBVyxFQUM5QixvQkFBb0IsRUFBRSxXQUFXLEVBQ2pDLEtBQUssRUFBRSxNQUFNLEdBQ1osT0FBTyxDQUFDLFNBQVMsRUFBRSxDQUFDLENBcUR0QiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync_tagged_private_logs.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/sync_tagged_private_logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAKpG
|
|
1
|
+
{"version":3,"file":"sync_tagged_private_logs.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/sync_tagged_private_logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAKpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,qBAAqB,EACnC,iBAAiB,EAAE,WAAW,EAC9B,oBAAoB,EAAE,WAAW,EACjC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,SAAS,EAAE,CAAC,CAqDtB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import { isDefined } from '@aztec/foundation/types';
|
|
3
3
|
import { AppTaggingSecretKind, SiloedTag } from '@aztec/stdlib/logs';
|
|
4
|
-
import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../constants.js';
|
|
4
|
+
import { INITIAL_CONSTRAINED_PROBE_LEN, UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../constants.js';
|
|
5
5
|
import { getAllPrivateLogsByTags } from '../get_all_logs_by_tags.js';
|
|
6
6
|
import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
7
7
|
/**
|
|
@@ -55,9 +55,14 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
55
55
|
* - The lower bound is `highestFinalizedIndex + 1`. The `highestAgedIndex` mechanism is unnecessary because
|
|
56
56
|
* the nullifier chain prevents out-of-order index usage: no device can fill in a lower index after a higher
|
|
57
57
|
* one is already on-chain.
|
|
58
|
-
* -
|
|
59
|
-
*
|
|
60
|
-
*
|
|
58
|
+
* - Because the sequence is gapless, the scan stops at the first missing index: that gap proves the sequence has
|
|
59
|
+
* ended and no further logs exist. We exploit this with a doubling first-miss probe (see
|
|
60
|
+
* `INITIAL_CONSTRAINED_PROBE_LEN` in ../constants.ts), so a
|
|
61
|
+
* steady-state sync with no new logs costs two tags instead of the whole window. The probe length is in-memory
|
|
62
|
+
* state scoped to one sync call, so every sync restarts at the initial probe.
|
|
63
|
+
* - The upper bound is the same as unconstrained: `highestFinalizedIndex + WINDOW_LEN`. Advancing the probe is
|
|
64
|
+
* decoupled from persisting the finalized index, so unfinalized logs at the top of the run are still fetched
|
|
65
|
+
* while only the finalized prefix is persisted.
|
|
61
66
|
*
|
|
62
67
|
* # Batching across secrets
|
|
63
68
|
*
|
|
@@ -87,8 +92,7 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
87
92
|
allLogs.push(...logsFoundWithSecret.map(({ log })=>log));
|
|
88
93
|
// Persist new indexes. If the finalized index moved forward, the window advances
|
|
89
94
|
// and we need another round for this secret.
|
|
90
|
-
|
|
91
|
-
return await processForKind(pendingSecret, logsFoundWithSecret, taggingStore, currentTimestamp, finalizedBlockNumber, jobId);
|
|
95
|
+
return pendingSecret.kind === AppTaggingSecretKind.CONSTRAINED ? await processConstrainedResults(pendingSecret, logsFoundWithSecret, taggingStore, currentTimestamp, finalizedBlockNumber, jobId) : await processUnconstrainedResults(pendingSecret, logsFoundWithSecret, taggingStore, currentTimestamp, finalizedBlockNumber, jobId);
|
|
92
96
|
}));
|
|
93
97
|
pending = nextRound.filter(isDefined);
|
|
94
98
|
}
|
|
@@ -97,13 +101,29 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
97
101
|
/** Reads stored indexes for each secret and computes the initial index range to query. */ function getIndexRangesForSecrets(secrets, taggingStore, jobId) {
|
|
98
102
|
return Promise.all(secrets.map(async (secret)=>{
|
|
99
103
|
const currentHighestFinalizedIndex = await taggingStore.getHighestFinalizedIndex(secret, jobId);
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
104
|
+
const boundEnd = (currentHighestFinalizedIndex ?? 0) + UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN + 1;
|
|
105
|
+
if (secret.kind === AppTaggingSecretKind.CONSTRAINED) {
|
|
106
|
+
// Constrained streams are gapless and resume at the finalized index, so probe a small initial window and stop
|
|
107
|
+
// at the first missing tag instead of always fetching the full window. The probe grows each round up to the
|
|
108
|
+
// window cap.
|
|
109
|
+
const start = currentHighestFinalizedIndex === undefined ? 0 : currentHighestFinalizedIndex + 1;
|
|
110
|
+
return {
|
|
111
|
+
kind: AppTaggingSecretKind.CONSTRAINED,
|
|
112
|
+
secret,
|
|
113
|
+
start,
|
|
114
|
+
end: Math.min(boundEnd, start + INITIAL_CONSTRAINED_PROBE_LEN),
|
|
115
|
+
boundEnd,
|
|
116
|
+
probeLen: INITIAL_CONSTRAINED_PROBE_LEN
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
// Unconstrained secrets can have gaps, so they scan the whole window starting past the highest aged index.
|
|
120
|
+
const highestAgedIndex = await taggingStore.getHighestAgedIndex(secret, jobId);
|
|
121
|
+
const start = highestAgedIndex === undefined ? 0 : highestAgedIndex + 1;
|
|
103
122
|
return {
|
|
123
|
+
kind: AppTaggingSecretKind.UNCONSTRAINED,
|
|
104
124
|
secret,
|
|
105
125
|
start,
|
|
106
|
-
end
|
|
126
|
+
end: boundEnd
|
|
107
127
|
};
|
|
108
128
|
}));
|
|
109
129
|
}
|
|
@@ -148,30 +168,43 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
148
168
|
return logsPerSecret;
|
|
149
169
|
}
|
|
150
170
|
/**
|
|
151
|
-
* Processes fetched logs for a constrained secret
|
|
152
|
-
*
|
|
171
|
+
* Processes fetched logs for a constrained secret: persists the finalized index and advances the probe. See the
|
|
172
|
+
* "# Constrained secrets" section above for why the scan stops at the first missing index. Only `highestFinalizedIndex`
|
|
153
173
|
* is tracked (no aged index).
|
|
154
174
|
*/ async function processConstrainedResults(pending, logsWithIndexes, taggingStore, currentTimestamp, finalizedBlockNumber, jobId) {
|
|
155
|
-
// Find where the contiguous run of indexes ends
|
|
156
|
-
// first gap, so all logs in the batch are within this prefix.
|
|
175
|
+
// Find where the contiguous run of indexes ends; all logs in the batch fall within this prefix.
|
|
157
176
|
const indexesWithLogs = new Set(logsWithIndexes.map((l)=>l.taggingIndex));
|
|
158
177
|
let firstMissingIndex = pending.start;
|
|
159
178
|
while(firstMissingIndex < pending.end && indexesWithLogs.has(firstMissingIndex)){
|
|
160
179
|
firstMissingIndex++;
|
|
161
180
|
}
|
|
162
|
-
//
|
|
163
|
-
// transaction, guaranteeing the log cannot disappear once included, so we persist the
|
|
164
|
-
//
|
|
181
|
+
// Persist the highest finalized index found. The nullifier for a constrained-delivery log is emitted in the same
|
|
182
|
+
// transaction, guaranteeing the log cannot disappear once included, so we persist even when a gap stops the scan.
|
|
183
|
+
// This lets the next sync round skip already-finalized indexes.
|
|
165
184
|
const { highestFinalizedIndex } = findHighestIndexes(logsWithIndexes, currentTimestamp, finalizedBlockNumber);
|
|
166
185
|
if (highestFinalizedIndex !== undefined) {
|
|
167
186
|
await taggingStore.updateHighestFinalizedIndex(pending.secret, highestFinalizedIndex, jobId);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
187
|
+
}
|
|
188
|
+
// Advancing the probe is decoupled from persisting the finalized index: keep scanning as long as the probe was
|
|
189
|
+
// entirely hits (no gap) and there is room before the protocol bound, even if none of those hits is finalized yet.
|
|
190
|
+
// Gating this on finalization would drop logs in unfinalized blocks, which sit at the top of the contiguous run.
|
|
191
|
+
// The bound re-anchors to any finalized index found this round.
|
|
192
|
+
const probeFullyConsumed = firstMissingIndex >= pending.end;
|
|
193
|
+
const boundEnd = highestFinalizedIndex !== undefined ? Math.max(pending.boundEnd, highestFinalizedIndex + UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN + 1) : pending.boundEnd;
|
|
194
|
+
// Double the probe each round, capped at the window (see INITIAL_CONSTRAINED_PROBE_LEN in ../constants.ts).
|
|
195
|
+
// The queried range is already bounded by boundEnd (a probe can never reach
|
|
196
|
+
// more than WINDOW_LEN past the finalized frontier); this cap just keeps the stored length from growing unbounded
|
|
197
|
+
// once the probe saturates the window.
|
|
198
|
+
const nextProbeLen = Math.min(pending.probeLen * 2, UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN);
|
|
199
|
+
if (probeFullyConsumed && pending.end < boundEnd) {
|
|
200
|
+
return {
|
|
201
|
+
kind: AppTaggingSecretKind.CONSTRAINED,
|
|
202
|
+
secret: pending.secret,
|
|
203
|
+
start: pending.end,
|
|
204
|
+
end: Math.min(boundEnd, pending.end + nextProbeLen),
|
|
205
|
+
boundEnd,
|
|
206
|
+
probeLen: nextProbeLen
|
|
207
|
+
};
|
|
175
208
|
}
|
|
176
209
|
return undefined;
|
|
177
210
|
}
|
|
@@ -195,9 +228,11 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
195
228
|
await taggingStore.updateHighestFinalizedIndex(pending.secret, highestFinalizedIndex, jobId);
|
|
196
229
|
// For the next iteration we want to look only at indexes for which we have not yet fetched logs while
|
|
197
230
|
// ensuring that we do not look further than WINDOW_LEN ahead of the highest finalized index.
|
|
231
|
+
const end = highestFinalizedIndex + UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN + 1;
|
|
198
232
|
return {
|
|
233
|
+
kind: AppTaggingSecretKind.UNCONSTRAINED,
|
|
199
234
|
secret: pending.secret,
|
|
200
235
|
start: pending.end,
|
|
201
|
-
end
|
|
236
|
+
end
|
|
202
237
|
};
|
|
203
238
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type AppTaggingSecret, type PrivateLogsQuery, SiloedTag } from '@aztec/stdlib/logs';
|
|
2
|
+
/** Computes the siloed tag */
|
|
3
|
+
export declare function computeSiloedTagForIndex(secret: AppTaggingSecret, index: number): Promise<SiloedTag>;
|
|
4
|
+
/** Extracts the bare-tag set from a query */
|
|
5
|
+
export declare function extractTags(query: PrivateLogsQuery): SiloedTag[];
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFnX3F1ZXJ5X3Rlc3RfdXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90YWdnaW5nL3Rlc3RpbmcvdGFnX3F1ZXJ5X3Rlc3RfdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssZ0JBQWdCLEVBQUUsS0FBSyxnQkFBZ0IsRUFBRSxTQUFTLEVBQWlCLE1BQU0sb0JBQW9CLENBQUM7QUFFNUcsOEJBQThCO0FBQzlCLHdCQUFnQix3QkFBd0IsQ0FBQyxNQUFNLEVBQUUsZ0JBQWdCLEVBQUUsS0FBSyxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsU0FBUyxDQUFDLENBRXBHO0FBRUQsNkNBQTZDO0FBQzdDLHdCQUFnQixXQUFXLENBQUMsS0FBSyxFQUFFLGdCQUFnQixHQUFHLFNBQVMsRUFBRSxDQUVoRSJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tag_query_test_utils.d.ts","sourceRoot":"","sources":["../../../src/tagging/testing/tag_query_test_utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,gBAAgB,EAAE,SAAS,EAAiB,MAAM,oBAAoB,CAAC;AAE5G,8BAA8B;AAC9B,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAEpG;AAED,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,EAAE,CAEhE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SiloedTag } from '@aztec/stdlib/logs';
|
|
2
|
+
/** Computes the siloed tag */ export function computeSiloedTagForIndex(secret, index) {
|
|
3
|
+
return SiloedTag.compute({
|
|
4
|
+
extendedSecret: secret,
|
|
5
|
+
index
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
/** Extracts the bare-tag set from a query */ export function extractTags(query) {
|
|
9
|
+
return query.tags.map((entry)=>entry instanceof SiloedTag ? entry : entry.tag);
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.aa0c64f",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"typedocOptions": {
|
|
6
6
|
"entryPoints": [
|
|
@@ -71,20 +71,20 @@
|
|
|
71
71
|
]
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
75
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
76
|
-
"@aztec/builder": "0.0.1-commit.
|
|
77
|
-
"@aztec/constants": "0.0.1-commit.
|
|
78
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
79
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
80
|
-
"@aztec/key-store": "0.0.1-commit.
|
|
81
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
82
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
83
|
-
"@aztec/noir-types": "0.0.1-commit.
|
|
84
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
85
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
86
|
-
"@aztec/standard-contracts": "0.0.1-commit.
|
|
87
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
74
|
+
"@aztec/bb-prover": "0.0.1-commit.aa0c64f",
|
|
75
|
+
"@aztec/bb.js": "0.0.1-commit.aa0c64f",
|
|
76
|
+
"@aztec/builder": "0.0.1-commit.aa0c64f",
|
|
77
|
+
"@aztec/constants": "0.0.1-commit.aa0c64f",
|
|
78
|
+
"@aztec/ethereum": "0.0.1-commit.aa0c64f",
|
|
79
|
+
"@aztec/foundation": "0.0.1-commit.aa0c64f",
|
|
80
|
+
"@aztec/key-store": "0.0.1-commit.aa0c64f",
|
|
81
|
+
"@aztec/kv-store": "0.0.1-commit.aa0c64f",
|
|
82
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.aa0c64f",
|
|
83
|
+
"@aztec/noir-types": "0.0.1-commit.aa0c64f",
|
|
84
|
+
"@aztec/protocol-contracts": "0.0.1-commit.aa0c64f",
|
|
85
|
+
"@aztec/simulator": "0.0.1-commit.aa0c64f",
|
|
86
|
+
"@aztec/standard-contracts": "0.0.1-commit.aa0c64f",
|
|
87
|
+
"@aztec/stdlib": "0.0.1-commit.aa0c64f",
|
|
88
88
|
"koa": "^2.16.1",
|
|
89
89
|
"koa-router": "^13.1.1",
|
|
90
90
|
"lodash.omit": "^4.5.0",
|
|
@@ -93,8 +93,8 @@
|
|
|
93
93
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|
|
96
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
97
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
96
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.aa0c64f",
|
|
97
|
+
"@aztec/world-state": "0.0.1-commit.aa0c64f",
|
|
98
98
|
"@jest/globals": "^30.0.0",
|
|
99
99
|
"@types/jest": "^30.0.0",
|
|
100
100
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -3,6 +3,7 @@ import { keccak256String } from '@aztec/foundation/crypto/keccak';
|
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
|
|
6
|
+
import { ORACLE_REGISTRY } from '../contract_function_simulator/index.js';
|
|
6
7
|
import { ORACLE_INTERFACE_HASH, ORACLE_VERSION_MAJOR } from '../oracle_version.js';
|
|
7
8
|
import { getOracleRegistrySignature, readNumericGlobal } from './oracle_version_helpers.js';
|
|
8
9
|
|
|
@@ -10,7 +11,7 @@ import { getOracleRegistrySignature, readNumericGlobal } from './oracle_version_
|
|
|
10
11
|
* Verifies that the Oracle interface matches the expected interface hash.
|
|
11
12
|
*
|
|
12
13
|
* The Oracle interface needs to be versioned to ensure compatibility between Aztec.nr and PXE. This function computes
|
|
13
|
-
* a hash of
|
|
14
|
+
* a hash of `ORACLE_REGISTRY` (where each oracle's parameter names, parameter types, and return type
|
|
14
15
|
* live) and compares it against a known hash. If they don't match, it means the interface has changed and the oracle
|
|
15
16
|
* version needs to be bumped:
|
|
16
17
|
* - If the change is backward-breaking (e.g. removing/renaming an oracle, or changing its params/return), bump
|
|
@@ -18,16 +19,8 @@ import { getOracleRegistrySignature, readNumericGlobal } from './oracle_version_
|
|
|
18
19
|
* - If the change is an oracle addition (non-breaking), bump ORACLE_VERSION_MINOR.
|
|
19
20
|
*/
|
|
20
21
|
function assertOracleInterfaceMatches(): void {
|
|
21
|
-
// The script runs from dest/bin/ after compilation, so we go up to the package root then into src/ to find
|
|
22
|
-
// the source file.
|
|
23
|
-
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
24
|
-
const packageRoot = dirname(dirname(currentDir)); // Go up from bin/ to pxe/
|
|
25
|
-
const registrySourcePath = join(packageRoot, 'src/contract_function_simulator/oracle/oracle_registry.ts');
|
|
26
|
-
|
|
27
|
-
const oracleInterfaceSignature = getOracleRegistrySignature(registrySourcePath, 'ORACLE_REGISTRY');
|
|
28
|
-
|
|
29
22
|
// We use keccak256 here just because we already have it in the dependencies.
|
|
30
|
-
const oracleInterfaceHash = keccak256String(
|
|
23
|
+
const oracleInterfaceHash = keccak256String(getOracleRegistrySignature(ORACLE_REGISTRY));
|
|
31
24
|
if (oracleInterfaceHash !== ORACLE_INTERFACE_HASH) {
|
|
32
25
|
throw new Error(
|
|
33
26
|
`The Oracle interface has changed. Update ORACLE_INTERFACE_HASH to ${oracleInterfaceHash} in pxe/src/oracle_version.ts and bump the oracle version (ORACLE_VERSION_MAJOR for breaking changes, ORACLE_VERSION_MINOR for oracle additions).`,
|
package/src/bin/index.ts
CHANGED