@aztec/stdlib 1.0.0-nightly.20250620 → 1.0.0-nightly.20250622
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/abi/contract_artifact.d.ts +1 -1
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/avm/avm.d.ts +1 -1
- package/dest/database-version/version_manager.js +2 -2
- package/dest/hash/hash.d.ts +8 -0
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +12 -0
- package/dest/interfaces/aztec-node.d.ts +1 -1
- package/dest/snapshots/download.js +2 -2
- package/dest/tx/index.d.ts +1 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +1 -1
- package/dest/tx/offchain_effect.d.ts +14 -0
- package/dest/tx/offchain_effect.d.ts.map +1 -0
- package/dest/tx/offchain_effect.js +3 -0
- package/dest/tx/private_execution_result.d.ts +11 -14
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +16 -19
- package/dest/tx/proven_tx.d.ts +2 -2
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +3 -3
- package/dest/update-checker/update-checker.d.ts +2 -0
- package/dest/update-checker/update-checker.d.ts.map +1 -1
- package/dest/update-checker/update-checker.js +11 -2
- package/package.json +7 -7
- package/src/abi/contract_artifact.ts +1 -1
- package/src/database-version/version_manager.ts +2 -2
- package/src/hash/hash.ts +11 -0
- package/src/interfaces/aztec-node.ts +1 -1
- package/src/snapshots/download.ts +2 -2
- package/src/tx/index.ts +1 -1
- package/src/tx/offchain_effect.ts +19 -0
- package/src/tx/private_execution_result.ts +15 -17
- package/src/tx/proven_tx.ts +4 -4
- package/src/update-checker/update-checker.ts +14 -1
- package/dest/tx/offchain_message.d.ts +0 -15
- package/dest/tx/offchain_message.d.ts.map +0 -1
- package/dest/tx/offchain_message.js +0 -4
- package/src/tx/offchain_message.ts +0 -16
|
@@ -11,7 +11,7 @@ export declare function contractArtifactToBuffer(artifact: ContractArtifact): Bu
|
|
|
11
11
|
* @param buffer - Buffer to deserialize.
|
|
12
12
|
* @returns Deserialized artifact.
|
|
13
13
|
*/
|
|
14
|
-
export declare function contractArtifactFromBuffer(buffer: Buffer):
|
|
14
|
+
export declare function contractArtifactFromBuffer(buffer: Buffer): ContractArtifact;
|
|
15
15
|
/**
|
|
16
16
|
* Gets nargo build output and returns a valid contract artifact instance.
|
|
17
17
|
* Does not include public bytecode, apart from the public_dispatch function.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract_artifact.d.ts","sourceRoot":"","sources":["../../src/abi/contract_artifact.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,gBAAgB,EAKrB,KAAK,gBAAgB,EAKtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAOL,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"contract_artifact.d.ts","sourceRoot":"","sources":["../../src/abi/contract_artifact.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,gBAAgB,EAKrB,KAAK,gBAAgB,EAKtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAOL,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAE3E;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,oBAAoB,GAAG,gBAAgB,CAKlF;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,oBAAoB,GAAG,gBAAgB,CAE3F;AA+DD,yDAAyD;AACzD,KAAK,4BAA4B,GAAG,oBAAoB,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAE9E;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,4BAA4B,GAAG,gBAAgB,GAAG,OAAO,CAI9F"}
|
package/dest/avm/avm.d.ts
CHANGED
|
@@ -10047,7 +10047,7 @@ export declare class AvmCircuitInputs {
|
|
|
10047
10047
|
}>;
|
|
10048
10048
|
serializeWithMessagePack(): Buffer;
|
|
10049
10049
|
toBuffer(): Buffer;
|
|
10050
|
-
static fromBuffer(buf: Buffer):
|
|
10050
|
+
static fromBuffer(buf: Buffer): AvmCircuitInputs;
|
|
10051
10051
|
}
|
|
10052
10052
|
export {};
|
|
10053
10053
|
//# sourceMappingURL=avm.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import {
|
|
2
|
+
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import fs from 'fs/promises';
|
|
5
5
|
import { inspect } from 'node:util';
|
|
@@ -19,7 +19,7 @@ import { z } from 'zod';
|
|
|
19
19
|
}
|
|
20
20
|
static fromBuffer(buf) {
|
|
21
21
|
try {
|
|
22
|
-
return
|
|
22
|
+
return jsonParseWithSchema(buf.toString('utf-8'), DatabaseVersion.schema);
|
|
23
23
|
} catch (err) {
|
|
24
24
|
throw new Error(`Failed to deserialize version information: ${err}`, {
|
|
25
25
|
cause: err
|
package/dest/hash/hash.d.ts
CHANGED
|
@@ -37,6 +37,14 @@ export declare function computeUniqueNoteHash(noteNonce: Fr, siloedNoteHash: Fr)
|
|
|
37
37
|
* @returns A siloed nullifier.
|
|
38
38
|
*/
|
|
39
39
|
export declare function siloNullifier(contract: AztecAddress, innerNullifier: Fr): Promise<Fr>;
|
|
40
|
+
/**
|
|
41
|
+
* Computes a siloed private log tag, given the contract address and the unsiloed tag.
|
|
42
|
+
* A siloed private log tag effectively namespaces a log to a specific contract.
|
|
43
|
+
* @param contract - The contract address.
|
|
44
|
+
* @param unsiloedTag - The unsiloed tag.
|
|
45
|
+
* @returns A siloed private log tag.
|
|
46
|
+
*/
|
|
47
|
+
export declare function siloPrivateLog(contract: AztecAddress, unsiloedTag: Fr): Promise<Fr>;
|
|
40
48
|
/**
|
|
41
49
|
* Computes a public data tree value ready for insertion.
|
|
42
50
|
* @param value - Raw public data tree value to hash into a tree-insertion-ready value.
|
package/dest/hash/hash.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/hash/hash.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,WAAW,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,EAAE,CAAC,CAE1F;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAE9E;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC,CAEpF;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,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YAAY,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,eAMtG;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,QAAQ,EACR,WAAW,EACX,OAAO,EACP,aAAa,EACb,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,YAAY,CAAC;IACvB,WAAW,EAAE,UAAU,CAAC;IACxB,OAAO,EAAE,EAAE,CAAC;IACZ,aAAa,EAAE,EAAE,CAAC;IAClB,OAAO,EAAE,EAAE,CAAC;CACb,MAEA"}
|
package/dest/hash/hash.js
CHANGED
|
@@ -54,6 +54,18 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
54
54
|
innerNullifier
|
|
55
55
|
], GeneratorIndex.OUTER_NULLIFIER);
|
|
56
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Computes a siloed private log tag, given the contract address and the unsiloed tag.
|
|
59
|
+
* A siloed private log tag effectively namespaces a log to a specific contract.
|
|
60
|
+
* @param contract - The contract address.
|
|
61
|
+
* @param unsiloedTag - The unsiloed tag.
|
|
62
|
+
* @returns A siloed private log tag.
|
|
63
|
+
*/ export function siloPrivateLog(contract, unsiloedTag) {
|
|
64
|
+
return poseidon2Hash([
|
|
65
|
+
contract,
|
|
66
|
+
unsiloedTag
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
57
69
|
/**
|
|
58
70
|
* Computes a public data tree value ready for insertion.
|
|
59
71
|
* @param value - Raw public data tree value to hash into a tree-insertion-ready value.
|
|
@@ -136,7 +136,7 @@ export interface AztecNode extends Pick<L2BlockSource, 'getBlocks' | 'getPublish
|
|
|
136
136
|
*/
|
|
137
137
|
getBlock(number: L2BlockNumber): Promise<L2Block | undefined>;
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* Method to fetch the latest block number synchronized by the node.
|
|
140
140
|
* @returns The block number.
|
|
141
141
|
*/
|
|
142
142
|
getBlockNumber(): Promise<number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fromEntries, getEntries, maxBy } from '@aztec/foundation/collection';
|
|
2
|
-
import {
|
|
2
|
+
import { jsonParseWithSchema } from '@aztec/foundation/json-rpc';
|
|
3
3
|
import { SnapshotDataKeys, SnapshotsIndexSchema } from './types.js';
|
|
4
4
|
export async function getSnapshotIndex(metadata, store) {
|
|
5
5
|
const basePath = getBasePath(metadata);
|
|
@@ -7,7 +7,7 @@ export async function getSnapshotIndex(metadata, store) {
|
|
|
7
7
|
try {
|
|
8
8
|
if (await store.exists(snapshotIndexPath)) {
|
|
9
9
|
const snapshotIndexData = await store.read(snapshotIndexPath);
|
|
10
|
-
return
|
|
10
|
+
return jsonParseWithSchema(snapshotIndexData.toString(), SnapshotsIndexSchema);
|
|
11
11
|
} else {
|
|
12
12
|
return undefined;
|
|
13
13
|
}
|
package/dest/tx/index.d.ts
CHANGED
|
@@ -29,6 +29,6 @@ export * from './capsule.js';
|
|
|
29
29
|
export * from './global_variable_builder.js';
|
|
30
30
|
export * from './hashed_values.js';
|
|
31
31
|
export * from './indexed_tx_effect.js';
|
|
32
|
-
export * from './
|
|
32
|
+
export * from './offchain_effect.js';
|
|
33
33
|
export * from './profiling.js';
|
|
34
34
|
//# sourceMappingURL=index.d.ts.map
|
package/dest/tx/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tx/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,+BAA+B,CAAC;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B,CAAC;AAC5C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,cAAc,CAAC;AAC7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC"}
|
package/dest/tx/index.js
CHANGED
|
@@ -29,5 +29,5 @@ export * from './capsule.js';
|
|
|
29
29
|
export * from './global_variable_builder.js';
|
|
30
30
|
export * from './hashed_values.js';
|
|
31
31
|
export * from './indexed_tx_effect.js';
|
|
32
|
-
export * from './
|
|
32
|
+
export * from './offchain_effect.js';
|
|
33
33
|
export * from './profiling.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
import type { AztecAddress } from '../aztec-address/index.js';
|
|
3
|
+
export declare const OFFCHAIN_MESSAGE_IDENTIFIER: Fr;
|
|
4
|
+
/**
|
|
5
|
+
* Represents an offchain effect emitted via the `emit_offchain_effect` oracle (see the oracle documentation for
|
|
6
|
+
* more details).
|
|
7
|
+
*/
|
|
8
|
+
export type OffchainEffect = {
|
|
9
|
+
/** The emitted data */
|
|
10
|
+
data: Fr[];
|
|
11
|
+
/** The contract that emitted the data */
|
|
12
|
+
contractAddress: AztecAddress;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=offchain_effect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"offchain_effect.d.ts","sourceRoot":"","sources":["../../src/tx/offchain_effect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAG9D,eAAO,MAAM,2BAA2B,EAAE,EAEzC,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,uBAAuB;IACvB,IAAI,EAAE,EAAE,EAAE,CAAC;IACX,yCAAyC;IACzC,eAAe,EAAE,YAAY,CAAC;CAC/B,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
2
2
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { NoteSelector } from '../abi/note_selector.js';
|
|
5
|
-
import { AztecAddress } from '../aztec-address/index.js';
|
|
6
5
|
import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
|
|
7
6
|
import type { IsEmpty } from '../kernel/utils/interfaces.js';
|
|
8
7
|
import { ContractClassLog, ContractClassLogFields } from '../logs/contract_class_log.js';
|
|
@@ -10,7 +9,7 @@ import { Note } from '../note/note.js';
|
|
|
10
9
|
import { type ZodFor } from '../schemas/index.js';
|
|
11
10
|
import type { UInt32 } from '../types/index.js';
|
|
12
11
|
import { HashedValues } from './hashed_values.js';
|
|
13
|
-
import type {
|
|
12
|
+
import type { OffchainEffect } from './offchain_effect.js';
|
|
14
13
|
/**
|
|
15
14
|
* The contents of a new note.
|
|
16
15
|
*/
|
|
@@ -119,10 +118,9 @@ export declare class PrivateCallExecutionResult {
|
|
|
119
118
|
noteHashNullifierCounterMap: Map<number, number>;
|
|
120
119
|
/** The raw return values of the executed function. */
|
|
121
120
|
returnValues: Fr[];
|
|
122
|
-
/** The offchain
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
recipient: AztecAddress;
|
|
121
|
+
/** The offchain effects emitted during execution of this function call via the `emit_offchain_effect` oracle. */
|
|
122
|
+
offchainEffects: {
|
|
123
|
+
data: Fr[];
|
|
126
124
|
}[];
|
|
127
125
|
/** The nested executions. */
|
|
128
126
|
nestedExecutions: PrivateCallExecutionResult[];
|
|
@@ -150,10 +148,9 @@ export declare class PrivateCallExecutionResult {
|
|
|
150
148
|
noteHashNullifierCounterMap: Map<number, number>,
|
|
151
149
|
/** The raw return values of the executed function. */
|
|
152
150
|
returnValues: Fr[],
|
|
153
|
-
/** The offchain
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
recipient: AztecAddress;
|
|
151
|
+
/** The offchain effects emitted during execution of this function call via the `emit_offchain_effect` oracle. */
|
|
152
|
+
offchainEffects: {
|
|
153
|
+
data: Fr[];
|
|
157
154
|
}[],
|
|
158
155
|
/** The nested executions. */
|
|
159
156
|
nestedExecutions: PrivateCallExecutionResult[],
|
|
@@ -176,11 +173,11 @@ export declare function collectNoteHashNullifierCounterMap(execResult: PrivateEx
|
|
|
176
173
|
*/
|
|
177
174
|
export declare function collectSortedContractClassLogs(execResult: PrivateExecutionResult): ContractClassLogFields[];
|
|
178
175
|
/**
|
|
179
|
-
* Collect all offchain
|
|
180
|
-
* @param execResult - The execution result to collect
|
|
181
|
-
* @returns Array of offchain
|
|
176
|
+
* Collect all offchain effects emitted across all nested executions.
|
|
177
|
+
* @param execResult - The execution result to collect offchain effects from.
|
|
178
|
+
* @returns Array of offchain effects.
|
|
182
179
|
*/
|
|
183
|
-
export declare function
|
|
180
|
+
export declare function collectOffchainEffects(execResult: PrivateExecutionResult): OffchainEffect[];
|
|
184
181
|
export declare function getFinalMinRevertibleSideEffectCounter(execResult: PrivateExecutionResult): number;
|
|
185
182
|
export declare function collectNested<T>(executionStack: PrivateCallExecutionResult[], extractExecutionItems: (execution: PrivateCallExecutionResult) => T[]): T[];
|
|
186
183
|
export declare class PrivateExecutionProfileResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_execution_result.d.ts","sourceRoot":"","sources":["../../src/tx/private_execution_result.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAA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ACH,wBAAgB,8BAA8B,CAAC,UAAU,EAAE,sBAAsB,GAAG,sBAAsB,EAAE,CAI3G;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,sBAAsB,GAAG,cAAc,EAAE,CAW3F;AAED,wBAAgB,sCAAsC,CAAC,UAAU,EAAE,sBAAsB,GAAG,MAAM,CAQjG;AAED,wBAAgB,aAAa,CAAC,CAAC,EAC7B,cAAc,EAAE,0BAA0B,EAAE,EAC5C,qBAAqB,EAAE,CAAC,SAAS,EAAE,0BAA0B,KAAK,CAAC,EAAE,GACpE,CAAC,EAAE,CAML;AAED,qBAAa,6BAA6B;IACrB,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAA;KAAE;gBAA1E,OAAO,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,KAAK,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC,CAAA;KAAE;CAC9F"}
|
|
@@ -3,7 +3,6 @@ import { randomBytes, randomInt } from '@aztec/foundation/crypto';
|
|
|
3
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { NoteSelector } from '../abi/note_selector.js';
|
|
6
|
-
import { AztecAddress } from '../aztec-address/index.js';
|
|
7
6
|
import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
|
|
8
7
|
import { sortByCounter } from '../kernel/utils/order_and_comparison.js';
|
|
9
8
|
import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
@@ -97,13 +96,13 @@ export class PrivateExecutionResult {
|
|
|
97
96
|
newNotes;
|
|
98
97
|
noteHashNullifierCounterMap;
|
|
99
98
|
returnValues;
|
|
100
|
-
|
|
99
|
+
offchainEffects;
|
|
101
100
|
nestedExecutions;
|
|
102
101
|
contractClassLogs;
|
|
103
102
|
profileResult;
|
|
104
103
|
constructor(// Needed for prover
|
|
105
104
|
/** The ACIR bytecode. */ acir, /** The verification key. */ vk, /** The partial witness. */ partialWitness, // Needed for the verifier (kernel)
|
|
106
|
-
/** The call stack item. */ publicInputs, /** Mapping of note hash to its index in the note hash tree. Used for building hints for note hash read requests. */ noteHashLeafIndexMap, /** The notes created in the executed function. */ newNotes, /** Mapping of note hash counter to the counter of its nullifier. */ noteHashNullifierCounterMap, /** The raw return values of the executed function. */ returnValues, /** The offchain
|
|
105
|
+
/** The call stack item. */ publicInputs, /** Mapping of note hash to its index in the note hash tree. Used for building hints for note hash read requests. */ noteHashLeafIndexMap, /** The notes created in the executed function. */ newNotes, /** Mapping of note hash counter to the counter of its nullifier. */ noteHashNullifierCounterMap, /** The raw return values of the executed function. */ returnValues, /** The offchain effects emitted during execution of this function call via the `emit_offchain_effect` oracle. */ offchainEffects, /** The nested executions. */ nestedExecutions, /**
|
|
107
106
|
* Contract class logs emitted during execution of this function call.
|
|
108
107
|
* Note: We only need to collect the ContractClassLogFields as preimages for the tx.
|
|
109
108
|
* But keep them as ContractClassLog so that we can verify the log hashes before submitting the tx (TODO).
|
|
@@ -116,7 +115,7 @@ export class PrivateExecutionResult {
|
|
|
116
115
|
this.newNotes = newNotes;
|
|
117
116
|
this.noteHashNullifierCounterMap = noteHashNullifierCounterMap;
|
|
118
117
|
this.returnValues = returnValues;
|
|
119
|
-
this.
|
|
118
|
+
this.offchainEffects = offchainEffects;
|
|
120
119
|
this.nestedExecutions = nestedExecutions;
|
|
121
120
|
this.contractClassLogs = contractClassLogs;
|
|
122
121
|
this.profileResult = profileResult;
|
|
@@ -131,16 +130,15 @@ export class PrivateExecutionResult {
|
|
|
131
130
|
newNotes: z.array(NoteAndSlot.schema),
|
|
132
131
|
noteHashNullifierCounterMap: mapSchema(z.coerce.number(), z.number()),
|
|
133
132
|
returnValues: z.array(schemas.Fr),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
recipient: AztecAddress.schema
|
|
133
|
+
offchainEffects: z.array(z.object({
|
|
134
|
+
data: z.array(schemas.Fr)
|
|
137
135
|
})),
|
|
138
136
|
nestedExecutions: z.array(z.lazy(()=>PrivateCallExecutionResult.schema)),
|
|
139
137
|
contractClassLogs: z.array(CountedContractClassLog.schema)
|
|
140
138
|
}).transform(PrivateCallExecutionResult.from);
|
|
141
139
|
}
|
|
142
140
|
static from(fields) {
|
|
143
|
-
return new PrivateCallExecutionResult(fields.acir, fields.vk, fields.partialWitness, fields.publicInputs, fields.noteHashLeafIndexMap, fields.newNotes, fields.noteHashNullifierCounterMap, fields.returnValues, fields.
|
|
141
|
+
return new PrivateCallExecutionResult(fields.acir, fields.vk, fields.partialWitness, fields.publicInputs, fields.noteHashLeafIndexMap, fields.newNotes, fields.noteHashNullifierCounterMap, fields.returnValues, fields.offchainEffects, fields.nestedExecutions, fields.contractClassLogs);
|
|
144
142
|
}
|
|
145
143
|
static async random(nested = 1) {
|
|
146
144
|
return new PrivateCallExecutionResult(randomBytes(4), randomBytes(4), new Map([
|
|
@@ -164,10 +162,9 @@ export class PrivateExecutionResult {
|
|
|
164
162
|
Fr.random()
|
|
165
163
|
], [
|
|
166
164
|
{
|
|
167
|
-
|
|
165
|
+
data: [
|
|
168
166
|
Fr.random()
|
|
169
|
-
]
|
|
170
|
-
recipient: await AztecAddress.random()
|
|
167
|
+
]
|
|
171
168
|
}
|
|
172
169
|
], await timesParallel(nested, ()=>PrivateCallExecutionResult.random(0)), [
|
|
173
170
|
new CountedContractClassLog(await ContractClassLog.random(), randomInt(10))
|
|
@@ -212,20 +209,20 @@ export function collectNoteHashNullifierCounterMap(execResult) {
|
|
|
212
209
|
return sortedLogs.map((l)=>l.log.fields);
|
|
213
210
|
}
|
|
214
211
|
/**
|
|
215
|
-
* Collect all offchain
|
|
216
|
-
* @param execResult - The execution result to collect
|
|
217
|
-
* @returns Array of offchain
|
|
218
|
-
*/ export function
|
|
219
|
-
const
|
|
212
|
+
* Collect all offchain effects emitted across all nested executions.
|
|
213
|
+
* @param execResult - The execution result to collect offchain effects from.
|
|
214
|
+
* @returns Array of offchain effects.
|
|
215
|
+
*/ export function collectOffchainEffects(execResult) {
|
|
216
|
+
const collectEffectsRecursive = (callResult)=>{
|
|
220
217
|
return [
|
|
221
|
-
...callResult.
|
|
218
|
+
...callResult.offchainEffects.map((msg)=>({
|
|
222
219
|
...msg,
|
|
223
220
|
contractAddress: callResult.publicInputs.callContext.contractAddress
|
|
224
221
|
})),
|
|
225
|
-
...callResult.nestedExecutions.flatMap((nested)=>
|
|
222
|
+
...callResult.nestedExecutions.flatMap((nested)=>collectEffectsRecursive(nested))
|
|
226
223
|
];
|
|
227
224
|
};
|
|
228
|
-
return
|
|
225
|
+
return collectEffectsRecursive(execResult.entrypoint);
|
|
229
226
|
}
|
|
230
227
|
export function getFinalMinRevertibleSideEffectCounter(execResult) {
|
|
231
228
|
const collectFinalMinRevertibleSideEffectCounterRecursive = (callResult)=>{
|
package/dest/tx/proven_tx.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
4
4
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { OffchainEffect } from './offchain_effect.js';
|
|
6
6
|
import { PrivateExecutionResult } from './private_execution_result.js';
|
|
7
7
|
import { type ProvingStats } from './profiling.js';
|
|
8
8
|
import { Tx } from './tx.js';
|
|
@@ -13,7 +13,7 @@ export declare class TxProvingResult {
|
|
|
13
13
|
stats?: ProvingStats | undefined;
|
|
14
14
|
constructor(privateExecutionResult: PrivateExecutionResult, publicInputs: PrivateKernelTailCircuitPublicInputs, clientIvcProof: ClientIvcProof, stats?: ProvingStats | undefined);
|
|
15
15
|
toTx(): Tx;
|
|
16
|
-
|
|
16
|
+
getOffchainEffects(): OffchainEffect[];
|
|
17
17
|
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
18
18
|
privateExecutionResult: import("@aztec/foundation/schemas").ZodFor<PrivateExecutionResult>;
|
|
19
19
|
publicInputs: z.ZodType<PrivateKernelTailCircuitPublicInputs, any, string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proven_tx.d.ts","sourceRoot":"","sources":["../../src/tx/proven_tx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oCAAoC,EAAE,MAAM,wDAAwD,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"proven_tx.d.ts","sourceRoot":"","sources":["../../src/tx/proven_tx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oCAAoC,EAAE,MAAM,wDAAwD,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EACL,sBAAsB,EAGvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,qBAAa,eAAe;IAEjB,sBAAsB,EAAE,sBAAsB;IAC9C,YAAY,EAAE,oCAAoC;IAClD,cAAc,EAAE,cAAc;IAC9B,KAAK,CAAC,EAAE,YAAY;gBAHpB,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,oCAAoC,EAClD,cAAc,EAAE,cAAc,EAC9B,KAAK,CAAC,EAAE,YAAY,YAAA;IAG7B,IAAI,IAAI,EAAE;IAYV,kBAAkB,IAAI,cAAc,EAAE;IAItC,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAShB;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC;WAIhC,MAAM;CAOpB"}
|
package/dest/tx/proven_tx.js
CHANGED
|
@@ -2,7 +2,7 @@ import { optional } from '@aztec/foundation/schemas';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
4
4
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
5
|
-
import { PrivateExecutionResult,
|
|
5
|
+
import { PrivateExecutionResult, collectOffchainEffects, collectSortedContractClassLogs } from './private_execution_result.js';
|
|
6
6
|
import { ProvingTimingsSchema } from './profiling.js';
|
|
7
7
|
import { Tx } from './tx.js';
|
|
8
8
|
export class TxProvingResult {
|
|
@@ -21,8 +21,8 @@ export class TxProvingResult {
|
|
|
21
21
|
const tx = new Tx(this.publicInputs, this.clientIvcProof, contractClassLogs, this.privateExecutionResult.publicFunctionCalldata);
|
|
22
22
|
return tx;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
getOffchainEffects() {
|
|
25
|
+
return collectOffchainEffects(this.privateExecutionResult);
|
|
26
26
|
}
|
|
27
27
|
static get schema() {
|
|
28
28
|
return z.object({
|
|
@@ -11,6 +11,7 @@ export type EventMap = {
|
|
|
11
11
|
latestVersion: string;
|
|
12
12
|
}];
|
|
13
13
|
updateNodeConfig: [object];
|
|
14
|
+
updatePublicTelemetryConfig: [object];
|
|
14
15
|
};
|
|
15
16
|
type Config = {
|
|
16
17
|
baseURL: URL;
|
|
@@ -30,6 +31,7 @@ export declare class UpdateChecker extends EventEmitter<EventMap> {
|
|
|
30
31
|
private log;
|
|
31
32
|
private runningPromise;
|
|
32
33
|
private lastPatchedConfig;
|
|
34
|
+
private lastPatchedPublicTelemetryConfig;
|
|
33
35
|
constructor(updatesUrl: URL, nodeVersion: string | undefined, rollupVersion: bigint, fetch: typeof globalThis.fetch, getLatestRollupVersion: () => Promise<bigint>, checkIntervalMs?: number, // every minute
|
|
34
36
|
log?: import("@aztec/foundation/log").Logger);
|
|
35
37
|
static new(config: Config): Promise<UpdateChecker>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update-checker.d.ts","sourceRoot":"","sources":["../../src/update-checker/update-checker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"update-checker.d.ts","sourceRoot":"","sources":["../../src/update-checker/update-checker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAYtC,MAAM,MAAM,QAAQ,GAAG;IACrB,gBAAgB,EAAE,CAAC;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACtE,cAAc,EAAE,CAAC;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACpE,gBAAgB,EAAE,CAA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|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
const updateConfigSchema = z.object({
|
|
11
11
|
version: z.string().optional(),
|
|
12
|
+
publicTelemetry: z.any().optional(),
|
|
12
13
|
config: z.any().optional()
|
|
13
14
|
});
|
|
14
15
|
export class UpdateChecker extends EventEmitter {
|
|
@@ -21,8 +22,9 @@ export class UpdateChecker extends EventEmitter {
|
|
|
21
22
|
log;
|
|
22
23
|
runningPromise;
|
|
23
24
|
lastPatchedConfig;
|
|
25
|
+
lastPatchedPublicTelemetryConfig;
|
|
24
26
|
constructor(updatesUrl, nodeVersion, rollupVersion, fetch1, getLatestRollupVersion, checkIntervalMs = 60_000, log = createLogger('foundation:update-check')){
|
|
25
|
-
super(), this.updatesUrl = updatesUrl, this.nodeVersion = nodeVersion, this.rollupVersion = rollupVersion, this.fetch = fetch1, this.getLatestRollupVersion = getLatestRollupVersion, this.checkIntervalMs = checkIntervalMs, this.log = log, this.lastPatchedConfig = {}, this.runChecks = async ()=>{
|
|
27
|
+
super(), this.updatesUrl = updatesUrl, this.nodeVersion = nodeVersion, this.rollupVersion = rollupVersion, this.fetch = fetch1, this.getLatestRollupVersion = getLatestRollupVersion, this.checkIntervalMs = checkIntervalMs, this.log = log, this.lastPatchedConfig = {}, this.lastPatchedPublicTelemetryConfig = {}, this.runChecks = async ()=>{
|
|
26
28
|
await Promise.all([
|
|
27
29
|
this.checkRollupVersion(),
|
|
28
30
|
this.checkConfig()
|
|
@@ -85,7 +87,7 @@ export class UpdateChecker extends EventEmitter {
|
|
|
85
87
|
url: this.updatesUrl
|
|
86
88
|
});
|
|
87
89
|
}
|
|
88
|
-
const { version, config } = updateConfigSchema.parse(body);
|
|
90
|
+
const { version, config, publicTelemetry } = updateConfigSchema.parse(body);
|
|
89
91
|
if (this.nodeVersion && version && version !== this.nodeVersion) {
|
|
90
92
|
this.log.debug('New node version', {
|
|
91
93
|
currentVersion: this.nodeVersion,
|
|
@@ -103,6 +105,13 @@ export class UpdateChecker extends EventEmitter {
|
|
|
103
105
|
this.lastPatchedConfig = config;
|
|
104
106
|
this.emit('updateNodeConfig', config);
|
|
105
107
|
}
|
|
108
|
+
if (publicTelemetry && Object.keys(publicTelemetry).length > 0 && !isDeepStrictEqual(publicTelemetry, this.lastPatchedPublicTelemetryConfig)) {
|
|
109
|
+
this.log.debug('New metrics config', {
|
|
110
|
+
config
|
|
111
|
+
});
|
|
112
|
+
this.lastPatchedPublicTelemetryConfig = publicTelemetry;
|
|
113
|
+
this.emit('updatePublicTelemetryConfig', publicTelemetry);
|
|
114
|
+
}
|
|
106
115
|
} catch (err) {
|
|
107
116
|
this.log.warn(`Failed to check if there is an update`, err);
|
|
108
117
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250622",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/bb.js": "1.0.0-nightly.
|
|
71
|
-
"@aztec/blob-lib": "1.0.0-nightly.
|
|
72
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
73
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
74
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
75
|
-
"@aztec/noir-noirc_abi": "1.0.0-nightly.
|
|
70
|
+
"@aztec/bb.js": "1.0.0-nightly.20250622",
|
|
71
|
+
"@aztec/blob-lib": "1.0.0-nightly.20250622",
|
|
72
|
+
"@aztec/constants": "1.0.0-nightly.20250622",
|
|
73
|
+
"@aztec/ethereum": "1.0.0-nightly.20250622",
|
|
74
|
+
"@aztec/foundation": "1.0.0-nightly.20250622",
|
|
75
|
+
"@aztec/noir-noirc_abi": "1.0.0-nightly.20250622",
|
|
76
76
|
"@google-cloud/storage": "^7.15.0",
|
|
77
77
|
"axios": "^1.9.0",
|
|
78
78
|
"json-stringify-deterministic": "1.0.12",
|
|
@@ -40,7 +40,7 @@ export function contractArtifactToBuffer(artifact: ContractArtifact): Buffer {
|
|
|
40
40
|
* @param buffer - Buffer to deserialize.
|
|
41
41
|
* @returns Deserialized artifact.
|
|
42
42
|
*/
|
|
43
|
-
export function contractArtifactFromBuffer(buffer: Buffer):
|
|
43
|
+
export function contractArtifactFromBuffer(buffer: Buffer): ContractArtifact {
|
|
44
44
|
return jsonParseWithSchema(buffer.toString('utf-8'), ContractArtifactSchema);
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import {
|
|
2
|
+
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
3
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
4
4
|
|
|
5
5
|
import fs from 'fs/promises';
|
|
@@ -24,7 +24,7 @@ export class DatabaseVersion {
|
|
|
24
24
|
|
|
25
25
|
public static fromBuffer(buf: Buffer): DatabaseVersion {
|
|
26
26
|
try {
|
|
27
|
-
return
|
|
27
|
+
return jsonParseWithSchema(buf.toString('utf-8'), DatabaseVersion.schema);
|
|
28
28
|
} catch (err) {
|
|
29
29
|
throw new Error(`Failed to deserialize version information: ${err}`, { cause: err });
|
|
30
30
|
}
|
package/src/hash/hash.ts
CHANGED
|
@@ -56,6 +56,17 @@ export function siloNullifier(contract: AztecAddress, innerNullifier: Fr): Promi
|
|
|
56
56
|
return poseidon2HashWithSeparator([contract, innerNullifier], GeneratorIndex.OUTER_NULLIFIER);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Computes a siloed private log tag, given the contract address and the unsiloed tag.
|
|
61
|
+
* A siloed private log tag effectively namespaces a log to a specific contract.
|
|
62
|
+
* @param contract - The contract address.
|
|
63
|
+
* @param unsiloedTag - The unsiloed tag.
|
|
64
|
+
* @returns A siloed private log tag.
|
|
65
|
+
*/
|
|
66
|
+
export function siloPrivateLog(contract: AztecAddress, unsiloedTag: Fr): Promise<Fr> {
|
|
67
|
+
return poseidon2Hash([contract, unsiloedTag]);
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
/**
|
|
60
71
|
* Computes a public data tree value ready for insertion.
|
|
61
72
|
* @param value - Raw public data tree value to hash into a tree-insertion-ready value.
|
|
@@ -220,7 +220,7 @@ export interface AztecNode
|
|
|
220
220
|
getBlock(number: L2BlockNumber): Promise<L2Block | undefined>;
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
|
-
*
|
|
223
|
+
* Method to fetch the latest block number synchronized by the node.
|
|
224
224
|
* @returns The block number.
|
|
225
225
|
*/
|
|
226
226
|
getBlockNumber(): Promise<number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fromEntries, getEntries, maxBy } from '@aztec/foundation/collection';
|
|
2
|
-
import {
|
|
2
|
+
import { jsonParseWithSchema } from '@aztec/foundation/json-rpc';
|
|
3
3
|
import type { ReadOnlyFileStore } from '@aztec/stdlib/file-store';
|
|
4
4
|
|
|
5
5
|
import {
|
|
@@ -20,7 +20,7 @@ export async function getSnapshotIndex(
|
|
|
20
20
|
try {
|
|
21
21
|
if (await store.exists(snapshotIndexPath)) {
|
|
22
22
|
const snapshotIndexData = await store.read(snapshotIndexPath);
|
|
23
|
-
return
|
|
23
|
+
return jsonParseWithSchema(snapshotIndexData.toString(), SnapshotsIndexSchema);
|
|
24
24
|
} else {
|
|
25
25
|
return undefined;
|
|
26
26
|
}
|
package/src/tx/index.ts
CHANGED
|
@@ -29,5 +29,5 @@ export * from './capsule.js';
|
|
|
29
29
|
export * from './global_variable_builder.js';
|
|
30
30
|
export * from './hashed_values.js';
|
|
31
31
|
export * from './indexed_tx_effect.js';
|
|
32
|
-
export * from './
|
|
32
|
+
export * from './offchain_effect.js';
|
|
33
33
|
export * from './profiling.js';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
+
|
|
3
|
+
import type { AztecAddress } from '../aztec-address/index.js';
|
|
4
|
+
|
|
5
|
+
// poseidon2hash("aztecnr_offchain_message")
|
|
6
|
+
export const OFFCHAIN_MESSAGE_IDENTIFIER: Fr = new Fr(
|
|
7
|
+
6023466688192654631553769360478808766602235351827869819420284624004071427516n,
|
|
8
|
+
);
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents an offchain effect emitted via the `emit_offchain_effect` oracle (see the oracle documentation for
|
|
12
|
+
* more details).
|
|
13
|
+
*/
|
|
14
|
+
export type OffchainEffect = {
|
|
15
|
+
/** The emitted data */
|
|
16
|
+
data: Fr[];
|
|
17
|
+
/** The contract that emitted the data */
|
|
18
|
+
contractAddress: AztecAddress;
|
|
19
|
+
};
|
|
@@ -6,7 +6,6 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
8
|
import { NoteSelector } from '../abi/note_selector.js';
|
|
9
|
-
import { AztecAddress } from '../aztec-address/index.js';
|
|
10
9
|
import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
|
|
11
10
|
import type { IsEmpty } from '../kernel/utils/interfaces.js';
|
|
12
11
|
import { sortByCounter } from '../kernel/utils/order_and_comparison.js';
|
|
@@ -15,7 +14,7 @@ import { Note } from '../note/note.js';
|
|
|
15
14
|
import { type ZodFor, mapSchema, schemas } from '../schemas/index.js';
|
|
16
15
|
import type { UInt32 } from '../types/index.js';
|
|
17
16
|
import { HashedValues } from './hashed_values.js';
|
|
18
|
-
import type {
|
|
17
|
+
import type { OffchainEffect } from './offchain_effect.js';
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* The contents of a new note.
|
|
@@ -134,8 +133,8 @@ export class PrivateCallExecutionResult {
|
|
|
134
133
|
public noteHashNullifierCounterMap: Map<number, number>,
|
|
135
134
|
/** The raw return values of the executed function. */
|
|
136
135
|
public returnValues: Fr[],
|
|
137
|
-
/** The offchain
|
|
138
|
-
public
|
|
136
|
+
/** The offchain effects emitted during execution of this function call via the `emit_offchain_effect` oracle. */
|
|
137
|
+
public offchainEffects: { data: Fr[] }[],
|
|
139
138
|
/** The nested executions. */
|
|
140
139
|
public nestedExecutions: PrivateCallExecutionResult[],
|
|
141
140
|
/**
|
|
@@ -158,7 +157,7 @@ export class PrivateCallExecutionResult {
|
|
|
158
157
|
newNotes: z.array(NoteAndSlot.schema),
|
|
159
158
|
noteHashNullifierCounterMap: mapSchema(z.coerce.number(), z.number()),
|
|
160
159
|
returnValues: z.array(schemas.Fr),
|
|
161
|
-
|
|
160
|
+
offchainEffects: z.array(z.object({ data: z.array(schemas.Fr) })),
|
|
162
161
|
nestedExecutions: z.array(z.lazy(() => PrivateCallExecutionResult.schema)),
|
|
163
162
|
contractClassLogs: z.array(CountedContractClassLog.schema),
|
|
164
163
|
})
|
|
@@ -175,7 +174,7 @@ export class PrivateCallExecutionResult {
|
|
|
175
174
|
fields.newNotes,
|
|
176
175
|
fields.noteHashNullifierCounterMap,
|
|
177
176
|
fields.returnValues,
|
|
178
|
-
fields.
|
|
177
|
+
fields.offchainEffects,
|
|
179
178
|
fields.nestedExecutions,
|
|
180
179
|
fields.contractClassLogs,
|
|
181
180
|
);
|
|
@@ -193,8 +192,7 @@ export class PrivateCallExecutionResult {
|
|
|
193
192
|
[Fr.random()],
|
|
194
193
|
[
|
|
195
194
|
{
|
|
196
|
-
|
|
197
|
-
recipient: await AztecAddress.random(),
|
|
195
|
+
data: [Fr.random()],
|
|
198
196
|
},
|
|
199
197
|
],
|
|
200
198
|
await timesParallel(nested, () => PrivateCallExecutionResult.random(0)),
|
|
@@ -247,21 +245,21 @@ export function collectSortedContractClassLogs(execResult: PrivateExecutionResul
|
|
|
247
245
|
}
|
|
248
246
|
|
|
249
247
|
/**
|
|
250
|
-
* Collect all offchain
|
|
251
|
-
* @param execResult - The execution result to collect
|
|
252
|
-
* @returns Array of offchain
|
|
248
|
+
* Collect all offchain effects emitted across all nested executions.
|
|
249
|
+
* @param execResult - The execution result to collect offchain effects from.
|
|
250
|
+
* @returns Array of offchain effects.
|
|
253
251
|
*/
|
|
254
|
-
export function
|
|
255
|
-
const
|
|
252
|
+
export function collectOffchainEffects(execResult: PrivateExecutionResult): OffchainEffect[] {
|
|
253
|
+
const collectEffectsRecursive = (callResult: PrivateCallExecutionResult): OffchainEffect[] => {
|
|
256
254
|
return [
|
|
257
|
-
...callResult.
|
|
255
|
+
...callResult.offchainEffects.map(msg => ({
|
|
258
256
|
...msg,
|
|
259
|
-
contractAddress: callResult.publicInputs.callContext.contractAddress, // contract that emitted the
|
|
257
|
+
contractAddress: callResult.publicInputs.callContext.contractAddress, // contract that emitted the effect
|
|
260
258
|
})),
|
|
261
|
-
...callResult.nestedExecutions.flatMap(nested =>
|
|
259
|
+
...callResult.nestedExecutions.flatMap(nested => collectEffectsRecursive(nested)),
|
|
262
260
|
];
|
|
263
261
|
};
|
|
264
|
-
return
|
|
262
|
+
return collectEffectsRecursive(execResult.entrypoint);
|
|
265
263
|
}
|
|
266
264
|
|
|
267
265
|
export function getFinalMinRevertibleSideEffectCounter(execResult: PrivateExecutionResult): number {
|
package/src/tx/proven_tx.ts
CHANGED
|
@@ -5,10 +5,10 @@ import { z } from 'zod';
|
|
|
5
5
|
|
|
6
6
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
7
7
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
8
|
-
import type {
|
|
8
|
+
import type { OffchainEffect } from './offchain_effect.js';
|
|
9
9
|
import {
|
|
10
10
|
PrivateExecutionResult,
|
|
11
|
-
|
|
11
|
+
collectOffchainEffects,
|
|
12
12
|
collectSortedContractClassLogs,
|
|
13
13
|
} from './private_execution_result.js';
|
|
14
14
|
import { type ProvingStats, ProvingTimingsSchema } from './profiling.js';
|
|
@@ -34,8 +34,8 @@ export class TxProvingResult {
|
|
|
34
34
|
return tx;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
return
|
|
37
|
+
getOffchainEffects(): OffchainEffect[] {
|
|
38
|
+
return collectOffchainEffects(this.privateExecutionResult);
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
static get schema() {
|
|
@@ -12,6 +12,7 @@ import { z } from 'zod';
|
|
|
12
12
|
|
|
13
13
|
const updateConfigSchema = z.object({
|
|
14
14
|
version: z.string().optional(),
|
|
15
|
+
publicTelemetry: z.any().optional(),
|
|
15
16
|
config: z.any().optional(),
|
|
16
17
|
});
|
|
17
18
|
|
|
@@ -19,6 +20,7 @@ export type EventMap = {
|
|
|
19
20
|
newRollupVersion: [{ currentVersion: bigint; latestVersion: bigint }];
|
|
20
21
|
newNodeVersion: [{ currentVersion: string; latestVersion: string }];
|
|
21
22
|
updateNodeConfig: [object];
|
|
23
|
+
updatePublicTelemetryConfig: [object];
|
|
22
24
|
};
|
|
23
25
|
|
|
24
26
|
type Config = {
|
|
@@ -33,6 +35,7 @@ type Config = {
|
|
|
33
35
|
export class UpdateChecker extends EventEmitter<EventMap> {
|
|
34
36
|
private runningPromise: RunningPromise;
|
|
35
37
|
private lastPatchedConfig: object = {};
|
|
38
|
+
private lastPatchedPublicTelemetryConfig: object = {};
|
|
36
39
|
|
|
37
40
|
constructor(
|
|
38
41
|
private updatesUrl: URL,
|
|
@@ -117,7 +120,7 @@ export class UpdateChecker extends EventEmitter<EventMap> {
|
|
|
117
120
|
});
|
|
118
121
|
}
|
|
119
122
|
|
|
120
|
-
const { version, config } = updateConfigSchema.parse(body);
|
|
123
|
+
const { version, config, publicTelemetry } = updateConfigSchema.parse(body);
|
|
121
124
|
|
|
122
125
|
if (this.nodeVersion && version && version !== this.nodeVersion) {
|
|
123
126
|
this.log.debug('New node version', { currentVersion: this.nodeVersion, latestVersion: version });
|
|
@@ -129,6 +132,16 @@ export class UpdateChecker extends EventEmitter<EventMap> {
|
|
|
129
132
|
this.lastPatchedConfig = config;
|
|
130
133
|
this.emit('updateNodeConfig', config);
|
|
131
134
|
}
|
|
135
|
+
|
|
136
|
+
if (
|
|
137
|
+
publicTelemetry &&
|
|
138
|
+
Object.keys(publicTelemetry).length > 0 &&
|
|
139
|
+
!isDeepStrictEqual(publicTelemetry, this.lastPatchedPublicTelemetryConfig)
|
|
140
|
+
) {
|
|
141
|
+
this.log.debug('New metrics config', { config });
|
|
142
|
+
this.lastPatchedPublicTelemetryConfig = publicTelemetry;
|
|
143
|
+
this.emit('updatePublicTelemetryConfig', publicTelemetry);
|
|
144
|
+
}
|
|
132
145
|
} catch (err) {
|
|
133
146
|
this.log.warn(`Failed to check if there is an update`, err);
|
|
134
147
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import type { AztecAddress } from '../aztec-address/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Represents an offchain message emitted via the `emit_offchain_message` oracle (see the oracle documentation for
|
|
5
|
-
* more details).
|
|
6
|
-
*/
|
|
7
|
-
export type OffchainMessage = {
|
|
8
|
-
/** The message content */
|
|
9
|
-
message: Fr[];
|
|
10
|
-
/** The message recipient */
|
|
11
|
-
recipient: AztecAddress;
|
|
12
|
-
/** The contract that emitted the message */
|
|
13
|
-
contractAddress: AztecAddress;
|
|
14
|
-
};
|
|
15
|
-
//# sourceMappingURL=offchain_message.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"offchain_message.d.ts","sourceRoot":"","sources":["../../src/tx/offchain_message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,0BAA0B;IAC1B,OAAO,EAAE,EAAE,EAAE,CAAC;IACd,4BAA4B;IAC5B,SAAS,EAAE,YAAY,CAAC;IACxB,4CAA4C;IAC5C,eAAe,EAAE,YAAY,CAAC;CAC/B,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
|
|
3
|
-
import type { AztecAddress } from '../aztec-address/index.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Represents an offchain message emitted via the `emit_offchain_message` oracle (see the oracle documentation for
|
|
7
|
-
* more details).
|
|
8
|
-
*/
|
|
9
|
-
export type OffchainMessage = {
|
|
10
|
-
/** The message content */
|
|
11
|
-
message: Fr[];
|
|
12
|
-
/** The message recipient */
|
|
13
|
-
recipient: AztecAddress;
|
|
14
|
-
/** The contract that emitted the message */
|
|
15
|
-
contractAddress: AztecAddress;
|
|
16
|
-
};
|