@aztec/stdlib 3.0.0-nightly.20251014 → 3.0.0-nightly.20251016
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/abi.d.ts +8 -8
- package/dest/abi/abi.js +1 -1
- package/dest/abi/function_call.d.ts +7 -2
- package/dest/abi/function_call.d.ts.map +1 -1
- package/dest/abi/function_call.js +6 -2
- package/dest/avm/avm.d.ts +54 -54
- package/dest/avm/avm_proving_request.d.ts +30 -30
- package/dest/contract/interfaces/contract_instance.d.ts +2 -2
- package/dest/interfaces/proving-job.d.ts +30 -30
- package/dest/kernel/private_circuit_public_inputs.d.ts +1 -1
- package/dest/kernel/private_to_public_accumulated_data.d.ts +1 -1
- package/dest/kernel/private_to_rollup_accumulated_data.d.ts +1 -1
- package/dest/keys/derivation.d.ts +0 -2
- package/dest/keys/derivation.d.ts.map +1 -1
- package/dest/keys/derivation.js +1 -21
- package/dest/logs/directional_app_tagging_secret.d.ts +40 -0
- package/dest/logs/directional_app_tagging_secret.d.ts.map +1 -0
- package/dest/logs/directional_app_tagging_secret.js +64 -0
- package/dest/logs/index.d.ts +2 -1
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +2 -1
- package/dest/logs/pre_tag.d.ts +34 -0
- package/dest/logs/pre_tag.d.ts.map +1 -0
- package/dest/logs/pre_tag.js +7 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +1 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +3 -0
- package/dest/tests/factories.d.ts +2 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +15 -9
- package/dest/tests/mocks.d.ts +3 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +4 -2
- package/dest/tx/private_execution_result.d.ts +5 -0
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +7 -3
- package/dest/tx/simulated_tx.d.ts +3 -3
- package/dest/versioning/versioning.d.ts.map +1 -1
- package/dest/versioning/versioning.js +10 -5
- package/package.json +8 -8
- package/src/abi/abi.ts +1 -1
- package/src/abi/function_call.ts +5 -1
- package/src/keys/derivation.ts +1 -26
- package/src/logs/directional_app_tagging_secret.ts +78 -0
- package/src/logs/index.ts +2 -1
- package/src/logs/pre_tag.ts +25 -0
- package/src/rollup/checkpoint_rollup_public_inputs.ts +4 -0
- package/src/tests/factories.ts +11 -4
- package/src/tests/mocks.ts +5 -0
- package/src/tx/private_execution_result.ts +6 -0
- package/src/versioning/versioning.ts +10 -5
- package/dest/logs/indexed_tagging_secret.d.ts +0 -28
- package/dest/logs/indexed_tagging_secret.d.ts.map +0 -1
- package/dest/logs/indexed_tagging_secret.js +0 -50
- package/src/logs/indexed_tagging_secret.ts +0 -48
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mocks.d.ts","sourceRoot":"","sources":["../../src/tests/mocks.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAe,MAAM,0BAA0B,CAAC;AACxE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAyC,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AACrG,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAIlE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAS7C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAA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UAAU,CAAC,OAAO,MAAM,CAAC,CAAC,CAAC,CAAM,gBAC+B,CAAC;AAoBjH,eAAO,MAAM,eAAe,GAAU,aAAQ,gCAgB7C,CAAC;AAEF,eAAO,MAAM,sBAAsB,QAAO,gBAUxC,CAAC;AAEH,eAAO,MAAM,iCAAiC,GAC5C,OAAM;IAAE,eAAe,CAAC,EAAE,EAAE,CAAA;CAAO,EACnC,UAAU,YAAY,KACrB,OAAO,CAAC,2BAA2B,CAUrC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;EAIlC,CAAC;AAEF,MAAM,WAAW,2BAA2B;IAC1C,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,OAAO,CAAC,EAAE,EAAE,CAAC;IACb,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;CACZ;AAqBD,eAAO,MAAM,0CAA0C,GACrD,wBAAwB,+BAA+B,EACvD,SAAQ,eAA0C,0CAOnD,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,UAAU,2BAA2B,KAAG,aAOzE,CAAC;AAGF,eAAO,MAAM,oBAAoB,GAAI,UAAU,2BAA2B,KAAG,gBAM5E,CAAC;AAEF,eAAO,MAAM,6BAA6B,GAAI,OAAO,OAAO,EAAE,SAAS,eAAe,KAAG,gBAQxF,CAAC;AAEF,wBAAsB,sBAAsB,CAC1C,aAAa,EAAE,MAAM,EACrB,IAAI,GAAE;IAAE,OAAO,CAAC,EAAE,eAAe,EAAE,CAAA;CAAO,GACzC,OAAO,CAAC,gBAAgB,CAAC,CAc3B"}
|
package/dest/tests/mocks.js
CHANGED
|
@@ -10,6 +10,7 @@ import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
|
10
10
|
import { computeContractAddressFromInstance } from '../contract/contract_address.js';
|
|
11
11
|
import { getContractClassFromArtifact } from '../contract/contract_class.js';
|
|
12
12
|
import { SerializableContractInstance } from '../contract/contract_instance.js';
|
|
13
|
+
import { Gas } from '../gas/gas.js';
|
|
13
14
|
import { GasFees } from '../gas/gas_fees.js';
|
|
14
15
|
import { GasSettings } from '../gas/gas_settings.js';
|
|
15
16
|
import { Nullifier } from '../kernel/nullifier.js';
|
|
@@ -36,7 +37,7 @@ export const randomExtendedNote = async ({ note = Note.random(), recipient = und
|
|
|
36
37
|
export const randomUniqueNote = async ({ note = Note.random(), recipient = undefined, contractAddress = undefined, txHash = randomTxHash(), storageSlot = Fr.random(), noteNonce = Fr.random() } = {})=>{
|
|
37
38
|
return new UniqueNote(note, recipient ?? await AztecAddress.random(), contractAddress ?? await AztecAddress.random(), storageSlot, txHash, noteNonce);
|
|
38
39
|
};
|
|
39
|
-
export const mockTx = async (seed = 1, { numberOfNonRevertiblePublicCallRequests = MAX_ENQUEUED_CALLS_PER_TX / 2, numberOfRevertiblePublicCallRequests = MAX_ENQUEUED_CALLS_PER_TX / 2, numberOfRevertibleNullifiers = 0, hasPublicTeardownCallRequest = false, publicCalldataSize = 2, feePayer, clientIvcProof = ClientIvcProof.random(), maxPriorityFeesPerGas, chainId = Fr.ZERO, version = Fr.ZERO, vkTreeRoot = Fr.ZERO, protocolContractsHash = Fr.ZERO } = {})=>{
|
|
40
|
+
export const mockTx = async (seed = 1, { numberOfNonRevertiblePublicCallRequests = MAX_ENQUEUED_CALLS_PER_TX / 2, numberOfRevertiblePublicCallRequests = MAX_ENQUEUED_CALLS_PER_TX / 2, numberOfRevertibleNullifiers = 0, hasPublicTeardownCallRequest = false, publicCalldataSize = 2, feePayer, clientIvcProof = ClientIvcProof.random(), maxPriorityFeesPerGas, gasUsed = Gas.empty(), chainId = Fr.ZERO, version = Fr.ZERO, vkTreeRoot = Fr.ZERO, protocolContractsHash = Fr.ZERO } = {})=>{
|
|
40
41
|
const totalPublicCallRequests = numberOfNonRevertiblePublicCallRequests + numberOfRevertiblePublicCallRequests + (hasPublicTeardownCallRequest ? 1 : 0);
|
|
41
42
|
const isForPublic = totalPublicCallRequests > 0;
|
|
42
43
|
const data = PrivateKernelTailCircuitPublicInputs.empty();
|
|
@@ -46,6 +47,7 @@ export const mockTx = async (seed = 1, { numberOfNonRevertiblePublicCallRequests
|
|
|
46
47
|
maxPriorityFeesPerGas
|
|
47
48
|
});
|
|
48
49
|
data.feePayer = feePayer ?? await AztecAddress.random();
|
|
50
|
+
data.gasUsed = gasUsed;
|
|
49
51
|
data.constants.txContext.chainId = chainId;
|
|
50
52
|
data.constants.txContext.version = version;
|
|
51
53
|
data.constants.vkTreeRoot = vkTreeRoot;
|
|
@@ -89,7 +91,7 @@ export const mockTxForRollup = (seed = 1, opts = {})=>mockTx(seed, {
|
|
|
89
91
|
numberOfNonRevertiblePublicCallRequests: 0,
|
|
90
92
|
numberOfRevertiblePublicCallRequests: 0
|
|
91
93
|
});
|
|
92
|
-
const emptyPrivateCallExecutionResult = ()=>new PrivateCallExecutionResult(Buffer.from(''), Buffer.from(''), new Map(), PrivateCircuitPublicInputs.empty(), new Map(), [], new Map(), [], [], [], []);
|
|
94
|
+
const emptyPrivateCallExecutionResult = ()=>new PrivateCallExecutionResult(Buffer.from(''), Buffer.from(''), new Map(), PrivateCircuitPublicInputs.empty(), new Map(), [], new Map(), [], [], [], [], []);
|
|
93
95
|
const emptyPrivateExecutionResult = ()=>new PrivateExecutionResult(emptyPrivateCallExecutionResult(), Fr.zero(), []);
|
|
94
96
|
export const mockSimulatedTx = async (seed = 1)=>{
|
|
95
97
|
const privateExecutionResult = emptyPrivateExecutionResult();
|
|
@@ -5,6 +5,7 @@ import { NoteSelector } from '../abi/note_selector.js';
|
|
|
5
5
|
import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
|
|
6
6
|
import type { IsEmpty } from '../kernel/utils/interfaces.js';
|
|
7
7
|
import { ContractClassLog, ContractClassLogFields } from '../logs/contract_class_log.js';
|
|
8
|
+
import { type PreTag } from '../logs/pre_tag.js';
|
|
8
9
|
import { Note } from '../note/note.js';
|
|
9
10
|
import { type ZodFor } from '../schemas/index.js';
|
|
10
11
|
import type { UInt32 } from '../types/index.js';
|
|
@@ -122,6 +123,8 @@ export declare class PrivateCallExecutionResult {
|
|
|
122
123
|
offchainEffects: {
|
|
123
124
|
data: Fr[];
|
|
124
125
|
}[];
|
|
126
|
+
/** The pre tags used in this tx to compute tags for private logs */
|
|
127
|
+
preTags: PreTag[];
|
|
125
128
|
/** The nested executions. */
|
|
126
129
|
nestedExecutionResults: PrivateCallExecutionResult[];
|
|
127
130
|
/**
|
|
@@ -152,6 +155,8 @@ export declare class PrivateCallExecutionResult {
|
|
|
152
155
|
offchainEffects: {
|
|
153
156
|
data: Fr[];
|
|
154
157
|
}[],
|
|
158
|
+
/** The pre tags used in this tx to compute tags for private logs */
|
|
159
|
+
preTags: PreTag[],
|
|
155
160
|
/** The nested executions. */
|
|
156
161
|
nestedExecutionResults: PrivateCallExecutionResult[],
|
|
157
162
|
/**
|
|
@@ -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,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,KAAK,MAAM,EAAsB,MAAM,qBAAqB,CAAC;AACtE,OA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,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,CAQL;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"}
|
|
@@ -6,6 +6,7 @@ import { NoteSelector } from '../abi/note_selector.js';
|
|
|
6
6
|
import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inputs.js';
|
|
7
7
|
import { sortByCounter } from '../kernel/utils/order_and_comparison.js';
|
|
8
8
|
import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
9
|
+
import { PreTagSchema } from '../logs/pre_tag.js';
|
|
9
10
|
import { Note } from '../note/note.js';
|
|
10
11
|
import { mapSchema, schemas } from '../schemas/index.js';
|
|
11
12
|
import { HashedValues } from './hashed_values.js';
|
|
@@ -97,12 +98,13 @@ export class PrivateExecutionResult {
|
|
|
97
98
|
noteHashNullifierCounterMap;
|
|
98
99
|
returnValues;
|
|
99
100
|
offchainEffects;
|
|
101
|
+
preTags;
|
|
100
102
|
nestedExecutionResults;
|
|
101
103
|
contractClassLogs;
|
|
102
104
|
profileResult;
|
|
103
105
|
constructor(// Needed for prover
|
|
104
106
|
/** The ACIR bytecode. */ acir, /** The verification key. */ vk, /** The partial witness. */ partialWitness, // Needed for the verifier (kernel)
|
|
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. */ nestedExecutionResults, /**
|
|
107
|
+
/** 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 pre tags used in this tx to compute tags for private logs */ preTags, /** The nested executions. */ nestedExecutionResults, /**
|
|
106
108
|
* Contract class logs emitted during execution of this function call.
|
|
107
109
|
* Note: We only need to collect the ContractClassLogFields as preimages for the tx.
|
|
108
110
|
* But keep them as ContractClassLog so that we can verify the log hashes before submitting the tx (TODO).
|
|
@@ -116,6 +118,7 @@ export class PrivateExecutionResult {
|
|
|
116
118
|
this.noteHashNullifierCounterMap = noteHashNullifierCounterMap;
|
|
117
119
|
this.returnValues = returnValues;
|
|
118
120
|
this.offchainEffects = offchainEffects;
|
|
121
|
+
this.preTags = preTags;
|
|
119
122
|
this.nestedExecutionResults = nestedExecutionResults;
|
|
120
123
|
this.contractClassLogs = contractClassLogs;
|
|
121
124
|
this.profileResult = profileResult;
|
|
@@ -133,12 +136,13 @@ export class PrivateExecutionResult {
|
|
|
133
136
|
offchainEffects: z.array(z.object({
|
|
134
137
|
data: z.array(schemas.Fr)
|
|
135
138
|
})),
|
|
139
|
+
preTags: z.array(PreTagSchema),
|
|
136
140
|
nestedExecutionResults: z.array(z.lazy(()=>PrivateCallExecutionResult.schema)),
|
|
137
141
|
contractClassLogs: z.array(CountedContractClassLog.schema)
|
|
138
142
|
}).transform(PrivateCallExecutionResult.from);
|
|
139
143
|
}
|
|
140
144
|
static from(fields) {
|
|
141
|
-
return new PrivateCallExecutionResult(fields.acir, fields.vk, fields.partialWitness, fields.publicInputs, fields.noteHashLeafIndexMap, fields.newNotes, fields.noteHashNullifierCounterMap, fields.returnValues, fields.offchainEffects, fields.nestedExecutionResults, fields.contractClassLogs);
|
|
145
|
+
return new PrivateCallExecutionResult(fields.acir, fields.vk, fields.partialWitness, fields.publicInputs, fields.noteHashLeafIndexMap, fields.newNotes, fields.noteHashNullifierCounterMap, fields.returnValues, fields.offchainEffects, fields.preTags, fields.nestedExecutionResults, fields.contractClassLogs);
|
|
142
146
|
}
|
|
143
147
|
static async random(nested = 1) {
|
|
144
148
|
return new PrivateCallExecutionResult(randomBytes(4), randomBytes(4), new Map([
|
|
@@ -166,7 +170,7 @@ export class PrivateExecutionResult {
|
|
|
166
170
|
Fr.random()
|
|
167
171
|
]
|
|
168
172
|
}
|
|
169
|
-
], await timesParallel(nested, ()=>PrivateCallExecutionResult.random(0)), [
|
|
173
|
+
], [], await timesParallel(nested, ()=>PrivateCallExecutionResult.random(0)), [
|
|
170
174
|
new CountedContractClassLog(await ContractClassLog.random(), randomInt(10))
|
|
171
175
|
]);
|
|
172
176
|
}
|
|
@@ -49,11 +49,11 @@ export declare class SimulationOverrides {
|
|
|
49
49
|
}, "strip", z.ZodTypeAny, {
|
|
50
50
|
version: 1;
|
|
51
51
|
salt: import("@aztec/foundation/schemas").Fr;
|
|
52
|
-
publicKeys: import("../keys/public_keys.js").PublicKeys;
|
|
53
52
|
deployer: import("../aztec-address/index.js").AztecAddress;
|
|
54
53
|
currentContractClassId: import("@aztec/foundation/schemas").Fr;
|
|
55
54
|
originalContractClassId: import("@aztec/foundation/schemas").Fr;
|
|
56
55
|
initializationHash: import("@aztec/foundation/schemas").Fr;
|
|
56
|
+
publicKeys: import("../keys/public_keys.js").PublicKeys;
|
|
57
57
|
}, {
|
|
58
58
|
version: 1;
|
|
59
59
|
publicKeys: {
|
|
@@ -79,11 +79,11 @@ export declare class SimulationOverrides {
|
|
|
79
79
|
instance: {
|
|
80
80
|
version: 1;
|
|
81
81
|
salt: import("@aztec/foundation/schemas").Fr;
|
|
82
|
-
publicKeys: import("../keys/public_keys.js").PublicKeys;
|
|
83
82
|
deployer: import("../aztec-address/index.js").AztecAddress;
|
|
84
83
|
currentContractClassId: import("@aztec/foundation/schemas").Fr;
|
|
85
84
|
originalContractClassId: import("@aztec/foundation/schemas").Fr;
|
|
86
85
|
initializationHash: import("@aztec/foundation/schemas").Fr;
|
|
86
|
+
publicKeys: import("../keys/public_keys.js").PublicKeys;
|
|
87
87
|
} & {
|
|
88
88
|
address: import("../aztec-address/index.js").AztecAddress;
|
|
89
89
|
};
|
|
@@ -112,11 +112,11 @@ export declare class SimulationOverrides {
|
|
|
112
112
|
instance: {
|
|
113
113
|
version: 1;
|
|
114
114
|
salt: import("@aztec/foundation/schemas").Fr;
|
|
115
|
-
publicKeys: import("../keys/public_keys.js").PublicKeys;
|
|
116
115
|
deployer: import("../aztec-address/index.js").AztecAddress;
|
|
117
116
|
currentContractClassId: import("@aztec/foundation/schemas").Fr;
|
|
118
117
|
originalContractClassId: import("@aztec/foundation/schemas").Fr;
|
|
119
118
|
initializationHash: import("@aztec/foundation/schemas").Fr;
|
|
119
|
+
publicKeys: import("../keys/public_keys.js").PublicKeys;
|
|
120
120
|
} & {
|
|
121
121
|
address: import("../aztec-address/index.js").AztecAddress;
|
|
122
122
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"versioning.d.ts","sourceRoot":"","sources":["../../src/versioning/versioning.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAGnD,OAAO,KAAK,GAAG,MAAM,KAAK,CAAC;AAE3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7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zF"}
|
|
@@ -67,11 +67,16 @@ export class ComponentsVersionsError extends Error {
|
|
|
67
67
|
}
|
|
68
68
|
/** Returns a Koa middleware that injects the versioning info as headers. */ export function getVersioningMiddleware(versions) {
|
|
69
69
|
return async (ctx, next)=>{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
if
|
|
74
|
-
|
|
70
|
+
try {
|
|
71
|
+
await next();
|
|
72
|
+
} finally{
|
|
73
|
+
// Always add version headers, even if there was an error
|
|
74
|
+
// This allows the client to detect version mismatches before processing other errors
|
|
75
|
+
for(const key in versions){
|
|
76
|
+
const value = versions[key];
|
|
77
|
+
if (value !== undefined) {
|
|
78
|
+
ctx.set(`x-aztec-${key}`, value.toString());
|
|
79
|
+
}
|
|
75
80
|
}
|
|
76
81
|
}
|
|
77
82
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251016",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -70,13 +70,13 @@
|
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@aws-sdk/client-s3": "^3.892.0",
|
|
73
|
-
"@aztec/bb.js": "3.0.0-nightly.
|
|
74
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
75
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
76
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
77
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
78
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
79
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
73
|
+
"@aztec/bb.js": "3.0.0-nightly.20251016",
|
|
74
|
+
"@aztec/blob-lib": "3.0.0-nightly.20251016",
|
|
75
|
+
"@aztec/constants": "3.0.0-nightly.20251016",
|
|
76
|
+
"@aztec/ethereum": "3.0.0-nightly.20251016",
|
|
77
|
+
"@aztec/foundation": "3.0.0-nightly.20251016",
|
|
78
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20251016",
|
|
79
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20251016",
|
|
80
80
|
"@google-cloud/storage": "^7.15.0",
|
|
81
81
|
"axios": "^1.12.0",
|
|
82
82
|
"json-stringify-deterministic": "1.0.12",
|
package/src/abi/abi.ts
CHANGED
|
@@ -195,7 +195,7 @@ export const FunctionAbiSchema = z.object({
|
|
|
195
195
|
isInitializer: z.boolean(),
|
|
196
196
|
parameters: z.array(z.object({ name: z.string(), type: AbiTypeSchema, visibility: z.enum(ABIParameterVisibility) })),
|
|
197
197
|
returnTypes: z.array(AbiTypeSchema),
|
|
198
|
-
errorTypes: z.record(AbiErrorTypeSchema),
|
|
198
|
+
errorTypes: z.record(z.string(), AbiErrorTypeSchema.optional()),
|
|
199
199
|
}) satisfies z.ZodType<FunctionAbi>;
|
|
200
200
|
|
|
201
201
|
/** Debug metadata for a function. */
|
package/src/abi/function_call.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { AztecAddress } from '../aztec-address/index.js';
|
|
|
5
5
|
import { type AbiType, FunctionType } from './abi.js';
|
|
6
6
|
import { FunctionSelector } from './function_selector.js';
|
|
7
7
|
|
|
8
|
-
/** A request to call a function on a contract
|
|
8
|
+
/** A request to call a function on a contract. */
|
|
9
9
|
export class FunctionCall {
|
|
10
10
|
constructor(
|
|
11
11
|
/** The name of the function to call */
|
|
@@ -16,6 +16,8 @@ export class FunctionCall {
|
|
|
16
16
|
public selector: FunctionSelector,
|
|
17
17
|
/** Type of the function */
|
|
18
18
|
public type: FunctionType,
|
|
19
|
+
/** Only applicable for enqueued public function calls. `hideMsgSender = true` will set the msg_sender field (the caller's address) to "null", meaning the public function (and observers around the world) won't know which smart contract address made the call. */
|
|
20
|
+
public hideMsgSender: boolean,
|
|
19
21
|
/** Whether this call can make modifications to state or not */
|
|
20
22
|
public isStatic: boolean,
|
|
21
23
|
/** The encoded args */
|
|
@@ -30,6 +32,7 @@ export class FunctionCall {
|
|
|
30
32
|
fields.to,
|
|
31
33
|
fields.selector,
|
|
32
34
|
fields.type,
|
|
35
|
+
fields.hideMsgSender,
|
|
33
36
|
fields.isStatic,
|
|
34
37
|
fields.args,
|
|
35
38
|
fields.returnTypes,
|
|
@@ -50,6 +53,7 @@ export class FunctionCall {
|
|
|
50
53
|
to: AztecAddress.ZERO,
|
|
51
54
|
selector: FunctionSelector.empty(),
|
|
52
55
|
type: FunctionType.PUBLIC,
|
|
56
|
+
hideMsgSender: false,
|
|
53
57
|
isStatic: false,
|
|
54
58
|
args: [],
|
|
55
59
|
returnTypes: [],
|
package/src/keys/derivation.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { GeneratorIndex } from '@aztec/constants';
|
|
2
|
-
import { Grumpkin,
|
|
2
|
+
import { Grumpkin, poseidon2HashWithSeparator, sha512ToGrumpkinScalar } from '@aztec/foundation/crypto';
|
|
3
3
|
import { Fq, Fr, GrumpkinScalar } from '@aztec/foundation/fields';
|
|
4
4
|
|
|
5
5
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
6
|
-
import type { CompleteAddress } from '../contract/complete_address.js';
|
|
7
6
|
import type { KeyPrefix } from './key_types.js';
|
|
8
7
|
import { PublicKeys } from './public_keys.js';
|
|
9
8
|
import { getKeyGenerator } from './utils.js';
|
|
@@ -121,27 +120,3 @@ export async function deriveKeys(secretKey: Fr) {
|
|
|
121
120
|
publicKeys,
|
|
122
121
|
};
|
|
123
122
|
}
|
|
124
|
-
|
|
125
|
-
// Returns shared tagging secret computed with Diffie-Hellman key exchange.
|
|
126
|
-
async function computeTaggingSecretPoint(knownAddress: CompleteAddress, ivsk: Fq, externalAddress: AztecAddress) {
|
|
127
|
-
const knownPreaddress = await computePreaddress(await knownAddress.publicKeys.hash(), knownAddress.partialAddress);
|
|
128
|
-
// TODO: #8970 - Computation of address point from x coordinate might fail
|
|
129
|
-
const externalAddressPoint = await externalAddress.toAddressPoint();
|
|
130
|
-
const curve = new Grumpkin();
|
|
131
|
-
// Given A (known complete address) -> B (external address) and h == preaddress
|
|
132
|
-
// Compute shared secret as S = (h_A + ivsk_A) * Addr_Point_B
|
|
133
|
-
|
|
134
|
-
// Beware! h_a + ivsk_a (also known as the address secret) can lead to an address point with a negative y-coordinate, since there's two possible candidates
|
|
135
|
-
// computeAddressSecret takes care of selecting the one that leads to a positive y-coordinate, which is the only valid address point
|
|
136
|
-
return curve.mul(externalAddressPoint, await computeAddressSecret(knownPreaddress, ivsk));
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export async function computeAppTaggingSecret(
|
|
140
|
-
knownAddress: CompleteAddress,
|
|
141
|
-
ivsk: Fq,
|
|
142
|
-
externalAddress: AztecAddress,
|
|
143
|
-
app: AztecAddress,
|
|
144
|
-
) {
|
|
145
|
-
const taggingSecretPoint = await computeTaggingSecretPoint(knownAddress, ivsk, externalAddress);
|
|
146
|
-
return poseidon2Hash([taggingSecretPoint.x, taggingSecretPoint.y, app]);
|
|
147
|
-
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { Grumpkin, poseidon2Hash } from '@aztec/foundation/crypto';
|
|
2
|
+
import { type Fq, Fr, type Point } from '@aztec/foundation/fields';
|
|
3
|
+
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
import type { AztecAddress } from '../aztec-address/index.js';
|
|
7
|
+
import type { CompleteAddress } from '../contract/complete_address.js';
|
|
8
|
+
import { computeAddressSecret, computePreaddress } from '../keys/derivation.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Directional application tagging secret used for log tagging.
|
|
12
|
+
*
|
|
13
|
+
* "Directional" because the derived secret is bound to the recipient
|
|
14
|
+
* address: A→B differs from B→A even with the same participants and app.
|
|
15
|
+
*
|
|
16
|
+
* Note: It's a bit unfortunate that this type resides in `stdlib` as the rest of the tagging functionality resides
|
|
17
|
+
* in `pxe/src/tagging`. We need to use this type in `PreTag` that in turn is used by other types
|
|
18
|
+
* in stdlib hence there doesn't seem to be a good way around this.
|
|
19
|
+
*/
|
|
20
|
+
export class DirectionalAppTaggingSecret {
|
|
21
|
+
private constructor(public readonly value: Fr) {}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Derives shared tagging secret and from that, the app address and recipient derives the directional app tagging
|
|
25
|
+
* secret.
|
|
26
|
+
*
|
|
27
|
+
* @param localAddress - The complete address of entity A in the shared tagging secret derivation scheme
|
|
28
|
+
* @param localIvsk - The incoming viewing secret key of entity A
|
|
29
|
+
* @param externalAddress - The address of entity B in the shared tagging secret derivation scheme
|
|
30
|
+
* @param app - Contract address to silo the secret to
|
|
31
|
+
* @param recipient - Recipient of the log. Defines the "direction of the secret".
|
|
32
|
+
* @returns The secret that can be used along with an index to compute a tag to be included in a log.
|
|
33
|
+
*/
|
|
34
|
+
static async compute(
|
|
35
|
+
localAddress: CompleteAddress,
|
|
36
|
+
localIvsk: Fq,
|
|
37
|
+
externalAddress: AztecAddress,
|
|
38
|
+
app: AztecAddress,
|
|
39
|
+
recipient: AztecAddress,
|
|
40
|
+
): Promise<DirectionalAppTaggingSecret> {
|
|
41
|
+
const taggingSecretPoint = await computeSharedTaggingSecret(localAddress, localIvsk, externalAddress);
|
|
42
|
+
const appTaggingSecret = await poseidon2Hash([taggingSecretPoint.x, taggingSecretPoint.y, app]);
|
|
43
|
+
const directionalAppTaggingSecret = await poseidon2Hash([appTaggingSecret, recipient]);
|
|
44
|
+
|
|
45
|
+
return new DirectionalAppTaggingSecret(directionalAppTaggingSecret);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
toString(): string {
|
|
49
|
+
return this.value.toString();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static fromString(str: string): DirectionalAppTaggingSecret {
|
|
53
|
+
return new DirectionalAppTaggingSecret(Fr.fromString(str));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// Returns shared tagging secret computed with Diffie-Hellman key exchange.
|
|
58
|
+
async function computeSharedTaggingSecret(
|
|
59
|
+
localAddress: CompleteAddress,
|
|
60
|
+
localIvsk: Fq,
|
|
61
|
+
externalAddress: AztecAddress,
|
|
62
|
+
): Promise<Point> {
|
|
63
|
+
const knownPreaddress = await computePreaddress(await localAddress.publicKeys.hash(), localAddress.partialAddress);
|
|
64
|
+
// TODO: #8970 - Computation of address point from x coordinate might fail
|
|
65
|
+
const externalAddressPoint = await externalAddress.toAddressPoint();
|
|
66
|
+
const curve = new Grumpkin();
|
|
67
|
+
// Given A (local complete address) -> B (external address) and h == preaddress
|
|
68
|
+
// Compute shared secret as S = (h_A + local_ivsk_A) * Addr_Point_B
|
|
69
|
+
|
|
70
|
+
// Beware! h_a + local_ivsk_a (also known as the address secret) can lead to an address point with a negative
|
|
71
|
+
// y-coordinate, since there's two possible candidates computeAddressSecret takes care of selecting the one that
|
|
72
|
+
// leads to a positive y-coordinate, which is the only valid address point
|
|
73
|
+
return curve.mul(externalAddressPoint, await computeAddressSecret(knownPreaddress, localIvsk));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const DirectionalAppTaggingSecretSchema = z.object({
|
|
77
|
+
value: Fr.schema,
|
|
78
|
+
});
|
package/src/logs/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './log_with_tx_data.js';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './directional_app_tagging_secret.js';
|
|
3
|
+
export * from './pre_tag.js';
|
|
3
4
|
export * from './contract_class_log.js';
|
|
4
5
|
export * from './public_log.js';
|
|
5
6
|
export * from './private_log.js';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { schemas } from '@aztec/foundation/schemas';
|
|
2
|
+
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
type DirectionalAppTaggingSecret,
|
|
7
|
+
DirectionalAppTaggingSecretSchema,
|
|
8
|
+
} from './directional_app_tagging_secret.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Represents a preimage of a private log tag (see `Tag` in `pxe/src/tagging`).
|
|
12
|
+
*
|
|
13
|
+
* Note: It's a bit unfortunate that this type resides in `stdlib` as the rest of the tagging functionality resides
|
|
14
|
+
* in `pxe/src/tagging`. But this type is used by other types in stdlib hence there doesn't seem to be a good way
|
|
15
|
+
* around this.
|
|
16
|
+
*/
|
|
17
|
+
export type PreTag = {
|
|
18
|
+
secret: DirectionalAppTaggingSecret;
|
|
19
|
+
index: number;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export const PreTagSchema = z.object({
|
|
23
|
+
secret: DirectionalAppTaggingSecretSchema,
|
|
24
|
+
index: schemas.Integer,
|
|
25
|
+
});
|
|
@@ -118,6 +118,10 @@ export class FeeRecipient {
|
|
|
118
118
|
return serializeToFields(...FeeRecipient.getFields(this));
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
+
static empty() {
|
|
122
|
+
return new FeeRecipient(EthAddress.ZERO, Fr.ZERO);
|
|
123
|
+
}
|
|
124
|
+
|
|
121
125
|
isEmpty() {
|
|
122
126
|
return this.value.isZero() && this.recipient.isZero();
|
|
123
127
|
}
|
package/src/tests/factories.ts
CHANGED
|
@@ -88,6 +88,7 @@ import {
|
|
|
88
88
|
computeContractClassId,
|
|
89
89
|
computePublicBytecodeCommitment,
|
|
90
90
|
} from '../contract/index.js';
|
|
91
|
+
import { computeEffectiveGasFees } from '../fees/transaction_fee.js';
|
|
91
92
|
import { Gas, GasFees, GasSettings, type GasUsed } from '../gas/index.js';
|
|
92
93
|
import { computeCalldataHash } from '../hash/hash.js';
|
|
93
94
|
import type { MerkleTreeReadOperations } from '../interfaces/merkle_tree_operations.js';
|
|
@@ -1544,6 +1545,8 @@ export async function makeBloatedProcessedTx({
|
|
|
1544
1545
|
newL1ToL2Snapshot = AppendOnlyTreeSnapshot.empty(),
|
|
1545
1546
|
feePayer,
|
|
1546
1547
|
feePaymentPublicDataWrite,
|
|
1548
|
+
// The default gasUsed is the tx overhead.
|
|
1549
|
+
gasUsed = Gas.from({ daGas: FIXED_DA_GAS, l2Gas: FIXED_L2_GAS }),
|
|
1547
1550
|
privateOnly = false,
|
|
1548
1551
|
}: {
|
|
1549
1552
|
seed?: number;
|
|
@@ -1558,6 +1561,7 @@ export async function makeBloatedProcessedTx({
|
|
|
1558
1561
|
protocolContracts?: ProtocolContracts;
|
|
1559
1562
|
feePayer?: AztecAddress;
|
|
1560
1563
|
feePaymentPublicDataWrite?: PublicDataWrite;
|
|
1564
|
+
gasUsed?: Gas;
|
|
1561
1565
|
privateOnly?: boolean;
|
|
1562
1566
|
} = {}) {
|
|
1563
1567
|
seed *= 0x1000; // Avoid clashing with the previous mock values if seed only increases by 1.
|
|
@@ -1573,22 +1577,21 @@ export async function makeBloatedProcessedTx({
|
|
|
1573
1577
|
txConstantData.protocolContractsHash = await protocolContracts.hash();
|
|
1574
1578
|
|
|
1575
1579
|
const tx = !privateOnly
|
|
1576
|
-
? await mockTx(seed, { feePayer })
|
|
1580
|
+
? await mockTx(seed, { feePayer, gasUsed })
|
|
1577
1581
|
: await mockTx(seed, {
|
|
1578
1582
|
numberOfNonRevertiblePublicCallRequests: 0,
|
|
1579
1583
|
numberOfRevertiblePublicCallRequests: 0,
|
|
1580
1584
|
feePayer,
|
|
1585
|
+
gasUsed,
|
|
1581
1586
|
});
|
|
1582
1587
|
tx.data.constants = txConstantData;
|
|
1583
1588
|
|
|
1584
|
-
|
|
1585
|
-
tx.data.gasUsed = Gas.from({ daGas: FIXED_DA_GAS, l2Gas: FIXED_L2_GAS });
|
|
1589
|
+
const transactionFee = tx.data.gasUsed.computeFee(globalVariables.gasFees);
|
|
1586
1590
|
|
|
1587
1591
|
if (privateOnly) {
|
|
1588
1592
|
const data = makePrivateToRollupAccumulatedData(seed + 0x1000);
|
|
1589
1593
|
clearContractClassLogs(data);
|
|
1590
1594
|
|
|
1591
|
-
const transactionFee = tx.data.gasUsed.computeFee(globalVariables.gasFees);
|
|
1592
1595
|
feePaymentPublicDataWrite ??= new PublicDataWrite(Fr.random(), Fr.random());
|
|
1593
1596
|
|
|
1594
1597
|
tx.data.forRollup!.end = data;
|
|
@@ -1612,6 +1615,7 @@ export async function makeBloatedProcessedTx({
|
|
|
1612
1615
|
avmOutput.protocolContracts = protocolContracts;
|
|
1613
1616
|
avmOutput.startTreeSnapshots.l1ToL2MessageTree = newL1ToL2Snapshot;
|
|
1614
1617
|
avmOutput.endTreeSnapshots.l1ToL2MessageTree = newL1ToL2Snapshot;
|
|
1618
|
+
avmOutput.effectiveGasFees = computeEffectiveGasFees(globalVariables.gasFees, gasSettings);
|
|
1615
1619
|
// Assign data from private.
|
|
1616
1620
|
avmOutput.globalVariables = globalVariables;
|
|
1617
1621
|
avmOutput.startGasUsed = tx.data.gasUsed;
|
|
@@ -1654,6 +1658,9 @@ export async function makeBloatedProcessedTx({
|
|
|
1654
1658
|
);
|
|
1655
1659
|
avmOutput.accumulatedDataArrayLengths = avmOutput.accumulatedData.getArrayLengths();
|
|
1656
1660
|
avmOutput.gasSettings = gasSettings;
|
|
1661
|
+
// Note: The fee is computed from the tx's gas used, which only includes the gas used in private. But this shouldn't
|
|
1662
|
+
// be a problem for the tests.
|
|
1663
|
+
avmOutput.transactionFee = transactionFee;
|
|
1657
1664
|
|
|
1658
1665
|
const avmCircuitInputs = await makeAvmCircuitInputs(seed + 0x3000, { publicInputs: avmOutput });
|
|
1659
1666
|
avmCircuitInputs.hints.startingTreeRoots.l1ToL2MessageTree = newL1ToL2Snapshot;
|
package/src/tests/mocks.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { computeContractAddressFromInstance } from '../contract/contract_address
|
|
|
14
14
|
import { getContractClassFromArtifact } from '../contract/contract_class.js';
|
|
15
15
|
import { SerializableContractInstance } from '../contract/contract_instance.js';
|
|
16
16
|
import type { ContractInstanceWithAddress } from '../contract/index.js';
|
|
17
|
+
import { Gas } from '../gas/gas.js';
|
|
17
18
|
import { GasFees } from '../gas/gas_fees.js';
|
|
18
19
|
import { GasSettings } from '../gas/gas_settings.js';
|
|
19
20
|
import { Nullifier } from '../kernel/nullifier.js';
|
|
@@ -84,6 +85,7 @@ export const mockTx = async (
|
|
|
84
85
|
feePayer,
|
|
85
86
|
clientIvcProof = ClientIvcProof.random(),
|
|
86
87
|
maxPriorityFeesPerGas,
|
|
88
|
+
gasUsed = Gas.empty(),
|
|
87
89
|
chainId = Fr.ZERO,
|
|
88
90
|
version = Fr.ZERO,
|
|
89
91
|
vkTreeRoot = Fr.ZERO,
|
|
@@ -97,6 +99,7 @@ export const mockTx = async (
|
|
|
97
99
|
feePayer?: AztecAddress;
|
|
98
100
|
clientIvcProof?: ClientIvcProof;
|
|
99
101
|
maxPriorityFeesPerGas?: GasFees;
|
|
102
|
+
gasUsed?: Gas;
|
|
100
103
|
chainId?: Fr;
|
|
101
104
|
version?: Fr;
|
|
102
105
|
vkTreeRoot?: Fr;
|
|
@@ -115,6 +118,7 @@ export const mockTx = async (
|
|
|
115
118
|
maxPriorityFeesPerGas,
|
|
116
119
|
});
|
|
117
120
|
data.feePayer = feePayer ?? (await AztecAddress.random());
|
|
121
|
+
data.gasUsed = gasUsed;
|
|
118
122
|
data.constants.txContext.chainId = chainId;
|
|
119
123
|
data.constants.txContext.version = version;
|
|
120
124
|
data.constants.vkTreeRoot = vkTreeRoot;
|
|
@@ -184,6 +188,7 @@ const emptyPrivateCallExecutionResult = () =>
|
|
|
184
188
|
[],
|
|
185
189
|
[],
|
|
186
190
|
[],
|
|
191
|
+
[],
|
|
187
192
|
);
|
|
188
193
|
|
|
189
194
|
const emptyPrivateExecutionResult = () => new PrivateExecutionResult(emptyPrivateCallExecutionResult(), Fr.zero(), []);
|
|
@@ -10,6 +10,7 @@ import { PrivateCircuitPublicInputs } from '../kernel/private_circuit_public_inp
|
|
|
10
10
|
import type { IsEmpty } from '../kernel/utils/interfaces.js';
|
|
11
11
|
import { sortByCounter } from '../kernel/utils/order_and_comparison.js';
|
|
12
12
|
import { ContractClassLog, ContractClassLogFields } from '../logs/contract_class_log.js';
|
|
13
|
+
import { type PreTag, PreTagSchema } from '../logs/pre_tag.js';
|
|
13
14
|
import { Note } from '../note/note.js';
|
|
14
15
|
import { type ZodFor, mapSchema, schemas } from '../schemas/index.js';
|
|
15
16
|
import type { UInt32 } from '../types/index.js';
|
|
@@ -135,6 +136,8 @@ export class PrivateCallExecutionResult {
|
|
|
135
136
|
public returnValues: Fr[],
|
|
136
137
|
/** The offchain effects emitted during execution of this function call via the `emit_offchain_effect` oracle. */
|
|
137
138
|
public offchainEffects: { data: Fr[] }[],
|
|
139
|
+
/** The pre tags used in this tx to compute tags for private logs */
|
|
140
|
+
public preTags: PreTag[],
|
|
138
141
|
/** The nested executions. */
|
|
139
142
|
public nestedExecutionResults: PrivateCallExecutionResult[],
|
|
140
143
|
/**
|
|
@@ -158,6 +161,7 @@ export class PrivateCallExecutionResult {
|
|
|
158
161
|
noteHashNullifierCounterMap: mapSchema(z.coerce.number(), z.number()),
|
|
159
162
|
returnValues: z.array(schemas.Fr),
|
|
160
163
|
offchainEffects: z.array(z.object({ data: z.array(schemas.Fr) })),
|
|
164
|
+
preTags: z.array(PreTagSchema),
|
|
161
165
|
nestedExecutionResults: z.array(z.lazy(() => PrivateCallExecutionResult.schema)),
|
|
162
166
|
contractClassLogs: z.array(CountedContractClassLog.schema),
|
|
163
167
|
})
|
|
@@ -175,6 +179,7 @@ export class PrivateCallExecutionResult {
|
|
|
175
179
|
fields.noteHashNullifierCounterMap,
|
|
176
180
|
fields.returnValues,
|
|
177
181
|
fields.offchainEffects,
|
|
182
|
+
fields.preTags,
|
|
178
183
|
fields.nestedExecutionResults,
|
|
179
184
|
fields.contractClassLogs,
|
|
180
185
|
);
|
|
@@ -195,6 +200,7 @@ export class PrivateCallExecutionResult {
|
|
|
195
200
|
data: [Fr.random()],
|
|
196
201
|
},
|
|
197
202
|
],
|
|
203
|
+
[],
|
|
198
204
|
await timesParallel(nested, () => PrivateCallExecutionResult.random(0)),
|
|
199
205
|
[new CountedContractClassLog(await ContractClassLog.random(), randomInt(10))],
|
|
200
206
|
);
|
|
@@ -117,11 +117,16 @@ export function validatePartialComponentVersionsMatch(
|
|
|
117
117
|
/** Returns a Koa middleware that injects the versioning info as headers. */
|
|
118
118
|
export function getVersioningMiddleware(versions: Partial<ComponentsVersions>) {
|
|
119
119
|
return async (ctx: Koa.Context, next: () => Promise<void>) => {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if
|
|
124
|
-
|
|
120
|
+
try {
|
|
121
|
+
await next();
|
|
122
|
+
} finally {
|
|
123
|
+
// Always add version headers, even if there was an error
|
|
124
|
+
// This allows the client to detect version mismatches before processing other errors
|
|
125
|
+
for (const key in versions) {
|
|
126
|
+
const value = versions[key as keyof ComponentsVersions];
|
|
127
|
+
if (value !== undefined) {
|
|
128
|
+
ctx.set(`x-aztec-${key}`, value.toString());
|
|
129
|
+
}
|
|
125
130
|
}
|
|
126
131
|
}
|
|
127
132
|
};
|