@aztec/aztec-node 0.0.1-commit.4ad48494d → 0.0.1-commit.4eabbdb
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 +7 -4
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +10 -2
- package/dest/aztec-node/server.d.ts +16 -3
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +141 -17
- package/dest/sentinel/sentinel.d.ts +1 -1
- package/dest/sentinel/sentinel.d.ts.map +1 -1
- package/dest/sentinel/sentinel.js +15 -8
- package/package.json +27 -25
- package/src/aztec-node/config.ts +24 -8
- package/src/aztec-node/server.ts +181 -25
- package/src/sentinel/sentinel.ts +15 -6
|
@@ -90,4 +90,4 @@ export declare class Sentinel extends Sentinel_base implements L2BlockStreamEven
|
|
|
90
90
|
} | undefined;
|
|
91
91
|
}
|
|
92
92
|
export {};
|
|
93
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
93
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VudGluZWwuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZW50aW5lbC9zZW50aW5lbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNyRCxPQUFPLEVBQWUsZ0JBQWdCLEVBQUUsV0FBVyxFQUFFLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRXpHLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUUzRCxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDbkUsT0FBTyxFQUFxQixLQUFLLFdBQVcsRUFBRSxNQU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,SAAS,CAAC,iBAE3G;IAED,0DAA0D;IAC7C,YAAY,CAAC,EACxB,QAAQ,EACR,MAAM,EACN,UAAU,EACX,GAAE;QAAE,QAAQ,CAAC,EAAE,UAAU,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,CAAC;QAAC,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;KAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAmB3G;IAED,6CAA6C;IAChC,iBAAiB,CAC5B,gBAAgB,EAAE,UAAU,EAC5B,QAAQ,CAAC,EAAE,UAAU,EACrB,MAAM,CAAC,EAAE,UAAU,GAClB,OAAO,CAAC,oBAAoB,GAAG,SAAS,CAAC,CAkC3C;IAED,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,KAAK,MAAM,EAAE,EACtB,UAAU,EAAE,sBAAsB,EAClC,QAAQ,CAAC,EAAE,UAAU,EACrB,MAAM,CAAC,EAAE,UAAU,GAClB,cAAc,CAgBhB;IAED,SAAS,CAAC,aAAa,CACrB,OAAO,EAAE,sBAAsB,EAC/B,mBAAmB,EAAE,mBAAmB,GAAG,SAAS,EACpD,MAAM,EAAE,qBAAqB,EAAE;;;;;MAYhC;IAED,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS;;;;kBAMrD;CACF"}
|
|
@@ -91,16 +91,14 @@ export class Sentinel extends EventEmitter {
|
|
|
91
91
|
return;
|
|
92
92
|
}
|
|
93
93
|
const blockNumber = event.block.number;
|
|
94
|
-
const
|
|
95
|
-
if (!
|
|
96
|
-
this.logger.error(`Failed to get block ${blockNumber}
|
|
97
|
-
block
|
|
98
|
-
});
|
|
94
|
+
const header = await this.archiver.getBlockHeader(blockNumber);
|
|
95
|
+
if (!header) {
|
|
96
|
+
this.logger.error(`Failed to get block header ${blockNumber}`);
|
|
99
97
|
return;
|
|
100
98
|
}
|
|
101
99
|
// TODO(palla/slash): We should only be computing proven performance if this is
|
|
102
100
|
// a full proof epoch and not a partial one, otherwise we'll end up with skewed stats.
|
|
103
|
-
const epoch = getEpochAtSlot(
|
|
101
|
+
const epoch = getEpochAtSlot(header.getSlot(), this.epochCache.getL1Constants());
|
|
104
102
|
this.logger.debug(`Computing proven performance for epoch ${epoch}`);
|
|
105
103
|
const performance = await this.computeProvenPerformance(epoch);
|
|
106
104
|
this.logger.info(`Computed proven performance for epoch ${epoch}`, performance);
|
|
@@ -109,7 +107,11 @@ export class Sentinel extends EventEmitter {
|
|
|
109
107
|
}
|
|
110
108
|
async computeProvenPerformance(epoch) {
|
|
111
109
|
const [fromSlot, toSlot] = getSlotRangeForEpoch(epoch, this.epochCache.getL1Constants());
|
|
112
|
-
const { committee } = await this.epochCache.getCommittee(fromSlot);
|
|
110
|
+
const { committee, isEscapeHatchOpen } = await this.epochCache.getCommittee(fromSlot);
|
|
111
|
+
if (isEscapeHatchOpen) {
|
|
112
|
+
this.logger.info(`Skipping proven performance for epoch ${epoch} - escape hatch is open`);
|
|
113
|
+
return {};
|
|
114
|
+
}
|
|
113
115
|
if (!committee) {
|
|
114
116
|
this.logger.trace(`No committee found for slot ${fromSlot}`);
|
|
115
117
|
return {};
|
|
@@ -251,7 +253,12 @@ export class Sentinel extends EventEmitter {
|
|
|
251
253
|
* Gathers committee and proposer data for a given slot, computes slot stats,
|
|
252
254
|
* and updates overall stats.
|
|
253
255
|
*/ async processSlot(slot) {
|
|
254
|
-
const { epoch, seed, committee } = await this.epochCache.getCommittee(slot);
|
|
256
|
+
const { epoch, seed, committee, isEscapeHatchOpen } = await this.epochCache.getCommittee(slot);
|
|
257
|
+
if (isEscapeHatchOpen) {
|
|
258
|
+
this.logger.info(`Skipping slot ${slot} at epoch ${epoch} - escape hatch is open`);
|
|
259
|
+
this.lastProcessedSlot = slot;
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
255
262
|
if (!committee || committee.length === 0) {
|
|
256
263
|
this.logger.trace(`No committee found for slot ${slot} at epoch ${epoch}`);
|
|
257
264
|
this.lastProcessedSlot = slot;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec-node",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.4eabbdb",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -65,30 +65,32 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
69
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
70
|
-
"@aztec/blob-client": "0.0.1-commit.
|
|
71
|
-
"@aztec/
|
|
72
|
-
"@aztec/
|
|
73
|
-
"@aztec/
|
|
74
|
-
"@aztec/
|
|
75
|
-
"@aztec/
|
|
76
|
-
"@aztec/
|
|
77
|
-
"@aztec/
|
|
78
|
-
"@aztec/
|
|
79
|
-
"@aztec/node-
|
|
80
|
-
"@aztec/
|
|
81
|
-
"@aztec/
|
|
82
|
-
"@aztec/
|
|
83
|
-
"@aztec/
|
|
84
|
-
"@aztec/
|
|
85
|
-
"@aztec/
|
|
86
|
-
"@aztec/
|
|
87
|
-
"@aztec/
|
|
88
|
-
"@aztec/
|
|
89
|
-
"@aztec/
|
|
90
|
-
"@aztec/
|
|
91
|
-
"@aztec/
|
|
68
|
+
"@aztec/archiver": "0.0.1-commit.4eabbdb",
|
|
69
|
+
"@aztec/bb-prover": "0.0.1-commit.4eabbdb",
|
|
70
|
+
"@aztec/blob-client": "0.0.1-commit.4eabbdb",
|
|
71
|
+
"@aztec/blob-lib": "0.0.1-commit.4eabbdb",
|
|
72
|
+
"@aztec/constants": "0.0.1-commit.4eabbdb",
|
|
73
|
+
"@aztec/epoch-cache": "0.0.1-commit.4eabbdb",
|
|
74
|
+
"@aztec/ethereum": "0.0.1-commit.4eabbdb",
|
|
75
|
+
"@aztec/foundation": "0.0.1-commit.4eabbdb",
|
|
76
|
+
"@aztec/kv-store": "0.0.1-commit.4eabbdb",
|
|
77
|
+
"@aztec/l1-artifacts": "0.0.1-commit.4eabbdb",
|
|
78
|
+
"@aztec/merkle-tree": "0.0.1-commit.4eabbdb",
|
|
79
|
+
"@aztec/node-keystore": "0.0.1-commit.4eabbdb",
|
|
80
|
+
"@aztec/node-lib": "0.0.1-commit.4eabbdb",
|
|
81
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.4eabbdb",
|
|
82
|
+
"@aztec/p2p": "0.0.1-commit.4eabbdb",
|
|
83
|
+
"@aztec/protocol-contracts": "0.0.1-commit.4eabbdb",
|
|
84
|
+
"@aztec/prover-client": "0.0.1-commit.4eabbdb",
|
|
85
|
+
"@aztec/prover-node": "0.0.1-commit.4eabbdb",
|
|
86
|
+
"@aztec/sequencer-client": "0.0.1-commit.4eabbdb",
|
|
87
|
+
"@aztec/simulator": "0.0.1-commit.4eabbdb",
|
|
88
|
+
"@aztec/slasher": "0.0.1-commit.4eabbdb",
|
|
89
|
+
"@aztec/stdlib": "0.0.1-commit.4eabbdb",
|
|
90
|
+
"@aztec/telemetry-client": "0.0.1-commit.4eabbdb",
|
|
91
|
+
"@aztec/validator-client": "0.0.1-commit.4eabbdb",
|
|
92
|
+
"@aztec/validator-ha-signer": "0.0.1-commit.4eabbdb",
|
|
93
|
+
"@aztec/world-state": "0.0.1-commit.4eabbdb",
|
|
92
94
|
"koa": "^2.16.1",
|
|
93
95
|
"koa-router": "^13.1.1",
|
|
94
96
|
"tslib": "^2.4.0",
|
package/src/aztec-node/config.ts
CHANGED
|
@@ -13,9 +13,14 @@ import {
|
|
|
13
13
|
import { type SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
14
14
|
import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
|
|
15
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';
|
|
16
21
|
import {
|
|
17
22
|
type SequencerClientConfig,
|
|
18
|
-
type
|
|
23
|
+
type SequencerTxSenderConfig,
|
|
19
24
|
sequencerClientConfigMappings,
|
|
20
25
|
} from '@aztec/sequencer-client/config';
|
|
21
26
|
import { slasherConfigMappings } from '@aztec/slasher';
|
|
@@ -46,16 +51,18 @@ export type AztecNodeConfig = ArchiverConfig &
|
|
|
46
51
|
SharedNodeConfig &
|
|
47
52
|
GenesisStateConfig &
|
|
48
53
|
NodeRPCConfig &
|
|
49
|
-
SlasherConfig &
|
|
54
|
+
SlasherConfig &
|
|
55
|
+
ProverNodeConfig & {
|
|
50
56
|
/** L1 contracts addresses */
|
|
51
57
|
l1Contracts: L1ContractAddresses;
|
|
52
58
|
/** Whether the validator is disabled for this node */
|
|
53
59
|
disableValidator: boolean;
|
|
54
60
|
/** Whether to skip waiting for the archiver to be fully synced before starting other services */
|
|
55
61
|
skipArchiverInitialSync: boolean;
|
|
56
|
-
|
|
57
62
|
/** A flag to force verification of tx Chonk proofs. Only used for testnet */
|
|
58
63
|
debugForceTxProofVerification: boolean;
|
|
64
|
+
/** Whether to enable the prover node as a subsystem. */
|
|
65
|
+
enableProverNode: boolean;
|
|
59
66
|
};
|
|
60
67
|
|
|
61
68
|
export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
@@ -63,6 +70,7 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
63
70
|
...keyStoreConfigMappings,
|
|
64
71
|
...archiverConfigMappings,
|
|
65
72
|
...sequencerClientConfigMappings,
|
|
73
|
+
...proverNodeConfigMappings,
|
|
66
74
|
...validatorClientConfigMappings,
|
|
67
75
|
...proverClientConfigMappings,
|
|
68
76
|
...worldStateConfigMappings,
|
|
@@ -72,6 +80,7 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
72
80
|
...genesisStateConfigMappings,
|
|
73
81
|
...nodeRpcConfigMappings,
|
|
74
82
|
...slasherConfigMappings,
|
|
83
|
+
...specificProverNodeConfigMappings,
|
|
75
84
|
l1Contracts: {
|
|
76
85
|
description: 'The deployed L1 contract addresses',
|
|
77
86
|
nested: l1ContractAddressesMapping,
|
|
@@ -91,6 +100,11 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
91
100
|
description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
|
|
92
101
|
...booleanConfigHelper(false),
|
|
93
102
|
},
|
|
103
|
+
enableProverNode: {
|
|
104
|
+
env: 'ENABLE_PROVER_NODE',
|
|
105
|
+
description: 'Whether to enable the prover node as a subsystem.',
|
|
106
|
+
...booleanConfigHelper(false),
|
|
107
|
+
},
|
|
94
108
|
};
|
|
95
109
|
|
|
96
110
|
/**
|
|
@@ -101,7 +115,7 @@ export function getConfigEnvVars(): AztecNodeConfig {
|
|
|
101
115
|
return getConfigFromMappings<AztecNodeConfig>(aztecNodeConfigMappings);
|
|
102
116
|
}
|
|
103
117
|
|
|
104
|
-
type ConfigRequiredToBuildKeyStore =
|
|
118
|
+
type ConfigRequiredToBuildKeyStore = SequencerClientConfig & SharedNodeConfig & ValidatorClientConfig;
|
|
105
119
|
|
|
106
120
|
function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): KeyStore | undefined {
|
|
107
121
|
const validatorKeyStores: ValidatorKeyStore[] = [];
|
|
@@ -120,7 +134,7 @@ function createKeyStoreFromWeb3Signer(config: ConfigRequiredToBuildKeyStore): Ke
|
|
|
120
134
|
feeRecipient: config.feeRecipient ?? AztecAddress.ZERO,
|
|
121
135
|
coinbase: config.coinbase ?? config.validatorAddresses[0],
|
|
122
136
|
remoteSigner: config.web3SignerUrl,
|
|
123
|
-
publisher: config.
|
|
137
|
+
publisher: config.sequencerPublisherAddresses ?? [],
|
|
124
138
|
});
|
|
125
139
|
|
|
126
140
|
const keyStore: KeyStore = {
|
|
@@ -145,8 +159,10 @@ function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): K
|
|
|
145
159
|
const coinbase = config.coinbase ?? EthAddress.fromString(privateKeyToAddress(ethPrivateKeys[0]));
|
|
146
160
|
const feeRecipient = config.feeRecipient ?? AztecAddress.ZERO;
|
|
147
161
|
|
|
148
|
-
const publisherKeys = config.
|
|
149
|
-
? config.
|
|
162
|
+
const publisherKeys = config.sequencerPublisherPrivateKeys
|
|
163
|
+
? config.sequencerPublisherPrivateKeys.map((k: { getValue: () => string }) =>
|
|
164
|
+
ethPrivateKeySchema.parse(k.getValue()),
|
|
165
|
+
)
|
|
150
166
|
: [];
|
|
151
167
|
|
|
152
168
|
validatorKeyStores.push({
|
|
@@ -168,7 +184,7 @@ function createKeyStoreFromPrivateKeys(config: ConfigRequiredToBuildKeyStore): K
|
|
|
168
184
|
}
|
|
169
185
|
|
|
170
186
|
export function createKeyStoreForValidator(
|
|
171
|
-
config:
|
|
187
|
+
config: SequencerTxSenderConfig & SequencerClientConfig & SharedNodeConfig,
|
|
172
188
|
): KeyStore | undefined {
|
|
173
189
|
if (config.web3SignerUrl !== undefined && config.web3SignerUrl.length > 0) {
|
|
174
190
|
return createKeyStoreFromWeb3Signer(config);
|
package/src/aztec-node/server.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Archiver, createArchiver } from '@aztec/archiver';
|
|
2
2
|
import { BBCircuitVerifier, QueuedIVCVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
|
|
3
3
|
import { type BlobClientInterface, createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
4
|
+
import { Blob } from '@aztec/blob-lib';
|
|
4
5
|
import { ARCHIVE_HEIGHT, type L1_TO_L2_MSG_TREE_HEIGHT, type NOTE_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
5
6
|
import { EpochCache, type EpochCacheInterface } from '@aztec/epoch-cache';
|
|
6
7
|
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
@@ -8,7 +9,7 @@ import { getPublicClient } from '@aztec/ethereum/client';
|
|
|
8
9
|
import { RegistryContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
9
10
|
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
10
11
|
import { BlockNumber, CheckpointNumber, EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
11
|
-
import { compactArray, pick } from '@aztec/foundation/collection';
|
|
12
|
+
import { compactArray, pick, unique } from '@aztec/foundation/collection';
|
|
12
13
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
13
14
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
14
15
|
import { BadRequestError } from '@aztec/foundation/json-rpc';
|
|
@@ -16,14 +17,13 @@ import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
|
16
17
|
import { count } from '@aztec/foundation/string';
|
|
17
18
|
import { DateProvider, Timer } from '@aztec/foundation/timer';
|
|
18
19
|
import { MembershipWitness, SiblingPath } from '@aztec/foundation/trees';
|
|
19
|
-
import { KeystoreManager, loadKeystores, mergeKeystores } from '@aztec/node-keystore';
|
|
20
|
+
import { type KeyStore, KeystoreManager, loadKeystores, mergeKeystores } from '@aztec/node-keystore';
|
|
20
21
|
import { trySnapshotSync, uploadSnapshot } from '@aztec/node-lib/actions';
|
|
21
|
-
import {
|
|
22
|
-
createForwarderL1TxUtilsFromEthSigner,
|
|
23
|
-
createL1TxUtilsWithBlobsFromEthSigner,
|
|
24
|
-
} from '@aztec/node-lib/factories';
|
|
22
|
+
import { createForwarderL1TxUtilsFromSigners, createL1TxUtilsFromSigners } from '@aztec/node-lib/factories';
|
|
25
23
|
import { type P2P, type P2PClientDeps, createP2PClient, getDefaultAllowedSetupFunctions } from '@aztec/p2p';
|
|
26
24
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
25
|
+
import { type ProverNode, type ProverNodeDeps, createProverNode } from '@aztec/prover-node';
|
|
26
|
+
import { createKeyStoreForProver } from '@aztec/prover-node/config';
|
|
27
27
|
import { GlobalVariableBuilder, SequencerClient, type SequencerPublisher } from '@aztec/sequencer-client';
|
|
28
28
|
import { PublicProcessorFactory } from '@aztec/simulator/server';
|
|
29
29
|
import {
|
|
@@ -35,7 +35,14 @@ import {
|
|
|
35
35
|
} from '@aztec/slasher';
|
|
36
36
|
import { CollectionLimitsConfig, PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
37
37
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
38
|
-
import {
|
|
38
|
+
import {
|
|
39
|
+
type BlockData,
|
|
40
|
+
BlockHash,
|
|
41
|
+
type BlockParameter,
|
|
42
|
+
type DataInBlock,
|
|
43
|
+
L2Block,
|
|
44
|
+
type L2BlockSource,
|
|
45
|
+
} from '@aztec/stdlib/block';
|
|
39
46
|
import type { PublishedCheckpoint } from '@aztec/stdlib/checkpoint';
|
|
40
47
|
import type {
|
|
41
48
|
ContractClassPublic,
|
|
@@ -129,6 +136,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
129
136
|
protected readonly l1ToL2MessageSource: L1ToL2MessageSource,
|
|
130
137
|
protected readonly worldStateSynchronizer: WorldStateSynchronizer,
|
|
131
138
|
protected readonly sequencer: SequencerClient | undefined,
|
|
139
|
+
protected readonly proverNode: ProverNode | undefined,
|
|
132
140
|
protected readonly slasherClient: SlasherClientInterface | undefined,
|
|
133
141
|
protected readonly validatorsSentinel: Sentinel | undefined,
|
|
134
142
|
protected readonly epochPruneWatcher: EpochPruneWatcher | undefined,
|
|
@@ -141,6 +149,8 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
141
149
|
private telemetry: TelemetryClient = getTelemetryClient(),
|
|
142
150
|
private log = createLogger('node'),
|
|
143
151
|
private blobClient?: BlobClientInterface,
|
|
152
|
+
private validatorClient?: ValidatorClient,
|
|
153
|
+
private keyStoreManager?: KeystoreManager,
|
|
144
154
|
) {
|
|
145
155
|
this.metrics = new NodeMetrics(telemetry, 'AztecNodeService');
|
|
146
156
|
this.tracer = telemetry.getTracer('AztecNodeService');
|
|
@@ -171,10 +181,12 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
171
181
|
publisher?: SequencerPublisher;
|
|
172
182
|
dateProvider?: DateProvider;
|
|
173
183
|
p2pClientDeps?: P2PClientDeps<P2PClientType.Full>;
|
|
184
|
+
proverNodeDeps?: Partial<ProverNodeDeps>;
|
|
174
185
|
} = {},
|
|
175
186
|
options: {
|
|
176
187
|
prefilledPublicData?: PublicDataTreeLeaf[];
|
|
177
188
|
dontStartSequencer?: boolean;
|
|
189
|
+
dontStartProverNode?: boolean;
|
|
178
190
|
} = {},
|
|
179
191
|
): Promise<AztecNodeService> {
|
|
180
192
|
const config = { ...inputConfig }; // Copy the config so we dont mutate the input object
|
|
@@ -184,16 +196,29 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
184
196
|
const dateProvider = deps.dateProvider ?? new DateProvider();
|
|
185
197
|
const ethereumChain = createEthereumChain(config.l1RpcUrls, config.l1ChainId);
|
|
186
198
|
|
|
187
|
-
// Build a key store from file if given or from environment otherwise
|
|
199
|
+
// Build a key store from file if given or from environment otherwise.
|
|
200
|
+
// We keep the raw KeyStore available so we can merge with prover keys if enableProverNode is set.
|
|
188
201
|
let keyStoreManager: KeystoreManager | undefined;
|
|
189
202
|
const keyStoreProvided = config.keyStoreDirectory !== undefined && config.keyStoreDirectory.length > 0;
|
|
190
203
|
if (keyStoreProvided) {
|
|
191
204
|
const keyStores = loadKeystores(config.keyStoreDirectory!);
|
|
192
205
|
keyStoreManager = new KeystoreManager(mergeKeystores(keyStores));
|
|
193
206
|
} else {
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
|
|
207
|
+
const rawKeyStores: KeyStore[] = [];
|
|
208
|
+
const validatorKeyStore = createKeyStoreForValidator(config);
|
|
209
|
+
if (validatorKeyStore) {
|
|
210
|
+
rawKeyStores.push(validatorKeyStore);
|
|
211
|
+
}
|
|
212
|
+
if (config.enableProverNode) {
|
|
213
|
+
const proverKeyStore = createKeyStoreForProver(config);
|
|
214
|
+
if (proverKeyStore) {
|
|
215
|
+
rawKeyStores.push(proverKeyStore);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (rawKeyStores.length > 0) {
|
|
219
|
+
keyStoreManager = new KeystoreManager(
|
|
220
|
+
rawKeyStores.length === 1 ? rawKeyStores[0] : mergeKeystores(rawKeyStores),
|
|
221
|
+
);
|
|
197
222
|
}
|
|
198
223
|
}
|
|
199
224
|
|
|
@@ -204,10 +229,8 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
204
229
|
if (keyStoreManager === undefined) {
|
|
205
230
|
throw new Error('Failed to create key store, a requirement for running a validator');
|
|
206
231
|
}
|
|
207
|
-
if (!keyStoreProvided) {
|
|
208
|
-
log.warn(
|
|
209
|
-
'KEY STORE CREATED FROM ENVIRONMENT, IT IS RECOMMENDED TO USE A FILE-BASED KEY STORE IN PRODUCTION ENVIRONMENTS',
|
|
210
|
-
);
|
|
232
|
+
if (!keyStoreProvided && process.env.NODE_ENV !== 'test') {
|
|
233
|
+
log.warn("Keystore created from env: it's recommended to use a file-based key store for production");
|
|
211
234
|
}
|
|
212
235
|
ValidatorClient.validateKeyStoreConfiguration(keyStoreManager, log);
|
|
213
236
|
}
|
|
@@ -249,7 +272,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
249
272
|
);
|
|
250
273
|
}
|
|
251
274
|
|
|
252
|
-
const blobClient = await createBlobClientWithFileStores(config,
|
|
275
|
+
const blobClient = await createBlobClientWithFileStores(config, log.createChild('blob-client'));
|
|
253
276
|
|
|
254
277
|
// attempt snapshot sync if possible
|
|
255
278
|
await trySnapshotSync(config, log);
|
|
@@ -412,19 +435,19 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
412
435
|
);
|
|
413
436
|
await slasherClient.start();
|
|
414
437
|
|
|
415
|
-
const l1TxUtils = config.
|
|
416
|
-
? await
|
|
438
|
+
const l1TxUtils = config.sequencerPublisherForwarderAddress
|
|
439
|
+
? await createForwarderL1TxUtilsFromSigners(
|
|
417
440
|
publicClient,
|
|
418
441
|
keyStoreManager!.createAllValidatorPublisherSigners(),
|
|
419
|
-
config.
|
|
442
|
+
config.sequencerPublisherForwarderAddress,
|
|
420
443
|
{ ...config, scope: 'sequencer' },
|
|
421
|
-
{ telemetry, logger: log.createChild('l1-tx-utils'), dateProvider },
|
|
444
|
+
{ telemetry, logger: log.createChild('l1-tx-utils'), dateProvider, kzg: Blob.getViemKzgInstance() },
|
|
422
445
|
)
|
|
423
|
-
: await
|
|
446
|
+
: await createL1TxUtilsFromSigners(
|
|
424
447
|
publicClient,
|
|
425
448
|
keyStoreManager!.createAllValidatorPublisherSigners(),
|
|
426
449
|
{ ...config, scope: 'sequencer' },
|
|
427
|
-
{ telemetry, logger: log.createChild('l1-tx-utils'), dateProvider },
|
|
450
|
+
{ telemetry, logger: log.createChild('l1-tx-utils'), dateProvider, kzg: Blob.getViemKzgInstance() },
|
|
428
451
|
);
|
|
429
452
|
|
|
430
453
|
// Create and start the sequencer client
|
|
@@ -461,6 +484,29 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
461
484
|
log.warn(`Sequencer created but not started`);
|
|
462
485
|
}
|
|
463
486
|
|
|
487
|
+
// Create prover node subsystem if enabled
|
|
488
|
+
let proverNode: ProverNode | undefined;
|
|
489
|
+
if (config.enableProverNode) {
|
|
490
|
+
proverNode = await createProverNode(config, {
|
|
491
|
+
...deps.proverNodeDeps,
|
|
492
|
+
telemetry,
|
|
493
|
+
dateProvider,
|
|
494
|
+
archiver,
|
|
495
|
+
worldStateSynchronizer,
|
|
496
|
+
p2pClient,
|
|
497
|
+
epochCache,
|
|
498
|
+
blobClient,
|
|
499
|
+
keyStoreManager,
|
|
500
|
+
});
|
|
501
|
+
|
|
502
|
+
if (!options.dontStartProverNode) {
|
|
503
|
+
await proverNode.start();
|
|
504
|
+
log.info(`Prover node subsystem started`);
|
|
505
|
+
} else {
|
|
506
|
+
log.info(`Prover node subsystem created but not started`);
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
464
510
|
const globalVariableBuilder = new GlobalVariableBuilder({
|
|
465
511
|
...config,
|
|
466
512
|
rollupVersion: BigInt(config.rollupVersion),
|
|
@@ -468,7 +514,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
468
514
|
slotDuration: Number(slotDuration),
|
|
469
515
|
});
|
|
470
516
|
|
|
471
|
-
|
|
517
|
+
const node = new AztecNodeService(
|
|
472
518
|
config,
|
|
473
519
|
p2pClient,
|
|
474
520
|
archiver,
|
|
@@ -477,6 +523,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
477
523
|
archiver,
|
|
478
524
|
worldStateSynchronizer,
|
|
479
525
|
sequencer,
|
|
526
|
+
proverNode,
|
|
480
527
|
slasherClient,
|
|
481
528
|
validatorsSentinel,
|
|
482
529
|
epochPruneWatcher,
|
|
@@ -489,7 +536,11 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
489
536
|
telemetry,
|
|
490
537
|
log,
|
|
491
538
|
blobClient,
|
|
539
|
+
validatorClient,
|
|
540
|
+
keyStoreManager,
|
|
492
541
|
);
|
|
542
|
+
|
|
543
|
+
return node;
|
|
493
544
|
}
|
|
494
545
|
|
|
495
546
|
/**
|
|
@@ -500,6 +551,11 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
500
551
|
return this.sequencer;
|
|
501
552
|
}
|
|
502
553
|
|
|
554
|
+
/** Returns the prover node subsystem, if enabled. */
|
|
555
|
+
public getProverNode(): ProverNode | undefined {
|
|
556
|
+
return this.proverNode;
|
|
557
|
+
}
|
|
558
|
+
|
|
503
559
|
public getBlockSource(): L2BlockSource {
|
|
504
560
|
return this.blockSource;
|
|
505
561
|
}
|
|
@@ -803,6 +859,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
803
859
|
await tryStop(this.slasherClient);
|
|
804
860
|
await tryStop(this.proofVerifier);
|
|
805
861
|
await tryStop(this.sequencer);
|
|
862
|
+
await tryStop(this.proverNode);
|
|
806
863
|
await tryStop(this.p2pClient);
|
|
807
864
|
await tryStop(this.worldStateSynchronizer);
|
|
808
865
|
await tryStop(this.blockSource);
|
|
@@ -1106,6 +1163,14 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
1106
1163
|
return await this.blockSource.getBlockHeaderByArchive(archive);
|
|
1107
1164
|
}
|
|
1108
1165
|
|
|
1166
|
+
public getBlockData(number: BlockNumber): Promise<BlockData | undefined> {
|
|
1167
|
+
return this.blockSource.getBlockData(number);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
public getBlockDataByArchive(archive: Fr): Promise<BlockData | undefined> {
|
|
1171
|
+
return this.blockSource.getBlockDataByArchive(archive);
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1109
1174
|
/**
|
|
1110
1175
|
* Simulates the public part of a transaction with the current state.
|
|
1111
1176
|
* @param tx - The transaction to simulate.
|
|
@@ -1129,7 +1194,8 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
1129
1194
|
}
|
|
1130
1195
|
|
|
1131
1196
|
const txHash = tx.getTxHash();
|
|
1132
|
-
const
|
|
1197
|
+
const latestBlockNumber = await this.blockSource.getBlockNumber();
|
|
1198
|
+
const blockNumber = BlockNumber.add(latestBlockNumber, 1);
|
|
1133
1199
|
|
|
1134
1200
|
// If sequencer is not initialized, we just set these values to zero for simulation.
|
|
1135
1201
|
const coinbase = EthAddress.ZERO;
|
|
@@ -1153,6 +1219,8 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
1153
1219
|
blockNumber,
|
|
1154
1220
|
});
|
|
1155
1221
|
|
|
1222
|
+
// Ensure world-state has caught up with the latest block we loaded from the archiver
|
|
1223
|
+
await this.worldStateSynchronizer.syncImmediate(latestBlockNumber);
|
|
1156
1224
|
const merkleTreeFork = await this.worldStateSynchronizer.fork();
|
|
1157
1225
|
try {
|
|
1158
1226
|
const config = PublicSimulatorConfig.from({
|
|
@@ -1195,7 +1263,7 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
1195
1263
|
const db = this.worldStateSynchronizer.getCommitted();
|
|
1196
1264
|
const verifier = isSimulation ? undefined : this.proofVerifier;
|
|
1197
1265
|
|
|
1198
|
-
// We accept transactions if they are not expired by the next slot (checked based on the
|
|
1266
|
+
// We accept transactions if they are not expired by the next slot (checked based on the ExpirationTimestamp field)
|
|
1199
1267
|
const { ts: nextSlotTimestamp } = this.epochCache.getEpochAndSlotInNextL1Slot();
|
|
1200
1268
|
const blockNumber = BlockNumber((await this.blockSource.getBlockNumber()) + 1);
|
|
1201
1269
|
const validator = createValidatorForAcceptingTxs(
|
|
@@ -1377,6 +1445,94 @@ export class AztecNodeService implements AztecNode, AztecNodeAdmin, Traceable {
|
|
|
1377
1445
|
}
|
|
1378
1446
|
}
|
|
1379
1447
|
|
|
1448
|
+
public async reloadKeystore(): Promise<void> {
|
|
1449
|
+
if (!this.config.keyStoreDirectory?.length) {
|
|
1450
|
+
throw new BadRequestError(
|
|
1451
|
+
'Cannot reload keystore: node is not using a file-based keystore. ' +
|
|
1452
|
+
'Set KEY_STORE_DIRECTORY to use file-based keystores.',
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
if (!this.validatorClient) {
|
|
1456
|
+
throw new BadRequestError('Cannot reload keystore: validator is not enabled.');
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
this.log.info('Reloading keystore from disk');
|
|
1460
|
+
|
|
1461
|
+
// Re-read and validate keystore files
|
|
1462
|
+
const keyStores = loadKeystores(this.config.keyStoreDirectory);
|
|
1463
|
+
const newManager = new KeystoreManager(mergeKeystores(keyStores));
|
|
1464
|
+
await newManager.validateSigners();
|
|
1465
|
+
ValidatorClient.validateKeyStoreConfiguration(newManager, this.log);
|
|
1466
|
+
|
|
1467
|
+
// Validate that every validator's publisher keys overlap with the L1 signers
|
|
1468
|
+
// that were initialized at startup. Publishers cannot be hot-reloaded, so a
|
|
1469
|
+
// validator with a publisher key that doesn't match any existing L1 signer
|
|
1470
|
+
// would silently fail on every proposer slot.
|
|
1471
|
+
if (this.keyStoreManager && this.sequencer) {
|
|
1472
|
+
const oldAdapter = NodeKeystoreAdapter.fromKeyStoreManager(this.keyStoreManager);
|
|
1473
|
+
const availablePublishers = new Set(
|
|
1474
|
+
oldAdapter
|
|
1475
|
+
.getAttesterAddresses()
|
|
1476
|
+
.flatMap(a => oldAdapter.getPublisherAddresses(a).map(p => p.toString().toLowerCase())),
|
|
1477
|
+
);
|
|
1478
|
+
|
|
1479
|
+
const newAdapter = NodeKeystoreAdapter.fromKeyStoreManager(newManager);
|
|
1480
|
+
for (const attester of newAdapter.getAttesterAddresses()) {
|
|
1481
|
+
const pubs = newAdapter.getPublisherAddresses(attester);
|
|
1482
|
+
if (pubs.length > 0 && !pubs.some(p => availablePublishers.has(p.toString().toLowerCase()))) {
|
|
1483
|
+
throw new BadRequestError(
|
|
1484
|
+
`Cannot reload keystore: validator ${attester} has publisher keys ` +
|
|
1485
|
+
`[${pubs.map(p => p.toString()).join(', ')}] but none match the L1 signers initialized at startup ` +
|
|
1486
|
+
`[${[...availablePublishers].join(', ')}]. Publishers cannot be hot-reloaded — ` +
|
|
1487
|
+
`use an existing publisher key or restart the node.`,
|
|
1488
|
+
);
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
// Build adapters for old and new keystores to compute diff
|
|
1494
|
+
const newAdapter = NodeKeystoreAdapter.fromKeyStoreManager(newManager);
|
|
1495
|
+
const newAddresses = newAdapter.getAttesterAddresses();
|
|
1496
|
+
const oldAddresses = this.keyStoreManager
|
|
1497
|
+
? NodeKeystoreAdapter.fromKeyStoreManager(this.keyStoreManager).getAttesterAddresses()
|
|
1498
|
+
: [];
|
|
1499
|
+
|
|
1500
|
+
const oldSet = new Set(oldAddresses.map(a => a.toString()));
|
|
1501
|
+
const newSet = new Set(newAddresses.map(a => a.toString()));
|
|
1502
|
+
const added = newAddresses.filter(a => !oldSet.has(a.toString()));
|
|
1503
|
+
const removed = oldAddresses.filter(a => !newSet.has(a.toString()));
|
|
1504
|
+
|
|
1505
|
+
if (added.length > 0) {
|
|
1506
|
+
this.log.info(`Keystore reload: adding attester keys: ${added.map(a => a.toString()).join(', ')}`);
|
|
1507
|
+
}
|
|
1508
|
+
if (removed.length > 0) {
|
|
1509
|
+
this.log.info(`Keystore reload: removing attester keys: ${removed.map(a => a.toString()).join(', ')}`);
|
|
1510
|
+
}
|
|
1511
|
+
if (added.length === 0 && removed.length === 0) {
|
|
1512
|
+
this.log.info('Keystore reload: attester keys unchanged');
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
// Update the validator client (coinbase, feeRecipient, attester keys)
|
|
1516
|
+
this.validatorClient.reloadKeystore(newManager);
|
|
1517
|
+
|
|
1518
|
+
// Update the publisher factory's keystore so newly-added validators
|
|
1519
|
+
// can be matched to existing publisher keys when proposing blocks.
|
|
1520
|
+
if (this.sequencer) {
|
|
1521
|
+
this.sequencer.updatePublisherNodeKeyStore(newAdapter);
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
// Update slasher's "don't-slash-self" list with new validator addresses
|
|
1525
|
+
if (this.slasherClient && !this.config.slashSelfAllowed) {
|
|
1526
|
+
const slashValidatorsNever = unique(
|
|
1527
|
+
[...(this.config.slashValidatorsNever ?? []), ...newAddresses].map(a => a.toString()),
|
|
1528
|
+
).map(EthAddress.fromString);
|
|
1529
|
+
this.slasherClient.updateConfig({ slashValidatorsNever });
|
|
1530
|
+
}
|
|
1531
|
+
|
|
1532
|
+
this.keyStoreManager = newManager;
|
|
1533
|
+
this.log.info('Keystore reloaded: coinbase, feeRecipient, and attester keys updated');
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1380
1536
|
#getInitialHeaderHash(): Promise<BlockHash> {
|
|
1381
1537
|
if (!this.initialHeaderHashPromise) {
|
|
1382
1538
|
this.initialHeaderHashPromise = this.worldStateSynchronizer.getCommitted().getInitialHeader().hash();
|