@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
|
@@ -1,380 +1,325 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
BLOBS_PER_BLOCK,
|
|
5
|
-
FIELDS_PER_BLOB,
|
|
6
|
-
L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH,
|
|
7
|
-
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
8
|
-
} from '@aztec/constants';
|
|
9
|
-
import { BLS12Point, Fr } from '@aztec/foundation/fields';
|
|
1
|
+
import { SpongeBlob } from '@aztec/blob-lib/types';
|
|
2
|
+
import { ARCHIVE_HEIGHT, L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH } from '@aztec/constants';
|
|
3
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
10
4
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
11
|
-
import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
12
|
-
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
5
|
+
import { BufferReader, type Tuple, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
13
6
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
14
7
|
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
8
|
+
import { ParityPublicInputs } from '../parity/parity_public_inputs.js';
|
|
9
|
+
import { ProofData } from '../proofs/proof_data.js';
|
|
10
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
11
|
+
import { StateReference } from '../tx/state_reference.js';
|
|
12
|
+
import type { UInt64 } from '../types/shared.js';
|
|
13
|
+
import { BaseOrMergeRollupPublicInputs } from './base_or_merge_rollup_public_inputs.js';
|
|
14
|
+
import { CheckpointConstantData } from './checkpoint_constant_data.js';
|
|
15
|
+
import type { RollupProofData, RootParityProofData } from './rollup_proof_data.js';
|
|
18
16
|
|
|
19
|
-
export class
|
|
17
|
+
export class BlockRootFirstRollupPrivateInputs {
|
|
20
18
|
constructor(
|
|
21
19
|
/**
|
|
22
20
|
* The original and converted roots of the L1 to L2 messages subtrees.
|
|
23
21
|
*/
|
|
24
|
-
public l1ToL2Roots:
|
|
22
|
+
public l1ToL2Roots: RootParityProofData,
|
|
25
23
|
/**
|
|
26
|
-
*
|
|
24
|
+
* The previous rollup proof data from base or merge rollup circuits.
|
|
25
|
+
*/
|
|
26
|
+
public previousRollups: [
|
|
27
|
+
RollupProofData<BaseOrMergeRollupPublicInputs>,
|
|
28
|
+
RollupProofData<BaseOrMergeRollupPublicInputs>,
|
|
29
|
+
],
|
|
30
|
+
/**
|
|
31
|
+
* The l1 to l2 message tree snapshot immediately before this block.
|
|
27
32
|
*/
|
|
28
|
-
public
|
|
33
|
+
public previousL1ToL2: AppendOnlyTreeSnapshot,
|
|
29
34
|
/**
|
|
30
|
-
* Hint for
|
|
35
|
+
* Hint for inserting the new l1 to l2 message subtree into `previousL1ToL2`.
|
|
31
36
|
*/
|
|
32
|
-
public
|
|
37
|
+
public newL1ToL2MessageSubtreeSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH>,
|
|
33
38
|
/**
|
|
34
39
|
* Hint for inserting the new block hash to the last archive.
|
|
35
40
|
*/
|
|
36
41
|
public newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
42
|
+
) {}
|
|
43
|
+
|
|
44
|
+
static from(fields: FieldsOf<BlockRootFirstRollupPrivateInputs>) {
|
|
45
|
+
return new BlockRootFirstRollupPrivateInputs(...BlockRootFirstRollupPrivateInputs.getFields(fields));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static getFields(fields: FieldsOf<BlockRootFirstRollupPrivateInputs>) {
|
|
49
|
+
return [
|
|
50
|
+
fields.l1ToL2Roots,
|
|
51
|
+
fields.previousRollups,
|
|
52
|
+
fields.previousL1ToL2,
|
|
53
|
+
fields.newL1ToL2MessageSubtreeSiblingPath,
|
|
54
|
+
fields.newArchiveSiblingPath,
|
|
55
|
+
] as const;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
toBuffer() {
|
|
59
|
+
return serializeToBuffer(...BlockRootFirstRollupPrivateInputs.getFields(this));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
63
|
+
const reader = BufferReader.asReader(buffer);
|
|
64
|
+
return new BlockRootFirstRollupPrivateInputs(
|
|
65
|
+
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
66
|
+
[
|
|
67
|
+
ProofData.fromBuffer(reader, BaseOrMergeRollupPublicInputs),
|
|
68
|
+
ProofData.fromBuffer(reader, BaseOrMergeRollupPublicInputs),
|
|
69
|
+
],
|
|
70
|
+
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
71
|
+
reader.readArray(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, Fr),
|
|
72
|
+
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
toJSON() {
|
|
77
|
+
return this.toBuffer();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
static get schema() {
|
|
81
|
+
return bufferSchemaFor(BlockRootFirstRollupPrivateInputs);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export class BlockRootSingleTxFirstRollupPrivateInputs {
|
|
86
|
+
constructor(
|
|
37
87
|
/**
|
|
38
|
-
* The
|
|
88
|
+
* The original and converted roots of the L1 to L2 messages subtrees.
|
|
39
89
|
*/
|
|
40
|
-
public
|
|
90
|
+
public l1ToL2Roots: RootParityProofData,
|
|
41
91
|
/**
|
|
42
|
-
* The
|
|
92
|
+
* The previous rollup proof data from base or merge rollup circuits.
|
|
43
93
|
*/
|
|
44
|
-
public
|
|
94
|
+
public previousRollup: RollupProofData<BaseOrMergeRollupPublicInputs>,
|
|
45
95
|
/**
|
|
46
|
-
*
|
|
96
|
+
* The l1 to l2 message tree snapshot immediately before this block.
|
|
47
97
|
*/
|
|
48
|
-
public
|
|
98
|
+
public previousL1ToL2: AppendOnlyTreeSnapshot,
|
|
49
99
|
/**
|
|
50
|
-
*
|
|
100
|
+
* Hint for inserting the new l1 to l2 message subtree.
|
|
51
101
|
*/
|
|
52
|
-
public
|
|
102
|
+
public newL1ToL2MessageSubtreeSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH>,
|
|
103
|
+
/**
|
|
104
|
+
* Hint for inserting the new block hash to the last archive.
|
|
105
|
+
*/
|
|
106
|
+
public newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
53
107
|
) {}
|
|
54
108
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
toBuffer() {
|
|
60
|
-
return serializeToBuffer(...BlockRootRollupData.getFields(this));
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Serializes the inputs to a hex string.
|
|
65
|
-
* @returns The instance serialized to a hex string.
|
|
66
|
-
*/
|
|
67
|
-
toString() {
|
|
68
|
-
return bufferToHex(this.toBuffer());
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Creates a new instance from fields.
|
|
73
|
-
* @param fields - Fields to create the instance from.
|
|
74
|
-
* @returns A new RootRollupInputs instance.
|
|
75
|
-
*/
|
|
76
|
-
static from(fields: FieldsOf<BlockRootRollupData>): BlockRootRollupData {
|
|
77
|
-
return new BlockRootRollupData(...BlockRootRollupData.getFields(fields));
|
|
109
|
+
static from(fields: FieldsOf<BlockRootSingleTxFirstRollupPrivateInputs>) {
|
|
110
|
+
return new BlockRootSingleTxFirstRollupPrivateInputs(
|
|
111
|
+
...BlockRootSingleTxFirstRollupPrivateInputs.getFields(fields),
|
|
112
|
+
);
|
|
78
113
|
}
|
|
79
114
|
|
|
80
|
-
|
|
81
|
-
* Extracts fields from an instance.
|
|
82
|
-
* @param fields - Fields to create the instance from.
|
|
83
|
-
* @returns An array of fields.
|
|
84
|
-
*/
|
|
85
|
-
static getFields(fields: FieldsOf<BlockRootRollupData>) {
|
|
115
|
+
static getFields(fields: FieldsOf<BlockRootSingleTxFirstRollupPrivateInputs>) {
|
|
86
116
|
return [
|
|
87
117
|
fields.l1ToL2Roots,
|
|
88
|
-
fields.
|
|
89
|
-
fields.
|
|
118
|
+
fields.previousRollup,
|
|
119
|
+
fields.previousL1ToL2,
|
|
120
|
+
fields.newL1ToL2MessageSubtreeSiblingPath,
|
|
90
121
|
fields.newArchiveSiblingPath,
|
|
91
|
-
fields.previousBlockHeader,
|
|
92
|
-
fields.startBlobAccumulator,
|
|
93
|
-
fields.finalBlobChallenges,
|
|
94
|
-
fields.proverId,
|
|
95
122
|
] as const;
|
|
96
123
|
}
|
|
97
124
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
static fromBuffer(buffer: Buffer | BufferReader): BlockRootRollupData {
|
|
125
|
+
toBuffer() {
|
|
126
|
+
return serializeToBuffer(...BlockRootSingleTxFirstRollupPrivateInputs.getFields(this));
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
104
130
|
const reader = BufferReader.asReader(buffer);
|
|
105
|
-
return new
|
|
106
|
-
|
|
131
|
+
return new BlockRootSingleTxFirstRollupPrivateInputs(
|
|
132
|
+
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
133
|
+
ProofData.fromBuffer(reader, BaseOrMergeRollupPublicInputs),
|
|
134
|
+
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
107
135
|
reader.readArray(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, Fr),
|
|
108
136
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
109
|
-
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
110
|
-
BlockHeader.fromBuffer(reader),
|
|
111
|
-
reader.readObject(BlobAccumulatorPublicInputs),
|
|
112
|
-
reader.readObject(FinalBlobBatchingChallenges),
|
|
113
|
-
Fr.fromBuffer(reader),
|
|
114
137
|
);
|
|
115
138
|
}
|
|
116
139
|
|
|
117
|
-
/**
|
|
118
|
-
* Deserializes the inputs from a hex string.
|
|
119
|
-
* @param str - A hex string to deserialize from.
|
|
120
|
-
* @returns A new RootRollupInputs instance.
|
|
121
|
-
*/
|
|
122
|
-
static fromString(str: string) {
|
|
123
|
-
return BlockRootRollupData.fromBuffer(hexToBuffer(str));
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** Returns a buffer representation for JSON serialization. */
|
|
127
140
|
toJSON() {
|
|
128
141
|
return this.toBuffer();
|
|
129
142
|
}
|
|
130
143
|
|
|
131
|
-
/** Creates an instance from a hex string. */
|
|
132
144
|
static get schema() {
|
|
133
|
-
return bufferSchemaFor(
|
|
145
|
+
return bufferSchemaFor(BlockRootSingleTxFirstRollupPrivateInputs);
|
|
134
146
|
}
|
|
135
147
|
}
|
|
136
148
|
|
|
137
|
-
export class
|
|
149
|
+
export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
138
150
|
constructor(
|
|
139
151
|
/**
|
|
140
|
-
*
|
|
141
|
-
* Below line gives error 'Type instantiation is excessively deep and possibly infinite. ts(2589)'
|
|
142
|
-
* Tuple<Fr, FIELDS_PER_BLOB * BLOBS_PER_BLOCK>
|
|
152
|
+
* The original and converted roots of the L1 to L2 messages subtrees.
|
|
143
153
|
*/
|
|
144
|
-
public
|
|
154
|
+
public l1ToL2Roots: RootParityProofData,
|
|
145
155
|
/**
|
|
146
|
-
*
|
|
156
|
+
* The archive after applying the previous block.
|
|
147
157
|
*/
|
|
148
|
-
public
|
|
158
|
+
public previousArchive: AppendOnlyTreeSnapshot,
|
|
149
159
|
/**
|
|
150
|
-
* The
|
|
151
|
-
* See yarn-project/foundation/src/blob/index.ts or body.ts for calculation
|
|
160
|
+
* The state reference of the previous block.
|
|
152
161
|
*/
|
|
153
|
-
public
|
|
162
|
+
public previousState: StateReference,
|
|
163
|
+
/**
|
|
164
|
+
* The constants of the checkpoint.
|
|
165
|
+
*/
|
|
166
|
+
public constants: CheckpointConstantData,
|
|
167
|
+
/**
|
|
168
|
+
* The start sponge blob of this block. No data has been absorbed into it yet, since it's the first block. But the
|
|
169
|
+
* number of expected fields must be set to the total number of fields in the entire checkpoint.
|
|
170
|
+
*/
|
|
171
|
+
public startSpongeBlob: SpongeBlob,
|
|
172
|
+
/**
|
|
173
|
+
* The timestamp of this block.
|
|
174
|
+
*/
|
|
175
|
+
public timestamp: UInt64,
|
|
176
|
+
/**
|
|
177
|
+
* Hint for inserting the new l1 to l2 message subtree.
|
|
178
|
+
*/
|
|
179
|
+
public newL1ToL2MessageSubtreeSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH>,
|
|
180
|
+
/**
|
|
181
|
+
* Hint for inserting the new block hash to the last archive.
|
|
182
|
+
*/
|
|
183
|
+
public newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
154
184
|
) {}
|
|
155
185
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
* @returns - The inputs serialized to a buffer.
|
|
159
|
-
*/
|
|
160
|
-
toBuffer() {
|
|
161
|
-
return serializeToBuffer(...BlockRootRollupBlobData.getFields(this));
|
|
186
|
+
static from(fields: FieldsOf<BlockRootEmptyTxFirstRollupPrivateInputs>) {
|
|
187
|
+
return new BlockRootEmptyTxFirstRollupPrivateInputs(...BlockRootEmptyTxFirstRollupPrivateInputs.getFields(fields));
|
|
162
188
|
}
|
|
163
189
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
* @returns A new RootRollupInputs instance.
|
|
176
|
-
*/
|
|
177
|
-
static from(fields: FieldsOf<BlockRootRollupBlobData>): BlockRootRollupBlobData {
|
|
178
|
-
return new BlockRootRollupBlobData(...BlockRootRollupBlobData.getFields(fields));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Extracts fields from an instance.
|
|
183
|
-
* @param fields - Fields to create the instance from.
|
|
184
|
-
* @returns An array of fields.
|
|
185
|
-
*/
|
|
186
|
-
static getFields(fields: FieldsOf<BlockRootRollupBlobData>) {
|
|
187
|
-
return [fields.blobFields, fields.blobCommitments, fields.blobsHash] as const;
|
|
190
|
+
static getFields(fields: FieldsOf<BlockRootEmptyTxFirstRollupPrivateInputs>) {
|
|
191
|
+
return [
|
|
192
|
+
fields.l1ToL2Roots,
|
|
193
|
+
fields.previousArchive,
|
|
194
|
+
fields.previousState,
|
|
195
|
+
fields.constants,
|
|
196
|
+
fields.startSpongeBlob,
|
|
197
|
+
fields.timestamp,
|
|
198
|
+
fields.newL1ToL2MessageSubtreeSiblingPath,
|
|
199
|
+
fields.newArchiveSiblingPath,
|
|
200
|
+
] as const;
|
|
188
201
|
}
|
|
189
202
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
203
|
+
toBuffer() {
|
|
204
|
+
return serializeToBuffer([
|
|
205
|
+
this.l1ToL2Roots,
|
|
206
|
+
this.previousArchive,
|
|
207
|
+
this.previousState,
|
|
208
|
+
this.constants,
|
|
209
|
+
this.startSpongeBlob,
|
|
210
|
+
bigintToUInt64BE(this.timestamp),
|
|
211
|
+
this.newL1ToL2MessageSubtreeSiblingPath,
|
|
212
|
+
this.newArchiveSiblingPath,
|
|
213
|
+
]);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
196
217
|
const reader = BufferReader.asReader(buffer);
|
|
197
|
-
return new
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
218
|
+
return new BlockRootEmptyTxFirstRollupPrivateInputs(
|
|
219
|
+
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
220
|
+
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
221
|
+
StateReference.fromBuffer(reader),
|
|
222
|
+
CheckpointConstantData.fromBuffer(reader),
|
|
223
|
+
SpongeBlob.fromBuffer(reader),
|
|
224
|
+
reader.readUInt64(),
|
|
225
|
+
reader.readArray(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, Fr),
|
|
226
|
+
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
203
227
|
);
|
|
204
228
|
}
|
|
205
229
|
|
|
206
|
-
/**
|
|
207
|
-
* Deserializes the inputs from a hex string.
|
|
208
|
-
* @param str - A hex string to deserialize from.
|
|
209
|
-
* @returns A new RootRollupInputs instance.
|
|
210
|
-
*/
|
|
211
|
-
static fromString(str: string) {
|
|
212
|
-
return BlockRootRollupBlobData.fromBuffer(hexToBuffer(str));
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
/** Returns a buffer representation for JSON serialization. */
|
|
216
230
|
toJSON() {
|
|
217
231
|
return this.toBuffer();
|
|
218
232
|
}
|
|
219
233
|
|
|
220
|
-
/** Creates an instance from a hex string. */
|
|
221
234
|
static get schema() {
|
|
222
|
-
return bufferSchemaFor(
|
|
235
|
+
return bufferSchemaFor(BlockRootEmptyTxFirstRollupPrivateInputs);
|
|
223
236
|
}
|
|
224
237
|
}
|
|
225
238
|
|
|
226
|
-
|
|
227
|
-
* Represents inputs of the block root rollup circuit.
|
|
228
|
-
*/
|
|
229
|
-
export class BlockRootRollupInputs {
|
|
239
|
+
export class BlockRootRollupPrivateInputs {
|
|
230
240
|
constructor(
|
|
231
241
|
/**
|
|
232
|
-
* The previous rollup data from
|
|
242
|
+
* The previous rollup proof data from base or merge rollup circuits.
|
|
243
|
+
*/
|
|
244
|
+
public previousRollups: [
|
|
245
|
+
RollupProofData<BaseOrMergeRollupPublicInputs>,
|
|
246
|
+
RollupProofData<BaseOrMergeRollupPublicInputs>,
|
|
247
|
+
],
|
|
248
|
+
/**
|
|
249
|
+
* Hint for inserting the new block hash to the last archive.
|
|
233
250
|
*/
|
|
234
|
-
public
|
|
235
|
-
public data: BlockRootRollupData,
|
|
236
|
-
public blobData: BlockRootRollupBlobData,
|
|
251
|
+
public newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
237
252
|
) {}
|
|
238
253
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
* @returns - The inputs serialized to a buffer.
|
|
242
|
-
*/
|
|
243
|
-
toBuffer() {
|
|
244
|
-
return serializeToBuffer(...BlockRootRollupInputs.getFields(this));
|
|
254
|
+
static from(fields: FieldsOf<BlockRootRollupPrivateInputs>) {
|
|
255
|
+
return new BlockRootRollupPrivateInputs(...BlockRootRollupPrivateInputs.getFields(fields));
|
|
245
256
|
}
|
|
246
257
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
* @returns The instance serialized to a hex string.
|
|
250
|
-
*/
|
|
251
|
-
toString() {
|
|
252
|
-
return bufferToHex(this.toBuffer());
|
|
258
|
+
static getFields(fields: FieldsOf<BlockRootRollupPrivateInputs>) {
|
|
259
|
+
return [fields.previousRollups, fields.newArchiveSiblingPath] as const;
|
|
253
260
|
}
|
|
254
261
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
* @param fields - Fields to create the instance from.
|
|
258
|
-
* @returns A new RootRollupInputs instance.
|
|
259
|
-
*/
|
|
260
|
-
static from(fields: FieldsOf<BlockRootRollupInputs>): BlockRootRollupInputs {
|
|
261
|
-
return new BlockRootRollupInputs(...BlockRootRollupInputs.getFields(fields));
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Extracts fields from an instance.
|
|
266
|
-
* @param fields - Fields to create the instance from.
|
|
267
|
-
* @returns An array of fields.
|
|
268
|
-
*/
|
|
269
|
-
static getFields(fields: FieldsOf<BlockRootRollupInputs>) {
|
|
270
|
-
return [fields.previousRollupData, fields.data, fields.blobData] as const;
|
|
262
|
+
toBuffer() {
|
|
263
|
+
return serializeToBuffer(...BlockRootRollupPrivateInputs.getFields(this));
|
|
271
264
|
}
|
|
272
265
|
|
|
273
|
-
|
|
274
|
-
* Deserializes the inputs from a buffer.
|
|
275
|
-
* @param buffer - A buffer to deserialize from.
|
|
276
|
-
* @returns A new RootRollupInputs instance.
|
|
277
|
-
*/
|
|
278
|
-
static fromBuffer(buffer: Buffer | BufferReader): BlockRootRollupInputs {
|
|
266
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
279
267
|
const reader = BufferReader.asReader(buffer);
|
|
280
|
-
return new
|
|
281
|
-
[
|
|
282
|
-
|
|
283
|
-
|
|
268
|
+
return new BlockRootRollupPrivateInputs(
|
|
269
|
+
[
|
|
270
|
+
ProofData.fromBuffer(reader, BaseOrMergeRollupPublicInputs),
|
|
271
|
+
ProofData.fromBuffer(reader, BaseOrMergeRollupPublicInputs),
|
|
272
|
+
],
|
|
273
|
+
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
284
274
|
);
|
|
285
275
|
}
|
|
286
276
|
|
|
287
|
-
/**
|
|
288
|
-
* Deserializes the inputs from a hex string.
|
|
289
|
-
* @param str - A hex string to deserialize from.
|
|
290
|
-
* @returns A new RootRollupInputs instance.
|
|
291
|
-
*/
|
|
292
|
-
static fromString(str: string) {
|
|
293
|
-
return BlockRootRollupInputs.fromBuffer(hexToBuffer(str));
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
/** Returns a buffer representation for JSON serialization. */
|
|
297
277
|
toJSON() {
|
|
298
278
|
return this.toBuffer();
|
|
299
279
|
}
|
|
300
280
|
|
|
301
|
-
/** Creates an instance from a hex string. */
|
|
302
281
|
static get schema() {
|
|
303
|
-
return bufferSchemaFor(
|
|
282
|
+
return bufferSchemaFor(BlockRootRollupPrivateInputs);
|
|
304
283
|
}
|
|
305
284
|
}
|
|
306
285
|
|
|
307
|
-
export class
|
|
286
|
+
export class BlockRootSingleTxRollupPrivateInputs {
|
|
308
287
|
constructor(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
288
|
+
/**
|
|
289
|
+
* The previous rollup proof data from base or merge rollup circuits.
|
|
290
|
+
*/
|
|
291
|
+
public previousRollup: RollupProofData<BaseOrMergeRollupPublicInputs>,
|
|
292
|
+
/**
|
|
293
|
+
* Hint for inserting the new block hash to the last archive.
|
|
294
|
+
*/
|
|
295
|
+
public newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
312
296
|
) {}
|
|
313
297
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
* @returns - The inputs serialized to a buffer.
|
|
317
|
-
*/
|
|
318
|
-
toBuffer() {
|
|
319
|
-
return serializeToBuffer(...SingleTxBlockRootRollupInputs.getFields(this));
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
/**
|
|
323
|
-
* Serializes the inputs to a hex string.
|
|
324
|
-
* @returns The instance serialized to a hex string.
|
|
325
|
-
*/
|
|
326
|
-
toString() {
|
|
327
|
-
return bufferToHex(this.toBuffer());
|
|
298
|
+
static from(fields: FieldsOf<BlockRootSingleTxRollupPrivateInputs>) {
|
|
299
|
+
return new BlockRootSingleTxRollupPrivateInputs(...BlockRootSingleTxRollupPrivateInputs.getFields(fields));
|
|
328
300
|
}
|
|
329
301
|
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
* @param fields - Fields to create the instance from.
|
|
333
|
-
* @returns A new RootRollupInputs instance.
|
|
334
|
-
*/
|
|
335
|
-
static from(fields: FieldsOf<SingleTxBlockRootRollupInputs>): SingleTxBlockRootRollupInputs {
|
|
336
|
-
return new SingleTxBlockRootRollupInputs(...SingleTxBlockRootRollupInputs.getFields(fields));
|
|
302
|
+
static getFields(fields: FieldsOf<BlockRootSingleTxRollupPrivateInputs>) {
|
|
303
|
+
return [fields.previousRollup, fields.newArchiveSiblingPath] as const;
|
|
337
304
|
}
|
|
338
305
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
* @param fields - Fields to create the instance from.
|
|
342
|
-
* @returns An array of fields.
|
|
343
|
-
*/
|
|
344
|
-
static getFields(fields: FieldsOf<SingleTxBlockRootRollupInputs>) {
|
|
345
|
-
return [fields.previousRollupData, fields.data, fields.blobData] as const;
|
|
306
|
+
toBuffer() {
|
|
307
|
+
return serializeToBuffer(...BlockRootSingleTxRollupPrivateInputs.getFields(this));
|
|
346
308
|
}
|
|
347
309
|
|
|
348
|
-
|
|
349
|
-
* Deserializes the inputs from a buffer.
|
|
350
|
-
* @param buffer - A buffer to deserialize from.
|
|
351
|
-
* @returns A new RootRollupInputs instance.
|
|
352
|
-
*/
|
|
353
|
-
static fromBuffer(buffer: Buffer | BufferReader): SingleTxBlockRootRollupInputs {
|
|
310
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
354
311
|
const reader = BufferReader.asReader(buffer);
|
|
355
|
-
return new
|
|
356
|
-
|
|
357
|
-
reader.
|
|
358
|
-
reader.readObject(BlockRootRollupBlobData),
|
|
312
|
+
return new BlockRootSingleTxRollupPrivateInputs(
|
|
313
|
+
ProofData.fromBuffer(reader, BaseOrMergeRollupPublicInputs),
|
|
314
|
+
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
359
315
|
);
|
|
360
316
|
}
|
|
361
317
|
|
|
362
|
-
/**
|
|
363
|
-
* Deserializes the inputs from a hex string.
|
|
364
|
-
* @param str - A hex string to deserialize from.
|
|
365
|
-
* @returns A new RootRollupInputs instance.
|
|
366
|
-
*/
|
|
367
|
-
static fromString(str: string) {
|
|
368
|
-
return SingleTxBlockRootRollupInputs.fromBuffer(hexToBuffer(str));
|
|
369
|
-
}
|
|
370
|
-
|
|
371
|
-
/** Returns a buffer representation for JSON serialization. */
|
|
372
318
|
toJSON() {
|
|
373
319
|
return this.toBuffer();
|
|
374
320
|
}
|
|
375
321
|
|
|
376
|
-
/** Creates an instance from a hex string. */
|
|
377
322
|
static get schema() {
|
|
378
|
-
return bufferSchemaFor(
|
|
323
|
+
return bufferSchemaFor(BlockRootSingleTxRollupPrivateInputs);
|
|
379
324
|
}
|
|
380
325
|
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
5
|
+
|
|
6
|
+
import { AztecAddress } from '../aztec-address/index.js';
|
|
7
|
+
import { GasFees } from '../gas/gas_fees.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Constants that are the same for the entire checkpoint.
|
|
11
|
+
*/
|
|
12
|
+
export class CheckpointConstantData {
|
|
13
|
+
constructor(
|
|
14
|
+
/** ChainId of the rollup. */
|
|
15
|
+
public chainId: Fr,
|
|
16
|
+
/** Version of the rollup. */
|
|
17
|
+
public version: Fr,
|
|
18
|
+
/** Root of the verification key tree. */
|
|
19
|
+
public vkTreeRoot: Fr,
|
|
20
|
+
/** Root of the protocol contract tree. */
|
|
21
|
+
public protocolContractTreeRoot: Fr,
|
|
22
|
+
/** Identifier of the prover. */
|
|
23
|
+
public proverId: Fr,
|
|
24
|
+
/** Slot number of the checkpoint. */
|
|
25
|
+
public slotNumber: Fr,
|
|
26
|
+
/** Coinbase address of the rollup. */
|
|
27
|
+
public coinbase: EthAddress,
|
|
28
|
+
/** Address to receive fees. */
|
|
29
|
+
public feeRecipient: AztecAddress,
|
|
30
|
+
/** Global gas fees for this checkpoint. */
|
|
31
|
+
public gasFees: GasFees,
|
|
32
|
+
) {}
|
|
33
|
+
|
|
34
|
+
static from(fields: FieldsOf<CheckpointConstantData>) {
|
|
35
|
+
return new CheckpointConstantData(...CheckpointConstantData.getFields(fields));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static getFields(fields: FieldsOf<CheckpointConstantData>) {
|
|
39
|
+
return [
|
|
40
|
+
fields.chainId,
|
|
41
|
+
fields.version,
|
|
42
|
+
fields.vkTreeRoot,
|
|
43
|
+
fields.protocolContractTreeRoot,
|
|
44
|
+
fields.proverId,
|
|
45
|
+
fields.slotNumber,
|
|
46
|
+
fields.coinbase,
|
|
47
|
+
fields.feeRecipient,
|
|
48
|
+
fields.gasFees,
|
|
49
|
+
] as const;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static empty() {
|
|
53
|
+
return new CheckpointConstantData(
|
|
54
|
+
Fr.ZERO,
|
|
55
|
+
Fr.ZERO,
|
|
56
|
+
Fr.ZERO,
|
|
57
|
+
Fr.ZERO,
|
|
58
|
+
Fr.ZERO,
|
|
59
|
+
Fr.ZERO,
|
|
60
|
+
EthAddress.ZERO,
|
|
61
|
+
AztecAddress.ZERO,
|
|
62
|
+
GasFees.empty(),
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
toBuffer() {
|
|
67
|
+
return serializeToBuffer(...CheckpointConstantData.getFields(this));
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
71
|
+
const reader = BufferReader.asReader(buffer);
|
|
72
|
+
return new CheckpointConstantData(
|
|
73
|
+
Fr.fromBuffer(reader),
|
|
74
|
+
Fr.fromBuffer(reader),
|
|
75
|
+
Fr.fromBuffer(reader),
|
|
76
|
+
Fr.fromBuffer(reader),
|
|
77
|
+
Fr.fromBuffer(reader),
|
|
78
|
+
Fr.fromBuffer(reader),
|
|
79
|
+
reader.readObject(EthAddress),
|
|
80
|
+
reader.readObject(AztecAddress),
|
|
81
|
+
reader.readObject(GasFees),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
}
|