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
15 changes: 4 additions & 11 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import {
} from '@aztec/node-lib/factories';
import { type P2P, type P2PClientDeps, createP2PClient, getDefaultAllowedSetupFunctions } from '@aztec/p2p';
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
import { BlockBuilder, GlobalVariableBuilder, SequencerClient, type SequencerPublisher } from '@aztec/sequencer-client';
import { GlobalVariableBuilder, SequencerClient, type SequencerPublisher } from '@aztec/sequencer-client';
import { PublicProcessorFactory } from '@aztec/simulator/server';
import {
AttestationsBlockWatcher,
Expand Down Expand Up @@ -309,18 +309,10 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
// We should really not be modifying the config object
config.txPublicSetupAllowList = config.txPublicSetupAllowList ?? (await getDefaultAllowedSetupFunctions());

// Create BlockBuilder for EpochPruneWatcher (slasher functionality)
const blockBuilder = new BlockBuilder(
{ ...config, l1GenesisTime, slotDuration: Number(slotDuration) },
worldStateSynchronizer,
archiver,
dateProvider,
telemetry,
);

// Create FullNodeCheckpointsBuilder for validator and non-validator block proposal handling
const validatorCheckpointsBuilder = new FullNodeCheckpointsBuilder(
{ ...config, l1GenesisTime, slotDuration: Number(slotDuration) },
worldStateSynchronizer,
archiver,
dateProvider,
telemetry,
Expand Down Expand Up @@ -387,7 +379,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
archiver,
epochCache,
p2pClient.getTxProvider(),
blockBuilder,
validatorCheckpointsBuilder,
config,
);
watchers.push(epochPruneWatcher);
Expand Down Expand Up @@ -452,6 +444,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
// Create and start the sequencer client
const checkpointsBuilder = new CheckpointsBuilder(
{ ...config, l1GenesisTime, slotDuration: Number(slotDuration) },
worldStateSynchronizer,
archiver,
dateProvider,
telemetry,
Expand Down
43 changes: 20 additions & 23 deletions yarn-project/end-to-end/src/e2e_p2p/reex.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { times } from '@aztec/foundation/collection';
import { sleep } from '@aztec/foundation/sleep';
import { unfreeze } from '@aztec/foundation/types';
import type { LibP2PService, P2PClient } from '@aztec/p2p';
import type { BlockBuilder } from '@aztec/sequencer-client';
import type { CppPublicTxSimulator, PublicTxResult } from '@aztec/simulator/server';
import { BlockProposal } from '@aztec/stdlib/p2p';
import { ReExFailedTxsError, ReExStateMismatchError, ReExTimeoutError } from '@aztec/stdlib/validators';
Expand Down Expand Up @@ -170,30 +169,28 @@ describe('e2e_p2p_reex', () => {
node: AztecNodeService,
stub: (tx: Tx, originalSimulate: (tx: Tx) => Promise<PublicTxResult>) => Promise<PublicTxResult>,
) => {
const blockBuilder: BlockBuilder = (node as any).sequencer.sequencer.blockBuilder;
const blockBuilder: any = (node as any).sequencer.sequencer.blockBuilder;
const originalCreateDeps = blockBuilder.makeBlockBuilderDeps.bind(blockBuilder);
jest
.spyOn(blockBuilder, 'makeBlockBuilderDeps')
.mockImplementation(async (...args: Parameters<BlockBuilder['makeBlockBuilderDeps']>) => {
const deps = await originalCreateDeps(...args);
t.logger.warn('Creating mocked processor factory');
const simulator: CppPublicTxSimulator = (deps.processor as any).publicTxSimulator;
const originalSimulate = simulator.simulate.bind(simulator);
// We only stub the simulate method if it's NOT the first time we see the tx
// so the proposer works fine, but we cause the failure in the validators.
jest.spyOn(simulator, 'simulate').mockImplementation((tx: Tx) => {
const txHash = tx.getTxHash().toString();
if (seenTxs.has(txHash)) {
t.logger.warn('Calling stubbed simulate for tx', { txHash });
return stub(tx, originalSimulate);
} else {
seenTxs.add(txHash);
t.logger.warn('Calling original simulate for tx', { txHash });
return originalSimulate(tx);
}
});
return deps;
jest.spyOn(blockBuilder, 'makeBlockBuilderDeps').mockImplementation(async (...args: any[]) => {
const deps = await originalCreateDeps(...args);
t.logger.warn('Creating mocked processor factory');
const simulator: CppPublicTxSimulator = (deps.processor as any).publicTxSimulator;
const originalSimulate = simulator.simulate.bind(simulator);
// We only stub the simulate method if it's NOT the first time we see the tx
// so the proposer works fine, but we cause the failure in the validators.
jest.spyOn(simulator, 'simulate').mockImplementation((tx: Tx) => {
const txHash = tx.getTxHash().toString();
if (seenTxs.has(txHash)) {
t.logger.warn('Calling stubbed simulate for tx', { txHash });
return stub(tx, originalSimulate);
} else {
seenTxs.add(txHash);
t.logger.warn('Calling original simulate for tx', { txHash });
return originalSimulate(tx);
}
});
return deps;
});
};

// Have the public tx processor take an extra long time to process the tx, so the validator times out
Expand Down
1 change: 0 additions & 1 deletion yarn-project/prover-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"type": "module",
"exports": {
".": "./dest/index.js",
"./block-factory": "./dest/block-factory/index.js",
"./broker": "./dest/proving_broker/index.js",
"./broker/config": "./dest/proving_broker/config.js",
"./orchestrator": "./dest/orchestrator/index.js",
Expand Down
1 change: 0 additions & 1 deletion yarn-project/prover-client/src/block-factory/index.ts

This file was deleted.

Loading
Loading