Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ import {
FullNodeCheckpointsBuilder,
NodeKeystoreAdapter,
ValidatorClient,
createBlockProposalHandler,
createProposalHandler,
createValidatorClient,
} from '@aztec/validator-client';
import { createWorldStateSynchronizer } from '@aztec/world-state';
Expand Down Expand Up @@ -390,19 +390,21 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
}
}

// If there's no validator client, create a BlockProposalHandler to handle block proposals
// If there's no validator client, create a ProposalHandler to handle block and checkpoint proposals
// for monitoring or reexecution. Reexecution (default) allows us to follow the pending chain,
// while non-reexecution is used for validating the proposals and collecting their txs.
// Checkpoint proposals are handled if the blob client can upload blobs.
if (!validatorClient) {
const reexecute = !!config.alwaysReexecuteBlockProposals;
log.info(`Setting up block proposal handler` + (reexecute ? ' with reexecution of proposals' : ''));
createBlockProposalHandler(config, {
log.info(`Setting up proposal handler` + (reexecute ? ' with reexecution of proposals' : ''));
createProposalHandler(config, {
checkpointsBuilder: validatorCheckpointsBuilder,
worldState: worldStateSynchronizer,
epochCache,
blockSource: archiver,
l1ToL2MessageSource: archiver,
p2pClient,
blobClient,
dateProvider,
telemetry,
}).register(p2pClient, reexecute);
Expand Down
8 changes: 5 additions & 3 deletions yarn-project/validator-client/src/factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import type { ValidatorClientFullConfig, WorldStateSynchronizer } from '@aztec/s
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
import type { TelemetryClient } from '@aztec/telemetry-client';

import { BlockProposalHandler } from './block_proposal_handler.js';
import type { FullNodeCheckpointsBuilder } from './checkpoint_builder.js';
import { ValidatorMetrics } from './metrics.js';
import { ProposalHandler } from './proposal_handler.js';
import { ValidatorClient } from './validator.js';

export function createBlockProposalHandler(
export function createProposalHandler(
config: ValidatorClientFullConfig,
deps: {
checkpointsBuilder: FullNodeCheckpointsBuilder;
Expand All @@ -22,6 +22,7 @@ export function createBlockProposalHandler(
l1ToL2MessageSource: L1ToL2MessageSource;
p2pClient: P2PClient;
epochCache: EpochCache;
blobClient: BlobClientInterface;
dateProvider: DateProvider;
telemetry: TelemetryClient;
},
Expand All @@ -31,7 +32,7 @@ export function createBlockProposalHandler(
txsPermitted: !config.disableTransactions,
maxTxsPerBlock: config.validateMaxTxsPerBlock ?? config.validateMaxTxsPerCheckpoint,
});
return new BlockProposalHandler(
return new ProposalHandler(
deps.checkpointsBuilder,
deps.worldState,
deps.blockSource,
Expand All @@ -40,6 +41,7 @@ export function createBlockProposalHandler(
blockProposalValidator,
deps.epochCache,
config,
deps.blobClient,
metrics,
deps.dateProvider,
deps.telemetry,
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/validator-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export * from './block_proposal_handler.js';
export * from './proposal_handler.js';
export * from './checkpoint_builder.js';
export * from './config.js';
export * from './factory.js';
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/validator-client/src/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
createUpDownCounterWithDefault,
} from '@aztec/telemetry-client';

import type { BlockProposalValidationFailureReason } from './block_proposal_handler.js';
import type { BlockProposalValidationFailureReason } from './proposal_handler.js';

export class ValidatorMetrics {
private failedReexecutionCounter: UpDownCounter;
Expand Down
Loading
Loading