@aztec/stdlib 6.0.0-nightly.20260812 → 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
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
import { L1RollupConstantsSchema } from '../epoch-helpers/index.js';
|
|
26
26
|
import { LogResultSchema } from '../logs/log_result.js';
|
|
27
27
|
import { PrivateLogsQuerySchema, PublicLogsQuerySchema } from '../logs/logs_query.js';
|
|
28
|
+
import { InboxBucketSchema } from '../messaging/inbox_bucket.js';
|
|
28
29
|
import type { L1ToL2MessageSource } from '../messaging/l1_to_l2_message_source.js';
|
|
29
30
|
import { L2ToL1MembershipWitnessSchema } from '../messaging/l2_to_l1_membership.js';
|
|
30
31
|
import { optional, schemas } from '../schemas/schemas.js';
|
|
@@ -72,7 +73,7 @@ export type ArchiverSpecificConfig = {
|
|
|
72
73
|
/**
|
|
73
74
|
* Preload the standard contracts (AuthRegistry, PublicChecks, HandshakeRegistry) into the contract store at block 0.
|
|
74
75
|
* For test environments only: it must only be set when genesis also seeds the matching registration/deployment
|
|
75
|
-
* nullifiers, otherwise a later
|
|
76
|
+
* nullifiers, otherwise a later onchain publish of a preloaded class would collide with the block-0 preload.
|
|
76
77
|
*/
|
|
77
78
|
testPreloadStandardContracts?: boolean;
|
|
78
79
|
};
|
|
@@ -135,8 +136,24 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
135
136
|
}),
|
|
136
137
|
getContractClassIds: z.function({ input: z.tuple([]), output: z.array(schemas.Fr) }),
|
|
137
138
|
registerContractFunctionSignatures: z.function({ input: z.tuple([z.array(z.string())]), output: z.void() }),
|
|
138
|
-
getL1ToL2Messages: z.function({ input: z.tuple([CheckpointNumberSchema]), output: z.array(schemas.Fr) }),
|
|
139
139
|
getL1ToL2MessageIndex: z.function({ input: z.tuple([schemas.Fr]), output: schemas.BigInt.optional() }),
|
|
140
|
+
getLatestInboxBucketAtOrBefore: z.function({
|
|
141
|
+
input: z.tuple([schemas.BigInt]),
|
|
142
|
+
output: InboxBucketSchema.optional(),
|
|
143
|
+
}),
|
|
144
|
+
getInboxBucket: z.function({ input: z.tuple([schemas.BigInt]), output: InboxBucketSchema.optional() }),
|
|
145
|
+
getInboxBucketByTotalMsgCount: z.function({
|
|
146
|
+
input: z.tuple([schemas.BigInt]),
|
|
147
|
+
output: InboxBucketSchema.optional(),
|
|
148
|
+
}),
|
|
149
|
+
getL1ToL2MessagesBetweenBuckets: z.function({
|
|
150
|
+
input: z.tuple([schemas.BigInt, schemas.BigInt]),
|
|
151
|
+
output: z.array(schemas.Fr),
|
|
152
|
+
}),
|
|
153
|
+
getL1ToL2MessagesBetweenLeafCounts: z.function({
|
|
154
|
+
input: z.tuple([schemas.BigInt, schemas.BigInt]),
|
|
155
|
+
output: z.array(schemas.Fr),
|
|
156
|
+
}),
|
|
140
157
|
getDebugFunctionName: z.function({
|
|
141
158
|
input: z.tuple([schemas.AztecAddress, schemas.FunctionSelector]),
|
|
142
159
|
output: optional(z.string()),
|
|
@@ -15,7 +15,12 @@ import {
|
|
|
15
15
|
} from '@aztec/foundation/branded-types';
|
|
16
16
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
17
17
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
type JsonRpcFetch,
|
|
20
|
+
type JsonRpcFetchConfig,
|
|
21
|
+
createSafeJsonRpcClient,
|
|
22
|
+
makeFetch,
|
|
23
|
+
} from '@aztec/foundation/json-rpc/client';
|
|
19
24
|
import { MembershipWitness, SiblingPath } from '@aztec/foundation/trees';
|
|
20
25
|
|
|
21
26
|
import { z } from 'zod';
|
|
@@ -200,8 +205,12 @@ export interface AztecNode {
|
|
|
200
205
|
l1ToL2Message: Fr,
|
|
201
206
|
): Promise<[bigint, SiblingPath<typeof L1_TO_L2_MSG_TREE_HEIGHT>] | undefined>;
|
|
202
207
|
|
|
203
|
-
/**
|
|
204
|
-
|
|
208
|
+
/**
|
|
209
|
+
* Returns the compact leaf index assigned to this L1 to L2 message as soon as the node has ingested it from L1,
|
|
210
|
+
* before any L2 block consumes it. Returns undefined if the node has not yet seen the message. The message becomes
|
|
211
|
+
* consumable once a block's L1-to-L2 message tree grows past this index.
|
|
212
|
+
*/
|
|
213
|
+
getL1ToL2MessageIndex(l1ToL2Message: Fr): Promise<bigint | undefined>;
|
|
205
214
|
|
|
206
215
|
/**
|
|
207
216
|
* Returns all the L2 to L1 messages in an epoch.
|
|
@@ -609,7 +618,7 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
609
618
|
output: z.tuple([schemas.BigInt, SiblingPath.schemaFor(L1_TO_L2_MSG_TREE_HEIGHT)]).optional(),
|
|
610
619
|
}),
|
|
611
620
|
|
|
612
|
-
|
|
621
|
+
getL1ToL2MessageIndex: z.function({ input: z.tuple([schemas.Fr]), output: schemas.BigInt.optional() }),
|
|
613
622
|
|
|
614
623
|
getL2ToL1Messages: z.function({
|
|
615
624
|
input: z.tuple([EpochNumberSchema]),
|
|
@@ -790,16 +799,28 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
790
799
|
}),
|
|
791
800
|
};
|
|
792
801
|
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
versions
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
802
|
+
/** Options for an Aztec node JSON-RPC client. */
|
|
803
|
+
export type AztecNodeClientOptions = {
|
|
804
|
+
/** Expected component versions checked against response headers. */
|
|
805
|
+
versions?: Partial<ComponentsVersions>;
|
|
806
|
+
/** Custom JSON-RPC transport. Takes precedence over fetchOptions. */
|
|
807
|
+
fetch?: JsonRpcFetch;
|
|
808
|
+
/** Configuration for the default retrying fetch transport. */
|
|
809
|
+
fetchOptions?: JsonRpcFetchConfig;
|
|
810
|
+
/** Time in milliseconds to collect calls into a JSON-RPC batch. */
|
|
811
|
+
batchWindowMS?: number;
|
|
812
|
+
/** Maximum number of calls sent in one JSON-RPC batch. */
|
|
813
|
+
maxBatchSize?: number;
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
export function createAztecNodeClient(url: string, options: AztecNodeClientOptions = {}): AztecNode {
|
|
817
|
+
const fetch = options.fetch ?? makeFetch([1, 2, 3], false, undefined, options.fetchOptions);
|
|
818
|
+
|
|
799
819
|
return createSafeJsonRpcClient<AztecNode>(url, AztecNodeApiSchema, {
|
|
800
820
|
namespaceMethods: 'aztec',
|
|
801
821
|
fetch,
|
|
802
|
-
batchWindowMS,
|
|
803
|
-
|
|
822
|
+
batchWindowMS: options.batchWindowMS ?? 0,
|
|
823
|
+
maxBatchSize: options.maxBatchSize,
|
|
824
|
+
onResponse: getVersioningResponseHandler(options.versions ?? {}),
|
|
804
825
|
});
|
|
805
826
|
}
|
|
@@ -56,6 +56,11 @@ export type PublicProcessorLimits = {
|
|
|
56
56
|
type BlockBuilderOptionsBase = PublicProcessorLimits & {
|
|
57
57
|
/** Minimum number of successfully processed txs required. Block is rejected if fewer succeed. */
|
|
58
58
|
minValidTxs: number;
|
|
59
|
+
/**
|
|
60
|
+
* L1-to-L2 message leaves this block consumes, inserted into the fork's L1-to-L2 message tree before the block
|
|
61
|
+
* header is built. Omitted when the block consumes nothing from the Inbox.
|
|
62
|
+
*/
|
|
63
|
+
l1ToL2Messages?: Fr[];
|
|
59
64
|
};
|
|
60
65
|
|
|
61
66
|
/** Proposer mode: redistribution params are required. */
|
|
@@ -150,12 +155,16 @@ export interface ICheckpointsBuilder {
|
|
|
150
155
|
*/
|
|
151
156
|
getFork(blockNumber: BlockNumber, blockHash?: BlockHash): Promise<MerkleTreeWriteOperations>;
|
|
152
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Opens a fresh checkpoint. The checkpoint's L1-to-L2 messages are not passed here: each block carries its own
|
|
160
|
+
* bundle in `buildBlock`'s `l1ToL2Messages`.
|
|
161
|
+
*/
|
|
153
162
|
startCheckpoint(
|
|
154
163
|
checkpointNumber: CheckpointNumber,
|
|
155
164
|
constants: CheckpointGlobalVariables,
|
|
156
165
|
feeAssetPriceModifier: bigint,
|
|
157
|
-
l1ToL2Messages: Fr[],
|
|
158
166
|
previousCheckpointOutHashes: Fr[],
|
|
167
|
+
previousInboxRollingHash: Fr,
|
|
159
168
|
fork: MerkleTreeWriteOperations,
|
|
160
169
|
bindings?: LoggerBindings,
|
|
161
170
|
): Promise<ICheckpointBlockBuilder>;
|
|
@@ -133,6 +133,11 @@ export interface SequencerConfig {
|
|
|
133
133
|
skipBroadcastCheckpointProposal?: boolean;
|
|
134
134
|
/** List of slots for which the sequencer will not produce a proposal (for testing only). Attestation paths are unaffected. */
|
|
135
135
|
pauseProposingForSlots?: SlotNumber[];
|
|
136
|
+
/**
|
|
137
|
+
* Minimum number of connected p2p peers required to build and propose a checkpoint. Zero disables the
|
|
138
|
+
* check. Ignored when p2p is disabled by config.
|
|
139
|
+
*/
|
|
140
|
+
minPeersToPropose?: number;
|
|
136
141
|
}
|
|
137
142
|
|
|
138
143
|
export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
@@ -186,6 +191,7 @@ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
|
186
191
|
skipBroadcastProposals: z.boolean().optional(),
|
|
187
192
|
skipBroadcastCheckpointProposal: z.boolean().optional(),
|
|
188
193
|
pauseProposingForSlots: z.array(SlotNumberSchema).optional(),
|
|
194
|
+
minPeersToPropose: z.number().nonnegative().optional(),
|
|
189
195
|
}),
|
|
190
196
|
);
|
|
191
197
|
|
package/src/interfaces/p2p.ts
CHANGED
|
@@ -29,6 +29,19 @@ export const PeerInfoSchema = z.discriminatedUnion('status', [
|
|
|
29
29
|
}),
|
|
30
30
|
]);
|
|
31
31
|
|
|
32
|
+
/** Connectivity of the p2p stack: whether it is enabled at all, and how many peers are currently connected. */
|
|
33
|
+
export type P2PConnectivity = {
|
|
34
|
+
/** False when the node runs without a p2p stack (eg sandbox or single-node setups). */
|
|
35
|
+
enabled: boolean;
|
|
36
|
+
/** Number of peers currently connected. Always zero when p2p is disabled. */
|
|
37
|
+
connectedPeers: number;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export const P2PConnectivitySchema = z.object({
|
|
41
|
+
enabled: z.boolean(),
|
|
42
|
+
connectedPeers: z.number(),
|
|
43
|
+
});
|
|
44
|
+
|
|
32
45
|
/** Exposed API to the P2P module. */
|
|
33
46
|
export interface P2PApi {
|
|
34
47
|
/**
|
|
@@ -54,6 +67,13 @@ export interface P2PApi {
|
|
|
54
67
|
*/
|
|
55
68
|
getPeers(includePending?: boolean): Promise<PeerInfo[]>;
|
|
56
69
|
|
|
70
|
+
/**
|
|
71
|
+
* Returns whether the p2p stack is enabled on this node, and the number of peers it is connected to.
|
|
72
|
+
* Nodes running without p2p report `enabled: false`, so consumers can tell a disabled stack apart from a
|
|
73
|
+
* stack that is enabled but has no peers.
|
|
74
|
+
*/
|
|
75
|
+
getP2PConnectivity(): Promise<P2PConnectivity>;
|
|
76
|
+
|
|
57
77
|
/**
|
|
58
78
|
* Queries the Attestation pool for checkpoint attestations for the given slot.
|
|
59
79
|
*
|
|
@@ -116,4 +136,5 @@ export const P2PApiSchema: ApiSchemaFor<P2PApi> = {
|
|
|
116
136
|
getPendingTxCount: z.function({ input: z.tuple([]), output: schemas.Integer }),
|
|
117
137
|
getEncodedEnr: z.function({ input: z.tuple([]), output: z.string().optional() }),
|
|
118
138
|
getPeers: z.function({ input: z.tuple([optional(z.boolean())]), output: z.array(PeerInfoSchema) }),
|
|
139
|
+
getP2PConnectivity: z.function({ input: z.tuple([]), output: P2PConnectivitySchema }),
|
|
119
140
|
};
|
|
@@ -11,18 +11,15 @@ import { z } from 'zod';
|
|
|
11
11
|
|
|
12
12
|
import { AvmCircuitInputs } from '../avm/avm.js';
|
|
13
13
|
import { AvmProvingRequestSchema } from '../avm/avm_proving_request.js';
|
|
14
|
-
import {
|
|
14
|
+
import { InboxParityPrivateInputs } from '../parity/inbox_parity_private_inputs.js';
|
|
15
15
|
import { ParityPublicInputs } from '../parity/parity_public_inputs.js';
|
|
16
|
-
import { ParityRootPrivateInputs } from '../parity/parity_root_private_inputs.js';
|
|
17
16
|
import { ProvingRequestType } from '../proofs/proving_request_type.js';
|
|
18
17
|
import { RecursiveProof } from '../proofs/recursive_proof.js';
|
|
19
18
|
import { BlockMergeRollupPrivateInputs } from '../rollup/block_merge_rollup_private_inputs.js';
|
|
20
19
|
import { BlockRollupPublicInputs } from '../rollup/block_rollup_public_inputs.js';
|
|
21
20
|
import {
|
|
22
|
-
|
|
23
|
-
BlockRootFirstRollupPrivateInputs,
|
|
21
|
+
BlockRootNoTxsRollupPrivateInputs,
|
|
24
22
|
BlockRootRollupPrivateInputs,
|
|
25
|
-
BlockRootSingleTxFirstRollupPrivateInputs,
|
|
26
23
|
BlockRootSingleTxRollupPrivateInputs,
|
|
27
24
|
} from '../rollup/block_root_rollup_private_inputs.js';
|
|
28
25
|
import { CheckpointMergeRollupPrivateInputs } from '../rollup/checkpoint_merge_rollup_private_inputs.js';
|
|
@@ -81,8 +78,7 @@ export function makePublicInputsAndRecursiveProof<T, N extends number = typeof N
|
|
|
81
78
|
|
|
82
79
|
export const ProvingJobInputs = z.discriminatedUnion('type', [
|
|
83
80
|
AvmProvingRequestSchema,
|
|
84
|
-
z.object({ type: z.literal(ProvingRequestType.
|
|
85
|
-
z.object({ type: z.literal(ProvingRequestType.PARITY_ROOT), inputs: ParityRootPrivateInputs.schema }),
|
|
81
|
+
z.object({ type: z.literal(ProvingRequestType.INBOX_PARITY), inputs: InboxParityPrivateInputs.schema }),
|
|
86
82
|
z.object({
|
|
87
83
|
type: z.literal(ProvingRequestType.PUBLIC_CHONK_VERIFIER),
|
|
88
84
|
inputs: PublicChonkVerifierPrivateInputs.schema,
|
|
@@ -96,23 +92,15 @@ export const ProvingJobInputs = z.discriminatedUnion('type', [
|
|
|
96
92
|
inputs: PublicTxBaseRollupPrivateInputs.schema,
|
|
97
93
|
}),
|
|
98
94
|
z.object({ type: z.literal(ProvingRequestType.TX_MERGE_ROLLUP), inputs: TxMergeRollupPrivateInputs.schema }),
|
|
99
|
-
z.object({
|
|
100
|
-
type: z.literal(ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP),
|
|
101
|
-
inputs: BlockRootFirstRollupPrivateInputs.schema,
|
|
102
|
-
}),
|
|
103
|
-
z.object({
|
|
104
|
-
type: z.literal(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP),
|
|
105
|
-
inputs: BlockRootSingleTxFirstRollupPrivateInputs.schema,
|
|
106
|
-
}),
|
|
107
|
-
z.object({
|
|
108
|
-
type: z.literal(ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP),
|
|
109
|
-
inputs: BlockRootEmptyTxFirstRollupPrivateInputs.schema,
|
|
110
|
-
}),
|
|
111
95
|
z.object({ type: z.literal(ProvingRequestType.BLOCK_ROOT_ROLLUP), inputs: BlockRootRollupPrivateInputs.schema }),
|
|
112
96
|
z.object({
|
|
113
97
|
type: z.literal(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP),
|
|
114
98
|
inputs: BlockRootSingleTxRollupPrivateInputs.schema,
|
|
115
99
|
}),
|
|
100
|
+
z.object({
|
|
101
|
+
type: z.literal(ProvingRequestType.BLOCK_ROOT_NO_TXS_ROLLUP),
|
|
102
|
+
inputs: BlockRootNoTxsRollupPrivateInputs.schema,
|
|
103
|
+
}),
|
|
116
104
|
z.object({ type: z.literal(ProvingRequestType.BLOCK_MERGE_ROLLUP), inputs: BlockMergeRollupPrivateInputs.schema }),
|
|
117
105
|
z.object({
|
|
118
106
|
type: z.literal(ProvingRequestType.CHECKPOINT_ROOT_ROLLUP),
|
|
@@ -145,16 +133,12 @@ export function getProvingJobInputClassFor(type: ProvingRequestType) {
|
|
|
145
133
|
return PublicTxBaseRollupPrivateInputs;
|
|
146
134
|
case ProvingRequestType.TX_MERGE_ROLLUP:
|
|
147
135
|
return TxMergeRollupPrivateInputs;
|
|
148
|
-
case ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP:
|
|
149
|
-
return BlockRootFirstRollupPrivateInputs;
|
|
150
|
-
case ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP:
|
|
151
|
-
return BlockRootSingleTxFirstRollupPrivateInputs;
|
|
152
|
-
case ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP:
|
|
153
|
-
return BlockRootEmptyTxFirstRollupPrivateInputs;
|
|
154
136
|
case ProvingRequestType.BLOCK_ROOT_ROLLUP:
|
|
155
137
|
return BlockRootRollupPrivateInputs;
|
|
156
138
|
case ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP:
|
|
157
139
|
return BlockRootSingleTxRollupPrivateInputs;
|
|
140
|
+
case ProvingRequestType.BLOCK_ROOT_NO_TXS_ROLLUP:
|
|
141
|
+
return BlockRootNoTxsRollupPrivateInputs;
|
|
158
142
|
case ProvingRequestType.BLOCK_MERGE_ROLLUP:
|
|
159
143
|
return BlockMergeRollupPrivateInputs;
|
|
160
144
|
case ProvingRequestType.CHECKPOINT_ROOT_ROLLUP:
|
|
@@ -167,10 +151,8 @@ export function getProvingJobInputClassFor(type: ProvingRequestType) {
|
|
|
167
151
|
return CheckpointMergeRollupPrivateInputs;
|
|
168
152
|
case ProvingRequestType.ROOT_ROLLUP:
|
|
169
153
|
return RootRollupPrivateInputs;
|
|
170
|
-
case ProvingRequestType.
|
|
171
|
-
return
|
|
172
|
-
case ProvingRequestType.PARITY_ROOT:
|
|
173
|
-
return ParityRootPrivateInputs;
|
|
154
|
+
case ProvingRequestType.INBOX_PARITY:
|
|
155
|
+
return InboxParityPrivateInputs;
|
|
174
156
|
default: {
|
|
175
157
|
const _exhaustive: never = type;
|
|
176
158
|
throw new Error(`Cannot find circuit inputs class for proving type ${type}`);
|
|
@@ -186,19 +168,16 @@ export type ProvingJobInputsMap = {
|
|
|
186
168
|
[ProvingRequestType.PRIVATE_TX_BASE_ROLLUP]: PrivateTxBaseRollupPrivateInputs;
|
|
187
169
|
[ProvingRequestType.PUBLIC_TX_BASE_ROLLUP]: PublicTxBaseRollupPrivateInputs;
|
|
188
170
|
[ProvingRequestType.TX_MERGE_ROLLUP]: TxMergeRollupPrivateInputs;
|
|
189
|
-
[ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP]: BlockRootFirstRollupPrivateInputs;
|
|
190
|
-
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP]: BlockRootSingleTxFirstRollupPrivateInputs;
|
|
191
|
-
[ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP]: BlockRootEmptyTxFirstRollupPrivateInputs;
|
|
192
171
|
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: BlockRootRollupPrivateInputs;
|
|
193
172
|
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP]: BlockRootSingleTxRollupPrivateInputs;
|
|
173
|
+
[ProvingRequestType.BLOCK_ROOT_NO_TXS_ROLLUP]: BlockRootNoTxsRollupPrivateInputs;
|
|
194
174
|
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: BlockMergeRollupPrivateInputs;
|
|
195
175
|
[ProvingRequestType.CHECKPOINT_ROOT_ROLLUP]: CheckpointRootRollupPrivateInputs;
|
|
196
176
|
[ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP]: CheckpointRootSingleBlockRollupPrivateInputs;
|
|
197
177
|
[ProvingRequestType.CHECKPOINT_PADDING_ROLLUP]: CheckpointPaddingRollupPrivateInputs;
|
|
198
178
|
[ProvingRequestType.CHECKPOINT_MERGE_ROLLUP]: CheckpointMergeRollupPrivateInputs;
|
|
199
179
|
[ProvingRequestType.ROOT_ROLLUP]: RootRollupPrivateInputs;
|
|
200
|
-
[ProvingRequestType.
|
|
201
|
-
[ProvingRequestType.PARITY_ROOT]: ParityRootPrivateInputs;
|
|
180
|
+
[ProvingRequestType.INBOX_PARITY]: InboxParityPrivateInputs;
|
|
202
181
|
};
|
|
203
182
|
|
|
204
183
|
export const ProvingJobResult = z.discriminatedUnion('type', [
|
|
@@ -235,35 +214,21 @@ export const ProvingJobResult = z.discriminatedUnion('type', [
|
|
|
235
214
|
),
|
|
236
215
|
}),
|
|
237
216
|
z.object({
|
|
238
|
-
type: z.literal(ProvingRequestType.
|
|
239
|
-
result: schemaForPublicInputsAndRecursiveProof(
|
|
240
|
-
BlockRollupPublicInputs.schema,
|
|
241
|
-
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
242
|
-
),
|
|
243
|
-
}),
|
|
244
|
-
z.object({
|
|
245
|
-
type: z.literal(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP),
|
|
246
|
-
result: schemaForPublicInputsAndRecursiveProof(
|
|
247
|
-
BlockRollupPublicInputs.schema,
|
|
248
|
-
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
249
|
-
),
|
|
250
|
-
}),
|
|
251
|
-
z.object({
|
|
252
|
-
type: z.literal(ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP),
|
|
217
|
+
type: z.literal(ProvingRequestType.BLOCK_ROOT_ROLLUP),
|
|
253
218
|
result: schemaForPublicInputsAndRecursiveProof(
|
|
254
219
|
BlockRollupPublicInputs.schema,
|
|
255
220
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
256
221
|
),
|
|
257
222
|
}),
|
|
258
223
|
z.object({
|
|
259
|
-
type: z.literal(ProvingRequestType.
|
|
224
|
+
type: z.literal(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP),
|
|
260
225
|
result: schemaForPublicInputsAndRecursiveProof(
|
|
261
226
|
BlockRollupPublicInputs.schema,
|
|
262
227
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
263
228
|
),
|
|
264
229
|
}),
|
|
265
230
|
z.object({
|
|
266
|
-
type: z.literal(ProvingRequestType.
|
|
231
|
+
type: z.literal(ProvingRequestType.BLOCK_ROOT_NO_TXS_ROLLUP),
|
|
267
232
|
result: schemaForPublicInputsAndRecursiveProof(
|
|
268
233
|
BlockRollupPublicInputs.schema,
|
|
269
234
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
@@ -309,13 +274,9 @@ export const ProvingJobResult = z.discriminatedUnion('type', [
|
|
|
309
274
|
result: schemaForPublicInputsAndRecursiveProof(RootRollupPublicInputs.schema, NESTED_RECURSIVE_PROOF_LENGTH),
|
|
310
275
|
}),
|
|
311
276
|
z.object({
|
|
312
|
-
type: z.literal(ProvingRequestType.
|
|
277
|
+
type: z.literal(ProvingRequestType.INBOX_PARITY),
|
|
313
278
|
result: schemaForPublicInputsAndRecursiveProof(ParityPublicInputs.schema, RECURSIVE_PROOF_LENGTH),
|
|
314
279
|
}),
|
|
315
|
-
z.object({
|
|
316
|
-
type: z.literal(ProvingRequestType.PARITY_ROOT),
|
|
317
|
-
result: schemaForPublicInputsAndRecursiveProof(ParityPublicInputs.schema, NESTED_RECURSIVE_PROOF_LENGTH),
|
|
318
|
-
}),
|
|
319
280
|
]);
|
|
320
281
|
export type ProvingJobResult = z.infer<typeof ProvingJobResult>;
|
|
321
282
|
export type ProvingJobResultsMap = {
|
|
@@ -336,15 +297,7 @@ export type ProvingJobResultsMap = {
|
|
|
336
297
|
TxRollupPublicInputs,
|
|
337
298
|
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
338
299
|
>;
|
|
339
|
-
[ProvingRequestType.
|
|
340
|
-
BlockRollupPublicInputs,
|
|
341
|
-
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
342
|
-
>;
|
|
343
|
-
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP]: PublicInputsAndRecursiveProof<
|
|
344
|
-
BlockRollupPublicInputs,
|
|
345
|
-
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
346
|
-
>;
|
|
347
|
-
[ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP]: PublicInputsAndRecursiveProof<
|
|
300
|
+
[ProvingRequestType.BLOCK_ROOT_NO_TXS_ROLLUP]: PublicInputsAndRecursiveProof<
|
|
348
301
|
BlockRollupPublicInputs,
|
|
349
302
|
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
350
303
|
>;
|
|
@@ -377,11 +330,7 @@ export type ProvingJobResultsMap = {
|
|
|
377
330
|
typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
|
|
378
331
|
>;
|
|
379
332
|
[ProvingRequestType.ROOT_ROLLUP]: PublicInputsAndRecursiveProof<RootRollupPublicInputs>;
|
|
380
|
-
[ProvingRequestType.
|
|
381
|
-
[ProvingRequestType.PARITY_ROOT]: PublicInputsAndRecursiveProof<
|
|
382
|
-
ParityPublicInputs,
|
|
383
|
-
typeof NESTED_RECURSIVE_PROOF_LENGTH
|
|
384
|
-
>;
|
|
333
|
+
[ProvingRequestType.INBOX_PARITY]: PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>;
|
|
385
334
|
};
|
|
386
335
|
|
|
387
336
|
export type ProvingRequestResultFor<T extends ProvingRequestType> = { type: T; result: ProvingJobResultsMap[T] };
|
|
@@ -6,17 +6,14 @@ import type {
|
|
|
6
6
|
} from '@aztec/constants';
|
|
7
7
|
|
|
8
8
|
import type { AvmCircuitInputs } from '../avm/avm.js';
|
|
9
|
-
import type {
|
|
9
|
+
import type { InboxParityPrivateInputs } from '../parity/inbox_parity_private_inputs.js';
|
|
10
10
|
import type { ParityPublicInputs } from '../parity/parity_public_inputs.js';
|
|
11
|
-
import type { ParityRootPrivateInputs } from '../parity/parity_root_private_inputs.js';
|
|
12
11
|
import type { RecursiveProof } from '../proofs/recursive_proof.js';
|
|
13
12
|
import type { BlockMergeRollupPrivateInputs } from '../rollup/block_merge_rollup_private_inputs.js';
|
|
14
13
|
import type { BlockRollupPublicInputs } from '../rollup/block_rollup_public_inputs.js';
|
|
15
14
|
import type {
|
|
16
|
-
|
|
17
|
-
BlockRootFirstRollupPrivateInputs,
|
|
15
|
+
BlockRootNoTxsRollupPrivateInputs,
|
|
18
16
|
BlockRootRollupPrivateInputs,
|
|
19
|
-
BlockRootSingleTxFirstRollupPrivateInputs,
|
|
20
17
|
BlockRootSingleTxRollupPrivateInputs,
|
|
21
18
|
} from '../rollup/block_root_rollup_private_inputs.js';
|
|
22
19
|
import type { CheckpointMergeRollupPrivateInputs } from '../rollup/checkpoint_merge_rollup_private_inputs.js';
|
|
@@ -42,25 +39,16 @@ import type { PublicInputsAndRecursiveProof } from './proving-job.js';
|
|
|
42
39
|
*/
|
|
43
40
|
export interface ServerCircuitProver {
|
|
44
41
|
/**
|
|
45
|
-
* Creates
|
|
46
|
-
*
|
|
42
|
+
* Creates the checkpoint's single InboxParity proof. The circuit variant (ladder size) is selected from
|
|
43
|
+
* `inputs.size`.
|
|
44
|
+
* @param inputs - Input to the circuit.
|
|
47
45
|
*/
|
|
48
|
-
|
|
49
|
-
inputs:
|
|
46
|
+
getInboxParityProof(
|
|
47
|
+
inputs: InboxParityPrivateInputs,
|
|
50
48
|
signal?: AbortSignal,
|
|
51
49
|
epochNumber?: number,
|
|
52
50
|
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof RECURSIVE_PROOF_LENGTH>>;
|
|
53
51
|
|
|
54
|
-
/**
|
|
55
|
-
* Creates a proof for the given input.
|
|
56
|
-
* @param input - Input to the circuit.
|
|
57
|
-
*/
|
|
58
|
-
getRootParityProof(
|
|
59
|
-
inputs: ParityRootPrivateInputs,
|
|
60
|
-
signal?: AbortSignal,
|
|
61
|
-
epochNumber?: number,
|
|
62
|
-
): Promise<PublicInputsAndRecursiveProof<ParityPublicInputs, typeof NESTED_RECURSIVE_PROOF_LENGTH>>;
|
|
63
|
-
|
|
64
52
|
getPublicChonkVerifierProof(
|
|
65
53
|
inputs: PublicChonkVerifierPrivateInputs,
|
|
66
54
|
signal?: AbortSignal,
|
|
@@ -99,24 +87,6 @@ export interface ServerCircuitProver {
|
|
|
99
87
|
* Creates a proof for the given input.
|
|
100
88
|
* @param input - Input to the circuit.
|
|
101
89
|
*/
|
|
102
|
-
getBlockRootFirstRollupProof(
|
|
103
|
-
input: BlockRootFirstRollupPrivateInputs,
|
|
104
|
-
signal?: AbortSignal,
|
|
105
|
-
epochNumber?: number,
|
|
106
|
-
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
107
|
-
|
|
108
|
-
getBlockRootSingleTxFirstRollupProof(
|
|
109
|
-
input: BlockRootSingleTxFirstRollupPrivateInputs,
|
|
110
|
-
signal?: AbortSignal,
|
|
111
|
-
epochNumber?: number,
|
|
112
|
-
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
113
|
-
|
|
114
|
-
getBlockRootEmptyTxFirstRollupProof(
|
|
115
|
-
input: BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
116
|
-
signal?: AbortSignal,
|
|
117
|
-
epochNumber?: number,
|
|
118
|
-
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
119
|
-
|
|
120
90
|
getBlockRootRollupProof(
|
|
121
91
|
input: BlockRootRollupPrivateInputs,
|
|
122
92
|
signal?: AbortSignal,
|
|
@@ -129,6 +99,12 @@ export interface ServerCircuitProver {
|
|
|
129
99
|
epochNumber?: number,
|
|
130
100
|
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
131
101
|
|
|
102
|
+
getBlockRootNoTxsRollupProof(
|
|
103
|
+
input: BlockRootNoTxsRollupPrivateInputs,
|
|
104
|
+
signal?: AbortSignal,
|
|
105
|
+
epochNumber?: number,
|
|
106
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
107
|
+
|
|
132
108
|
/**
|
|
133
109
|
* Creates a proof for the given input.
|
|
134
110
|
* @param input - Input to the circuit.
|
|
@@ -11,6 +11,8 @@ import type {
|
|
|
11
11
|
CheckpointAttestation,
|
|
12
12
|
CheckpointProposal,
|
|
13
13
|
CheckpointProposalOptions,
|
|
14
|
+
ValidatedBlockProposal,
|
|
15
|
+
ValidatedCheckpointProposalCore,
|
|
14
16
|
} from '@aztec/stdlib/p2p';
|
|
15
17
|
import type { CheckpointHeader } from '@aztec/stdlib/rollup';
|
|
16
18
|
import type { BlockHeader, Tx } from '@aztec/stdlib/tx';
|
|
@@ -153,7 +155,6 @@ export interface Validator {
|
|
|
153
155
|
blockHeader: BlockHeader,
|
|
154
156
|
checkpointNumber: CheckpointNumber,
|
|
155
157
|
indexWithinCheckpoint: number,
|
|
156
|
-
inHash: Fr,
|
|
157
158
|
archive: Fr,
|
|
158
159
|
txs: Tx[],
|
|
159
160
|
proposerAddress: EthAddress | undefined,
|
|
@@ -172,18 +173,18 @@ export interface Validator {
|
|
|
172
173
|
): Promise<CheckpointProposal>;
|
|
173
174
|
|
|
174
175
|
/**
|
|
175
|
-
* Validate a block proposal from a peer.
|
|
176
|
+
* Validate a block proposal from a peer that has already passed p2p ingress validation.
|
|
176
177
|
* Note: Validators do NOT attest to individual blocks - attestations are only for checkpoint proposals.
|
|
177
178
|
* @returns true if the proposal is valid, false otherwise
|
|
178
179
|
*/
|
|
179
|
-
validateBlockProposal(proposal:
|
|
180
|
+
validateBlockProposal(proposal: ValidatedBlockProposal, sender: PeerId): Promise<boolean>;
|
|
180
181
|
|
|
181
182
|
/**
|
|
182
|
-
* Validate and attest to a checkpoint proposal from a peer.
|
|
183
|
+
* Validate and attest to a checkpoint proposal from a peer that has already passed p2p ingress validation.
|
|
183
184
|
* @returns Checkpoint attestations if valid, undefined otherwise
|
|
184
185
|
*/
|
|
185
186
|
attestToCheckpointProposal(
|
|
186
|
-
proposal:
|
|
187
|
+
proposal: ValidatedCheckpointProposalCore,
|
|
187
188
|
sender: PeerId,
|
|
188
189
|
): Promise<CheckpointAttestation[] | undefined>;
|
|
189
190
|
|
|
@@ -78,7 +78,7 @@ export interface ResetCatalogEntry {
|
|
|
78
78
|
cost: number;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
// Must match the
|
|
81
|
+
// Must match the shipped private_kernel_reset_config.json, loaded by @aztec/noir-protocol-circuits-types.
|
|
82
82
|
export interface PrivateKernelResetDimensionsConfig {
|
|
83
83
|
// Variants used for mid-tx resets that prevent overflow. Never the last kernel in the chain.
|
|
84
84
|
inner: ResetCatalogEntry[];
|
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
3
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
2
|
|
|
5
3
|
import type { MerkleTreeWriteOperations } from '../interfaces/merkle_tree_operations.js';
|
|
6
4
|
import { MerkleTreeId } from '../trees/merkle_tree_id.js';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* Appends a block's real L1→L2 message leaves (unpadded, at compact indices) to the L1→L2 message tree of `db`.
|
|
8
|
+
* Use whenever a fork at "state before a block" needs to mirror what the world-state
|
|
9
|
+
* synchronizer inserts at sync time.
|
|
12
10
|
*/
|
|
13
11
|
export async function appendL1ToL2MessagesToTree(db: MerkleTreeWriteOperations, l1ToL2Messages: Fr[]): Promise<void> {
|
|
14
|
-
|
|
15
|
-
l1ToL2Messages,
|
|
16
|
-
Fr.ZERO,
|
|
17
|
-
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
|
|
18
|
-
'Too many L1 to L2 messages',
|
|
19
|
-
);
|
|
20
|
-
await db.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, padded);
|
|
12
|
+
await db.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, l1ToL2Messages);
|
|
21
13
|
}
|