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
4 changes: 4 additions & 0 deletions yarn-project/aztec-node/src/aztec-node/server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ describe('aztec node', () => {
undefined,
undefined,
undefined,
undefined,
12345,
rollupVersion.toNumber(),
globalVariablesBuilder,
Expand Down Expand Up @@ -742,6 +743,7 @@ describe('aztec node', () => {
slasherClient,
undefined,
undefined,
undefined,
12345,
rollupVersion.toNumber(),
globalVariablesBuilder,
Expand Down Expand Up @@ -932,6 +934,7 @@ describe('aztec node', () => {
slasherClient,
undefined,
undefined,
undefined,
12345,
rollupVersion.toNumber(),
globalVariablesBuilder,
Expand Down Expand Up @@ -1003,6 +1006,7 @@ describe('aztec node', () => {
undefined,
undefined,
undefined,
undefined,
12345,
rollupVersion.toNumber(),
globalVariablesBuilder,
Expand Down
29 changes: 23 additions & 6 deletions yarn-project/aztec-node/src/aztec-node/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
protected readonly slasherClient: SlasherClientInterface | undefined,
protected readonly validatorsSentinel: Sentinel | undefined,
protected readonly epochPruneWatcher: EpochPruneWatcher | undefined,
protected readonly attestationsBlockWatcher: AttestationsBlockWatcher | undefined,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to keep track of it to be able to stop it.

protected readonly l1ChainId: number,
protected readonly version: number,
protected readonly globalVariableBuilder: GlobalVariableBuilderInterface,
Expand Down Expand Up @@ -403,7 +404,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb

let validatorClient: ValidatorClient | undefined;

if (!proverOnly) {
if (!config.disableValidator) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about this one. It's more declarative/readable, but not semantically the same. LMK.

// Create validator client if required
validatorClient = await createValidatorClient(config, {
checkpointsBuilder: validatorCheckpointsBuilder,
Expand Down Expand Up @@ -494,9 +495,18 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
void archiver
.waitForInitialSync()
.then(async () => {
await validatorsSentinel?.start();
await epochPruneWatcher?.start();
await attestationsBlockWatcher?.start();
if (validatorsSentinel) {
await validatorsSentinel.start();
started.push(validatorsSentinel);
}
if (epochPruneWatcher) {
await epochPruneWatcher.start();
started.push(epochPruneWatcher);
}
if (attestationsBlockWatcher) {
await attestationsBlockWatcher.start();
started.push(attestationsBlockWatcher);
}
log.info(`All p2p services started`);
})
.catch(err => log.error('Failed to start p2p services after archiver sync', err));
Expand Down Expand Up @@ -627,6 +637,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
slasherClient,
validatorsSentinel,
epochPruneWatcher,
attestationsBlockWatcher,
ethereumChain.chainInfo.id,
config.rollupVersion,
globalVariableBuilder,
Expand Down Expand Up @@ -966,10 +977,15 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
// If the tx is in the pool but not in the archiver, it's pending.
// This handles race conditions between archiver and p2p, where the archiver
// has pruned the block in which a tx was mined, but p2p has not caught up yet.
receipt = new TxReceipt(txHash, TxStatus.PENDING, undefined, undefined);
receipt = new TxReceipt(txHash, TxStatus.PENDING, /*executionResult=*/ undefined, /*error=*/ undefined);
} else {
// Otherwise, if we don't know the tx, we consider it dropped.
receipt = new TxReceipt(txHash, TxStatus.DROPPED, undefined, 'Tx dropped by P2P node');
receipt = new TxReceipt(
txHash,
TxStatus.DROPPED,
/*executionResult=*/ undefined,
/*error=*/ 'Tx dropped by P2P node',
);
}

this.debugLogStore.decorateReceiptWithLogs(txHash.toString(), receipt);
Expand All @@ -986,6 +1002,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, AztecNodeDeb
*/
public async stop() {
this.log.info(`Stopping Aztec Node`);
await tryStop(this.attestationsBlockWatcher);
await tryStop(this.validatorsSentinel);
await tryStop(this.epochPruneWatcher);
await tryStop(this.slasherClient);
Expand Down
1 change: 1 addition & 0 deletions yarn-project/txe/src/state_machine/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class TXEStateMachine {
undefined,
undefined,
undefined,
undefined,
VERSION,
CHAIN_ID,
new TXEGlobalVariablesBuilder(),
Expand Down
Loading