@aztec/validator-client 2.0.3-rc.9 → 2.1.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.
@@ -0,0 +1,47 @@
1
+ import { Fr } from '@aztec/foundation/fields';
2
+ import { DateProvider } from '@aztec/foundation/timer';
3
+ import type { P2P, PeerId } from '@aztec/p2p';
4
+ import { TxProvider } from '@aztec/p2p';
5
+ import { BlockProposalValidator } from '@aztec/p2p/msg_validators';
6
+ import type { L2BlockSource } from '@aztec/stdlib/block';
7
+ import type { IFullNodeBlockBuilder, ValidatorClientFullConfig } from '@aztec/stdlib/interfaces/server';
8
+ import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
9
+ import { type BlockProposal } from '@aztec/stdlib/p2p';
10
+ import { type FailedTx, type Tx } from '@aztec/stdlib/tx';
11
+ import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
12
+ import type { ValidatorMetrics } from './metrics.js';
13
+ export type BlockProposalValidationFailureReason = 'invalid_proposal' | 'parent_block_not_found' | 'parent_block_does_not_match' | 'in_hash_mismatch' | 'block_number_already_exists' | 'txs_not_available' | 'state_mismatch' | 'failed_txs' | 'timeout' | 'unknown_error';
14
+ export interface BlockProposalValidationResult {
15
+ isValid: boolean;
16
+ reason?: BlockProposalValidationFailureReason;
17
+ reexecutionResult?: {
18
+ block: any;
19
+ failedTxs: FailedTx[];
20
+ reexecutionTimeMs: number;
21
+ totalManaUsed: number;
22
+ };
23
+ }
24
+ export declare class BlockProposalHandler {
25
+ private blockBuilder;
26
+ private blockSource;
27
+ private l1ToL2MessageSource;
28
+ private txProvider;
29
+ private blockProposalValidator;
30
+ private config;
31
+ private metrics?;
32
+ private dateProvider;
33
+ private log;
34
+ readonly tracer: Tracer;
35
+ constructor(blockBuilder: IFullNodeBlockBuilder, blockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, txProvider: TxProvider, blockProposalValidator: BlockProposalValidator, config: ValidatorClientFullConfig, metrics?: ValidatorMetrics | undefined, dateProvider?: DateProvider, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
36
+ registerForReexecution(p2pClient: P2P): BlockProposalHandler;
37
+ handleBlockProposal(proposal: BlockProposal, proposalSender: PeerId, shouldReexecute: boolean): Promise<BlockProposalValidationResult>;
38
+ private getReexecutionDeadline;
39
+ private getReexecuteFailureReason;
40
+ reexecuteTransactions(proposal: BlockProposal, txs: Tx[], l1ToL2Messages: Fr[]): Promise<{
41
+ block: any;
42
+ failedTxs: FailedTx[];
43
+ reexecutionTimeMs: number;
44
+ totalManaUsed: number;
45
+ }>;
46
+ }
47
+ //# sourceMappingURL=block_proposal_handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"block_proposal_handler.d.ts","sourceRoot":"","sources":["../src/block_proposal_handler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAG9C,OAAO,EAAE,YAAY,EAAS,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AACxG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAE,KAAK,QAAQ,EAAmB,KAAK,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAO3E,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAsB,MAAM,yBAAyB,CAAC;AAEhG,OAAO,KAAK,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AAO,CAAC,sBAAsB;IAS9B,OAAO,CAAC,yBAAyB;IAY3B,qBAAqB,CACzB,QAAQ,EAAE,aAAa,EACvB,GAAG,EAAE,EAAE,EAAE,EACT,cAAc,EAAE,EAAE,EAAE,GACnB,OAAO,CAAC;QACT,KAAK,EAAE,GAAG,CAAC;QACX,SAAS,EAAE,QAAQ,EAAE,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CA8EH"}
@@ -0,0 +1,257 @@
1
+ import { INITIAL_L2_BLOCK_NUM } from '@aztec/constants';
2
+ import { Fr } from '@aztec/foundation/fields';
3
+ import { createLogger } from '@aztec/foundation/log';
4
+ import { retryUntil } from '@aztec/foundation/retry';
5
+ import { DateProvider, Timer } from '@aztec/foundation/timer';
6
+ import { computeInHashFromL1ToL2Messages } from '@aztec/prover-client/helpers';
7
+ import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
8
+ import { ConsensusPayload } from '@aztec/stdlib/p2p';
9
+ import { GlobalVariables } from '@aztec/stdlib/tx';
10
+ import { ReExFailedTxsError, ReExStateMismatchError, ReExTimeoutError, TransactionsNotAvailableError } from '@aztec/stdlib/validators';
11
+ import { getTelemetryClient } from '@aztec/telemetry-client';
12
+ export class BlockProposalHandler {
13
+ blockBuilder;
14
+ blockSource;
15
+ l1ToL2MessageSource;
16
+ txProvider;
17
+ blockProposalValidator;
18
+ config;
19
+ metrics;
20
+ dateProvider;
21
+ log;
22
+ tracer;
23
+ constructor(blockBuilder, blockSource, l1ToL2MessageSource, txProvider, blockProposalValidator, config, metrics, dateProvider = new DateProvider(), telemetry = getTelemetryClient(), log = createLogger('validator:block-proposal-handler')){
24
+ this.blockBuilder = blockBuilder;
25
+ this.blockSource = blockSource;
26
+ this.l1ToL2MessageSource = l1ToL2MessageSource;
27
+ this.txProvider = txProvider;
28
+ this.blockProposalValidator = blockProposalValidator;
29
+ this.config = config;
30
+ this.metrics = metrics;
31
+ this.dateProvider = dateProvider;
32
+ this.log = log;
33
+ this.tracer = telemetry.getTracer('BlockProposalHandler');
34
+ }
35
+ registerForReexecution(p2pClient) {
36
+ const handler = async (proposal, proposalSender)=>{
37
+ try {
38
+ const result = await this.handleBlockProposal(proposal, proposalSender, true);
39
+ if (result.isValid && result.reexecutionResult) {
40
+ this.log.info(`Non-validator reexecution completed for slot ${proposal.slotNumber.toBigInt()}`, {
41
+ blockNumber: proposal.blockNumber,
42
+ reexecutionTimeMs: result.reexecutionResult.reexecutionTimeMs,
43
+ totalManaUsed: result.reexecutionResult.totalManaUsed,
44
+ numTxs: result.reexecutionResult.block?.body?.txEffects?.length ?? 0
45
+ });
46
+ } else {
47
+ this.log.warn(`Non-validator reexecution failed for slot ${proposal.slotNumber.toBigInt()}`, {
48
+ blockNumber: proposal.blockNumber,
49
+ reason: result.reason
50
+ });
51
+ }
52
+ } catch (error) {
53
+ this.log.error('Error processing block proposal in non-validator handler', error);
54
+ }
55
+ return undefined; // Non-validator nodes don't return attestations
56
+ };
57
+ p2pClient.registerBlockProposalHandler(handler);
58
+ return this;
59
+ }
60
+ async handleBlockProposal(proposal, proposalSender, shouldReexecute) {
61
+ const slotNumber = proposal.slotNumber.toBigInt();
62
+ const blockNumber = proposal.blockNumber;
63
+ const proposer = proposal.getSender();
64
+ const proposalInfo = {
65
+ ...proposal.toBlockInfo(),
66
+ proposer: proposer.toString()
67
+ };
68
+ this.log.info(`Processing proposal for slot ${slotNumber}`, {
69
+ ...proposalInfo,
70
+ txHashes: proposal.txHashes.map((t)=>t.toString())
71
+ });
72
+ // Check that the proposal is from the current proposer, or the next proposer
73
+ // This should have been handled by the p2p layer, but we double check here out of caution
74
+ const invalidProposal = await this.blockProposalValidator.validate(proposal);
75
+ if (invalidProposal) {
76
+ this.log.warn(`Proposal is not valid, skipping processing`, proposalInfo);
77
+ return {
78
+ isValid: false,
79
+ reason: 'invalid_proposal'
80
+ };
81
+ }
82
+ // Collect txs from the proposal. We start doing this as early as possible,
83
+ // and we do it even if we don't plan to re-execute the txs, so that we have them
84
+ // if another node needs them.
85
+ const config = this.blockBuilder.getConfig();
86
+ const { txs, missingTxs } = await this.txProvider.getTxsForBlockProposal(proposal, {
87
+ pinnedPeer: proposalSender,
88
+ deadline: this.getReexecutionDeadline(proposal, config)
89
+ });
90
+ // Check that the parent proposal is a block we know, otherwise reexecution would fail
91
+ if (blockNumber > INITIAL_L2_BLOCK_NUM) {
92
+ const deadline = this.getReexecutionDeadline(proposal, config);
93
+ const currentTime = this.dateProvider.now();
94
+ const timeoutDurationMs = deadline.getTime() - currentTime;
95
+ const parentBlock = timeoutDurationMs <= 0 ? undefined : await retryUntil(async ()=>{
96
+ const block = await this.blockSource.getBlock(blockNumber - 1);
97
+ if (block) {
98
+ return block;
99
+ }
100
+ await this.blockSource.syncImmediate();
101
+ return await this.blockSource.getBlock(blockNumber - 1);
102
+ }, 'Force Archiver Sync', timeoutDurationMs / 1000, 0.5);
103
+ if (parentBlock === undefined) {
104
+ this.log.warn(`Parent block for ${blockNumber} not found, skipping processing`, proposalInfo);
105
+ return {
106
+ isValid: false,
107
+ reason: 'parent_block_not_found'
108
+ };
109
+ }
110
+ if (!proposal.payload.header.lastArchiveRoot.equals(parentBlock.archive.root)) {
111
+ this.log.warn(`Parent block archive root for proposal does not match, skipping processing`, {
112
+ proposalLastArchiveRoot: proposal.payload.header.lastArchiveRoot.toString(),
113
+ parentBlockArchiveRoot: parentBlock.archive.root.toString(),
114
+ ...proposalInfo
115
+ });
116
+ return {
117
+ isValid: false,
118
+ reason: 'parent_block_does_not_match'
119
+ };
120
+ }
121
+ }
122
+ // Check that I have the same set of l1ToL2Messages as the proposal
123
+ const l1ToL2Messages = await this.l1ToL2MessageSource.getL1ToL2Messages(blockNumber);
124
+ const computedInHash = await computeInHashFromL1ToL2Messages(l1ToL2Messages);
125
+ const proposalInHash = proposal.payload.header.contentCommitment.inHash;
126
+ if (!computedInHash.equals(proposalInHash)) {
127
+ this.log.warn(`L1 to L2 messages in hash mismatch, skipping processing`, {
128
+ proposalInHash: proposalInHash.toString(),
129
+ computedInHash: computedInHash.toString(),
130
+ ...proposalInfo
131
+ });
132
+ return {
133
+ isValid: false,
134
+ reason: 'in_hash_mismatch'
135
+ };
136
+ }
137
+ // Check that this block number does not exist already
138
+ const existingBlock = await this.blockSource.getBlockHeader(blockNumber);
139
+ if (existingBlock) {
140
+ this.log.warn(`Block number ${blockNumber} already exists, skipping processing`, proposalInfo);
141
+ return {
142
+ isValid: false,
143
+ reason: 'block_number_already_exists'
144
+ };
145
+ }
146
+ // Check that all of the transactions in the proposal are available
147
+ if (missingTxs.length > 0) {
148
+ this.log.warn(`Missing ${missingTxs.length} txs to process proposal`, {
149
+ ...proposalInfo,
150
+ missingTxs
151
+ });
152
+ return {
153
+ isValid: false,
154
+ reason: 'txs_not_available'
155
+ };
156
+ }
157
+ // Try re-executing the transactions in the proposal if needed
158
+ let reexecutionResult;
159
+ if (shouldReexecute) {
160
+ try {
161
+ this.log.verbose(`Re-executing transactions in the proposal`, proposalInfo);
162
+ reexecutionResult = await this.reexecuteTransactions(proposal, txs, l1ToL2Messages);
163
+ } catch (error) {
164
+ this.log.error(`Error reexecuting txs while processing block proposal`, error, proposalInfo);
165
+ const reason = this.getReexecuteFailureReason(error);
166
+ return {
167
+ isValid: false,
168
+ reason,
169
+ reexecutionResult
170
+ };
171
+ }
172
+ }
173
+ this.log.info(`Successfully processed proposal for slot ${slotNumber}`, proposalInfo);
174
+ return {
175
+ isValid: true,
176
+ reexecutionResult
177
+ };
178
+ }
179
+ getReexecutionDeadline(proposal, config) {
180
+ const nextSlotTimestampSeconds = Number(getTimestampForSlot(proposal.slotNumber.toBigInt() + 1n, config));
181
+ const msNeededForPropagationAndPublishing = this.config.validatorReexecuteDeadlineMs;
182
+ return new Date(nextSlotTimestampSeconds * 1000 - msNeededForPropagationAndPublishing);
183
+ }
184
+ getReexecuteFailureReason(err) {
185
+ if (err instanceof ReExStateMismatchError) {
186
+ return 'state_mismatch';
187
+ } else if (err instanceof ReExFailedTxsError) {
188
+ return 'failed_txs';
189
+ } else if (err instanceof ReExTimeoutError) {
190
+ return 'timeout';
191
+ } else if (err instanceof Error) {
192
+ return 'unknown_error';
193
+ }
194
+ }
195
+ async reexecuteTransactions(proposal, txs, l1ToL2Messages) {
196
+ const { header } = proposal.payload;
197
+ const { txHashes } = proposal;
198
+ // If we do not have all of the transactions, then we should fail
199
+ if (txs.length !== txHashes.length) {
200
+ const foundTxHashes = txs.map((tx)=>tx.getTxHash());
201
+ const missingTxHashes = txHashes.filter((txHash)=>!foundTxHashes.includes(txHash));
202
+ throw new TransactionsNotAvailableError(missingTxHashes);
203
+ }
204
+ // Use the sequencer's block building logic to re-execute the transactions
205
+ const timer = new Timer();
206
+ const config = this.blockBuilder.getConfig();
207
+ // We source most global variables from the proposal
208
+ const globalVariables = GlobalVariables.from({
209
+ slotNumber: proposal.payload.header.slotNumber,
210
+ coinbase: proposal.payload.header.coinbase,
211
+ feeRecipient: proposal.payload.header.feeRecipient,
212
+ gasFees: proposal.payload.header.gasFees,
213
+ blockNumber: proposal.blockNumber,
214
+ timestamp: header.timestamp,
215
+ chainId: new Fr(config.l1ChainId),
216
+ version: new Fr(config.rollupVersion)
217
+ });
218
+ const { block, failedTxs } = await this.blockBuilder.buildBlock(txs, l1ToL2Messages, globalVariables, {
219
+ deadline: this.getReexecutionDeadline(proposal, config)
220
+ });
221
+ const numFailedTxs = failedTxs.length;
222
+ const slot = proposal.slotNumber;
223
+ this.log.verbose(`Transaction re-execution complete for slot ${slot}`, {
224
+ numFailedTxs,
225
+ numProposalTxs: txHashes.length,
226
+ numProcessedTxs: block.body.txEffects.length,
227
+ slot
228
+ });
229
+ if (numFailedTxs > 0) {
230
+ this.metrics?.recordFailedReexecution(proposal);
231
+ throw new ReExFailedTxsError(numFailedTxs);
232
+ }
233
+ if (block.body.txEffects.length !== txHashes.length) {
234
+ this.metrics?.recordFailedReexecution(proposal);
235
+ throw new ReExTimeoutError();
236
+ }
237
+ // Throw a ReExStateMismatchError error if state updates do not match
238
+ const blockPayload = ConsensusPayload.fromBlock(block);
239
+ if (!blockPayload.equals(proposal.payload)) {
240
+ this.log.warn(`Re-execution state mismatch for slot ${slot}`, {
241
+ expected: blockPayload.toInspect(),
242
+ actual: proposal.payload.toInspect()
243
+ });
244
+ this.metrics?.recordFailedReexecution(proposal);
245
+ throw new ReExStateMismatchError(proposal.archive, block.archive.root, proposal.payload.stateReference, block.header.state);
246
+ }
247
+ const reexecutionTimeMs = timer.ms();
248
+ const totalManaUsed = block.header.totalManaUsed.toNumber() / 1e6;
249
+ this.metrics?.recordReex(reexecutionTimeMs, txs.length, totalManaUsed);
250
+ return {
251
+ block,
252
+ failedTxs,
253
+ reexecutionTimeMs,
254
+ totalManaUsed
255
+ };
256
+ }
257
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CAgDnF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAE7E,YAAY,EAAE,qBAAqB,EAAE,CAAC;AAEtC,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CAsDnF,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
package/dest/config.js CHANGED
@@ -39,6 +39,11 @@ export const validatorClientConfigMappings = {
39
39
  env: 'VALIDATOR_REEXECUTE_DEADLINE_MS',
40
40
  description: 'Will re-execute until this many milliseconds are left in the slot',
41
41
  ...numberConfigHelper(6000)
42
+ },
43
+ alwaysReexecuteBlockProposals: {
44
+ env: 'ALWAYS_REEXECUTE_BLOCK_PROPOSALS',
45
+ description: 'Whether to always reexecute block proposals, even for non-validator nodes (useful for monitoring network status).',
46
+ ...booleanConfigHelper(false)
42
47
  }
43
48
  };
44
49
  /**
@@ -1,5 +1,7 @@
1
1
  import type { EthAddress } from '@aztec/foundation/eth-address';
2
+ import { Signature } from '@aztec/foundation/eth-signature';
2
3
  import type { Fr } from '@aztec/foundation/fields';
4
+ import type { CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
3
5
  import { BlockAttestation, BlockProposal, type BlockProposalOptions } from '@aztec/stdlib/p2p';
4
6
  import type { ProposedBlockHeader, StateReference, Tx } from '@aztec/stdlib/tx';
5
7
  import type { ValidatorKeyStore } from '../key_store/interface.js';
@@ -28,5 +30,6 @@ export declare class ValidationService {
28
30
  * @returns attestations
29
31
  */
30
32
  attestToProposal(proposal: BlockProposal, attestors: EthAddress[]): Promise<BlockAttestation[]>;
33
+ signAttestationsAndSigners(attestationsAndSigners: CommitteeAttestationsAndSigners, proposer: EthAddress | undefined): Promise<Signature>;
31
34
  }
