@aztec/aztec-node 0.0.0-test.1 → 0.0.1-commit.001888fc

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.
Files changed (48) hide show
  1. package/dest/aztec-node/config.d.ts +22 -11
  2. package/dest/aztec-node/config.d.ts.map +1 -1
  3. package/dest/aztec-node/config.js +90 -15
  4. package/dest/aztec-node/node_metrics.d.ts +5 -1
  5. package/dest/aztec-node/node_metrics.d.ts.map +1 -1
  6. package/dest/aztec-node/node_metrics.js +20 -6
  7. package/dest/aztec-node/server.d.ts +132 -154
  8. package/dest/aztec-node/server.d.ts.map +1 -1
  9. package/dest/aztec-node/server.js +1292 -371
  10. package/dest/bin/index.d.ts +1 -1
  11. package/dest/bin/index.js +4 -2
  12. package/dest/index.d.ts +1 -2
  13. package/dest/index.d.ts.map +1 -1
  14. package/dest/index.js +0 -1
  15. package/dest/sentinel/config.d.ts +8 -0
  16. package/dest/sentinel/config.d.ts.map +1 -0
  17. package/dest/sentinel/config.js +29 -0
  18. package/dest/sentinel/factory.d.ts +9 -0
  19. package/dest/sentinel/factory.d.ts.map +1 -0
  20. package/dest/sentinel/factory.js +17 -0
  21. package/dest/sentinel/index.d.ts +3 -0
  22. package/dest/sentinel/index.d.ts.map +1 -0
  23. package/dest/sentinel/index.js +1 -0
  24. package/dest/sentinel/sentinel.d.ts +93 -0
  25. package/dest/sentinel/sentinel.d.ts.map +1 -0
  26. package/dest/sentinel/sentinel.js +429 -0
  27. package/dest/sentinel/store.d.ts +35 -0
  28. package/dest/sentinel/store.d.ts.map +1 -0
  29. package/dest/sentinel/store.js +174 -0
  30. package/dest/test/index.d.ts +31 -0
  31. package/dest/test/index.d.ts.map +1 -0
  32. package/dest/test/index.js +1 -0
  33. package/package.json +47 -35
  34. package/src/aztec-node/config.ts +149 -26
  35. package/src/aztec-node/node_metrics.ts +23 -6
  36. package/src/aztec-node/server.ts +1162 -467
  37. package/src/bin/index.ts +4 -2
  38. package/src/index.ts +0 -1
  39. package/src/sentinel/config.ts +37 -0
  40. package/src/sentinel/factory.ts +31 -0
  41. package/src/sentinel/index.ts +8 -0
  42. package/src/sentinel/sentinel.ts +543 -0
  43. package/src/sentinel/store.ts +185 -0
  44. package/src/test/index.ts +32 -0
  45. package/dest/aztec-node/http_rpc_server.d.ts +0 -8
  46. package/dest/aztec-node/http_rpc_server.d.ts.map +0 -1
  47. package/dest/aztec-node/http_rpc_server.js +0 -9
  48. package/src/aztec-node/http_rpc_server.ts +0 -11
