@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
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
/** Facts are always tied to a real scope; the zero address is not a valid fact scope. */ function assertNonZeroScope(scope) {
|
|
4
|
+
if (scope.equals(AztecAddress.ZERO)) {
|
|
5
|
+
throw new Error('scope must not be the zero address');
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Identifies all fact collections of one type within a contract, for one scope. */ export class FactCollectionTypeKey {
|
|
9
|
+
contractAddress;
|
|
10
|
+
scope;
|
|
11
|
+
factCollectionTypeId;
|
|
12
|
+
constructor(contractAddress, scope, factCollectionTypeId){
|
|
13
|
+
this.contractAddress = contractAddress;
|
|
14
|
+
this.scope = scope;
|
|
15
|
+
this.factCollectionTypeId = factCollectionTypeId;
|
|
16
|
+
assertNonZeroScope(scope);
|
|
17
|
+
}
|
|
18
|
+
static from(fields) {
|
|
19
|
+
return new FactCollectionTypeKey(fields.contractAddress, fields.scope, fields.factCollectionTypeId);
|
|
20
|
+
}
|
|
21
|
+
toString() {
|
|
22
|
+
return `${this.contractAddress}:${this.scope}:${this.factCollectionTypeId}`;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** Uniquely identifies a single fact collection, isolated by scope; all its facts share this key. */ export class FactCollectionKey {
|
|
26
|
+
contractAddress;
|
|
27
|
+
scope;
|
|
28
|
+
factCollectionTypeId;
|
|
29
|
+
factCollectionId;
|
|
30
|
+
constructor(contractAddress, scope, factCollectionTypeId, factCollectionId){
|
|
31
|
+
this.contractAddress = contractAddress;
|
|
32
|
+
this.scope = scope;
|
|
33
|
+
this.factCollectionTypeId = factCollectionTypeId;
|
|
34
|
+
this.factCollectionId = factCollectionId;
|
|
35
|
+
assertNonZeroScope(scope);
|
|
36
|
+
}
|
|
37
|
+
static from(fields) {
|
|
38
|
+
return new FactCollectionKey(fields.contractAddress, fields.scope, fields.factCollectionTypeId, fields.factCollectionId);
|
|
39
|
+
}
|
|
40
|
+
/** Inverse of toString */ static fromString(str) {
|
|
41
|
+
const [contractAddress, scope, factCollectionTypeId, factCollectionId] = str.split(':');
|
|
42
|
+
return new FactCollectionKey(AztecAddress.fromStringUnsafe(contractAddress), AztecAddress.fromStringUnsafe(scope), Fr.fromString(factCollectionTypeId), Fr.fromString(factCollectionId));
|
|
43
|
+
}
|
|
44
|
+
/** The key grouping this collection with the other collections of its type within the same contract and scope. */ factCollectionTypeKey() {
|
|
45
|
+
return new FactCollectionTypeKey(this.contractAddress, this.scope, this.factCollectionTypeId);
|
|
46
|
+
}
|
|
47
|
+
toString() {
|
|
48
|
+
return `${this.contractAddress}:${this.scope}:${this.factCollectionTypeId}:${this.factCollectionId}`;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { FactStore, type FactCollection } from './fact_store.js';
|
|
2
|
+
export { FactService } from './fact_service.js';
|
|
3
|
+
export { FactCollectionKey, FactCollectionTypeKey, type OriginBlock } from './fact_store_keys.js';
|
|
4
|
+
export type { Fact } from './stored_fact.js';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL2ZhY3Rfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLGNBQWMsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBQ2pFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxtQkFBbUIsQ0FBQztBQUNoRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUscUJBQXFCLEVBQUUsS0FBSyxXQUFXLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRyxZQUFZLEVBQUUsSUFBSSxFQUFFLE1BQU0sa0JBQWtCLENBQUMifQ==
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
+
import { FactCollectionKey, type OriginBlock } from './fact_store_keys.js';
|
|
4
|
+
/** A fact as returned by the fact store. */
|
|
5
|
+
export type Fact = {
|
|
6
|
+
factTypeId: Fr;
|
|
7
|
+
payload: Fr[];
|
|
8
|
+
originBlock: OriginBlock | undefined;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A single immutable fact belonging to a fact collection.
|
|
12
|
+
*/
|
|
13
|
+
export declare class StoredFact {
|
|
14
|
+
readonly factCollectionKey: FactCollectionKey;
|
|
15
|
+
readonly factTypeId: Fr;
|
|
16
|
+
readonly payload: Fr[];
|
|
17
|
+
readonly originBlock: OriginBlock | undefined;
|
|
18
|
+
constructor(factCollectionKey: FactCollectionKey, factTypeId: Fr, payload: Fr[], originBlock: OriginBlock | undefined);
|
|
19
|
+
/** Whether this fact is deleted on block pruning (true) or survives reorgs (false). */
|
|
20
|
+
get isRetractable(): boolean;
|
|
21
|
+
/** Stable digest of the payload, used for fact idempotency. */
|
|
22
|
+
payloadHash(): Fr;
|
|
23
|
+
/** Returns the externally facing view of this fact. */
|
|
24
|
+
toFact(): Fact;
|
|
25
|
+
toBuffer(): Buffer;
|
|
26
|
+
static fromBuffer(buffer: Buffer | BufferReader): StoredFact;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Builds the serialized key that identifies a fact in the store.
|
|
30
|
+
*/
|
|
31
|
+
export declare function factKeyStrOf(fact: StoredFact): string;
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RvcmVkX2ZhY3QuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJz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,GAAG,MAAM,CAGrD"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { sha256ToField } from '@aztec/foundation/crypto/sha256';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { FactCollectionKey } from './fact_store_keys.js';
|
|
6
|
+
/**
|
|
7
|
+
* A single immutable fact belonging to a fact collection.
|
|
8
|
+
*/ export class StoredFact {
|
|
9
|
+
factCollectionKey;
|
|
10
|
+
factTypeId;
|
|
11
|
+
payload;
|
|
12
|
+
originBlock;
|
|
13
|
+
constructor(factCollectionKey, factTypeId, payload, originBlock){
|
|
14
|
+
this.factCollectionKey = factCollectionKey;
|
|
15
|
+
this.factTypeId = factTypeId;
|
|
16
|
+
this.payload = payload;
|
|
17
|
+
this.originBlock = originBlock;
|
|
18
|
+
}
|
|
19
|
+
/** Whether this fact is deleted on block pruning (true) or survives reorgs (false). */ get isRetractable() {
|
|
20
|
+
return this.originBlock !== undefined;
|
|
21
|
+
}
|
|
22
|
+
/** Stable digest of the payload, used for fact idempotency. */ payloadHash() {
|
|
23
|
+
return sha256ToField([
|
|
24
|
+
this.payload.length,
|
|
25
|
+
...this.payload
|
|
26
|
+
]);
|
|
27
|
+
}
|
|
28
|
+
/** Returns the externally facing view of this fact. */ toFact() {
|
|
29
|
+
return {
|
|
30
|
+
factTypeId: this.factTypeId,
|
|
31
|
+
payload: this.payload,
|
|
32
|
+
originBlock: this.originBlock
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
toBuffer() {
|
|
36
|
+
return serializeToBuffer(this.factCollectionKey.contractAddress, this.factCollectionKey.scope, this.factCollectionKey.factCollectionTypeId, this.factCollectionKey.factCollectionId, this.factTypeId, this.payload.length, ...this.payload, this.originBlock !== undefined, this.originBlock ? this.originBlock.blockNumber : 0, this.originBlock ? this.originBlock.blockHash : Fr.ZERO);
|
|
37
|
+
}
|
|
38
|
+
static fromBuffer(buffer) {
|
|
39
|
+
const reader = BufferReader.asReader(buffer);
|
|
40
|
+
const contractAddress = reader.readObject(AztecAddress);
|
|
41
|
+
const scope = reader.readObject(AztecAddress);
|
|
42
|
+
const factCollectionTypeId = reader.readObject(Fr);
|
|
43
|
+
const factCollectionId = reader.readObject(Fr);
|
|
44
|
+
const factTypeId = reader.readObject(Fr);
|
|
45
|
+
const payloadLen = reader.readNumber();
|
|
46
|
+
const payload = reader.readArray(payloadLen, Fr);
|
|
47
|
+
const hasOriginBlock = reader.readBoolean();
|
|
48
|
+
const blockNumber = reader.readNumber();
|
|
49
|
+
const blockHash = reader.readObject(Fr);
|
|
50
|
+
const originBlock = hasOriginBlock ? {
|
|
51
|
+
blockNumber,
|
|
52
|
+
blockHash
|
|
53
|
+
} : undefined;
|
|
54
|
+
return new StoredFact(new FactCollectionKey(contractAddress, scope, factCollectionTypeId, factCollectionId), factTypeId, [
|
|
55
|
+
...payload
|
|
56
|
+
], originBlock);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Builds the serialized key that identifies a fact in the store.
|
|
61
|
+
*/ export function factKeyStrOf(fact) {
|
|
62
|
+
const origin = fact.originBlock ? `${fact.originBlock.blockNumber}:${fact.originBlock.blockHash}` : 'none';
|
|
63
|
+
return `${fact.factCollectionKey}:${fact.factTypeId}:${fact.payloadHash()}:${origin}`;
|
|
64
|
+
}
|
package/dest/storage/index.d.ts
CHANGED
|
@@ -2,8 +2,9 @@ export * from './address_store/index.js';
|
|
|
2
2
|
export * from './anchor_block_store/index.js';
|
|
3
3
|
export * from './capsule_store/index.js';
|
|
4
4
|
export * from './contract_store/index.js';
|
|
5
|
+
export * from './fact_store/index.js';
|
|
5
6
|
export * from './note_store/index.js';
|
|
6
7
|
export * from './tagging_store/index.js';
|
|
7
8
|
export * from './metadata.js';
|
|
8
9
|
export * from './private_event_store/private_event_store.js';
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyxlQUFlLENBQUM7QUFDOUIsY0FBYyw4Q0FBOEMsQ0FBQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,8CAA8C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,8CAA8C,CAAC"}
|
package/dest/storage/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './address_store/index.js';
|
|
|
2
2
|
export * from './anchor_block_store/index.js';
|
|
3
3
|
export * from './capsule_store/index.js';
|
|
4
4
|
export * from './contract_store/index.js';
|
|
5
|
+
export * from './fact_store/index.js';
|
|
5
6
|
export * from './note_store/index.js';
|
|
6
7
|
export * from './tagging_store/index.js';
|
|
7
8
|
export * from './metadata.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PXE_DATA_SCHEMA_VERSION =
|
|
1
|
+
export declare const PXE_DATA_SCHEMA_VERSION = 9;
|
|
2
2
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0YWRhdGEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL21ldGFkYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQU8sTUFBTSx1QkFBdUIsSUFBSSxDQUFDIn0=
|
package/dest/storage/metadata.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PXE_DATA_SCHEMA_VERSION =
|
|
1
|
+
export const PXE_DATA_SCHEMA_VERSION = 9;
|
|
@@ -6,9 +6,10 @@ import { AddressStore } from './address_store/address_store.js';
|
|
|
6
6
|
import { AnchorBlockStore } from './anchor_block_store/anchor_block_store.js';
|
|
7
7
|
import { CapsuleStore } from './capsule_store/capsule_store.js';
|
|
8
8
|
import { ContractStore } from './contract_store/contract_store.js';
|
|
9
|
+
import { FactStore } from './fact_store/fact_store.js';
|
|
9
10
|
import { NoteStore } from './note_store/note_store.js';
|
|
10
11
|
import { PrivateEventStore } from './private_event_store/private_event_store.js';
|
|
11
|
-
import { RecipientTaggingStore,
|
|
12
|
+
import { RecipientTaggingStore, SenderTaggingStore, TaggingSecretSourcesStore } from './tagging_store/index.js';
|
|
12
13
|
/**
|
|
13
14
|
* The set of sub-stores opened against a single `AztecAsyncKVStore` to back PXE state.
|
|
14
15
|
*/
|
|
@@ -19,15 +20,16 @@ export type PxeStores = {
|
|
|
19
20
|
noteStore: NoteStore;
|
|
20
21
|
anchorBlockStore: AnchorBlockStore;
|
|
21
22
|
senderTaggingStore: SenderTaggingStore;
|
|
22
|
-
|
|
23
|
+
taggingSecretSourcesStore: TaggingSecretSourcesStore;
|
|
23
24
|
recipientTaggingStore: RecipientTaggingStore;
|
|
24
25
|
capsuleStore: CapsuleStore;
|
|
25
26
|
keyStore: KeyStore;
|
|
26
27
|
l2TipsStore: L2TipsKVStore;
|
|
28
|
+
factStore: FactStore;
|
|
27
29
|
};
|
|
28
30
|
/**
|
|
29
31
|
* Opens every PXE sub-store against the given backing store. The `initialBlockHash` seeds the
|
|
30
32
|
* `L2TipsKVStore` so it agrees with the node's archiver on the dynamic genesis header hash.
|
|
31
33
|
*/
|
|
32
34
|
export declare function openPxeStores(store: AztecAsyncKVStore, initialBlockHash: BlockHash): PxeStores;
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
35
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3Blbl9weGVfc3RvcmVzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc3RvcmFnZS9vcGVuX3B4ZV9zdG9yZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQzVDLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDekQsT0FBTyxFQUFFLGFBQWEsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ3ZELE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBRXJELE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxrQ0FBa0MsQ0FB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RyxTQUFTLENBZTlGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open_pxe_stores.d.ts","sourceRoot":"","sources":["../../src/storage/open_pxe_stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,
|
|
1
|
+
{"version":3,"file":"open_pxe_stores.d.ts","sourceRoot":"","sources":["../../src/storage/open_pxe_stores.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAEhH;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG;IACtB,YAAY,EAAE,YAAY,CAAC;IAC3B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE,SAAS,CAAC;IACrB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,yBAAyB,EAAE,yBAAyB,CAAC;IACrD,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,YAAY,EAAE,YAAY,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,aAAa,CAAC;IAC3B,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,SAAS,GAAG,SAAS,CAe9F"}
|
|
@@ -4,9 +4,10 @@ import { AddressStore } from './address_store/address_store.js';
|
|
|
4
4
|
import { AnchorBlockStore } from './anchor_block_store/anchor_block_store.js';
|
|
5
5
|
import { CapsuleStore } from './capsule_store/capsule_store.js';
|
|
6
6
|
import { ContractStore } from './contract_store/contract_store.js';
|
|
7
|
+
import { FactStore } from './fact_store/fact_store.js';
|
|
7
8
|
import { NoteStore } from './note_store/note_store.js';
|
|
8
9
|
import { PrivateEventStore } from './private_event_store/private_event_store.js';
|
|
9
|
-
import { RecipientTaggingStore,
|
|
10
|
+
import { RecipientTaggingStore, SenderTaggingStore, TaggingSecretSourcesStore } from './tagging_store/index.js';
|
|
10
11
|
/**
|
|
11
12
|
* Opens every PXE sub-store against the given backing store. The `initialBlockHash` seeds the
|
|
12
13
|
* `L2TipsKVStore` so it agrees with the node's archiver on the dynamic genesis header hash.
|
|
@@ -18,10 +19,11 @@ import { RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } fro
|
|
|
18
19
|
noteStore: new NoteStore(store),
|
|
19
20
|
anchorBlockStore: new AnchorBlockStore(store),
|
|
20
21
|
senderTaggingStore: new SenderTaggingStore(store),
|
|
21
|
-
|
|
22
|
+
taggingSecretSourcesStore: new TaggingSecretSourcesStore(store),
|
|
22
23
|
recipientTaggingStore: new RecipientTaggingStore(store),
|
|
23
24
|
capsuleStore: new CapsuleStore(store),
|
|
24
25
|
keyStore: new KeyStore(store),
|
|
25
|
-
l2TipsStore: new L2TipsKVStore(store, 'pxe', initialBlockHash)
|
|
26
|
+
l2TipsStore: new L2TipsKVStore(store, 'pxe', initialBlockHash),
|
|
27
|
+
factStore: new FactStore(store)
|
|
26
28
|
};
|
|
27
29
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { SenderTaggingStore } from './sender_tagging_store.js';
|
|
2
|
-
export {
|
|
2
|
+
export { TaggingSecretSourcesStore } from './tagging_secret_sources_store.js';
|
|
3
3
|
export { RecipientTaggingStore } from './recipient_tagging_store.js';
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL3RhZ2dpbmdfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDL0QsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDOUUsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sOEJBQThCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { SenderTaggingStore } from './sender_tagging_store.js';
|
|
2
|
-
export {
|
|
2
|
+
export { TaggingSecretSourcesStore } from './tagging_secret_sources_store.js';
|
|
3
3
|
export { RecipientTaggingStore } from './recipient_tagging_store.js';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Point } from '@aztec/foundation/curves/grumpkin';
|
|
2
|
+
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
3
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
/**
|
|
5
|
+
* Stores the sources from which directional app tagging secrets are derived during recipient log synchronization.
|
|
6
|
+
*
|
|
7
|
+
* Two kinds of source are held:
|
|
8
|
+
* - Sender addresses: combined with a recipient to derive a shared tagging secret via ECDH. These are global (not
|
|
9
|
+
* scoped to a recipient) because the per-recipient binding comes from re-mixing the recipient's keys during
|
|
10
|
+
* derivation, so each account only ever derives secrets meant for it.
|
|
11
|
+
* - Pre-shared tagging secrets: shared secret points registered directly, bypassing ECDH. These are scoped to a
|
|
12
|
+
* specific recipient, since the derivation of the directional app tagging secret does not require any secret
|
|
13
|
+
* recipient data: given the original secret anyone can derive a recipient's app-siloed directional tagging secret,
|
|
14
|
+
* and so these must not be reused to preserve privacy.
|
|
15
|
+
*/
|
|
16
|
+
export declare class TaggingSecretSourcesStore {
|
|
17
|
+
#private;
|
|
18
|
+
constructor(store: AztecAsyncKVStore);
|
|
19
|
+
addSender(address: AztecAddress): Promise<boolean>;
|
|
20
|
+
getSenders(): Promise<AztecAddress[]>;
|
|
21
|
+
removeSender(address: AztecAddress): Promise<boolean>;
|
|
22
|
+
/**
|
|
23
|
+
* Registers a pre-shared tagging secret scoped to a recipient.
|
|
24
|
+
* @returns true if the secret was newly added, false if it was already registered for that recipient.
|
|
25
|
+
*/
|
|
26
|
+
addSharedSecret(recipient: AztecAddress, secret: Point): Promise<boolean>;
|
|
27
|
+
/** Returns the pre-shared tagging secrets registered for a given recipient. */
|
|
28
|
+
getSharedSecretsForRecipient(recipient: AztecAddress): Promise<Point[]>;
|
|
29
|
+
/** Returns every registered pre-shared tagging secret, each paired with the recipient it is scoped to. */
|
|
30
|
+
getAllSharedSecrets(): Promise<{
|
|
31
|
+
recipient: AztecAddress;
|
|
32
|
+
secret: Point;
|
|
33
|
+
}[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Removes a pre-shared tagging secret scoped to a recipient.
|
|
36
|
+
* @returns true if the secret was registered and removed, false if it was not registered for that recipient.
|
|
37
|
+
*/
|
|
38
|
+
removeSharedSecret(recipient: AztecAddress, secret: Point): Promise<boolean>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFnZ2luZ19zZWNyZXRfc291cmNlc19zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvdGFnZ2luZ19zdG9yZS90YWdnaW5nX3NlY3JldF9zb3VyY2VzX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLEVBQUUsTU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ources_store.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/tagging_secret_sources_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAE1D,OAAO,KAAK,EAAE,iBAAiB,EAAqC,MAAM,iBAAiB,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;;;;;;;;;;GAWG;AACH,qBAAa,yBAAyB;;IAKpC,YAAY,KAAK,EAAE,iBAAiB,EAKnC;IAED,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAUjD;IAED,UAAU,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAIpC;IAED,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAUpD;IAED;;;OAGG;IACH,eAAe,CAAC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAcxE;IAED,+EAA+E;IAC/E,4BAA4B,CAAC,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAMtE;IAED,0GAA0G;IAC1G,mBAAmB,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,YAAY,CAAC;QAAC,MAAM,EAAE,KAAK,CAAA;KAAE,EAAE,CAAC,CAQ3E;IAED;;;OAGG;IACH,kBAAkB,CAAC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAY3E;CACF"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { Point } from '@aztec/foundation/curves/grumpkin';
|
|
2
|
+
import { toArray } from '@aztec/foundation/iterable';
|
|
3
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
/**
|
|
5
|
+
* Stores the sources from which directional app tagging secrets are derived during recipient log synchronization.
|
|
6
|
+
*
|
|
7
|
+
* Two kinds of source are held:
|
|
8
|
+
* - Sender addresses: combined with a recipient to derive a shared tagging secret via ECDH. These are global (not
|
|
9
|
+
* scoped to a recipient) because the per-recipient binding comes from re-mixing the recipient's keys during
|
|
10
|
+
* derivation, so each account only ever derives secrets meant for it.
|
|
11
|
+
* - Pre-shared tagging secrets: shared secret points registered directly, bypassing ECDH. These are scoped to a
|
|
12
|
+
* specific recipient, since the derivation of the directional app tagging secret does not require any secret
|
|
13
|
+
* recipient data: given the original secret anyone can derive a recipient's app-siloed directional tagging secret,
|
|
14
|
+
* and so these must not be reused to preserve privacy.
|
|
15
|
+
*/ export class TaggingSecretSourcesStore {
|
|
16
|
+
#store;
|
|
17
|
+
#senders;
|
|
18
|
+
#sharedSecretsByRecipient;
|
|
19
|
+
constructor(store){
|
|
20
|
+
this.#store = store;
|
|
21
|
+
this.#senders = this.#store.openMap('senders');
|
|
22
|
+
this.#sharedSecretsByRecipient = this.#store.openMultiMap('recipient_shared_secrets');
|
|
23
|
+
}
|
|
24
|
+
addSender(address) {
|
|
25
|
+
return this.#store.transactionAsync(async ()=>{
|
|
26
|
+
if (await this.#senders.hasAsync(address.toString())) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
await this.#senders.set(address.toString(), true);
|
|
30
|
+
return true;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
getSenders() {
|
|
34
|
+
return this.#store.transactionAsync(async ()=>{
|
|
35
|
+
return (await toArray(this.#senders.keysAsync())).map(AztecAddress.fromStringUnsafe);
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
removeSender(address) {
|
|
39
|
+
return this.#store.transactionAsync(async ()=>{
|
|
40
|
+
if (!await this.#senders.hasAsync(address.toString())) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
await this.#senders.delete(address.toString());
|
|
44
|
+
return true;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Registers a pre-shared tagging secret scoped to a recipient.
|
|
49
|
+
* @returns true if the secret was newly added, false if it was already registered for that recipient.
|
|
50
|
+
*/ addSharedSecret(recipient, secret) {
|
|
51
|
+
return this.#store.transactionAsync(async ()=>{
|
|
52
|
+
const secretStr = secret.toString();
|
|
53
|
+
// MultiMap.set silently ignores an identical (key, value), so we scan to report whether this is a new secret.
|
|
54
|
+
for await (const existing of this.#sharedSecretsByRecipient.getValuesAsync(recipient.toString())){
|
|
55
|
+
if (existing === secretStr) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
await this.#sharedSecretsByRecipient.set(recipient.toString(), secretStr);
|
|
60
|
+
return true;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
/** Returns the pre-shared tagging secrets registered for a given recipient. */ getSharedSecretsForRecipient(recipient) {
|
|
64
|
+
return this.#store.transactionAsync(async ()=>{
|
|
65
|
+
return (await toArray(this.#sharedSecretsByRecipient.getValuesAsync(recipient.toString()))).map((secret)=>Point.fromString(secret));
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** Returns every registered pre-shared tagging secret, each paired with the recipient it is scoped to. */ getAllSharedSecrets() {
|
|
69
|
+
return this.#store.transactionAsync(async ()=>{
|
|
70
|
+
const entries = await toArray(this.#sharedSecretsByRecipient.entriesAsync());
|
|
71
|
+
return entries.map(([recipient, secret])=>({
|
|
72
|
+
recipient: AztecAddress.fromStringUnsafe(recipient),
|
|
73
|
+
secret: Point.fromString(secret)
|
|
74
|
+
}));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Removes a pre-shared tagging secret scoped to a recipient.
|
|
79
|
+
* @returns true if the secret was registered and removed, false if it was not registered for that recipient.
|
|
80
|
+
*/ removeSharedSecret(recipient, secret) {
|
|
81
|
+
return this.#store.transactionAsync(async ()=>{
|
|
82
|
+
const secretStr = secret.toString();
|
|
83
|
+
for await (const existing of this.#sharedSecretsByRecipient.getValuesAsync(recipient.toString())){
|
|
84
|
+
if (existing === secretStr) {
|
|
85
|
+
await this.#sharedSecretsByRecipient.deleteValue(recipient.toString(), secretStr);
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return false;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.2",
|
|
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": "5.0.0-rc.
|
|
75
|
-
"@aztec/bb.js": "5.0.0-rc.
|
|
76
|
-
"@aztec/builder": "5.0.0-rc.
|
|
77
|
-
"@aztec/constants": "5.0.0-rc.
|
|
78
|
-
"@aztec/ethereum": "5.0.0-rc.
|
|
79
|
-
"@aztec/foundation": "5.0.0-rc.
|
|
80
|
-
"@aztec/key-store": "5.0.0-rc.
|
|
81
|
-
"@aztec/kv-store": "5.0.0-rc.
|
|
82
|
-
"@aztec/noir-protocol-circuits-types": "5.0.0-rc.
|
|
83
|
-
"@aztec/noir-types": "5.0.0-rc.
|
|
84
|
-
"@aztec/protocol-contracts": "5.0.0-rc.
|
|
85
|
-
"@aztec/simulator": "5.0.0-rc.
|
|
86
|
-
"@aztec/standard-contracts": "5.0.0-rc.
|
|
87
|
-
"@aztec/stdlib": "5.0.0-rc.
|
|
74
|
+
"@aztec/bb-prover": "5.0.0-rc.2",
|
|
75
|
+
"@aztec/bb.js": "5.0.0-rc.2",
|
|
76
|
+
"@aztec/builder": "5.0.0-rc.2",
|
|
77
|
+
"@aztec/constants": "5.0.0-rc.2",
|
|
78
|
+
"@aztec/ethereum": "5.0.0-rc.2",
|
|
79
|
+
"@aztec/foundation": "5.0.0-rc.2",
|
|
80
|
+
"@aztec/key-store": "5.0.0-rc.2",
|
|
81
|
+
"@aztec/kv-store": "5.0.0-rc.2",
|
|
82
|
+
"@aztec/noir-protocol-circuits-types": "5.0.0-rc.2",
|
|
83
|
+
"@aztec/noir-types": "5.0.0-rc.2",
|
|
84
|
+
"@aztec/protocol-contracts": "5.0.0-rc.2",
|
|
85
|
+
"@aztec/simulator": "5.0.0-rc.2",
|
|
86
|
+
"@aztec/standard-contracts": "5.0.0-rc.2",
|
|
87
|
+
"@aztec/stdlib": "5.0.0-rc.2",
|
|
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": "5.0.0-rc.
|
|
97
|
-
"@aztec/world-state": "5.0.0-rc.
|
|
96
|
+
"@aztec/noir-test-contracts.js": "5.0.0-rc.2",
|
|
97
|
+
"@aztec/world-state": "5.0.0-rc.2",
|
|
98
98
|
"@jest/globals": "^30.0.0",
|
|
99
99
|
"@types/jest": "^30.0.0",
|
|
100
100
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -1,29 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
type BlockData,
|
|
4
|
-
type BlockQuery,
|
|
5
|
-
type BlocksQuery,
|
|
6
|
-
type CheckpointsQuery,
|
|
7
|
-
L2Block,
|
|
8
|
-
type L2BlockSource,
|
|
9
|
-
} from '@aztec/stdlib/block';
|
|
10
|
-
import { Checkpoint, L1PublishedData, PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
1
|
+
import { type BlockData, type BlockQuery, type BlocksQuery, L2Block, type L2BlockSource } from '@aztec/stdlib/block';
|
|
11
2
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
12
3
|
|
|
13
4
|
/**
|
|
14
5
|
* Lifts an {@link AztecNode} RPC client into the shape {@link L2BlockStream} expects.
|
|
15
|
-
* `getBlocks` requests transaction bodies so that real `L2Block` instances can be constructed
|
|
16
|
-
* `
|
|
17
|
-
*
|
|
6
|
+
* `getBlocks` requests transaction bodies so that real `L2Block` instances can be constructed. The stream no
|
|
7
|
+
* longer fetches checkpoint payloads (the `chain-checkpointed` event is a thin tip event), so `getCheckpoints`
|
|
8
|
+
* is not part of the lifted shape.
|
|
18
9
|
*/
|
|
19
10
|
export function blockStreamSourceFromAztecNode(
|
|
20
11
|
node: AztecNode,
|
|
21
|
-
): Pick<L2BlockSource, 'getBlocks' | 'getBlockData' | 'getL2Tips'
|
|
12
|
+
): Pick<L2BlockSource, 'getBlocks' | 'getBlockData' | 'getL2Tips'> {
|
|
22
13
|
return {
|
|
23
|
-
getL2Tips:
|
|
24
|
-
const tips = await node.getChainTips();
|
|
25
|
-
return { ...tips, proposedCheckpoint: tips.checkpointed };
|
|
26
|
-
},
|
|
14
|
+
getL2Tips: () => node.getChainTips(),
|
|
27
15
|
|
|
28
16
|
async getBlockData(query: BlockQuery): Promise<BlockData | undefined> {
|
|
29
17
|
const response = await node.getBlock(query);
|
|
@@ -50,32 +38,5 @@ export function blockStreamSourceFromAztecNode(
|
|
|
50
38
|
const responses = await node.getBlocks(query.from, query.limit, { includeTransactions: true });
|
|
51
39
|
return responses.map(r => new L2Block(r.archive, r.header, r.body!, r.checkpointNumber, r.indexWithinCheckpoint));
|
|
52
40
|
},
|
|
53
|
-
|
|
54
|
-
async getCheckpoints(query: CheckpointsQuery): Promise<PublishedCheckpoint[]> {
|
|
55
|
-
if (!('from' in query)) {
|
|
56
|
-
throw new Error('getCheckpoints with epoch query not supported via AztecNode RPC');
|
|
57
|
-
}
|
|
58
|
-
const { from, limit } = query;
|
|
59
|
-
const responses = await node.getCheckpoints(from, limit, {
|
|
60
|
-
includeBlocks: true,
|
|
61
|
-
includeTransactions: true,
|
|
62
|
-
includeL1PublishInfo: true,
|
|
63
|
-
includeAttestations: true,
|
|
64
|
-
});
|
|
65
|
-
return responses.map(r => {
|
|
66
|
-
const checkpoint = new Checkpoint(
|
|
67
|
-
r.archive,
|
|
68
|
-
r.header,
|
|
69
|
-
r.blocks!.map(b => new L2Block(b.archive, b.header, b.body!, b.checkpointNumber, b.indexWithinCheckpoint)),
|
|
70
|
-
r.number,
|
|
71
|
-
r.feeAssetPriceModifier,
|
|
72
|
-
);
|
|
73
|
-
const l1 =
|
|
74
|
-
r.l1?.published === true
|
|
75
|
-
? new L1PublishedData(r.l1.blockNumber, r.l1.timestamp, r.l1.blockHash)
|
|
76
|
-
: new L1PublishedData(0n, 0n, Fr.ZERO.toString());
|
|
77
|
-
return new PublishedCheckpoint(checkpoint, l1, r.attestations ?? []);
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
41
|
};
|
|
81
42
|
}
|