32
35
  //# sourceMappingURL=validation_service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation_service.d.ts","sourceRoot":"","sources":["../../src/duties/validation_service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,KAAK,oBAAoB,EAG1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,mBAAmB,EAAE,c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AW,EAAE,MAAM,EACnB,MAAM,EAAE,mBAAmB,EAC3B,OAAO,EAAE,EAAE,EACX,cAAc,EAAE,cAAc,EAC9B,GAAG,EAAE,EAAE,EAAE,EACT,uBAAuB,EAAE,UAAU,GAAG,SAAS,EAC/C,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,aAAa,CAAC;IAqBzB;;;;;;;;;OASG;IACG,gBAAgB,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAW/F,0BAA0B,CAC9B,sBAAsB,EAAE,+BAA+B,EACvD,QAAQ,EAAE,UAAU,GAAG,SAAS,GAC/B,OAAO,CAAC,SAAS,CAAC;CAUtB"}
@@ -1,5 +1,6 @@
1
1
  import { Buffer32 } from '@aztec/foundation/buffer';
2
2
  import { keccak256 } from '@aztec/foundation/crypto';
3
+ import { Signature } from '@aztec/foundation/eth-signature';
3
4
  import { BlockAttestation, BlockProposal, ConsensusPayload, SignatureDomainSeparator } from '@aztec/stdlib/p2p';
