@aztec/stdlib 3.0.0-nightly.20250917 → 3.0.0-nightly.20250919
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 +2 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/epoch-prover.d.ts +26 -9
- package/dest/interfaces/epoch-prover.d.ts.map +1 -1
- package/dest/interfaces/proving-job.d.ts +233 -125
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +120 -102
- package/dest/interfaces/pxe.d.ts +192 -90
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +5 -31
- package/dest/interfaces/server_circuit_prover.d.ts +31 -27
- 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/index.d.ts +2 -3
- package/dest/parity/index.d.ts.map +1 -1
- package/dest/parity/index.js +2 -3
- package/dest/parity/{base_parity_inputs.d.ts → parity_base_private_inputs.d.ts} +6 -6
- package/dest/parity/parity_base_private_inputs.d.ts.map +1 -0
- package/dest/parity/{base_parity_inputs.js → parity_base_private_inputs.js} +5 -5
- package/dest/parity/parity_root_private_inputs.d.ts +39 -0
- package/dest/parity/parity_root_private_inputs.d.ts.map +1 -0
- package/dest/parity/{root_parity_inputs.js → parity_root_private_inputs.js} +12 -13
- package/dest/proofs/proof_data.d.ts +4 -3
- 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 +16 -11
- package/dest/proofs/proving_request_type.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.js +16 -11
- 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 → block_merge_rollup_private_inputs.d.ts} +17 -10
- package/dest/rollup/block_merge_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{block_merge_rollup.js → block_merge_rollup_private_inputs.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_private_inputs.d.ts +236 -0
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/block_root_rollup_private_inputs.js +257 -0
- 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_private_inputs.d.ts +30 -0
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/checkpoint_merge_rollup_private_inputs.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_private_inputs.d.ts +123 -0
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/checkpoint_root_rollup_private_inputs.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 +14 -12
- package/dest/rollup/index.d.ts.map +1 -1
- package/dest/rollup/index.js +14 -12
- package/dest/rollup/{private_base_rollup_inputs.d.ts → private_tx_base_rollup_private_inputs.d.ts} +7 -7
- package/dest/rollup/private_tx_base_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{private_base_rollup_inputs.js → private_tx_base_rollup_private_inputs.js} +6 -6
- package/dest/rollup/{public_base_rollup_inputs.d.ts → public_tx_base_rollup_private_inputs.d.ts} +7 -7
- package/dest/rollup/public_tx_base_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{public_base_rollup_inputs.js → public_tx_base_rollup_private_inputs.js} +6 -6
- package/dest/rollup/root_rollup_private_inputs.d.ts +67 -0
- package/dest/rollup/root_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/root_rollup_private_inputs.js +69 -0
- package/dest/rollup/root_rollup_public_inputs.d.ts +46 -0
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/root_rollup_public_inputs.js +71 -0
- package/dest/rollup/{merge_rollup.d.ts → tx_merge_rollup_private_inputs.d.ts} +11 -10
- package/dest/rollup/tx_merge_rollup_private_inputs.d.ts.map +1 -0
- package/dest/rollup/{merge_rollup.js → tx_merge_rollup_private_inputs.js} +14 -13
- package/dest/rollup/{base_or_merge_rollup_public_inputs.d.ts → tx_rollup_public_inputs.d.ts} +12 -12
- package/dest/rollup/tx_rollup_public_inputs.d.ts.map +1 -0
- package/dest/rollup/{base_or_merge_rollup_public_inputs.js → tx_rollup_public_inputs.js} +14 -14
- package/dest/stats/stats.d.ts +1 -1
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +28 -68
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +90 -115
- 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 +2 -6
- package/src/interfaces/epoch-prover.ts +35 -11
- package/src/interfaces/proving-job.ts +199 -123
- package/src/interfaces/pxe.ts +3 -138
- package/src/interfaces/server_circuit_prover.ts +83 -52
- 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/parity/index.ts +2 -3
- package/src/parity/{base_parity_inputs.ts → parity_base_private_inputs.ts} +6 -6
- package/src/parity/{root_parity_inputs.ts → parity_root_private_inputs.ts} +16 -18
- package/src/proofs/proof_data.ts +5 -8
- package/src/proofs/proving_request_type.ts +14 -8
- 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 → block_merge_rollup_private_inputs.ts} +15 -11
- package/src/rollup/block_rollup_public_inputs.ts +123 -0
- package/src/rollup/block_root_rollup_private_inputs.ts +312 -0
- 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_private_inputs.ts +49 -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_private_inputs.ts +218 -0
- package/src/rollup/epoch_constant_data.ts +32 -8
- package/src/rollup/index.ts +14 -12
- package/src/rollup/{private_base_rollup_inputs.ts → private_tx_base_rollup_private_inputs.ts} +9 -9
- package/src/rollup/{public_base_rollup_inputs.ts → public_tx_base_rollup_private_inputs.ts} +9 -9
- package/src/rollup/root_rollup_private_inputs.ts +90 -0
- package/src/rollup/{root_rollup.ts → root_rollup_public_inputs.ts} +8 -104
- package/src/rollup/{merge_rollup.ts → tx_merge_rollup_private_inputs.ts} +13 -9
- package/src/rollup/{base_or_merge_rollup_public_inputs.ts → tx_rollup_public_inputs.ts} +12 -12
- package/src/stats/stats.ts +18 -12
- package/src/tests/factories.ts +144 -199
- 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/parity/base_parity_inputs.d.ts.map +0 -1
- package/dest/parity/root_parity_input.d.ts +0 -52
- package/dest/parity/root_parity_input.d.ts.map +0 -1
- package/dest/parity/root_parity_input.js +0 -50
- package/dest/parity/root_parity_inputs.d.ts +0 -37
- package/dest/parity/root_parity_inputs.d.ts.map +0 -1
- package/dest/rollup/base_or_merge_rollup_public_inputs.d.ts.map +0 -1
- package/dest/rollup/block_merge_rollup.d.ts.map +0 -1
- 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/block_root_rollup.d.ts +0 -283
- package/dest/rollup/block_root_rollup.d.ts.map +0 -1
- package/dest/rollup/block_root_rollup.js +0 -306
- 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/merge_rollup.d.ts.map +0 -1
- 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/rollup/previous_rollup_data.d.ts +0 -47
- package/dest/rollup/previous_rollup_data.d.ts.map +0 -1
- package/dest/rollup/previous_rollup_data.js +0 -37
- package/dest/rollup/private_base_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/public_base_rollup_inputs.d.ts.map +0 -1
- package/dest/rollup/root_rollup.d.ts +0 -106
- package/dest/rollup/root_rollup.d.ts.map +0 -1
- package/dest/rollup/root_rollup.js +0 -147
- package/dest/tx/proposed_block_header.d.ts.map +0 -1
- package/src/parity/root_parity_input.ts +0 -71
- package/src/rollup/block_root_rollup.ts +0 -380
- 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
- package/src/rollup/previous_rollup_data.ts +0 -48
|
@@ -0,0 +1,257 @@
|
|
|
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';
|
|
4
|
+
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
5
|
+
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
6
|
+
import { ParityPublicInputs } from '../parity/parity_public_inputs.js';
|
|
7
|
+
import { ProofData } from '../proofs/proof_data.js';
|
|
8
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
9
|
+
import { StateReference } from '../tx/state_reference.js';
|
|
10
|
+
import { CheckpointConstantData } from './checkpoint_constant_data.js';
|
|
11
|
+
import { TxRollupPublicInputs } from './tx_rollup_public_inputs.js';
|
|
12
|
+
export class BlockRootFirstRollupPrivateInputs {
|
|
13
|
+
l1ToL2Roots;
|
|
14
|
+
previousRollups;
|
|
15
|
+
previousL1ToL2;
|
|
16
|
+
newL1ToL2MessageSubtreeSiblingPath;
|
|
17
|
+
newArchiveSiblingPath;
|
|
18
|
+
constructor(/**
|
|
19
|
+
* The original and converted roots of the L1 to L2 messages subtrees.
|
|
20
|
+
*/ l1ToL2Roots, /**
|
|
21
|
+
* The previous rollup proof data from base or merge rollup circuits.
|
|
22
|
+
*/ previousRollups, /**
|
|
23
|
+
* The l1 to l2 message tree snapshot immediately before this block.
|
|
24
|
+
*/ previousL1ToL2, /**
|
|
25
|
+
* Hint for inserting the new l1 to l2 message subtree into `previousL1ToL2`.
|
|
26
|
+
*/ newL1ToL2MessageSubtreeSiblingPath, /**
|
|
27
|
+
* Hint for inserting the new block hash to the last archive.
|
|
28
|
+
*/ newArchiveSiblingPath){
|
|
29
|
+
this.l1ToL2Roots = l1ToL2Roots;
|
|
30
|
+
this.previousRollups = previousRollups;
|
|
31
|
+
this.previousL1ToL2 = previousL1ToL2;
|
|
32
|
+
this.newL1ToL2MessageSubtreeSiblingPath = newL1ToL2MessageSubtreeSiblingPath;
|
|
33
|
+
this.newArchiveSiblingPath = newArchiveSiblingPath;
|
|
34
|
+
}
|
|
35
|
+
static from(fields) {
|
|
36
|
+
return new BlockRootFirstRollupPrivateInputs(...BlockRootFirstRollupPrivateInputs.getFields(fields));
|
|
37
|
+
}
|
|
38
|
+
static getFields(fields) {
|
|
39
|
+
return [
|
|
40
|
+
fields.l1ToL2Roots,
|
|
41
|
+
fields.previousRollups,
|
|
42
|
+
fields.previousL1ToL2,
|
|
43
|
+
fields.newL1ToL2MessageSubtreeSiblingPath,
|
|
44
|
+
fields.newArchiveSiblingPath
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
toBuffer() {
|
|
48
|
+
return serializeToBuffer(...BlockRootFirstRollupPrivateInputs.getFields(this));
|
|
49
|
+
}
|
|
50
|
+
static fromBuffer(buffer) {
|
|
51
|
+
const reader = BufferReader.asReader(buffer);
|
|
52
|
+
return new BlockRootFirstRollupPrivateInputs(ProofData.fromBuffer(reader, ParityPublicInputs), [
|
|
53
|
+
ProofData.fromBuffer(reader, TxRollupPublicInputs),
|
|
54
|
+
ProofData.fromBuffer(reader, TxRollupPublicInputs)
|
|
55
|
+
], AppendOnlyTreeSnapshot.fromBuffer(reader), reader.readArray(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, Fr), reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
56
|
+
}
|
|
57
|
+
toJSON() {
|
|
58
|
+
return this.toBuffer();
|
|
59
|
+
}
|
|
60
|
+
static get schema() {
|
|
61
|
+
return bufferSchemaFor(BlockRootFirstRollupPrivateInputs);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
export class BlockRootSingleTxFirstRollupPrivateInputs {
|
|
65
|
+
l1ToL2Roots;
|
|
66
|
+
previousRollup;
|
|
67
|
+
previousL1ToL2;
|
|
68
|
+
newL1ToL2MessageSubtreeSiblingPath;
|
|
69
|
+
newArchiveSiblingPath;
|
|
70
|
+
constructor(/**
|
|
71
|
+
* The original and converted roots of the L1 to L2 messages subtrees.
|
|
72
|
+
*/ l1ToL2Roots, /**
|
|
73
|
+
* The previous rollup proof data from base or merge rollup circuits.
|
|
74
|
+
*/ previousRollup, /**
|
|
75
|
+
* The l1 to l2 message tree snapshot immediately before this block.
|
|
76
|
+
*/ previousL1ToL2, /**
|
|
77
|
+
* Hint for inserting the new l1 to l2 message subtree.
|
|
78
|
+
*/ newL1ToL2MessageSubtreeSiblingPath, /**
|
|
79
|
+
* Hint for inserting the new block hash to the last archive.
|
|
80
|
+
*/ newArchiveSiblingPath){
|
|
81
|
+
this.l1ToL2Roots = l1ToL2Roots;
|
|
82
|
+
this.previousRollup = previousRollup;
|
|
83
|
+
this.previousL1ToL2 = previousL1ToL2;
|
|
84
|
+
this.newL1ToL2MessageSubtreeSiblingPath = newL1ToL2MessageSubtreeSiblingPath;
|
|
85
|
+
this.newArchiveSiblingPath = newArchiveSiblingPath;
|
|
86
|
+
}
|
|
87
|
+
static from(fields) {
|
|
88
|
+
return new BlockRootSingleTxFirstRollupPrivateInputs(...BlockRootSingleTxFirstRollupPrivateInputs.getFields(fields));
|
|
89
|
+
}
|
|
90
|
+
static getFields(fields) {
|
|
91
|
+
return [
|
|
92
|
+
fields.l1ToL2Roots,
|
|
93
|
+
fields.previousRollup,
|
|
94
|
+
fields.previousL1ToL2,
|
|
95
|
+
fields.newL1ToL2MessageSubtreeSiblingPath,
|
|
96
|
+
fields.newArchiveSiblingPath
|
|
97
|
+
];
|
|
98
|
+
}
|
|
99
|
+
toBuffer() {
|
|
100
|
+
return serializeToBuffer(...BlockRootSingleTxFirstRollupPrivateInputs.getFields(this));
|
|
101
|
+
}
|
|
102
|
+
static fromBuffer(buffer) {
|
|
103
|
+
const reader = BufferReader.asReader(buffer);
|
|
104
|
+
return new BlockRootSingleTxFirstRollupPrivateInputs(ProofData.fromBuffer(reader, ParityPublicInputs), ProofData.fromBuffer(reader, TxRollupPublicInputs), AppendOnlyTreeSnapshot.fromBuffer(reader), reader.readArray(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, Fr), reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
105
|
+
}
|
|
106
|
+
toJSON() {
|
|
107
|
+
return this.toBuffer();
|
|
108
|
+
}
|
|
109
|
+
static get schema() {
|
|
110
|
+
return bufferSchemaFor(BlockRootSingleTxFirstRollupPrivateInputs);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
114
|
+
l1ToL2Roots;
|
|
115
|
+
previousArchive;
|
|
116
|
+
previousState;
|
|
117
|
+
constants;
|
|
118
|
+
startSpongeBlob;
|
|
119
|
+
timestamp;
|
|
120
|
+
newL1ToL2MessageSubtreeSiblingPath;
|
|
121
|
+
newArchiveSiblingPath;
|
|
122
|
+
constructor(/**
|
|
123
|
+
* The original and converted roots of the L1 to L2 messages subtrees.
|
|
124
|
+
*/ l1ToL2Roots, /**
|
|
125
|
+
* The archive after applying the previous block.
|
|
126
|
+
*/ previousArchive, /**
|
|
127
|
+
* The state reference of the previous block.
|
|
128
|
+
*/ previousState, /**
|
|
129
|
+
* The constants of the checkpoint.
|
|
130
|
+
*/ constants, /**
|
|
131
|
+
* The start sponge blob of this block. No data has been absorbed into it yet, since it's the first block. But the
|
|
132
|
+
* number of expected fields must be set to the total number of fields in the entire checkpoint.
|
|
133
|
+
*/ startSpongeBlob, /**
|
|
134
|
+
* The timestamp of this block.
|
|
135
|
+
*/ timestamp, /**
|
|
136
|
+
* Hint for inserting the new l1 to l2 message subtree.
|
|
137
|
+
*/ newL1ToL2MessageSubtreeSiblingPath, /**
|
|
138
|
+
* Hint for inserting the new block hash to the last archive.
|
|
139
|
+
*/ newArchiveSiblingPath){
|
|
140
|
+
this.l1ToL2Roots = l1ToL2Roots;
|
|
141
|
+
this.previousArchive = previousArchive;
|
|
142
|
+
this.previousState = previousState;
|
|
143
|
+
this.constants = constants;
|
|
144
|
+
this.startSpongeBlob = startSpongeBlob;
|
|
145
|
+
this.timestamp = timestamp;
|
|
146
|
+
this.newL1ToL2MessageSubtreeSiblingPath = newL1ToL2MessageSubtreeSiblingPath;
|
|
147
|
+
this.newArchiveSiblingPath = newArchiveSiblingPath;
|
|
148
|
+
}
|
|
149
|
+
static from(fields) {
|
|
150
|
+
return new BlockRootEmptyTxFirstRollupPrivateInputs(...BlockRootEmptyTxFirstRollupPrivateInputs.getFields(fields));
|
|
151
|
+
}
|
|
152
|
+
static getFields(fields) {
|
|
153
|
+
return [
|
|
154
|
+
fields.l1ToL2Roots,
|
|
155
|
+
fields.previousArchive,
|
|
156
|
+
fields.previousState,
|
|
157
|
+
fields.constants,
|
|
158
|
+
fields.startSpongeBlob,
|
|
159
|
+
fields.timestamp,
|
|
160
|
+
fields.newL1ToL2MessageSubtreeSiblingPath,
|
|
161
|
+
fields.newArchiveSiblingPath
|
|
162
|
+
];
|
|
163
|
+
}
|
|
164
|
+
toBuffer() {
|
|
165
|
+
return serializeToBuffer([
|
|
166
|
+
this.l1ToL2Roots,
|
|
167
|
+
this.previousArchive,
|
|
168
|
+
this.previousState,
|
|
169
|
+
this.constants,
|
|
170
|
+
this.startSpongeBlob,
|
|
171
|
+
bigintToUInt64BE(this.timestamp),
|
|
172
|
+
this.newL1ToL2MessageSubtreeSiblingPath,
|
|
173
|
+
this.newArchiveSiblingPath
|
|
174
|
+
]);
|
|
175
|
+
}
|
|
176
|
+
static fromBuffer(buffer) {
|
|
177
|
+
const reader = BufferReader.asReader(buffer);
|
|
178
|
+
return new BlockRootEmptyTxFirstRollupPrivateInputs(ProofData.fromBuffer(reader, ParityPublicInputs), AppendOnlyTreeSnapshot.fromBuffer(reader), StateReference.fromBuffer(reader), CheckpointConstantData.fromBuffer(reader), SpongeBlob.fromBuffer(reader), reader.readUInt64(), reader.readArray(L1_TO_L2_MSG_SUBTREE_SIBLING_PATH_LENGTH, Fr), reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
179
|
+
}
|
|
180
|
+
toJSON() {
|
|
181
|
+
return this.toBuffer();
|
|
182
|
+
}
|
|
183
|
+
static get schema() {
|
|
184
|
+
return bufferSchemaFor(BlockRootEmptyTxFirstRollupPrivateInputs);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
export class BlockRootRollupPrivateInputs {
|
|
188
|
+
previousRollups;
|
|
189
|
+
newArchiveSiblingPath;
|
|
190
|
+
constructor(/**
|
|
191
|
+
* The previous rollup proof data from base or merge rollup circuits.
|
|
192
|
+
*/ previousRollups, /**
|
|
193
|
+
* Hint for inserting the new block hash to the last archive.
|
|
194
|
+
*/ newArchiveSiblingPath){
|
|
195
|
+
this.previousRollups = previousRollups;
|
|
196
|
+
this.newArchiveSiblingPath = newArchiveSiblingPath;
|
|
197
|
+
}
|
|
198
|
+
static from(fields) {
|
|
199
|
+
return new BlockRootRollupPrivateInputs(...BlockRootRollupPrivateInputs.getFields(fields));
|
|
200
|
+
}
|
|
201
|
+
static getFields(fields) {
|
|
202
|
+
return [
|
|
203
|
+
fields.previousRollups,
|
|
204
|
+
fields.newArchiveSiblingPath
|
|
205
|
+
];
|
|
206
|
+
}
|
|
207
|
+
toBuffer() {
|
|
208
|
+
return serializeToBuffer(...BlockRootRollupPrivateInputs.getFields(this));
|
|
209
|
+
}
|
|
210
|
+
static fromBuffer(buffer) {
|
|
211
|
+
const reader = BufferReader.asReader(buffer);
|
|
212
|
+
return new BlockRootRollupPrivateInputs([
|
|
213
|
+
ProofData.fromBuffer(reader, TxRollupPublicInputs),
|
|
214
|
+
ProofData.fromBuffer(reader, TxRollupPublicInputs)
|
|
215
|
+
], reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
216
|
+
}
|
|
217
|
+
toJSON() {
|
|
218
|
+
return this.toBuffer();
|
|
219
|
+
}
|
|
220
|
+
static get schema() {
|
|
221
|
+
return bufferSchemaFor(BlockRootRollupPrivateInputs);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
export class BlockRootSingleTxRollupPrivateInputs {
|
|
225
|
+
previousRollup;
|
|
226
|
+
newArchiveSiblingPath;
|
|
227
|
+
constructor(/**
|
|
228
|
+
* The previous rollup proof data from base or merge rollup circuits.
|
|
229
|
+
*/ previousRollup, /**
|
|
230
|
+
* Hint for inserting the new block hash to the last archive.
|
|
231
|
+
*/ newArchiveSiblingPath){
|
|
232
|
+
this.previousRollup = previousRollup;
|
|
233
|
+
this.newArchiveSiblingPath = newArchiveSiblingPath;
|
|
234
|
+
}
|
|
235
|
+
static from(fields) {
|
|
236
|
+
return new BlockRootSingleTxRollupPrivateInputs(...BlockRootSingleTxRollupPrivateInputs.getFields(fields));
|
|
237
|
+
}
|
|
238
|
+
static getFields(fields) {
|
|
239
|
+
return [
|
|
240
|
+
fields.previousRollup,
|
|
241
|
+
fields.newArchiveSiblingPath
|
|
242
|
+
];
|
|
243
|
+
}
|
|
244
|
+
toBuffer() {
|
|
245
|
+
return serializeToBuffer(...BlockRootSingleTxRollupPrivateInputs.getFields(this));
|
|
246
|
+
}
|
|
247
|
+
static fromBuffer(buffer) {
|
|
248
|
+
const reader = BufferReader.asReader(buffer);
|
|
249
|
+
return new BlockRootSingleTxRollupPrivateInputs(ProofData.fromBuffer(reader, TxRollupPublicInputs), reader.readArray(ARCHIVE_HEIGHT, Fr));
|
|
250
|
+
}
|
|
251
|
+
toJSON() {
|
|
252
|
+
return this.toBuffer();
|
|
253
|
+
}
|
|
254
|
+
static get schema() {
|
|
255
|
+
return bufferSchemaFor(BlockRootSingleTxRollupPrivateInputs);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
3
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
4
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
5
|
+
import { AztecAddress } from '../aztec-address/index.js';
|
|
6
|
+
import { GasFees } from '../gas/gas_fees.js';
|
|
7
|
+
/**
|
|
8
|
+
* Constants that are the same for the entire checkpoint.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CheckpointConstantData {
|
|
11
|
+
/** ChainId of the rollup. */
|
|
12
|
+
chainId: Fr;
|
|
13
|
+
/** Version of the rollup. */
|
|
14
|
+
version: Fr;
|
|
15
|
+
/** Root of the verification key tree. */
|
|
16
|
+
vkTreeRoot: Fr;
|
|
17
|
+
/** Root of the protocol contract tree. */
|
|
18
|
+
protocolContractTreeRoot: Fr;
|
|
19
|
+
/** Identifier of the prover. */
|
|
20
|
+
proverId: Fr;
|
|
21
|
+
/** Slot number of the checkpoint. */
|
|
22
|
+
slotNumber: Fr;
|
|
23
|
+
/** Coinbase address of the rollup. */
|
|
24
|
+
coinbase: EthAddress;
|
|
25
|
+
/** Address to receive fees. */
|
|
26
|
+
feeRecipient: AztecAddress;
|
|
27
|
+
/** Global gas fees for this checkpoint. */
|
|
28
|
+
gasFees: GasFees;
|
|
29
|
+
constructor(
|
|
30
|
+
/** ChainId of the rollup. */
|
|
31
|
+
chainId: Fr,
|
|
32
|
+
/** Version of the rollup. */
|
|
33
|
+
version: Fr,
|
|
34
|
+
/** Root of the verification key tree. */
|
|
35
|
+
vkTreeRoot: Fr,
|
|
36
|
+
/** Root of the protocol contract tree. */
|
|
37
|
+
protocolContractTreeRoot: Fr,
|
|
38
|
+
/** Identifier of the prover. */
|
|
39
|
+
proverId: Fr,
|
|
40
|
+
/** Slot number of the checkpoint. */
|
|
41
|
+
slotNumber: Fr,
|
|
42
|
+
/** Coinbase address of the rollup. */
|
|
43
|
+
coinbase: EthAddress,
|
|
44
|
+
/** Address to receive fees. */
|
|
45
|
+
feeRecipient: AztecAddress,
|
|
46
|
+
/** Global gas fees for this checkpoint. */
|
|
47
|
+
gasFees: GasFees);
|
|
48
|
+
static from(fields: FieldsOf<CheckpointConstantData>): CheckpointConstantData;
|
|
49
|
+
static getFields(fields: FieldsOf<CheckpointConstantData>): readonly [Fr, Fr, Fr, Fr, Fr, Fr, EthAddress, AztecAddress, GasFees];
|
|
50
|
+
static empty(): CheckpointConstantData;
|
|
51
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
52
|
+
static fromBuffer(buffer: Buffer | BufferReader): CheckpointConstantData;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=checkpoint_constant_data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint_constant_data.d.ts","sourceRoot":"","sources":["../../src/rollup/checkpoint_constant_data.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,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,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE7C;;GAEG;AACH,qBAAa,sBAAsB;IAE/B,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,yCAAyC;IAClC,UAAU,EAAE,EAAE;IACrB,0CAA0C;IACnC,wBAAwB,EAAE,EAAE;IACnC,gCAAgC;IACzB,QAAQ,EAAE,EAAE;IACnB,qCAAqC;IAC9B,UAAU,EAAE,EAAE;IACrB,sCAAsC;IAC/B,QAAQ,EAAE,UAAU;IAC3B,+BAA+B;IACxB,YAAY,EAAE,YAAY;IACjC,2CAA2C;IACpC,OAAO,EAAE,OAAO;;IAjBvB,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,6BAA6B;IACtB,OAAO,EAAE,EAAE;IAClB,yCAAyC;IAClC,UAAU,EAAE,EAAE;IACrB,0CAA0C;IACnC,wBAAwB,EAAE,EAAE;IACnC,gCAAgC;IACzB,QAAQ,EAAE,EAAE;IACnB,qCAAqC;IAC9B,UAAU,EAAE,EAAE;IACrB,sCAAsC;IAC/B,QAAQ,EAAE,UAAU;IAC3B,+BAA+B;IACxB,YAAY,EAAE,YAAY;IACjC,2CAA2C;IACpC,OAAO,EAAE,OAAO;IAGzB,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAIpD,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,sBAAsB,CAAC;IAczD,MAAM,CAAC,KAAK;IAcZ,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;CAchD"}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { AztecAddress } from '../aztec-address/index.js';
|
|
5
|
+
import { GasFees } from '../gas/gas_fees.js';
|
|
6
|
+
/**
|
|
7
|
+
* Constants that are the same for the entire checkpoint.
|
|
8
|
+
*/ export class CheckpointConstantData {
|
|
9
|
+
chainId;
|
|
10
|
+
version;
|
|
11
|
+
vkTreeRoot;
|
|
12
|
+
protocolContractTreeRoot;
|
|
13
|
+
proverId;
|
|
14
|
+
slotNumber;
|
|
15
|
+
coinbase;
|
|
16
|
+
feeRecipient;
|
|
17
|
+
gasFees;
|
|
18
|
+
constructor(/** ChainId of the rollup. */ chainId, /** Version of the rollup. */ version, /** Root of the verification key tree. */ vkTreeRoot, /** Root of the protocol contract tree. */ protocolContractTreeRoot, /** Identifier of the prover. */ proverId, /** Slot number of the checkpoint. */ slotNumber, /** Coinbase address of the rollup. */ coinbase, /** Address to receive fees. */ feeRecipient, /** Global gas fees for this checkpoint. */ gasFees){
|
|
19
|
+
this.chainId = chainId;
|
|
20
|
+
this.version = version;
|
|
21
|
+
this.vkTreeRoot = vkTreeRoot;
|
|
22
|
+
this.protocolContractTreeRoot = protocolContractTreeRoot;
|
|
23
|
+
this.proverId = proverId;
|
|
24
|
+
this.slotNumber = slotNumber;
|
|
25
|
+
this.coinbase = coinbase;
|
|
26
|
+
this.feeRecipient = feeRecipient;
|
|
27
|
+
this.gasFees = gasFees;
|
|
28
|
+
}
|
|
29
|
+
static from(fields) {
|
|
30
|
+
return new CheckpointConstantData(...CheckpointConstantData.getFields(fields));
|
|
31
|
+
}
|
|
32
|
+
static getFields(fields) {
|
|
33
|
+
return [
|
|
34
|
+
fields.chainId,
|
|
35
|
+
fields.version,
|
|
36
|
+
fields.vkTreeRoot,
|
|
37
|
+
fields.protocolContractTreeRoot,
|
|
38
|
+
fields.proverId,
|
|
39
|
+
fields.slotNumber,
|
|
40
|
+
fields.coinbase,
|
|
41
|
+
fields.feeRecipient,
|
|
42
|
+
fields.gasFees
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
static empty() {
|
|
46
|
+
return new CheckpointConstantData(Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, Fr.ZERO, EthAddress.ZERO, AztecAddress.ZERO, GasFees.empty());
|
|
47
|
+
}
|
|
48
|
+
toBuffer() {
|
|
49
|
+
return serializeToBuffer(...CheckpointConstantData.getFields(this));
|
|
50
|
+
}
|
|
51
|
+
static fromBuffer(buffer) {
|
|
52
|
+
const reader = BufferReader.asReader(buffer);
|
|
53
|
+
return new CheckpointConstantData(Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), Fr.fromBuffer(reader), reader.readObject(EthAddress), reader.readObject(AztecAddress), reader.readObject(GasFees));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -7,10 +7,9 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
7
7
|
import { inspect } from 'util';
|
|
8
8
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
9
9
|
import { GasFees } from '../gas/index.js';
|
|
10
|
+
import { ContentCommitment } from '../tx/content_commitment.js';
|
|
10
11
|
import type { UInt64 } from '../types/shared.js';
|
|
11
|
-
|
|
12
|
-
/** The proposed values of an L2 block. */
|
|
13
|
-
export declare class ProposedBlockHeader {
|
|
12
|
+
export declare class CheckpointHeader {
|
|
14
13
|
/** Root of the archive tree before this block is added. */
|
|
15
14
|
lastArchiveRoot: Fr;
|
|
16
15
|
/** Content commitment of the L2 block. */
|
|
@@ -44,22 +43,22 @@ export declare class ProposedBlockHeader {
|
|
|
44
43
|
gasFees: GasFees,
|
|
45
44
|
/** Total mana used in the block, computed by the root rollup circuit */
|
|
46
45
|
totalManaUsed: Fr);
|
|
47
|
-
static get schema(): ZodFor<
|
|
48
|
-
static getFields(fields: FieldsOf<
|
|
49
|
-
static from(fields: FieldsOf<
|
|
50
|
-
static fromBuffer(buffer: Buffer | BufferReader):
|
|
46
|
+
static get schema(): ZodFor<CheckpointHeader>;
|
|
47
|
+
static getFields(fields: FieldsOf<CheckpointHeader>): readonly [Fr, ContentCommitment, Fr, bigint, EthAddress, AztecAddress, GasFees, Fr];
|
|
48
|
+
static from(fields: FieldsOf<CheckpointHeader>): CheckpointHeader;
|
|
49
|
+
static fromBuffer(buffer: Buffer | BufferReader): CheckpointHeader;
|
|
51
50
|
toBuffer(): Buffer<ArrayBufferLike>;
|
|
52
51
|
hash(): Fr;
|
|
53
|
-
static empty(fields?: Partial<FieldsOf<
|
|
54
|
-
static random():
|
|
52
|
+
static empty(fields?: Partial<FieldsOf<CheckpointHeader>>): CheckpointHeader;
|
|
53
|
+
static random(): CheckpointHeader;
|
|
55
54
|
isEmpty(): boolean;
|
|
56
55
|
/**
|
|
57
56
|
* Serializes this instance into a string.
|
|
58
57
|
* @returns Encoded string.
|
|
59
58
|
*/
|
|
60
59
|
toString(): `0x${string}`;
|
|
61
|
-
static fromString(str: string):
|
|
62
|
-
static fromViem(header: ViemHeader):
|
|
60
|
+
static fromString(str: string): CheckpointHeader;
|
|
61
|
+
static fromViem(header: ViemHeader): CheckpointHeader;
|
|
63
62
|
toViem(): ViemHeader;
|
|
64
63
|
toInspect(): {
|
|
65
64
|
lastArchive: `0x${string}`;
|
|
@@ -80,4 +79,4 @@ export declare class ProposedBlockHeader {
|
|
|
80
79
|
};
|
|
81
80
|
[inspect.custom](): string;
|
|
82
81
|
}
|
|
83
|
-
//# sourceMappingURL=
|
|
82
|
+
//# sourceMappingURL=checkpoint_header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint_header.d.ts","sourceRoot":"","sources":["../../src/rollup/checkpoint_header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAuC,MAAM,6BAA6B,CAAC;AAEhG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAG/B,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjD,qBAAa,gBAAgB;IAEzB,2DAA2D;IACpD,eAAe,EAAE,EAAE;IAC1B,0CAA0C;IACnC,iBAAiB,EAAE,iBAAiB;IAC3C,kCAAkC;IAC3B,UAAU,EAAE,EAAE;IACrB,iCAAiC;IAC1B,SAAS,EAAE,MAAM;IACxB,iCAAiC;IAC1B,QAAQ,EAAE,UAAU;IAC3B,+BAA+B;IACxB,YAAY,EAAE,YAAY;IACjC,wCAAwC;IACjC,OAAO,EAAE,OAAO;IACvB,wEAAwE;IACjE,aAAa,EAAE,EAAE;;IAfxB,2DAA2D;IACpD,eAAe,EAAE,EAAE;IAC1B,0CAA0C;IACnC,iBAAiB,EAAE,iBAAiB;IAC3C,kCAAkC;IAC3B,UAAU,EAAE,EAAE;IACrB,iCAAiC;IAC1B,SAAS,EAAE,MAAM;IACxB,iCAAiC;IAC1B,QAAQ,EAAE,UAAU;IAC3B,+BAA+B;IACxB,YAAY,EAAE,YAAY;IACjC,wCAAwC;IACjC,OAAO,EAAE,OAAO;IACvB,wEAAwE;IACjE,aAAa,EAAE,EAAE;IAG1B,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAa5C;IAED,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAanD,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAAC;IAI9C,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAe/C,QAAQ;IAcR,IAAI,IAAI,EAAE;IAIV,MAAM,CAAC,KAAK,CAAC,MAAM,GAAE,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAM;IAc7D,MAAM,CAAC,MAAM,IAAI,gBAAgB;IAajC,OAAO,IAAI,OAAO;IAalB;;;OAGG;IACI,QAAQ;IAIf,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE,UAAU;IAalC,MAAM,IAAI,UAAU;IAgBpB,SAAS;;;;;;;;;;;;;;;;;IAaT,CAAC,OAAO,CAAC,MAAM,CAAC;CAajB"}
|
|
@@ -8,8 +8,8 @@ import { z } from 'zod';
|
|
|
8
8
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
9
9
|
import { GasFees } from '../gas/index.js';
|
|
10
10
|
import { schemas } from '../schemas/index.js';
|
|
11
|
-
import { ContentCommitment } from '
|
|
12
|
-
|
|
11
|
+
import { ContentCommitment } from '../tx/content_commitment.js';
|
|
12
|
+
export class CheckpointHeader {
|
|
13
13
|
lastArchiveRoot;
|
|
14
14
|
contentCommitment;
|
|
15
15
|
slotNumber;
|
|
@@ -38,7 +38,7 @@ import { ContentCommitment } from './content_commitment.js';
|
|
|
38
38
|
feeRecipient: schemas.AztecAddress,
|
|
39
39
|
gasFees: GasFees.schema,
|
|
40
40
|
totalManaUsed: schemas.Fr
|
|
41
|
-
}).transform(
|
|
41
|
+
}).transform(CheckpointHeader.from);
|
|
42
42
|
}
|
|
43
43
|
static getFields(fields) {
|
|
44
44
|
return [
|
|
@@ -53,11 +53,11 @@ import { ContentCommitment } from './content_commitment.js';
|
|
|
53
53
|
];
|
|
54
54
|
}
|
|
55
55
|
static from(fields) {
|
|
56
|
-
return new
|
|
56
|
+
return new CheckpointHeader(...CheckpointHeader.getFields(fields));
|
|
57
57
|
}
|
|
58
58
|
static fromBuffer(buffer) {
|
|
59
59
|
const reader = BufferReader.asReader(buffer);
|
|
60
|
-
return new
|
|
60
|
+
return new CheckpointHeader(reader.readObject(Fr), reader.readObject(ContentCommitment), Fr.fromBuffer(reader), reader.readUInt64(), reader.readObject(EthAddress), reader.readObject(AztecAddress), reader.readObject(GasFees), reader.readObject(Fr));
|
|
61
61
|
}
|
|
62
62
|
toBuffer() {
|
|
63
63
|
// Note: The order here must match the order in the ProposedHeaderLib solidity library.
|
|
@@ -78,7 +78,7 @@ import { ContentCommitment } from './content_commitment.js';
|
|
|
78
78
|
]);
|
|
79
79
|
}
|
|
80
80
|
static empty(fields = {}) {
|
|
81
|
-
return
|
|
81
|
+
return CheckpointHeader.from({
|
|
82
82
|
lastArchiveRoot: Fr.ZERO,
|
|
83
83
|
contentCommitment: ContentCommitment.empty(),
|
|
84
84
|
slotNumber: Fr.ZERO,
|
|
@@ -91,7 +91,7 @@ import { ContentCommitment } from './content_commitment.js';
|
|
|
91
91
|
});
|
|
92
92
|
}
|
|
93
93
|
static random() {
|
|
94
|
-
return new
|
|
94
|
+
return new CheckpointHeader(Fr.random(), ContentCommitment.random(), new Fr(BigInt(Math.floor(Math.random() * 1000) + 1)), BigInt(Math.floor(Date.now() / 1000)), EthAddress.random(), new AztecAddress(Fr.random()), GasFees.random(), new Fr(BigInt(Math.floor(Math.random() * 1000000))));
|
|
95
95
|
}
|
|
96
96
|
isEmpty() {
|
|
97
97
|
return this.lastArchiveRoot.isZero() && this.contentCommitment.isEmpty() && this.slotNumber.isZero() && this.timestamp === 0n && this.coinbase.isZero() && this.feeRecipient.isZero() && this.gasFees.isEmpty() && this.totalManaUsed.isZero();
|
|
@@ -103,10 +103,10 @@ import { ContentCommitment } from './content_commitment.js';
|
|
|
103
103
|
return bufferToHex(this.toBuffer());
|
|
104
104
|
}
|
|
105
105
|
static fromString(str) {
|
|
106
|
-
return
|
|
106
|
+
return CheckpointHeader.fromBuffer(hexToBuffer(str));
|
|
107
107
|
}
|
|
108
108
|
static fromViem(header) {
|
|
109
|
-
return new
|
|
109
|
+
return new CheckpointHeader(Fr.fromString(header.lastArchiveRoot), ContentCommitment.fromViem(header.contentCommitment), new Fr(header.slotNumber), header.timestamp, new EthAddress(hexToBuffer(header.coinbase)), new AztecAddress(hexToBuffer(header.feeRecipient)), new GasFees(header.gasFees.feePerDaGas, header.gasFees.feePerL2Gas), new Fr(header.totalManaUsed));
|
|
110
110
|
}
|
|
111
111
|
toViem() {
|
|
112
112
|
return {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
2
|
+
import { type RollupHonkProofData } from '../proofs/proof_data.js';
|
|
3
|
+
import { CheckpointRollupPublicInputs } from './checkpoint_rollup_public_inputs.js';
|
|
4
|
+
/**
|
|
5
|
+
* Represents inputs of the checkpoint merge rollup circuit.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CheckpointMergeRollupPrivateInputs {
|
|
8
|
+
/**
|
|
9
|
+
* Previous rollup data from the 2 checkpoint root or merge rollup circuits that preceded this checkpoint merge rollup circuit.
|
|
10
|
+
*/
|
|
11
|
+
previousRollups: [
|
|
12
|
+
RollupHonkProofData<CheckpointRollupPublicInputs>,
|
|
13
|
+
RollupHonkProofData<CheckpointRollupPublicInputs>
|
|
14
|
+
];
|
|
15
|
+
constructor(
|
|
16
|
+
/**
|
|
17
|
+
* Previous rollup data from the 2 checkpoint root or merge rollup circuits that preceded this checkpoint merge rollup circuit.
|
|
18
|
+
*/
|
|
19
|
+
previousRollups: [
|
|
20
|
+
RollupHonkProofData<CheckpointRollupPublicInputs>,
|
|
21
|
+
RollupHonkProofData<CheckpointRollupPublicInputs>
|
|
22
|
+
]);
|
|
23
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
24
|
+
static fromBuffer(buffer: Buffer | BufferReader): CheckpointMergeRollupPrivateInputs;
|
|
25
|
+
toString(): `0x${string}`;
|
|
26
|
+
static fromString(str: string): CheckpointMergeRollupPrivateInputs;
|
|
27
|
+
toJSON(): Buffer<ArrayBufferLike>;
|
|
28
|
+
static get schema(): import("zod").ZodType<CheckpointMergeRollupPrivateInputs, any, string>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=checkpoint_merge_rollup_private_inputs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkpoint_merge_rollup_private_inputs.d.ts","sourceRoot":"","sources":["../../src/rollup/checkpoint_merge_rollup_private_inputs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAG9E,OAAO,EAAa,KAAK,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAEpF;;GAEG;AACH,qBAAa,kCAAkC;IAE3C;;OAEG;IACI,eAAe,EAAE;QACtB,mBAAmB,CAAC,4BAA4B,CAAC;QACjD,mBAAmB,CAAC,4BAA4B,CAAC;KAClD;;IAND;;OAEG;IACI,eAAe,EAAE;QACtB,mBAAmB,CAAC,4BAA4B,CAAC;QACjD,mBAAmB,CAAC,4BAA4B,CAAC;KAClD;IAGH,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAQ/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAI7B,MAAM;IAIN,MAAM,KAAK,MAAM,2EAEhB;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
2
|
+
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
3
|
+
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
4
|
+
import { ProofData } from '../proofs/proof_data.js';
|
|
5
|
+
import { CheckpointRollupPublicInputs } from './checkpoint_rollup_public_inputs.js';
|
|
6
|
+
/**
|
|
7
|
+
* Represents inputs of the checkpoint merge rollup circuit.
|
|
8
|
+
*/ export class CheckpointMergeRollupPrivateInputs {
|
|
9
|
+
previousRollups;
|
|
10
|
+
constructor(/**
|
|
11
|
+
* Previous rollup data from the 2 checkpoint root or merge rollup circuits that preceded this checkpoint merge rollup circuit.
|
|
12
|
+
*/ previousRollups){
|
|
13
|
+
this.previousRollups = previousRollups;
|
|
14
|
+
}
|
|
15
|
+
toBuffer() {
|
|
16
|
+
return serializeToBuffer(this.previousRollups);
|
|
17
|
+
}
|
|
18
|
+
static fromBuffer(buffer) {
|
|
19
|
+
const reader = BufferReader.asReader(buffer);
|
|
20
|
+
return new CheckpointMergeRollupPrivateInputs([
|
|
21
|
+
ProofData.fromBuffer(reader, CheckpointRollupPublicInputs),
|
|
22
|
+
ProofData.fromBuffer(reader, CheckpointRollupPublicInputs)
|
|
23
|
+
]);
|
|
24
|
+
}
|
|
25
|
+
toString() {
|
|
26
|
+
return bufferToHex(this.toBuffer());
|
|
27
|
+
}
|
|
28
|
+
static fromString(str) {
|
|
29
|
+
return CheckpointMergeRollupPrivateInputs.fromBuffer(hexToBuffer(str));
|
|
30
|
+
}
|
|
31
|
+
toJSON() {
|
|
32
|
+
return this.toBuffer();
|
|
33
|
+
}
|
|
34
|
+
static get schema() {
|
|
35
|
+
return bufferSchemaFor(CheckpointMergeRollupPrivateInputs);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { BlobAccumulatorPublicInputs, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
|
|
2
|
+
import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
|
|
3
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
5
|
+
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
6
|
+
import type { FieldsOf } from '@aztec/foundation/types';
|
|
7
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
8
|
+
import { EpochConstantData } from './epoch_constant_data.js';
|
|
9
|
+
/**
|
|
10
|
+
* Output of the checkpoint root and checkpoint merge rollup circuits.
|
|
11
|
+
*/
|
|
12
|
+
export declare class CheckpointRollupPublicInputs {
|
|
13
|
+
/**
|
|
14
|
+
* Constants for the entire epoch.
|
|
15
|
+
*/
|
|
16
|
+
constants: EpochConstantData;
|
|
17
|
+
/**
|
|
18
|
+
* Archive tree immediately before this checkpoint range.
|
|
19
|
+
*/
|
|
20
|
+
previousArchive: AppendOnlyTreeSnapshot;
|
|
21
|
+
/**
|
|
22
|
+
* Archive tree after adding this checkpoint range.
|
|
23
|
+
*/
|
|
24
|
+
newArchive: AppendOnlyTreeSnapshot;
|
|
25
|
+
/**
|
|
26
|
+
* The hashes of the headers of the constituent checkpoints.
|
|
27
|
+
*/
|
|
28
|
+
checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>;
|
|
29
|
+
/**
|
|
30
|
+
* The summed transaction fees and recipients of the constituent checkpoints.
|
|
31
|
+
*/
|
|
32
|
+
fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>;
|
|
33
|
+
/**
|
|
34
|
+
* Accumulated opening proofs for all blobs before this checkpoint range.
|
|
35
|
+
*/
|
|
36
|
+
startBlobAccumulator: BlobAccumulatorPublicInputs;
|
|
37
|
+
/**
|
|
38
|
+
* Accumulated opening proofs for all blobs after applying this checkpoint range.
|
|
39
|
+
*/
|
|
40
|
+
endBlobAccumulator: BlobAccumulatorPublicInputs;
|
|
41
|
+
/**
|
|
42
|
+
* Final values z and gamma, shared across the epoch.
|
|
43
|
+
*/
|
|
44
|
+
finalBlobChallenges: FinalBlobBatchingChallenges;
|
|
45
|
+
constructor(
|
|
46
|
+
/**
|
|
47
|
+
* Constants for the entire epoch.
|
|
48
|
+
*/
|
|
49
|
+
constants: EpochConstantData,
|
|
50
|
+
/**
|
|
51
|
+
* Archive tree immediately before this checkpoint range.
|
|
52
|
+
*/
|
|
53
|
+
previousArchive: AppendOnlyTreeSnapshot,
|
|
54
|
+
/**
|
|
55
|
+
* Archive tree after adding this checkpoint range.
|
|
56
|
+
*/
|
|
57
|
+
newArchive: AppendOnlyTreeSnapshot,
|
|
58
|
+
/**
|
|
59
|
+
* The hashes of the headers of the constituent checkpoints.
|
|
60
|
+
*/
|
|
61
|
+
checkpointHeaderHashes: Tuple<Fr, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
62
|
+
/**
|
|
63
|
+
* The summed transaction fees and recipients of the constituent checkpoints.
|
|
64
|
+
*/
|
|
65
|
+
fees: Tuple<FeeRecipient, typeof AZTEC_MAX_EPOCH_DURATION>,
|
|
66
|
+
/**
|
|
67
|
+
* Accumulated opening proofs for all blobs before this checkpoint range.
|
|
68
|
+
*/
|
|
69
|
+
startBlobAccumulator: BlobAccumulatorPublicInputs,
|
|
70
|
+
/**
|
|
71
|
+
* Accumulated opening proofs for all blobs after applying this checkpoint range.
|
|
72
|
+
*/
|
|
73
|
+
endBlobAccumulator: BlobAccumulatorPublicInputs,
|
|
74
|
+
/**
|
|
75
|
+
* Final values z and gamma, shared across the epoch.
|
|
76
|
+
*/
|
|
77
|
+
finalBlobChallenges: FinalBlobBatchingChallenges);
|
|
78
|
+
static fromBuffer(buffer: Buffer | BufferReader): CheckpointRollupPublicInputs;
|
|
79
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
80
|
+
toString(): `0x${string}`;
|
|
81
|
+
static fromString(str: string): CheckpointRollupPublicInputs;
|
|
82
|
+
/** Returns a buffer representation for JSON serialization. */
|
|
83
|
+
toJSON(): Buffer<ArrayBufferLike>;
|
|
84
|
+
/** Creates an instance from a hex string. */
|
|
85
|
+
static get schema(): import("zod").ZodType<CheckpointRollupPublicInputs, any, string>;
|
|
86
|
+
}
|
|
87
|
+
export declare class FeeRecipient {
|
|
88
|
+
recipient: EthAddress;
|
|
89
|
+
value: Fr;
|
|
90
|
+
constructor(recipient: EthAddress, value: Fr);
|
|
91
|
+
static fromBuffer(buffer: Buffer | BufferReader): FeeRecipient;
|
|
92
|
+
toBuffer(): Buffer<ArrayBufferLike>;
|
|
93
|
+
static getFields(fields: FieldsOf<FeeRecipient>): readonly [EthAddress, Fr];
|
|
94
|
+
toFields(): Fr[];
|
|
95
|
+
isEmpty(): boolean;
|
|
96
|
+
toFriendlyJSON(): {
|
|
97
|
+
recipient?: undefined;
|
|
98
|
+
value?: undefined;
|
|
99
|
+
} | {
|
|
100
|
+
recipient: `0x${string}`;
|
|
101
|
+
value: `0x${string}`;
|
|
102
|
+
};
|
|
103
|
+
static random(): FeeRecipient;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=checkpoint_rollup_public_inputs.d.ts.map
|