@aztec/stdlib 1.0.0-nightly.20250606 → 1.0.0-nightly.20250607
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/avm/avm.d.ts +304 -304
- package/dest/avm/avm_circuit_public_inputs.d.ts +60 -60
- package/dest/avm/avm_proving_request.d.ts +184 -184
- package/dest/avm/message_pack.d.ts.map +1 -1
- package/dest/avm/message_pack.js +2 -1
- package/dest/block/l2_block.js +1 -1
- package/dest/block/l2_block_code_to_purge.js +1 -1
- package/dest/block/l2_block_source.d.ts +2 -0
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/fees/transaction_fee.js +3 -3
- package/dest/gas/gas.js +1 -1
- package/dest/gas/gas_fees.d.ts +15 -14
- package/dest/gas/gas_fees.d.ts.map +1 -1
- package/dest/gas/gas_fees.js +17 -18
- package/dest/gas/gas_settings.d.ts +24 -24
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +1 -0
- package/dest/interfaces/proving-job.d.ts +185 -185
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/service.d.ts +1 -2
- package/dest/interfaces/service.d.ts.map +1 -1
- package/dest/interfaces/service.js +0 -7
- package/dest/kernel/combined_constant_data.d.ts +71 -0
- package/dest/kernel/combined_constant_data.d.ts.map +1 -0
- package/dest/kernel/combined_constant_data.js +73 -0
- package/dest/kernel/index.d.ts +1 -0
- package/dest/kernel/index.d.ts.map +1 -1
- package/dest/kernel/index.js +1 -0
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts +3 -3
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/base_or_merge_rollup_public_inputs.js +3 -3
- package/dest/rollup/base_rollup_hints.d.ts +14 -15
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +12 -13
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts +24 -9
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_or_block_merge_public_inputs.js +14 -7
- package/dest/rollup/block_root_rollup.d.ts +2 -2
- package/dest/rollup/block_root_rollup.js +1 -1
- package/dest/rollup/constant_rollup_data.d.ts +45 -0
- package/dest/rollup/constant_rollup_data.d.ts.map +1 -0
- package/dest/rollup/{block_constant_data.js → constant_rollup_data.js} +13 -10
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts +4 -4
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts.map +1 -1
- package/dest/rollup/empty_block_root_rollup_inputs.js +2 -2
- package/dest/rollup/index.d.ts +1 -2
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +1 -2
- package/dest/rollup/root_rollup.d.ts +6 -2
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +6 -3
- package/dest/tests/factories.d.ts +10 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +33 -20
- package/dest/tests/mocks.js +2 -2
- package/dest/trees/append_only_tree_snapshot.d.ts +2 -2
- package/dest/trees/append_only_tree_snapshot.d.ts.map +1 -1
- package/dest/trees/append_only_tree_snapshot.js +2 -2
- package/dest/tx/block_header.js +2 -2
- package/dest/tx/global_variables.d.ts +12 -12
- package/dest/tx/global_variables.js +2 -2
- package/dest/tx/partial_state_reference.js +2 -2
- package/dest/tx/processed_tx.d.ts +3 -2
- package/dest/tx/processed_tx.d.ts.map +1 -1
- package/dest/tx/processed_tx.js +7 -5
- package/dest/tx/proposed_block_header.d.ts +2 -2
- package/dest/tx/proposed_block_header.js +1 -1
- package/dest/tx/public_simulation_output.d.ts +3 -3
- package/dest/tx/public_simulation_output.d.ts.map +1 -1
- package/dest/tx/public_simulation_output.js +7 -7
- package/dest/tx/state_reference.js +2 -2
- package/dest/tx/tree_snapshots.js +2 -2
- package/dest/tx/tx_context.d.ts +32 -32
- package/dest/types/shared.d.ts +4 -0
- package/dest/types/shared.d.ts.map +1 -1
- package/dest/zkpassport/index.d.ts +31 -0
- package/dest/zkpassport/index.d.ts.map +1 -0
- package/dest/zkpassport/index.js +81 -0
- package/package.json +9 -8
- package/src/avm/message_pack.ts +1 -0
- package/src/block/l2_block.ts +1 -1
- package/src/block/l2_block_code_to_purge.ts +1 -1
- package/src/block/l2_block_source.ts +3 -0
- package/src/fees/transaction_fee.ts +5 -5
- package/src/gas/gas.ts +1 -1
- package/src/gas/gas_fees.ts +27 -23
- package/src/gas/gas_settings.ts +1 -5
- package/src/interfaces/archiver.ts +1 -0
- package/src/interfaces/service.ts +1 -11
- package/src/kernel/combined_constant_data.ts +128 -0
- package/src/kernel/index.ts +1 -0
- package/src/rollup/base_or_merge_rollup_public_inputs.ts +4 -4
- package/src/rollup/base_rollup_hints.ts +11 -12
- package/src/rollup/block_root_or_block_merge_public_inputs.ts +18 -7
- package/src/rollup/block_root_rollup.ts +1 -1
- package/src/rollup/constant_rollup_data.ts +54 -0
- package/src/rollup/empty_block_root_rollup_inputs.ts +3 -3
- package/src/rollup/index.ts +1 -2
- package/src/rollup/root_rollup.ts +7 -5
- package/src/tests/factories.ts +54 -30
- package/src/tests/mocks.ts +2 -2
- package/src/trees/append_only_tree_snapshot.ts +2 -2
- package/src/tx/block_header.ts +2 -2
- package/src/tx/global_variables.ts +2 -2
- package/src/tx/partial_state_reference.ts +4 -4
- package/src/tx/processed_tx.ts +10 -7
- package/src/tx/proposed_block_header.ts +1 -1
- package/src/tx/public_simulation_output.ts +5 -5
- package/src/tx/state_reference.ts +2 -2
- package/src/tx/tree_snapshots.ts +8 -8
- package/src/types/shared.ts +5 -0
- package/src/zkpassport/index.ts +115 -0
- package/dest/rollup/block_constant_data.d.ts +0 -37
- package/dest/rollup/block_constant_data.d.ts.map +0 -1
- package/dest/rollup/epoch_constant_data.d.ts +0 -39
- package/dest/rollup/epoch_constant_data.d.ts.map +0 -1
- package/dest/rollup/epoch_constant_data.js +0 -40
- package/src/rollup/block_constant_data.ts +0 -63
- package/src/rollup/epoch_constant_data.ts +0 -44
|
@@ -52,17 +52,17 @@ export declare class GlobalVariables {
|
|
|
52
52
|
coinbase: import("../schemas/index.js").ZodFor<EthAddress>;
|
|
53
53
|
feeRecipient: import("../schemas/index.js").ZodFor<AztecAddress>;
|
|
54
54
|
gasFees: z.ZodEffects<z.ZodObject<{
|
|
55
|
-
feePerDaGas: z.
|
|
56
|
-
feePerL2Gas: z.
|
|
55
|
+
feePerDaGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
56
|
+
feePerL2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
57
57
|
}, "strip", z.ZodTypeAny, {
|
|
58
|
-
feePerDaGas:
|
|
59
|
-
feePerL2Gas:
|
|
58
|
+
feePerDaGas: bigint;
|
|
59
|
+
feePerL2Gas: bigint;
|
|
60
60
|
}, {
|
|
61
|
-
feePerDaGas: string;
|
|
62
|
-
feePerL2Gas: string;
|
|
61
|
+
feePerDaGas: string | number | bigint;
|
|
62
|
+
feePerL2Gas: string | number | bigint;
|
|
63
63
|
}>, GasFees, {
|
|
64
|
-
feePerDaGas: string;
|
|
65
|
-
feePerL2Gas: string;
|
|
64
|
+
feePerDaGas: string | number | bigint;
|
|
65
|
+
feePerL2Gas: string | number | bigint;
|
|
66
66
|
}>;
|
|
67
67
|
}, "strip", z.ZodTypeAny, {
|
|
68
68
|
chainId: Fr;
|
|
@@ -75,8 +75,8 @@ export declare class GlobalVariables {
|
|
|
75
75
|
gasFees: GasFees;
|
|
76
76
|
}, {
|
|
77
77
|
gasFees: {
|
|
78
|
-
feePerDaGas: string;
|
|
79
|
-
feePerL2Gas: string;
|
|
78
|
+
feePerDaGas: string | number | bigint;
|
|
79
|
+
feePerL2Gas: string | number | bigint;
|
|
80
80
|
};
|
|
81
81
|
chainId?: any;
|
|
82
82
|
version?: any;
|
|
@@ -87,8 +87,8 @@ export declare class GlobalVariables {
|
|
|
87
87
|
feeRecipient?: any;
|
|
88
88
|
}>, GlobalVariables, {
|
|
89
89
|
gasFees: {
|
|
90
|
-
feePerDaGas: string;
|
|
91
|
-
feePerL2Gas: string;
|
|
90
|
+
feePerDaGas: string | number | bigint;
|
|
91
|
+
feePerL2Gas: string | number | bigint;
|
|
92
92
|
};
|
|
93
93
|
chainId?: any;
|
|
94
94
|
version?: any;
|
|
@@ -118,8 +118,8 @@ import { schemas } from '../schemas/index.js';
|
|
|
118
118
|
timestamp: this.timestamp.toNumber(),
|
|
119
119
|
coinbase: this.coinbase.toString(),
|
|
120
120
|
feeRecipient: this.feeRecipient.toString(),
|
|
121
|
-
feePerDaGas: this.gasFees.feePerDaGas
|
|
122
|
-
feePerL2Gas: this.gasFees.feePerL2Gas
|
|
121
|
+
feePerDaGas: Number(this.gasFees.feePerDaGas),
|
|
122
|
+
feePerL2Gas: Number(this.gasFees.feePerL2Gas)
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
125
|
[inspect.custom]() {
|
|
@@ -35,7 +35,7 @@ import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
|
35
35
|
return new PartialStateReference(noteHashTree, nullifierTree, publicDataTree);
|
|
36
36
|
}
|
|
37
37
|
static empty() {
|
|
38
|
-
return new PartialStateReference(AppendOnlyTreeSnapshot.
|
|
38
|
+
return new PartialStateReference(AppendOnlyTreeSnapshot.zero(), AppendOnlyTreeSnapshot.zero(), AppendOnlyTreeSnapshot.zero());
|
|
39
39
|
}
|
|
40
40
|
toBuffer() {
|
|
41
41
|
return serializeToBuffer(this.noteHashTree, this.nullifierTree, this.publicDataTree);
|
|
@@ -52,7 +52,7 @@ import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
|
52
52
|
return fields;
|
|
53
53
|
}
|
|
54
54
|
isEmpty() {
|
|
55
|
-
return this.noteHashTree.
|
|
55
|
+
return this.noteHashTree.isZero() && this.nullifierTree.isZero() && this.publicDataTree.isZero();
|
|
56
56
|
}
|
|
57
57
|
equals(other) {
|
|
58
58
|
return this.noteHashTree.equals(other.noteHashTree) && this.nullifierTree.equals(other.nullifierTree) && this.publicDataTree.equals(other.publicDataTree);
|
|
@@ -4,6 +4,7 @@ import type { PublicDataWrite } from '../avm/public_data_write.js';
|
|
|
4
4
|
import { RevertCode } from '../avm/revert_code.js';
|
|
5
5
|
import type { SimulationError } from '../errors/simulation_error.js';
|
|
6
6
|
import type { GasUsed } from '../gas/gas_used.js';
|
|
7
|
+
import { CombinedConstantData } from '../kernel/combined_constant_data.js';
|
|
7
8
|
import type { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
8
9
|
import type { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
9
10
|
import type { GlobalVariables } from './global_variables.js';
|
|
@@ -37,9 +38,9 @@ export type ProcessedTx = {
|
|
|
37
38
|
*/
|
|
38
39
|
avmProvingRequest: AvmProvingRequest | undefined;
|
|
39
40
|
/**
|
|
40
|
-
* `
|
|
41
|
+
* Combining `TxConstantData` specified by the user, and `GlobalVariables` injected by the sequencer.
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
constants: CombinedConstantData;
|
|
43
44
|
/**
|
|
44
45
|
* Output data of the tx.
|
|
45
46
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"processed_tx.d.ts","sourceRoot":"","sources":["../../src/tx/processed_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,wDAAwD,CAAC;AACnH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,oBAAY,gBAAgB;IAC1B,KAAK,IAAA;IACL,SAAS,IAAA;IACT,QAAQ,IAAA;CACT;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,oCAAoC,CAAC;IAC3C;;OAEG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACjD;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"processed_tx.d.ts","sourceRoot":"","sources":["../../src/tx/processed_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,KAAK,EAAE,oCAAoC,EAAE,MAAM,wDAAwD,CAAC;AACnH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,oBAAY,gBAAgB;IAC1B,KAAK,IAAA;IACL,SAAS,IAAA;IACT,QAAQ,IAAA;CACT;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,oCAAoC,CAAC;IAC3C;;OAEG;IACH,cAAc,EAAE,cAAc,CAAC;IAC/B;;OAEG;IACH,iBAAiB,EAAE,iBAAiB,GAAG,SAAS,CAAC;IACjD;;OAEG;IACH,SAAS,EAAE,oBAAoB,CAAC;IAChC;;OAEG;IACH,QAAQ,EAAE,QAAQ,CAAC;IAInB,OAAO,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,YAAY,EAAE,eAAe,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IACrB;;OAEG;IACH,EAAE,EAAE,EAAE,CAAC;IACP;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,wBAAsB,gCAAgC,CACpD,EAAE,EAAE,EAAE,EACN,cAAc,EAAE,EAAE,EAClB,yBAAyB,EAAE,eAAe,EAC1C,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,WAAW,CAAC,CAsCtB;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,MAAM,CAI1D;AAED,wBAAsB,oCAAoC,CACxD,EAAE,EAAE,EAAE,EACN,iBAAiB,EAAE,iBAAiB,EACpC,OAAO,EAAE,OAAO,EAChB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,eAAe,GAAG,SAAS,GACxC,OAAO,CAAC,WAAW,CAAC,CA0CtB"}
|
package/dest/tx/processed_tx.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RevertCode } from '../avm/revert_code.js';
|
|
2
2
|
import { Gas } from '../gas/gas.js';
|
|
3
3
|
import { siloL2ToL1Message } from '../hash/hash.js';
|
|
4
|
+
import { CombinedConstantData } from '../kernel/combined_constant_data.js';
|
|
4
5
|
import { TxEffect } from './tx_effect.js';
|
|
5
6
|
export var TxExecutionPhase = /*#__PURE__*/ function(TxExecutionPhase) {
|
|
6
7
|
TxExecutionPhase[TxExecutionPhase["SETUP"] = 0] = "SETUP";
|
|
@@ -9,8 +10,9 @@ export var TxExecutionPhase = /*#__PURE__*/ function(TxExecutionPhase) {
|
|
|
9
10
|
return TxExecutionPhase;
|
|
10
11
|
}({});
|
|
11
12
|
export async function makeProcessedTxFromPrivateOnlyTx(tx, transactionFee, feePaymentPublicDataWrite, globalVariables) {
|
|
13
|
+
const constants = CombinedConstantData.combine(tx.data.constants, globalVariables);
|
|
12
14
|
const data = tx.data.forRollup;
|
|
13
|
-
const txEffect = new TxEffect(RevertCode.OK, await tx.getTxHash(), transactionFee, data.end.noteHashes.filter((h)=>!h.isZero()), data.end.nullifiers.filter((h)=>!h.isZero()), data.end.l2ToL1Msgs.map((message)=>siloL2ToL1Message(message,
|
|
15
|
+
const txEffect = new TxEffect(RevertCode.OK, await tx.getTxHash(), transactionFee, data.end.noteHashes.filter((h)=>!h.isZero()), data.end.nullifiers.filter((h)=>!h.isZero()), data.end.l2ToL1Msgs.map((message)=>siloL2ToL1Message(message, constants.txContext.version, constants.txContext.chainId)).filter((h)=>!h.isZero()), [
|
|
14
16
|
feePaymentPublicDataWrite
|
|
15
17
|
], data.end.privateLogs.filter((l)=>!l.isEmpty()), [], tx.getContractClassLogs());
|
|
16
18
|
const gasUsed = {
|
|
@@ -25,7 +27,7 @@ export async function makeProcessedTxFromPrivateOnlyTx(tx, transactionFee, feePa
|
|
|
25
27
|
data: tx.data,
|
|
26
28
|
clientIvcProof: tx.clientIvcProof,
|
|
27
29
|
avmProvingRequest: undefined,
|
|
28
|
-
|
|
30
|
+
constants,
|
|
29
31
|
txEffect,
|
|
30
32
|
gasUsed,
|
|
31
33
|
revertCode: RevertCode.OK,
|
|
@@ -39,20 +41,20 @@ export function toNumBlobFields(txs) {
|
|
|
39
41
|
}
|
|
40
42
|
export async function makeProcessedTxFromTxWithPublicCalls(tx, avmProvingRequest, gasUsed, revertCode, revertReason) {
|
|
41
43
|
const avmPublicInputs = avmProvingRequest.inputs.publicInputs;
|
|
42
|
-
const
|
|
44
|
+
const constants = CombinedConstantData.combine(tx.data.constants, avmPublicInputs.globalVariables);
|
|
43
45
|
const publicDataWrites = avmPublicInputs.accumulatedData.publicDataWrites.filter((w)=>!w.isEmpty());
|
|
44
46
|
const privateLogs = [
|
|
45
47
|
...tx.data.forPublic.nonRevertibleAccumulatedData.privateLogs,
|
|
46
48
|
...revertCode.isOK() ? tx.data.forPublic.revertibleAccumulatedData.privateLogs : []
|
|
47
49
|
].filter((l)=>!l.isEmpty());
|
|
48
50
|
const contractClassLogs = revertCode.isOK() ? tx.getContractClassLogs() : tx.getSplitContractClassLogs(false);
|
|
49
|
-
const txEffect = new TxEffect(revertCode, await tx.getTxHash(), avmPublicInputs.transactionFee, avmPublicInputs.accumulatedData.noteHashes.filter((h)=>!h.isZero()), avmPublicInputs.accumulatedData.nullifiers.filter((h)=>!h.isZero()), avmPublicInputs.accumulatedData.l2ToL1Msgs.map((message)=>siloL2ToL1Message(message,
|
|
51
|
+
const txEffect = new TxEffect(revertCode, await tx.getTxHash(), avmPublicInputs.transactionFee, avmPublicInputs.accumulatedData.noteHashes.filter((h)=>!h.isZero()), avmPublicInputs.accumulatedData.nullifiers.filter((h)=>!h.isZero()), avmPublicInputs.accumulatedData.l2ToL1Msgs.map((message)=>siloL2ToL1Message(message, constants.txContext.version, constants.txContext.chainId)).filter((h)=>!h.isZero()), publicDataWrites, privateLogs, avmPublicInputs.accumulatedData.publicLogs.filter((l)=>!l.isEmpty()), contractClassLogs);
|
|
50
52
|
return {
|
|
51
53
|
hash: txEffect.txHash,
|
|
52
54
|
data: tx.data,
|
|
53
55
|
clientIvcProof: tx.clientIvcProof,
|
|
54
56
|
avmProvingRequest,
|
|
55
|
-
|
|
57
|
+
constants,
|
|
56
58
|
txEffect,
|
|
57
59
|
gasUsed,
|
|
58
60
|
revertCode,
|
|
@@ -115,7 +115,7 @@ import { ContentCommitment } from './content_commitment.js';
|
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
[inspect.custom]() {
|
|
118
|
-
const gasfees = `da:${this.gasFees.feePerDaGas
|
|
118
|
+
const gasfees = `da:${this.gasFees.feePerDaGas}, l2:${this.gasFees.feePerL2Gas}`;
|
|
119
119
|
return `Header {
|
|
120
120
|
lastArchiveRoot: ${this.lastArchiveRoot.toString()},
|
|
121
121
|
contentCommitment: ${inspect(this.contentCommitment)},
|
|
@@ -2,8 +2,8 @@ import { Fr } from '@aztec/foundation/fields';
|
|
|
2
2
|
import { type ZodFor } from '@aztec/foundation/schemas';
|
|
3
3
|
import { SimulationError } from '../errors/simulation_error.js';
|
|
4
4
|
import type { GasUsed } from '../gas/gas_used.js';
|
|
5
|
+
import { CombinedConstantData } from '../kernel/combined_constant_data.js';
|
|
5
6
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
6
|
-
import { GlobalVariables } from './global_variables.js';
|
|
7
7
|
/** Return values of simulating a circuit. */
|
|
8
8
|
export type ProcessReturnValues = Fr[] | undefined;
|
|
9
9
|
/** Return values of simulating complete callstack. */
|
|
@@ -20,11 +20,11 @@ export declare class NestedProcessReturnValues {
|
|
|
20
20
|
*/
|
|
21
21
|
export declare class PublicSimulationOutput {
|
|
22
22
|
revertReason: SimulationError | undefined;
|
|
23
|
-
|
|
23
|
+
constants: CombinedConstantData;
|
|
24
24
|
txEffect: TxEffect;
|
|
25
25
|
publicReturnValues: NestedProcessReturnValues[];
|
|
26
26
|
gasUsed: GasUsed;
|
|
27
|
-
constructor(revertReason: SimulationError | undefined,
|
|
27
|
+
constructor(revertReason: SimulationError | undefined, constants: CombinedConstantData, txEffect: TxEffect, publicReturnValues: NestedProcessReturnValues[], gasUsed: GasUsed);
|
|
28
28
|
static get schema(): ZodFor<PublicSimulationOutput>;
|
|
29
29
|
static random(): Promise<PublicSimulationOutput>;
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public_simulation_output.d.ts","sourceRoot":"","sources":["../../src/tx/public_simulation_output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AAKjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"public_simulation_output.d.ts","sourceRoot":"","sources":["../../src/tx/public_simulation_output.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AAKjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,6CAA6C;AAC7C,MAAM,MAAM,mBAAmB,GAAG,EAAE,EAAE,GAAG,SAAS,CAAC;AAEnD,sDAAsD;AACtD,qBAAa,yBAAyB;IACpC,MAAM,EAAE,mBAAmB,CAAC;IAC5B,MAAM,EAAE,yBAAyB,EAAE,CAAC;gBAExB,MAAM,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,yBAAyB,EAAE;IAK7E,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,yBAAyB,CAAC,CAOrD;IAED,MAAM,CAAC,KAAK;IAIZ,MAAM,CAAC,MAAM,CAAC,KAAK,SAAI,GAAG,yBAAyB;CAMpD;AAED;;GAEG;AACH,qBAAa,sBAAsB;IAExB,YAAY,EAAE,eAAe,GAAG,SAAS;IACzC,SAAS,EAAE,oBAAoB;IAC/B,QAAQ,EAAE,QAAQ;IAClB,kBAAkB,EAAE,yBAAyB,EAAE;IAC/C,OAAO,EAAE,OAAO;gBAJhB,YAAY,EAAE,eAAe,GAAG,SAAS,EACzC,SAAS,EAAE,oBAAoB,EAC/B,QAAQ,EAAE,QAAQ,EAClB,kBAAkB,EAAE,yBAAyB,EAAE,EAC/C,OAAO,EAAE,OAAO;IAGzB,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,sBAAsB,CAAC,CAwBlD;WAEY,MAAM;CASpB"}
|
|
@@ -4,8 +4,8 @@ import times from 'lodash.times';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { SimulationError } from '../errors/simulation_error.js';
|
|
6
6
|
import { Gas } from '../gas/gas.js';
|
|
7
|
+
import { CombinedConstantData } from '../kernel/combined_constant_data.js';
|
|
7
8
|
import { TxEffect } from '../tx/tx_effect.js';
|
|
8
|
-
import { GlobalVariables } from './global_variables.js';
|
|
9
9
|
/** Return values of simulating complete callstack. */ export class NestedProcessReturnValues {
|
|
10
10
|
values;
|
|
11
11
|
nested;
|
|
@@ -32,13 +32,13 @@ import { GlobalVariables } from './global_variables.js';
|
|
|
32
32
|
* Outputs of processing the public component of a transaction.
|
|
33
33
|
*/ export class PublicSimulationOutput {
|
|
34
34
|
revertReason;
|
|
35
|
-
|
|
35
|
+
constants;
|
|
36
36
|
txEffect;
|
|
37
37
|
publicReturnValues;
|
|
38
38
|
gasUsed;
|
|
39
|
-
constructor(revertReason,
|
|
39
|
+
constructor(revertReason, constants, txEffect, publicReturnValues, gasUsed){
|
|
40
40
|
this.revertReason = revertReason;
|
|
41
|
-
this.
|
|
41
|
+
this.constants = constants;
|
|
42
42
|
this.txEffect = txEffect;
|
|
43
43
|
this.publicReturnValues = publicReturnValues;
|
|
44
44
|
this.gasUsed = gasUsed;
|
|
@@ -46,7 +46,7 @@ import { GlobalVariables } from './global_variables.js';
|
|
|
46
46
|
static get schema() {
|
|
47
47
|
return z.object({
|
|
48
48
|
revertReason: SimulationError.schema.optional(),
|
|
49
|
-
|
|
49
|
+
constants: CombinedConstantData.schema,
|
|
50
50
|
txEffect: TxEffect.schema,
|
|
51
51
|
publicReturnValues: z.array(NestedProcessReturnValues.schema),
|
|
52
52
|
gasUsed: z.object({
|
|
@@ -55,10 +55,10 @@ import { GlobalVariables } from './global_variables.js';
|
|
|
55
55
|
publicGas: Gas.schema,
|
|
56
56
|
billedGas: Gas.schema
|
|
57
57
|
})
|
|
58
|
-
}).transform((fields)=>new PublicSimulationOutput(fields.revertReason, fields.
|
|
58
|
+
}).transform((fields)=>new PublicSimulationOutput(fields.revertReason, fields.constants, fields.txEffect, fields.publicReturnValues, fields.gasUsed));
|
|
59
59
|
}
|
|
60
60
|
static async random() {
|
|
61
|
-
return new PublicSimulationOutput(await SimulationError.random(),
|
|
61
|
+
return new PublicSimulationOutput(await SimulationError.random(), CombinedConstantData.empty(), TxEffect.empty(), times(2, NestedProcessReturnValues.random), {
|
|
62
62
|
teardownGas: Gas.random(),
|
|
63
63
|
totalGas: Gas.random(),
|
|
64
64
|
publicGas: Gas.random(),
|
|
@@ -47,10 +47,10 @@ import { PartialStateReference } from './partial_state_reference.js';
|
|
|
47
47
|
return new StateReference(l1ToL2MessageTree, partial);
|
|
48
48
|
}
|
|
49
49
|
static empty() {
|
|
50
|
-
return new StateReference(AppendOnlyTreeSnapshot.
|
|
50
|
+
return new StateReference(AppendOnlyTreeSnapshot.zero(), PartialStateReference.empty());
|
|
51
51
|
}
|
|
52
52
|
isEmpty() {
|
|
53
|
-
return this.l1ToL2MessageTree.
|
|
53
|
+
return this.l1ToL2MessageTree.isZero() && this.partial.isEmpty();
|
|
54
54
|
}
|
|
55
55
|
toInspect() {
|
|
56
56
|
return {
|
|
@@ -56,10 +56,10 @@ import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
|
56
56
|
return fields;
|
|
57
57
|
}
|
|
58
58
|
static empty() {
|
|
59
|
-
return new TreeSnapshots(AppendOnlyTreeSnapshot.
|
|
59
|
+
return new TreeSnapshots(AppendOnlyTreeSnapshot.zero(), AppendOnlyTreeSnapshot.zero(), AppendOnlyTreeSnapshot.zero(), AppendOnlyTreeSnapshot.zero());
|
|
60
60
|
}
|
|
61
61
|
isEmpty() {
|
|
62
|
-
return this.l1ToL2MessageTree.
|
|
62
|
+
return this.l1ToL2MessageTree.isZero() && this.noteHashTree.isZero() && this.nullifierTree.isZero() && this.publicDataTree.isZero();
|
|
63
63
|
}
|
|
64
64
|
[inspect.custom]() {
|
|
65
65
|
return `TreeSnapshots {
|
package/dest/tx/tx_context.d.ts
CHANGED
|
@@ -49,30 +49,30 @@ export declare class TxContext {
|
|
|
49
49
|
l2Gas: string | number | bigint;
|
|
50
50
|
}>;
|
|
51
51
|
maxFeesPerGas: z.ZodEffects<z.ZodObject<{
|
|
52
|
-
feePerDaGas: z.
|
|
53
|
-
feePerL2Gas: z.
|
|
52
|
+
feePerDaGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
53
|
+
feePerL2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
54
54
|
}, "strip", z.ZodTypeAny, {
|
|
55
|
-
feePerDaGas:
|
|
56
|
-
feePerL2Gas:
|
|
55
|
+
feePerDaGas: bigint;
|
|
56
|
+
feePerL2Gas: bigint;
|
|
57
57
|
}, {
|
|
58
|
-
feePerDaGas: string;
|
|
59
|
-
feePerL2Gas: string;
|
|
58
|
+
feePerDaGas: string | number | bigint;
|
|
59
|
+
feePerL2Gas: string | number | bigint;
|
|
60
60
|
}>, import("../gas/gas_fees.js").GasFees, {
|
|
61
|
-
feePerDaGas: string;
|
|
62
|
-
feePerL2Gas: string;
|
|
61
|
+
feePerDaGas: string | number | bigint;
|
|
62
|
+
feePerL2Gas: string | number | bigint;
|
|
63
63
|
}>;
|
|
64
64
|
maxPriorityFeesPerGas: z.ZodEffects<z.ZodObject<{
|
|
65
|
-
feePerDaGas: z.
|
|
66
|
-
feePerL2Gas: z.
|
|
65
|
+
feePerDaGas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
66
|
+
feePerL2Gas: z.ZodPipeline<z.ZodUnion<[z.ZodBigInt, z.ZodNumber, z.ZodString]>, z.ZodBigInt>;
|
|
67
67
|
}, "strip", z.ZodTypeAny, {
|
|
68
|
-
feePerDaGas:
|
|
69
|
-
feePerL2Gas:
|
|
68
|
+
feePerDaGas: bigint;
|
|
69
|
+
feePerL2Gas: bigint;
|
|
70
70
|
}, {
|
|
71
|
-
feePerDaGas: string;
|
|
72
|
-
feePerL2Gas: string;
|
|
71
|
+
feePerDaGas: string | number | bigint;
|
|
72
|
+
feePerL2Gas: string | number | bigint;
|
|
73
73
|
}>, import("../gas/gas_fees.js").GasFees, {
|
|
74
|
-
feePerDaGas: string;
|
|
75
|
-
feePerL2Gas: string;
|
|
74
|
+
feePerDaGas: string | number | bigint;
|
|
75
|
+
feePerL2Gas: string | number | bigint;
|
|
76
76
|
}>;
|
|
77
77
|
}, "strip", z.ZodTypeAny, {
|
|
78
78
|
gasLimits: import("../gas/gas.js").Gas;
|
|
@@ -89,12 +89,12 @@ export declare class TxContext {
|
|
|
89
89
|
l2Gas: string | number | bigint;
|
|
90
90
|
};
|
|
91
91
|
maxFeesPerGas: {
|
|
92
|
-
feePerDaGas: string;
|
|
93
|
-
feePerL2Gas: string;
|
|
92
|
+
feePerDaGas: string | number | bigint;
|
|
93
|
+
feePerL2Gas: string | number | bigint;
|
|
94
94
|
};
|
|
95
95
|
maxPriorityFeesPerGas: {
|
|
96
|
-
feePerDaGas: string;
|
|
97
|
-
feePerL2Gas: string;
|
|
96
|
+
feePerDaGas: string | number | bigint;
|
|
97
|
+
feePerL2Gas: string | number | bigint;
|
|
98
98
|
};
|
|
99
99
|
}>, GasSettings, {
|
|
100
100
|
gasLimits: {
|
|
@@ -106,12 +106,12 @@ export declare class TxContext {
|
|
|
106
106
|
l2Gas: string | number | bigint;
|
|
107
107
|
};
|
|
108
108
|
maxFeesPerGas: {
|
|
109
|
-
feePerDaGas: string;
|
|
110
|
-
feePerL2Gas: string;
|
|
109
|
+
feePerDaGas: string | number | bigint;
|
|
110
|
+
feePerL2Gas: string | number | bigint;
|
|
111
111
|
};
|
|
112
112
|
maxPriorityFeesPerGas: {
|
|
113
|
-
feePerDaGas: string;
|
|
114
|
-
feePerL2Gas: string;
|
|
113
|
+
feePerDaGas: string | number | bigint;
|
|
114
|
+
feePerL2Gas: string | number | bigint;
|
|
115
115
|
};
|
|
116
116
|
}>;
|
|
117
117
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -131,12 +131,12 @@ export declare class TxContext {
|
|
|
131
131
|
l2Gas: string | number | bigint;
|
|
132
132
|
};
|
|
133
133
|
maxFeesPerGas: {
|
|
134
|
-
feePerDaGas: string;
|
|
135
|
-
feePerL2Gas: string;
|
|
134
|
+
feePerDaGas: string | number | bigint;
|
|
135
|
+
feePerL2Gas: string | number | bigint;
|
|
136
136
|
};
|
|
137
137
|
maxPriorityFeesPerGas: {
|
|
138
|
-
feePerDaGas: string;
|
|
139
|
-
feePerL2Gas: string;
|
|
138
|
+
feePerDaGas: string | number | bigint;
|
|
139
|
+
feePerL2Gas: string | number | bigint;
|
|
140
140
|
};
|
|
141
141
|
};
|
|
142
142
|
}>, TxContext, {
|
|
@@ -152,12 +152,12 @@ export declare class TxContext {
|
|
|
152
152
|
l2Gas: string | number | bigint;
|
|
153
153
|
};
|
|
154
154
|
maxFeesPerGas: {
|
|
155
|
-
feePerDaGas: string;
|
|
156
|
-
feePerL2Gas: string;
|
|
155
|
+
feePerDaGas: string | number | bigint;
|
|
156
|
+
feePerL2Gas: string | number | bigint;
|
|
157
157
|
};
|
|
158
158
|
maxPriorityFeesPerGas: {
|
|
159
|
-
feePerDaGas: string;
|
|
160
|
-
feePerL2Gas: string;
|
|
159
|
+
feePerDaGas: string | number | bigint;
|
|
160
|
+
feePerL2Gas: string | number | bigint;
|
|
161
161
|
};
|
|
162
162
|
};
|
|
163
163
|
}>;
|
package/dest/types/shared.d.ts
CHANGED
|
@@ -23,6 +23,10 @@ export type UInt32 = number;
|
|
|
23
23
|
* A type alias for a 64-bit unsigned integer.
|
|
24
24
|
*/
|
|
25
25
|
export type UInt64 = bigint;
|
|
26
|
+
/**
|
|
27
|
+
* A type alias for a 128-bit unsigned integer.
|
|
28
|
+
*/
|
|
29
|
+
export type UInt128 = bigint;
|
|
26
30
|
/**
|
|
27
31
|
* CircuitType replaces ComposerType for now. When using Plonk, CircuitType is equivalent to the information of the proving system that will be used
|
|
28
32
|
* to construct a proof. In the future Aztec zk stack, more information must be specified (e.g., the curve over which circuits are constructed;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/types/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,6BAA6B,CAAC;AAEjF;;GAEG;AACH,qBAAa,MAAM,CAAC,CAAC,SAAS,UAAU;IAEpC;;OAEG;IACI,KAAK,EAAE,CAAC,EAAE;;IAHjB;;OAEG;IACI,KAAK,EAAE,CAAC,EAAE;IAGnB,QAAQ;IAIR,cAAc;CAGf;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B;;;;GAIG;AACH,oBAAY,WAAW;IACrB,QAAQ,IAAI;IACZ,KAAK,IAAI;CACV;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,IAAI,IAAI;IACR,KAAK,IAAI;IACT,IAAI,IAAI;CACT"}
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/types/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,6BAA6B,CAAC;AAEjF;;GAEG;AACH,qBAAa,MAAM,CAAC,CAAC,SAAS,UAAU;IAEpC;;OAEG;IACI,KAAK,EAAE,CAAC,EAAE;;IAHjB;;OAEG;IACI,KAAK,EAAE,CAAC,EAAE;IAGnB,QAAQ;IAIR,cAAc;CAGf;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC;AAE5B;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAE7B;;;;GAIG;AACH,oBAAY,WAAW;IACrB,QAAQ,IAAI;IACZ,KAAK,IAAI;CACV;AAED;;GAEG;AACH,oBAAY,WAAW;IACrB,IAAI,IAAI;IACR,KAAK,IAAI;IACT,IAAI,IAAI;CACT"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
export type ViemZkPassportProofParams = {
|
|
4
|
+
vkeyHash: `0x${string}`;
|
|
5
|
+
proof: `0x${string}`;
|
|
6
|
+
publicInputs: `0x${string}`[];
|
|
7
|
+
committedInputs: `0x${string}`;
|
|
8
|
+
committedInputCounts: bigint[];
|
|
9
|
+
validityPeriodInDays: bigint;
|
|
10
|
+
scope: string;
|
|
11
|
+
subscope: string;
|
|
12
|
+
devMode: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare class ZkPassportProofParams {
|
|
15
|
+
devMode: boolean;
|
|
16
|
+
vkeyHash: Buffer32;
|
|
17
|
+
proof: Buffer;
|
|
18
|
+
publicInputs: Fr[];
|
|
19
|
+
committedInputs: Buffer;
|
|
20
|
+
committedInputCounts: bigint[];
|
|
21
|
+
validityPeriodInDays: bigint;
|
|
22
|
+
scope: string;
|
|
23
|
+
subscope: string;
|
|
24
|
+
constructor(devMode: boolean, vkeyHash: Buffer32, proof: Buffer, publicInputs: Fr[], committedInputs: Buffer, committedInputCounts: bigint[], validityPeriodInDays: bigint, scope: string, subscope: string);
|
|
25
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
26
|
+
static random(): ZkPassportProofParams;
|
|
27
|
+
static fromBuffer(buffer: Buffer): ZkPassportProofParams;
|
|
28
|
+
static fromViem(params: ViemZkPassportProofParams): ZkPassportProofParams;
|
|
29
|
+
toViem(): ViemZkPassportProofParams;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zkpassport/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEpD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAI9C,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,KAAK,MAAM,EAAE,CAAC;IACxB,KAAK,EAAE,KAAK,MAAM,EAAE,CAAC;IACrB,YAAY,EAAE,KAAK,MAAM,EAAE,EAAE,CAAC;IAC9B,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAIF,qBAAa,qBAAqB;IAEvB,OAAO,EAAE,OAAO;IAChB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,MAAM;IACb,YAAY,EAAE,EAAE,EAAE;IAClB,eAAe,EAAE,MAAM;IACvB,oBAAoB,EAAE,MAAM,EAAE;IAC9B,oBAAoB,EAAE,MAAM;IAC5B,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,MAAM;gBARhB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,EAAE,EAAE,EAClB,eAAe,EAAE,MAAM,EACvB,oBAAoB,EAAE,MAAM,EAAE,EAC9B,oBAAoB,EAAE,MAAM,EAC5B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM;IAGzB,QAAQ;IAkBR,MAAM,CAAC,MAAM;IAqBb,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM;IAehC,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,yBAAyB;IAcjD,MAAM,IAAI,yBAAyB;CAapC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
2
|
+
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
4
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
+
import { withoutHexPrefix } from '@aztec/foundation/string';
|
|
6
|
+
// NOTE: Must match the ZkPassportProofParams struct in the zkpassport verifier contract
|
|
7
|
+
// find here: ROOT/l1-contracts/lib/circuits/src/solidity/src/ZKPassportVerifier.sol
|
|
8
|
+
export class ZkPassportProofParams {
|
|
9
|
+
devMode;
|
|
10
|
+
vkeyHash;
|
|
11
|
+
proof;
|
|
12
|
+
publicInputs;
|
|
13
|
+
committedInputs;
|
|
14
|
+
committedInputCounts;
|
|
15
|
+
validityPeriodInDays;
|
|
16
|
+
scope;
|
|
17
|
+
subscope;
|
|
18
|
+
constructor(devMode, vkeyHash, proof, publicInputs, committedInputs, committedInputCounts, validityPeriodInDays, scope, subscope){
|
|
19
|
+
this.devMode = devMode;
|
|
20
|
+
this.vkeyHash = vkeyHash;
|
|
21
|
+
this.proof = proof;
|
|
22
|
+
this.publicInputs = publicInputs;
|
|
23
|
+
this.committedInputs = committedInputs;
|
|
24
|
+
this.committedInputCounts = committedInputCounts;
|
|
25
|
+
this.validityPeriodInDays = validityPeriodInDays;
|
|
26
|
+
this.scope = scope;
|
|
27
|
+
this.subscope = subscope;
|
|
28
|
+
}
|
|
29
|
+
toBuffer() {
|
|
30
|
+
return serializeToBuffer([
|
|
31
|
+
this.devMode,
|
|
32
|
+
this.vkeyHash,
|
|
33
|
+
this.proof.length,
|
|
34
|
+
this.proof,
|
|
35
|
+
this.publicInputs.length,
|
|
36
|
+
this.publicInputs,
|
|
37
|
+
this.committedInputs.length,
|
|
38
|
+
this.committedInputs,
|
|
39
|
+
this.committedInputCounts.length,
|
|
40
|
+
this.committedInputCounts,
|
|
41
|
+
this.validityPeriodInDays,
|
|
42
|
+
this.scope,
|
|
43
|
+
this.subscope
|
|
44
|
+
]);
|
|
45
|
+
}
|
|
46
|
+
static random() {
|
|
47
|
+
const committedInputCounts = [
|
|
48
|
+
BigInt(1),
|
|
49
|
+
BigInt(2),
|
|
50
|
+
BigInt(3),
|
|
51
|
+
BigInt(4)
|
|
52
|
+
];
|
|
53
|
+
const numberOfCommittedInputs = committedInputCounts.reduce((acc, count)=>acc + count, BigInt(0));
|
|
54
|
+
const committedInputs = randomBytes(Number(numberOfCommittedInputs) * 32);
|
|
55
|
+
const publicInputsCount = numberOfCommittedInputs + 16n;
|
|
56
|
+
const publicInputs = Array.from({
|
|
57
|
+
length: Number(publicInputsCount)
|
|
58
|
+
}, ()=>Fr.random());
|
|
59
|
+
return new ZkPassportProofParams(false, Buffer32.random(), randomBytes(1024), publicInputs, committedInputs, committedInputCounts, BigInt(100), 'sequencer.alpha-testnet.aztec.network', 'personhood');
|
|
60
|
+
}
|
|
61
|
+
static fromBuffer(buffer) {
|
|
62
|
+
const reader = BufferReader.asReader(buffer);
|
|
63
|
+
return new ZkPassportProofParams(reader.readBoolean(), reader.readObject(Buffer32), reader.readBuffer(), reader.readVector(Fr), reader.readBuffer(), reader.readUint256Vector(), reader.readUInt256(), reader.readString(), reader.readString());
|
|
64
|
+
}
|
|
65
|
+
static fromViem(params) {
|
|
66
|
+
return new ZkPassportProofParams(params.devMode, Buffer32.fromString(params.vkeyHash), Buffer.from(withoutHexPrefix(params.proof), 'hex'), params.publicInputs.map((input)=>Fr.fromString(input)), Buffer.from(withoutHexPrefix(params.committedInputs), 'hex'), params.committedInputCounts, params.validityPeriodInDays, params.scope, params.subscope);
|
|
67
|
+
}
|
|
68
|
+
toViem() {
|
|
69
|
+
return {
|
|
70
|
+
devMode: this.devMode,
|
|
71
|
+
vkeyHash: this.vkeyHash.toString(),
|
|
72
|
+
proof: `0x${this.proof.toString('hex')}`,
|
|
73
|
+
publicInputs: this.publicInputs.map((input)=>input.toString()),
|
|
74
|
+
committedInputs: `0x${this.committedInputs.toString('hex')}`,
|
|
75
|
+
committedInputCounts: this.committedInputCounts,
|
|
76
|
+
validityPeriodInDays: this.validityPeriodInDays,
|
|
77
|
+
scope: this.scope,
|
|
78
|
+
subscope: this.subscope
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
}
|
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.20250607",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"./validators": "./dest/validators/index.js",
|
|
51
51
|
"./file-store": "./dest/file-store/index.js",
|
|
52
52
|
"./snapshots": "./dest/snapshots/index.js",
|
|
53
|
-
"./update-checker": "./dest/update-checker/index.js"
|
|
53
|
+
"./update-checker": "./dest/update-checker/index.js",
|
|
54
|
+
"./zkpassport": "./dest/zkpassport/index.js"
|
|
54
55
|
},
|
|
55
56
|
"typedocOptions": {
|
|
56
57
|
"entryPoints": [
|
|
@@ -67,12 +68,12 @@
|
|
|
67
68
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
68
69
|
},
|
|
69
70
|
"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.
|
|
71
|
+
"@aztec/bb.js": "1.0.0-nightly.20250607",
|
|
72
|
+
"@aztec/blob-lib": "1.0.0-nightly.20250607",
|
|
73
|
+
"@aztec/constants": "1.0.0-nightly.20250607",
|
|
74
|
+
"@aztec/ethereum": "1.0.0-nightly.20250607",
|
|
75
|
+
"@aztec/foundation": "1.0.0-nightly.20250607",
|
|
76
|
+
"@aztec/noir-noirc_abi": "1.0.0-nightly.20250607",
|
|
76
77
|
"@google-cloud/storage": "^7.15.0",
|
|
77
78
|
"axios": "^1.9.0",
|
|
78
79
|
"json-stringify-deterministic": "1.0.12",
|
package/src/avm/message_pack.ts
CHANGED
package/src/block/l2_block.ts
CHANGED
|
@@ -103,7 +103,7 @@ export class L2Block {
|
|
|
103
103
|
* @returns The L2 block.
|
|
104
104
|
*/
|
|
105
105
|
static empty(): L2Block {
|
|
106
|
-
return new L2Block(AppendOnlyTreeSnapshot.
|
|
106
|
+
return new L2Block(AppendOnlyTreeSnapshot.zero(), BlockHeader.empty(), Body.empty());
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
get number(): number {
|