@aztec/stdlib 3.0.0-nightly.20250917 → 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 +6 -0
- package/dest/avm/avm.d.ts.map +1 -1
- 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 +7 -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/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 +170 -61
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +101 -39
- 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/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 +15 -40
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +70 -78
- 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/package.json +8 -8
- 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/block-builder.ts +1 -6
- package/src/interfaces/epoch-prover.ts +34 -10
- package/src/interfaces/proving-job.ts +166 -51
- 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/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 +124 -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/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,6 +1,7 @@
|
|
|
1
|
-
import { SpongeBlob } from '@aztec/blob-lib';
|
|
1
|
+
import { SpongeBlob } from '@aztec/blob-lib/types';
|
|
2
2
|
import { ARCHIVE_HEIGHT, MAX_CONTRACT_CLASS_LOGS_PER_TX } from '@aztec/constants';
|
|
3
3
|
import { makeTuple } from '@aztec/foundation/array';
|
|
4
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
4
5
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
6
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
7
|
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
@@ -83,6 +84,7 @@ export class PublicBaseRollupHints {
|
|
|
83
84
|
lastArchive;
|
|
84
85
|
archiveRootMembershipWitness;
|
|
85
86
|
contractClassLogsFields;
|
|
87
|
+
proverId;
|
|
86
88
|
constructor(/**
|
|
87
89
|
* Sponge state to absorb blob inputs at the start of the rollup.
|
|
88
90
|
*/ startSpongeBlob, /**
|
|
@@ -91,11 +93,14 @@ export class PublicBaseRollupHints {
|
|
|
91
93
|
* Membership witnesses of blocks referred by each of the 2 kernels.
|
|
92
94
|
*/ archiveRootMembershipWitness, /**
|
|
93
95
|
* Preimages to the kernel's contractClassLogsHashes.
|
|
94
|
-
*/ contractClassLogsFields
|
|
96
|
+
*/ contractClassLogsFields, /**
|
|
97
|
+
* Identifier of the prover.
|
|
98
|
+
*/ proverId){
|
|
95
99
|
this.startSpongeBlob = startSpongeBlob;
|
|
96
100
|
this.lastArchive = lastArchive;
|
|
97
101
|
this.archiveRootMembershipWitness = archiveRootMembershipWitness;
|
|
98
102
|
this.contractClassLogsFields = contractClassLogsFields;
|
|
103
|
+
this.proverId = proverId;
|
|
99
104
|
}
|
|
100
105
|
static from(fields) {
|
|
101
106
|
return new PublicBaseRollupHints(...PublicBaseRollupHints.getFields(fields));
|
|
@@ -105,7 +110,8 @@ export class PublicBaseRollupHints {
|
|
|
105
110
|
fields.startSpongeBlob,
|
|
106
111
|
fields.lastArchive,
|
|
107
112
|
fields.archiveRootMembershipWitness,
|
|
108
|
-
fields.contractClassLogsFields
|
|
113
|
+
fields.contractClassLogsFields,
|
|
114
|
+
fields.proverId
|
|
109
115
|
];
|
|
110
116
|
}
|
|
111
117
|
/**
|
|
@@ -122,12 +128,12 @@ export class PublicBaseRollupHints {
|
|
|
122
128
|
}
|
|
123
129
|
static fromBuffer(buffer) {
|
|
124
130
|
const reader = BufferReader.asReader(buffer);
|
|
125
|
-
return new PublicBaseRollupHints(reader.readObject(SpongeBlob), reader.readObject(AppendOnlyTreeSnapshot), MembershipWitness.fromBuffer(reader, ARCHIVE_HEIGHT), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ()=>reader.readObject(ContractClassLogFields)));
|
|
131
|
+
return new PublicBaseRollupHints(reader.readObject(SpongeBlob), reader.readObject(AppendOnlyTreeSnapshot), MembershipWitness.fromBuffer(reader, ARCHIVE_HEIGHT), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ()=>reader.readObject(ContractClassLogFields)), reader.readObject(Fr));
|
|
126
132
|
}
|
|
127
133
|
static fromString(str) {
|
|
128
134
|
return PublicBaseRollupHints.fromBuffer(hexToBuffer(str));
|
|
129
135
|
}
|
|
130
136
|
static empty() {
|
|
131
|
-
return new PublicBaseRollupHints(SpongeBlob.empty(), AppendOnlyTreeSnapshot.empty(), MembershipWitness.empty(ARCHIVE_HEIGHT), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLogFields.empty));
|
|
137
|
+
return new PublicBaseRollupHints(SpongeBlob.empty(), AppendOnlyTreeSnapshot.empty(), MembershipWitness.empty(ARCHIVE_HEIGHT), makeTuple(MAX_CONTRACT_CLASS_LOGS_PER_TX, ContractClassLogFields.empty), Fr.ZERO);
|
|
132
138
|
}
|
|
133
139
|
}
|
|
@@ -9,28 +9,42 @@ import { GlobalVariables } from '../tx/global_variables.js';
|
|
|
9
9
|
export declare class BlockConstantData {
|
|
10
10
|
/** Archive tree snapshot at the very beginning of the entire rollup. */
|
|
11
11
|
lastArchive: AppendOnlyTreeSnapshot;
|
|
12
|
-
/**
|
|
13
|
-
|
|
12
|
+
/**
|
|
13
|
+
* L1-to-L2 message tree snapshot after this block lands.
|
|
14
|
+
* For the first block in a checkpoint, this should be the snapshot after inserting the new l1-to-l2 message subtree
|
|
15
|
+
* into the last l1-to-l2 tree snapshot in `last_archive`.
|
|
16
|
+
* For subsequent blocks, this should match the snapshot of the previous block.
|
|
17
|
+
*/
|
|
18
|
+
l1ToL2TreeSnapshot: AppendOnlyTreeSnapshot;
|
|
14
19
|
/** Root of the verification key tree. */
|
|
15
20
|
vkTreeRoot: Fr;
|
|
16
21
|
/** Root of the protocol contract tree. */
|
|
17
22
|
protocolContractTreeRoot: Fr;
|
|
18
23
|
/** Global variables for the block. */
|
|
19
24
|
globalVariables: GlobalVariables;
|
|
25
|
+
/** Identifier of the prover. */
|
|
26
|
+
proverId: Fr;
|
|
20
27
|
constructor(
|
|
21
28
|
/** Archive tree snapshot at the very beginning of the entire rollup. */
|
|
22
29
|
lastArchive: AppendOnlyTreeSnapshot,
|
|
23
|
-
/**
|
|
24
|
-
|
|
30
|
+
/**
|
|
31
|
+
* L1-to-L2 message tree snapshot after this block lands.
|
|
32
|
+
* For the first block in a checkpoint, this should be the snapshot after inserting the new l1-to-l2 message subtree
|
|
33
|
+
* into the last l1-to-l2 tree snapshot in `last_archive`.
|
|
34
|
+
* For subsequent blocks, this should match the snapshot of the previous block.
|
|
35
|
+
*/
|
|
36
|
+
l1ToL2TreeSnapshot: AppendOnlyTreeSnapshot,
|
|
25
37
|
/** Root of the verification key tree. */
|
|
26
38
|
vkTreeRoot: Fr,
|
|
27
39
|
/** Root of the protocol contract tree. */
|
|
28
40
|
protocolContractTreeRoot: Fr,
|
|
29
41
|
/** Global variables for the block. */
|
|
30
|
-
globalVariables: GlobalVariables
|
|
42
|
+
globalVariables: GlobalVariables,
|
|
43
|
+
/** Identifier of the prover. */
|
|
44
|
+
proverId: Fr);
|
|
31
45
|
static from(fields: FieldsOf<BlockConstantData>): BlockConstantData;
|
|
32
46
|
static fromBuffer(buffer: Buffer | BufferReader): BlockConstantData;
|
|
33
|
-
static getFields(fields: FieldsOf<BlockConstantData>): readonly [AppendOnlyTreeSnapshot, AppendOnlyTreeSnapshot, Fr, Fr, GlobalVariables];
|
|
47
|
+
static getFields(fields: FieldsOf<BlockConstantData>): readonly [AppendOnlyTreeSnapshot, AppendOnlyTreeSnapshot, Fr, Fr, GlobalVariables, Fr];
|
|
34
48
|
static empty(): BlockConstantData;
|
|
35
49
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
36
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_constant_data.d.ts","sourceRoot":"","sources":["../../src/rollup/block_constant_data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;GAEG;AACH,qBAAa,iBAAiB;IAE1B,wEAAwE;IACjE,WAAW,EAAE,sBAAsB;IAC1C
|
|
1
|
+
{"version":3,"file":"block_constant_data.d.ts","sourceRoot":"","sources":["../../src/rollup/block_constant_data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D;;GAEG;AACH,qBAAa,iBAAiB;IAE1B,wEAAwE;IACjE,WAAW,EAAE,sBAAsB;IAC1C;;;;;OAKG;IACI,kBAAkB,EAAE,sBAAsB;IACjD,yCAAyC;IAClC,UAAU,EAAE,EAAE;IACrB,0CAA0C;IACnC,wBAAwB,EAAE,EAAE;IACnC,sCAAsC;IAC/B,eAAe,EAAE,eAAe;IACvC,gCAAgC;IACzB,QAAQ,EAAE,EAAE;;IAhBnB,wEAAwE;IACjE,WAAW,EAAE,sBAAsB;IAC1C;;;;;OAKG;IACI,kBAAkB,EAAE,sBAAsB;IACjD,yCAAyC;IAClC,UAAU,EAAE,EAAE;IACrB,0CAA0C;IACnC,wBAAwB,EAAE,EAAE;IACnC,sCAAsC;IAC/B,eAAe,EAAE,eAAe;IACvC,gCAAgC;IACzB,QAAQ,EAAE,EAAE;IAGrB,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC,GAAG,iBAAiB;IAInE,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,iBAAiB;IAYnE,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,iBAAiB,CAAC;IAWpD,MAAM,CAAC,KAAK;IAWZ,QAAQ;CAGT"}
|
|
@@ -6,35 +6,43 @@ import { GlobalVariables } from '../tx/global_variables.js';
|
|
|
6
6
|
* Constants that are the same for the entire block.
|
|
7
7
|
*/ export class BlockConstantData {
|
|
8
8
|
lastArchive;
|
|
9
|
-
|
|
9
|
+
l1ToL2TreeSnapshot;
|
|
10
10
|
vkTreeRoot;
|
|
11
11
|
protocolContractTreeRoot;
|
|
12
12
|
globalVariables;
|
|
13
|
-
|
|
13
|
+
proverId;
|
|
14
|
+
constructor(/** Archive tree snapshot at the very beginning of the entire rollup. */ lastArchive, /**
|
|
15
|
+
* L1-to-L2 message tree snapshot after this block lands.
|
|
16
|
+
* For the first block in a checkpoint, this should be the snapshot after inserting the new l1-to-l2 message subtree
|
|
17
|
+
* into the last l1-to-l2 tree snapshot in `last_archive`.
|
|
18
|
+
* For subsequent blocks, this should match the snapshot of the previous block.
|
|
19
|
+
*/ l1ToL2TreeSnapshot, /** Root of the verification key tree. */ vkTreeRoot, /** Root of the protocol contract tree. */ protocolContractTreeRoot, /** Global variables for the block. */ globalVariables, /** Identifier of the prover. */ proverId){
|
|
14
20
|
this.lastArchive = lastArchive;
|
|
15
|
-
this.
|
|
21
|
+
this.l1ToL2TreeSnapshot = l1ToL2TreeSnapshot;
|
|
16
22
|
this.vkTreeRoot = vkTreeRoot;
|
|
17
23
|
this.protocolContractTreeRoot = protocolContractTreeRoot;
|
|
18
24
|
this.globalVariables = globalVariables;
|
|
25
|
+
this.proverId = proverId;
|
|
19
26
|
}
|
|
20
27
|
static from(fields) {
|
|
21
28
|
return new BlockConstantData(...BlockConstantData.getFields(fields));
|
|
22
29
|
}
|
|
23
30
|
static fromBuffer(buffer) {
|
|
24
31
|
const reader = BufferReader.asReader(buffer);
|
|
25
|
-
return new BlockConstantData(reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), Fr.fromBuffer(reader), Fr.fromBuffer(reader), reader.readObject(GlobalVariables));
|
|
32
|
+
return new BlockConstantData(reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), Fr.fromBuffer(reader), Fr.fromBuffer(reader), reader.readObject(GlobalVariables), Fr.fromBuffer(reader));
|
|
26
33
|
}
|
|
27
34
|
static getFields(fields) {
|
|
28
35
|
return [
|
|
29
36
|
fields.lastArchive,
|
|
30
|
-
fields.
|
|
37
|
+
fields.l1ToL2TreeSnapshot,
|
|
31
38
|
fields.vkTreeRoot,
|
|
32
39
|
fields.protocolContractTreeRoot,
|
|
33
|
-
fields.globalVariables
|
|
40
|
+
fields.globalVariables,
|
|
41
|
+
fields.proverId
|
|
34
42
|
];
|
|
35
43
|
}
|
|
36
44
|
static empty() {
|
|
37
|
-
return new BlockConstantData(AppendOnlyTreeSnapshot.empty(), AppendOnlyTreeSnapshot.empty(), Fr.ZERO, Fr.ZERO, GlobalVariables.empty());
|
|
45
|
+
return new BlockConstantData(AppendOnlyTreeSnapshot.empty(), AppendOnlyTreeSnapshot.empty(), Fr.ZERO, Fr.ZERO, GlobalVariables.empty(), Fr.ZERO);
|
|
38
46
|
}
|
|
39
47
|
toBuffer() {
|
|
40
48
|
return serializeToBuffer(...BlockConstantData.getFields(this));
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { BufferReader } from '@aztec/foundation/serialize';
|
|
2
|
-
import {
|
|
2
|
+
import { BlockRollupPublicInputs } from './block_rollup_public_inputs.js';
|
|
3
|
+
import type { RollupProofData } from './rollup_proof_data.js';
|
|
3
4
|
/**
|
|
4
5
|
* Represents inputs of the block merge rollup circuit.
|
|
5
6
|
*/
|
|
6
|
-
export declare class
|
|
7
|
+
export declare class BlockMergeRollupPrivateInputs {
|
|
7
8
|
/**
|
|
8
9
|
* Previous rollup data from the 2 block merge or block root rollup circuits that preceded this merge rollup circuit.
|
|
9
10
|
*/
|
|
10
|
-
|
|
11
|
+
previousRollups: [RollupProofData<BlockRollupPublicInputs>, RollupProofData<BlockRollupPublicInputs>];
|
|
11
12
|
constructor(
|
|
12
13
|
/**
|
|
13
14
|
* Previous rollup data from the 2 block merge or block root rollup circuits that preceded this merge rollup circuit.
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
+
previousRollups: [RollupProofData<BlockRollupPublicInputs>, RollupProofData<BlockRollupPublicInputs>]);
|
|
16
17
|
/**
|
|
17
18
|
* Serializes the inputs to a buffer.
|
|
18
19
|
* @returns The inputs serialized to a buffer.
|
|
@@ -26,18 +27,18 @@ export declare class BlockMergeRollupInputs {
|
|
|
26
27
|
/**
|
|
27
28
|
* Deserializes the inputs from a buffer.
|
|
28
29
|
* @param buffer - The buffer to deserialize from.
|
|
29
|
-
* @returns A new
|
|
30
|
+
* @returns A new BlockMergeRollupPrivateInputs instance.
|
|
30
31
|
*/
|
|
31
|
-
static fromBuffer(buffer: Buffer | BufferReader):
|
|
32
|
+
static fromBuffer(buffer: Buffer | BufferReader): BlockMergeRollupPrivateInputs;
|
|
32
33
|
/**
|
|
33
34
|
* Deserializes the inputs from a hex string.
|
|
34
35
|
* @param str - A hex string to deserialize from.
|
|
35
|
-
* @returns A new
|
|
36
|
+
* @returns A new BlockMergeRollupPrivateInputs instance.
|
|
36
37
|
*/
|
|
37
|
-
static fromString(str: string):
|
|
38
|
+
static fromString(str: string): BlockMergeRollupPrivateInputs;
|
|
38
39
|
/** Returns a hex representation for JSON serialization. */
|
|
39
40
|
toJSON(): Buffer<ArrayBufferLike>;
|
|
40
41
|
/** Creates an instance from a hex string. */
|
|
41
|
-
static get schema(): import("zod").ZodType<
|
|
42
|
+
static get schema(): import("zod").ZodType<BlockMergeRollupPrivateInputs, any, string>;
|
|
42
43
|
}
|
|
43
44
|
//# sourceMappingURL=block_merge_rollup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_merge_rollup.d.ts","sourceRoot":"","sources":["../../src/rollup/block_merge_rollup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"block_merge_rollup.d.ts","sourceRoot":"","sources":["../../src/rollup/block_merge_rollup.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAI9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D;;GAEG;AACH,qBAAa,6BAA6B;IAEtC;;OAEG;IACI,eAAe,EAAE,CAAC,eAAe,CAAC,uBAAuB,CAAC,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC;;IAH5G;;OAEG;IACI,eAAe,EAAE,CAAC,eAAe,CAAC,uBAAuB,CAAC,EAAE,eAAe,CAAC,uBAAuB,CAAC,CAAC;IAG9G;;;OAGG;IACH,QAAQ;IAIR;;;OAGG;IACH,QAAQ;IAIR;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAQ/C;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,2DAA2D;IAC3D,MAAM;IAIN,6CAA6C;IAC7C,MAAM,KAAK,MAAM,sEAEhB;CACF"}
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
2
2
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
3
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
|
-
import {
|
|
4
|
+
import { ProofData } from '../proofs/index.js';
|
|
5
|
+
import { BlockRollupPublicInputs } from './block_rollup_public_inputs.js';
|
|
5
6
|
/**
|
|
6
7
|
* Represents inputs of the block merge rollup circuit.
|
|
7
|
-
*/ export class
|
|
8
|
-
|
|
8
|
+
*/ export class BlockMergeRollupPrivateInputs {
|
|
9
|
+
previousRollups;
|
|
9
10
|
constructor(/**
|
|
10
11
|
* Previous rollup data from the 2 block merge or block root rollup circuits that preceded this merge rollup circuit.
|
|
11
|
-
*/
|
|
12
|
-
this.
|
|
12
|
+
*/ previousRollups){
|
|
13
|
+
this.previousRollups = previousRollups;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Serializes the inputs to a buffer.
|
|
16
17
|
* @returns The inputs serialized to a buffer.
|
|
17
18
|
*/ toBuffer() {
|
|
18
|
-
return serializeToBuffer(this.
|
|
19
|
+
return serializeToBuffer(this.previousRollups);
|
|
19
20
|
}
|
|
20
21
|
/**
|
|
21
22
|
* Serializes the inputs to a hex string.
|
|
@@ -26,25 +27,25 @@ import { PreviousRollupBlockData } from './previous_rollup_block_data.js';
|
|
|
26
27
|
/**
|
|
27
28
|
* Deserializes the inputs from a buffer.
|
|
28
29
|
* @param buffer - The buffer to deserialize from.
|
|
29
|
-
* @returns A new
|
|
30
|
+
* @returns A new BlockMergeRollupPrivateInputs instance.
|
|
30
31
|
*/ static fromBuffer(buffer) {
|
|
31
32
|
const reader = BufferReader.asReader(buffer);
|
|
32
|
-
return new
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
return new BlockMergeRollupPrivateInputs([
|
|
34
|
+
ProofData.fromBuffer(reader, BlockRollupPublicInputs),
|
|
35
|
+
ProofData.fromBuffer(reader, BlockRollupPublicInputs)
|
|
35
36
|
]);
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Deserializes the inputs from a hex string.
|
|
39
40
|
* @param str - A hex string to deserialize from.
|
|
40
|
-
* @returns A new
|
|
41
|
+
* @returns A new BlockMergeRollupPrivateInputs instance.
|
|
41
42
|
*/ static fromString(str) {
|
|
42
|
-
return
|
|
43
|
+
return BlockMergeRollupPrivateInputs.fromBuffer(hexToBuffer(str));
|
|
43
44
|
}
|
|
44
45
|
/** Returns a hex representation for JSON serialization. */ toJSON() {
|
|
45
46
|
return this.toBuffer();
|
|
46
47
|
}
|
|
47
48
|
/** Creates an instance from a hex string. */ static get schema() {
|
|
48
|
-
return bufferSchemaFor(
|
|
49
|
+
return bufferSchemaFor(BlockMergeRollupPrivateInputs);
|
|
49
50
|
}
|
|
50
51
|
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { SpongeBlob } from '@aztec/blob-lib/types';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
4
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
5
|
+
import { StateReference } from '../tx/state_reference.js';
|
|
6
|
+
import type { UInt64 } from '../types/shared.js';
|
|
7
|
+
import { CheckpointConstantData } from './checkpoint_constant_data.js';
|
|
8
|
+
/**
|
|
9
|
+
* Output of the block root and block merge rollup circuits.
|
|
10
|
+
*/
|
|
11
|
+
export declare class BlockRollupPublicInputs {
|
|
12
|
+
/**
|
|
13
|
+
* Constants for the entire checkpoint.
|
|
14
|
+
*/
|
|
15
|
+
constants: CheckpointConstantData;
|
|
16
|
+
/**
|
|
17
|
+
* Archive tree immediately before this block range.
|
|
18
|
+
*/
|
|
19
|
+
previousArchive: AppendOnlyTreeSnapshot;
|
|
20
|
+
/**
|
|
21
|
+
* Archive tree after applying this block range.
|
|
22
|
+
*/
|
|
23
|
+
newArchive: AppendOnlyTreeSnapshot;
|
|
24
|
+
/**
|
|
25
|
+
* State reference immediately before this block range.
|
|
26
|
+
*/
|
|
27
|
+
startState: StateReference;
|
|
28
|
+
/**
|
|
29
|
+
* State reference after applying this block range.
|
|
30
|
+
*/
|
|
31
|
+
endState: StateReference;
|
|
32
|
+
/**
|
|
33
|
+
* Sponge state to absorb blob inputs at the start of this block range.
|
|
34
|
+
*/
|
|
35
|
+
startSpongeBlob: SpongeBlob;
|
|
36
|
+
/**
|
|
37
|
+
* Sponge state to absorb blob inputs at the end of this block range.
|
|
38
|
+
*/
|
|
39
|
+
endSpongeBlob: SpongeBlob;
|
|
40
|
+
/**
|
|
41
|
+
* Timestamp of the first block in this block range.
|
|
42
|
+
*/
|
|
43
|
+
startTimestamp: UInt64;
|
|
44
|
+
/**
|
|
45
|
+
* Timestamp of the last block in this block range.
|
|
46
|
+
*/
|
|
47
|
+
endTimestamp: UInt64;
|
|
48
|
+
/**
|
|
49
|
+
* SHA256 hash of l1 to l2 messages.
|
|
50
|
+
*/
|
|
51
|
+
inHash: Fr;
|
|
52
|
+
/**
|
|
53
|
+
* SHA256 hash of L2 to L1 messages created in this block range.
|
|
54
|
+
*/
|
|
55
|
+
outHash: Fr;
|
|
56
|
+
/**
|
|
57
|
+
* The summed transaction fees of all the txs in this block range.
|
|
58
|
+
*/
|
|
59
|
+
accumulatedFees: Fr;
|
|
60
|
+
/**
|
|
61
|
+
* The summed mana used of all the txs in this block range.
|
|
62
|
+
*/
|
|
63
|
+
accumulatedManaUsed: Fr;
|
|
64
|
+
constructor(
|
|
65
|
+
/**
|
|
66
|
+
* Constants for the entire checkpoint.
|
|
67
|
+
*/
|
|
68
|
+
constants: CheckpointConstantData,
|
|
69
|
+
/**
|
|
70
|
+
* Archive tree immediately before this block range.
|
|
71
|
+
*/
|
|
72
|
+
previousArchive: AppendOnlyTreeSnapshot,
|
|
73
|
+
/**
|
|
74
|
+
* Archive tree after applying this block range.
|
|
75
|
+
*/
|
|
76
|
+
newArchive: AppendOnlyTreeSnapshot,
|
|
77
|
+
/**
|
|
78
|
+
* State reference immediately before this block range.
|
|
79
|
+
*/
|
|
80
|
+
startState: StateReference,
|
|
81
|
+
/**
|
|
82
|
+
* State reference after applying this block range.
|
|
83
|
+
*/
|
|
84
|
+
endState: StateReference,
|
|
85
|
+
/**
|
|
86
|
+
* Sponge state to absorb blob inputs at the start of this block range.
|
|
87
|
+
*/
|
|
88
|
+
startSpongeBlob: SpongeBlob,
|
|
89
|
+
/**
|
|
90
|
+
* Sponge state to absorb blob inputs at the end of this block range.
|
|
91
|
+
*/
|
|
92
|
+
endSpongeBlob: SpongeBlob,
|
|
93
|
+
/**
|
|
94
|
+
* Timestamp of the first block in this block range.
|
|
95
|
+
*/
|
|
96
|
+
startTimestamp: UInt64,
|
|
97
|
+
/**
|
|
98
|
+
* Timestamp of the last block in this block range.
|
|
99
|
+
*/
|
|
100
|
+
endTimestamp: UInt64,
|
|
101
|
+
/**
|
|
102
|
+
* SHA256 hash of l1 to l2 messages.
|
|
103
|
+
*/
|
|
104
|
+
inHash: Fr,
|
|
105
|
+
/**
|
|
106
|
+
* SHA256 hash of L2 to L1 messages created in this block range.
|
|
107
|
+
*/
|
|
108
|
+
outHash: Fr,
|
|
109
|
+
/**
|
|
110
|
+
* The summed transaction fees of all the txs in this block range.
|
|
111
|
+
*/
|
|
112
|
+
accumulatedFees: Fr,
|
|
113
|
+
/**
|
|
114
|
+
* The summed mana used of all the txs in this block range.
|
|
115
|
+
*/
|
|
116
|
+
accumulatedManaUsed: Fr);
|
|
117
|
+
static fromBuffer(buffer: Buffer | BufferReader): BlockRollupPublicInputs;
|
|
118
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
119
|
+
toString(): `0x${string}`;
|
|
120
|
+
static fromString(str: string): BlockRollupPublicInputs;
|
|
121
|
+
toJSON(): Buffer<ArrayBufferLike>;
|
|
122
|
+
static get schema(): import("zod").ZodType<BlockRollupPublicInputs, any, string>;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=block_rollup_public_inputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block_rollup_public_inputs.d.ts","sourceRoot":"","sources":["../../src/rollup/block_rollup_public_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAuC,MAAM,6BAA6B,CAAC;AAGhG,OAAO,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAEvE;;GAEG;AACH,qBAAa,uBAAuB;IAEhC;;OAEG;IACI,SAAS,EAAE,sBAAsB;IACxC;;OAEG;IACI,eAAe,EAAE,sBAAsB;IAC9C;;OAEG;IACI,UAAU,EAAE,sBAAsB;IACzC;;OAEG;IACI,UAAU,EAAE,cAAc;IACjC;;OAEG;IACI,QAAQ,EAAE,cAAc;IAC/B;;OAEG;IACI,eAAe,EAAE,UAAU;IAClC;;OAEG;IACI,aAAa,EAAE,UAAU;IAChC;;OAEG;IACI,cAAc,EAAE,MAAM;IAC7B;;OAEG;IACI,YAAY,EAAE,MAAM;IAC3B;;OAEG;IACI,MAAM,EAAE,EAAE;IACjB;;OAEG;IACI,OAAO,EAAE,EAAE;IAClB;;OAEG;IACI,eAAe,EAAE,EAAE;IAC1B;;OAEG;IACI,mBAAmB,EAAE,EAAE;;IAnD9B;;OAEG;IACI,SAAS,EAAE,sBAAsB;IACxC;;OAEG;IACI,eAAe,EAAE,sBAAsB;IAC9C;;OAEG;IACI,UAAU,EAAE,sBAAsB;IACzC;;OAEG;IACI,UAAU,EAAE,cAAc;IACjC;;OAEG;IACI,QAAQ,EAAE,cAAc;IAC/B;;OAEG;IACI,eAAe,EAAE,UAAU;IAClC;;OAEG;IACI,aAAa,EAAE,UAAU;IAChC;;OAEG;IACI,cAAc,EAAE,MAAM;IAC7B;;OAEG;IACI,YAAY,EAAE,MAAM;IAC3B;;OAEG;IACI,MAAM,EAAE,EAAE;IACjB;;OAEG;IACI,OAAO,EAAE,EAAE;IAClB;;OAEG;IACI,eAAe,EAAE,EAAE;IAC1B;;OAEG;IACI,mBAAmB,EAAE,EAAE;IAGhC,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,uBAAuB;IAmBzE,QAAQ;IAkBR,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,MAAM;IAIN,MAAM,KAAK,MAAM,gEAEhB;CACF"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { SpongeBlob } from '@aztec/blob-lib/types';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
|
+
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
+
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
7
|
+
import { StateReference } from '../tx/state_reference.js';
|
|
8
|
+
import { CheckpointConstantData } from './checkpoint_constant_data.js';
|
|
9
|
+
/**
|
|
10
|
+
* Output of the block root and block merge rollup circuits.
|
|
11
|
+
*/ export class BlockRollupPublicInputs {
|
|
12
|
+
constants;
|
|
13
|
+
previousArchive;
|
|
14
|
+
newArchive;
|
|
15
|
+
startState;
|
|
16
|
+
endState;
|
|
17
|
+
startSpongeBlob;
|
|
18
|
+
endSpongeBlob;
|
|
19
|
+
startTimestamp;
|
|
20
|
+
endTimestamp;
|
|
21
|
+
inHash;
|
|
22
|
+
outHash;
|
|
23
|
+
accumulatedFees;
|
|
24
|
+
accumulatedManaUsed;
|
|
25
|
+
constructor(/**
|
|
26
|
+
* Constants for the entire checkpoint.
|
|
27
|
+
*/ constants, /**
|
|
28
|
+
* Archive tree immediately before this block range.
|
|
29
|
+
*/ previousArchive, /**
|
|
30
|
+
* Archive tree after applying this block range.
|
|
31
|
+
*/ newArchive, /**
|
|
32
|
+
* State reference immediately before this block range.
|
|
33
|
+
*/ startState, /**
|
|
34
|
+
* State reference after applying this block range.
|
|
35
|
+
*/ endState, /**
|
|
36
|
+
* Sponge state to absorb blob inputs at the start of this block range.
|
|
37
|
+
*/ startSpongeBlob, /**
|
|
38
|
+
* Sponge state to absorb blob inputs at the end of this block range.
|
|
39
|
+
*/ endSpongeBlob, /**
|
|
40
|
+
* Timestamp of the first block in this block range.
|
|
41
|
+
*/ startTimestamp, /**
|
|
42
|
+
* Timestamp of the last block in this block range.
|
|
43
|
+
*/ endTimestamp, /**
|
|
44
|
+
* SHA256 hash of l1 to l2 messages.
|
|
45
|
+
*/ inHash, /**
|
|
46
|
+
* SHA256 hash of L2 to L1 messages created in this block range.
|
|
47
|
+
*/ outHash, /**
|
|
48
|
+
* The summed transaction fees of all the txs in this block range.
|
|
49
|
+
*/ accumulatedFees, /**
|
|
50
|
+
* The summed mana used of all the txs in this block range.
|
|
51
|
+
*/ accumulatedManaUsed){
|
|
52
|
+
this.constants = constants;
|
|
53
|
+
this.previousArchive = previousArchive;
|
|
54
|
+
this.newArchive = newArchive;
|
|
55
|
+
this.startState = startState;
|
|
56
|
+
this.endState = endState;
|
|
57
|
+
this.startSpongeBlob = startSpongeBlob;
|
|
58
|
+
this.endSpongeBlob = endSpongeBlob;
|
|
59
|
+
this.startTimestamp = startTimestamp;
|
|
60
|
+
this.endTimestamp = endTimestamp;
|
|
61
|
+
this.inHash = inHash;
|
|
62
|
+
this.outHash = outHash;
|
|
63
|
+
this.accumulatedFees = accumulatedFees;
|
|
64
|
+
this.accumulatedManaUsed = accumulatedManaUsed;
|
|
65
|
+
}
|
|
66
|
+
static fromBuffer(buffer) {
|
|
67
|
+
const reader = BufferReader.asReader(buffer);
|
|
68
|
+
return new BlockRollupPublicInputs(reader.readObject(CheckpointConstantData), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(AppendOnlyTreeSnapshot), reader.readObject(StateReference), reader.readObject(StateReference), reader.readObject(SpongeBlob), reader.readObject(SpongeBlob), reader.readUInt64(), reader.readUInt64(), Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader));
|
|
69
|
+
}
|
|
70
|
+
toBuffer() {
|
|
71
|
+
return serializeToBuffer(this.constants, this.previousArchive, this.newArchive, this.startState, this.endState, this.startSpongeBlob, this.endSpongeBlob, bigintToUInt64BE(this.startTimestamp), bigintToUInt64BE(this.endTimestamp), this.inHash, this.outHash, this.accumulatedFees, this.accumulatedManaUsed);
|
|
72
|
+
}
|
|
73
|
+
toString() {
|
|
74
|
+
return bufferToHex(this.toBuffer());
|
|
75
|
+
}
|
|
76
|
+
static fromString(str) {
|
|
77
|
+
return BlockRollupPublicInputs.fromBuffer(hexToBuffer(str));
|
|
78
|
+
}
|
|
79
|
+
toJSON() {
|
|
80
|
+
return this.toBuffer();
|
|
81
|
+
}
|
|
82
|
+
static get schema() {
|
|
83
|
+
return bufferSchemaFor(BlockRollupPublicInputs);
|
|
84
|
+
}
|
|
85
|
+
}
|