@aztec/stdlib 3.0.0-nightly.20250916 → 3.0.0-nightly.20250918
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 +78 -1
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +20 -2
- package/dest/avm/avm_circuit_public_inputs.d.ts +6 -1
- package/dest/avm/avm_circuit_public_inputs.d.ts.map +1 -1
- package/dest/avm/avm_circuit_public_inputs.js +11 -6
- package/dest/avm/avm_proving_request.d.ts +41 -0
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/body.d.ts +4 -1
- package/dest/block/body.d.ts.map +1 -1
- package/dest/block/body.js +16 -5
- package/dest/block/index.d.ts +1 -0
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -0
- package/dest/block/l2_block.d.ts +8 -5
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +14 -7
- package/dest/block/l2_block_code_to_purge.d.ts +3 -14
- package/dest/block/l2_block_code_to_purge.d.ts.map +1 -1
- package/dest/block/l2_block_code_to_purge.js +23 -13
- package/dest/block/l2_block_header.d.ts +100 -0
- package/dest/block/l2_block_header.d.ts.map +1 -0
- package/dest/block/l2_block_header.js +146 -0
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +1 -1
- package/dest/block/published_l2_block.d.ts +2 -2
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +1 -3
- package/dest/interfaces/aztec-node.d.ts +5 -2
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +1 -0
- package/dest/interfaces/block-builder.d.ts +1 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/epoch-prover.d.ts +25 -8
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +204 -61
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +101 -39
- package/dest/interfaces/pxe.d.ts +8 -1
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +1 -0
- package/dest/interfaces/server_circuit_prover.d.ts +19 -16
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +3 -2
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +4 -4
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +7 -7
- package/dest/kernel/private_context_inputs.d.ts +2 -2
- package/dest/kernel/private_context_inputs.d.ts.map +1 -1
- package/dest/kernel/private_context_inputs.js +4 -4
- package/dest/kernel/private_kernel_tail_circuit_public_inputs.js +1 -1
- package/dest/messaging/inbox_leaf.d.ts +2 -0
- package/dest/messaging/inbox_leaf.d.ts.map +1 -1
- package/dest/messaging/inbox_leaf.js +3 -0
- package/dest/p2p/consensus_payload.d.ts +7 -6
- package/dest/p2p/consensus_payload.d.ts.map +1 -1
- package/dest/p2p/consensus_payload.js +7 -6
- package/dest/parity/root_parity_input.d.ts +1 -1
- package/dest/proofs/proof_data.d.ts +1 -1
- package/dest/proofs/proof_data.d.ts.map +1 -1
- package/dest/proofs/proof_data.js +2 -2
- package/dest/proofs/proving_request_type.d.ts +13 -8
- package/dest/proofs/proving_request_type.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.js +13 -8
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts +1 -1
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/base_or_merge_rollup_public_inputs.js +1 -1
- package/dest/rollup/base_rollup_hints.d.ts +12 -3
- package/dest/rollup/base_rollup_hints.d.ts.map +1 -1
- package/dest/rollup/base_rollup_hints.js +11 -5
- package/dest/rollup/block_constant_data.d.ts +20 -6
- package/dest/rollup/block_constant_data.d.ts.map +1 -1
- package/dest/rollup/block_constant_data.js +15 -7
- package/dest/rollup/block_merge_rollup.d.ts +10 -9
- package/dest/rollup/block_merge_rollup.d.ts.map +1 -1
- package/dest/rollup/block_merge_rollup.js +14 -13
- package/dest/rollup/block_rollup_public_inputs.d.ts +124 -0
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/block_rollup_public_inputs.js +85 -0
- package/dest/rollup/block_root_rollup.d.ts +148 -184
- package/dest/rollup/block_root_rollup.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup.js +211 -260
- package/dest/rollup/checkpoint_constant_data.d.ts +54 -0
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -0
- package/dest/rollup/checkpoint_constant_data.js +55 -0
- package/dest/{tx/proposed_block_header.d.ts → rollup/checkpoint_header.d.ts} +11 -12
- package/dest/rollup/checkpoint_header.d.ts.map +1 -0
- package/dest/{tx/proposed_block_header.js → rollup/checkpoint_header.js} +9 -9
- package/dest/rollup/checkpoint_merge_rollup.d.ts +30 -0
- package/dest/rollup/checkpoint_merge_rollup.d.ts.map +1 -0
- package/dest/rollup/checkpoint_merge_rollup.js +37 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +105 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/checkpoint_rollup_public_inputs.js +105 -0
- package/dest/rollup/checkpoint_root_rollup.d.ts +117 -0
- package/dest/rollup/checkpoint_root_rollup.d.ts.map +1 -0
- package/dest/rollup/checkpoint_root_rollup.js +178 -0
- package/dest/rollup/epoch_constant_data.d.ts +19 -2
- package/dest/rollup/epoch_constant_data.d.ts.map +1 -1
- package/dest/rollup/epoch_constant_data.js +20 -7
- package/dest/rollup/index.d.ts +8 -5
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +8 -5
- package/dest/rollup/rollup_proof_data.d.ts +10 -0
- package/dest/rollup/rollup_proof_data.d.ts.map +1 -0
- package/dest/rollup/rollup_proof_data.js +1 -0
- package/dest/rollup/root_rollup.d.ts +26 -23
- package/dest/rollup/root_rollup.d.ts.map +1 -1
- package/dest/rollup/root_rollup.js +28 -39
- package/dest/stats/stats.d.ts +1 -1
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +17 -41
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +76 -80
- package/dest/tests/mocks.d.ts +3 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -3
- package/dest/tx/block_header.d.ts +12 -13
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +16 -21
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +0 -1
- package/dest/tx/index.d.ts +0 -1
- package/dest/tx/index.d.ts.map +1 -1
- package/dest/tx/index.js +0 -1
- package/dest/tx/private_execution_result.d.ts +2 -2
- package/dest/tx/private_execution_result.d.ts.map +1 -1
- package/dest/tx/private_execution_result.js +3 -3
- package/dest/tx/tx_constant_data.d.ts +4 -4
- package/dest/tx/tx_constant_data.d.ts.map +1 -1
- package/dest/tx/tx_constant_data.js +6 -6
- package/dest/tx/tx_effect.d.ts +0 -3
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +2 -7
- package/dest/zkpassport/index.d.ts +3 -3
- package/dest/zkpassport/index.d.ts.map +1 -1
- package/dest/zkpassport/index.js +7 -7
- package/package.json +8 -8
- package/src/avm/avm.ts +22 -0
- package/src/avm/avm_circuit_public_inputs.ts +10 -0
- package/src/block/body.ts +23 -6
- package/src/block/index.ts +1 -0
- package/src/block/l2_block.ts +18 -8
- package/src/block/l2_block_code_to_purge.ts +30 -31
- package/src/block/l2_block_header.ts +232 -0
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +1 -1
- package/src/block/test/l2_tips_store_test_suite.ts +1 -2
- package/src/interfaces/aztec-node.ts +8 -2
- package/src/interfaces/block-builder.ts +1 -6
- package/src/interfaces/epoch-prover.ts +34 -10
- package/src/interfaces/proving-job.ts +166 -51
- package/src/interfaces/pxe.ts +10 -1
- package/src/interfaces/server_circuit_prover.ts +65 -29
- package/src/interfaces/validator.ts +3 -2
- package/src/kernel/private_circuit_public_inputs.ts +5 -5
- package/src/kernel/private_context_inputs.ts +2 -2
- package/src/kernel/private_kernel_tail_circuit_public_inputs.ts +1 -1
- package/src/messaging/inbox_leaf.ts +5 -0
- package/src/p2p/consensus_payload.ts +8 -7
- package/src/proofs/proof_data.ts +1 -6
- package/src/proofs/proving_request_type.ts +8 -3
- package/src/rollup/base_or_merge_rollup_public_inputs.ts +1 -1
- package/src/rollup/base_rollup_hints.ts +9 -1
- package/src/rollup/block_constant_data.ts +13 -3
- package/src/rollup/block_merge_rollup.ts +13 -11
- package/src/rollup/block_rollup_public_inputs.ts +123 -0
- package/src/rollup/block_root_rollup.ts +209 -264
- package/src/rollup/checkpoint_constant_data.ts +84 -0
- package/src/{tx/proposed_block_header.ts → rollup/checkpoint_header.ts} +16 -17
- package/src/rollup/checkpoint_merge_rollup.ts +50 -0
- package/src/rollup/{block_root_or_block_merge_public_inputs.ts → checkpoint_rollup_public_inputs.ts} +26 -52
- package/src/rollup/checkpoint_root_rollup.ts +216 -0
- package/src/rollup/epoch_constant_data.ts +32 -8
- package/src/rollup/index.ts +8 -5
- package/src/rollup/rollup_proof_data.ts +12 -0
- package/src/rollup/root_rollup.ts +30 -41
- package/src/stats/stats.ts +8 -3
- package/src/tests/factories.ts +139 -135
- package/src/tests/mocks.ts +6 -13
- package/src/tx/block_header.ts +17 -32
- package/src/tx/global_variables.ts +0 -1
- package/src/tx/index.ts +0 -1
- package/src/tx/private_execution_result.ts +3 -3
- package/src/tx/tx_constant_data.ts +4 -4
- package/src/tx/tx_effect.ts +2 -7
- package/src/zkpassport/index.ts +6 -6
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts +0 -134
- package/dest/rollup/block_root_or_block_merge_public_inputs.d.ts.map +0 -1
- package/dest/rollup/block_root_or_block_merge_public_inputs.js +0 -125
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts +0 -51
- package/dest/rollup/empty_block_root_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/empty_block_root_rollup_inputs.js +0 -65
- package/dest/rollup/padding_block_root_rollup_inputs.d.ts +0 -20
- package/dest/rollup/padding_block_root_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/padding_block_root_rollup_inputs.js +0 -39
- package/dest/rollup/previous_rollup_block_data.d.ts +0 -47
- package/dest/rollup/previous_rollup_block_data.d.ts.map +0 -1
- package/dest/rollup/previous_rollup_block_data.js +0 -37
- package/dest/tx/proposed_block_header.d.ts.map +0 -1
- package/src/rollup/empty_block_root_rollup_inputs.ts +0 -80
- package/src/rollup/padding_block_root_rollup_inputs.ts +0 -47
- package/src/rollup/previous_rollup_block_data.ts +0 -48
|
@@ -4,18 +4,19 @@ import { BufferReader, FieldReader } from '@aztec/foundation/serialize';
|
|
|
4
4
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
5
5
|
import { inspect } from 'util';
|
|
6
6
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
7
|
-
import { ContentCommitment } from './content_commitment.js';
|
|
8
7
|
import { GlobalVariables } from './global_variables.js';
|
|
9
|
-
import { ProposedBlockHeader } from './proposed_block_header.js';
|
|
10
8
|
import { StateReference } from './state_reference.js';
|
|
11
9
|
/** A header of an L2 block. */
|
|
12
10
|
export declare class BlockHeader {
|
|
13
11
|
/** Snapshot of archive before the block is applied. */
|
|
14
12
|
lastArchive: AppendOnlyTreeSnapshot;
|
|
15
|
-
/** Hash of the body of an L2 block. */
|
|
16
|
-
contentCommitment: ContentCommitment;
|
|
17
13
|
/** State reference. */
|
|
18
14
|
state: StateReference;
|
|
15
|
+
/**
|
|
16
|
+
* Hash of the sponge blob after the tx effects of this block has been applied.
|
|
17
|
+
* May contain tx effects from the previous blocks in the same checkpoint.
|
|
18
|
+
*/
|
|
19
|
+
spongeBlobHash: Fr;
|
|
19
20
|
/** Global variables of an L2 block. */
|
|
20
21
|
globalVariables: GlobalVariables;
|
|
21
22
|
/** Total fees in the block, computed by the root rollup circuit */
|
|
@@ -25,10 +26,13 @@ export declare class BlockHeader {
|
|
|
25
26
|
constructor(
|
|
26
27
|
/** Snapshot of archive before the block is applied. */
|
|
27
28
|
lastArchive: AppendOnlyTreeSnapshot,
|
|
28
|
-
/** Hash of the body of an L2 block. */
|
|
29
|
-
contentCommitment: ContentCommitment,
|
|
30
29
|
/** State reference. */
|
|
31
30
|
state: StateReference,
|
|
31
|
+
/**
|
|
32
|
+
* Hash of the sponge blob after the tx effects of this block has been applied.
|
|
33
|
+
* May contain tx effects from the previous blocks in the same checkpoint.
|
|
34
|
+
*/
|
|
35
|
+
spongeBlobHash: Fr,
|
|
32
36
|
/** Global variables of an L2 block. */
|
|
33
37
|
globalVariables: GlobalVariables,
|
|
34
38
|
/** Total fees in the block, computed by the root rollup circuit */
|
|
@@ -36,7 +40,7 @@ export declare class BlockHeader {
|
|
|
36
40
|
/** Total mana used in the block, computed by the root rollup circuit */
|
|
37
41
|
totalManaUsed: Fr);
|
|
38
42
|
static get schema(): ZodFor<BlockHeader>;
|
|
39
|
-
static getFields(fields: FieldsOf<BlockHeader>): readonly [AppendOnlyTreeSnapshot,
|
|
43
|
+
static getFields(fields: FieldsOf<BlockHeader>): readonly [AppendOnlyTreeSnapshot, StateReference, Fr, GlobalVariables, Fr, Fr];
|
|
40
44
|
static from(fields: FieldsOf<BlockHeader>): BlockHeader;
|
|
41
45
|
getSlot(): bigint;
|
|
42
46
|
getBlockNumber(): number;
|
|
@@ -55,20 +59,15 @@ export declare class BlockHeader {
|
|
|
55
59
|
toString(): `0x${string}`;
|
|
56
60
|
static fromString(str: string): BlockHeader;
|
|
57
61
|
hash(): Promise<Fr>;
|
|
58
|
-
toPropose(): ProposedBlockHeader;
|
|
59
62
|
toInspect(): {
|
|
60
63
|
lastArchive: `0x${string}`;
|
|
61
|
-
contentCommitment: {
|
|
62
|
-
blobsHash: `0x${string}`;
|
|
63
|
-
inHash: `0x${string}`;
|
|
64
|
-
outHash: `0x${string}`;
|
|
65
|
-
};
|
|
66
64
|
state: {
|
|
67
65
|
l1ToL2MessageTree: `0x${string}`;
|
|
68
66
|
noteHashTree: `0x${string}`;
|
|
69
67
|
nullifierTree: `0x${string}`;
|
|
70
68
|
publicDataTree: `0x${string}`;
|
|
71
69
|
};
|
|
70
|
+
spongeBlobHash: bigint;
|
|
72
71
|
globalVariables: {
|
|
73
72
|
chainId: number;
|
|
74
73
|
version: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_header.d.ts","sourceRoot":"","sources":["../../src/tx/block_header.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAE9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"block_header.d.ts","sourceRoot":"","sources":["../../src/tx/block_header.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAE9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EAAE,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lB;;;OAGG;IACI,QAAQ;IAIf,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAI3C,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC;IAInB,SAAS;;;;;;;;;;;;;;;;;;;;;;;IAWT,CAAC,OAAO,CAAC,MAAM,CAAC;IAcT,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;CAUpC"}
|
package/dest/tx/block_header.js
CHANGED
|
@@ -7,21 +7,22 @@ import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
|
7
7
|
import { inspect } from 'util';
|
|
8
8
|
import { z } from 'zod';
|
|
9
9
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
10
|
-
import { ContentCommitment } from './content_commitment.js';
|
|
11
10
|
import { GlobalVariables } from './global_variables.js';
|
|
12
|
-
import { ProposedBlockHeader } from './proposed_block_header.js';
|
|
13
11
|
import { StateReference } from './state_reference.js';
|
|
14
12
|
/** A header of an L2 block. */ export class BlockHeader {
|
|
15
13
|
lastArchive;
|
|
16
|
-
contentCommitment;
|
|
17
14
|
state;
|
|
15
|
+
spongeBlobHash;
|
|
18
16
|
globalVariables;
|
|
19
17
|
totalFees;
|
|
20
18
|
totalManaUsed;
|
|
21
|
-
constructor(/** Snapshot of archive before the block is applied. */ lastArchive, /**
|
|
19
|
+
constructor(/** Snapshot of archive before the block is applied. */ lastArchive, /** State reference. */ state, /**
|
|
20
|
+
* Hash of the sponge blob after the tx effects of this block has been applied.
|
|
21
|
+
* May contain tx effects from the previous blocks in the same checkpoint.
|
|
22
|
+
*/ spongeBlobHash, /** Global variables of an L2 block. */ globalVariables, /** Total fees in the block, computed by the root rollup circuit */ totalFees, /** Total mana used in the block, computed by the root rollup circuit */ totalManaUsed){
|
|
22
23
|
this.lastArchive = lastArchive;
|
|
23
|
-
this.contentCommitment = contentCommitment;
|
|
24
24
|
this.state = state;
|
|
25
|
+
this.spongeBlobHash = spongeBlobHash;
|
|
25
26
|
this.globalVariables = globalVariables;
|
|
26
27
|
this.totalFees = totalFees;
|
|
27
28
|
this.totalManaUsed = totalManaUsed;
|
|
@@ -29,19 +30,18 @@ import { StateReference } from './state_reference.js';
|
|
|
29
30
|
static get schema() {
|
|
30
31
|
return z.object({
|
|
31
32
|
lastArchive: AppendOnlyTreeSnapshot.schema,
|
|
32
|
-
contentCommitment: ContentCommitment.schema,
|
|
33
33
|
state: StateReference.schema,
|
|
34
|
+
spongeBlobHash: schemas.Fr,
|
|
34
35
|
globalVariables: GlobalVariables.schema,
|
|
35
36
|
totalFees: schemas.Fr,
|
|
36
37
|
totalManaUsed: schemas.Fr
|
|
37
38
|
}).transform(BlockHeader.from);
|
|
38
39
|
}
|
|
39
40
|
static getFields(fields) {
|
|
40
|
-
// Note: The order here must match the order in the ProposedHeaderLib solidity library.
|
|
41
41
|
return [
|
|
42
42
|
fields.lastArchive,
|
|
43
|
-
fields.contentCommitment,
|
|
44
43
|
fields.state,
|
|
44
|
+
fields.spongeBlobHash,
|
|
45
45
|
fields.globalVariables,
|
|
46
46
|
fields.totalFees,
|
|
47
47
|
fields.totalManaUsed
|
|
@@ -57,7 +57,7 @@ import { StateReference } from './state_reference.js';
|
|
|
57
57
|
return this.globalVariables.blockNumber;
|
|
58
58
|
}
|
|
59
59
|
getSize() {
|
|
60
|
-
return this.lastArchive.getSize() + this.
|
|
60
|
+
return this.lastArchive.getSize() + this.state.getSize() + this.spongeBlobHash.size + this.globalVariables.getSize() + this.totalFees.size + this.totalManaUsed.size;
|
|
61
61
|
}
|
|
62
62
|
toBuffer() {
|
|
63
63
|
return serializeToBuffer(...BlockHeader.getFields(this));
|
|
@@ -74,17 +74,17 @@ import { StateReference } from './state_reference.js';
|
|
|
74
74
|
}
|
|
75
75
|
static fromBuffer(buffer) {
|
|
76
76
|
const reader = BufferReader.asReader(buffer);
|
|
77
|
-
return new BlockHeader(reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(
|
|
77
|
+
return new BlockHeader(reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(StateReference), reader.readObject(Fr), reader.readObject(GlobalVariables), reader.readObject(Fr), reader.readObject(Fr));
|
|
78
78
|
}
|
|
79
79
|
static fromFields(fields) {
|
|
80
80
|
const reader = FieldReader.asReader(fields);
|
|
81
|
-
return new BlockHeader(AppendOnlyTreeSnapshot.fromFields(reader),
|
|
81
|
+
return new BlockHeader(AppendOnlyTreeSnapshot.fromFields(reader), StateReference.fromFields(reader), reader.readField(), GlobalVariables.fromFields(reader), reader.readField(), reader.readField());
|
|
82
82
|
}
|
|
83
83
|
static empty(fields = {}) {
|
|
84
84
|
return BlockHeader.from({
|
|
85
85
|
lastArchive: AppendOnlyTreeSnapshot.empty(),
|
|
86
|
-
contentCommitment: ContentCommitment.empty(),
|
|
87
86
|
state: StateReference.empty(),
|
|
87
|
+
spongeBlobHash: Fr.ZERO,
|
|
88
88
|
globalVariables: GlobalVariables.empty(),
|
|
89
89
|
totalFees: Fr.ZERO,
|
|
90
90
|
totalManaUsed: Fr.ZERO,
|
|
@@ -92,7 +92,7 @@ import { StateReference } from './state_reference.js';
|
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
94
|
isEmpty() {
|
|
95
|
-
return this.lastArchive.isEmpty() && this.
|
|
95
|
+
return this.lastArchive.isEmpty() && this.state.isEmpty() && this.spongeBlobHash.isZero() && this.globalVariables.isEmpty() && this.totalFees.isZero() && this.totalManaUsed.isZero();
|
|
96
96
|
}
|
|
97
97
|
/**
|
|
98
98
|
* Serializes this instance into a string.
|
|
@@ -106,14 +106,11 @@ import { StateReference } from './state_reference.js';
|
|
|
106
106
|
hash() {
|
|
107
107
|
return poseidon2HashWithSeparator(this.toFields(), GeneratorIndex.BLOCK_HASH);
|
|
108
108
|
}
|
|
109
|
-
toPropose() {
|
|
110
|
-
return new ProposedBlockHeader(this.lastArchive.root, this.contentCommitment, this.globalVariables.slotNumber, this.globalVariables.timestamp, this.globalVariables.coinbase, this.globalVariables.feeRecipient, this.globalVariables.gasFees, this.totalManaUsed);
|
|
111
|
-
}
|
|
112
109
|
toInspect() {
|
|
113
110
|
return {
|
|
114
111
|
lastArchive: this.lastArchive.root.toString(),
|
|
115
|
-
contentCommitment: this.contentCommitment.toInspect(),
|
|
116
112
|
state: this.state.toInspect(),
|
|
113
|
+
spongeBlobHash: this.spongeBlobHash.toBigInt(),
|
|
117
114
|
globalVariables: this.globalVariables.toInspect(),
|
|
118
115
|
totalFees: this.totalFees.toBigInt(),
|
|
119
116
|
totalManaUsed: this.totalManaUsed.toBigInt()
|
|
@@ -122,19 +119,17 @@ import { StateReference } from './state_reference.js';
|
|
|
122
119
|
[inspect.custom]() {
|
|
123
120
|
return `Header {
|
|
124
121
|
lastArchive: ${inspect(this.lastArchive)},
|
|
125
|
-
contentCommitment.blobsHash: ${inspect(this.contentCommitment.blobsHash)},
|
|
126
|
-
contentCommitment.inHash: ${inspect(this.contentCommitment.inHash)},
|
|
127
|
-
contentCommitment.outHash: ${inspect(this.contentCommitment.outHash)},
|
|
128
122
|
state.l1ToL2MessageTree: ${inspect(this.state.l1ToL2MessageTree)},
|
|
129
123
|
state.noteHashTree: ${inspect(this.state.partial.noteHashTree)},
|
|
130
124
|
state.nullifierTree: ${inspect(this.state.partial.nullifierTree)},
|
|
131
125
|
state.publicDataTree: ${inspect(this.state.partial.publicDataTree)},
|
|
126
|
+
spongeBlobHash: ${this.spongeBlobHash},
|
|
132
127
|
globalVariables: ${inspect(this.globalVariables)},
|
|
133
128
|
totalFees: ${this.totalFees},
|
|
134
129
|
totalManaUsed: ${this.totalManaUsed},
|
|
135
130
|
}`;
|
|
136
131
|
}
|
|
137
132
|
equals(other) {
|
|
138
|
-
return this.
|
|
133
|
+
return this.lastArchive.equals(other.lastArchive) && this.state.equals(other.state) && this.spongeBlobHash.equals(other.spongeBlobHash) && this.globalVariables.equals(other.globalVariables) && this.totalFees.equals(other.totalFees) && this.totalManaUsed.equals(other.totalManaUsed);
|
|
139
134
|
}
|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AAC,OAAO,CAAC,MAAM,CAAC;IAIT,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,OAAO;CAYpC"}
|
|
@@ -69,7 +69,6 @@ import { schemas } from '../schemas/index.js';
|
|
|
69
69
|
return new GlobalVariables(reader.readField(), reader.readField(), reader.readU32(), reader.readField(), reader.readField().toBigInt(), EthAddress.fromField(reader.readField()), AztecAddress.fromField(reader.readField()), GasFees.fromFields(reader));
|
|
70
70
|
}
|
|
71
71
|
static getFields(fields) {
|
|
72
|
-
// Note: The order here must match the order in the ProposedHeaderLib solidity library.
|
|
73
72
|
return [
|
|
74
73
|
fields.chainId,
|
|
75
74
|
fields.version,
|
package/dest/tx/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export * from './tx_constant_data.js';
|
|
|
10
10
|
export * from './tx_context.js';
|
|
11
11
|
export * from './tx_request.js';
|
|
12
12
|
export * from './private_execution_result.js';
|
|
13
|
-
export * from './proposed_block_header.js';
|
|
14
13
|
export * from './public_call_request_with_calldata.js';
|
|
15
14
|
export * from './tx_hash.js';
|
|
16
15
|
export * from './tx_receipt.js';
|
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,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;AAC9C,cAAc,
|
|
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,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;AAC9C,cAAc,wCAAwC,CAAC;AACvD,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,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
|
@@ -10,7 +10,6 @@ export * from './tx_constant_data.js';
|
|
|
10
10
|
export * from './tx_context.js';
|
|
11
11
|
export * from './tx_request.js';
|
|
12
12
|
export * from './private_execution_result.js';
|
|
13
|
-
export * from './proposed_block_header.js';
|
|
14
13
|
export * from './public_call_request_with_calldata.js';
|
|
15
14
|
export * from './tx_hash.js';
|
|
16
15
|
export * from './tx_receipt.js';
|
|
@@ -94,9 +94,9 @@ export declare class PrivateExecutionResult {
|
|
|
94
94
|
static from(fields: FieldsOf<PrivateExecutionResult>): PrivateExecutionResult;
|
|
95
95
|
static random(nested?: number): Promise<PrivateExecutionResult>;
|
|
96
96
|
/**
|
|
97
|
-
* The block number that this execution was simulated with.
|
|
97
|
+
* The anchor block number that this execution was simulated with.
|
|
98
98
|
*/
|
|
99
|
-
|
|
99
|
+
getSimulationAnchorBlockNumber(): UInt32;
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
102
|
* The result of executing a call to a private function.
|
|
@@ -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,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D;;GAEG;AACH,qBAAa,WAAW;IAEpB,gBAAgB;IACT,IAAI,EAAE,IAAI;IACjB,oCAAoC;IAC7B,WAAW,EAAE,EAAE;IACtB,gCAAgC;IACzB,UAAU,EAAE,YAAY;;IAL/B,gBAAgB;IACT,IAAI,EAAE,IAAI;IACjB,oCAAoC;IAC7B,WAAW,EAAE,EAAE;IACtB,gCAAgC;IACzB,UAAU,E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BAAgB,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"}
|
|
@@ -80,9 +80,9 @@ export class PrivateExecutionResult {
|
|
|
80
80
|
]);
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
|
-
* The block number that this execution was simulated with.
|
|
84
|
-
*/
|
|
85
|
-
return this.entrypoint.publicInputs.
|
|
83
|
+
* The anchor block number that this execution was simulated with.
|
|
84
|
+
*/ getSimulationAnchorBlockNumber() {
|
|
85
|
+
return this.entrypoint.publicInputs.anchorBlockHeader.globalVariables.blockNumber;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
/**
|
|
@@ -8,12 +8,12 @@ import { TxContext } from './tx_context.js';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare class TxConstantData {
|
|
10
10
|
/** Header of a block whose state is used during execution (not the block the transaction is included in). */
|
|
11
|
-
|
|
11
|
+
anchorBlockHeader: BlockHeader;
|
|
12
12
|
/**
|
|
13
13
|
* Context of the transaction.
|
|
14
14
|
*
|
|
15
15
|
* Note: `chainId` and `version` in txContext are not redundant to the values in
|
|
16
|
-
* self.
|
|
16
|
+
* self.anchor_block_header.global_variables because they can be different in case of a protocol upgrade. In such
|
|
17
17
|
* a situation we could be using header from a block before the upgrade took place but be using the updated
|
|
18
18
|
* protocol to execute and prove the transaction.
|
|
19
19
|
*/
|
|
@@ -28,12 +28,12 @@ export declare class TxConstantData {
|
|
|
28
28
|
protocolContractTreeRoot: Fr;
|
|
29
29
|
constructor(
|
|
30
30
|
/** Header of a block whose state is used during execution (not the block the transaction is included in). */
|
|
31
|
-
|
|
31
|
+
anchorBlockHeader: BlockHeader,
|
|
32
32
|
/**
|
|
33
33
|
* Context of the transaction.
|
|
34
34
|
*
|
|
35
35
|
* Note: `chainId` and `version` in txContext are not redundant to the values in
|
|
36
|
-
* self.
|
|
36
|
+
* self.anchor_block_header.global_variables because they can be different in case of a protocol upgrade. In such
|
|
37
37
|
* a situation we could be using header from a block before the upgrade took place but be using the updated
|
|
38
38
|
* protocol to execute and prove the transaction.
|
|
39
39
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_constant_data.d.ts","sourceRoot":"","sources":["../../src/tx/tx_constant_data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAC9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,qBAAa,cAAc;IAEvB,6GAA6G;IACtG,
|
|
1
|
+
{"version":3,"file":"tx_constant_data.d.ts","sourceRoot":"","sources":["../../src/tx/tx_constant_data.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAwC,MAAM,6BAA6B,CAAC;AAC9G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,qBAAa,cAAc;IAEvB,6GAA6G;IACtG,iBAAiB,EAAE,WAAW;IACrC;;;;;;;OAOG;IACI,SAAS,EAAE,SAAS;IAC3B;;OAEG;IACI,UAAU,EAAE,EAAE;IACrB;;OAEG;IACI,wBAAwB,EAAE,EAAE;;IAlBnC,6GAA6G;IACtG,iBAAiB,EAAE,WAAW;IACrC;;;;;;;OAOG;IACI,SAAS,EAAE,SAAS;IAC3B;;OAEG;IACI,UAAU,EAAE,EAAE;IACrB;;OAEG;IACI,wBAAwB,EAAE,EAAE;IAGrC,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC;IAI5C,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC;IAIjD,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW,GAAG,cAAc;IAU7D,QAAQ,IAAI,EAAE,EAAE;IAUhB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,cAAc;IAUhE,QAAQ;IAIR,MAAM,CAAC,KAAK;IAIZ,OAAO;IASP,KAAK,IAAI,cAAc;CAGxB"}
|
|
@@ -6,15 +6,15 @@ import { TxContext } from './tx_context.js';
|
|
|
6
6
|
/**
|
|
7
7
|
* Data that is constant/not modified by neither of the kernels.
|
|
8
8
|
*/ export class TxConstantData {
|
|
9
|
-
|
|
9
|
+
anchorBlockHeader;
|
|
10
10
|
txContext;
|
|
11
11
|
vkTreeRoot;
|
|
12
12
|
protocolContractTreeRoot;
|
|
13
|
-
constructor(/** Header of a block whose state is used during execution (not the block the transaction is included in). */
|
|
13
|
+
constructor(/** Header of a block whose state is used during execution (not the block the transaction is included in). */ anchorBlockHeader, /**
|
|
14
14
|
* Context of the transaction.
|
|
15
15
|
*
|
|
16
16
|
* Note: `chainId` and `version` in txContext are not redundant to the values in
|
|
17
|
-
* self.
|
|
17
|
+
* self.anchor_block_header.global_variables because they can be different in case of a protocol upgrade. In such
|
|
18
18
|
* a situation we could be using header from a block before the upgrade took place but be using the updated
|
|
19
19
|
* protocol to execute and prove the transaction.
|
|
20
20
|
*/ txContext, /**
|
|
@@ -22,7 +22,7 @@ import { TxContext } from './tx_context.js';
|
|
|
22
22
|
*/ vkTreeRoot, /**
|
|
23
23
|
* Root of the tree for the protocol contracts.
|
|
24
24
|
*/ protocolContractTreeRoot){
|
|
25
|
-
this.
|
|
25
|
+
this.anchorBlockHeader = anchorBlockHeader;
|
|
26
26
|
this.txContext = txContext;
|
|
27
27
|
this.vkTreeRoot = vkTreeRoot;
|
|
28
28
|
this.protocolContractTreeRoot = protocolContractTreeRoot;
|
|
@@ -32,7 +32,7 @@ import { TxContext } from './tx_context.js';
|
|
|
32
32
|
}
|
|
33
33
|
static getFields(fields) {
|
|
34
34
|
return [
|
|
35
|
-
fields.
|
|
35
|
+
fields.anchorBlockHeader,
|
|
36
36
|
fields.txContext,
|
|
37
37
|
fields.vkTreeRoot,
|
|
38
38
|
fields.protocolContractTreeRoot
|
|
@@ -60,7 +60,7 @@ import { TxContext } from './tx_context.js';
|
|
|
60
60
|
return new TxConstantData(BlockHeader.empty(), TxContext.empty(), Fr.ZERO, Fr.ZERO);
|
|
61
61
|
}
|
|
62
62
|
getSize() {
|
|
63
|
-
return this.
|
|
63
|
+
return this.anchorBlockHeader.getSize() + this.txContext.getSize() + this.vkTreeRoot.size + this.protocolContractTreeRoot.size;
|
|
64
64
|
}
|
|
65
65
|
clone() {
|
|
66
66
|
return TxConstantData.fromBuffer(this.toBuffer());
|
package/dest/tx/tx_effect.d.ts
CHANGED
|
@@ -9,9 +9,6 @@ import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
|
9
9
|
import { PrivateLog } from '../logs/private_log.js';
|
|
10
10
|
import { PublicLog } from '../logs/public_log.js';
|
|
11
11
|
import { TxHash } from './tx_hash.js';
|
|
12
|
-
export declare const TX_START_PREFIX = 8392562855083340404n;
|
|
13
|
-
export declare const TX_START_PREFIX_BYTES_LENGTH: number;
|
|
14
|
-
export declare const TX_EFFECT_PREFIX_BYTE_LENGTH: number;
|
|
15
12
|
export declare class TxEffect {
|
|
16
13
|
/**
|
|
17
14
|
* Whether the transaction reverted during public app logic.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_effect.d.ts","sourceRoot":"","sources":["../../src/tx/tx_effect.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tx_effect.d.ts","sourceRoot":"","sources":["../../src/tx/tx_effect.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,QAAQ,EAA6B,MAAM,yBAAyB,CAAC;AAEnF,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAW,MAAM,2BAA2B,CAAC;AACjE,OAAO,EACL,YAAY,EACZ,WAAW,EAGZ,MAAM,6BAA6B,CAAC;AAIrC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,qBAAa,QAAQ;IAEjB;;OAEG;IACI,UAAU,EAAE,UAAU;IAC7B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;;OAEG;IACI,cAAc,EAAE,EAAE;IACzB;;OAEG;IACI,UAAU,EAAE,EAAE,EAAE;IACvB;;OAEG;IACI,UAAU,EAAE,EAAE,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BAAgB;IAgBxB;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,EAAE;;;;IAQjC;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE;IAuB7B;;OAEG;IACH,YAAY,IAAI,EAAE,EAAE;IAoDpB;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,EAAE,EAAE,GAAG,WAAW;IA0EhD,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAetC,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAepC;IAED,CAAC,OAAO,CAAC,MAAM,CAAC;IAsBhB;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;CAG9B"}
|
package/dest/tx/tx_effect.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TX_EFFECT_PREFIX_BYTE_LENGTH, TX_START_PREFIX_BYTES_LENGTH } from '@aztec/blob-lib/encoding';
|
|
2
|
+
import { CONTRACT_CLASS_LOGS_PREFIX, L2_L1_MSGS_PREFIX, MAX_CONTRACT_CLASS_LOGS_PER_TX, MAX_L2_TO_L1_MSGS_PER_TX, MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, MAX_PRIVATE_LOGS_PER_TX, MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX, NOTES_PREFIX, NULLIFIERS_PREFIX, PRIVATE_LOGS_PREFIX, PUBLIC_DATA_UPDATE_REQUESTS_PREFIX, PUBLIC_LOGS_PREFIX, REVERT_CODE_PREFIX, TX_FEE_PREFIX, TX_START_PREFIX } from '@aztec/constants';
|
|
2
3
|
import { makeTuple, makeTupleAsync } from '@aztec/foundation/array';
|
|
3
4
|
import { toBufferBE } from '@aztec/foundation/bigint-buffer';
|
|
4
5
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -14,12 +15,6 @@ import { ContractClassLog } from '../logs/contract_class_log.js';
|
|
|
14
15
|
import { PrivateLog } from '../logs/private_log.js';
|
|
15
16
|
import { PublicLog } from '../logs/public_log.js';
|
|
16
17
|
import { TxHash } from './tx_hash.js';
|
|
17
|
-
// This will appear as 0x74785f7374617274 in logs
|
|
18
|
-
export const TX_START_PREFIX = 8392562855083340404n;
|
|
19
|
-
// These are helper constants to decode tx effects from blob encoded fields
|
|
20
|
-
export const TX_START_PREFIX_BYTES_LENGTH = TX_START_PREFIX.toString(16).length / 2;
|
|
21
|
-
// 7 bytes for: | 0 | txlen[0] | txlen[1] | 0 | REVERT_CODE_PREFIX | 0 | revertCode |
|
|
22
|
-
export const TX_EFFECT_PREFIX_BYTE_LENGTH = TX_START_PREFIX_BYTES_LENGTH + 7;
|
|
23
18
|
export class TxEffect {
|
|
24
19
|
revertCode;
|
|
25
20
|
txHash;
|
|
@@ -6,7 +6,7 @@ export type ViemZkPassportProofParams = {
|
|
|
6
6
|
publicInputs: `0x${string}`[];
|
|
7
7
|
committedInputs: `0x${string}`;
|
|
8
8
|
committedInputCounts: bigint[];
|
|
9
|
-
|
|
9
|
+
validityPeriodInSeconds: bigint;
|
|
10
10
|
domain: string;
|
|
11
11
|
scope: string;
|
|
12
12
|
devMode: boolean;
|
|
@@ -18,10 +18,10 @@ export declare class ZkPassportProofParams {
|
|
|
18
18
|
publicInputs: Fr[];
|
|
19
19
|
committedInputs: Buffer;
|
|
20
20
|
committedInputCounts: bigint[];
|
|
21
|
-
|
|
21
|
+
validityPeriodInSeconds: bigint;
|
|
22
22
|
domain: string;
|
|
23
23
|
scope: string;
|
|
24
|
-
constructor(devMode: boolean, vkeyHash: Buffer32, proof: Buffer, publicInputs: Fr[], committedInputs: Buffer, committedInputCounts: bigint[],
|
|
24
|
+
constructor(devMode: boolean, vkeyHash: Buffer32, proof: Buffer, publicInputs: Fr[], committedInputs: Buffer, committedInputCounts: bigint[], validityPeriodInSeconds: bigint, domain: string, scope: string);
|
|
25
25
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
26
26
|
static random(): ZkPassportProofParams;
|
|
27
27
|
static fromBuffer(buffer: Buffer): ZkPassportProofParams;
|
|
@@ -1 +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,
|
|
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,uBAAuB,EAAE,MAAM,CAAC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,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,uBAAuB,EAAE,MAAM;IAC/B,MAAM,EAAE,MAAM;IACd,KAAK,EAAE,MAAM;gBARb,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,uBAAuB,EAAE,MAAM,EAC/B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM;IAGtB,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"}
|
package/dest/zkpassport/index.js
CHANGED
|
@@ -12,17 +12,17 @@ export class ZkPassportProofParams {
|
|
|
12
12
|
publicInputs;
|
|
13
13
|
committedInputs;
|
|
14
14
|
committedInputCounts;
|
|
15
|
-
|
|
15
|
+
validityPeriodInSeconds;
|
|
16
16
|
domain;
|
|
17
17
|
scope;
|
|
18
|
-
constructor(devMode, vkeyHash, proof, publicInputs, committedInputs, committedInputCounts,
|
|
18
|
+
constructor(devMode, vkeyHash, proof, publicInputs, committedInputs, committedInputCounts, validityPeriodInSeconds, domain, scope){
|
|
19
19
|
this.devMode = devMode;
|
|
20
20
|
this.vkeyHash = vkeyHash;
|
|
21
21
|
this.proof = proof;
|
|
22
22
|
this.publicInputs = publicInputs;
|
|
23
23
|
this.committedInputs = committedInputs;
|
|
24
24
|
this.committedInputCounts = committedInputCounts;
|
|
25
|
-
this.
|
|
25
|
+
this.validityPeriodInSeconds = validityPeriodInSeconds;
|
|
26
26
|
this.domain = domain;
|
|
27
27
|
this.scope = scope;
|
|
28
28
|
}
|
|
@@ -38,7 +38,7 @@ export class ZkPassportProofParams {
|
|
|
38
38
|
this.committedInputs,
|
|
39
39
|
this.committedInputCounts.length,
|
|
40
40
|
this.committedInputCounts,
|
|
41
|
-
this.
|
|
41
|
+
this.validityPeriodInSeconds,
|
|
42
42
|
this.domain,
|
|
43
43
|
this.scope
|
|
44
44
|
]);
|
|
@@ -56,14 +56,14 @@ export class ZkPassportProofParams {
|
|
|
56
56
|
const publicInputs = Array.from({
|
|
57
57
|
length: Number(publicInputsCount)
|
|
58
58
|
}, ()=>Fr.random());
|
|
59
|
-
return new ZkPassportProofParams(false, Buffer32.random(), randomBytes(1024), publicInputs, committedInputs, committedInputCounts, BigInt(100), 'sequencer.alpha-testnet.aztec.network', 'personhood');
|
|
59
|
+
return new ZkPassportProofParams(false, Buffer32.random(), randomBytes(1024), publicInputs, committedInputs, committedInputCounts, BigInt(100 * 60 * 60 * 24), 'sequencer.alpha-testnet.aztec.network', 'personhood');
|
|
60
60
|
}
|
|
61
61
|
static fromBuffer(buffer) {
|
|
62
62
|
const reader = BufferReader.asReader(buffer);
|
|
63
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
64
|
}
|
|
65
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.
|
|
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.validityPeriodInSeconds, params.domain, params.scope);
|
|
67
67
|
}
|
|
68
68
|
toViem() {
|
|
69
69
|
return {
|
|
@@ -73,7 +73,7 @@ export class ZkPassportProofParams {
|
|
|
73
73
|
publicInputs: this.publicInputs.map((input)=>input.toString()),
|
|
74
74
|
committedInputs: `0x${this.committedInputs.toString('hex')}`,
|
|
75
75
|
committedInputCounts: this.committedInputCounts,
|
|
76
|
-
|
|
76
|
+
validityPeriodInSeconds: this.validityPeriodInSeconds,
|
|
77
77
|
domain: this.domain,
|
|
78
78
|
scope: this.scope
|
|
79
79
|
};
|
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.20250918",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -69,13 +69,13 @@
|
|
|
69
69
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/bb.js": "3.0.0-nightly.
|
|
73
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
74
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
75
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
76
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
77
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
78
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
72
|
+
"@aztec/bb.js": "3.0.0-nightly.20250918",
|
|
73
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250918",
|
|
74
|
+
"@aztec/constants": "3.0.0-nightly.20250918",
|
|
75
|
+
"@aztec/ethereum": "3.0.0-nightly.20250918",
|
|
76
|
+
"@aztec/foundation": "3.0.0-nightly.20250918",
|
|
77
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250918",
|
|
78
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250918",
|
|
79
79
|
"@google-cloud/storage": "^7.15.0",
|
|
80
80
|
"axios": "^1.9.0",
|
|
81
81
|
"json-stringify-deterministic": "1.0.12",
|
package/src/avm/avm.ts
CHANGED
|
@@ -106,6 +106,23 @@ export class AvmContractInstanceHint {
|
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
export class AvmProtocolContractAddressHint {
|
|
110
|
+
constructor(
|
|
111
|
+
public readonly canonicalAddress: AztecAddress,
|
|
112
|
+
public readonly derivedAddress: AztecAddress,
|
|
113
|
+
) {}
|
|
114
|
+
static get schema() {
|
|
115
|
+
return z
|
|
116
|
+
.object({
|
|
117
|
+
canonicalAddress: AztecAddress.schema,
|
|
118
|
+
derivedAddress: AztecAddress.schema,
|
|
119
|
+
})
|
|
120
|
+
.transform(
|
|
121
|
+
({ canonicalAddress, derivedAddress }) => new AvmProtocolContractAddressHint(canonicalAddress, derivedAddress),
|
|
122
|
+
);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
109
126
|
////////////////////////////////////////////////////////////////////////////
|
|
110
127
|
// Hints (merkle db)
|
|
111
128
|
////////////////////////////////////////////////////////////////////////////
|
|
@@ -510,6 +527,8 @@ export class AvmExecutionHints {
|
|
|
510
527
|
constructor(
|
|
511
528
|
public readonly globalVariables: GlobalVariables,
|
|
512
529
|
public tx: AvmTxHint,
|
|
530
|
+
// Protocol contract hints.
|
|
531
|
+
public protocolContractDerivedAddresses: AvmProtocolContractAddressHint[] = [],
|
|
513
532
|
// Contract hints.
|
|
514
533
|
public readonly contractInstances: AvmContractInstanceHint[] = [],
|
|
515
534
|
public readonly contractClasses: AvmContractClassHint[] = [],
|
|
@@ -538,6 +557,7 @@ export class AvmExecutionHints {
|
|
|
538
557
|
.object({
|
|
539
558
|
globalVariables: GlobalVariables.schema,
|
|
540
559
|
tx: AvmTxHint.schema,
|
|
560
|
+
protocolContractDerivedAddresses: AvmProtocolContractAddressHint.schema.array(),
|
|
541
561
|
contractInstances: AvmContractInstanceHint.schema.array(),
|
|
542
562
|
contractClasses: AvmContractClassHint.schema.array(),
|
|
543
563
|
bytecodeCommitments: AvmBytecodeCommitmentHint.schema.array(),
|
|
@@ -558,6 +578,7 @@ export class AvmExecutionHints {
|
|
|
558
578
|
({
|
|
559
579
|
globalVariables,
|
|
560
580
|
tx,
|
|
581
|
+
protocolContractDerivedAddresses,
|
|
561
582
|
contractInstances,
|
|
562
583
|
contractClasses,
|
|
563
584
|
bytecodeCommitments,
|
|
@@ -577,6 +598,7 @@ export class AvmExecutionHints {
|
|
|
577
598
|
new AvmExecutionHints(
|
|
578
599
|
globalVariables,
|
|
579
600
|
tx,
|
|
601
|
+
protocolContractDerivedAddresses,
|
|
580
602
|
contractInstances,
|
|
581
603
|
contractClasses,
|
|
582
604
|
bytecodeCommitments,
|