4
5
  export class ValidationService {
5
6
  keyStore;
@@ -43,4 +44,11 @@ export class ValidationService {
43
44
  //await this.keyStore.signMessage(buf);
44
45
  return signatures.map((sig)=>new BlockAttestation(proposal.blockNumber, proposal.payload, sig));
45
46
  }
47
+ async signAttestationsAndSigners(attestationsAndSigners, proposer) {
48
+ if (proposer === undefined) {
49
+ return Signature.empty();
50
+ }
51
+ const buf = Buffer32.fromBuffer(keccak256(attestationsAndSigners.getPayloadToSign(SignatureDomainSeparator.attestationsAndSigners)));
52
+ return await this.keyStore.signMessageWithAddress(proposer, buf);
53
+ }
46
54
  }
package/dest/factory.d.ts CHANGED
@@ -1,14 +1,23 @@
1
1
  import type { EpochCache } from '@aztec/epoch-cache';
2
2
  import type { DateProvider } from '@aztec/foundation/timer';
3
3
  import type { KeystoreManager } from '@aztec/node-keystore';
4
- import type { P2PClient } from '@aztec/p2p';
4
+ import { type P2PClient } from '@aztec/p2p';
5
5
  import type { L2BlockSource } from '@aztec/stdlib/block';
6
- import type { IFullNodeBlockBuilder, SlasherConfig } from '@aztec/stdlib/interfaces/server';
6
+ import type { IFullNodeBlockBuilder, ValidatorClientFullConfig } from '@aztec/stdlib/interfaces/server';
7
7
  import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
