@aztec/stdlib 6.0.0-nightly.20260810 → 6.0.0-nightly.20260821
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/abi/abi.d.ts +4 -3
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +5 -1
- package/dest/abi/contract_artifact.d.ts +7 -2
- package/dest/abi/contract_artifact.d.ts.map +1 -1
- package/dest/abi/contract_artifact.js +18 -19
- package/dest/avm/avm.d.ts +3 -2
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +9 -3
- package/dest/avm/avm_proving_request.d.ts +70 -70
- package/dest/block/l2_block.d.ts +1 -2
- package/dest/block/l2_block.d.ts.map +1 -1
- package/dest/block/l2_block.js +2 -3
- package/dest/block/l2_block_source.d.ts +3 -6
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts +11 -20
- package/dest/block/l2_block_stream/event_driven_l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/event_driven_l2_block_stream.js +12 -116
- package/dest/checkpoint/checkpoint_data.d.ts +14 -2
- package/dest/checkpoint/checkpoint_data.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint_data.js +2 -1
- package/dest/checkpoint/index.d.ts +2 -1
- package/dest/checkpoint/index.d.ts.map +1 -1
- package/dest/checkpoint/index.js +1 -0
- package/dest/checkpoint/previous_checkpoint_inbox_rolling_hash.d.ts +21 -0
- package/dest/checkpoint/previous_checkpoint_inbox_rolling_hash.d.ts.map +1 -0
- package/dest/checkpoint/previous_checkpoint_inbox_rolling_hash.js +34 -0
- package/dest/checkpoint/simulation_overrides.d.ts +2 -2
- package/dest/checkpoint/simulation_overrides.d.ts.map +1 -1
- package/dest/checkpoint/simulation_overrides.js +11 -8
- package/dest/config/network-consensus-config.d.ts +4 -3
- package/dest/config/network-consensus-config.d.ts.map +1 -1
- package/dest/config/network-consensus-config.js +9 -4
- package/dest/config/node-rpc-config.d.ts +13 -1
- package/dest/config/node-rpc-config.d.ts.map +1 -1
- package/dest/config/node-rpc-config.js +34 -1
- package/dest/deserialization/index.d.ts +17 -17
- package/dest/deserialization/index.d.ts.map +1 -1
- package/dest/deserialization/index.js +18 -18
- package/dest/gas/gas_settings.d.ts +17 -5
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +4 -4
- package/dest/gas/tx_gas_limits.d.ts +3 -4
- package/dest/gas/tx_gas_limits.d.ts.map +1 -1
- package/dest/gas/tx_gas_limits.js +4 -5
- package/dest/interfaces/archiver.d.ts +2 -2
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +32 -5
- package/dest/interfaces/aztec-node-admin.d.ts +2 -1
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.d.ts +22 -4
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +11 -9
- package/dest/interfaces/block-builder.d.ts +11 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/configs.d.ts +7 -1
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +2 -1
- package/dest/interfaces/p2p.d.ts +18 -1
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +8 -0
- package/dest/interfaces/proving-job.d.ts +17 -42
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/proving-job.js +16 -47
- package/dest/interfaces/server_circuit_prover.d.ts +8 -15
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/validator.d.ts +7 -7
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/messaging/append_l1_to_l2_messages.d.ts +5 -5
- package/dest/messaging/append_l1_to_l2_messages.d.ts.map +1 -1
- package/dest/messaging/append_l1_to_l2_messages.js +4 -8
- package/dest/messaging/inbox_bucket.d.ts +77 -0
- package/dest/messaging/inbox_bucket.d.ts.map +1 -0
- package/dest/messaging/inbox_bucket.js +73 -0
- package/dest/messaging/inbox_consumption.d.ts +55 -0
- package/dest/messaging/inbox_consumption.d.ts.map +1 -0
- package/dest/messaging/inbox_consumption.js +53 -0
- package/dest/messaging/inbox_rolling_hash.d.ts +16 -0
- package/dest/messaging/inbox_rolling_hash.d.ts.map +1 -0
- package/dest/messaging/inbox_rolling_hash.js +23 -0
- package/dest/messaging/index.d.ts +6 -3
- package/dest/messaging/index.d.ts.map +1 -1
- package/dest/messaging/index.js +5 -2
- package/dest/messaging/l1_to_l2_message_bundle.d.ts +31 -0
- package/dest/messaging/l1_to_l2_message_bundle.d.ts.map +1 -0
- package/dest/messaging/l1_to_l2_message_bundle.js +51 -0
- package/dest/messaging/l1_to_l2_message_source.d.ts +44 -10
- package/dest/messaging/l1_to_l2_message_source.d.ts.map +1 -1
- package/dest/messaging/l1_to_l2_message_sponge.d.ts +40 -0
- package/dest/messaging/l1_to_l2_message_sponge.d.ts.map +1 -0
- package/dest/messaging/l1_to_l2_message_sponge.js +56 -0
- package/dest/noir/index.d.ts +3 -3
- package/dest/noir/index.d.ts.map +1 -1
- package/dest/p2p/block_proposal.d.ts +24 -9
- package/dest/p2p/block_proposal.d.ts.map +1 -1
- package/dest/p2p/block_proposal.js +42 -20
- package/dest/p2p/checkpoint_attestation.d.ts +1 -1
- package/dest/p2p/checkpoint_proposal.d.ts +13 -3
- package/dest/p2p/checkpoint_proposal.d.ts.map +1 -1
- package/dest/p2p/checkpoint_proposal.js +26 -8
- package/dest/p2p/consensus_payload.d.ts +1 -1
- package/dest/p2p/index.d.ts +2 -1
- package/dest/p2p/index.d.ts.map +1 -1
- package/dest/p2p/index.js +1 -0
- package/dest/p2p/validated_proposal.d.ts +35 -0
- package/dest/p2p/validated_proposal.d.ts.map +1 -0
- package/dest/p2p/validated_proposal.js +17 -0
- package/dest/p2p/wire_compat_fixtures.d.ts +7 -0
- package/dest/p2p/wire_compat_fixtures.d.ts.map +1 -0
- package/dest/p2p/wire_compat_fixtures.js +14 -0
- package/dest/parity/inbox_parity_private_inputs.d.ts +61 -0
- package/dest/parity/inbox_parity_private_inputs.d.ts.map +1 -0
- package/dest/parity/inbox_parity_private_inputs.js +79 -0
- package/dest/parity/index.d.ts +2 -3
- package/dest/parity/index.d.ts.map +1 -1
- package/dest/parity/index.js +1 -2
- package/dest/parity/parity_public_inputs.d.ts +15 -14
- package/dest/parity/parity_public_inputs.d.ts.map +1 -1
- package/dest/parity/parity_public_inputs.js +13 -15
- package/dest/proofs/proving_request_type.d.ts +11 -14
- package/dest/proofs/proving_request_type.d.ts.map +1 -1
- package/dest/proofs/proving_request_type.js +10 -13
- package/dest/rollup/block_constant_data.d.ts +8 -8
- package/dest/rollup/block_constant_data.js +4 -4
- package/dest/rollup/block_rollup_public_inputs.d.ts +18 -6
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +14 -7
- package/dest/rollup/block_root_rollup_private_inputs.d.ts +109 -113
- package/dest/rollup/block_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/block_root_rollup_private_inputs.js +79 -130
- package/dest/rollup/checkpoint_header.d.ts +14 -6
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +18 -14
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts +22 -2
- package/dest/rollup/checkpoint_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_rollup_public_inputs.js +14 -3
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts +27 -6
- package/dest/rollup/checkpoint_root_rollup_private_inputs.d.ts.map +1 -1
- package/dest/rollup/checkpoint_root_rollup_private_inputs.js +17 -4
- package/dest/rollup/root_rollup_public_inputs.d.ts +10 -2
- package/dest/rollup/root_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/root_rollup_public_inputs.js +9 -3
- package/dest/stats/stats.d.ts +2 -2
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +7 -7
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +26 -22
- package/dest/tests/fixtures.d.ts +1 -1
- package/dest/tests/fixtures.d.ts.map +1 -1
- package/dest/tests/fixtures.js +2 -0
- package/dest/tests/mocks.d.ts +4 -2
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +4 -7
- package/dest/tx/state_reference.d.ts +5 -2
- package/dest/tx/state_reference.d.ts.map +1 -1
- package/dest/tx/state_reference.js +5 -5
- package/package.json +8 -8
- package/src/abi/abi.ts +7 -2
- package/src/abi/contract_artifact.ts +20 -23
- package/src/avm/avm.ts +11 -1
- package/src/block/l2_block.ts +2 -3
- package/src/block/l2_block_source.ts +2 -5
- package/src/block/l2_block_stream/event_driven_l2_block_stream.ts +17 -143
- package/src/checkpoint/checkpoint_data.ts +14 -1
- package/src/checkpoint/index.ts +1 -0
- package/src/checkpoint/previous_checkpoint_inbox_rolling_hash.ts +46 -0
- package/src/checkpoint/simulation_overrides.ts +11 -8
- package/src/config/network-consensus-config.ts +17 -4
- package/src/config/node-rpc-config.ts +51 -1
- package/src/deserialization/index.ts +18 -18
- package/src/gas/README.md +4 -3
- package/src/gas/gas_settings.ts +7 -3
- package/src/gas/tx_gas_limits.ts +4 -12
- package/src/interfaces/archiver.ts +19 -2
- package/src/interfaces/aztec-node.ts +33 -12
- package/src/interfaces/block-builder.ts +10 -1
- package/src/interfaces/configs.ts +6 -0
- package/src/interfaces/p2p.ts +21 -0
- package/src/interfaces/proving-job.ts +19 -70
- package/src/interfaces/server_circuit_prover.ts +13 -37
- package/src/interfaces/validator.ts +6 -5
- package/src/kernel/private_kernel_reset_dimensions.ts +1 -1
- package/src/messaging/append_l1_to_l2_messages.ts +5 -13
- package/src/messaging/inbox_bucket.ts +125 -0
- package/src/messaging/inbox_consumption.ts +74 -0
- package/src/messaging/inbox_rolling_hash.ts +24 -0
- package/src/messaging/index.ts +5 -2
- package/src/messaging/l1_to_l2_message_bundle.ts +65 -0
- package/src/messaging/l1_to_l2_message_source.ts +48 -10
- package/src/messaging/l1_to_l2_message_sponge.ts +69 -0
- package/src/noir/index.ts +1 -2
- package/src/p2p/block_proposal.ts +41 -28
- package/src/p2p/checkpoint_proposal.ts +31 -6
- package/src/p2p/index.ts +1 -0
- package/src/p2p/validated_proposal.ts +43 -0
- package/src/p2p/wire_compat_fixtures.ts +23 -0
- package/src/parity/inbox_parity_private_inputs.ts +116 -0
- package/src/parity/index.ts +1 -2
- package/src/parity/parity_public_inputs.ts +12 -14
- package/src/proofs/proving_request_type.ts +2 -5
- package/src/rollup/block_constant_data.ts +4 -4
- package/src/rollup/block_rollup_public_inputs.ts +14 -5
- package/src/rollup/block_root_rollup_private_inputs.ts +117 -153
- package/src/rollup/checkpoint_header.ts +17 -13
- package/src/rollup/checkpoint_rollup_public_inputs.ts +15 -0
- package/src/rollup/checkpoint_root_rollup_private_inputs.ts +16 -3
- package/src/rollup/root_rollup_public_inputs.ts +10 -0
- package/src/stats/stats.ts +4 -5
- package/src/tests/factories.ts +38 -32
- package/src/tests/fixtures.ts +3 -0
- package/src/tests/mocks.ts +6 -7
- package/src/tx/state_reference.ts +5 -12
- package/dest/messaging/in_hash.d.ts +0 -6
- package/dest/messaging/in_hash.d.ts.map +0 -1
- package/dest/messaging/in_hash.js +0 -10
- package/dest/messaging/inbox_leaf.d.ts +0 -25
- package/dest/messaging/inbox_leaf.d.ts.map +0 -1
- package/dest/messaging/inbox_leaf.js +0 -42
- package/dest/parity/parity_base_private_inputs.d.ts +0 -39
- package/dest/parity/parity_base_private_inputs.d.ts.map +0 -1
- package/dest/parity/parity_base_private_inputs.js +0 -51
- package/dest/parity/parity_root_private_inputs.d.ts +0 -39
- package/dest/parity/parity_root_private_inputs.d.ts.map +0 -1
- package/dest/parity/parity_root_private_inputs.js +0 -46
- package/src/messaging/in_hash.ts +0 -12
- package/src/messaging/inbox_leaf.ts +0 -44
- package/src/parity/parity_base_private_inputs.ts +0 -71
- package/src/parity/parity_root_private_inputs.ts +0 -64
|
@@ -4,6 +4,7 @@ import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
|
4
4
|
import { BufferReader, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
5
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
6
|
|
|
7
|
+
import { L1ToL2MessageSponge } from '../messaging/l1_to_l2_message_sponge.js';
|
|
7
8
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
8
9
|
import { StateReference } from '../tx/state_reference.js';
|
|
9
10
|
import type { UInt64 } from '../types/shared.js';
|
|
@@ -53,9 +54,14 @@ export class BlockRollupPublicInputs {
|
|
|
53
54
|
*/
|
|
54
55
|
public blockHeadersHash: Fr,
|
|
55
56
|
/**
|
|
56
|
-
*
|
|
57
|
+
* Message-bundle sponge threaded across the checkpoint's blocks, before this block range absorbs its bundle.
|
|
57
58
|
*/
|
|
58
|
-
public
|
|
59
|
+
public startMsgSponge: L1ToL2MessageSponge,
|
|
60
|
+
/**
|
|
61
|
+
* Message-bundle sponge after this block range absorbs its bundle. The checkpoint root asserts the final value
|
|
62
|
+
* matches the parity root's sponge over the same (padded) message list.
|
|
63
|
+
*/
|
|
64
|
+
public endMsgSponge: L1ToL2MessageSponge,
|
|
59
65
|
/**
|
|
60
66
|
* SHA256 hash of L2 to L1 messages created in this block range.
|
|
61
67
|
*/
|
|
@@ -82,7 +88,8 @@ export class BlockRollupPublicInputs {
|
|
|
82
88
|
reader.readObject(SpongeBlob),
|
|
83
89
|
reader.readUInt64(),
|
|
84
90
|
Fr.fromBuffer(reader),
|
|
85
|
-
|
|
91
|
+
reader.readObject(L1ToL2MessageSponge),
|
|
92
|
+
reader.readObject(L1ToL2MessageSponge),
|
|
86
93
|
Fr.fromBuffer(reader),
|
|
87
94
|
Fr.fromBuffer(reader),
|
|
88
95
|
Fr.fromBuffer(reader),
|
|
@@ -100,7 +107,8 @@ export class BlockRollupPublicInputs {
|
|
|
100
107
|
this.endSpongeBlob,
|
|
101
108
|
bigintToUInt64BE(this.timestamp),
|
|
102
109
|
this.blockHeadersHash,
|
|
103
|
-
this.
|
|
110
|
+
this.startMsgSponge,
|
|
111
|
+
this.endMsgSponge,
|
|
104
112
|
this.outHash,
|
|
105
113
|
this.accumulatedFees,
|
|
106
114
|
this.accumulatedManaUsed,
|
|
@@ -124,7 +132,8 @@ export class BlockRollupPublicInputs {
|
|
|
124
132
|
previousArchiveRoot: this.previousArchive.root.toString(),
|
|
125
133
|
newArchiveRoot: this.newArchive.root.toString(),
|
|
126
134
|
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
127
|
-
|
|
135
|
+
startMsgSpongeNumAbsorbed: this.startMsgSponge.numAbsorbed,
|
|
136
|
+
endMsgSpongeNumAbsorbed: this.endMsgSponge.numAbsorbed,
|
|
128
137
|
outHash: this.outHash.toString(),
|
|
129
138
|
timestamp: this.timestamp.toString(),
|
|
130
139
|
accumulatedFees: this.accumulatedFees.toString(),
|
|
@@ -1,149 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { SpongeBlob } from '@aztec/blob-lib/types';
|
|
2
|
+
import { ARCHIVE_HEIGHT, L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
|
|
2
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
4
|
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
5
|
import { BufferReader, type Tuple, bigintToUInt64BE, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
6
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { L1ToL2MessageBundle } from '../messaging/l1_to_l2_message_bundle.js';
|
|
9
|
+
import { L1ToL2MessageSponge } from '../messaging/l1_to_l2_message_sponge.js';
|
|
10
|
+
import { ProofData, type RollupHonkProofData } from '../proofs/proof_data.js';
|
|
9
11
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
10
12
|
import { StateReference } from '../tx/state_reference.js';
|
|
11
13
|
import type { UInt64 } from '../types/shared.js';
|
|
12
14
|
import { CheckpointConstantData } from './checkpoint_constant_data.js';
|
|
13
15
|
import { TxRollupPublicInputs } from './tx_rollup_public_inputs.js';
|
|
14
16
|
|
|
15
|
-
export class
|
|
17
|
+
export class BlockRootNoTxsRollupPrivateInputs {
|
|
16
18
|
constructor(
|
|
17
|
-
/**
|
|
18
|
-
* The original and converted roots of the L1 to L2 messages subtrees.
|
|
19
|
-
*/
|
|
20
|
-
public l1ToL2Roots: UltraHonkProofData<ParityPublicInputs>,
|
|
21
|
-
/**
|
|
22
|
-
* The previous rollup proof data from base or merge rollup circuits.
|
|
23
|
-
*/
|
|
24
|
-
public previousRollups: [RollupHonkProofData<TxRollupPublicInputs>, RollupHonkProofData<TxRollupPublicInputs>],
|
|
25
|
-
/**
|
|
26
|
-
* The l1 to l2 message tree snapshot immediately before this block.
|
|
27
|
-
*/
|
|
28
|
-
public previousL1ToL2: AppendOnlyTreeSnapshot,
|
|
29
|
-
/**
|
|
30
|
-
* Hint for inserting the new l1 to l2 message subtree root into `previousL1ToL2`.
|
|
31
|
-
*/
|
|
32
|
-
public newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>,
|
|
33
|
-
/**
|
|
34
|
-
* Hint for inserting the new block hash to the last archive.
|
|
35
|
-
*/
|
|
36
|
-
public newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
37
|
-
) {}
|
|
38
|
-
|
|
39
|
-
static from(fields: FieldsOf<BlockRootFirstRollupPrivateInputs>) {
|
|
40
|
-
return new BlockRootFirstRollupPrivateInputs(...BlockRootFirstRollupPrivateInputs.getFields(fields));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
static getFields(fields: FieldsOf<BlockRootFirstRollupPrivateInputs>) {
|
|
44
|
-
return [
|
|
45
|
-
fields.l1ToL2Roots,
|
|
46
|
-
fields.previousRollups,
|
|
47
|
-
fields.previousL1ToL2,
|
|
48
|
-
fields.newL1ToL2MessageSubtreeRootSiblingPath,
|
|
49
|
-
fields.newArchiveSiblingPath,
|
|
50
|
-
] as const;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
toBuffer() {
|
|
54
|
-
return serializeToBuffer(...BlockRootFirstRollupPrivateInputs.getFields(this));
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
58
|
-
const reader = BufferReader.asReader(buffer);
|
|
59
|
-
return new BlockRootFirstRollupPrivateInputs(
|
|
60
|
-
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
61
|
-
[ProofData.fromBuffer(reader, TxRollupPublicInputs), ProofData.fromBuffer(reader, TxRollupPublicInputs)],
|
|
62
|
-
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
63
|
-
reader.readArray(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
64
|
-
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
toJSON() {
|
|
69
|
-
return this.toBuffer();
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
static get schema() {
|
|
73
|
-
return bufferSchemaFor(BlockRootFirstRollupPrivateInputs);
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export class BlockRootSingleTxFirstRollupPrivateInputs {
|
|
78
|
-
constructor(
|
|
79
|
-
/**
|
|
80
|
-
* The original and converted roots of the L1 to L2 messages subtrees.
|
|
81
|
-
*/
|
|
82
|
-
public l1ToL2Roots: UltraHonkProofData<ParityPublicInputs>,
|
|
83
|
-
/**
|
|
84
|
-
* The previous rollup proof data from base or merge rollup circuits.
|
|
85
|
-
*/
|
|
86
|
-
public previousRollup: RollupHonkProofData<TxRollupPublicInputs>,
|
|
87
|
-
/**
|
|
88
|
-
* The l1 to l2 message tree snapshot immediately before this block.
|
|
89
|
-
*/
|
|
90
|
-
public previousL1ToL2: AppendOnlyTreeSnapshot,
|
|
91
|
-
/**
|
|
92
|
-
* Hint for inserting the new l1 to l2 message subtree root.
|
|
93
|
-
*/
|
|
94
|
-
public newL1ToL2MessageSubtreeRootSiblingPath: Tuple<Fr, typeof L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH>,
|
|
95
|
-
/**
|
|
96
|
-
* Hint for inserting the new block hash to the last archive.
|
|
97
|
-
*/
|
|
98
|
-
public newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
99
|
-
) {}
|
|
100
|
-
|
|
101
|
-
static from(fields: FieldsOf<BlockRootSingleTxFirstRollupPrivateInputs>) {
|
|
102
|
-
return new BlockRootSingleTxFirstRollupPrivateInputs(
|
|
103
|
-
...BlockRootSingleTxFirstRollupPrivateInputs.getFields(fields),
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
static getFields(fields: FieldsOf<BlockRootSingleTxFirstRollupPrivateInputs>) {
|
|
108
|
-
return [
|
|
109
|
-
fields.l1ToL2Roots,
|
|
110
|
-
fields.previousRollup,
|
|
111
|
-
fields.previousL1ToL2,
|
|
112
|
-
fields.newL1ToL2MessageSubtreeRootSiblingPath,
|
|
113
|
-
fields.newArchiveSiblingPath,
|
|
114
|
-
] as const;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
toBuffer() {
|
|
118
|
-
return serializeToBuffer(...BlockRootSingleTxFirstRollupPrivateInputs.getFields(this));
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
122
|
-
const reader = BufferReader.asReader(buffer);
|
|
123
|
-
return new BlockRootSingleTxFirstRollupPrivateInputs(
|
|
124
|
-
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
125
|
-
ProofData.fromBuffer(reader, TxRollupPublicInputs),
|
|
126
|
-
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
127
|
-
reader.readArray(L1_TO_L2_MSG_SUBTREE_ROOT_SIBLING_PATH_LENGTH, Fr),
|
|
128
|
-
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
toJSON() {
|
|
133
|
-
return this.toBuffer();
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
static get schema() {
|
|
137
|
-
return bufferSchemaFor(BlockRootSingleTxFirstRollupPrivateInputs);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
142
|
-
constructor(
|
|
143
|
-
/**
|
|
144
|
-
* The original and converted roots of the L1 to L2 messages subtrees.
|
|
145
|
-
*/
|
|
146
|
-
public l1ToL2Roots: UltraHonkProofData<ParityPublicInputs>,
|
|
147
19
|
/**
|
|
148
20
|
* The archive after applying the previous block.
|
|
149
21
|
*/
|
|
@@ -161,52 +33,72 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
161
33
|
*/
|
|
162
34
|
public timestamp: UInt64,
|
|
163
35
|
/**
|
|
164
|
-
*
|
|
36
|
+
* Sponge blob this block starts from: initialized for the checkpoint's first block, inherited from the previous
|
|
37
|
+
* block otherwise (checked against `SpongeBlob.init()` or the previous block's `endSpongeBlob` respectively).
|
|
38
|
+
*/
|
|
39
|
+
public startSpongeBlob: SpongeBlob,
|
|
40
|
+
/**
|
|
41
|
+
* Message sponge this block starts from: empty for the checkpoint's first block, inherited from the previous block
|
|
42
|
+
* otherwise (checked against the empty sponge or the previous block's `endMsgSponge` respectively).
|
|
43
|
+
*/
|
|
44
|
+
public startMsgSponge: L1ToL2MessageSponge,
|
|
45
|
+
/**
|
|
46
|
+
* L1-to-L2 message bundle inserted by this block.
|
|
47
|
+
*/
|
|
48
|
+
public messageBundle: L1ToL2MessageBundle,
|
|
49
|
+
/**
|
|
50
|
+
* Frontier hint for appending the message bundle to the previous state's l1 to l2 message tree.
|
|
165
51
|
*/
|
|
166
|
-
public
|
|
52
|
+
public l1ToL2MessageFrontierHint: Tuple<Fr, typeof L1_TO_L2_MSG_TREE_HEIGHT>,
|
|
167
53
|
/**
|
|
168
54
|
* Hint for inserting the new block hash to the last archive.
|
|
169
55
|
*/
|
|
170
56
|
public newArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>,
|
|
171
57
|
) {}
|
|
172
58
|
|
|
173
|
-
static from(fields: FieldsOf<
|
|
174
|
-
return new
|
|
59
|
+
static from(fields: FieldsOf<BlockRootNoTxsRollupPrivateInputs>) {
|
|
60
|
+
return new BlockRootNoTxsRollupPrivateInputs(...BlockRootNoTxsRollupPrivateInputs.getFields(fields));
|
|
175
61
|
}
|
|
176
62
|
|
|
177
|
-
static getFields(fields: FieldsOf<
|
|
63
|
+
static getFields(fields: FieldsOf<BlockRootNoTxsRollupPrivateInputs>) {
|
|
178
64
|
return [
|
|
179
|
-
fields.l1ToL2Roots,
|
|
180
65
|
fields.previousArchive,
|
|
181
66
|
fields.previousState,
|
|
182
67
|
fields.constants,
|
|
183
68
|
fields.timestamp,
|
|
184
|
-
fields.
|
|
69
|
+
fields.startSpongeBlob,
|
|
70
|
+
fields.startMsgSponge,
|
|
71
|
+
fields.messageBundle,
|
|
72
|
+
fields.l1ToL2MessageFrontierHint,
|
|
185
73
|
fields.newArchiveSiblingPath,
|
|
186
74
|
] as const;
|
|
187
75
|
}
|
|
188
76
|
|
|
189
77
|
toBuffer() {
|
|
190
|
-
return serializeToBuffer(
|
|
191
|
-
this.l1ToL2Roots,
|
|
78
|
+
return serializeToBuffer(
|
|
192
79
|
this.previousArchive,
|
|
193
80
|
this.previousState,
|
|
194
81
|
this.constants,
|
|
195
82
|
bigintToUInt64BE(this.timestamp),
|
|
196
|
-
this.
|
|
83
|
+
this.startSpongeBlob,
|
|
84
|
+
this.startMsgSponge,
|
|
85
|
+
this.messageBundle,
|
|
86
|
+
this.l1ToL2MessageFrontierHint,
|
|
197
87
|
this.newArchiveSiblingPath,
|
|
198
|
-
|
|
88
|
+
);
|
|
199
89
|
}
|
|
200
90
|
|
|
201
91
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
202
92
|
const reader = BufferReader.asReader(buffer);
|
|
203
|
-
return new
|
|
204
|
-
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
93
|
+
return new BlockRootNoTxsRollupPrivateInputs(
|
|
205
94
|
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
206
95
|
StateReference.fromBuffer(reader),
|
|
207
96
|
CheckpointConstantData.fromBuffer(reader),
|
|
208
97
|
reader.readUInt64(),
|
|
209
|
-
reader.
|
|
98
|
+
reader.readObject(SpongeBlob),
|
|
99
|
+
reader.readObject(L1ToL2MessageSponge),
|
|
100
|
+
reader.readObject(L1ToL2MessageBundle),
|
|
101
|
+
reader.readArray(L1_TO_L2_MSG_TREE_HEIGHT, Fr),
|
|
210
102
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
211
103
|
);
|
|
212
104
|
}
|
|
@@ -216,7 +108,7 @@ export class BlockRootEmptyTxFirstRollupPrivateInputs {
|
|
|
216
108
|
}
|
|
217
109
|
|
|
218
110
|
static get schema() {
|
|
219
|
-
return bufferSchemaFor(
|
|
111
|
+
return bufferSchemaFor(BlockRootNoTxsRollupPrivateInputs);
|
|
220
112
|
}
|
|
221
113
|
}
|
|
222
114
|
|
|
@@ -226,6 +118,24 @@ export class BlockRootRollupPrivateInputs {
|
|
|
226
118
|
* The previous rollup proof data from base or merge rollup circuits.
|
|
227
119
|
*/
|
|
228
120
|
public previousRollups: [RollupHonkProofData<TxRollupPublicInputs>, RollupHonkProofData<TxRollupPublicInputs>],
|
|
121
|
+
/**
|
|
122
|
+
* L1-to-L2 message bundle inserted by this block.
|
|
123
|
+
*/
|
|
124
|
+
public messageBundle: L1ToL2MessageBundle,
|
|
125
|
+
/**
|
|
126
|
+
* The l1 to l2 message tree snapshot this block builds on (the previous block's post-insertion snapshot). Pinned by
|
|
127
|
+
* block-merge continuity to the previous block's end state; the circuit appends this block's bundle on top and
|
|
128
|
+
* asserts the tx constants carry the resulting post-bundle snapshot.
|
|
129
|
+
*/
|
|
130
|
+
public previousL1ToL2: AppendOnlyTreeSnapshot,
|
|
131
|
+
/**
|
|
132
|
+
* Message sponge inherited from the previous block (checked against its `endMsgSponge` in the merge/checkpoint root).
|
|
133
|
+
*/
|
|
134
|
+
public startMsgSponge: L1ToL2MessageSponge,
|
|
135
|
+
/**
|
|
136
|
+
* Frontier hint for appending the message bundle to `previousL1ToL2`.
|
|
137
|
+
*/
|
|
138
|
+
public l1ToL2MessageFrontierHint: Tuple<Fr, typeof L1_TO_L2_MSG_TREE_HEIGHT>,
|
|
229
139
|
/**
|
|
230
140
|
* Hint for inserting the new block hash to the last archive.
|
|
231
141
|
*/
|
|
@@ -237,17 +147,35 @@ export class BlockRootRollupPrivateInputs {
|
|
|
237
147
|
}
|
|
238
148
|
|
|
239
149
|
static getFields(fields: FieldsOf<BlockRootRollupPrivateInputs>) {
|
|
240
|
-
return [
|
|
150
|
+
return [
|
|
151
|
+
fields.previousRollups,
|
|
152
|
+
fields.messageBundle,
|
|
153
|
+
fields.previousL1ToL2,
|
|
154
|
+
fields.startMsgSponge,
|
|
155
|
+
fields.l1ToL2MessageFrontierHint,
|
|
156
|
+
fields.newArchiveSiblingPath,
|
|
157
|
+
] as const;
|
|
241
158
|
}
|
|
242
159
|
|
|
243
160
|
toBuffer() {
|
|
244
|
-
return serializeToBuffer(
|
|
161
|
+
return serializeToBuffer(
|
|
162
|
+
this.previousRollups,
|
|
163
|
+
this.messageBundle,
|
|
164
|
+
this.previousL1ToL2,
|
|
165
|
+
this.startMsgSponge,
|
|
166
|
+
this.l1ToL2MessageFrontierHint,
|
|
167
|
+
this.newArchiveSiblingPath,
|
|
168
|
+
);
|
|
245
169
|
}
|
|
246
170
|
|
|
247
171
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
248
172
|
const reader = BufferReader.asReader(buffer);
|
|
249
173
|
return new BlockRootRollupPrivateInputs(
|
|
250
174
|
[ProofData.fromBuffer(reader, TxRollupPublicInputs), ProofData.fromBuffer(reader, TxRollupPublicInputs)],
|
|
175
|
+
reader.readObject(L1ToL2MessageBundle),
|
|
176
|
+
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
177
|
+
reader.readObject(L1ToL2MessageSponge),
|
|
178
|
+
reader.readArray(L1_TO_L2_MSG_TREE_HEIGHT, Fr),
|
|
251
179
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
252
180
|
);
|
|
253
181
|
}
|
|
@@ -267,6 +195,24 @@ export class BlockRootSingleTxRollupPrivateInputs {
|
|
|
267
195
|
* The previous rollup proof data from base or merge rollup circuits.
|
|
268
196
|
*/
|
|
269
197
|
public previousRollup: RollupHonkProofData<TxRollupPublicInputs>,
|
|
198
|
+
/**
|
|
199
|
+
* L1-to-L2 message bundle inserted by this block.
|
|
200
|
+
*/
|
|
201
|
+
public messageBundle: L1ToL2MessageBundle,
|
|
202
|
+
/**
|
|
203
|
+
* The l1 to l2 message tree snapshot this block builds on (the previous block's post-insertion snapshot). Pinned by
|
|
204
|
+
* block-merge continuity to the previous block's end state; the circuit appends this block's bundle on top and
|
|
205
|
+
* asserts the tx constants carry the resulting post-bundle snapshot.
|
|
206
|
+
*/
|
|
207
|
+
public previousL1ToL2: AppendOnlyTreeSnapshot,
|
|
208
|
+
/**
|
|
209
|
+
* Message sponge inherited from the previous block (checked against its `endMsgSponge` in the merge/checkpoint root).
|
|
210
|
+
*/
|
|
211
|
+
public startMsgSponge: L1ToL2MessageSponge,
|
|
212
|
+
/**
|
|
213
|
+
* Frontier hint for appending the message bundle to `previousL1ToL2`.
|
|
214
|
+
*/
|
|
215
|
+
public l1ToL2MessageFrontierHint: Tuple<Fr, typeof L1_TO_L2_MSG_TREE_HEIGHT>,
|
|
270
216
|
/**
|
|
271
217
|
* Hint for inserting the new block hash to the last archive.
|
|
272
218
|
*/
|
|
@@ -278,17 +224,35 @@ export class BlockRootSingleTxRollupPrivateInputs {
|
|
|
278
224
|
}
|
|
279
225
|
|
|
280
226
|
static getFields(fields: FieldsOf<BlockRootSingleTxRollupPrivateInputs>) {
|
|
281
|
-
return [
|
|
227
|
+
return [
|
|
228
|
+
fields.previousRollup,
|
|
229
|
+
fields.messageBundle,
|
|
230
|
+
fields.previousL1ToL2,
|
|
231
|
+
fields.startMsgSponge,
|
|
232
|
+
fields.l1ToL2MessageFrontierHint,
|
|
233
|
+
fields.newArchiveSiblingPath,
|
|
234
|
+
] as const;
|
|
282
235
|
}
|
|
283
236
|
|
|
284
237
|
toBuffer() {
|
|
285
|
-
return serializeToBuffer(
|
|
238
|
+
return serializeToBuffer(
|
|
239
|
+
this.previousRollup,
|
|
240
|
+
this.messageBundle,
|
|
241
|
+
this.previousL1ToL2,
|
|
242
|
+
this.startMsgSponge,
|
|
243
|
+
this.l1ToL2MessageFrontierHint,
|
|
244
|
+
this.newArchiveSiblingPath,
|
|
245
|
+
);
|
|
286
246
|
}
|
|
287
247
|
|
|
288
248
|
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
289
249
|
const reader = BufferReader.asReader(buffer);
|
|
290
250
|
return new BlockRootSingleTxRollupPrivateInputs(
|
|
291
251
|
ProofData.fromBuffer(reader, TxRollupPublicInputs),
|
|
252
|
+
reader.readObject(L1ToL2MessageBundle),
|
|
253
|
+
AppendOnlyTreeSnapshot.fromBuffer(reader),
|
|
254
|
+
reader.readObject(L1ToL2MessageSponge),
|
|
255
|
+
reader.readArray(L1_TO_L2_MSG_TREE_HEIGHT, Fr),
|
|
292
256
|
reader.readArray(ARCHIVE_HEIGHT, Fr),
|
|
293
257
|
);
|
|
294
258
|
}
|
|
@@ -30,8 +30,12 @@ export class CheckpointHeader {
|
|
|
30
30
|
public blockHeadersHash: Fr,
|
|
31
31
|
/** Hash of the blobs in the checkpoint. */
|
|
32
32
|
public blobsHash: Fr,
|
|
33
|
-
/**
|
|
34
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Inbox rolling-hash chain value after consuming all L1-to-L2 messages bundled into this checkpoint:
|
|
35
|
+
* the truncated-to-field sha256 chain the L1 Inbox accumulates. This is the checkpoint's only inbox
|
|
36
|
+
* commitment.
|
|
37
|
+
*/
|
|
38
|
+
public inboxRollingHash: Fr,
|
|
35
39
|
/**
|
|
36
40
|
* The root of the epoch out hash balanced tree. The out hash of the first checkpoint in the epoch is inserted at
|
|
37
41
|
* index 0, the second at index 1, and so on.
|
|
@@ -62,7 +66,7 @@ export class CheckpointHeader {
|
|
|
62
66
|
lastArchiveRoot: schemas.Fr,
|
|
63
67
|
blockHeadersHash: schemas.Fr,
|
|
64
68
|
blobsHash: schemas.Fr,
|
|
65
|
-
|
|
69
|
+
inboxRollingHash: schemas.Fr,
|
|
66
70
|
epochOutHash: schemas.Fr,
|
|
67
71
|
slotNumber: schemas.SlotNumber,
|
|
68
72
|
timestamp: schemas.BigInt,
|
|
@@ -80,7 +84,7 @@ export class CheckpointHeader {
|
|
|
80
84
|
fields.lastArchiveRoot,
|
|
81
85
|
fields.blockHeadersHash,
|
|
82
86
|
fields.blobsHash,
|
|
83
|
-
fields.
|
|
87
|
+
fields.inboxRollingHash,
|
|
84
88
|
fields.epochOutHash,
|
|
85
89
|
fields.slotNumber,
|
|
86
90
|
fields.timestamp,
|
|
@@ -120,7 +124,7 @@ export class CheckpointHeader {
|
|
|
120
124
|
this.lastArchiveRoot.equals(other.lastArchiveRoot) &&
|
|
121
125
|
this.blockHeadersHash.equals(other.blockHeadersHash) &&
|
|
122
126
|
this.blobsHash.equals(other.blobsHash) &&
|
|
123
|
-
this.
|
|
127
|
+
this.inboxRollingHash.equals(other.inboxRollingHash) &&
|
|
124
128
|
this.epochOutHash.equals(other.epochOutHash) &&
|
|
125
129
|
this.slotNumber === other.slotNumber &&
|
|
126
130
|
this.timestamp === other.timestamp &&
|
|
@@ -149,7 +153,7 @@ export class CheckpointHeader {
|
|
|
149
153
|
this.lastArchiveRoot,
|
|
150
154
|
this.blockHeadersHash,
|
|
151
155
|
this.blobsHash,
|
|
152
|
-
this.
|
|
156
|
+
this.inboxRollingHash,
|
|
153
157
|
this.epochOutHash,
|
|
154
158
|
new Fr(this.slotNumber),
|
|
155
159
|
bigintToUInt64BE(this.timestamp),
|
|
@@ -170,7 +174,7 @@ export class CheckpointHeader {
|
|
|
170
174
|
lastArchiveRoot: Fr.ZERO,
|
|
171
175
|
blockHeadersHash: Fr.ZERO,
|
|
172
176
|
blobsHash: Fr.ZERO,
|
|
173
|
-
|
|
177
|
+
inboxRollingHash: Fr.ZERO,
|
|
174
178
|
epochOutHash: Fr.ZERO,
|
|
175
179
|
slotNumber: SlotNumber.ZERO,
|
|
176
180
|
timestamp: 0n,
|
|
@@ -188,7 +192,7 @@ export class CheckpointHeader {
|
|
|
188
192
|
lastArchiveRoot: Fr.random(),
|
|
189
193
|
blockHeadersHash: Fr.random(),
|
|
190
194
|
blobsHash: Fr.random(),
|
|
191
|
-
|
|
195
|
+
inboxRollingHash: Fr.random(),
|
|
192
196
|
epochOutHash: Fr.random(),
|
|
193
197
|
slotNumber: SlotNumber(Math.floor(Math.random() * 1000) + 1),
|
|
194
198
|
timestamp: BigInt(Math.floor(Date.now() / 1000)),
|
|
@@ -206,7 +210,7 @@ export class CheckpointHeader {
|
|
|
206
210
|
this.lastArchiveRoot.isZero() &&
|
|
207
211
|
this.blockHeadersHash.isZero() &&
|
|
208
212
|
this.blobsHash.isZero() &&
|
|
209
|
-
this.
|
|
213
|
+
this.inboxRollingHash.isZero() &&
|
|
210
214
|
this.epochOutHash.isZero() &&
|
|
211
215
|
this.slotNumber === 0 &&
|
|
212
216
|
this.timestamp === 0n &&
|
|
@@ -235,7 +239,7 @@ export class CheckpointHeader {
|
|
|
235
239
|
Fr.fromString(header.lastArchiveRoot),
|
|
236
240
|
Fr.fromString(header.blockHeadersHash),
|
|
237
241
|
Fr.fromString(header.blobsHash),
|
|
238
|
-
Fr.fromString(header.
|
|
242
|
+
Fr.fromString(header.inboxRollingHash),
|
|
239
243
|
Fr.fromString(header.outHash),
|
|
240
244
|
SlotNumber.fromBigInt(header.slotNumber),
|
|
241
245
|
header.timestamp,
|
|
@@ -260,7 +264,7 @@ export class CheckpointHeader {
|
|
|
260
264
|
lastArchiveRoot: this.lastArchiveRoot.toString(),
|
|
261
265
|
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
262
266
|
blobsHash: this.blobsHash.toString(),
|
|
263
|
-
|
|
267
|
+
inboxRollingHash: this.inboxRollingHash.toString(),
|
|
264
268
|
outHash: this.epochOutHash.toString(),
|
|
265
269
|
slotNumber: BigInt(this.slotNumber),
|
|
266
270
|
timestamp: this.timestamp,
|
|
@@ -280,7 +284,7 @@ export class CheckpointHeader {
|
|
|
280
284
|
lastArchive: this.lastArchiveRoot.toString(),
|
|
281
285
|
blockHeadersHash: this.blockHeadersHash.toString(),
|
|
282
286
|
blobsHash: this.blobsHash.toString(),
|
|
283
|
-
|
|
287
|
+
inboxRollingHash: this.inboxRollingHash.toString(),
|
|
284
288
|
epochOutHash: this.epochOutHash.toString(),
|
|
285
289
|
slotNumber: this.slotNumber,
|
|
286
290
|
timestamp: this.timestamp,
|
|
@@ -297,7 +301,7 @@ export class CheckpointHeader {
|
|
|
297
301
|
lastArchiveRoot: ${this.lastArchiveRoot.toString()},
|
|
298
302
|
blockHeadersHash: ${this.blockHeadersHash.toString()},
|
|
299
303
|
blobsHash: ${inspect(this.blobsHash)},
|
|
300
|
-
|
|
304
|
+
inboxRollingHash: ${inspect(this.inboxRollingHash)},
|
|
301
305
|
epochOutHash: ${inspect(this.epochOutHash)},
|
|
302
306
|
slotNumber: ${this.slotNumber},
|
|
303
307
|
timestamp: ${this.timestamp},
|
|
@@ -35,6 +35,15 @@ export class CheckpointRollupPublicInputs {
|
|
|
35
35
|
* The out hash tree snapshot after applying this checkpoint range.
|
|
36
36
|
*/
|
|
37
37
|
public newOutHash: AppendOnlyTreeSnapshot,
|
|
38
|
+
/**
|
|
39
|
+
* Inbox rolling hash before consuming this checkpoint range's messages.
|
|
40
|
+
*/
|
|
41
|
+
public startInboxRollingHash: Fr,
|
|
42
|
+
/**
|
|
43
|
+
* Inbox rolling hash after consuming this checkpoint range's messages (the end value lands in the checkpoint
|
|
44
|
+
* header). Checkpoint merges assert `right.start == left.end` for chain continuity.
|
|
45
|
+
*/
|
|
46
|
+
public endInboxRollingHash: Fr,
|
|
38
47
|
/**
|
|
39
48
|
* The hashes of the headers of the constituent checkpoints.
|
|
40
49
|
*/
|
|
@@ -65,6 +74,8 @@ export class CheckpointRollupPublicInputs {
|
|
|
65
74
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
66
75
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
67
76
|
reader.readObject(AppendOnlyTreeSnapshot),
|
|
77
|
+
Fr.fromBuffer(reader),
|
|
78
|
+
Fr.fromBuffer(reader),
|
|
68
79
|
reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, Fr),
|
|
69
80
|
reader.readArray(MAX_CHECKPOINTS_PER_EPOCH, FeeRecipient),
|
|
70
81
|
reader.readObject(BlobAccumulator),
|
|
@@ -80,6 +91,8 @@ export class CheckpointRollupPublicInputs {
|
|
|
80
91
|
this.newArchive,
|
|
81
92
|
this.previousOutHash,
|
|
82
93
|
this.newOutHash,
|
|
94
|
+
this.startInboxRollingHash,
|
|
95
|
+
this.endInboxRollingHash,
|
|
83
96
|
this.checkpointHeaderHashes,
|
|
84
97
|
this.fees,
|
|
85
98
|
this.startBlobAccumulator,
|
|
@@ -108,6 +121,8 @@ export class CheckpointRollupPublicInputs {
|
|
|
108
121
|
newArchiveRoot: this.newArchive.root.toString(),
|
|
109
122
|
previousOutHashRoot: this.previousOutHash.root.toString(),
|
|
110
123
|
newOutHashRoot: this.newOutHash.root.toString(),
|
|
124
|
+
startInboxRollingHash: this.startInboxRollingHash.toString(),
|
|
125
|
+
endInboxRollingHash: this.endInboxRollingHash.toString(),
|
|
111
126
|
};
|
|
112
127
|
}
|
|
113
128
|
|
|
@@ -7,7 +7,8 @@ import { BufferReader, type Tuple, serializeToBuffer } from '@aztec/foundation/s
|
|
|
7
7
|
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
8
8
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { ParityPublicInputs } from '../parity/parity_public_inputs.js';
|
|
11
|
+
import { ProofData, type RollupHonkProofData, type UltraHonkProofData } from '../proofs/proof_data.js';
|
|
11
12
|
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
12
13
|
import { BlockHeader } from '../tx/block_header.js';
|
|
13
14
|
import { BlockRollupPublicInputs } from './block_rollup_public_inputs.js';
|
|
@@ -117,6 +118,11 @@ export class CheckpointRootRollupPrivateInputs {
|
|
|
117
118
|
RollupHonkProofData<BlockRollupPublicInputs>,
|
|
118
119
|
RollupHonkProofData<BlockRollupPublicInputs>,
|
|
119
120
|
],
|
|
121
|
+
/**
|
|
122
|
+
* Inbox parity proof over the checkpoint's L1-to-L2 messages: it commits to the checkpoint's
|
|
123
|
+
* message list, and its message sponge is checked against the blocks' accumulated one.
|
|
124
|
+
*/
|
|
125
|
+
public inboxParity: UltraHonkProofData<ParityPublicInputs>,
|
|
120
126
|
public hints: CheckpointRootRollupHints,
|
|
121
127
|
) {}
|
|
122
128
|
|
|
@@ -125,7 +131,7 @@ export class CheckpointRootRollupPrivateInputs {
|
|
|
125
131
|
}
|
|
126
132
|
|
|
127
133
|
static getFields(fields: FieldsOf<CheckpointRootRollupPrivateInputs>) {
|
|
128
|
-
return [fields.previousRollups, fields.hints] as const;
|
|
134
|
+
return [fields.previousRollups, fields.inboxParity, fields.hints] as const;
|
|
129
135
|
}
|
|
130
136
|
|
|
131
137
|
toBuffer() {
|
|
@@ -136,6 +142,7 @@ export class CheckpointRootRollupPrivateInputs {
|
|
|
136
142
|
const reader = BufferReader.asReader(buffer);
|
|
137
143
|
return new CheckpointRootRollupPrivateInputs(
|
|
138
144
|
[ProofData.fromBuffer(reader, BlockRollupPublicInputs), ProofData.fromBuffer(reader, BlockRollupPublicInputs)],
|
|
145
|
+
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
139
146
|
CheckpointRootRollupHints.fromBuffer(reader),
|
|
140
147
|
);
|
|
141
148
|
}
|
|
@@ -160,6 +167,11 @@ export class CheckpointRootRollupPrivateInputs {
|
|
|
160
167
|
export class CheckpointRootSingleBlockRollupPrivateInputs {
|
|
161
168
|
constructor(
|
|
162
169
|
public previousRollup: RollupHonkProofData<BlockRollupPublicInputs>,
|
|
170
|
+
/**
|
|
171
|
+
* Inbox parity proof over the checkpoint's L1-to-L2 messages: it commits to the checkpoint's
|
|
172
|
+
* message list, and its message sponge is checked against the block's accumulated one.
|
|
173
|
+
*/
|
|
174
|
+
public inboxParity: UltraHonkProofData<ParityPublicInputs>,
|
|
163
175
|
public hints: CheckpointRootRollupHints,
|
|
164
176
|
) {}
|
|
165
177
|
|
|
@@ -170,7 +182,7 @@ export class CheckpointRootSingleBlockRollupPrivateInputs {
|
|
|
170
182
|
}
|
|
171
183
|
|
|
172
184
|
static getFields(fields: FieldsOf<CheckpointRootSingleBlockRollupPrivateInputs>) {
|
|
173
|
-
return [fields.previousRollup, fields.hints] as const;
|
|
185
|
+
return [fields.previousRollup, fields.inboxParity, fields.hints] as const;
|
|
174
186
|
}
|
|
175
187
|
|
|
176
188
|
toBuffer() {
|
|
@@ -181,6 +193,7 @@ export class CheckpointRootSingleBlockRollupPrivateInputs {
|
|
|
181
193
|
const reader = BufferReader.asReader(buffer);
|
|
182
194
|
return new CheckpointRootSingleBlockRollupPrivateInputs(
|
|
183
195
|
ProofData.fromBuffer(reader, BlockRollupPublicInputs),
|
|
196
|
+
ProofData.fromBuffer(reader, ParityPublicInputs),
|
|
184
197
|
CheckpointRootRollupHints.fromBuffer(reader),
|
|
185
198
|
);
|
|
186
199
|
}
|
|
@@ -26,6 +26,10 @@ export class RootRollupPublicInputs {
|
|
|
26
26
|
* The out hash of the first checkpoint in the epoch is inserted at index 0, the second at index 1, and so on.
|
|
27
27
|
*/
|
|
28
28
|
public outHash: Fr,
|
|
29
|
+
/** Inbox rolling hash before the epoch's first checkpoint's messages. */
|
|
30
|
+
public previousInboxRollingHash: Fr,
|
|
31
|
+
/** Inbox rolling hash after the epoch's last checkpoint's messages. */
|
|
32
|
+
public endInboxRollingHash: Fr,
|
|
29
33
|
/** Hashes of checkpoint headers for this rollup. */
|
|
30
34
|
public checkpointHeaderHashes: Tuple<Fr, typeof MAX_CHECKPOINTS_PER_EPOCH>,
|
|
31
35
|
public fees: Tuple<FeeRecipient, typeof MAX_CHECKPOINTS_PER_EPOCH>,
|
|
@@ -38,6 +42,8 @@ export class RootRollupPublicInputs {
|
|
|
38
42
|
fields.previousArchiveRoot,
|
|
39
43
|
fields.endArchiveRoot,
|
|
40
44
|
fields.outHash,
|
|
45
|
+
fields.previousInboxRollingHash,
|
|
46
|
+
fields.endInboxRollingHash,
|
|
41
47
|
fields.checkpointHeaderHashes,
|
|
42
48
|
fields.fees,
|
|
43
49
|
fields.constants,
|
|
@@ -65,6 +71,8 @@ export class RootRollupPublicInputs {
|
|
|
65
71
|
public static fromBuffer(buffer: Buffer | BufferReader): RootRollupPublicInputs {
|
|
66
72
|
const reader = BufferReader.asReader(buffer);
|
|
67
73
|
return new RootRollupPublicInputs(
|
|
74
|
+
Fr.fromBuffer(reader),
|
|
75
|
+
Fr.fromBuffer(reader),
|
|
68
76
|
Fr.fromBuffer(reader),
|
|
69
77
|
Fr.fromBuffer(reader),
|
|
70
78
|
Fr.fromBuffer(reader),
|
|
@@ -96,6 +104,8 @@ export class RootRollupPublicInputs {
|
|
|
96
104
|
/** Creates a random instance. Used for testing only - will not prove/verify. */
|
|
97
105
|
static random() {
|
|
98
106
|
return new RootRollupPublicInputs(
|
|
107
|
+
Fr.random(),
|
|
108
|
+
Fr.random(),
|
|
99
109
|
Fr.random(),
|
|
100
110
|
Fr.random(),
|
|
101
111
|
Fr.random(),
|