@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
package/src/stats/stats.ts
CHANGED
|
@@ -101,17 +101,16 @@ export type ClientCircuitName =
|
|
|
101
101
|
| 'app-circuit';
|
|
102
102
|
|
|
103
103
|
export type ServerCircuitName =
|
|
104
|
-
| 'parity-
|
|
105
|
-
| 'parity-
|
|
104
|
+
| 'inbox-parity-64'
|
|
105
|
+
| 'inbox-parity-256'
|
|
106
|
+
| 'inbox-parity-1024'
|
|
106
107
|
| 'chonk-verifier-public'
|
|
107
108
|
| 'rollup-tx-base-private'
|
|
108
109
|
| 'rollup-tx-base-public'
|
|
109
110
|
| 'rollup-tx-merge'
|
|
110
|
-
| 'rollup-block-root-first'
|
|
111
|
-
| 'rollup-block-root-first-single-tx'
|
|
112
|
-
| 'rollup-block-root-first-empty-tx'
|
|
113
111
|
| 'rollup-block-root'
|
|
114
112
|
| 'rollup-block-root-single-tx'
|
|
113
|
+
| 'rollup-block-root-no-txs'
|
|
115
114
|
| 'rollup-block-merge'
|
|
116
115
|
| 'rollup-checkpoint-root'
|
|
117
116
|
| 'rollup-checkpoint-root-single-block'
|
package/src/tests/factories.ts
CHANGED
|
@@ -9,12 +9,15 @@ import {
|
|
|
9
9
|
AVM_V2_PROOF_LENGTH_IN_FIELDS,
|
|
10
10
|
CHONK_PROOF_LENGTH,
|
|
11
11
|
CONTRACT_CLASS_LOG_SIZE_IN_FIELDS,
|
|
12
|
-
|
|
12
|
+
INBOX_PARITY_SIZE_SMALL,
|
|
13
|
+
L1_TO_L2_MSG_TREE_HEIGHT,
|
|
13
14
|
MAX_CHECKPOINTS_PER_EPOCH,
|
|
14
15
|
MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
15
16
|
MAX_ENQUEUED_CALLS_PER_CALL,
|
|
16
17
|
MAX_ENQUEUED_CALLS_PER_TX,
|
|
17
18
|
MAX_KEY_VALIDATION_REQUESTS_PER_CALL,
|
|
19
|
+
MAX_L1_TO_L2_MSGS_PER_BLOCK,
|
|
20
|
+
MAX_L1_TO_L2_MSGS_PER_CHECKPOINT,
|
|
18
21
|
MAX_L2_TO_L1_MSGS_PER_CALL,
|
|
19
22
|
MAX_L2_TO_L1_MSGS_PER_TX,
|
|
20
23
|
MAX_NOTE_HASHES_PER_CALL,
|
|
@@ -34,9 +37,6 @@ import {
|
|
|
34
37
|
NOTE_HASH_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
35
38
|
NULLIFIER_SUBTREE_ROOT_SIBLING_PATH_LENGTH,
|
|
36
39
|
NULLIFIER_TREE_HEIGHT,
|
|
37
|
-
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
|
|
38
|
-
NUM_BASE_PARITY_PER_ROOT_PARITY,
|
|
39
|
-
NUM_MSGS_PER_BASE_PARITY,
|
|
40
40
|
PRIVATE_LOG_SIZE_IN_FIELDS,
|
|
41
41
|
PUBLIC_DATA_TREE_HEIGHT,
|
|
42
42
|
RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
@@ -129,10 +129,11 @@ import { ContractClassLog, ContractClassLogFields } from '../logs/index.js';
|
|
|
129
129
|
import type { LogResult } from '../logs/log_result.js';
|
|
130
130
|
import { PrivateLog } from '../logs/private_log.js';
|
|
131
131
|
import { FlatPublicLogs, PublicLog } from '../logs/public_log.js';
|
|
132
|
+
import { L1ToL2MessageBundle } from '../messaging/l1_to_l2_message_bundle.js';
|
|
133
|
+
import { L1ToL2MessageSponge } from '../messaging/l1_to_l2_message_sponge.js';
|
|
132
134
|
import { CountedL2ToL1Message, L2ToL1Message, ScopedL2ToL1Message } from '../messaging/l2_to_l1_message.js';
|
|
133
|
-
import {
|
|
135
|
+
import { InboxParityPrivateInputs } from '../parity/inbox_parity_private_inputs.js';
|
|
134
136
|
import { ParityPublicInputs } from '../parity/parity_public_inputs.js';
|
|
135
|
-
import { ParityRootPrivateInputs } from '../parity/parity_root_private_inputs.js';
|
|
136
137
|
import { ProofData, ProofDataForFixedVk } from '../proofs/index.js';
|
|
137
138
|
import { Proof } from '../proofs/proof.js';
|
|
138
139
|
import { makeRecursiveProof } from '../proofs/recursive_proof.js';
|
|
@@ -141,7 +142,7 @@ import { BlockConstantData } from '../rollup/block_constant_data.js';
|
|
|
141
142
|
import { BlockMergeRollupPrivateInputs } from '../rollup/block_merge_rollup_private_inputs.js';
|
|
142
143
|
import { BlockRollupPublicInputs } from '../rollup/block_rollup_public_inputs.js';
|
|
143
144
|
import {
|
|
144
|
-
|
|
145
|
+
BlockRootRollupPrivateInputs,
|
|
145
146
|
BlockRootSingleTxRollupPrivateInputs,
|
|
146
147
|
} from '../rollup/block_root_rollup_private_inputs.js';
|
|
147
148
|
import { CheckpointConstantData } from '../rollup/checkpoint_constant_data.js';
|
|
@@ -231,8 +232,6 @@ export function makeTxContext(seed: number = 1): TxContext {
|
|
|
231
232
|
*/
|
|
232
233
|
export function makeGasSettings() {
|
|
233
234
|
return GasSettings.fallback({
|
|
234
|
-
// Arbitrary daGas pinned to the pre-existing fixture value so avm_inputs.testdata.bin (consumed by
|
|
235
|
-
// the C++ vm2 tests) stays byte-stable; teardown derives to the same values the old fallback produced.
|
|
236
235
|
gasLimits: new Gas(196_608, MAX_PROCESSABLE_L2_GAS),
|
|
237
236
|
maxFeesPerGas: new GasFees(10, 10),
|
|
238
237
|
});
|
|
@@ -788,13 +787,18 @@ export function makeBlockRollupPublicInputs(seed = 0): BlockRollupPublicInputs {
|
|
|
788
787
|
makeSpongeBlob(seed + 0x700),
|
|
789
788
|
BigInt(seed + 0x800),
|
|
790
789
|
fr(seed + 0x820),
|
|
791
|
-
|
|
790
|
+
makeL1ToL2MessageSponge(seed + 0x835),
|
|
791
|
+
makeL1ToL2MessageSponge(seed + 0x838),
|
|
792
792
|
fr(seed + 0x840),
|
|
793
793
|
fr(seed + 0x850),
|
|
794
794
|
fr(seed + 0x860),
|
|
795
795
|
);
|
|
796
796
|
}
|
|
797
797
|
|
|
798
|
+
export function makeL1ToL2MessageSponge(seed = 0): L1ToL2MessageSponge {
|
|
799
|
+
return new L1ToL2MessageSponge(makeSpongeBlob(seed).sponge, seed % (INBOX_PARITY_SIZE_SMALL + 1));
|
|
800
|
+
}
|
|
801
|
+
|
|
798
802
|
export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
799
803
|
return new CheckpointRollupPublicInputs(
|
|
800
804
|
makeEpochConstantData(seed),
|
|
@@ -802,6 +806,8 @@ export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
|
802
806
|
makeAppendOnlyTreeSnapshot(seed + 0x200),
|
|
803
807
|
makeAppendOnlyTreeSnapshot(seed + 0x300),
|
|
804
808
|
makeAppendOnlyTreeSnapshot(seed + 0x350),
|
|
809
|
+
fr(seed + 0x360),
|
|
810
|
+
fr(seed + 0x370),
|
|
805
811
|
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, () => fr(seed), 0x400),
|
|
806
812
|
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, () => makeFeeRecipient(seed), 0x500),
|
|
807
813
|
makeBlobAccumulator(seed + 0x600),
|
|
@@ -812,25 +818,18 @@ export function makeCheckpointRollupPublicInputs(seed = 0) {
|
|
|
812
818
|
|
|
813
819
|
export function makeParityPublicInputs(seed = 0): ParityPublicInputs {
|
|
814
820
|
return new ParityPublicInputs(
|
|
815
|
-
new Fr(BigInt(seed + 0x200)),
|
|
816
|
-
new Fr(BigInt(seed + 0x300)),
|
|
817
821
|
new Fr(BigInt(seed + 0x400)),
|
|
818
822
|
new Fr(BigInt(seed + 0x500)),
|
|
823
|
+
makeL1ToL2MessageSponge(seed + 0x580),
|
|
824
|
+
new Fr(BigInt(seed + 0x800)),
|
|
819
825
|
);
|
|
820
826
|
}
|
|
821
827
|
|
|
822
|
-
export function
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
);
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
export function makeParityRootPrivateInputs(seed = 0) {
|
|
831
|
-
return new ParityRootPrivateInputs(
|
|
832
|
-
makeTuple(NUM_BASE_PARITY_PER_ROOT_PARITY, () => makeProofData(seed, makeParityPublicInputs)),
|
|
833
|
-
);
|
|
828
|
+
export function makeInboxParityPrivateInputs(seed = 0): InboxParityPrivateInputs {
|
|
829
|
+
const size = INBOX_PARITY_SIZE_SMALL;
|
|
830
|
+
const numMsgs = seed % (size + 1);
|
|
831
|
+
const messages = Array.from({ length: size }, (_, i) => (i < numMsgs ? fr(i + seed + 0x3000) : Fr.ZERO));
|
|
832
|
+
return new InboxParityPrivateInputs(size, messages, numMsgs, new Fr(seed + 0x3500), new Fr(seed + 0x5000));
|
|
834
833
|
}
|
|
835
834
|
|
|
836
835
|
/**
|
|
@@ -844,6 +843,8 @@ export function makeRootRollupPublicInputs(seed = 0): RootRollupPublicInputs {
|
|
|
844
843
|
fr(seed + 0x100),
|
|
845
844
|
fr(seed + 0x200),
|
|
846
845
|
fr(seed + 0x300),
|
|
846
|
+
fr(seed + 0x320),
|
|
847
|
+
fr(seed + 0x340),
|
|
847
848
|
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, () => fr(seed), 0x400),
|
|
848
849
|
makeTuple(MAX_CHECKPOINTS_PER_EPOCH, () => makeFeeRecipient(seed), 0x500),
|
|
849
850
|
makeEpochConstantData(seed + 0x600),
|
|
@@ -871,7 +872,7 @@ export function makeCheckpointHeader(seed = 0, overrides: Partial<FieldsOf<Check
|
|
|
871
872
|
lastArchiveRoot: fr(seed + 0x100),
|
|
872
873
|
blockHeadersHash: fr(seed + 0x150),
|
|
873
874
|
blobsHash: fr(seed + 0x200),
|
|
874
|
-
|
|
875
|
+
inboxRollingHash: fr(seed + 0x215),
|
|
875
876
|
epochOutHash: fr(seed + 0x220),
|
|
876
877
|
slotNumber: SlotNumber(seed + 0x300),
|
|
877
878
|
timestamp: BigInt(seed + 0x400),
|
|
@@ -891,14 +892,14 @@ export function makeCheckpointHeader(seed = 0, overrides: Partial<FieldsOf<Check
|
|
|
891
892
|
*/
|
|
892
893
|
export function makeStateReference(seed = 0): StateReference {
|
|
893
894
|
return new StateReference(
|
|
894
|
-
makeAppendOnlyTreeSnapshot(
|
|
895
|
+
makeAppendOnlyTreeSnapshot(MAX_L1_TO_L2_MSGS_PER_CHECKPOINT * seed),
|
|
895
896
|
makePartialStateReference(seed + 1),
|
|
896
897
|
);
|
|
897
898
|
}
|
|
898
899
|
|
|
899
900
|
function makeTreeSnapshots(seed = 0) {
|
|
900
901
|
return new TreeSnapshots(
|
|
901
|
-
makeAppendOnlyTreeSnapshot(seed *
|
|
902
|
+
makeAppendOnlyTreeSnapshot(seed * MAX_L1_TO_L2_MSGS_PER_CHECKPOINT),
|
|
902
903
|
makeAppendOnlyTreeSnapshot((seed + 0x10) * MAX_NOTE_HASHES_PER_TX),
|
|
903
904
|
makeAppendOnlyTreeSnapshot((seed + 0x20) * MAX_NULLIFIERS_PER_TX),
|
|
904
905
|
makeAppendOnlyTreeSnapshot((seed + 0x30) * MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX),
|
|
@@ -945,12 +946,13 @@ export function makeTxMergeRollupPrivateInputs(seed = 0): TxMergeRollupPrivateIn
|
|
|
945
946
|
]);
|
|
946
947
|
}
|
|
947
948
|
|
|
948
|
-
export function
|
|
949
|
-
return new
|
|
950
|
-
makeProofData(seed, makeParityPublicInputs),
|
|
949
|
+
export function makeBlockRootRollupPrivateInputs(seed = 0) {
|
|
950
|
+
return new BlockRootRollupPrivateInputs(
|
|
951
951
|
[makeProofData(seed + 0x1000, makeTxRollupPublicInputs), makeProofData(seed + 0x2000, makeTxRollupPublicInputs)],
|
|
952
|
+
new L1ToL2MessageBundle(makeArray(MAX_L1_TO_L2_MSGS_PER_BLOCK, fr, seed + 0x2500), MAX_L1_TO_L2_MSGS_PER_BLOCK),
|
|
952
953
|
makeAppendOnlyTreeSnapshot(seed + 0x3000),
|
|
953
|
-
|
|
954
|
+
makeL1ToL2MessageSponge(seed + 0x3500),
|
|
955
|
+
makeSiblingPath(seed + 0x4000, L1_TO_L2_MSG_TREE_HEIGHT),
|
|
954
956
|
makeSiblingPath(seed + 0x5000, ARCHIVE_HEIGHT),
|
|
955
957
|
);
|
|
956
958
|
}
|
|
@@ -958,7 +960,11 @@ export function makeBlockRootFirstRollupPrivateInputs(seed = 0) {
|
|
|
958
960
|
export function makeBlockRootSingleTxRollupPrivateInputs(seed = 0) {
|
|
959
961
|
return new BlockRootSingleTxRollupPrivateInputs(
|
|
960
962
|
makeProofData(seed + 0x1000, makeTxRollupPublicInputs),
|
|
961
|
-
|
|
963
|
+
new L1ToL2MessageBundle(makeArray(MAX_L1_TO_L2_MSGS_PER_BLOCK, fr, seed + 0x2500), 0),
|
|
964
|
+
makeAppendOnlyTreeSnapshot(seed + 0x2800),
|
|
965
|
+
makeL1ToL2MessageSponge(seed + 0x3000),
|
|
966
|
+
makeSiblingPath(seed + 0x4000, L1_TO_L2_MSG_TREE_HEIGHT),
|
|
967
|
+
makeSiblingPath(seed + 0x5000, ARCHIVE_HEIGHT),
|
|
962
968
|
);
|
|
963
969
|
}
|
|
964
970
|
|
package/src/tests/fixtures.ts
CHANGED
|
@@ -5,6 +5,9 @@ import { fileURLToPath } from 'url';
|
|
|
5
5
|
import { type ContractArtifact, loadContractArtifact } from '../abi/index.js';
|
|
6
6
|
import type { NoirCompiledContract } from '../noir/index.js';
|
|
7
7
|
|
|
8
|
+
// The fixtures are gitignored copies of noir-contracts build outputs, read via fs below.
|
|
9
|
+
// @dependency ../../fixtures/*.json
|
|
10
|
+
|
|
8
11
|
// Copied from the build output for the contract `Benchmarking` in noir-contracts
|
|
9
12
|
export function getBenchmarkContractArtifact(): ContractArtifact {
|
|
10
13
|
const path = getPathToFixture('Benchmarking.test.json');
|
package/src/tests/mocks.ts
CHANGED
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
import { PrivateToAvmAccumulatedData } from '../kernel/private_to_avm_accumulated_data.js';
|
|
51
51
|
import { PrivateToPublicAccumulatedDataBuilder } from '../kernel/private_to_public_accumulated_data_builder.js';
|
|
52
52
|
import { PublicCallRequestArrayLengths } from '../kernel/public_call_request.js';
|
|
53
|
-
import {
|
|
53
|
+
import { InboxBucketRef } from '../messaging/inbox_bucket.js';
|
|
54
54
|
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
55
55
|
import { CheckpointAttestation } from '../p2p/checkpoint_attestation.js';
|
|
56
56
|
import { CheckpointProposal } from '../p2p/checkpoint_proposal.js';
|
|
@@ -476,11 +476,9 @@ export async function mockCheckpointAndMessages(
|
|
|
476
476
|
}
|
|
477
477
|
|
|
478
478
|
const messages = blocksAndMessages[0].messages;
|
|
479
|
-
const inHash = computeInHashFromL1ToL2Messages(messages);
|
|
480
479
|
const firstBlockLastArchive = blocksAndMessages[0].block.header.lastArchive;
|
|
481
480
|
const checkpoint = await Checkpoint.random(checkpointNumber, {
|
|
482
481
|
numBlocks: 0,
|
|
483
|
-
inHash,
|
|
484
482
|
...options,
|
|
485
483
|
...globals,
|
|
486
484
|
lastArchive: firstBlockLastArchive,
|
|
@@ -544,11 +542,11 @@ export interface MakeBlockProposalOptions {
|
|
|
544
542
|
signer?: Secp256k1Signer;
|
|
545
543
|
blockHeader?: BlockHeader;
|
|
546
544
|
indexWithinCheckpoint?: IndexWithinCheckpoint;
|
|
547
|
-
inHash?: Fr;
|
|
548
545
|
archiveRoot?: Fr;
|
|
549
546
|
txHashes?: TxHash[];
|
|
550
547
|
txs?: Tx[];
|
|
551
548
|
signatureContext?: CoordinationSignatureContext;
|
|
549
|
+
bucketRef?: InboxBucketRef;
|
|
552
550
|
}
|
|
553
551
|
|
|
554
552
|
export interface MakeCheckpointProposalOptions {
|
|
@@ -563,6 +561,7 @@ export interface MakeCheckpointProposalOptions {
|
|
|
563
561
|
indexWithinCheckpoint?: IndexWithinCheckpoint;
|
|
564
562
|
txHashes?: TxHash[];
|
|
565
563
|
txs?: Tx[];
|
|
564
|
+
bucketRef?: InboxBucketRef;
|
|
566
565
|
};
|
|
567
566
|
}
|
|
568
567
|
|
|
@@ -595,24 +594,24 @@ export const makeAndSignCommitteeAttestationsAndSigners = (
|
|
|
595
594
|
export const makeBlockProposal = (options?: MakeBlockProposalOptions): Promise<BlockProposal> => {
|
|
596
595
|
const blockHeader = options?.blockHeader ?? makeBlockHeader(1);
|
|
597
596
|
const indexWithinCheckpoint = options?.indexWithinCheckpoint ?? IndexWithinCheckpoint(0);
|
|
598
|
-
const inHash = options?.inHash ?? Fr.random();
|
|
599
597
|
const archiveRoot = options?.archiveRoot ?? Fr.random();
|
|
600
598
|
const txHashes = options?.txHashes ?? [0, 1, 2, 3, 4, 5].map(() => TxHash.random());
|
|
601
599
|
const txs = options?.txs;
|
|
602
600
|
const signer = options?.signer ?? Secp256k1Signer.random();
|
|
603
601
|
const signatureContext = options?.signatureContext ?? TEST_COORDINATION_SIGNATURE_CONTEXT;
|
|
602
|
+
const bucketRef = options?.bucketRef;
|
|
604
603
|
|
|
605
604
|
return BlockProposal.createProposalFromSigner(
|
|
606
605
|
blockHeader,
|
|
607
606
|
CheckpointNumber(1),
|
|
608
607
|
indexWithinCheckpoint,
|
|
609
|
-
inHash,
|
|
610
608
|
archiveRoot,
|
|
611
609
|
txHashes,
|
|
612
610
|
txs,
|
|
613
611
|
signatureContext,
|
|
614
612
|
(typedData, _context) => Promise.resolve(signTypedData(signer, typedData)),
|
|
615
613
|
(typedData, _context) => Promise.resolve(signTypedData(signer, typedData)),
|
|
614
|
+
bucketRef,
|
|
616
615
|
);
|
|
617
616
|
};
|
|
618
617
|
|
|
@@ -628,12 +627,12 @@ export const makeCheckpointProposal = async (options?: MakeCheckpointProposalOpt
|
|
|
628
627
|
? await makeBlockProposal({
|
|
629
628
|
blockHeader: options.lastBlock.blockHeader,
|
|
630
629
|
indexWithinCheckpoint: options.lastBlock.indexWithinCheckpoint ?? IndexWithinCheckpoint(4),
|
|
631
|
-
inHash: checkpointHeader.inHash,
|
|
632
630
|
archiveRoot,
|
|
633
631
|
txHashes: options.lastBlock.txHashes,
|
|
634
632
|
txs: options.lastBlock.txs,
|
|
635
633
|
signer,
|
|
636
634
|
signatureContext,
|
|
635
|
+
bucketRef: options.lastBlock.bucketRef,
|
|
637
636
|
})
|
|
638
637
|
: undefined;
|
|
639
638
|
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MAX_NOTE_HASHES_PER_TX,
|
|
3
|
-
MAX_NULLIFIERS_PER_TX,
|
|
4
|
-
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
|
|
5
|
-
STATE_REFERENCE_LENGTH,
|
|
6
|
-
} from '@aztec/constants';
|
|
1
|
+
import { MAX_NOTE_HASHES_PER_TX, MAX_NULLIFIERS_PER_TX, STATE_REFERENCE_LENGTH } from '@aztec/constants';
|
|
7
2
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
8
3
|
import { BufferReader, BufferSink, FieldReader, serializeToSink } from '@aztec/foundation/serialize';
|
|
9
4
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
@@ -106,14 +101,12 @@ export class StateReference {
|
|
|
106
101
|
}
|
|
107
102
|
|
|
108
103
|
/**
|
|
109
|
-
* Validates the trees
|
|
104
|
+
* Validates the partial-state trees have the expected number of leaves (multiple of number of insertions per tx).
|
|
105
|
+
*
|
|
106
|
+
* The L1-to-L2 message tree is not checked: it grows by real message counts at compact (unaligned)
|
|
107
|
+
* indices, so its next-available leaf index is no longer a multiple of any per-block subtree size.
|
|
110
108
|
*/
|
|
111
109
|
public validate() {
|
|
112
|
-
if (this.l1ToL2MessageTree.nextAvailableLeafIndex % NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP !== 0) {
|
|
113
|
-
throw new Error(
|
|
114
|
-
`Invalid L1 to L2 message tree next available leaf index ${this.l1ToL2MessageTree.nextAvailableLeafIndex} (must be a multiple of ${NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP})`,
|
|
115
|
-
);
|
|
116
|
-
}
|
|
117
110
|
if (this.partial.noteHashTree.nextAvailableLeafIndex % MAX_NOTE_HASHES_PER_TX !== 0) {
|
|
118
111
|
throw new Error(
|
|
119
112
|
`Invalid note hash tree next available leaf index ${this.partial.noteHashTree.nextAvailableLeafIndex} (must be a multiple of ${MAX_NOTE_HASHES_PER_TX})`,
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
-
/**
|
|
3
|
-
* Computes the inHash for a checkpoint (or the first block in a checkpoint) given its l1 to l2 messages.
|
|
4
|
-
*/
|
|
5
|
-
export declare function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages: Fr[]): Fr;
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5faGFzaC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL21lc3NhZ2luZy9pbl9oYXNoLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUdwRDs7R0FFRztBQUNILHdCQUFnQiwrQkFBK0IsQ0FBQyxzQkFBc0IsRUFBRSxFQUFFLEVBQUUsR0FBRyxFQUFFLENBR2hGIn0=
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"in_hash.d.ts","sourceRoot":"","sources":["../../src/messaging/in_hash.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD;;GAEG;AACH,wBAAgB,+BAA+B,CAAC,sBAAsB,EAAE,EAAE,EAAE,GAAG,EAAE,CAGhF"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
2
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
3
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
-
import { computeBalancedShaRoot } from '@aztec/foundation/trees';
|
|
5
|
-
/**
|
|
6
|
-
* Computes the inHash for a checkpoint (or the first block in a checkpoint) given its l1 to l2 messages.
|
|
7
|
-
*/ export function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages) {
|
|
8
|
-
const l1ToL2Messages = padArrayEnd(unpaddedL1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
|
|
9
|
-
return new Fr(computeBalancedShaRoot(l1ToL2Messages.map((msg)=>msg.toBuffer())));
|
|
10
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
4
|
-
export declare class InboxLeaf {
|
|
5
|
-
/** Index of the leaf in the whole tree. */
|
|
6
|
-
readonly index: bigint;
|
|
7
|
-
/** Leaf in the subtree/message hash. */
|
|
8
|
-
readonly leaf: Fr;
|
|
9
|
-
constructor(
|
|
10
|
-
/** Index of the leaf in the whole tree. */
|
|
11
|
-
index: bigint,
|
|
12
|
-
/** Leaf in the subtree/message hash. */
|
|
13
|
-
leaf: Fr);
|
|
14
|
-
toBuffer(): Buffer;
|
|
15
|
-
fromBuffer(buffer: Buffer | BufferReader): InboxLeaf;
|
|
16
|
-
static smallestIndexForCheckpoint(checkpointNumber: CheckpointNumber): bigint;
|
|
17
|
-
/**
|
|
18
|
-
* Returns the range of valid indices for a given checkpoint.
|
|
19
|
-
* Start index is inclusive, end index is exclusive.
|
|
20
|
-
*/
|
|
21
|
-
static indexRangeForCheckpoint(checkpointNumber: CheckpointNumber): [bigint, bigint];
|
|
22
|
-
/** Returns the checkpoint number for a given leaf index */
|
|
23
|
-
static checkpointNumberFromIndex(index: bigint): CheckpointNumber;
|
|
24
|
-
}
|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-
{"version":3,"file":"inbox_leaf.d.ts","sourceRoot":"","sources":["../../src/messaging/inbox_leaf.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E,qBAAa,SAAS;IAElB,2CAA2C;aAC3B,KAAK,EAAE,MAAM;IAC7B,wCAAwC;aACxB,IAAI,EAAE,EAAE;IAJ1B;IACE,2CAA2C;IAC3B,KAAK,EAAE,MAAM;IAC7B,wCAAwC;IACxB,IAAI,EAAE,EAAE,EACtB;IAEJ,QAAQ,IAAI,MAAM,CAEjB;IAED,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAKnD;IAED,MAAM,CAAC,0BAA0B,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,MAAM,CAE5E;IAED;;;OAGG;IACH,MAAM,CAAC,uBAAuB,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAInF;IAED,2DAA2D;IAC3D,MAAM,CAAC,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAEhE;CACF"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { INITIAL_CHECKPOINT_NUMBER, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
2
|
-
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
3
|
-
import { CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
4
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
6
|
-
export class InboxLeaf {
|
|
7
|
-
index;
|
|
8
|
-
leaf;
|
|
9
|
-
constructor(/** Index of the leaf in the whole tree. */ index, /** Leaf in the subtree/message hash. */ leaf){
|
|
10
|
-
this.index = index;
|
|
11
|
-
this.leaf = leaf;
|
|
12
|
-
}
|
|
13
|
-
toBuffer() {
|
|
14
|
-
return serializeToBuffer([
|
|
15
|
-
this.index,
|
|
16
|
-
this.leaf
|
|
17
|
-
]);
|
|
18
|
-
}
|
|
19
|
-
fromBuffer(buffer) {
|
|
20
|
-
const reader = BufferReader.asReader(buffer);
|
|
21
|
-
const index = toBigIntBE(reader.readBytes(32));
|
|
22
|
-
const leaf = reader.readObject(Fr);
|
|
23
|
-
return new InboxLeaf(index, leaf);
|
|
24
|
-
}
|
|
25
|
-
static smallestIndexForCheckpoint(checkpointNumber) {
|
|
26
|
-
return BigInt(checkpointNumber - INITIAL_CHECKPOINT_NUMBER) * BigInt(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Returns the range of valid indices for a given checkpoint.
|
|
30
|
-
* Start index is inclusive, end index is exclusive.
|
|
31
|
-
*/ static indexRangeForCheckpoint(checkpointNumber) {
|
|
32
|
-
const start = this.smallestIndexForCheckpoint(checkpointNumber);
|
|
33
|
-
const end = start + BigInt(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
|
|
34
|
-
return [
|
|
35
|
-
start,
|
|
36
|
-
end
|
|
37
|
-
];
|
|
38
|
-
}
|
|
39
|
-
/** Returns the checkpoint number for a given leaf index */ static checkpointNumberFromIndex(index) {
|
|
40
|
-
return CheckpointNumber(Number(index / BigInt(NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP)) + INITIAL_CHECKPOINT_NUMBER);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { NUM_MSGS_PER_BASE_PARITY } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
-
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
4
|
-
export declare class ParityBasePrivateInputs {
|
|
5
|
-
/** Aggregated proof of all the parity circuit iterations. */
|
|
6
|
-
readonly msgs: Tuple<Fr, typeof NUM_MSGS_PER_BASE_PARITY>;
|
|
7
|
-
/** Root of the VK tree */
|
|
8
|
-
readonly vkTreeRoot: Fr;
|
|
9
|
-
/** Prover identity committed to by the circuit, for sybil protection. */
|
|
10
|
-
readonly proverId: Fr;
|
|
11
|
-
constructor(
|
|
12
|
-
/** Aggregated proof of all the parity circuit iterations. */
|
|
13
|
-
msgs: Tuple<Fr, typeof NUM_MSGS_PER_BASE_PARITY>,
|
|
14
|
-
/** Root of the VK tree */
|
|
15
|
-
vkTreeRoot: Fr,
|
|
16
|
-
/** Prover identity committed to by the circuit, for sybil protection. */
|
|
17
|
-
proverId: Fr);
|
|
18
|
-
static fromSlice(array: Fr[], index: number, vkTreeRoot: Fr, proverId: Fr): ParityBasePrivateInputs;
|
|
19
|
-
/** Serializes the inputs to a buffer. */
|
|
20
|
-
toBuffer(): Buffer<ArrayBufferLike>;
|
|
21
|
-
/** Serializes the inputs to a hex string. */
|
|
22
|
-
toString(): `0x${string}`;
|
|
23
|
-
/**
|
|
24
|
-
* Deserializes the inputs from a buffer.
|
|
25
|
-
* @param buffer - The buffer to deserialize from.
|
|
26
|
-
*/
|
|
27
|
-
static fromBuffer(buffer: Buffer | BufferReader): ParityBasePrivateInputs;
|
|
28
|
-
/**
|
|
29
|
-
* Deserializes the inputs from a hex string.
|
|
30
|
-
* @param str - The hex string to deserialize from.
|
|
31
|
-
* @returns - The deserialized inputs.
|
|
32
|
-
*/
|
|
33
|
-
static fromString(str: string): ParityBasePrivateInputs;
|
|
34
|
-
/** Returns a buffer representation for JSON serialization. */
|
|
35
|
-
toJSON(): Buffer<ArrayBufferLike>;
|
|
36
|
-
/** Creates an instance from a hex string. */
|
|
37
|
-
static get schema(): import("zod").ZodType<ParityBasePrivateInputs, string, import("zod/v4/core").$ZodTypeInternals<ParityBasePrivateInputs, string>>;
|
|
38
|
-
}
|
|
39
|
-
//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CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,2BAO9C;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,2BAE5B;IAED,8DAA8D;IAC9D,MAAM,4BAEL;IAED,6CAA6C;IAC7C,MAAM,KAAK,MAAM,qIAEhB;CACF"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, NUM_MSGS_PER_BASE_PARITY } from '@aztec/constants';
|
|
2
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
-
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
-
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
|
-
export class ParityBasePrivateInputs {
|
|
7
|
-
msgs;
|
|
8
|
-
vkTreeRoot;
|
|
9
|
-
proverId;
|
|
10
|
-
constructor(/** Aggregated proof of all the parity circuit iterations. */ msgs, /** Root of the VK tree */ vkTreeRoot, /** Prover identity committed to by the circuit, for sybil protection. */ proverId){
|
|
11
|
-
this.msgs = msgs;
|
|
12
|
-
this.vkTreeRoot = vkTreeRoot;
|
|
13
|
-
this.proverId = proverId;
|
|
14
|
-
}
|
|
15
|
-
static fromSlice(array, index, vkTreeRoot, proverId) {
|
|
16
|
-
// Can't use Tuple<Fr, typeof NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP> due to length
|
|
17
|
-
if (array.length !== NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP) {
|
|
18
|
-
throw new Error(`Msgs array length must be NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP=${NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP}`);
|
|
19
|
-
}
|
|
20
|
-
const start = index * NUM_MSGS_PER_BASE_PARITY;
|
|
21
|
-
const end = start + NUM_MSGS_PER_BASE_PARITY;
|
|
22
|
-
const msgs = array.slice(start, end);
|
|
23
|
-
return new ParityBasePrivateInputs(msgs, vkTreeRoot, proverId);
|
|
24
|
-
}
|
|
25
|
-
/** Serializes the inputs to a buffer. */ toBuffer() {
|
|
26
|
-
return serializeToBuffer(this.msgs, this.vkTreeRoot, this.proverId);
|
|
27
|
-
}
|
|
28
|
-
/** Serializes the inputs to a hex string. */ toString() {
|
|
29
|
-
return bufferToHex(this.toBuffer());
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Deserializes the inputs from a buffer.
|
|
33
|
-
* @param buffer - The buffer to deserialize from.
|
|
34
|
-
*/ static fromBuffer(buffer) {
|
|
35
|
-
const reader = BufferReader.asReader(buffer);
|
|
36
|
-
return new ParityBasePrivateInputs(reader.readArray(NUM_MSGS_PER_BASE_PARITY, Fr), Fr.fromBuffer(reader), Fr.fromBuffer(reader));
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Deserializes the inputs from a hex string.
|
|
40
|
-
* @param str - The hex string to deserialize from.
|
|
41
|
-
* @returns - The deserialized inputs.
|
|
42
|
-
*/ static fromString(str) {
|
|
43
|
-
return ParityBasePrivateInputs.fromBuffer(hexToBuffer(str));
|
|
44
|
-
}
|
|
45
|
-
/** Returns a buffer representation for JSON serialization. */ toJSON() {
|
|
46
|
-
return this.toBuffer();
|
|
47
|
-
}
|
|
48
|
-
/** Creates an instance from a hex string. */ static get schema() {
|
|
49
|
-
return bufferSchemaFor(ParityBasePrivateInputs);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { NUM_BASE_PARITY_PER_ROOT_PARITY } from '@aztec/constants';
|
|
2
|
-
import { BufferReader, type Tuple } from '@aztec/foundation/serialize';
|
|
3
|
-
import { type UltraHonkProofData } from '../proofs/proof_data.js';
|
|
4
|
-
import { ParityPublicInputs } from './parity_public_inputs.js';
|
|
5
|
-
export type ParityBaseProofData = UltraHonkProofData<ParityPublicInputs>;
|
|
6
|
-
export declare class ParityRootPrivateInputs {
|
|
7
|
-
/** Public inputs of the parity base circuits and their proofs and vk data. */
|
|
8
|
-
readonly children: Tuple<ParityBaseProofData, typeof NUM_BASE_PARITY_PER_ROOT_PARITY>;
|
|
9
|
-
constructor(
|
|
10
|
-
/** Public inputs of the parity base circuits and their proofs and vk data. */
|
|
11
|
-
children: Tuple<ParityBaseProofData, typeof NUM_BASE_PARITY_PER_ROOT_PARITY>);
|
|
12
|
-
/**
|
|
13
|
-
* Serializes the inputs to a buffer.
|
|
14
|
-
* @returns The inputs serialized to a buffer.
|
|
15
|
-
*/
|
|
16
|
-
toBuffer(): Buffer<ArrayBufferLike>;
|
|
17
|
-
/**
|
|
18
|
-
* Serializes the inputs to a hex string.
|
|
19
|
-
* @returns The instance serialized to a hex string.
|
|
20
|
-
*/
|
|
21
|
-
toString(): `0x${string}`;
|
|
22
|
-
/**
|
|
23
|
-
* Deserializes the inputs from a buffer.
|
|
24
|
-
* @param buffer - The buffer to deserialize from.
|
|
25
|
-
* @returns A new ParityRootPrivateInputs instance.
|
|
26
|
-
*/
|
|
27
|
-
static fromBuffer(buffer: Buffer | BufferReader): ParityRootPrivateInputs;
|
|
28
|
-
/**
|
|
29
|
-
* Deserializes the inputs from a hex string.
|
|
30
|
-
* @param str - A hex string to deserialize from.
|
|
31
|
-
* @returns A new ParityRootPrivateInputs instance.
|
|
32
|
-
*/
|
|
33
|
-
static fromString(str: string): ParityRootPrivateInputs;
|
|
34
|
-
/** Returns a buffer representation for JSON serialization. */
|
|
35
|
-
toJSON(): Buffer<ArrayBufferLike>;
|
|
36
|
-
/** Creates an instance from a hex string. */
|
|
37
|
-
static get schema(): import("zod").ZodType<ParityRootPrivateInputs, string, import("zod/v4/core").$ZodTypeInternals<ParityRootPrivateInputs, string>>;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGFyaXR5X3Jvb3RfcHJpdmF0ZV9pbnB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oQjtDQUNGIn0=
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parity_root_private_inputs.d.ts","sourceRoot":"","sources":["../../src/parity/parity_root_private_inputs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,kBAAkB,CAAC;AAGnE,OAAO,EAAE,YAAY,EAAE,KAAK,KAAK,EAAqB,MAAM,6BAA6B,CAAC;AAG1F,OAAO,EAAa,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAE/D,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,CAAC;AAEzE,qBAAa,uBAAuB;IAEhC,8EAA8E;aAC9D,QAAQ,EAAE,KAAK,CAAC,mBAAmB,EAAE,OAAO,+BAA+B,CAAC;IAF9F;IACE,8EAA8E;IAC9D,QAAQ,EAAE,KAAK,CAAC,mBAAmB,EAAE,OAAO,+BAA+B,CAAC,EAC1F;IAEJ;;;OAGG;IACH,QAAQ,4BAEP;IAED;;;OAGG;IACH,QAAQ,kBAEP;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY,2BAK9C;IAED;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM,2BAE5B;IAED,8DAA8D;IAC9D,MAAM,4BAEL;IAED,6CAA6C;IAC7C,MAAM,KAAK,MAAM,qIAEhB;CACF"}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { NUM_BASE_PARITY_PER_ROOT_PARITY } from '@aztec/constants';
|
|
2
|
-
import { makeTuple } from '@aztec/foundation/array';
|
|
3
|
-
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
4
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
5
|
-
import { bufferToHex, hexToBuffer } from '@aztec/foundation/string';
|
|
6
|
-
import { ProofData } from '../proofs/proof_data.js';
|
|
7
|
-
import { ParityPublicInputs } from './parity_public_inputs.js';
|
|
8
|
-
export class ParityRootPrivateInputs {
|
|
9
|
-
children;
|
|
10
|
-
constructor(/** Public inputs of the parity base circuits and their proofs and vk data. */ children){
|
|
11
|
-
this.children = children;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Serializes the inputs to a buffer.
|
|
15
|
-
* @returns The inputs serialized to a buffer.
|
|
16
|
-
*/ toBuffer() {
|
|
17
|
-
return serializeToBuffer(this.children);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Serializes the inputs to a hex string.
|
|
21
|
-
* @returns The instance serialized to a hex string.
|
|
22
|
-
*/ toString() {
|
|
23
|
-
return bufferToHex(this.toBuffer());
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Deserializes the inputs from a buffer.
|
|
27
|
-
* @param buffer - The buffer to deserialize from.
|
|
28
|
-
* @returns A new ParityRootPrivateInputs instance.
|
|
29
|
-
*/ static fromBuffer(buffer) {
|
|
30
|
-
const reader = BufferReader.asReader(buffer);
|
|
31
|
-
return new ParityRootPrivateInputs(makeTuple(NUM_BASE_PARITY_PER_ROOT_PARITY, ()=>ProofData.fromBuffer(reader, ParityPublicInputs)));
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Deserializes the inputs from a hex string.
|
|
35
|
-
* @param str - A hex string to deserialize from.
|
|
36
|
-
* @returns A new ParityRootPrivateInputs instance.
|
|
37
|
-
*/ static fromString(str) {
|
|
38
|
-
return ParityRootPrivateInputs.fromBuffer(hexToBuffer(str));
|
|
39
|
-
}
|
|
40
|
-
/** Returns a buffer representation for JSON serialization. */ toJSON() {
|
|
41
|
-
return this.toBuffer();
|
|
42
|
-
}
|
|
43
|
-
/** Creates an instance from a hex string. */ static get schema() {
|
|
44
|
-
return bufferSchemaFor(ParityRootPrivateInputs);
|
|
45
|
-
}
|
|
46
|
-
}
|
package/src/messaging/in_hash.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
2
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
3
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
-
import { computeBalancedShaRoot } from '@aztec/foundation/trees';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Computes the inHash for a checkpoint (or the first block in a checkpoint) given its l1 to l2 messages.
|
|
8
|
-
*/
|
|
9
|
-
export function computeInHashFromL1ToL2Messages(unpaddedL1ToL2Messages: Fr[]): Fr {
|
|
10
|
-
const l1ToL2Messages = padArrayEnd<Fr, number>(unpaddedL1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP);
|
|
11
|
-
return new Fr(computeBalancedShaRoot(l1ToL2Messages.map(msg => msg.toBuffer())));
|
|
12
|
-
}
|