@@ -0,0 +1,31 @@
1
+ import type { EpochCacheInterface } from '@aztec/epoch-cache';
2
+ import type { P2P } from '@aztec/p2p';
3
+ import { SequencerClient } from '@aztec/sequencer-client';
4
+ import { EpochPruneWatcher, type SlasherClientInterface } from '@aztec/slasher';
5
+ import type { L2BlockSource } from '@aztec/stdlib/block';
6
+ import type { ContractDataSource } from '@aztec/stdlib/contract';
7
+ import type { L2LogsSource, Service, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
8
+ import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
9
+ import type { GlobalVariableBuilder as GlobalVariableBuilderInterface } from '@aztec/stdlib/tx';
10
+ import type { AztecNodeConfig } from '../aztec-node/config.js';
11
+ import { AztecNodeService } from '../aztec-node/server.js';
12
+ import { Sentinel } from '../sentinel/sentinel.js';
13
+ export declare class TestAztecNodeService extends AztecNodeService {
14
+ config: AztecNodeConfig;
15
+ p2pClient: P2P;
16
+ blockSource: L2BlockSource & Partial<Service>;
17
+ logsSource: L2LogsSource;
18
+ contractDataSource: ContractDataSource;
19
+ l1ToL2MessageSource: L1ToL2MessageSource;
20
+ worldStateSynchronizer: WorldStateSynchronizer;
21
+ sequencer: SequencerClient | undefined;
22
+ slasherClient: SlasherClientInterface | undefined;
23
+ validatorsSentinel: Sentinel | undefined;
24
+ epochPruneWatcher: EpochPruneWatcher | undefined;
25
+ l1ChainId: number;
26
+ version: number;
27
+ globalVariableBuilder: GlobalVariableBuilderInterface;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-node",
3
- "version": "0.0.0-test.1",
3
+ "version": "0.0.1-commit.001888fc",
4
4
  "main": "dest/index.js",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./dest/index.js",
8
- "./config": "./dest/aztec-node/config.js"
8
+ "./config": "./dest/aztec-node/config.js",
9
+ "./sentinel": "./dest/aztec-node/sentinel.js",
10
+ "./test": "./dest/test/index.js"
9
11
  },
10
- "bin": "./dest/bin/index.js",
11
12
  "typedocOptions": {
12
13
  "entryPoints": [
13
14
  "./src/index.ts"
@@ -18,11 +19,9 @@
18
19
  "scripts": {
19
20
  "start": "node --no-warnings ./dest/bin",
20
21
  "start:debug": "node --no-warnings --inspect ./dest/bin",
21
- "build": "yarn clean && tsc -b",
22
- "build:dev": "tsc -b --watch",
22
+ "build": "yarn clean && ../scripts/tsc.sh",
23
+ "build:dev": "../scripts/tsc.sh --watch",
23
24
  "clean": "rm -rf ./dest .tsbuildinfo",
24
- "formatting": "run -T prettier --check ./src && run -T eslint ./src",
25
- "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
26
25
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
27
26
  },
28
27
  "inherits": [
@@ -59,39 +58,52 @@
59
58
  "testTimeout": 120000,
60
59
  "setupFiles": [
61
60
  "../../foundation/src/jest/setup.mjs"
61
+ ],
62
+ "testEnvironment": "../../foundation/src/jest/env.mjs",
63
+ "setupFilesAfterEnv": [
64
+ "../../foundation/src/jest/setupAfterEnv.mjs"
62
65
  ]
63
66
  },
64
67
  "dependencies": {
65
- "@aztec/archiver": "0.0.0-test.1",
66
- "@aztec/bb-prover": "0.0.0-test.1",
67
- "@aztec/blob-sink": "0.0.0-test.1",
68
- "@aztec/constants": "0.0.0-test.1",
69
- "@aztec/epoch-cache": "0.0.0-test.1",
70
- "@aztec/ethereum": "0.0.0-test.1",
71
- "@aztec/foundation": "0.0.0-test.1",
72
- "@aztec/kv-store": "0.0.0-test.1",
73
- "@aztec/merkle-tree": "0.0.0-test.1",
74
- "@aztec/p2p": "0.0.0-test.1",
75
- "@aztec/protocol-contracts": "0.0.0-test.1",
76
- "@aztec/prover-client": "0.0.0-test.1",
77
- "@aztec/sequencer-client": "0.0.0-test.1",
78
- "@aztec/simulator": "0.0.0-test.1",
79
- "@aztec/stdlib": "0.0.0-test.1",
80
- "@aztec/telemetry-client": "0.0.0-test.1",
81
- "@aztec/validator-client": "0.0.0-test.1",
82
- "@aztec/world-state": "0.0.0-test.1",
83
- "koa": "^2.14.2",
84
- "koa-router": "^12.0.0",
85
- "tslib": "^2.4.0"
68
+ "@aztec/archiver": "0.0.1-commit.001888fc",
69
+ "@aztec/bb-prover": "0.0.1-commit.001888fc",
70
+ "@aztec/blob-client": "0.0.1-commit.001888fc",
71
+ "@aztec/blob-lib": "0.0.1-commit.001888fc",
72
+ "@aztec/constants": "0.0.1-commit.001888fc",
73
+ "@aztec/epoch-cache": "0.0.1-commit.001888fc",
74
+ "@aztec/ethereum": "0.0.1-commit.001888fc",
75
+ "@aztec/foundation": "0.0.1-commit.001888fc",
76
+ "@aztec/kv-store": "0.0.1-commit.001888fc",
77
+ "@aztec/l1-artifacts": "0.0.1-commit.001888fc",
78
+ "@aztec/node-keystore": "0.0.1-commit.001888fc",
79
+ "@aztec/node-lib": "0.0.1-commit.001888fc",
80
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.001888fc",
81
+ "@aztec/p2p": "0.0.1-commit.001888fc",
82
+ "@aztec/protocol-contracts": "0.0.1-commit.001888fc",
83
+ "@aztec/prover-client": "0.0.1-commit.001888fc",
84
+ "@aztec/prover-node": "0.0.1-commit.001888fc",
85
+ "@aztec/sequencer-client": "0.0.1-commit.001888fc",
86
+ "@aztec/simulator": "0.0.1-commit.001888fc",
87
+ "@aztec/slasher": "0.0.1-commit.001888fc",
88
+ "@aztec/stdlib": "0.0.1-commit.001888fc",
89
+ "@aztec/telemetry-client": "0.0.1-commit.001888fc",
90
+ "@aztec/validator-client": "0.0.1-commit.001888fc",
91
+ "@aztec/validator-ha-signer": "0.0.1-commit.001888fc",
92
+ "@aztec/world-state": "0.0.1-commit.001888fc",
93
+ "koa": "^2.16.1",
94
+ "koa-router": "^13.1.1",
95
+ "tslib": "^2.4.0",
96
+ "viem": "npm:@aztec/viem@2.38.2"
86
97
  },
87
98
  "devDependencies": {
88
- "@jest/globals": "^29.5.0",
89
- "@types/jest": "^29.5.0",
90
- "@types/node": "^18.7.23",
91
- "jest": "^29.5.0",
92
- "jest-mock-extended": "^3.0.3",
99
+ "@jest/globals": "^30.0.0",
100
+ "@types/jest": "^30.0.0",
101
+ "@types/node": "^22.15.17",
102
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
103
+ "jest": "^30.0.0",
104
+ "jest-mock-extended": "^4.0.0",
93
105
  "ts-node": "^10.9.1",
94
- "typescript": "^5.0.4"
106
+ "typescript": "^5.3.3"
95
107
  },
96
108
  "files": [
97
109
  "dest",
@@ -100,6 +112,6 @@
100
112
  ],
101
113
  "types": "./dest/index.d.ts",
102
114
  "engines": {
103
- "node": ">=18"
115
+ "node": ">=20.10"
104
116
  }
105
117
  }
@@ -1,15 +1,38 @@
1
1
  import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
2
+ import { type GenesisStateConfig, genesisStateConfigMappings } from '@aztec/ethereum/config';
3
+ import { type L1ContractAddresses, l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
2
4
  import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
3
- import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
5
+ import { EthAddress } from '@aztec/foundation/eth-address';
6
+ import {
7
+ type KeyStore,
8
+ type ValidatorKeyStore,
9
+ ethPrivateKeySchema,
10
+ keyStoreConfigMappings,
11
+ } from '@aztec/node-keystore';
12
+ import { type SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config';
4
13
  import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
5
- import { type ProverClientConfig, proverClientConfigMappings } from '@aztec/prover-client/config';
6
- import { type SequencerClientConfig, sequencerClientConfigMappings } from '@aztec/sequencer-client/config';
14
+ import { type ProverClientUserConfig, proverClientConfigMappings } from '@aztec/prover-client/config';
15
+ import {
16
+ type ProverNodeConfig,
17
+ proverNodeConfigMappings,
18
+ specificProverNodeConfigMappings,
19
+ } from '@aztec/prover-node/config';
20
+ import {
21
+ type SequencerClientConfig,
22
+ type SequencerTxSenderConfig,
23
+ sequencerClientConfigMappings,
24
+ } from '@aztec/sequencer-client/config';
25
+ import { slasherConfigMappings } from '@aztec/slasher';
26
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
27
+ import { type NodeRPCConfig, nodeRpcConfigMappings } from '@aztec/stdlib/config';
28
+ import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
29
+ import { type DataStoreConfig, dataConfigMappings } from '@aztec/stdlib/kv-store';
7
30
  import { type ValidatorClientConfig, validatorClientConfigMappings } from '@aztec/validator-client/config';
8
31
  import { type WorldStateConfig, worldStateConfigMappings } from '@aztec/world-state/config';
9
32
 
10
- import { readFileSync } from 'fs';
11
- import { dirname, resolve } from 'path';
12
- import { fileURLToPath } from 'url';
33
+ import { privateKeyToAddress } from 'viem/accounts';
34
+
35
+ import { type SentinelConfig, sentinelConfigMappings } from '../sentinel/config.js';
13
36
 
14
37
  export { sequencerClientConfigMappings, type SequencerClientConfig };
15
38
 
@@ -19,34 +42,68 @@ export { sequencerClientConfigMappings, type SequencerClientConfig };
19
42
  export type AztecNodeConfig = ArchiverConfig &
20
43
  SequencerClientConfig &
21
44
  ValidatorClientConfig &
22
- ProverClientConfig &
45
+ ProverClientUserConfig &
23
46
  WorldStateConfig &
24
- Pick<ProverClientConfig, 'bbBinaryPath' | 'bbWorkingDirectory' | 'realProofs'> &
47
+ Pick<ProverClientUserConfig, 'bbBinaryPath' | 'bbWorkingDirectory' | 'realProofs'> &
25
48
  P2PConfig &
26
- DataStoreConfig & {
49
+ DataStoreConfig &
50
+ SentinelConfig &
51
+ SharedNodeConfig &
52
+ GenesisStateConfig &
53
+ NodeRPCConfig &
54
+ SlasherConfig &
55
+ ProverNodeConfig & {
56
+ /** L1 contracts addresses */
57
+ l1Contracts: L1ContractAddresses;
27
58
  /** Whether the validator is disabled for this node */
28
59
  disableValidator: boolean;
29
- /** Whether to populate the genesis state with initial fee juice for the test accounts */
30
- testAccounts: boolean;
60
+ /** Whether to skip waiting for the archiver to be fully synced before starting other services */
61
+ skipArchiverInitialSync: boolean;
62
+ /** A flag to force verification of tx Chonk proofs. Only used for testnet */
63
+ debugForceTxProofVerification: boolean;
64
+ /** Whether to enable the prover node as a subsystem. */
65
+ enableProverNode: boolean;
31
66
  };
32
67
 
33
68
  export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
69
+ ...dataConfigMappings,
70
+ ...keyStoreConfigMappings,
34
71
  ...archiverConfigMappings,
35
72
  ...sequencerClientConfigMappings,
73
+ ...proverNodeConfigMappings,
36
74
  ...validatorClientConfigMappings,
37
75
  ...proverClientConfigMappings,
38
76
  ...worldStateConfigMappings,
39
77
  ...p2pConfigMappings,
40
- ...dataConfigMappings,
78
+ ...sentinelConfigMappings,
79
+ ...sharedNodeConfigMappings,
80
+ ...genesisStateConfigMappings,
81
+ ...nodeRpcConfigMappings,
82
+ ...slasherConfigMappings,
83
+ ...specificProverNodeConfigMappings,
84
+ l1Contracts: {
85
+ description: 'The deployed L1 contract addresses',
86
+ nested: l1ContractAddressesMapping,
87
+ },
41
88
  disableValidator: {
42
89
  env: 'VALIDATOR_DISABLED',
43
90
  description: 'Whether the validator is disabled for this node.',
44
91
  ...booleanConfigHelper(),
45
92
  },
46
- testAccounts: {
47
- env: 'TEST_ACCOUNTS',
48
- description: 'Whether to populate the genesis state with initial fee juice for the test accounts.',
49
- ...booleanConfigHelper(),
93
+ skipArchiverInitialSync: {
94
+ env: 'SKIP_ARCHIVER_INITIAL_SYNC',
95
+ description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
96
+ ...booleanConfigHelper(false),
97
+ },
98
+ debugForceTxProofVerification: {
99
+ env: 'DEBUG_FORCE_TX_PROOF_VERIFICATION',
100
+ description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
101
+ ...booleanConfigHelper(false),
102
+ },
103
+ enableProverNode: {
104
+ env: 'ENABLE_PROVER_NODE',
105
+ description: 'Whether to enable the prover node as a subsystem.',
106
+ ...booleanConfigHelper(false),
50
107
  },
51
108
  };
52
109
 
@@ -58,14 +115,80 @@ export function getConfigEnvVars(): AztecNodeConfig {
58
115
  return getConfigFromMappings<AztecNodeConfig>(aztecNodeConfigMappings);
59
116
  }
60
117
 
61
- /**
62
- * Returns package version.
63
- */
64
- export function getPackageVersion() {
65
- const releasePleaseManifestPath = resolve(
66
- dirname(fileURLToPath(import.meta.url)),
67
- '../../../../.release-please-manifest.json',
68
- );
69
- const version = JSON.parse(readFileSync(releasePleaseManifestPath).toString());
70
- return version['.'];
118
+ type ConfigRequiredToBuildKeyStore = SequencerClientConfig & SharedNodeConfig & ValidatorClientConfig;
119
+
120
+ function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): KeyStore | undefined {
121
+ const validatorKeyStores: ValidatorKeyStore[] = [];
122
+
123
+ if (
124
+ config.web3SignerUrl === undefined ||
125
+ config.web3SignerUrl.length === 0 ||
126
+ config.validatorAddresses === undefined ||
127
+ config.validatorAddresses.length === 0
128
+ ) {
129
+ return undefined;
130
+ }
131
+
132
+ validatorKeyStores.push({
133
+ attester: config.validatorAddresses,
134
+ feeRecipient: config.feeRecipient ?? AztecAddress.ZERO,
135
+ coinbase: config.coinbase ?? config.validatorAddresses[0],
136
+ remoteSigner: config.web3SignerUrl,
137
+ publisher: config.sequencerPublisherAddresses ?? [],
138
+ });
139
+
140
+ const keyStore: KeyStore = {
141
+ schemaVersion: 1,
142
+ slasher: undefined,
143
+ prover: undefined,
144
+ remoteSigner: undefined,
145
+ validators: validatorKeyStores,
146
+ };
147
+ return keyStore;
148
+ }
149
+
150
+ function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): KeyStore | undefined {
151
+ const validatorKeyStores: ValidatorKeyStore[] = [];
152
+ const ethPrivateKeys = config.validatorPrivateKeys
153
+ ? config.validatorPrivateKeys.getValue().map((x: string) => ethPrivateKeySchema.parse(x))
154
+ : [];
155
+
156
+ if (!ethPrivateKeys.length) {
157
+ return undefined;
158
+ }
159
+ const coinbase = config.coinbase ?? EthAddress.fromString(privateKeyToAddress(ethPrivateKeys[0]));
160
+ const feeRecipient = config.feeRecipient ?? AztecAddress.ZERO;
161
+
162
+ const publisherKeys = config.sequencerPublisherPrivateKeys
163
+ ? config.sequencerPublisherPrivateKeys.map((k: { getValue: () => string }) =>
164
+ ethPrivateKeySchema.parse(k.getValue()),
165
+ )
166
+ : [];
167
+
168
+ validatorKeyStores.push({
169
+ attester: ethPrivateKeys,
170
+ feeRecipient: feeRecipient,
171
+ coinbase: coinbase,
172
+ remoteSigner: undefined,
173
+ publisher: publisherKeys,
174
+ });
175
+
176
+ const keyStore: KeyStore = {
177
+ schemaVersion: 1,
178
+ slasher: undefined,
179
+ prover: undefined,
180
+ remoteSigner: undefined,
181
+ validators: validatorKeyStores,
182
+ };
183
+ return keyStore;
184
+ }
185
+
186
+ export function createKeyStoreForValidator(
187
+ config: SequencerTxSenderConfig & SequencerClientConfig & SharedNodeConfig,
188
+ ): KeyStore | undefined {
189
+ if (config.web3SignerUrl !== undefined && config.web3SignerUrl.length > 0) {
190
+ return createKeyStoreFromWeb3Signer(config);
191
+ }
192
+
193
+ return createKeyStoreFromPrivateKeys(config);
71
194
  }
@@ -4,21 +4,26 @@ import {
4
4
  Metrics,
5
5
  type TelemetryClient,
6
6
  type UpDownCounter,
7
- ValueType,
7
+ createUpDownCounterWithDefault,
8
8
  } from '@aztec/telemetry-client';
9
9
 
10
10
  export class NodeMetrics {
11
11
  private receiveTxCount: UpDownCounter;
12
12
  private receiveTxDuration: Histogram;
13
13
 
14
+ private snapshotErrorCount: UpDownCounter;
15
+ private snapshotDuration: Histogram;
16
+
14
17
  constructor(client: TelemetryClient, name = 'AztecNode') {
15
18
  const meter = client.getMeter(name);
16
- this.receiveTxCount = meter.createUpDownCounter(Metrics.NODE_RECEIVE_TX_COUNT, {});
17
- this.receiveTxDuration = meter.createHistogram(Metrics.NODE_RECEIVE_TX_DURATION, {
18
- description: 'The duration of the receiveTx method',
19
- unit: 'ms',
20
- valueType: ValueType.INT,
19
+ this.receiveTxCount = createUpDownCounterWithDefault(meter, Metrics.NODE_RECEIVE_TX_COUNT, {
20
+ [Attributes.OK]: [true, false],
21
21
  });
22
+ this.receiveTxDuration = meter.createHistogram(Metrics.NODE_RECEIVE_TX_DURATION);
23
+
24
+ this.snapshotDuration = meter.createHistogram(Metrics.NODE_SNAPSHOT_DURATION);
25
+
26
+ this.snapshotErrorCount = createUpDownCounterWithDefault(meter, Metrics.NODE_SNAPSHOT_ERROR_COUNT);
22
27
  }
23
28
 
24
29
  receivedTx(durationMs: number, isAccepted: boolean) {
@@ -29,4 +34,16 @@ export class NodeMetrics {
29
34
  [Attributes.OK]: isAccepted,
30
35
  });
31
36
  }
37
+
38
+ recordSnapshot(durationMs: number) {
39
+ if (isNaN(durationMs)) {
40
+ return;
41
+ }
42
+
43
+ this.snapshotDuration.record(Math.ceil(durationMs));
44
+ }
45
+
46
+ recordSnapshotError() {
47
+ this.snapshotErrorCount.add(1);
48
+ }
32
49
  }