@aztec/aztec-node 0.0.1-commit.b655e406 → 0.0.1-commit.b6e433891

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.
@@ -1,9 +1,10 @@
1
+ import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
1
2
  import { EthAddress } from '@aztec/foundation/eth-address';
2
3
  import { BufferReader, numToUInt8, numToUInt32BE, serializeToBuffer } from '@aztec/foundation/serialize';
3
4
  export class SentinelStore {
4
5
  store;
5
6
  config;
6
- static SCHEMA_VERSION = 2;
7
+ static SCHEMA_VERSION = 3;
7
8
  // a map from validator address to their ValidatorStatusHistory
8
9
  historyMap;
9
10
  // a map from validator address to their historical proven epoch performance
@@ -105,7 +106,7 @@ export class SentinelStore {
105
106
  const performance = [];
106
107
  while(!reader.isEmpty()){
107
108
  performance.push({
108
- epoch: BigInt(reader.readNumber()),
109
+ epoch: EpochNumber(reader.readNumber()),
109
110
  missed: reader.readNumber(),
110
111
  total: reader.readNumber()
111
112
  });
@@ -122,7 +123,7 @@ export class SentinelStore {
122
123
  const reader = new BufferReader(buffer);
123
124
  const history = [];
124
125
  while(!reader.isEmpty()){
125
- const slot = BigInt(reader.readNumber());
126
+ const slot = SlotNumber(reader.readNumber());
126
127
  const status = this.statusFromNumber(reader.readUInt8());
127
128
  history.push({
128
129
  slot,
@@ -133,16 +134,18 @@ export class SentinelStore {
133
134
  }
134
135
  statusToNumber(status) {
135
136
  switch(status){
136
- case 'block-mined':
137
+ case 'checkpoint-mined':
137
138
  return 1;
138
- case 'block-proposed':
139
+ case 'checkpoint-proposed':
139
140
  return 2;
140
- case 'block-missed':
141
+ case 'checkpoint-missed':
141
142
  return 3;
142
143
  case 'attestation-sent':
143
144
  return 4;
144
145
  case 'attestation-missed':
145
146
  return 5;
147
+ case 'blocks-missed':
148
+ return 6;
146
149
  default:
147
150
  {
148
151
  const _exhaustive = status;
@@ -153,15 +156,17 @@ export class SentinelStore {
153
156
  statusFromNumber(status) {
154
157
  switch(status){
155
158
  case 1:
156
- return 'block-mined';
159
+ return 'checkpoint-mined';
157
160
  case 2:
158
- return 'block-proposed';
161
+ return 'checkpoint-proposed';
159
162
  case 3:
160
- return 'block-missed';
163
+ return 'checkpoint-missed';
161
164
  case 4:
162
165
  return 'attestation-sent';
163
166
  case 5:
164
167
  return 'attestation-missed';
168
+ case 6:
169
+ return 'blocks-missed';
165
170
  default:
166
171
  throw new Error(`Unknown status: ${status}`);
167
172
  }
@@ -28,4 +28,4 @@ export declare class TestAztecNodeService extends AztecNodeService {
28
28
  epochCache: EpochCacheInterface;
29
29
  packageVersion: string;
30
30
  }
31
- //# sourceMappingURL=index.d.ts.map
31
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDOUQsT0FBTyxLQUFLLEVBQUUsR0FBRyxFQUFFLE1BQU0sWUFBWSxDQUFDO0FBQ3RDLE9BQU8sRUFBRSxlQUFlLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUMxRCxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsS0FBSyxzQkFBc0IsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ2hGLE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBQ3pELE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE9BQU8sRUFBRSxzQkFBc0IsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ3JHLE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E1BQU0sQ0FBQztDQUN2QyJ9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/aztec-node",
3
- "version": "0.0.1-commit.b655e406",
3
+ "version": "0.0.1-commit.b6e433891",
4
4
  "main": "dest/index.js",
5
5
  "type": "module",
6
6
  "exports": {
@@ -9,7 +9,6 @@
9
9
  "./sentinel": "./dest/aztec-node/sentinel.js",
10
10
  "./test": "./dest/test/index.js"
11
11
  },
12
- "bin": "./dest/bin/index.js",
13
12
  "typedocOptions": {
14
13
  "entryPoints": [
15
14
  "./src/index.ts"
@@ -20,8 +19,8 @@
20
19
  "scripts": {
21
20
  "start": "node --no-warnings ./dest/bin",
22
21
  "start:debug": "node --no-warnings --inspect ./dest/bin",
23
- "build": "yarn clean && tsc -b",
24
- "build:dev": "tsc -b --watch",
22
+ "build": "yarn clean && ../scripts/tsc.sh",
23
+ "build:dev": "../scripts/tsc.sh --watch",
25
24
  "clean": "rm -rf ./dest .tsbuildinfo",
26
25
  "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
27
26
  },
@@ -66,38 +65,41 @@
66
65
  ]
67
66
  },
68
67
  "dependencies": {
69
- "@aztec/archiver": "0.0.1-commit.b655e406",
70
- "@aztec/bb-prover": "0.0.1-commit.b655e406",
71
- "@aztec/blob-sink": "0.0.1-commit.b655e406",
72
- "@aztec/constants": "0.0.1-commit.b655e406",
73
- "@aztec/epoch-cache": "0.0.1-commit.b655e406",
74
- "@aztec/ethereum": "0.0.1-commit.b655e406",
75
- "@aztec/foundation": "0.0.1-commit.b655e406",
76
- "@aztec/kv-store": "0.0.1-commit.b655e406",
77
- "@aztec/l1-artifacts": "0.0.1-commit.b655e406",
78
- "@aztec/merkle-tree": "0.0.1-commit.b655e406",
79
- "@aztec/node-keystore": "0.0.1-commit.b655e406",
80
- "@aztec/node-lib": "0.0.1-commit.b655e406",
81
- "@aztec/noir-protocol-circuits-types": "0.0.1-commit.b655e406",
82
- "@aztec/p2p": "0.0.1-commit.b655e406",
83
- "@aztec/protocol-contracts": "0.0.1-commit.b655e406",
84
- "@aztec/prover-client": "0.0.1-commit.b655e406",
85
- "@aztec/sequencer-client": "0.0.1-commit.b655e406",
86
- "@aztec/simulator": "0.0.1-commit.b655e406",
87
- "@aztec/slasher": "0.0.1-commit.b655e406",
88
- "@aztec/stdlib": "0.0.1-commit.b655e406",
89
- "@aztec/telemetry-client": "0.0.1-commit.b655e406",
90
- "@aztec/validator-client": "0.0.1-commit.b655e406",
91
- "@aztec/world-state": "0.0.1-commit.b655e406",
68
+ "@aztec/archiver": "0.0.1-commit.b6e433891",
69
+ "@aztec/bb-prover": "0.0.1-commit.b6e433891",
70
+ "@aztec/blob-client": "0.0.1-commit.b6e433891",
71
+ "@aztec/blob-lib": "0.0.1-commit.b6e433891",
72
+ "@aztec/constants": "0.0.1-commit.b6e433891",
73
+ "@aztec/epoch-cache": "0.0.1-commit.b6e433891",
74
+ "@aztec/ethereum": "0.0.1-commit.b6e433891",
75
+ "@aztec/foundation": "0.0.1-commit.b6e433891",
76
+ "@aztec/kv-store": "0.0.1-commit.b6e433891",
77
+ "@aztec/l1-artifacts": "0.0.1-commit.b6e433891",
78
+ "@aztec/node-keystore": "0.0.1-commit.b6e433891",
79
+ "@aztec/node-lib": "0.0.1-commit.b6e433891",
80
+ "@aztec/noir-protocol-circuits-types": "0.0.1-commit.b6e433891",
81
+ "@aztec/p2p": "0.0.1-commit.b6e433891",
82
+ "@aztec/protocol-contracts": "0.0.1-commit.b6e433891",
83
+ "@aztec/prover-client": "0.0.1-commit.b6e433891",
84
+ "@aztec/prover-node": "0.0.1-commit.b6e433891",
85
+ "@aztec/sequencer-client": "0.0.1-commit.b6e433891",
86
+ "@aztec/simulator": "0.0.1-commit.b6e433891",
87
+ "@aztec/slasher": "0.0.1-commit.b6e433891",
88
+ "@aztec/stdlib": "0.0.1-commit.b6e433891",
89
+ "@aztec/telemetry-client": "0.0.1-commit.b6e433891",
90
+ "@aztec/validator-client": "0.0.1-commit.b6e433891",
91
+ "@aztec/validator-ha-signer": "0.0.1-commit.b6e433891",
92
+ "@aztec/world-state": "0.0.1-commit.b6e433891",
92
93
  "koa": "^2.16.1",
93
94
  "koa-router": "^13.1.1",
94
95
  "tslib": "^2.4.0",
95
- "viem": "npm:@spalladino/viem@2.38.2-eip7594.0"
96
+ "viem": "npm:@aztec/viem@2.38.2"
96
97
  },
97
98
  "devDependencies": {
98
99
  "@jest/globals": "^30.0.0",
99
100
  "@types/jest": "^30.0.0",
100
101
  "@types/node": "^22.15.17",
102
+ "@typescript/native-preview": "7.0.0-dev.20260113.1",
101
103
  "jest": "^30.0.0",
102
104
  "jest-mock-extended": "^4.0.0",
103
105
  "ts-node": "^10.9.1",
@@ -1,13 +1,8 @@
1
1
  import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
2
- import {
3
- type GenesisStateConfig,
4
- type L1ContractAddresses,
5
- genesisStateConfigMappings,
6
- l1ContractAddressesMapping,
7
- } from '@aztec/ethereum';
2
+ import { type GenesisStateConfig, genesisStateConfigMappings } from '@aztec/ethereum/config';
3
+ import { type L1ContractAddresses, l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
8
4
  import { type ConfigMappingsType, booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
9
5
  import { EthAddress } from '@aztec/foundation/eth-address';
10
- import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
11
6
  import {
12
7
  type KeyStore,
13
8
  type ValidatorKeyStore,
@@ -17,15 +12,21 @@ import {
17
12
  import { type SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config';
18
13
  import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
19
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
20
  import {
21
21
  type SequencerClientConfig,
22
- type TxSenderConfig,
22
+ type SequencerTxSenderConfig,
23
23
  sequencerClientConfigMappings,
24
24
  } from '@aztec/sequencer-client/config';
25
25
  import { slasherConfigMappings } from '@aztec/slasher';
26
26
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
27
27
  import { type NodeRPCConfig, nodeRpcConfigMappings } from '@aztec/stdlib/config';
28
28
  import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
29
+ import { type DataStoreConfig, dataConfigMappings } from '@aztec/stdlib/kv-store';
29
30
  import { type ValidatorClientConfig, validatorClientConfigMappings } from '@aztec/validator-client/config';
30
31
  import { type WorldStateConfig, worldStateConfigMappings } from '@aztec/world-state/config';
31
32
 
@@ -50,13 +51,18 @@ export type AztecNodeConfig = ArchiverConfig &
50
51
  SharedNodeConfig &
51
52
  GenesisStateConfig &
52
53
  NodeRPCConfig &
53
- SlasherConfig & {
54
+ SlasherConfig &
55
+ ProverNodeConfig & {
54
56
  /** L1 contracts addresses */
55
57
  l1Contracts: L1ContractAddresses;
56
58
  /** Whether the validator is disabled for this node */
57
59
  disableValidator: boolean;
58
60
  /** Whether to skip waiting for the archiver to be fully synced before starting other services */
59
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;
60
66
  };
61
67
 
62
68
  export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
@@ -64,6 +70,7 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
64
70
  ...keyStoreConfigMappings,
65
71
  ...archiverConfigMappings,
66
72
  ...sequencerClientConfigMappings,
73
+ ...proverNodeConfigMappings,
67
74
  ...validatorClientConfigMappings,
68
75
  ...proverClientConfigMappings,
69
76
  ...worldStateConfigMappings,
@@ -73,6 +80,7 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
73
80
  ...genesisStateConfigMappings,
74
81
  ...nodeRpcConfigMappings,
75
82
  ...slasherConfigMappings,
83
+ ...specificProverNodeConfigMappings,
76
84
  l1Contracts: {
77
85
  description: 'The deployed L1 contract addresses',
78
86
  nested: l1ContractAddressesMapping,
@@ -87,6 +95,16 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
87
95
  description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
88
96
  ...booleanConfigHelper(false),
89
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),
107
+ },
90
108
  };
91
109
 
92
110
  /**
@@ -97,7 +115,7 @@ export function getConfigEnvVars(): AztecNodeConfig {
97
115
  return getConfigFromMappings<AztecNodeConfig>(aztecNodeConfigMappings);
98
116
  }
99
117
 
100
- type ConfigRequiredToBuildKeyStore = TxSenderConfig & SequencerClientConfig & SharedNodeConfig & ValidatorClientConfig;
118
+ type ConfigRequiredToBuildKeyStore = SequencerClientConfig & SharedNodeConfig & ValidatorClientConfig;
101
119
 
102
120
  function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): KeyStore | undefined {
103
121
  const validatorKeyStores: ValidatorKeyStore[] = [];
@@ -116,7 +134,7 @@ function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): Ke
116
134
  feeRecipient: config.feeRecipient ?? AztecAddress.ZERO,
117
135
  coinbase: config.coinbase ?? config.validatorAddresses[0],
118
136
  remoteSigner: config.web3SignerUrl,
119
- publisher: config.publisherAddresses ?? [],
137
+ publisher: config.sequencerPublisherAddresses ?? [],
120
138
  });
121
139
 
122
140
  const keyStore: KeyStore = {
@@ -132,7 +150,7 @@ function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): Ke
132
150
  function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): KeyStore | undefined {
133
151
  const validatorKeyStores: ValidatorKeyStore[] = [];
134
152
  const ethPrivateKeys = config.validatorPrivateKeys
135
- ? config.validatorPrivateKeys.getValue().map(x => ethPrivateKeySchema.parse(x))
153
+ ? config.validatorPrivateKeys.getValue().map((x: string) => ethPrivateKeySchema.parse(x))
136
154
  : [];
137
155
 
138
156
  if (!ethPrivateKeys.length) {
@@ -141,8 +159,10 @@ function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): K
141
159
  const coinbase = config.coinbase ?? EthAddress.fromString(privateKeyToAddress(ethPrivateKeys[0]));
142
160
  const feeRecipient = config.feeRecipient ?? AztecAddress.ZERO;
143
161
 
144
- const publisherKeys = config.publisherPrivateKeys
145
- ? config.publisherPrivateKeys.map(k => ethPrivateKeySchema.parse(k.getValue()))
162
+ const publisherKeys = config.sequencerPublisherPrivateKeys
163
+ ? config.sequencerPublisherPrivateKeys.map((k: { getValue: () => string }) =>
164
+ ethPrivateKeySchema.parse(k.getValue()),
165
+ )
146
166
  : [];
147
167
 
148
168
  validatorKeyStores.push({
@@ -164,7 +184,7 @@ function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): K
164
184
  }
165
185
 
166
186
  export function createKeyStoreForValidator(
167
- config: TxSenderConfig & SequencerClientConfig & SharedNodeConfig,
187
+ config: SequencerTxSenderConfig & SequencerClientConfig & SharedNodeConfig,
168
188
  ): KeyStore | undefined {
169
189
  if (config.web3SignerUrl !== undefined && config.web3SignerUrl.length > 0) {
170
190
  return createKeyStoreFromWeb3Signer(config);
@@ -4,7 +4,7 @@ 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 {
@@ -16,25 +16,14 @@ export class NodeMetrics {
16
16
 
17
17
  constructor(client: TelemetryClient, name = 'AztecNode') {
18
18
  const meter = client.getMeter(name);
19
- this.receiveTxCount = meter.createUpDownCounter(Metrics.NODE_RECEIVE_TX_COUNT, {});
20
- this.receiveTxDuration = meter.createHistogram(Metrics.NODE_RECEIVE_TX_DURATION, {
21
- description: 'The duration of the receiveTx method',
22
- unit: 'ms',
23
- valueType: ValueType.INT,
19
+ this.receiveTxCount = createUpDownCounterWithDefault(meter, Metrics.NODE_RECEIVE_TX_COUNT, {
20
+ [Attributes.OK]: [true, false],
24
21
  });
22
+ this.receiveTxDuration = meter.createHistogram(Metrics.NODE_RECEIVE_TX_DURATION);
25
23
 
26
- this.snapshotDuration = meter.createHistogram(Metrics.NODE_SNAPSHOT_DURATION, {
27
- description: 'How long taking a snapshot takes',
28
- unit: 'ms',
29
- valueType: ValueType.INT,
30
- });
31
-
32
- this.snapshotErrorCount = meter.createUpDownCounter(Metrics.NODE_SNAPSHOT_ERROR_COUNT, {
33
- description: 'How many snapshot errors have happened',
34
- valueType: ValueType.INT,
35
- });
24
+ this.snapshotDuration = meter.createHistogram(Metrics.NODE_SNAPSHOT_DURATION);
36
25
 
37
- this.snapshotErrorCount.add(0);
26
+ this.snapshotErrorCount = createUpDownCounterWithDefault(meter, Metrics.NODE_SNAPSHOT_ERROR_COUNT);
38
27
  }
39
28
 
40
29
  receivedTx(durationMs: number, isAccepted: boolean) {