@aztec/aztec-node 0.0.1-commit.fce3e4f → 0.0.1-commit.ff7989d6c
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.
- package/dest/aztec-node/config.d.ts +11 -5
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +17 -3
- package/dest/aztec-node/node_metrics.d.ts +1 -1
- package/dest/aztec-node/node_metrics.d.ts.map +1 -1
- package/dest/aztec-node/node_metrics.js +9 -16
- package/dest/aztec-node/server.d.ts +65 -122
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +769 -216
- package/dest/sentinel/factory.d.ts +1 -1
- package/dest/sentinel/factory.d.ts.map +1 -1
- package/dest/sentinel/factory.js +1 -1
- package/dest/sentinel/sentinel.d.ts +6 -5
- package/dest/sentinel/sentinel.d.ts.map +1 -1
- package/dest/sentinel/sentinel.js +82 -51
- package/dest/sentinel/store.d.ts +2 -2
- package/dest/sentinel/store.d.ts.map +1 -1
- package/dest/sentinel/store.js +11 -7
- package/package.json +30 -28
- package/src/aztec-node/config.ts +34 -14
- package/src/aztec-node/node_metrics.ts +6 -17
- package/src/aztec-node/server.ts +488 -288
- package/src/sentinel/factory.ts +1 -6
- package/src/sentinel/sentinel.ts +94 -52
- package/src/sentinel/store.ts +12 -12
package/src/aztec-node/config.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
6
|
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
|
|
@@ -17,9 +13,14 @@ import {
|
|
|
17
13
|
import { type SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
18
14
|
import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
|
|
19
15
|
import { type ProverClientUserConfig, proverClientConfigMappings } from '@aztec/prover-client/config';
|
|
16
|
+
import {
|
|
17
|
+
type ProverNodeConfig,
|
|
18
|
+
proverNodeConfigMappings,
|
|
19
|
+
specificProverNodeConfigMappings,
|
|
20
|
+
} from '@aztec/prover-node/config';
|
|
20
21
|
import {
|
|
21
22
|
type SequencerClientConfig,
|
|
22
|
-
type
|
|
23
|
+
type SequencerTxSenderConfig,
|
|
23
24
|
sequencerClientConfigMappings,
|
|
24
25
|
} from '@aztec/sequencer-client/config';
|
|
25
26
|
import { slasherConfigMappings } from '@aztec/slasher';
|
|
@@ -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 =
|
|
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.
|
|
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.
|
|
145
|
-
? config.
|
|
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:
|
|
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
|
-
|
|
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
|
|
20
|
-
|
|
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.
|
|
26
|
+
this.snapshotErrorCount = createUpDownCounterWithDefault(meter, Metrics.NODE_SNAPSHOT_ERROR_COUNT);
|
|
38
27
|
}
|
|
39
28
|
|
|
40
29
|
receivedTx(durationMs: number, isAccepted: boolean) {
|