@aztec/stdlib 5.0.0-nightly.20260611 → 5.0.0-nightly.20260613
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/block/l2_block_source.d.ts +7 -1
- package/dest/block/l2_block_source.d.ts.map +1 -1
- package/dest/block/l2_block_stream/interfaces.d.ts +44 -8
- package/dest/block/l2_block_stream/interfaces.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_block_stream.d.ts +1 -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 +13 -4
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts +6 -12
- package/dest/block/l2_block_stream/l2_tips_memory_store.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_memory_store.js +8 -32
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts +9 -18
- package/dest/block/l2_block_stream/l2_tips_store_base.d.ts.map +1 -1
- package/dest/block/l2_block_stream/l2_tips_store_base.js +52 -58
- 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 +202 -34
- package/dest/config/index.d.ts +2 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -0
- package/dest/config/network-consensus-config.d.ts +72 -0
- package/dest/config/network-consensus-config.d.ts.map +1 -0
- package/dest/config/network-consensus-config.js +231 -0
- package/dest/config/sequencer-config.d.ts +3 -1
- package/dest/config/sequencer-config.d.ts.map +1 -1
- package/dest/config/sequencer-config.js +5 -4
- package/dest/contract/interfaces/node-info.d.ts +11 -1
- package/dest/contract/interfaces/node-info.d.ts.map +1 -1
- package/dest/contract/interfaces/node-info.js +7 -1
- package/dest/gas/gas_settings.d.ts +7 -13
- package/dest/gas/gas_settings.d.ts.map +1 -1
- package/dest/gas/gas_settings.js +9 -16
- package/dest/gas/index.d.ts +2 -1
- package/dest/gas/index.d.ts.map +1 -1
- package/dest/gas/index.js +1 -0
- package/dest/gas/tx_gas_limits.d.ts +72 -0
- package/dest/gas/tx_gas_limits.d.ts.map +1 -0
- package/dest/gas/tx_gas_limits.js +85 -0
- package/dest/interfaces/aztec-node-admin.d.ts +18 -17
- 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-debug.d.ts +15 -2
- package/dest/interfaces/aztec-node-debug.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-debug.js +9 -1
- package/dest/interfaces/aztec-node.d.ts +40 -11
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +42 -5
- package/dest/interfaces/block-builder.d.ts +3 -1
- package/dest/interfaces/block-builder.d.ts.map +1 -1
- package/dest/interfaces/client.d.ts +2 -1
- package/dest/interfaces/client.d.ts.map +1 -1
- package/dest/interfaces/configs.d.ts +12 -6
- package/dest/interfaces/configs.d.ts.map +1 -1
- package/dest/interfaces/configs.js +2 -1
- package/dest/interfaces/get_tx_by_hash_options.d.ts +9 -0
- package/dest/interfaces/get_tx_by_hash_options.d.ts.map +1 -0
- package/dest/interfaces/get_tx_by_hash_options.js +4 -0
- package/dest/interfaces/p2p.d.ts +32 -8
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +12 -2
- package/dest/interfaces/proving-job.d.ts +70 -70
- package/dest/interfaces/validator.d.ts +3 -3
- package/dest/interfaces/validator.d.ts.map +1 -1
- package/dest/interfaces/validator.js +1 -1
- package/dest/tests/factories.d.ts +1 -1
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +4 -1
- package/dest/tests/mocks.d.ts +1 -1
- package/dest/tests/mocks.d.ts.map +1 -1
- package/dest/tests/mocks.js +3 -2
- package/dest/timetable/budgets.d.ts +4 -2
- package/dest/timetable/budgets.d.ts.map +1 -1
- package/dest/timetable/budgets.js +2 -1
- package/dest/timetable/build_proposer_timetable.d.ts +21 -0
- package/dest/timetable/build_proposer_timetable.d.ts.map +1 -0
- package/dest/timetable/build_proposer_timetable.js +17 -0
- package/dest/timetable/consensus_timetable.d.ts +5 -7
- package/dest/timetable/consensus_timetable.d.ts.map +1 -1
- package/dest/timetable/consensus_timetable.js +6 -8
- package/dest/timetable/index.d.ts +2 -1
- package/dest/timetable/index.d.ts.map +1 -1
- package/dest/timetable/index.js +1 -0
- package/dest/timetable/proposer_timetable.d.ts +18 -24
- package/dest/timetable/proposer_timetable.d.ts.map +1 -1
- package/dest/timetable/proposer_timetable.js +26 -55
- package/dest/tx/fee_provider.d.ts +2 -2
- package/dest/tx/fee_provider.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.d.ts +2 -2
- package/dest/tx/validator/error_texts.d.ts.map +1 -1
- package/dest/tx/validator/error_texts.js +1 -1
- package/package.json +8 -8
- package/src/block/l2_block_source.ts +7 -0
- package/src/block/l2_block_stream/interfaces.ts +39 -7
- package/src/block/l2_block_stream/l2_block_stream.ts +21 -3
- package/src/block/l2_block_stream/l2_tips_memory_store.ts +12 -41
- package/src/block/l2_block_stream/l2_tips_store_base.ts +63 -93
- package/src/block/test/l2_tips_store_test_suite.ts +197 -24
- package/src/config/index.ts +1 -0
- package/src/config/network-consensus-config.ts +302 -0
- package/src/config/sequencer-config.ts +7 -5
- package/src/contract/interfaces/node-info.ts +11 -0
- package/src/gas/README.md +92 -0
- package/src/gas/gas_settings.ts +11 -21
- package/src/gas/index.ts +1 -0
- package/src/gas/tx_gas_limits.ts +123 -0
- package/src/interfaces/aztec-node-admin.ts +1 -1
- package/src/interfaces/aztec-node-debug.ts +17 -2
- package/src/interfaces/aztec-node.ts +74 -13
- package/src/interfaces/block-builder.ts +2 -0
- package/src/interfaces/client.ts +1 -0
- package/src/interfaces/configs.ts +10 -6
- package/src/interfaces/get_tx_by_hash_options.ts +14 -0
- package/src/interfaces/p2p.ts +21 -8
- package/src/interfaces/validator.ts +5 -5
- package/src/tests/factories.ts +7 -1
- package/src/tests/mocks.ts +7 -2
- package/src/timetable/README.md +10 -2
- package/src/timetable/budgets.ts +5 -2
- package/src/timetable/build_proposer_timetable.ts +42 -0
- package/src/timetable/consensus_timetable.ts +8 -14
- package/src/timetable/index.ts +1 -0
- package/src/timetable/proposer_timetable.ts +37 -61
- package/src/tx/fee_provider.ts +1 -1
- package/src/tx/validator/error_texts.ts +2 -1
|
@@ -133,7 +133,7 @@ export function createAztecNodeAdminClient(
|
|
|
133
133
|
apiKey?: string,
|
|
134
134
|
): AztecNodeAdmin {
|
|
135
135
|
return createSafeJsonRpcClient<AztecNodeAdmin>(url, AztecNodeAdminApiSchema, {
|
|
136
|
-
namespaceMethods: '
|
|
136
|
+
namespaceMethods: 'aztecAdmin',
|
|
137
137
|
fetch,
|
|
138
138
|
onResponse: getVersioningResponseHandler(versions),
|
|
139
139
|
...(apiKey ? { extraHeaders: { 'x-api-key': apiKey } } : {}),
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { type CheckpointNumber, CheckpointNumberSchema } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { createSafeJsonRpcClient, defaultFetch } from '@aztec/foundation/json-rpc/client';
|
|
2
3
|
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
|
-
import type
|
|
6
|
+
import { type ApiSchemaFor, optional } from '../schemas/schemas.js';
|
|
6
7
|
import { type ComponentsVersions, getVersioningResponseHandler } from '../versioning/index.js';
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -19,10 +20,24 @@ export interface AztecNodeDebug {
|
|
|
19
20
|
* @throws If no sequencer is running.
|
|
20
21
|
*/
|
|
21
22
|
mineBlock(): Promise<void>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Synthetically proves the L2 chain up to the given checkpoint (default: the latest checkpointed
|
|
26
|
+
* checkpoint), writing epoch out hashes into the L1 Outbox so L2-to-L1 messages become consumable
|
|
27
|
+
* and advancing the rollup's proven tip. There is no real proof — this is the local-network
|
|
28
|
+
* equivalent of an epoch proof landing on L1. The target is clamped to the latest checkpointed
|
|
29
|
+
* checkpoint and the call no-ops when it is already proven.
|
|
30
|
+
*
|
|
31
|
+
* @param upToCheckpoint - Checkpoint to prove up to; defaults to the latest checkpointed checkpoint.
|
|
32
|
+
* @returns The proven checkpoint number after the call.
|
|
33
|
+
* @throws If no automine sequencer is running (only the automine sequencer supports synthetic proving).
|
|
34
|
+
*/
|
|
35
|
+
prove(upToCheckpoint?: CheckpointNumber): Promise<CheckpointNumber>;
|
|
22
36
|
}
|
|
23
37
|
|
|
24
38
|
export const AztecNodeDebugApiSchema: ApiSchemaFor<AztecNodeDebug> = {
|
|
25
39
|
mineBlock: z.function({ input: z.tuple([]), output: z.void() }),
|
|
40
|
+
prove: z.function({ input: z.tuple([optional(CheckpointNumberSchema)]), output: CheckpointNumberSchema }),
|
|
26
41
|
};
|
|
27
42
|
|
|
28
43
|
export function createAztecNodeDebugClient(
|
|
@@ -32,7 +47,7 @@ export function createAztecNodeDebugClient(
|
|
|
32
47
|
apiKey?: string,
|
|
33
48
|
): AztecNodeDebug {
|
|
34
49
|
return createSafeJsonRpcClient<AztecNodeDebug>(url, AztecNodeDebugApiSchema, {
|
|
35
|
-
namespaceMethods: '
|
|
50
|
+
namespaceMethods: 'aztecDebug',
|
|
36
51
|
fetch,
|
|
37
52
|
onResponse: getVersioningResponseHandler(versions),
|
|
38
53
|
...(apiKey ? { extraHeaders: { 'x-api-key': apiKey } } : {}),
|
|
@@ -7,9 +7,11 @@ import {
|
|
|
7
7
|
type CheckpointNumber,
|
|
8
8
|
CheckpointNumberPositiveSchema,
|
|
9
9
|
CheckpointNumberSchema,
|
|
10
|
+
type CheckpointProposalHash,
|
|
10
11
|
type EpochNumber,
|
|
11
12
|
EpochNumberSchema,
|
|
12
13
|
type SlotNumber,
|
|
14
|
+
SlotNumberSchema,
|
|
13
15
|
} from '@aztec/foundation/branded-types';
|
|
14
16
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
15
17
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -35,6 +37,7 @@ import {
|
|
|
35
37
|
type ProtocolContractAddresses,
|
|
36
38
|
ProtocolContractAddressesSchema,
|
|
37
39
|
} from '../contract/index.js';
|
|
40
|
+
import { type L1RollupConstants, L1RollupConstantsSchema } from '../epoch-helpers/index.js';
|
|
38
41
|
import { ManaUsageEstimate } from '../gas/fee_math.js';
|
|
39
42
|
import { GasFees } from '../gas/gas_fees.js';
|
|
40
43
|
import { type LogResult, LogResultSchema } from '../logs/log_result.js';
|
|
@@ -45,7 +48,8 @@ import {
|
|
|
45
48
|
PublicLogsQuerySchema,
|
|
46
49
|
} from '../logs/logs_query.js';
|
|
47
50
|
import { type L2ToL1MembershipWitness, L2ToL1MembershipWitnessSchema } from '../messaging/l2_to_l1_membership.js';
|
|
48
|
-
import {
|
|
51
|
+
import { CheckpointAttestation } from '../p2p/checkpoint_attestation.js';
|
|
52
|
+
import { type ApiSchemaFor, optional, schemas } from '../schemas/schemas.js';
|
|
49
53
|
import { MerkleTreeId } from '../trees/merkle_tree_id.js';
|
|
50
54
|
import { NullifierMembershipWitness } from '../trees/nullifier_membership_witness.js';
|
|
51
55
|
import { PublicDataWitness } from '../trees/public_data_witness.js';
|
|
@@ -84,18 +88,12 @@ import {
|
|
|
84
88
|
type CheckpointResponse,
|
|
85
89
|
CheckpointResponseSchema,
|
|
86
90
|
} from './checkpoint_response.js';
|
|
91
|
+
import { type GetTxByHashOptions, GetTxByHashOptionsSchema } from './get_tx_by_hash_options.js';
|
|
92
|
+
import { type PeerInfo, PeerInfoSchema, type ProposalsForSlot, ProposalsForSlotSchema } from './p2p.js';
|
|
87
93
|
import { type WorldStateSyncStatus, WorldStateSyncStatusSchema } from './world_state.js';
|
|
88
94
|
|
|
89
|
-
|
|
90
|
-
export
|
|
91
|
-
/** Keep the proof on the returned tx; stripped by default. */
|
|
92
|
-
includeProof?: boolean;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/** Zod schema for {@link GetTxByHashOptions}. */
|
|
96
|
-
export const GetTxByHashOptionsSchema: ZodFor<GetTxByHashOptions> = z.object({
|
|
97
|
-
includeProof: z.boolean().optional(),
|
|
98
|
-
});
|
|
95
|
+
export type { GetTxByHashOptions } from './get_tx_by_hash_options.js';
|
|
96
|
+
export { GetTxByHashOptionsSchema } from './get_tx_by_hash_options.js';
|
|
99
97
|
|
|
100
98
|
/**
|
|
101
99
|
* The aztec node.
|
|
@@ -252,6 +250,22 @@ export interface AztecNode {
|
|
|
252
250
|
/** Returns the tips of the L2 chain. */
|
|
253
251
|
getChainTips(): Promise<ChainTips>;
|
|
254
252
|
|
|
253
|
+
/** Returns the rollup constants for the current chain. */
|
|
254
|
+
getL1Constants(): Promise<L1RollupConstants>;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Returns the last L2 slot number for which the node has all L1 data needed to build the next checkpoint.
|
|
258
|
+
*/
|
|
259
|
+
getSyncedL2SlotNumber(): Promise<SlotNumber | undefined>;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Returns the last L2 epoch number that has been fully synchronized from L1.
|
|
263
|
+
*/
|
|
264
|
+
getSyncedL2EpochNumber(): Promise<EpochNumber | undefined>;
|
|
265
|
+
|
|
266
|
+
/** Returns the latest L1 timestamp according to the archiver's synced L1 view. */
|
|
267
|
+
getSyncedL1Timestamp(): Promise<bigint | undefined>;
|
|
268
|
+
|
|
255
269
|
/**
|
|
256
270
|
* Gets lightweight checkpoint metadata for a contiguous range or for an entire epoch.
|
|
257
271
|
* @param query - Either `{ from, limit }` or `{ epoch }`.
|
|
@@ -329,7 +343,7 @@ export interface AztecNode {
|
|
|
329
343
|
* Each entry accounts for the L1 gas oracle transition and congestion growth based on the
|
|
330
344
|
* given mana usage estimate. Defaults to target usage (steady state).
|
|
331
345
|
* @param manaUsage - Expected mana usage per checkpoint (none, target, or limit).
|
|
332
|
-
* @returns An array of GasFees,
|
|
346
|
+
* @returns An array of GasFees with current min fees first, followed by one entry per predicted slot.
|
|
333
347
|
*/
|
|
334
348
|
getPredictedMinFees(manaUsage?: ManaUsageEstimate): Promise<GasFees[]>;
|
|
335
349
|
|
|
@@ -526,6 +540,30 @@ export interface AztecNode {
|
|
|
526
540
|
* @returns The list of allowed elements.
|
|
527
541
|
*/
|
|
528
542
|
getAllowedPublicSetup(): Promise<AllowedElement[]>;
|
|
543
|
+
|
|
544
|
+
/**
|
|
545
|
+
* Returns info for all connected, dialing, and cached peers. Only available when P2P is enabled.
|
|
546
|
+
* @param includePending - If true, also include peers in the pending state.
|
|
547
|
+
*/
|
|
548
|
+
getPeers(includePending?: boolean): Promise<PeerInfo[]>;
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Queries the attestation pool for checkpoint attestations for the given slot.
|
|
552
|
+
* @param slot - The slot to query.
|
|
553
|
+
* @param proposalPayloadHash - Hex-encoded keccak256 of the target proposal's signed payload hash.
|
|
554
|
+
* When provided, only attestations whose payload hash matches are returned.
|
|
555
|
+
* When omitted, all attestations for the slot are returned.
|
|
556
|
+
*/
|
|
557
|
+
getCheckpointAttestationsForSlot(
|
|
558
|
+
slot: SlotNumber,
|
|
559
|
+
proposalPayloadHash?: CheckpointProposalHash,
|
|
560
|
+
): Promise<CheckpointAttestation[]>;
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Returns block and checkpoint proposals retained in the attestation pool for the given slot.
|
|
564
|
+
* Only available when P2P is enabled.
|
|
565
|
+
*/
|
|
566
|
+
getProposalsForSlot(slot: SlotNumber): Promise<ProposalsForSlot>;
|
|
529
567
|
}
|
|
530
568
|
|
|
531
569
|
const MAX_SIGNATURES_PER_REGISTER_CALL = 100;
|
|
@@ -590,6 +628,14 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
590
628
|
|
|
591
629
|
getChainTips: z.function({ input: z.tuple([]), output: ChainTipsSchema }),
|
|
592
630
|
|
|
631
|
+
getL1Constants: z.function({ input: z.tuple([]), output: L1RollupConstantsSchema }),
|
|
632
|
+
|
|
633
|
+
getSyncedL2SlotNumber: z.function({ input: z.tuple([]), output: SlotNumberSchema.optional() }),
|
|
634
|
+
|
|
635
|
+
getSyncedL2EpochNumber: z.function({ input: z.tuple([]), output: EpochNumberSchema.optional() }),
|
|
636
|
+
|
|
637
|
+
getSyncedL1Timestamp: z.function({ input: z.tuple([]), output: schemas.BigInt.optional() }),
|
|
638
|
+
|
|
593
639
|
getCheckpointsData: z.function({ input: z.tuple([CheckpointsQuerySchema]), output: z.array(CheckpointDataSchema) }),
|
|
594
640
|
|
|
595
641
|
getBlock: z.function({
|
|
@@ -730,6 +776,21 @@ export const AztecNodeApiSchema: ApiSchemaFor<AztecNode> = {
|
|
|
730
776
|
getEncodedEnr: z.function({ input: z.tuple([]), output: z.string().optional() }),
|
|
731
777
|
|
|
732
778
|
getAllowedPublicSetup: z.function({ input: z.tuple([]), output: z.array(AllowedElementSchema) }),
|
|
779
|
+
|
|
780
|
+
getPeers: z.function({ input: z.tuple([optional(z.boolean())]), output: z.array(PeerInfoSchema) }),
|
|
781
|
+
|
|
782
|
+
getCheckpointAttestationsForSlot: z.function({
|
|
783
|
+
input: z.tuple([
|
|
784
|
+
schemas.SlotNumber,
|
|
785
|
+
optional(z.string().regex(/^0x[0-9a-fA-F]+$/) as unknown as z.ZodType<CheckpointProposalHash>),
|
|
786
|
+
]),
|
|
787
|
+
output: z.array(CheckpointAttestation.schema),
|
|
788
|
+
}),
|
|
789
|
+
|
|
790
|
+
getProposalsForSlot: z.function({
|
|
791
|
+
input: z.tuple([schemas.SlotNumber]),
|
|
792
|
+
output: ProposalsForSlotSchema,
|
|
793
|
+
}),
|
|
733
794
|
};
|
|
734
795
|
|
|
735
796
|
export function createAztecNodeClient(
|
|
@@ -739,7 +800,7 @@ export function createAztecNodeClient(
|
|
|
739
800
|
batchWindowMS = 0,
|
|
740
801
|
): AztecNode {
|
|
741
802
|
return createSafeJsonRpcClient<AztecNode>(url, AztecNodeApiSchema, {
|
|
742
|
-
namespaceMethods: '
|
|
803
|
+
namespaceMethods: 'aztec',
|
|
743
804
|
fetch,
|
|
744
805
|
batchWindowMS,
|
|
745
806
|
onResponse: getVersioningResponseHandler(versions),
|
|
@@ -64,6 +64,8 @@ type ProposerBlockBuilderOptions = BlockBuilderOptionsBase & {
|
|
|
64
64
|
maxBlocksPerCheckpoint: number;
|
|
65
65
|
/** Per-block gas budget multiplier. Budget = (remaining / remainingBlocks) * multiplier. */
|
|
66
66
|
perBlockAllocationMultiplier: number;
|
|
67
|
+
/** Per-block budget multiplier for DA gas and blob fields. Falls back to perBlockAllocationMultiplier when unset. */
|
|
68
|
+
perBlockDAAllocationMultiplier?: number;
|
|
67
69
|
};
|
|
68
70
|
|
|
69
71
|
/** Validator mode: no redistribution params needed. */
|
package/src/interfaces/client.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './aztec-node.js';
|
|
2
2
|
export * from './aztec-node-admin.js';
|
|
3
3
|
export * from './aztec-node-debug.js';
|
|
4
|
+
export { type PeerInfo, type ProposalsForSlot } from './p2p.js';
|
|
4
5
|
export * from './block_response.js';
|
|
5
6
|
export * from './chain_tips.js';
|
|
6
7
|
export * from './checkpoint_parameter.js';
|
|
@@ -30,6 +30,11 @@ export interface SequencerConfig {
|
|
|
30
30
|
maxDABlockGas?: number;
|
|
31
31
|
/** Per-block gas budget multiplier for both L2 and DA gas. Budget = (checkpointLimit / maxBlocks) * multiplier. */
|
|
32
32
|
perBlockAllocationMultiplier?: number;
|
|
33
|
+
/**
|
|
34
|
+
* Per-block budget multiplier applied to DA gas and blob fields in place of `perBlockAllocationMultiplier`.
|
|
35
|
+
* Defaults higher than the general multiplier so the largest contract class deploy fits a single block.
|
|
36
|
+
*/
|
|
37
|
+
perBlockDAAllocationMultiplier?: number;
|
|
33
38
|
/** Redistribute remaining checkpoint budget evenly across remaining blocks instead of allowing a single block to consume the entire remaining budget. */
|
|
34
39
|
redistributeCheckpointBudget?: boolean;
|
|
35
40
|
/** Recipient of block reward. */
|
|
@@ -44,8 +49,6 @@ export interface SequencerConfig {
|
|
|
44
49
|
txPublicSetupAllowListExtend?: AllowedElement[];
|
|
45
50
|
/** Payload address to vote for */
|
|
46
51
|
governanceProposerPayload?: EthAddress;
|
|
47
|
-
/** Whether to enforce the time table when building blocks */
|
|
48
|
-
enforceTimeTable?: boolean;
|
|
49
52
|
/**
|
|
50
53
|
* Minimum block-building time (`min_block_duration`) still worth allocating if the proposer starts
|
|
51
54
|
* late, in seconds.
|
|
@@ -56,6 +59,8 @@ export interface SequencerConfig {
|
|
|
56
59
|
* checkpoint proposal being ready for p2p send, in seconds.
|
|
57
60
|
*/
|
|
58
61
|
checkpointProposalPrepareTime?: number;
|
|
62
|
+
/** How much time (in seconds) we allow in the slot for publishing the L1 tx. */
|
|
63
|
+
l1PublishingTime?: number;
|
|
59
64
|
/** Used for testing to introduce a fake delay after processing each tx */
|
|
60
65
|
fakeProcessingDelayPerTxMs?: number;
|
|
61
66
|
/** Used for testing to throw an error after processing N txs */
|
|
@@ -95,7 +100,7 @@ export interface SequencerConfig {
|
|
|
95
100
|
fishermanMode?: boolean;
|
|
96
101
|
/** Shuffle attestation ordering to create invalid ordering (for testing only) */
|
|
97
102
|
shuffleAttestationOrdering?: boolean;
|
|
98
|
-
/** Duration per block in milliseconds
|
|
103
|
+
/** Duration per block in milliseconds, used to derive how many blocks fit in a slot (defaults to 3000 ms). */
|
|
99
104
|
blockDurationMs?: number;
|
|
100
105
|
/** Consensus grace in seconds for a received checkpoint proposal to materialize into local proposed state. */
|
|
101
106
|
checkpointProposalSyncGraceSeconds?: number;
|
|
@@ -135,6 +140,7 @@ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
|
135
140
|
publishTxsWithProposals: z.boolean().optional(),
|
|
136
141
|
maxDABlockGas: z.number().optional(),
|
|
137
142
|
perBlockAllocationMultiplier: z.number().optional(),
|
|
143
|
+
perBlockDAAllocationMultiplier: z.number().optional(),
|
|
138
144
|
redistributeCheckpointBudget: z.boolean().optional(),
|
|
139
145
|
coinbase: schemas.EthAddress.optional(),
|
|
140
146
|
feeRecipient: schemas.AztecAddress.optional(),
|
|
@@ -144,7 +150,7 @@ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
|
144
150
|
governanceProposerPayload: schemas.EthAddress.optional(),
|
|
145
151
|
minBlockDuration: z.number().positive().optional(),
|
|
146
152
|
checkpointProposalPrepareTime: z.number().nonnegative().optional(),
|
|
147
|
-
|
|
153
|
+
l1PublishingTime: z.number().optional(),
|
|
148
154
|
fakeProcessingDelayPerTxMs: z.number().optional(),
|
|
149
155
|
fakeThrowAfterProcessingTxCount: z.number().optional(),
|
|
150
156
|
attestationPropagationTime: z.number().optional(),
|
|
@@ -176,8 +182,6 @@ export const SequencerConfigSchema = zodFor<SequencerConfig>()(
|
|
|
176
182
|
|
|
177
183
|
type SequencerConfigOptionalKeys =
|
|
178
184
|
| 'governanceProposerPayload'
|
|
179
|
-
| 'blockDurationMs'
|
|
180
|
-
| 'checkpointProposalSyncGraceSeconds'
|
|
181
185
|
| 'expectedBlockProposalsPerSlot'
|
|
182
186
|
| 'coinbase'
|
|
183
187
|
| 'feeRecipient'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
import type { ZodFor } from '../schemas/schemas.js';
|
|
4
|
+
|
|
5
|
+
/** Options for retrieving txs via {@link AztecNode.getTxByHash} and {@link AztecNode.getTxsByHash}. */
|
|
6
|
+
export type GetTxByHashOptions = {
|
|
7
|
+
/** Keep the proof on the returned tx; stripped by default. */
|
|
8
|
+
includeProof?: boolean;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
/** Zod schema for {@link GetTxByHashOptions}. */
|
|
12
|
+
export const GetTxByHashOptionsSchema: ZodFor<GetTxByHashOptions> = z.object({
|
|
13
|
+
includeProof: z.boolean().optional(),
|
|
14
|
+
});
|
package/src/interfaces/p2p.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import type { CheckpointProposalHash, SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { bufferSchemaFor } from '@aztec/foundation/schemas';
|
|
2
3
|
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
5
|
-
import
|
|
6
|
+
import { BlockProposal } from '../p2p/block_proposal.js';
|
|
6
7
|
import { CheckpointAttestation } from '../p2p/checkpoint_attestation.js';
|
|
7
|
-
import type
|
|
8
|
+
import { CheckpointProposal, type CheckpointProposalCore } from '../p2p/checkpoint_proposal.js';
|
|
8
9
|
import { type ApiSchemaFor, optional, schemas } from '../schemas/index.js';
|
|
9
10
|
import { Tx } from '../tx/tx.js';
|
|
10
11
|
import { TxHash } from '../tx/tx_hash.js';
|
|
11
12
|
import { MAX_RPC_TXS_LEN } from './api_limit.js';
|
|
12
|
-
import { type GetTxByHashOptions, GetTxByHashOptionsSchema } from './
|
|
13
|
+
import { type GetTxByHashOptions, GetTxByHashOptionsSchema } from './get_tx_by_hash_options.js';
|
|
13
14
|
|
|
14
15
|
export type PeerInfo =
|
|
15
16
|
| { status: 'connected'; score: number; id: string }
|
|
16
17
|
| { status: 'dialing'; dialStatus: string; id: string; addresses: string[] }
|
|
17
18
|
| { status: 'cached'; id: string; addresses: string[]; enr: string; dialAttempts: number };
|
|
18
19
|
|
|
19
|
-
const PeerInfoSchema = z.discriminatedUnion('status', [
|
|
20
|
+
export const PeerInfoSchema = z.discriminatedUnion('status', [
|
|
20
21
|
z.object({ status: z.literal('connected'), score: z.number(), id: z.string() }),
|
|
21
22
|
z.object({ status: z.literal('dialing'), dialStatus: z.string(), id: z.string(), addresses: z.array(z.string()) }),
|
|
22
23
|
z.object({
|
|
@@ -69,20 +70,32 @@ export interface P2PApi {
|
|
|
69
70
|
): Promise<CheckpointAttestation[]>;
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
export type ProposalsForSlot = {
|
|
74
|
+
blockProposals: BlockProposal[];
|
|
75
|
+
checkpointProposals: CheckpointProposalCore[];
|
|
76
|
+
};
|
|
77
|
+
|
|
72
78
|
export interface P2PClient extends P2PApi {
|
|
73
79
|
/** Manually adds checkpoint attestations to the p2p client attestation pool. */
|
|
74
80
|
addOwnCheckpointAttestations(attestations: CheckpointAttestation[]): Promise<void>;
|
|
75
81
|
|
|
76
82
|
/** Returns retained signed proposals for a slot. */
|
|
77
|
-
getProposalsForSlot(slot: SlotNumber): Promise<
|
|
78
|
-
blockProposals: BlockProposal[];
|
|
79
|
-
checkpointProposals: CheckpointProposalCore[];
|
|
80
|
-
}>;
|
|
83
|
+
getProposalsForSlot(slot: SlotNumber): Promise<ProposalsForSlot>;
|
|
81
84
|
|
|
82
85
|
/** Returns whether a checkpoint proposal was retained for a slot. */
|
|
83
86
|
hasCheckpointProposalForSlot(slot: SlotNumber): Promise<boolean>;
|
|
84
87
|
}
|
|
85
88
|
|
|
89
|
+
const MAX_PROPOSALS_FOR_SLOT_RPC_LEN = 256;
|
|
90
|
+
|
|
91
|
+
export const BlockProposalSchema = bufferSchemaFor(BlockProposal);
|
|
92
|
+
export const CheckpointProposalSchema = bufferSchemaFor(CheckpointProposal);
|
|
93
|
+
|
|
94
|
+
export const ProposalsForSlotSchema = z.object({
|
|
95
|
+
blockProposals: z.array(BlockProposalSchema).max(MAX_PROPOSALS_FOR_SLOT_RPC_LEN),
|
|
96
|
+
checkpointProposals: z.array(CheckpointProposalSchema).max(MAX_PROPOSALS_FOR_SLOT_RPC_LEN),
|
|
97
|
+
});
|
|
98
|
+
|
|
86
99
|
export const P2PApiSchema: ApiSchemaFor<P2PApi> = {
|
|
87
100
|
getCheckpointAttestationsForSlot: z.function({
|
|
88
101
|
input: z.tuple([
|
|
@@ -83,10 +83,10 @@ export type ValidatorClientConfig = ValidatorHASignerConfig &
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export type ValidatorClientFullConfig = ValidatorClientConfig &
|
|
86
|
-
Pick<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
Pick<SequencerConfig, 'txPublicSetupAllowListExtend' | 'broadcastInvalidBlockProposal' | 'maxBlocksPerCheckpoint'> &
|
|
87
|
+
// `blockDurationMs` is optional on the loose `SequencerConfig` but is always populated via the shared
|
|
88
|
+
// `numberConfigHelper(3000)` mapping, so it is required on the fully-resolved validator config.
|
|
89
|
+
Required<Pick<SequencerConfig, 'blockDurationMs'>> &
|
|
90
90
|
Pick<
|
|
91
91
|
SlasherConfig,
|
|
92
92
|
| 'slashBroadcastedInvalidBlockPenalty'
|
|
@@ -132,8 +132,8 @@ export const ValidatorClientFullConfigSchema = zodFor<Omit<ValidatorClientFullCo
|
|
|
132
132
|
ValidatorClientConfigSchema.extend({
|
|
133
133
|
txPublicSetupAllowListExtend: z.array(AllowedElementSchema).optional(),
|
|
134
134
|
broadcastInvalidBlockProposal: z.boolean().optional(),
|
|
135
|
+
blockDurationMs: z.number().positive(),
|
|
135
136
|
maxBlocksPerCheckpoint: z.number().positive().optional(),
|
|
136
|
-
blockDurationMs: z.number().positive().optional(),
|
|
137
137
|
slashBroadcastedInvalidBlockPenalty: schemas.BigInt,
|
|
138
138
|
slashBroadcastedInvalidCheckpointProposalPenalty: schemas.BigInt,
|
|
139
139
|
slashDuplicateProposalPenalty: schemas.BigInt,
|
package/src/tests/factories.ts
CHANGED
|
@@ -26,6 +26,7 @@ import {
|
|
|
26
26
|
MAX_PRIVATE_CALL_STACK_LENGTH_PER_CALL,
|
|
27
27
|
MAX_PRIVATE_LOGS_PER_CALL,
|
|
28
28
|
MAX_PRIVATE_LOGS_PER_TX,
|
|
29
|
+
MAX_PROCESSABLE_L2_GAS,
|
|
29
30
|
MAX_PROTOCOL_CONTRACTS,
|
|
30
31
|
MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
31
32
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
@@ -232,7 +233,12 @@ export function makeTxContext(seed: number = 1): TxContext {
|
|
|
232
233
|
* Creates a default instance of gas settings. No seed value is used to ensure we allocate a sensible amount of gas for testing.
|
|
233
234
|
*/
|
|
234
235
|
export function makeGasSettings() {
|
|
235
|
-
return GasSettings.fallback({
|
|
236
|
+
return GasSettings.fallback({
|
|
237
|
+
// Arbitrary daGas pinned to the pre-existing fixture value so avm_inputs.testdata.bin (consumed by
|
|
238
|
+
// the C++ vm2 tests) stays byte-stable; teardown derives to the same values the old fallback produced.
|
|
239
|
+
gasLimits: new Gas(196_608, MAX_PROCESSABLE_L2_GAS),
|
|
240
|
+
maxFeesPerGas: new GasFees(10, 10),
|
|
241
|
+
});
|
|
236
242
|
}
|
|
237
243
|
|
|
238
244
|
/**
|
package/src/tests/mocks.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MAX_ENQUEUED_CALLS_PER_TX,
|
|
3
3
|
MAX_NULLIFIERS_PER_TX,
|
|
4
|
+
MAX_PROCESSABLE_L2_GAS,
|
|
4
5
|
MAX_TOTAL_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
|
|
6
|
+
MAX_TX_DA_GAS,
|
|
5
7
|
MAX_TX_LIFETIME,
|
|
6
8
|
PRIVATE_TX_L2_GAS_OVERHEAD,
|
|
7
9
|
PUBLIC_TX_L2_GAS_OVERHEAD,
|
|
@@ -110,7 +112,7 @@ export const mockTx = async (
|
|
|
110
112
|
publicCalldataSize = 2,
|
|
111
113
|
feePayer,
|
|
112
114
|
chonkProof = ChonkProof.random(),
|
|
113
|
-
gasLimits,
|
|
115
|
+
gasLimits = new Gas(MAX_TX_DA_GAS, MAX_PROCESSABLE_L2_GAS),
|
|
114
116
|
maxFeesPerGas = new GasFees(10, 10),
|
|
115
117
|
maxPriorityFeesPerGas,
|
|
116
118
|
gasUsed = Gas.empty(),
|
|
@@ -212,7 +214,10 @@ export async function mockProcessedTx({
|
|
|
212
214
|
db,
|
|
213
215
|
chainId = Fr.ZERO,
|
|
214
216
|
version = Fr.ZERO,
|
|
215
|
-
gasSettings = GasSettings.fallback({
|
|
217
|
+
gasSettings = GasSettings.fallback({
|
|
218
|
+
gasLimits: new Gas(MAX_TX_DA_GAS, MAX_PROCESSABLE_L2_GAS),
|
|
219
|
+
maxFeesPerGas: new GasFees(10, 10),
|
|
220
|
+
}),
|
|
216
221
|
vkTreeRoot = Fr.ZERO,
|
|
217
222
|
protocolContracts = makeProtocolContracts(seed + 0x100),
|
|
218
223
|
globalVariables = GlobalVariables.empty(),
|
package/src/timetable/README.md
CHANGED
|
@@ -275,12 +275,20 @@ where `block_index` is zero-based.
|
|
|
275
275
|
|
|
276
276
|
Sub-slot starts and deadlines do not move when earlier blocks finish early or late. If block `k` finishes early, the proposer waits until `block_build_deadline(k)` before attempting block `k + 1`. If block `k` finishes late, the next sub-slot keeps its original deadline and therefore has less remaining headroom.
|
|
277
277
|
|
|
278
|
-
The
|
|
278
|
+
The number of full-duration block sub-slots a node's local operational budgets compute is:
|
|
279
279
|
|
|
280
280
|
```text
|
|
281
|
-
|
|
281
|
+
computed_blocks_per_checkpoint = floor((last_block_build_time - first_subslot_start) / block_duration)
|
|
282
282
|
```
|
|
283
283
|
|
|
284
|
+
The effective `max_blocks_per_checkpoint` is this computed value, clamped down to the explicit network value when
|
|
285
|
+
the network value is lower. A network value at or above the computed count has no effect and the computed count is
|
|
286
|
+
used. When the local budgets compute more blocks than the network allows, the computed count is clamped down to the
|
|
287
|
+
network value and a warning is emitted. Clamping never raises the effective value above what the local budgets can
|
|
288
|
+
fit, preserving the invariant that every offered sub-slot's build deadline stays within `last_block_build_time`.
|
|
289
|
+
|
|
290
|
+
`max_blocks_per_checkpoint` is also an input to the network tx admission limits (it divides the per-checkpoint gas budgets into a per-block share); see [`../gas/README.md`](../gas/README.md) under "Gas and Data Limits".
|
|
291
|
+
|
|
284
292
|
The start deadline is the latest time at which the proposer can still squeeze one minimum-duration block and make the ideal L1 publish path:
|
|
285
293
|
|
|
286
294
|
```text
|
package/src/timetable/budgets.ts
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
/** Default block sub-slot duration (`D`) in seconds, used to derive how many blocks fit in a slot. */
|
|
2
|
+
export const DEFAULT_BLOCK_DURATION = 3;
|
|
3
|
+
|
|
1
4
|
/** Default minimum block-building duration (`min_block_duration`) in seconds. */
|
|
2
5
|
export const DEFAULT_MIN_BLOCK_DURATION = 2;
|
|
3
6
|
|
|
@@ -49,8 +52,8 @@ export type ResolvedTimingBudgets = {
|
|
|
49
52
|
};
|
|
50
53
|
|
|
51
54
|
/** Default consensus grace for received checkpoint proposals to materialize locally. */
|
|
52
|
-
export function getDefaultCheckpointProposalSyncGrace(blockDuration: number
|
|
53
|
-
return 2 *
|
|
55
|
+
export function getDefaultCheckpointProposalSyncGrace(blockDuration: number): number {
|
|
56
|
+
return 2 * blockDuration;
|
|
54
57
|
}
|
|
55
58
|
|
|
56
59
|
/**
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_BLOCK_DURATION,
|
|
3
|
+
DEFAULT_CHECKPOINT_PROPOSAL_INIT_TIME,
|
|
4
|
+
DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME,
|
|
5
|
+
DEFAULT_MIN_BLOCK_DURATION,
|
|
6
|
+
DEFAULT_P2P_PROPAGATION_TIME,
|
|
7
|
+
} from './budgets.js';
|
|
8
|
+
import type { SlotTimingConstants } from './consensus_timetable.js';
|
|
9
|
+
import { ProposerTimetable } from './proposer_timetable.js';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Subset of the sequencer/p2p config the proposer timetable derives its operational budgets from. Both
|
|
13
|
+
* {@link SequencerConfig} and {@link P2PConfig} structurally satisfy this, so the same builder is used by
|
|
14
|
+
* the sequencer, the p2p layer, and the node's `getNodeInfo`.
|
|
15
|
+
*/
|
|
16
|
+
export type ProposerTimetableConfig = {
|
|
17
|
+
blockDurationMs?: number;
|
|
18
|
+
minBlockDuration?: number;
|
|
19
|
+
attestationPropagationTime?: number;
|
|
20
|
+
checkpointProposalPrepareTime?: number;
|
|
21
|
+
checkpointProposalSyncGraceSeconds?: number;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Builds the proposer timetable from a sequencer/p2p config and the slot-timing protocol constants,
|
|
26
|
+
* applying the shared stdlib budget defaults. Single source of truth shared by the sequencer, the p2p
|
|
27
|
+
* layer, and the node's `getNodeInfo` so they all derive the same `maxBlocksPerCheckpoint`.
|
|
28
|
+
*/
|
|
29
|
+
export function buildProposerTimetable(
|
|
30
|
+
config: ProposerTimetableConfig,
|
|
31
|
+
l1Constants: SlotTimingConstants,
|
|
32
|
+
): ProposerTimetable {
|
|
33
|
+
return new ProposerTimetable({
|
|
34
|
+
l1Constants,
|
|
35
|
+
blockDuration: config.blockDurationMs !== undefined ? config.blockDurationMs / 1000 : DEFAULT_BLOCK_DURATION,
|
|
36
|
+
minBlockDuration: config.minBlockDuration ?? DEFAULT_MIN_BLOCK_DURATION,
|
|
37
|
+
p2pPropagationTime: config.attestationPropagationTime ?? DEFAULT_P2P_PROPAGATION_TIME,
|
|
38
|
+
checkpointProposalPrepareTime: config.checkpointProposalPrepareTime ?? DEFAULT_CHECKPOINT_PROPOSAL_PREPARE_TIME,
|
|
39
|
+
checkpointProposalInitTime: DEFAULT_CHECKPOINT_PROPOSAL_INIT_TIME,
|
|
40
|
+
checkpointProposalSyncGrace: config.checkpointProposalSyncGraceSeconds,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
@@ -24,8 +24,8 @@ export class ConsensusTimetable {
|
|
|
24
24
|
/** Ethereum slot duration (`E`) in seconds. */
|
|
25
25
|
public readonly ethereumSlotDuration: number;
|
|
26
26
|
|
|
27
|
-
/** Block sub-slot duration (`D`) in seconds
|
|
28
|
-
public readonly blockDuration: number
|
|
27
|
+
/** Block sub-slot duration (`D`) in seconds. */
|
|
28
|
+
public readonly blockDuration: number;
|
|
29
29
|
|
|
30
30
|
/** L1 genesis timestamp in seconds (`genesis`), the anchor all slot timings derive from. */
|
|
31
31
|
public readonly genesisTime: bigint;
|
|
@@ -33,11 +33,7 @@ export class ConsensusTimetable {
|
|
|
33
33
|
/** Consensus grace for received checkpoint proposals to materialize into local proposed state. */
|
|
34
34
|
public readonly checkpointProposalSyncGrace: number;
|
|
35
35
|
|
|
36
|
-
constructor(opts: {
|
|
37
|
-
l1Constants: SlotTimingConstants;
|
|
38
|
-
blockDuration: number | undefined;
|
|
39
|
-
checkpointProposalSyncGrace?: number;
|
|
40
|
-
}) {
|
|
36
|
+
constructor(opts: { l1Constants: SlotTimingConstants; blockDuration: number; checkpointProposalSyncGrace?: number }) {
|
|
41
37
|
const { l1Constants, blockDuration } = opts;
|
|
42
38
|
const checkpointProposalSyncGrace =
|
|
43
39
|
opts.checkpointProposalSyncGrace ?? getDefaultCheckpointProposalSyncGrace(blockDuration);
|
|
@@ -47,8 +43,8 @@ export class ConsensusTimetable {
|
|
|
47
43
|
if (l1Constants.ethereumSlotDuration <= 0) {
|
|
48
44
|
throw new Error(`ethereumSlotDuration must be positive (got ${l1Constants.ethereumSlotDuration})`);
|
|
49
45
|
}
|
|
50
|
-
if (blockDuration
|
|
51
|
-
throw new Error(`blockDuration must be positive
|
|
46
|
+
if (blockDuration <= 0) {
|
|
47
|
+
throw new Error(`blockDuration must be positive (got ${blockDuration})`);
|
|
52
48
|
}
|
|
53
49
|
if (checkpointProposalSyncGrace < 0) {
|
|
54
50
|
throw new Error(`checkpointProposalSyncGrace must be non-negative (got ${checkpointProposalSyncGrace})`);
|
|
@@ -85,12 +81,10 @@ export class ConsensusTimetable {
|
|
|
85
81
|
|
|
86
82
|
/**
|
|
87
83
|
* Hard consensus receive deadline for a checkpoint proposal: `target_slot_start - E - D`. Validators
|
|
88
|
-
* reject proposals arriving after this, and the next proposer does not build on them.
|
|
89
|
-
* mode (`blockDuration` undefined) the `D` term drops to zero, giving `target_slot_start - E` (the
|
|
90
|
-
* next proposer's build-frame boundary), so this remains usable rather than throwing.
|
|
84
|
+
* reject proposals arriving after this, and the next proposer does not build on them.
|
|
91
85
|
*/
|
|
92
86
|
public getCheckpointProposalReceiveDeadline(slot: SlotNumber): number {
|
|
93
|
-
return this.getTargetSlotStart(slot) - this.ethereumSlotDuration -
|
|
87
|
+
return this.getTargetSlotStart(slot) - this.ethereumSlotDuration - this.blockDuration;
|
|
94
88
|
}
|
|
95
89
|
|
|
96
90
|
/**
|
|
@@ -100,7 +94,7 @@ export class ConsensusTimetable {
|
|
|
100
94
|
*/
|
|
101
95
|
public getCheckpointProposalSyncedDeadline(slot: SlotNumber): number {
|
|
102
96
|
return Math.ceil(
|
|
103
|
-
this.getCheckpointProposalReceiveDeadline(slot) +
|
|
97
|
+
this.getCheckpointProposalReceiveDeadline(slot) + this.blockDuration + this.checkpointProposalSyncGrace,
|
|
104
98
|
);
|
|
105
99
|
}
|
|
106
100
|
|
package/src/timetable/index.ts
CHANGED