8
8
  import type { TelemetryClient } from '@aztec/telemetry-client';
9
- import type { ValidatorClientConfig } from './config.js';
9
+ import { BlockProposalHandler } from './block_proposal_handler.js';
10
10
  import { ValidatorClient } from './validator.js';
11
- export declare function createValidatorClient(config: ValidatorClientConfig & Pick<SlasherConfig, 'slashBroadcastedInvalidBlockPenalty'>, deps: {
11
+ export declare function createBlockProposalHandler(config: ValidatorClientFullConfig, deps: {
12
+ blockBuilder: IFullNodeBlockBuilder;
13
+ blockSource: L2BlockSource;
14
+ l1ToL2MessageSource: L1ToL2MessageSource;
15
+ p2pClient: P2PClient;
16
+ epochCache: EpochCache;
17
+ dateProvider: DateProvider;
18
+ telemetry: TelemetryClient;
19
+ }): BlockProposalHandler;
20
+ export declare function createValidatorClient(config: ValidatorClientFullConfig, deps: {
12
21
  blockBuilder: IFullNodeBlockBuilder;
13
22
  p2pClient: P2PClient;
14
23
  blockSource: L2BlockSource;
@@ -1 +1 @@
1
- {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC5F,OA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AAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE;IACJ,YAAY,EAAE,qBAAqB,CAAC;IACpC,WAAW,EAAE,aAAa,CAAC;IAC3B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,eAAe,CAAC;CAC5B,wBAeF;AAED,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,yBAAyB,EACjC,IAAI,EAAE;IACJ,YAAY,EAAE,qBAAqB,CAAC;IACpC,SAAS,EAAE,SAAS,CAAC;IACrB,WAAW,EAAE,aAAa,CAAC;IAC3B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,SAAS,EAAE,eAAe,CAAC;IAC3B,YAAY,EAAE,YAAY,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;IACvB,eAAe,EAAE,eAAe,GAAG,SAAS,CAAC;CAC9C,+BAmBF"}
package/dest/factory.js CHANGED
@@ -1,4 +1,12 @@
1
+ import { BlockProposalValidator } from '@aztec/p2p';
2
+ import { BlockProposalHandler } from './block_proposal_handler.js';
3
+ import { ValidatorMetrics } from './metrics.js';
1
4
  import { ValidatorClient } from './validator.js';
5
+ export function createBlockProposalHandler(config, deps) {
6
+ const metrics = new ValidatorMetrics(deps.telemetry);
7
+ const blockProposalValidator = new BlockProposalValidator(deps.epochCache);
8
+ return new BlockProposalHandler(deps.blockBuilder, deps.blockSource, deps.l1ToL2MessageSource, deps.p2pClient.getTxProvider(), blockProposalValidator, config, metrics, deps.dateProvider, deps.telemetry);
9
+ }
2
10
  export function createValidatorClient(config, deps) {
3
11
  if (config.disableValidator || !deps.keyStoreManager) {
4
12
  return undefined;
package/dest/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './block_proposal_handler.js';
1
2
  export * from './config.js';
2
3
  export * from './factory.js';
3
4
  export * from './validator.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,6BAA6B,CAAC;AAC5C,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
package/dest/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './block_proposal_handler.js';
1
2
  export * from './config.js';
2
3
  export * from './factory.js';
3
4
  export * from './validator.js';
package/dest/metrics.d.ts CHANGED
@@ -11,6 +11,6 @@ export declare class ValidatorMetrics {
11
11
  recordReex(time: number, txs: number, mManaTotal: number): void;
12
12
  recordFailedReexecution(proposal: BlockProposal): void;
13
13
  incAttestations(num: number): void;
14
- incFailedAttestations(num: number, reason: string): void;
14
+ incFailedAttestations(num: number, reason: string, inCommittee: boolean): void;
15
15
  }
16
16
  //# sourceMappingURL=metrics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAIL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAEjC,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,wBAAwB,CAAgB;IAChD,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,uBAAuB,CAAgB;IAE/C,OAAO,CAAC,QAAQ,CAAY;IAC5B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,YAAY,CAAY;gBAEpB,eAAe,EAAE,eAAe;IAsCrC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAMxD,uBAAuB,CAAC,QAAQ,EAAE,aAAa;IAO/C,eAAe,CAAC,GAAG,EAAE,MAAM;IAI3B,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAKzD"}
1
+ {"version":3,"file":"metrics.d.ts","sourceRoot":"","sources":["../src/metrics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAIL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAEjC,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,wBAAwB,CAAgB;IAChD,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,uBAAuB,CAAgB;IAE/C,OAAO,CAAC,QAAQ,CAAY;IAC5B,OAAO,CAAC,MAAM,CAAY;IAC1B,OAAO,CAAC,YAAY,CAAY;gBAEpB,eAAe,EAAE,eAAe;IAsCrC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAMxD,uBAAuB,CAAC,QAAQ,EAAE,aAAa;IAO/C,eAAe,CAAC,GAAG,EAAE,MAAM;IAI3B,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO;CAM/E"}
package/dest/metrics.js CHANGED
@@ -51,9 +51,10 @@ export class ValidatorMetrics {
51
51
  incAttestations(num) {
52
52
  this.attestationsCount.add(num);
53
53
  }
54
- incFailedAttestations(num, reason) {
54
+ incFailedAttestations(num, reason, inCommittee) {
55
55
  this.failedAttestationsCount.add(num, {
56
- [Attributes.ERROR_TYPE]: reason
56
+ [Attributes.ERROR_TYPE]: reason,
57
+ [Attributes.VALIDATOR_STATUS]: inCommittee ? 'in-committee' : 'none'
57
58
  });
58
59
  }
59
60
  }
@@ -1,19 +1,20 @@
1
1
  import type { EpochCache } from '@aztec/epoch-cache';
2
2
  import type { EthAddress } from '@aztec/foundation/eth-address';
3
+ import type { Signature } from '@aztec/foundation/eth-signature';
3
4
  import { Fr } from '@aztec/foundation/fields';
4
5
  import { DateProvider } from '@aztec/foundation/timer';
5
6
  import type { KeystoreManager } from '@aztec/node-keystore';
6
- import type { P2P, PeerId } from '@aztec/p2p';
7
- import { TxProvider } from '@aztec/p2p';
7
+ import type { P2P, PeerId, TxProvider } from '@aztec/p2p';
8
8
  import { type SlasherConfig, type Watcher, type WatcherEmitter } from '@aztec/slasher';
9
9
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
10
- import type { L2BlockSource } from '@aztec/stdlib/block';
10
+ import type { CommitteeAttestationsAndSigners, L2BlockSource } from '@aztec/stdlib/block';
11
11
  import type { IFullNodeBlockBuilder, Validator, ValidatorClientFullConfig } from '@aztec/stdlib/interfaces/server';
12
12
  import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
13
13
  import type { BlockAttestation, BlockProposal, BlockProposalOptions } from '@aztec/stdlib/p2p';
14
- import { type ProposedBlockHeader, type StateReference, type Tx } from '@aztec/stdlib/tx';
14
+ import type { ProposedBlockHeader, StateReference, Tx } from '@aztec/stdlib/tx';
15
15
  import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
16
16
  import type { TypedDataDefinition } from 'viem';
17
+ import { BlockProposalHandler } from './block_proposal_handler.js';
17
18
  import type { ValidatorClientConfig } from './config.js';
18
19
  import { NodeKeystoreAdapter } from './key_store/node_keystore_adapter.js';
19
20
  declare const ValidatorClient_base: new () => WatcherEmitter;
@@ -21,50 +22,45 @@ declare const ValidatorClient_base: new () => WatcherEmitter;
21
22
  * Validator Client
22
23
  */
23
24
  export declare class ValidatorClient extends ValidatorClient_base implements Validator, Watcher {
24
- private blockBuilder;
25
25
  private keyStore;
26
26
  private epochCache;
27
27
  private p2pClient;
28
- private blockSource;
29
- private l1ToL2MessageSource;
30
- private txProvider;
28
+ private blockProposalHandler;
31
29
  private config;
32
30
  private dateProvider;
33
31
  private log;
34
32
  readonly tracer: Tracer;
35
33
  private validationService;
36
34
  private metrics;
35
+ private hasRegisteredHandlers;
37
36
  private previousProposal?;
38
37
  private lastEpochForCommitteeUpdateLoop;
39
38
  private epochCacheUpdateLoop;
40
- private blockProposalValidator;
41
39
  private proposersOfInvalidBlocks;
42
- protected constructor(blockBuilder: IFullNodeBlockBuilder, keyStore: NodeKeystoreAdapter, epochCache: EpochCache, p2pClient: P2P, blockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, txProvider: TxProvider, config: ValidatorClientFullConfig, dateProvider?: DateProvider, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
40
+ protected constructor(keyStore: NodeKeystoreAdapter, epochCache: EpochCache, p2pClient: P2P, blockProposalHandler: BlockProposalHandler, config: ValidatorClientFullConfig, dateProvider?: DateProvider, telemetry?: TelemetryClient, log?: import("@aztec/foundation/log").Logger);
43
41
  static validateKeyStoreConfiguration(keyStoreManager: KeystoreManager): void;
44
42
  private handleEpochCommitteeUpdate;
45
43
  static new(config: ValidatorClientConfig & Pick<SlasherConfig, 'slashBroadcastedInvalidBlockPenalty'>, blockBuilder: IFullNodeBlockBuilder, epochCache: EpochCache, p2pClient: P2P, blockSource: L2BlockSource, l1ToL2MessageSource: L1ToL2MessageSource, txProvider: TxProvider, keyStoreManager: KeystoreManager, dateProvider?: DateProvider, telemetry?: TelemetryClient): ValidatorClient;
46
44
  getValidatorAddresses(): EthAddress[];
47
- signWithAddress(addr: EthAddress, msg: TypedDataDefinition): Promise<import("@aztec/stdlib/block").Signature>;
45
+ getBlockProposalHandler(): BlockProposalHandler;
46
+ reExecuteTransactions(proposal: BlockProposal, txs: any[], l1ToL2Messages: Fr[]): Promise<any>;
47
+ signWithAddress(addr: EthAddress, msg: TypedDataDefinition): Promise<Signature>;
48
48
  getCoinbaseForAttestor(attestor: EthAddress): EthAddress;
49
49
  getFeeRecipientForAttestor(attestor: EthAddress): AztecAddress;
50
50
  getConfig(): ValidatorClientFullConfig;
51
51
  updateConfig(config: Partial<ValidatorClientFullConfig>): void;
52
52
  start(): Promise<void>;
53
53
  stop(): Promise<void>;
54
- registerBlockProposalHandler(): void;
54
+ /** Register handlers on the p2p client */
55
+ registerHandlers(): Promise<void>;
55
56
  attestToProposal(proposal: BlockProposal, proposalSender: PeerId): Promise<BlockAttestation[] | undefined>;
56
- private getReexecutionDeadline;
57
- /**
58
- * Re-execute the transactions in the proposal and check that the state updates match the header state
59
- * @param proposal - The proposal to re-execute
60
- */
61
- reExecuteTransactions(proposal: BlockProposal, txs: Tx[], l1ToL2Messages: Fr[]): Promise<void>;
62
57
  private slashInvalidBlock;
63
58
  createBlockProposal(blockNumber: number, header: ProposedBlockHeader, archive: Fr, stateReference: StateReference, txs: Tx[], proposerAddress: EthAddress | undefined, options: BlockProposalOptions): Promise<BlockProposal | undefined>;
64
59
  broadcastBlockProposal(proposal: BlockProposal): Promise<void>;
60
+ signAttestationsAndSigners(attestationsAndSigners: CommitteeAttestationsAndSigners, proposer: EthAddress | undefined): Promise<Signature>;
65
61
  collectOwnAttestations(proposal: BlockProposal): Promise<BlockAttestation[]>;
66
62
  collectAttestations(proposal: BlockProposal, required: number, deadline: Date): Promise<BlockAttestation[]>;
67
- private doAttestToProposal;
63
+ private createBlockAttestationsFromProposal;
68
64
  private handleAuthRequest;
69
65
  }
70
66
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../src/validator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAK9C,OAAO,EAAE,YAAY,EAAS,MAAM,yBAAyB,CAAC;AAC9D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