@aztec/stdlib 3.0.0-rc.5 → 4.0.0-nightly.20260107
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 +602 -4
- package/dest/abi/abi.d.ts.map +1 -1
- package/dest/abi/abi.js +7 -7
- package/dest/abi/function_selector.d.ts +2 -1
- package/dest/abi/function_selector.d.ts.map +1 -1
- package/dest/abi/function_selector.js +7 -0
- package/dest/abi/selector.js +3 -1
- package/dest/avm/avm.js +1 -1
- package/dest/avm/avm_accumulated_data.js +5 -2
- package/dest/avm/avm_circuit_public_inputs.js +3 -1
- package/dest/avm/public_data_update_request.js +3 -1
- package/dest/avm/public_inner_call_request.js +3 -1
- package/dest/avm/revert_code.js +3 -1
- package/dest/aztec-address/index.js +4 -2
- package/dest/block/body.js +3 -1
- package/dest/block/checkpointed_l2_block.d.ts +267 -0
- package/dest/block/checkpointed_l2_block.d.ts.map +1 -0
- package/dest/block/{published_l2_block.js → checkpointed_l2_block.js} +40 -4
- package/dest/block/index.d.ts +2 -2
- package/dest/block/index.d.ts.map +1 -1
- package/dest/block/index.js +1 -1
- package/dest/block/l2_block_header.js +3 -1
- package/dest/block/l2_block_new.d.ts +8 -3
- package/dest/block/l2_block_new.d.ts.map +1 -1
- package/dest/block/l2_block_new.js +10 -9
- package/dest/block/l2_block_source.d.ts +69 -45
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_stream/interfaces.d.ts +2 -2
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +6 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.js +9 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts +1 -1
- package/dest/block/test/l2_tips_store_test_suite.d.ts.map +1 -1
- package/dest/block/test/l2_tips_store_test_suite.js +2 -5
- package/dest/checkpoint/checkpoint.d.ts +17 -2
- package/dest/checkpoint/checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/checkpoint.js +42 -4
- package/dest/checkpoint/checkpoint_info.d.ts +9 -0
- package/dest/checkpoint/checkpoint_info.d.ts.map +1 -0
- package/dest/checkpoint/checkpoint_info.js +1 -0
- package/dest/checkpoint/published_checkpoint.d.ts +14 -8
- package/dest/checkpoint/published_checkpoint.d.ts.map +1 -1
- package/dest/checkpoint/published_checkpoint.js +11 -1
- package/dest/contract/contract_class_id.js +1 -1
- package/dest/contract/interfaces/contract_class.d.ts +11 -13
- package/dest/contract/interfaces/contract_class.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_class.js +18 -18
- package/dest/contract/interfaces/contract_instance.d.ts +12 -13
- package/dest/contract/interfaces/contract_instance.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance.js +5 -5
- package/dest/contract/interfaces/contract_instance_update.d.ts +6 -7
- package/dest/contract/interfaces/contract_instance_update.d.ts.map +1 -1
- package/dest/contract/interfaces/contract_instance_update.js +5 -5
- package/dest/database-version/version_manager.js +3 -1
- package/dest/epoch-helpers/index.d.ts +1 -1
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +3 -3
- package/dest/gas/gas.js +3 -1
- package/dest/gas/gas_fees.js +3 -1
- package/dest/hash/hash.d.ts +1 -9
- package/dest/hash/hash.d.ts.map +1 -1
- package/dest/hash/hash.js +0 -12
- package/dest/interfaces/allowed_element.d.ts +7 -8
- package/dest/interfaces/allowed_element.d.ts.map +1 -1
- package/dest/interfaces/allowed_element.js +3 -3
- package/dest/interfaces/archiver.d.ts +1 -1
- package/dest/interfaces/archiver.d.ts.map +1 -1
- package/dest/interfaces/archiver.js +8 -3
- package/dest/interfaces/aztec-node-admin.d.ts +29 -11
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +1 -1
- package/dest/interfaces/aztec-node.d.ts +10 -10
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +4 -4
- package/dest/interfaces/block-builder.d.ts +3 -2
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/block-builder.js +9 -1
- package/dest/interfaces/configs.d.ts +47 -23
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +11 -6
- package/dest/interfaces/get_logs_response.d.ts +19 -4
- package/dest/interfaces/get_logs_response.d.ts.map +1 -1
- package/dest/interfaces/get_logs_response.js +5 -4
- package/dest/interfaces/l2_logs_source.d.ts +12 -8
- package/dest/interfaces/l2_logs_source.d.ts.map +1 -1
- package/dest/interfaces/merkle_tree_operations.d.ts +2 -2
- package/dest/interfaces/merkle_tree_operations.d.ts.map +1 -1
- package/dest/interfaces/prover-client.d.ts +5 -3
- package/dest/interfaces/prover-client.d.ts.map +1 -1
- package/dest/interfaces/prover-client.js +5 -4
- package/dest/interfaces/proving-job.d.ts +168 -168
- package/dest/interfaces/server_circuit_prover.d.ts +2 -2
- package/dest/interfaces/server_circuit_prover.d.ts.map +1 -1
- package/dest/interfaces/slasher.d.ts +1 -1
- package/dest/interfaces/slasher.d.ts.map +1 -1
- package/dest/interfaces/slasher.js +3 -3
- package/dest/interfaces/validator.d.ts +7 -8
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +5 -5
- package/dest/interfaces/world_state.d.ts +17 -8
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/kernel/claimed_length_array.js +3 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.d.ts.map +1 -1
- package/dest/kernel/hints/find_private_kernel_reset_dimensions.js +1 -3
- package/dest/kernel/hints/transient_data_squashing_hint.js +3 -1
- package/dest/kernel/log_hash.js +3 -1
- package/dest/kernel/private_circuit_public_inputs.d.ts +47 -47
- package/dest/kernel/private_circuit_public_inputs.d.ts.map +1 -1
- package/dest/kernel/private_circuit_public_inputs.js +59 -59
- package/dest/kernel/private_log_data.js +5 -2
- package/dest/kernel/private_to_avm_accumulated_data.js +5 -2
- package/dest/kernel/private_to_public_accumulated_data.js +3 -1
- package/dest/kernel/private_to_rollup_accumulated_data.js +3 -1
- package/dest/kernel/private_validation_requests.js +3 -1
- package/dest/kernel/public_call_request.js +5 -2
- package/dest/logs/contract_class_log.js +3 -1
- package/dest/logs/extended_public_log.d.ts +7 -1
- package/dest/logs/extended_public_log.d.ts.map +1 -1
- package/dest/logs/index.d.ts +3 -2
- package/dest/logs/index.d.ts.map +1 -1
- package/dest/logs/index.js +2 -1
- package/dest/logs/log_id.d.ts +9 -1
- package/dest/logs/log_id.d.ts.map +1 -1
- package/dest/logs/log_id.js +15 -8
- package/dest/logs/private_log.d.ts +1 -1
- package/dest/logs/private_log.d.ts.map +1 -1
- package/dest/logs/private_log.js +5 -2
- package/dest/logs/public_log.js +3 -1
- package/dest/logs/siloed_tag.d.ts +23 -0
- package/dest/logs/siloed_tag.d.ts.map +1 -0
- package/dest/logs/siloed_tag.js +30 -0
- package/dest/logs/tag.d.ts +21 -0
- package/dest/logs/tag.d.ts.map +1 -0
- package/dest/logs/tag.js +30 -0
- package/dest/logs/tx_scoped_l2_log.d.ts +24 -33
- package/dest/logs/tx_scoped_l2_log.d.ts.map +1 -1
- package/dest/logs/tx_scoped_l2_log.js +37 -43
- package/dest/messaging/l1_to_l2_message.d.ts +1 -1
- package/dest/messaging/l1_to_l2_message.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.d.ts +1 -3
- package/dest/rollup/avm_proof_data.d.ts.map +1 -1
- package/dest/rollup/avm_proof_data.js +1 -9
- package/dest/rollup/block_rollup_public_inputs.d.ts +4 -9
- package/dest/rollup/block_rollup_public_inputs.d.ts.map +1 -1
- package/dest/rollup/block_rollup_public_inputs.js +6 -10
- package/dest/rollup/checkpoint_constant_data.d.ts +2 -1
- package/dest/rollup/checkpoint_constant_data.d.ts.map +1 -1
- package/dest/rollup/checkpoint_constant_data.js +4 -1
- package/dest/rollup/checkpoint_header.d.ts +5 -1
- package/dest/rollup/checkpoint_header.d.ts.map +1 -1
- package/dest/rollup/checkpoint_header.js +7 -2
- package/dest/schemas/schemas.d.ts +4 -2
- package/dest/schemas/schemas.d.ts.map +1 -1
- package/dest/schemas/schemas.js +2 -1
- package/dest/slashing/types.d.ts +4 -5
- package/dest/slashing/types.d.ts.map +1 -1
- package/dest/slashing/types.js +5 -5
- package/dest/snapshots/types.d.ts +1 -1
- package/dest/snapshots/types.d.ts.map +1 -1
- package/dest/snapshots/types.js +5 -5
- package/dest/stats/stats.d.ts +10 -6
- package/dest/stats/stats.d.ts.map +1 -1
- package/dest/tests/factories.d.ts +24 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +21 -1
- package/dest/tests/mocks.d.ts +5 -4
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +18 -5
- package/dest/trees/append_only_tree_snapshot.js +3 -1
- package/dest/tx/block_header.d.ts +8 -7
- package/dest/tx/block_header.d.ts.map +1 -1
- package/dest/tx/block_header.js +8 -2
- package/dest/tx/call_context.js +3 -1
- package/dest/tx/global_variable_builder.d.ts +4 -2
- package/dest/tx/global_variable_builder.d.ts.map +1 -1
- package/dest/tx/global_variables.d.ts +6 -1
- package/dest/tx/global_variables.d.ts.map +1 -1
- package/dest/tx/global_variables.js +3 -1
- package/dest/tx/private_execution_result.d.ts +1 -1
- package/dest/tx/private_execution_result.js +1 -1
- package/dest/tx/public_call_request_with_calldata.js +3 -1
- package/dest/tx/simulated_tx.d.ts +1031 -7
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/state_reference.js +3 -1
- package/dest/tx/tree_snapshots.js +3 -1
- package/dest/tx/tx.d.ts +10 -3
- package/dest/tx/tx.d.ts.map +1 -1
- package/dest/tx/tx.js +9 -2
- package/dest/tx/tx_effect.d.ts +1 -1
- package/dest/tx/tx_effect.d.ts.map +1 -1
- package/dest/tx/tx_effect.js +6 -2
- package/dest/tx/tx_execution_request.js +3 -1
- package/dest/tx/validator/tx_validator.d.ts +1 -4
- package/dest/tx/validator/tx_validator.d.ts.map +1 -1
- package/dest/tx/validator/tx_validator.js +4 -4
- package/dest/validators/schemas.d.ts +1 -1
- package/dest/validators/schemas.d.ts.map +1 -1
- package/dest/validators/schemas.js +13 -13
- package/package.json +8 -8
- package/src/abi/abi.ts +39 -33
- package/src/abi/function_selector.ts +8 -0
- package/src/avm/avm.ts +1 -1
- package/src/block/{published_l2_block.ts → checkpointed_l2_block.ts} +58 -3
- package/src/block/index.ts +1 -1
- package/src/block/l2_block_new.ts +17 -7
- package/src/block/l2_block_source.ts +78 -50
- package/src/block/l2_block_stream/interfaces.ts +1 -1
- package/src/block/l2_block_stream/l2_block_stream.ts +9 -0
- package/src/block/test/l2_tips_store_test_suite.ts +2 -1
- package/src/checkpoint/checkpoint.ts +51 -4
- package/src/checkpoint/checkpoint_info.ts +9 -0
- package/src/checkpoint/published_checkpoint.ts +19 -5
- package/src/contract/contract_class_id.ts +1 -1
- package/src/contract/interfaces/contract_class.ts +59 -46
- package/src/contract/interfaces/contract_instance.ts +15 -13
- package/src/contract/interfaces/contract_instance_update.ts +11 -9
- package/src/epoch-helpers/index.ts +11 -9
- package/src/hash/hash.ts +0 -11
- package/src/interfaces/allowed_element.ts +9 -7
- package/src/interfaces/archiver.ts +12 -4
- package/src/interfaces/aztec-node-admin.ts +2 -2
- package/src/interfaces/aztec-node.ts +18 -15
- package/src/interfaces/block-builder.ts +11 -1
- package/src/interfaces/configs.ts +64 -33
- package/src/interfaces/get_logs_response.ts +13 -9
- package/src/interfaces/l2_logs_source.ts +12 -7
- package/src/interfaces/merkle_tree_operations.ts +4 -1
- package/src/interfaces/prover-client.ts +13 -10
- package/src/interfaces/server_circuit_prover.ts +0 -1
- package/src/interfaces/slasher.ts +24 -22
- package/src/interfaces/validator.ts +22 -18
- package/src/interfaces/world_state.ts +16 -9
- package/src/kernel/hints/find_private_kernel_reset_dimensions.ts +2 -4
- package/src/kernel/private_circuit_public_inputs.ts +85 -85
- package/src/logs/index.ts +2 -1
- package/src/logs/log_id.ts +16 -6
- package/src/logs/private_log.ts +2 -1
- package/src/logs/siloed_tag.ts +44 -0
- package/src/logs/tag.ts +42 -0
- package/src/logs/tx_scoped_l2_log.ts +45 -43
- package/src/messaging/l1_to_l2_message.ts +1 -0
- package/src/rollup/avm_proof_data.ts +0 -7
- package/src/rollup/block_rollup_public_inputs.ts +3 -9
- package/src/rollup/checkpoint_constant_data.ts +1 -0
- package/src/rollup/checkpoint_header.ts +4 -0
- package/src/schemas/schemas.ts +4 -0
- package/src/slashing/types.ts +24 -20
- package/src/snapshots/types.ts +33 -29
- package/src/stats/stats.ts +10 -5
- package/src/tests/factories.ts +45 -1
- package/src/tests/mocks.ts +15 -3
- package/src/tx/block_header.ts +12 -7
- package/src/tx/global_variable_builder.ts +8 -1
- package/src/tx/global_variables.ts +6 -0
- package/src/tx/private_execution_result.ts +1 -1
- package/src/tx/tx.ts +9 -2
- package/src/tx/tx_effect.ts +3 -1
- package/src/tx/validator/tx_validator.ts +8 -6
- package/src/validators/schemas.ts +54 -48
- package/dest/block/published_l2_block.d.ts +0 -130
- package/dest/block/published_l2_block.d.ts.map +0 -1
- package/dest/logs/log_with_tx_data.d.ts +0 -19
- package/dest/logs/log_with_tx_data.d.ts.map +0 -1
- package/dest/logs/log_with_tx_data.js +0 -49
- package/src/logs/log_with_tx_data.ts +0 -46
|
@@ -3,7 +3,7 @@ import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
import type { AztecAddress } from '../../aztec-address/index.js';
|
|
6
|
-
import {
|
|
6
|
+
import { schemas, zodFor } from '../../schemas/index.js';
|
|
7
7
|
import type { UInt64 } from '../../types/shared.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -20,12 +20,14 @@ export interface ContractInstanceUpdate {
|
|
|
20
20
|
|
|
21
21
|
export type ContractInstanceUpdateWithAddress = ContractInstanceUpdate & { address: AztecAddress };
|
|
22
22
|
|
|
23
|
-
export const ContractInstanceUpdateSchema =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
export const ContractInstanceUpdateSchema = zodFor<ContractInstanceUpdate>()(
|
|
24
|
+
z.object({
|
|
25
|
+
prevContractClassId: schemas.Fr,
|
|
26
|
+
newContractClassId: schemas.Fr,
|
|
27
|
+
timestampOfChange: schemas.BigInt,
|
|
28
|
+
}),
|
|
29
|
+
);
|
|
28
30
|
|
|
29
|
-
export const ContractInstanceUpdateWithAddressSchema =
|
|
30
|
-
z.object({ address: schemas.AztecAddress }),
|
|
31
|
-
)
|
|
31
|
+
export const ContractInstanceUpdateWithAddressSchema = zodFor<ContractInstanceUpdateWithAddress>()(
|
|
32
|
+
ContractInstanceUpdateSchema.and(z.object({ address: schemas.AztecAddress })),
|
|
33
|
+
);
|
|
@@ -2,7 +2,7 @@ import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { schemas, zodFor } from '../schemas/index.js';
|
|
6
6
|
|
|
7
7
|
export type L1RollupConstants = {
|
|
8
8
|
l1StartBlock: bigint;
|
|
@@ -22,14 +22,16 @@ export const EmptyL1RollupConstants: L1RollupConstants = {
|
|
|
22
22
|
proofSubmissionEpochs: 1,
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
export const L1RollupConstantsSchema =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
export const L1RollupConstantsSchema = zodFor<L1RollupConstants>()(
|
|
26
|
+
z.object({
|
|
27
|
+
l1StartBlock: schemas.BigInt,
|
|
28
|
+
l1GenesisTime: schemas.BigInt,
|
|
29
|
+
slotDuration: z.number(),
|
|
30
|
+
epochDuration: z.number(),
|
|
31
|
+
ethereumSlotDuration: z.number(),
|
|
32
|
+
proofSubmissionEpochs: z.number(),
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
33
35
|
|
|
34
36
|
/** Returns the timestamp for a given L2 slot. */
|
|
35
37
|
export function getTimestampForSlot(
|
package/src/hash/hash.ts
CHANGED
|
@@ -69,17 +69,6 @@ export function computeProtocolNullifier(txRequestHash: Fr): Promise<Fr> {
|
|
|
69
69
|
return siloNullifier(AztecAddress.fromBigInt(NULL_MSG_SENDER_CONTRACT_ADDRESS), txRequestHash);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
/**
|
|
73
|
-
* Computes a siloed private log tag, given the contract address and the unsiloed tag.
|
|
74
|
-
* A siloed private log tag effectively namespaces a log to a specific contract.
|
|
75
|
-
* @param contract - The contract address.
|
|
76
|
-
* @param unsiloedTag - The unsiloed tag.
|
|
77
|
-
* @returns A siloed private log tag.
|
|
78
|
-
*/
|
|
79
|
-
export function siloPrivateLog(contract: AztecAddress, unsiloedTag: Fr): Promise<Fr> {
|
|
80
|
-
return poseidon2Hash([contract, unsiloedTag]);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
72
|
/**
|
|
84
73
|
* Computes a public data tree value ready for insertion.
|
|
85
74
|
* @param value - Raw public data tree value to hash into a tree-insertion-ready value.
|
|
@@ -4,7 +4,7 @@ import { z } from 'zod';
|
|
|
4
4
|
|
|
5
5
|
import type { FunctionSelector } from '../abi/function_selector.js';
|
|
6
6
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
7
|
-
import {
|
|
7
|
+
import { schemas, zodFor } from '../schemas/index.js';
|
|
8
8
|
|
|
9
9
|
type AllowedInstance = { address: AztecAddress };
|
|
10
10
|
type AllowedInstanceFunction = { address: AztecAddress; selector: FunctionSelector };
|
|
@@ -13,9 +13,11 @@ type AllowedClassFunction = { classId: Fr; selector: FunctionSelector };
|
|
|
13
13
|
|
|
14
14
|
export type AllowedElement = AllowedInstance | AllowedInstanceFunction | AllowedClass | AllowedClassFunction;
|
|
15
15
|
|
|
16
|
-
export const AllowedElementSchema =
|
|
17
|
-
z.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
export const AllowedElementSchema = zodFor<AllowedElement>()(
|
|
17
|
+
z.union([
|
|
18
|
+
z.object({ address: schemas.AztecAddress, selector: schemas.FunctionSelector }),
|
|
19
|
+
z.object({ address: schemas.AztecAddress }),
|
|
20
|
+
z.object({ classId: schemas.Fr, selector: schemas.FunctionSelector }),
|
|
21
|
+
z.object({ classId: schemas.Fr }),
|
|
22
|
+
]),
|
|
23
|
+
);
|
|
@@ -4,9 +4,10 @@ import type { ApiSchemaFor } from '@aztec/foundation/schemas';
|
|
|
4
4
|
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
|
|
7
|
+
import { CheckpointedL2Block, PublishedL2Block } from '../block/checkpointed_l2_block.js';
|
|
7
8
|
import { L2Block } from '../block/l2_block.js';
|
|
9
|
+
import { L2BlockNew } from '../block/l2_block_new.js';
|
|
8
10
|
import { type L2BlockSource, L2TipsSchema } from '../block/l2_block_source.js';
|
|
9
|
-
import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
10
11
|
import { ValidateBlockResultSchema } from '../block/validate_block_result.js';
|
|
11
12
|
import { Checkpoint } from '../checkpoint/checkpoint.js';
|
|
12
13
|
import { PublishedCheckpoint } from '../checkpoint/published_checkpoint.js';
|
|
@@ -17,6 +18,8 @@ import {
|
|
|
17
18
|
} from '../contract/index.js';
|
|
18
19
|
import { L1RollupConstantsSchema } from '../epoch-helpers/index.js';
|
|
19
20
|
import { LogFilterSchema } from '../logs/log_filter.js';
|
|
21
|
+
import { SiloedTag } from '../logs/siloed_tag.js';
|
|
22
|
+
import { Tag } from '../logs/tag.js';
|
|
20
23
|
import { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
|
|
21
24
|
import type { L1ToL2MessageSource } from '../messaging/l1_to_l2_message_source.js';
|
|
22
25
|
import { optional, schemas } from '../schemas/schemas.js';
|
|
@@ -85,6 +88,7 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
85
88
|
.function()
|
|
86
89
|
.args(z.union([BlockNumberSchema, z.literal('latest')]))
|
|
87
90
|
.returns(BlockHeader.schema.optional()),
|
|
91
|
+
getCheckpointedBlock: z.function().args(BlockNumberSchema).returns(CheckpointedL2Block.schema.optional()),
|
|
88
92
|
getBlocks: z
|
|
89
93
|
.function()
|
|
90
94
|
.args(BlockNumberSchema, schemas.Integer, optional(z.boolean()))
|
|
@@ -93,7 +97,6 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
93
97
|
.function()
|
|
94
98
|
.args(CheckpointNumberSchema, schemas.Integer)
|
|
95
99
|
.returns(z.array(PublishedCheckpoint.schema)),
|
|
96
|
-
getCheckpointByArchive: z.function().args(schemas.Fr).returns(Checkpoint.schema.optional()),
|
|
97
100
|
getPublishedBlocks: z
|
|
98
101
|
.function()
|
|
99
102
|
.args(BlockNumberSchema, schemas.Integer, optional(z.boolean()))
|
|
@@ -102,6 +105,7 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
102
105
|
getPublishedBlockByArchive: z.function().args(schemas.Fr).returns(PublishedL2Block.schema.optional()),
|
|
103
106
|
getBlockHeaderByHash: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
|
|
104
107
|
getBlockHeaderByArchive: z.function().args(schemas.Fr).returns(BlockHeader.schema.optional()),
|
|
108
|
+
getL2BlockNew: z.function().args(BlockNumberSchema).returns(L2BlockNew.schema.optional()),
|
|
105
109
|
getTxEffect: z.function().args(TxHash.schema).returns(indexedTxSchema().optional()),
|
|
106
110
|
getSettledTxReceipt: z.function().args(TxHash.schema).returns(TxReceipt.schema.optional()),
|
|
107
111
|
getL2SlotNumber: z.function().args().returns(schemas.SlotNumber.optional()),
|
|
@@ -111,9 +115,13 @@ export const ArchiverApiSchema: ApiSchemaFor<ArchiverApi> = {
|
|
|
111
115
|
getBlockHeadersForEpoch: z.function().args(EpochNumberSchema).returns(z.array(BlockHeader.schema)),
|
|
112
116
|
isEpochComplete: z.function().args(EpochNumberSchema).returns(z.boolean()),
|
|
113
117
|
getL2Tips: z.function().args().returns(L2TipsSchema),
|
|
114
|
-
|
|
118
|
+
getPrivateLogsByTags: z
|
|
115
119
|
.function()
|
|
116
|
-
.args(z.array(
|
|
120
|
+
.args(z.array(SiloedTag.schema))
|
|
121
|
+
.returns(z.array(z.array(TxScopedL2Log.schema))),
|
|
122
|
+
getPublicLogsByTagsFromContract: z
|
|
123
|
+
.function()
|
|
124
|
+
.args(schemas.AztecAddress, z.array(Tag.schema))
|
|
117
125
|
.returns(z.array(z.array(TxScopedL2Log.schema))),
|
|
118
126
|
getPublicLogs: z.function().args(LogFilterSchema).returns(GetPublicLogsResponseSchema),
|
|
119
127
|
getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
|
|
@@ -57,7 +57,7 @@ export type AztecNodeAdminConfig = ValidatorClientFullConfig &
|
|
|
57
57
|
ProverConfig &
|
|
58
58
|
SlasherConfig &
|
|
59
59
|
Pick<ArchiverSpecificConfig, 'archiverPollingIntervalMS' | 'skipValidateBlockAttestations' | 'archiverBatchSize'> & {
|
|
60
|
-
|
|
60
|
+
maxPendingTxCount: number;
|
|
61
61
|
};
|
|
62
62
|
|
|
63
63
|
export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConfigSchema)
|
|
@@ -70,7 +70,7 @@ export const AztecNodeAdminConfigSchema = SequencerConfigSchema.merge(ProverConf
|
|
|
70
70
|
archiverBatchSize: true,
|
|
71
71
|
}),
|
|
72
72
|
)
|
|
73
|
-
.merge(z.object({
|
|
73
|
+
.merge(z.object({ maxPendingTxCount: z.number() }));
|
|
74
74
|
|
|
75
75
|
export const AztecNodeAdminApiSchema: ApiSchemaFor<AztecNodeAdmin> = {
|
|
76
76
|
getConfig: z.function().returns(AztecNodeAdminConfigSchema),
|
|
@@ -21,10 +21,10 @@ import { z } from 'zod';
|
|
|
21
21
|
|
|
22
22
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
23
23
|
import { type BlockParameter, BlockParameterSchema } from '../block/block_parameter.js';
|
|
24
|
+
import { PublishedL2Block } from '../block/checkpointed_l2_block.js';
|
|
24
25
|
import { type DataInBlock, dataInBlockSchemaFor } from '../block/in_block.js';
|
|
25
26
|
import { L2Block } from '../block/l2_block.js';
|
|
26
27
|
import { type L2BlockSource, type L2Tips, L2TipsSchema } from '../block/l2_block_source.js';
|
|
27
|
-
import { PublishedL2Block } from '../block/published_l2_block.js';
|
|
28
28
|
import {
|
|
29
29
|
type ContractClassPublic,
|
|
30
30
|
ContractClassPublicSchema,
|
|
@@ -36,8 +36,8 @@ import {
|
|
|
36
36
|
ProtocolContractAddressesSchema,
|
|
37
37
|
} from '../contract/index.js';
|
|
38
38
|
import { GasFees } from '../gas/gas_fees.js';
|
|
39
|
+
import { SiloedTag, Tag, TxScopedL2Log } from '../logs/index.js';
|
|
39
40
|
import { type LogFilter, LogFilterSchema } from '../logs/log_filter.js';
|
|
40
|
-
import { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
|
|
41
41
|
import { type ApiSchemaFor, optional, schemas } from '../schemas/schemas.js';
|
|
42
42
|
import { MerkleTreeId } from '../trees/merkle_tree_id.js';
|
|
43
43
|
import { NullifierMembershipWitness } from '../trees/nullifier_membership_witness.js';
|
|
@@ -338,14 +338,16 @@ export interface AztecNode
|
|
|
338
338
|
getContractClassLogs(filter: LogFilter): Promise<GetContractClassLogsResponse>;
|
|
339
339
|
|
|
340
340
|
/**
|
|
341
|
-
* Gets all logs that match any of the
|
|
342
|
-
*
|
|
343
|
-
* @param logsPerTag - How many logs to return per tag. Default 10 logs are returned for each tag
|
|
344
|
-
* @returns For each received tag, an array of matching logs and metadata (e.g. tx hash) is returned. An empty
|
|
345
|
-
* array implies no logs match that tag. There can be multiple logs for 1 tag because tag reuse can happen
|
|
346
|
-
* --> e.g. when sending a note from multiple unsynched devices.
|
|
341
|
+
* Gets all private logs that match any of the `tags`. For each tag, an array of matching logs is returned. An empty
|
|
342
|
+
* array implies no logs match that tag.
|
|
347
343
|
*/
|
|
348
|
-
|
|
344
|
+
getPrivateLogsByTags(tags: SiloedTag[]): Promise<TxScopedL2Log[][]>;
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Gets all public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
|
|
348
|
+
* logs is returned. An empty array implies no logs match that tag.
|
|
349
|
+
*/
|
|
350
|
+
getPublicLogsByTagsFromContract(contractAddress: AztecAddress, tags: Tag[]): Promise<TxScopedL2Log[][]>;
|
|
349
351
|
|
|
350
352
|
/**
|
|
351
353
|
* Method to submit a transaction to the p2p pool.
|
|
@@ -481,7 +483,6 @@ export interface AztecNode
|
|
|
481
483
|
getAllowedPublicSetup(): Promise<AllowedElement[]>;
|
|
482
484
|
}
|
|
483
485
|
|
|
484
|
-
export const MAX_LOGS_PER_TAG = 10;
|
|
485
486
|
const MAX_SIGNATURES_PER_REGISTER_CALL = 100;
|
|
486
487
|
const MAX_SIGNATURE_LEN = 10000;
|
|
487
488
|
|
|
@@ -601,12 +602,14 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
601
602
|
|
|
602
603
|
getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
|
|
603
604
|
|
|
604
|
-
|
|
605
|
+
getPrivateLogsByTags: z
|
|
605
606
|
.function()
|
|
606
|
-
.args(
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
607
|
+
.args(z.array(SiloedTag.schema).max(MAX_RPC_LEN))
|
|
608
|
+
.returns(z.array(z.array(TxScopedL2Log.schema))),
|
|
609
|
+
|
|
610
|
+
getPublicLogsByTagsFromContract: z
|
|
611
|
+
.function()
|
|
612
|
+
.args(schemas.AztecAddress, z.array(Tag.schema).max(MAX_RPC_LEN))
|
|
610
613
|
.returns(z.array(z.array(TxScopedL2Log.schema))),
|
|
611
614
|
|
|
612
615
|
sendTx: z.function().args(Tx.schema).returns(z.void()),
|
|
@@ -60,7 +60,17 @@ export interface BuildBlockResult {
|
|
|
60
60
|
|
|
61
61
|
export type FullNodeBlockBuilderConfig = Pick<L1RollupConstants, 'l1GenesisTime' | 'slotDuration'> &
|
|
62
62
|
Pick<ChainConfig, 'l1ChainId' | 'rollupVersion'> &
|
|
63
|
-
Pick<SequencerConfig, 'txPublicSetupAllowList' | 'fakeProcessingDelayPerTxMs'>;
|
|
63
|
+
Pick<SequencerConfig, 'txPublicSetupAllowList' | 'fakeProcessingDelayPerTxMs' | 'fakeThrowAfterProcessingTxCount'>;
|
|
64
|
+
|
|
65
|
+
export const FullNodeBlockBuilderConfigKeys: (keyof FullNodeBlockBuilderConfig)[] = [
|
|
66
|
+
'l1GenesisTime',
|
|
67
|
+
'slotDuration',
|
|
68
|
+
'l1ChainId',
|
|
69
|
+
'rollupVersion',
|
|
70
|
+
'txPublicSetupAllowList',
|
|
71
|
+
'fakeProcessingDelayPerTxMs',
|
|
72
|
+
'fakeThrowAfterProcessingTxCount',
|
|
73
|
+
] as const;
|
|
64
74
|
|
|
65
75
|
export interface IFullNodeBlockBuilder {
|
|
66
76
|
getConfig(): FullNodeBlockBuilderConfig;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
+
import type { Prettify } from '@aztec/foundation/types';
|
|
2
3
|
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
6
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
6
|
-
import {
|
|
7
|
+
import { schemas, zodFor } from '../schemas/index.js';
|
|
7
8
|
import { type AllowedElement, AllowedElementSchema } from './allowed_element.js';
|
|
8
9
|
|
|
9
|
-
/**
|
|
10
|
-
* The sequencer configuration.
|
|
11
|
-
*/
|
|
10
|
+
/** Sequencer configuration */
|
|
12
11
|
export interface SequencerConfig {
|
|
13
12
|
/** The number of ms to wait between polling for pending txs. */
|
|
14
|
-
|
|
13
|
+
sequencerPollingIntervalMS?: number;
|
|
15
14
|
/** The maximum number of txs to include in a block. */
|
|
16
15
|
maxTxsPerBlock?: number;
|
|
17
16
|
/** The minimum number of txs to include in a block. */
|
|
18
17
|
minTxsPerBlock?: number;
|
|
18
|
+
/** The minimum number of valid txs (after execution) to include in a block. If not set, falls back to minTxsPerBlock. */
|
|
19
|
+
minValidTxsPerBlock?: number;
|
|
19
20
|
/** Whether to publish txs with the block proposals */
|
|
20
21
|
publishTxsWithProposals?: boolean;
|
|
21
22
|
/** The maximum L2 block gas. */
|
|
@@ -38,10 +39,12 @@ export interface SequencerConfig {
|
|
|
38
39
|
governanceProposerPayload?: EthAddress;
|
|
39
40
|
/** Whether to enforce the time table when building blocks */
|
|
40
41
|
enforceTimeTable?: boolean;
|
|
41
|
-
/** How
|
|
42
|
-
|
|
42
|
+
/** How much time (in seconds) we allow in the slot for publishing the L1 tx. */
|
|
43
|
+
l1PublishingTime?: number;
|
|
43
44
|
/** Used for testing to introduce a fake delay after processing each tx */
|
|
44
45
|
fakeProcessingDelayPerTxMs?: number;
|
|
46
|
+
/** Used for testing to throw an error after processing N txs */
|
|
47
|
+
fakeThrowAfterProcessingTxCount?: number;
|
|
45
48
|
/** How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way) */
|
|
46
49
|
attestationPropagationTime?: number;
|
|
47
50
|
/** How many seconds before invalidating a block as a committee member (zero to never invalidate) */
|
|
@@ -60,31 +63,59 @@ export interface SequencerConfig {
|
|
|
60
63
|
fishermanMode?: boolean;
|
|
61
64
|
/** Shuffle attestation ordering to create invalid ordering (for testing only) */
|
|
62
65
|
shuffleAttestationOrdering?: boolean;
|
|
66
|
+
/** Duration per block in milliseconds when building multiple blocks per slot (default: undefined = single block per slot) */
|
|
67
|
+
blockDurationMs?: number;
|
|
68
|
+
/** Have sequencer build and publish an empty checkpoint if there are no txs */
|
|
69
|
+
buildCheckpointIfEmpty?: boolean;
|
|
63
70
|
}
|
|
64
71
|
|
|
65
|
-
export const SequencerConfigSchema =
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
73
|
+
z.object({
|
|
74
|
+
sequencerPollingIntervalMS: z.number().optional(),
|
|
75
|
+
maxTxsPerBlock: z.number().optional(),
|
|
76
|
+
minValidTxsPerBlock: z.number().optional(),
|
|
77
|
+
minTxsPerBlock: z.number().optional(),
|
|
78
|
+
maxL2BlockGas: z.number().optional(),
|
|
79
|
+
publishTxsWithProposals: z.boolean().optional(),
|
|
80
|
+
maxDABlockGas: z.number().optional(),
|
|
81
|
+
coinbase: schemas.EthAddress.optional(),
|
|
82
|
+
feeRecipient: schemas.AztecAddress.optional(),
|
|
83
|
+
acvmWorkingDirectory: z.string().optional(),
|
|
84
|
+
acvmBinaryPath: z.string().optional(),
|
|
85
|
+
txPublicSetupAllowList: z.array(AllowedElementSchema).optional(),
|
|
86
|
+
maxBlockSizeInBytes: z.number().optional(),
|
|
87
|
+
governanceProposerPayload: schemas.EthAddress.optional(),
|
|
88
|
+
l1PublishingTime: z.number().optional(),
|
|
89
|
+
enforceTimeTable: z.boolean().optional(),
|
|
90
|
+
fakeProcessingDelayPerTxMs: z.number().optional(),
|
|
91
|
+
fakeThrowAfterProcessingTxCount: z.number().optional(),
|
|
92
|
+
attestationPropagationTime: z.number().optional(),
|
|
93
|
+
skipCollectingAttestations: z.boolean().optional(),
|
|
94
|
+
skipInvalidateBlockAsProposer: z.boolean().optional(),
|
|
95
|
+
secondsBeforeInvalidatingBlockAsCommitteeMember: z.number(),
|
|
96
|
+
secondsBeforeInvalidatingBlockAsNonCommitteeMember: z.number(),
|
|
97
|
+
broadcastInvalidBlockProposal: z.boolean().optional(),
|
|
98
|
+
injectFakeAttestation: z.boolean().optional(),
|
|
99
|
+
fishermanMode: z.boolean().optional(),
|
|
100
|
+
shuffleAttestationOrdering: z.boolean().optional(),
|
|
101
|
+
blockDurationMs: z.number().positive().optional(),
|
|
102
|
+
buildCheckpointIfEmpty: z.boolean().optional(),
|
|
103
|
+
}),
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
type SequencerConfigOptionalKeys =
|
|
107
|
+
| 'governanceProposerPayload'
|
|
108
|
+
| 'blockDurationMs'
|
|
109
|
+
| 'coinbase'
|
|
110
|
+
| 'feeRecipient'
|
|
111
|
+
| 'acvmWorkingDirectory'
|
|
112
|
+
| 'acvmBinaryPath'
|
|
113
|
+
| 'fakeProcessingDelayPerTxMs'
|
|
114
|
+
| 'fakeThrowAfterProcessingTxCount'
|
|
115
|
+
| 'l1PublishingTime'
|
|
116
|
+
| 'txPublicSetupAllowList'
|
|
117
|
+
| 'minValidTxsPerBlock';
|
|
118
|
+
|
|
119
|
+
export type ResolvedSequencerConfig = Prettify<
|
|
120
|
+
Required<Omit<SequencerConfig, SequencerConfigOptionalKeys>> & Pick<SequencerConfig, SequencerConfigOptionalKeys>
|
|
121
|
+
>;
|
|
@@ -2,7 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
import { ExtendedContractClassLog } from '../logs/extended_contract_class_log.js';
|
|
4
4
|
import { ExtendedPublicLog } from '../logs/extended_public_log.js';
|
|
5
|
-
import
|
|
5
|
+
import { zodFor } from '../schemas/index.js';
|
|
6
6
|
|
|
7
7
|
/** Response for the getContractClassLogs archiver call. */
|
|
8
8
|
export type GetContractClassLogsResponse = {
|
|
@@ -12,10 +12,12 @@ export type GetContractClassLogsResponse = {
|
|
|
12
12
|
maxLogsHit: boolean;
|
|
13
13
|
};
|
|
14
14
|
|
|
15
|
-
export const GetContractClassLogsResponseSchema
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
export const GetContractClassLogsResponseSchema = zodFor<GetContractClassLogsResponse>()(
|
|
16
|
+
z.object({
|
|
17
|
+
logs: z.array(ExtendedContractClassLog.schema),
|
|
18
|
+
maxLogsHit: z.boolean(),
|
|
19
|
+
}),
|
|
20
|
+
);
|
|
19
21
|
|
|
20
22
|
/** Response for the getPublicLogs archiver call. */
|
|
21
23
|
export type GetPublicLogsResponse = {
|
|
@@ -25,7 +27,9 @@ export type GetPublicLogsResponse = {
|
|
|
25
27
|
maxLogsHit: boolean;
|
|
26
28
|
};
|
|
27
29
|
|
|
28
|
-
export const GetPublicLogsResponseSchema =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
export const GetPublicLogsResponseSchema = zodFor<GetPublicLogsResponse>()(
|
|
31
|
+
z.object({
|
|
32
|
+
logs: z.array(ExtendedPublicLog.schema),
|
|
33
|
+
maxLogsHit: z.boolean(),
|
|
34
|
+
}),
|
|
35
|
+
);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
2
|
|
|
3
|
+
import type { AztecAddress } from '../aztec-address/index.js';
|
|
4
4
|
import type { LogFilter } from '../logs/log_filter.js';
|
|
5
|
+
import type { SiloedTag } from '../logs/siloed_tag.js';
|
|
6
|
+
import type { Tag } from '../logs/tag.js';
|
|
5
7
|
import type { TxScopedL2Log } from '../logs/tx_scoped_l2_log.js';
|
|
6
8
|
import type { GetContractClassLogsResponse, GetPublicLogsResponse } from './get_logs_response.js';
|
|
7
9
|
|
|
@@ -10,13 +12,16 @@ import type { GetContractClassLogsResponse, GetPublicLogsResponse } from './get_
|
|
|
10
12
|
*/
|
|
11
13
|
export interface L2LogsSource {
|
|
12
14
|
/**
|
|
13
|
-
* Gets all logs that match any of the
|
|
14
|
-
*
|
|
15
|
-
* @param logsPerTag - The maximum number of logs to return for each tag. Default returns everything
|
|
16
|
-
* @returns For each received tag, an array of matching logs is returned. An empty array implies no logs match
|
|
17
|
-
* that tag.
|
|
15
|
+
* Gets all private logs that match any of the `tags`. For each tag, an array of matching logs is returned. An empty
|
|
16
|
+
* array implies no logs match that tag.
|
|
18
17
|
*/
|
|
19
|
-
|
|
18
|
+
getPrivateLogsByTags(tags: SiloedTag[]): Promise<TxScopedL2Log[][]>;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Gets all public logs that match any of the `tags` from the specified contract. For each tag, an array of matching
|
|
22
|
+
* logs is returned. An empty array implies no logs match that tag.
|
|
23
|
+
*/
|
|
24
|
+
getPublicLogsByTagsFromContract(contractAddress: AztecAddress, tags: Tag[]): Promise<TxScopedL2Log[][]>;
|
|
20
25
|
|
|
21
26
|
/**
|
|
22
27
|
* Gets public logs based on the provided filter.
|
|
@@ -251,7 +251,10 @@ export interface MerkleTreeCheckpointOperations {
|
|
|
251
251
|
revertAllCheckpoints(): Promise<void>;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
export interface MerkleTreeWriteOperations
|
|
254
|
+
export interface MerkleTreeWriteOperations
|
|
255
|
+
extends MerkleTreeReadOperations,
|
|
256
|
+
MerkleTreeCheckpointOperations,
|
|
257
|
+
Disposable {
|
|
255
258
|
/**
|
|
256
259
|
* Appends leaves to a given tree.
|
|
257
260
|
* @param treeId - The tree to be updated.
|
|
@@ -3,7 +3,7 @@ import { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
3
3
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { schemas, zodFor } from '../schemas/index.js';
|
|
7
7
|
import type { TxHash } from '../tx/tx_hash.js';
|
|
8
8
|
import type { EpochProver } from './epoch-prover.js';
|
|
9
9
|
import type { ProvingJobConsumer } from './prover-broker.js';
|
|
@@ -33,15 +33,18 @@ export type ProverConfig = ActualProverConfig & {
|
|
|
33
33
|
failedProofStore?: string;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
-
export const ProverConfigSchema =
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
export const ProverConfigSchema = zodFor<ProverConfig>()(
|
|
37
|
+
z.object({
|
|
38
|
+
nodeUrl: z.string().optional(),
|
|
39
|
+
realProofs: z.boolean(),
|
|
40
|
+
proverId: schemas.EthAddress.optional(),
|
|
41
|
+
proverTestDelayType: z.enum(['fixed', 'realistic']),
|
|
42
|
+
proverTestDelayMs: z.number(),
|
|
43
|
+
proverTestDelayFactor: z.number(),
|
|
44
|
+
proverAgentCount: z.number(),
|
|
45
|
+
failedProofStore: z.string().optional(),
|
|
46
|
+
}),
|
|
47
|
+
);
|
|
45
48
|
|
|
46
49
|
export const proverConfigMappings: ConfigMappingsType<ProverConfig> = {
|
|
47
50
|
nodeUrl: {
|
|
@@ -186,7 +186,6 @@ export interface ServerCircuitProver {
|
|
|
186
186
|
*/
|
|
187
187
|
getAvmProof(
|
|
188
188
|
inputs: AvmCircuitInputs,
|
|
189
|
-
skipPublicInputsValidation?: boolean, // TODO(#14234)[Unconditional PIs validation]: Remove.
|
|
190
189
|
signal?: AbortSignal,
|
|
191
190
|
epochNumber?: number,
|
|
192
191
|
): Promise<ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
2
|
-
import {
|
|
2
|
+
import { schemas, zodFor } from '@aztec/foundation/schemas';
|
|
3
3
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
@@ -27,24 +27,26 @@ export interface SlasherConfig {
|
|
|
27
27
|
slashExecuteRoundsLookBack: number; // How many rounds to look back when searching for a round to execute
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
export const SlasherConfigSchema =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
export const SlasherConfigSchema = zodFor<SlasherConfig>()(
|
|
31
|
+
z.object({
|
|
32
|
+
slashOverridePayload: schemas.EthAddress.optional(),
|
|
33
|
+
slashMinPenaltyPercentage: z.number(),
|
|
34
|
+
slashMaxPenaltyPercentage: z.number(),
|
|
35
|
+
slashValidatorsAlways: z.array(schemas.EthAddress),
|
|
36
|
+
slashValidatorsNever: z.array(schemas.EthAddress),
|
|
37
|
+
slashPrunePenalty: schemas.BigInt,
|
|
38
|
+
slashDataWithholdingPenalty: schemas.BigInt,
|
|
39
|
+
slashInactivityTargetPercentage: z.number(),
|
|
40
|
+
slashInactivityConsecutiveEpochThreshold: z.number(),
|
|
41
|
+
slashInactivityPenalty: schemas.BigInt,
|
|
42
|
+
slashProposeInvalidAttestationsPenalty: schemas.BigInt,
|
|
43
|
+
slashAttestDescendantOfInvalidPenalty: schemas.BigInt,
|
|
44
|
+
slashUnknownPenalty: schemas.BigInt,
|
|
45
|
+
slashOffenseExpirationRounds: z.number(),
|
|
46
|
+
slashMaxPayloadSize: z.number(),
|
|
47
|
+
slashGracePeriodL2Slots: z.number(),
|
|
48
|
+
slashBroadcastedInvalidBlockPenalty: schemas.BigInt,
|
|
49
|
+
slashExecuteRoundsLookBack: z.number(),
|
|
50
|
+
slashSelfAllowed: z.boolean().optional(),
|
|
51
|
+
}),
|
|
52
|
+
);
|