@aztec/validator-client 5.0.0-private.20260319 → 5.0.0-rc.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/validator-client",
3
- "version": "5.0.0-private.20260319",
3
+ "version": "5.0.0-rc.1",
4
4
  "main": "dest/index.js",
5
5
  "type": "module",
6
6
  "exports": {
@@ -64,30 +64,30 @@
64
64
  ]
65
65
  },
66
66
  "dependencies": {
67
- "@aztec/blob-client": "5.0.0-private.20260319",
68
- "@aztec/blob-lib": "5.0.0-private.20260319",
69
- "@aztec/constants": "5.0.0-private.20260319",
70
- "@aztec/epoch-cache": "5.0.0-private.20260319",
71
- "@aztec/ethereum": "5.0.0-private.20260319",
72
- "@aztec/foundation": "5.0.0-private.20260319",
73
- "@aztec/node-keystore": "5.0.0-private.20260319",
74
- "@aztec/noir-protocol-circuits-types": "5.0.0-private.20260319",
75
- "@aztec/p2p": "5.0.0-private.20260319",
76
- "@aztec/protocol-contracts": "5.0.0-private.20260319",
77
- "@aztec/prover-client": "5.0.0-private.20260319",
78
- "@aztec/simulator": "5.0.0-private.20260319",
79
- "@aztec/slasher": "5.0.0-private.20260319",
80
- "@aztec/stdlib": "5.0.0-private.20260319",
81
- "@aztec/telemetry-client": "5.0.0-private.20260319",
82
- "@aztec/validator-ha-signer": "5.0.0-private.20260319",
67
+ "@aztec/blob-client": "5.0.0-rc.1",
68
+ "@aztec/blob-lib": "5.0.0-rc.1",
69
+ "@aztec/constants": "5.0.0-rc.1",
70
+ "@aztec/epoch-cache": "5.0.0-rc.1",
71
+ "@aztec/ethereum": "5.0.0-rc.1",
72
+ "@aztec/foundation": "5.0.0-rc.1",
73
+ "@aztec/node-keystore": "5.0.0-rc.1",
74
+ "@aztec/noir-protocol-circuits-types": "5.0.0-rc.1",
75
+ "@aztec/p2p": "5.0.0-rc.1",
76
+ "@aztec/protocol-contracts": "5.0.0-rc.1",
77
+ "@aztec/prover-client": "5.0.0-rc.1",
78
+ "@aztec/simulator": "5.0.0-rc.1",
79
+ "@aztec/slasher": "5.0.0-rc.1",
80
+ "@aztec/stdlib": "5.0.0-rc.1",
81
+ "@aztec/telemetry-client": "5.0.0-rc.1",
82
+ "@aztec/validator-ha-signer": "5.0.0-rc.1",
83
83
  "koa": "^2.16.1",
84
84
  "koa-router": "^13.1.1",
85
85
  "tslib": "^2.4.0",
86
86
  "viem": "npm:@aztec/viem@2.38.2"
87
87
  },
88
88
  "devDependencies": {
89
- "@aztec/archiver": "5.0.0-private.20260319",
90
- "@aztec/world-state": "5.0.0-private.20260319",
89
+ "@aztec/archiver": "5.0.0-rc.1",
90
+ "@aztec/world-state": "5.0.0-rc.1",
91
91
  "@electric-sql/pglite": "^0.3.14",
92
92
  "@jest/globals": "^30.0.0",
93
93
  "@types/jest": "^30.0.0",
@@ -219,10 +219,12 @@ export class CheckpointBuilder implements ICheckpointBlockBuilder {
219
219
  if (opts.isBuildingProposal) {
220
220
  const remainingBlocks = Math.max(1, opts.maxBlocksPerCheckpoint - existingBlocks.length);
221
221
  const multiplier = opts.perBlockAllocationMultiplier;
222
+ // DA gas and blob fields use a higher multiplier so the largest contract class deploy fits a block.
223
+ const daMultiplier = opts.perBlockDAAllocationMultiplier ?? multiplier;
222
224
 
223
225
  cappedL2Gas = Math.min(cappedL2Gas, Math.ceil((remainingMana / remainingBlocks) * multiplier));
224
- cappedDAGas = Math.min(cappedDAGas, Math.ceil((remainingDAGas / remainingBlocks) * multiplier));
225
- cappedBlobFields = Math.min(cappedBlobFields, Math.ceil((maxBlobFieldsForTxs / remainingBlocks) * multiplier));
226
+ cappedDAGas = Math.min(cappedDAGas, Math.ceil((remainingDAGas / remainingBlocks) * daMultiplier));
227
+ cappedBlobFields = Math.min(cappedBlobFields, Math.ceil((maxBlobFieldsForTxs / remainingBlocks) * daMultiplier));
226
228
  cappedMaxTransactions = Math.min(cappedMaxTransactions, Math.ceil((remainingTxs / remainingBlocks) * multiplier));
227
229
  }
228
230
 
package/src/config.ts CHANGED
@@ -3,15 +3,27 @@ import {
3
3
  booleanConfigHelper,
4
4
  getConfigFromMappings,
5
5
  numberConfigHelper,
6
+ optionalNumberConfigHelper,
7
+ pickConfigMappings,
6
8
  secretValueConfigHelper,
7
9
  } from '@aztec/foundation/config';
8
10
  import { EthAddress } from '@aztec/foundation/eth-address';
11
+ import { type SequencerConfig, sharedSequencerConfigMappings } from '@aztec/stdlib/config';
9
12
  import { localSignerConfigMappings, validatorHASignerConfigMappings } from '@aztec/stdlib/ha-signing';
10
13
  import type { ValidatorClientConfig } from '@aztec/stdlib/interfaces/server';
11
14
 
12
15
  export type { ValidatorClientConfig };
13
16
 
14
- export const validatorClientConfigMappings: ConfigMappingsType<ValidatorClientConfig> = {
17
+ /**
18
+ * Default clock-disparity tolerance (ms) for proposal/attestation receive windows, mirroring the p2p config
19
+ * default. Used by the validator-client validators when the merged node config does not carry the value.
20
+ */
21
+ export const DEFAULT_MAX_GOSSIP_CLOCK_DISPARITY_MS = 500;
22
+
23
+ export const validatorClientConfigMappings: ConfigMappingsType<
24
+ ValidatorClientConfig & Pick<SequencerConfig, 'blockDurationMs'>
25
+ > = {
26
+ ...pickConfigMappings(sharedSequencerConfigMappings, ['blockDurationMs']),
15
27
  validatorPrivateKeys: {
16
28
  env: 'VALIDATOR_PRIVATE_KEYS',
17
29
  description: 'List of private keys of the validators participating in attestation duties',
@@ -30,6 +42,12 @@ export const validatorClientConfigMappings: ConfigMappingsType<ValidatorClientCo
30
42
  .map(address => EthAddress.fromString(address.trim())),
31
43
  defaultValue: [],
32
44
  },
45
+ l1ChainId: {
46
+ env: 'L1_CHAIN_ID',
47
+ description: 'The chain ID of the ethereum host.',
48
+ parseEnv: (val: string) => +val,
49
+ defaultValue: 31337,
50
+ },
33
51
  disableValidator: {
34
52
  env: 'VALIDATOR_DISABLED',
35
53
  description: 'Do not run the validator',
@@ -49,11 +67,6 @@ export const validatorClientConfigMappings: ConfigMappingsType<ValidatorClientCo
49
67
  description: 'Interval between polling for new attestations',
50
68
  ...numberConfigHelper(200),
51
69
  },
52
- validatorReexecute: {
53
- env: 'VALIDATOR_REEXECUTE',
54
- description: 'Re-execute transactions before attesting',
55
- ...booleanConfigHelper(true),
56
- },
57
70
  alwaysReexecuteBlockProposals: {
58
71
  description:
59
72
  'Whether to always reexecute block proposals, even for non-validator nodes (useful for monitoring network status).',
@@ -77,25 +90,29 @@ export const validatorClientConfigMappings: ConfigMappingsType<ValidatorClientCo
77
90
  description: 'Agree to attest to equivocated checkpoint proposals (for testing purposes only)',
78
91
  ...booleanConfigHelper(false),
79
92
  },
93
+ skipProposalSlotValidation: {
94
+ description: 'Accept proposal validation regardless of slot timing (for testing only)',
95
+ ...booleanConfigHelper(false),
96
+ },
80
97
  validateMaxL2BlockGas: {
81
98
  env: 'VALIDATOR_MAX_L2_BLOCK_GAS',
82
99
  description: 'Maximum L2 block gas for validation. Proposals exceeding this limit are rejected.',
83
- parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
100
+ ...optionalNumberConfigHelper(),
84
101
  },
85
102
  validateMaxDABlockGas: {
86
103
  env: 'VALIDATOR_MAX_DA_BLOCK_GAS',
87
104
  description: 'Maximum DA block gas for validation. Proposals exceeding this limit are rejected.',
88
- parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
105
+ ...optionalNumberConfigHelper(),
89
106
  },
90
107
  validateMaxTxsPerBlock: {
91
108
  env: 'VALIDATOR_MAX_TX_PER_BLOCK',
92
109
  description: 'Maximum transactions per block for validation. Proposals exceeding this limit are rejected.',
93
- parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
110
+ ...optionalNumberConfigHelper(),
94
111
  },
95
112
  validateMaxTxsPerCheckpoint: {
96
113
  env: 'VALIDATOR_MAX_TX_PER_CHECKPOINT',
97
114
  description: 'Maximum transactions per checkpoint for validation. Proposals exceeding this limit are rejected.',
98
- parseEnv: (val: string) => (val ? parseInt(val, 10) : undefined),
115
+ ...optionalNumberConfigHelper(),
99
116
  },
100
117
  ...localSignerConfigMappings,
101
118
  ...validatorHASignerConfigMappings,
@@ -106,6 +123,8 @@ export const validatorClientConfigMappings: ConfigMappingsType<ValidatorClientCo
106
123
  * Note: If an environment variable is not set, the default value is used.
107
124
  * @returns The validator configuration.
108
125
  */
109
- export function getProverEnvVars(): ValidatorClientConfig {
110
- return getConfigFromMappings<ValidatorClientConfig>(validatorClientConfigMappings);
126
+ export function getProverEnvVars(): ValidatorClientConfig & Pick<SequencerConfig, 'blockDurationMs'> {
127
+ return getConfigFromMappings<ValidatorClientConfig & Pick<SequencerConfig, 'blockDurationMs'>>(
128
+ validatorClientConfigMappings,
129
+ );
111
130
  }
@@ -1,17 +1,9 @@
1
- import {
2
- BlockNumber,
3
- type CheckpointNumber,
4
- IndexWithinCheckpoint,
5
- type SlotNumber,
6
- } from '@aztec/foundation/branded-types';
7
- import { Buffer32 } from '@aztec/foundation/buffer';
8
- import { keccak256 } from '@aztec/foundation/crypto/keccak';
1
+ import { type CheckpointNumber, IndexWithinCheckpoint, type SlotNumber } from '@aztec/foundation/branded-types';
9
2
  import { Fr } from '@aztec/foundation/curves/bn254';
10
3
  import type { EthAddress } from '@aztec/foundation/eth-address';
11
4
  import type { Signature } from '@aztec/foundation/eth-signature';
12
5
  import { createLogger } from '@aztec/foundation/log';
13
- import type { CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
14
- import type { CreateCheckpointProposalLastBlockData } from '@aztec/stdlib/interfaces/server';
6
+ import { CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
15
7
  import {
16
8
  BlockProposal,
17
9
  type BlockProposalOptions,
@@ -20,9 +12,10 @@ import {
20
12
  type CheckpointProposalCore,
21
13
  type CheckpointProposalOptions,
22
14
  ConsensusPayload,
23
- SignatureDomainSeparator,
15
+ type CoordinationSignatureContext,
16
+ getCoordinationSignatureTypedData,
24
17
  } from '@aztec/stdlib/p2p';
25
- import type { CheckpointHeader } from '@aztec/stdlib/rollup';
18
+ import { CheckpointHeader } from '@aztec/stdlib/rollup';
26
19
  import type { BlockHeader, Tx } from '@aztec/stdlib/tx';
27
20
  import { DutyAlreadySignedError, SlashingProtectionError } from '@aztec/validator-ha-signer/errors';
28
21
  import { DutyType, type SigningContext } from '@aztec/validator-ha-signer/types';
@@ -32,6 +25,7 @@ import type { ValidatorKeyStore } from '../key_store/interface.js';
32
25
  export class ValidationService {
33
26
  constructor(
34
27
  private keyStore: ValidatorKeyStore,
28
+ private signatureContext: CoordinationSignatureContext,
35
29
  private log = createLogger('validator:validation-service'),
36
30
  ) {}
37
31
 
@@ -52,6 +46,7 @@ export class ValidationService {
52
46
  */
53
47
  public createBlockProposal(
54
48
  blockHeader: BlockHeader,
49
+ checkpointNumber: CheckpointNumber,
55
50
  blockIndexWithinCheckpoint: IndexWithinCheckpoint,
56
51
  inHash: Fr,
57
52
  archive: Fr,
@@ -67,17 +62,26 @@ export class ValidationService {
67
62
 
68
63
  // Create a signer that uses the appropriate address
69
64
  const address = proposerAttesterAddress ?? this.keyStore.getAddress(0);
70
- const payloadSigner = (payload: Buffer32, context: SigningContext) =>
71
- this.keyStore.signMessageWithAddress(address, payload, context);
65
+ const payloadSigner = (
66
+ typedData: Parameters<ValidatorKeyStore['signTypedDataWithAddress']>[1],
67
+ context: SigningContext,
68
+ ) => this.keyStore.signTypedDataWithAddress(address, typedData, context);
69
+ const txsSigner = (
70
+ typedData: Parameters<ValidatorKeyStore['signTypedDataWithAddress']>[1],
71
+ context: SigningContext,
72
+ ) => this.keyStore.signTypedDataWithAddress(address, typedData, context);
72
73
 
73
74
  return BlockProposal.createProposalFromSigner(
74
75
  blockHeader,
76
+ checkpointNumber,
75
77
  blockIndexWithinCheckpoint,
76
78
  inHash,
77
79
  archive,
78
80
  txs.map(tx => tx.getTxHash()),
79
81
  options.publishFullTxs ? txs : undefined,
82
+ this.signatureContext,
80
83
  payloadSigner,
84
+ txsSigner,
81
85
  );
82
86
  }
83
87
 
@@ -86,7 +90,7 @@ export class ValidationService {
86
90
  *
87
91
  * @param checkpointHeader - The checkpoint header containing aggregated data
88
92
  * @param archive - The archive of the checkpoint
89
- * @param lastBlockInfo - Info about the last block (header, index, txs) or undefined
93
+ * @param lastBlockProposal - Signed block proposal for the last block in the checkpoint, or undefined
90
94
  * @param proposerAttesterAddress - The address of the proposer
91
95
  * @param options - Checkpoint proposal options
92
96
  *
@@ -95,36 +99,41 @@ export class ValidationService {
95
99
  public createCheckpointProposal(
96
100
  checkpointHeader: CheckpointHeader,
97
101
  archive: Fr,
102
+ checkpointNumber: CheckpointNumber,
98
103
  feeAssetPriceModifier: bigint,
99
- lastBlockInfo: CreateCheckpointProposalLastBlockData | undefined,
104
+ lastBlockProposal: BlockProposal | undefined,
100
105
  proposerAttesterAddress: EthAddress | undefined,
101
106
  options: CheckpointProposalOptions,
102
107
  ): Promise<CheckpointProposal> {
103
- // For testing: change the archive to trigger state_mismatch validation failure
108
+ // For testing: corrupt the checkpoint so observers' checkpoint validation fails.
109
+ //
110
+ // Keep `archive` aligned with `lastBlockProposal.archiveRoot` so the archive-based lookup
111
+ // in `validateCheckpointProposal` (`getBlockData({ archive })`) still succeeds
104
112
  if (options.broadcastInvalidCheckpointProposal) {
105
- archive = Fr.random();
113
+ archive = lastBlockProposal?.archiveRoot ?? Fr.random();
114
+ checkpointHeader = CheckpointHeader.from({
115
+ ...checkpointHeader,
116
+ epochOutHash: Fr.random(),
117
+ });
106
118
  this.log.warn(`Creating INVALID checkpoint proposal for slot ${checkpointHeader.slotNumber}`);
107
119
  }
108
120
 
109
121
  // Create a signer that takes payload and context, and uses the appropriate address
110
- const payloadSigner = (payload: Buffer32, context: SigningContext) => {
122
+ const payloadSigner = (
123
+ typedData: Parameters<ValidatorKeyStore['signTypedDataWithAddress']>[1],
124
+ context: SigningContext,
125
+ ) => {
111
126
  const address = proposerAttesterAddress ?? this.keyStore.getAddress(0);
112
- return this.keyStore.signMessageWithAddress(address, payload, context);
113
- };
114
-
115
- // Last block to include in the proposal
116
- const lastBlock = lastBlockInfo && {
117
- blockHeader: lastBlockInfo.blockHeader,
118
- indexWithinCheckpoint: lastBlockInfo.indexWithinCheckpoint,
119
- txHashes: lastBlockInfo.txs.map(tx => tx.getTxHash()),
120
- txs: options.publishFullTxs ? lastBlockInfo.txs : undefined,
127
+ return this.keyStore.signTypedDataWithAddress(address, typedData, context);
121
128
  };
122
129
 
123
130
  return CheckpointProposal.createProposalFromSigner(
124
131
  checkpointHeader,
125
132
  archive,
133
+ checkpointNumber,
126
134
  feeAssetPriceModifier,
127
- lastBlock,
135
+ lastBlockProposal,
136
+ this.signatureContext,
128
137
  payloadSigner,
129
138
  );
130
139
  }
@@ -142,29 +151,27 @@ export class ValidationService {
142
151
  async attestToCheckpointProposal(
143
152
  proposal: CheckpointProposalCore,
144
153
  attestors: EthAddress[],
154
+ checkpointNumber: CheckpointNumber,
145
155
  ): Promise<CheckpointAttestation[]> {
146
156
  // Create the attestation payload from the checkpoint proposal
147
- const payload = new ConsensusPayload(proposal.checkpointHeader, proposal.archive, proposal.feeAssetPriceModifier);
148
- const buf = Buffer32.fromBuffer(
149
- keccak256(payload.getPayloadToSign(SignatureDomainSeparator.checkpointAttestation)),
157
+ const payload = new ConsensusPayload(
158
+ proposal.checkpointHeader,
159
+ proposal.archive,
160
+ proposal.feeAssetPriceModifier,
161
+ this.signatureContext,
150
162
  );
163
+ const typedData = getCoordinationSignatureTypedData(payload);
151
164
 
152
- // TODO(spy/ha): Use checkpointNumber instead of blockNumber once CheckpointHeader includes it.
153
- // CheckpointProposalCore doesn't have lastBlock info, so use 0 as a proxy.
154
- // blockNumber is NOT used for the primary key so it's safe to use here.
155
- // See CheckpointHeader TODO and SigningContext types documentation.
156
- const blockNumber = BlockNumber(0);
157
165
  const context: SigningContext = {
158
166
  slot: proposal.slotNumber,
159
- blockNumber,
167
+ checkpointNumber,
160
168
  dutyType: DutyType.ATTESTATION,
161
169
  };
162
170
 
163
171
  // Sign each attestor in parallel, catching HA errors per-attestor
164
172
  const results = await Promise.allSettled(
165
173
  attestors.map(async attestor => {
166
- const sig = await this.keyStore.signMessageWithAddress(attestor, buf, context);
167
- // return new BlockAttestation(proposal.payload, sig, proposal.signature);
174
+ const sig = await this.keyStore.signTypedDataWithAddress(attestor, typedData, context);
168
175
  return new CheckpointAttestation(payload, sig, proposal.signature);
169
176
  }),
170
177
  );
@@ -195,7 +202,6 @@ export class ValidationService {
195
202
  * @param attestationsAndSigners - The attestations and signers to sign
196
203
  * @param proposer - The proposer address to sign with
197
204
  * @param slot - The slot number for HA signing context
198
- * @param blockNumber - The block or checkpoint number for HA signing context
199
205
  * @returns signature
200
206
  * @throws DutyAlreadySignedError if already signed by another HA node
201
207
  * @throws SlashingProtectionError if attempting to sign different data for same slot
@@ -204,17 +210,15 @@ export class ValidationService {
204
210
  attestationsAndSigners: CommitteeAttestationsAndSigners,
205
211
  proposer: EthAddress,
206
212
  slot: SlotNumber,
207
- blockNumber: BlockNumber | CheckpointNumber,
213
+ checkpointNumber: CheckpointNumber,
208
214
  ): Promise<Signature> {
209
215
  const context: SigningContext = {
210
216
  slot,
211
- blockNumber,
217
+ checkpointNumber,
212
218
  dutyType: DutyType.ATTESTATIONS_AND_SIGNERS,
213
219
  };
214
220
 
215
- const buf = Buffer32.fromBuffer(
216
- keccak256(attestationsAndSigners.getPayloadToSign(SignatureDomainSeparator.attestationsAndSigners)),
217
- );
218
- return this.keyStore.signMessageWithAddress(proposer, buf, context);
221
+ const typedData = getCoordinationSignatureTypedData(attestationsAndSigners);
222
+ return this.keyStore.signTypedDataWithAddress(proposer, typedData, context);
219
223
  }
220
224
  }
package/src/factory.ts CHANGED
@@ -4,17 +4,20 @@ import type { DateProvider } from '@aztec/foundation/timer';
4
4
  import type { KeystoreManager } from '@aztec/node-keystore';
5
5
  import { BlockProposalValidator, type P2PClient } from '@aztec/p2p';
6
6
  import type { L2BlockSink, L2BlockSource } from '@aztec/stdlib/block';
7
+ import type { CheckpointReexecutionTracker } from '@aztec/stdlib/checkpoint';
7
8
  import type { ValidatorClientFullConfig, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
8
9
  import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
10
+ import { ConsensusTimetable } from '@aztec/stdlib/timetable';
9
11
  import type { TelemetryClient } from '@aztec/telemetry-client';
10
12
  import type { SlashingProtectionDatabase } from '@aztec/validator-ha-signer/types';
11
13
 
12
- import { BlockProposalHandler } from './block_proposal_handler.js';
13
14
  import type { FullNodeCheckpointsBuilder } from './checkpoint_builder.js';
15
+ import { DEFAULT_MAX_GOSSIP_CLOCK_DISPARITY_MS } from './config.js';
14
16
  import { ValidatorMetrics } from './metrics.js';
17
+ import { ProposalHandler } from './proposal_handler.js';
15
18
  import { ValidatorClient } from './validator.js';
16
19
 
17
- export function createBlockProposalHandler(
20
+ export function createProposalHandler(
18
21
  config: ValidatorClientFullConfig,
19
22
  deps: {
20
23
  checkpointsBuilder: FullNodeCheckpointsBuilder;
@@ -23,16 +26,28 @@ export function createBlockProposalHandler(
23
26
  l1ToL2MessageSource: L1ToL2MessageSource;
24
27
  p2pClient: P2PClient;
25
28
  epochCache: EpochCache;
29
+ blobClient: BlobClientInterface;
26
30
  dateProvider: DateProvider;
27
31
  telemetry: TelemetryClient;
32
+ reexecutionTracker: CheckpointReexecutionTracker;
28
33
  },
29
34
  ) {
30
35
  const metrics = new ValidatorMetrics(deps.telemetry);
31
- const blockProposalValidator = new BlockProposalValidator(deps.epochCache, {
36
+ const consensusTimetable = new ConsensusTimetable({
37
+ l1Constants: deps.epochCache.getL1Constants(),
38
+ blockDuration: config.blockDurationMs / 1000,
39
+ });
40
+ const blockProposalValidator = new BlockProposalValidator(deps.epochCache, consensusTimetable, {
32
41
  txsPermitted: !config.disableTransactions,
33
42
  maxTxsPerBlock: config.validateMaxTxsPerBlock ?? config.validateMaxTxsPerCheckpoint,
43
+ maxBlocksPerCheckpoint: config.maxBlocksPerCheckpoint,
44
+ signatureContext: {
45
+ chainId: config.l1ChainId,
46
+ rollupAddress: config.rollupAddress,
47
+ },
48
+ clockDisparityMs: config.maxGossipClockDisparityMs ?? DEFAULT_MAX_GOSSIP_CLOCK_DISPARITY_MS,
34
49
  });
35
- return new BlockProposalHandler(
50
+ return new ProposalHandler(
36
51
  deps.checkpointsBuilder,
37
52
  deps.worldState,
38
53
  deps.blockSource,
@@ -40,10 +55,14 @@ export function createBlockProposalHandler(
40
55
  deps.p2pClient.getTxProvider(),
41
56
  blockProposalValidator,
42
57
  deps.epochCache,
58
+ consensusTimetable,
43
59
  config,
60
+ deps.blobClient,
61
+ deps.reexecutionTracker,
44
62
  metrics,
45
63
  deps.dateProvider,
46
64
  deps.telemetry,
65
+ undefined,
47
66
  );
48
67
  }
49
68
 
@@ -60,6 +79,7 @@ export function createValidatorClient(
60
79
  epochCache: EpochCache;
61
80
  keyStoreManager: KeystoreManager | undefined;
62
81
  blobClient: BlobClientInterface;
82
+ reexecutionTracker: CheckpointReexecutionTracker;
63
83
  slashingProtectionDb?: SlashingProtectionDatabase;
64
84
  },
65
85
  ) {
@@ -79,6 +99,7 @@ export function createValidatorClient(
79
99
  txProvider,
80
100
  deps.keyStoreManager,
81
101
  deps.blobClient,
102
+ deps.reexecutionTracker,
82
103
  deps.dateProvider,
83
104
  deps.telemetry,
84
105
  deps.slashingProtectionDb,
package/src/index.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from './block_proposal_handler.js';
1
+ export * from './proposal_handler.js';
2
2
  export * from './checkpoint_builder.js';
3
3
  export * from './config.js';
4
4
  export * from './factory.js';
package/src/metrics.ts CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  createUpDownCounterWithDefault,
12
12
  } from '@aztec/telemetry-client';
13
13
 
14
- import type { BlockProposalValidationFailureReason } from './block_proposal_handler.js';
14
+ import type { BlockProposalValidationFailureReason } from './proposal_handler.js';
15
15
 
16
16
  export class ValidatorMetrics {
17
17
  private failedReexecutionCounter: UpDownCounter;
@@ -24,6 +24,8 @@ export class ValidatorMetrics {
24
24
  private reexMana: Histogram;
25
25
  private reexTx: Histogram;
26
26
  private reexDuration: Gauge;
27
+ private checkpointProposalToPipelinedStateDuration: Histogram;
28
+ private checkpointProposalReceiveOffsetFromNextSlotBoundary: Histogram;
27
29
 
28
30
  constructor(telemetryClient: TelemetryClient) {
29
31
  const meter = telemetryClient.getMeter('Validator');
@@ -77,6 +79,12 @@ export class ValidatorMetrics {
77
79
  this.reexTx = meter.createHistogram(Metrics.VALIDATOR_RE_EXECUTION_TX_COUNT);
78
80
 
79
81
  this.reexDuration = meter.createGauge(Metrics.VALIDATOR_RE_EXECUTION_TIME);
82
+ this.checkpointProposalToPipelinedStateDuration = meter.createHistogram(
83
+ Metrics.VALIDATOR_CHECKPOINT_PROPOSAL_TO_PIPELINED_STATE_DURATION,
84
+ );
85
+ this.checkpointProposalReceiveOffsetFromNextSlotBoundary = meter.createHistogram(
86
+ Metrics.VALIDATOR_CHECKPOINT_PROPOSAL_RECEIVE_OFFSET_FROM_NEXT_SLOT_BOUNDARY,
87
+ );
80
88
  }
81
89
 
82
90
  public recordReex(time: number, txs: number, mManaTotal: number) {
@@ -85,6 +93,16 @@ export class ValidatorMetrics {
85
93
  this.reexMana.record(mManaTotal);
86
94
  }
87
95
 
96
+ public recordCheckpointProposalToPipelinedStateDuration(durationMs: number) {
97
+ this.checkpointProposalToPipelinedStateDuration.record(Math.ceil(durationMs));
98
+ }
99
+
100
+ public recordCheckpointProposalReceiveOffsetFromNextSlotBoundary(offsetMs: number) {
101
+ this.checkpointProposalReceiveOffsetFromNextSlotBoundary.record(Math.ceil(Math.abs(offsetMs)), {
102
+ [Attributes.SLOT_BOUNDARY_SIDE]: offsetMs < 0 ? 'before' : 'after',
103
+ });
104
+ }
105
+
88
106
  public recordFailedReexecution(proposal: BlockProposal) {
89
107
  const proposer = proposal.getSender();
90
108
  this.failedReexecutionCounter.add(1, {