@aztec/prover-node 0.0.1-commit.d3ec352c → 0.0.1-commit.f295ac2
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/actions/download-epoch-proving-job.d.ts +1 -1
- package/dest/config.d.ts +5 -4
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +4 -3
- package/dest/factory.d.ts +2 -4
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +19 -10
- package/dest/index.d.ts +2 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -0
- package/dest/job/epoch-proving-job-data.d.ts +2 -2
- package/dest/job/epoch-proving-job-data.d.ts.map +1 -1
- package/dest/job/epoch-proving-job-data.js +1 -1
- package/dest/job/epoch-proving-job.d.ts +1 -1
- package/dest/job/epoch-proving-job.d.ts.map +1 -1
- package/dest/job/epoch-proving-job.js +389 -14
- package/dest/metrics.d.ts +2 -2
- package/dest/metrics.d.ts.map +1 -1
- package/dest/metrics.js +18 -100
- package/dest/monitors/epoch-monitor.d.ts +1 -1
- package/dest/monitors/epoch-monitor.d.ts.map +1 -1
- package/dest/monitors/epoch-monitor.js +1 -10
- package/dest/prover-node-publisher.d.ts +4 -3
- package/dest/prover-node-publisher.d.ts.map +1 -1
- package/dest/prover-node-publisher.js +20 -16
- package/dest/prover-node.d.ts +3 -3
- package/dest/prover-node.d.ts.map +1 -1
- package/dest/prover-node.js +399 -21
- package/dest/prover-publisher-factory.d.ts +4 -2
- package/dest/prover-publisher-factory.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/bin/run-failed-epoch.ts +1 -1
- package/src/config.ts +6 -4
- package/src/factory.ts +27 -15
- package/src/index.ts +1 -0
- package/src/job/epoch-proving-job-data.ts +1 -1
- package/src/job/epoch-proving-job.ts +2 -1
- package/src/metrics.ts +18 -85
- package/src/monitors/epoch-monitor.ts +1 -8
- package/src/prover-node-publisher.ts +26 -20
- package/src/prover-node.ts +4 -6
- package/src/prover-publisher-factory.ts +3 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RollupContract } from '@aztec/ethereum/contracts';
|
|
2
|
+
import type { L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
3
|
+
import type { PublisherManager } from '@aztec/ethereum/publisher-manager';
|
|
2
4
|
import type { PublisherConfig, TxSenderConfig } from '@aztec/sequencer-client';
|
|
3
5
|
import type { TelemetryClient } from '@aztec/telemetry-client';
|
|
4
6
|
import { ProverNodePublisher } from './prover-node-publisher.js';
|
|
@@ -18,4 +20,4 @@ export declare class ProverPublisherFactory {
|
|
|
18
20
|
*/
|
|
19
21
|
create(): Promise<ProverNodePublisher>;
|
|
20
22
|
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJvdmVyLXB1Ymxpc2hlci1mYWN0b3J5LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvcHJvdmVyLXB1Ymxpc2hlci1mYWN0b3J5LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGNBQWMsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQzdELE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUNBQW1DLENBQUM7QUFDMUUsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLGNBQWMsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQy9FLE9BQU8sS0FBSyxFQUFFLGVBQWUsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRS9ELE9BQU8sRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBRWpFLHFCQUFhLHNCQUFzQjtJQUUvQixPQUFPLENBQUMsTUFBTTtJQUNkLE9BQU8sQ0FBQyxJQUFJO0lBRmQsWUFDVSxNQUFNLEVBQUUsY0FBYyxHQUFHLGVBQWUsRUFDeEMsSUFBSSxFQUFFO1FBQ1osY0FBYyxFQUFFLGNBQWMsQ0FBQztRQUMvQixnQkFBZ0IsRUFBRSxnQkFBZ0IsQ0FBQyxTQUFTLENBQUMsQ0FBQztRQUM5QyxTQUFTLENBQUMsRUFBRSxlQUFlLENBQUM7S0FDN0IsRUFDQztJQUVTLEtBQUssa0JBRWpCO0lBRU0sSUFBSSxTQUVWO0lBRUQ7OztPQUdHO0lBQ1UsTUFBTSxJQUFJLE9BQU8sQ0FBQyxtQkFBbUIsQ0FBQyxDQU9sRDtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prover-publisher-factory.d.ts","sourceRoot":"","sources":["../src/prover-publisher-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"prover-publisher-factory.d.ts","sourceRoot":"","sources":["../src/prover-publisher-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAE/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,qBAAa,sBAAsB;IAE/B,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,IAAI;IAFd,YACU,MAAM,EAAE,cAAc,GAAG,eAAe,EACxC,IAAI,EAAE;QACZ,cAAc,EAAE,cAAc,CAAC;QAC/B,gBAAgB,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC9C,SAAS,CAAC,EAAE,eAAe,CAAC;KAC7B,EACC;IAES,KAAK,kBAEjB;IAEM,IAAI,SAEV;IAED;;;OAGG;IACU,MAAM,IAAI,OAAO,CAAC,mBAAmB,CAAC,CAOlD;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/prover-node",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.f295ac2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -56,27 +56,27 @@
|
|
|
56
56
|
]
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
60
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
61
|
-
"@aztec/blob-
|
|
62
|
-
"@aztec/blob-
|
|
63
|
-
"@aztec/constants": "0.0.1-commit.
|
|
64
|
-
"@aztec/epoch-cache": "0.0.1-commit.
|
|
65
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
66
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
67
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
68
|
-
"@aztec/l1-artifacts": "0.0.1-commit.
|
|
69
|
-
"@aztec/node-keystore": "0.0.1-commit.
|
|
70
|
-
"@aztec/node-lib": "0.0.1-commit.
|
|
71
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
72
|
-
"@aztec/p2p": "0.0.1-commit.
|
|
73
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
74
|
-
"@aztec/prover-client": "0.0.1-commit.
|
|
75
|
-
"@aztec/sequencer-client": "0.0.1-commit.
|
|
76
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
77
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
78
|
-
"@aztec/telemetry-client": "0.0.1-commit.
|
|
79
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
59
|
+
"@aztec/archiver": "0.0.1-commit.f295ac2",
|
|
60
|
+
"@aztec/bb-prover": "0.0.1-commit.f295ac2",
|
|
61
|
+
"@aztec/blob-client": "0.0.1-commit.f295ac2",
|
|
62
|
+
"@aztec/blob-lib": "0.0.1-commit.f295ac2",
|
|
63
|
+
"@aztec/constants": "0.0.1-commit.f295ac2",
|
|
64
|
+
"@aztec/epoch-cache": "0.0.1-commit.f295ac2",
|
|
65
|
+
"@aztec/ethereum": "0.0.1-commit.f295ac2",
|
|
66
|
+
"@aztec/foundation": "0.0.1-commit.f295ac2",
|
|
67
|
+
"@aztec/kv-store": "0.0.1-commit.f295ac2",
|
|
68
|
+
"@aztec/l1-artifacts": "0.0.1-commit.f295ac2",
|
|
69
|
+
"@aztec/node-keystore": "0.0.1-commit.f295ac2",
|
|
70
|
+
"@aztec/node-lib": "0.0.1-commit.f295ac2",
|
|
71
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.f295ac2",
|
|
72
|
+
"@aztec/p2p": "0.0.1-commit.f295ac2",
|
|
73
|
+
"@aztec/protocol-contracts": "0.0.1-commit.f295ac2",
|
|
74
|
+
"@aztec/prover-client": "0.0.1-commit.f295ac2",
|
|
75
|
+
"@aztec/sequencer-client": "0.0.1-commit.f295ac2",
|
|
76
|
+
"@aztec/simulator": "0.0.1-commit.f295ac2",
|
|
77
|
+
"@aztec/stdlib": "0.0.1-commit.f295ac2",
|
|
78
|
+
"@aztec/telemetry-client": "0.0.1-commit.f295ac2",
|
|
79
|
+
"@aztec/world-state": "0.0.1-commit.f295ac2",
|
|
80
80
|
"source-map-support": "^0.5.21",
|
|
81
81
|
"tslib": "^2.4.0",
|
|
82
82
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"@types/jest": "^30.0.0",
|
|
87
87
|
"@types/node": "^22.15.17",
|
|
88
88
|
"@types/source-map-support": "^0.5.10",
|
|
89
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
89
|
+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
90
90
|
"jest": "^30.0.0",
|
|
91
91
|
"jest-mock-extended": "^4.0.0",
|
|
92
92
|
"ts-node": "^10.9.1",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import type { L1ContractAddresses } from '@aztec/ethereum';
|
|
2
|
+
import type { L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
3
3
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
4
|
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
5
5
|
import { createLogger } from '@aztec/foundation/log';
|
package/src/config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ArchiverConfig, archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
2
|
import type { ACVMConfig, BBConfig } from '@aztec/bb-prover/config';
|
|
3
|
-
import { type GenesisStateConfig, genesisStateConfigMappings } from '@aztec/ethereum';
|
|
3
|
+
import { type GenesisStateConfig, genesisStateConfigMappings } from '@aztec/ethereum/config';
|
|
4
4
|
import {
|
|
5
5
|
type ConfigMappingsType,
|
|
6
6
|
booleanConfigHelper,
|
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
numberConfigHelper,
|
|
9
9
|
} from '@aztec/foundation/config';
|
|
10
10
|
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
|
|
11
|
-
import { type
|
|
11
|
+
import { type KeyStoreConfig, keyStoreConfigMappings } from '@aztec/node-keystore/config';
|
|
12
|
+
import { ethPrivateKeySchema } from '@aztec/node-keystore/schemas';
|
|
13
|
+
import type { KeyStore } from '@aztec/node-keystore/types';
|
|
12
14
|
import { type SharedNodeConfig, sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
13
15
|
import { type P2PConfig, p2pConfigMappings } from '@aztec/p2p/config';
|
|
14
16
|
import {
|
|
@@ -16,7 +18,7 @@ import {
|
|
|
16
18
|
type ProverBrokerConfig,
|
|
17
19
|
proverAgentConfigMappings,
|
|
18
20
|
proverBrokerConfigMappings,
|
|
19
|
-
} from '@aztec/prover-client/broker';
|
|
21
|
+
} from '@aztec/prover-client/broker/config';
|
|
20
22
|
import { type ProverClientUserConfig, bbConfigMappings, proverClientConfigMappings } from '@aztec/prover-client/config';
|
|
21
23
|
import {
|
|
22
24
|
type PublisherConfig,
|
|
@@ -163,7 +165,7 @@ function createKeyStoreFromWeb3Signer(config: ProverNodeConfig): KeyStore | unde
|
|
|
163
165
|
function createKeyStoreFromPublisherKeys(config: ProverNodeConfig): KeyStore | undefined {
|
|
164
166
|
// Extract the publisher keys from the provided config.
|
|
165
167
|
const publisherKeys = config.publisherPrivateKeys
|
|
166
|
-
? config.publisherPrivateKeys.map(k => ethPrivateKeySchema.parse(k.getValue()))
|
|
168
|
+
? config.publisherPrivateKeys.map((k: { getValue: () => string }) => ethPrivateKeySchema.parse(k.getValue()))
|
|
167
169
|
: [];
|
|
168
170
|
|
|
169
171
|
// There must be at least 1.
|
package/src/factory.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { type Archiver, createArchiver } from '@aztec/archiver';
|
|
2
2
|
import { BBCircuitVerifier, QueuedIVCVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
|
|
3
|
-
import {
|
|
3
|
+
import { createBlobClientWithFileStores } from '@aztec/blob-client/client';
|
|
4
4
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
5
|
-
import {
|
|
5
|
+
import { createEthereumChain } from '@aztec/ethereum/chain';
|
|
6
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
7
|
+
import { L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
8
|
+
import { PublisherManager } from '@aztec/ethereum/publisher-manager';
|
|
6
9
|
import { pick } from '@aztec/foundation/collection';
|
|
7
10
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
8
11
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
9
12
|
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
10
13
|
import { type KeyStoreConfig, KeystoreManager, loadKeystores, mergeKeystores } from '@aztec/node-keystore';
|
|
11
14
|
import { trySnapshotSync } from '@aztec/node-lib/actions';
|
|
12
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
createForwarderL1TxUtilsFromEthSigner,
|
|
17
|
+
createL1TxUtilsFromEthSignerWithStore,
|
|
18
|
+
} from '@aztec/node-lib/factories';
|
|
13
19
|
import { NodeRpcTxSource, createP2PClient } from '@aztec/p2p';
|
|
14
20
|
import { type ProverClientConfig, createProverClient } from '@aztec/prover-client';
|
|
15
21
|
import { createAndStartProvingBroker } from '@aztec/prover-client/broker';
|
|
@@ -33,7 +39,6 @@ export type ProverNodeDeps = {
|
|
|
33
39
|
aztecNodeTxProvider?: Pick<AztecNode, 'getTxsByHash'>;
|
|
34
40
|
archiver?: Archiver;
|
|
35
41
|
publisherFactory?: ProverPublisherFactory;
|
|
36
|
-
blobSinkClient?: BlobSinkClientInterface;
|
|
37
42
|
broker?: ProvingJobBroker;
|
|
38
43
|
l1TxUtils?: L1TxUtils;
|
|
39
44
|
dateProvider?: DateProvider;
|
|
@@ -50,8 +55,7 @@ export async function createProverNode(
|
|
|
50
55
|
const config = { ...userConfig };
|
|
51
56
|
const telemetry = deps.telemetry ?? getTelemetryClient();
|
|
52
57
|
const dateProvider = deps.dateProvider ?? new DateProvider();
|
|
53
|
-
const
|
|
54
|
-
deps.blobSinkClient ?? createBlobSinkClient(config, { logger: createLogger('prover-node:blob-sink:client') });
|
|
58
|
+
const blobClient = await createBlobClientWithFileStores(config, createLogger('prover-node:blob-client:client'));
|
|
55
59
|
const log = deps.log ?? createLogger('prover-node');
|
|
56
60
|
|
|
57
61
|
// Build a key store from file if given or from environment otherwise
|
|
@@ -102,7 +106,7 @@ export async function createProverNode(
|
|
|
102
106
|
|
|
103
107
|
const archiver =
|
|
104
108
|
deps.archiver ??
|
|
105
|
-
(await createArchiver(config, {
|
|
109
|
+
(await createArchiver(config, { blobClient, epochCache, telemetry, dateProvider }, { blockUntilSync: true }));
|
|
106
110
|
log.verbose(`Created archiver and synced to block ${await archiver.getBlockNumber()}`);
|
|
107
111
|
|
|
108
112
|
const worldStateConfig = { ...config, worldStateProvenBlocksOnly: false };
|
|
@@ -123,7 +127,7 @@ export async function createProverNode(
|
|
|
123
127
|
|
|
124
128
|
const publicClient = createPublicClient({
|
|
125
129
|
chain: chain.chainInfo,
|
|
126
|
-
transport: fallback(config.l1RpcUrls.map((url: string) => http(url))),
|
|
130
|
+
transport: fallback(config.l1RpcUrls.map((url: string) => http(url, { batch: false }))),
|
|
127
131
|
pollingInterval: config.viemPollingIntervalMS,
|
|
128
132
|
});
|
|
129
133
|
|
|
@@ -131,12 +135,20 @@ export async function createProverNode(
|
|
|
131
135
|
|
|
132
136
|
const l1TxUtils = deps.l1TxUtils
|
|
133
137
|
? [deps.l1TxUtils]
|
|
134
|
-
:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
: config.publisherForwarderAddress
|
|
139
|
+
? await createForwarderL1TxUtilsFromEthSigner(
|
|
140
|
+
publicClient,
|
|
141
|
+
proverSigners.signers,
|
|
142
|
+
config.publisherForwarderAddress,
|
|
143
|
+
{ ...config, scope: 'prover' },
|
|
144
|
+
{ telemetry, logger: log.createChild('l1-tx-utils'), dateProvider },
|
|
145
|
+
)
|
|
146
|
+
: await createL1TxUtilsFromEthSignerWithStore(
|
|
147
|
+
publicClient,
|
|
148
|
+
proverSigners.signers,
|
|
149
|
+
{ ...config, scope: 'prover' },
|
|
150
|
+
{ telemetry, logger: log.createChild('l1-tx-utils'), dateProvider },
|
|
151
|
+
);
|
|
140
152
|
|
|
141
153
|
const publisherFactory =
|
|
142
154
|
deps.publisherFactory ??
|
|
@@ -148,7 +160,7 @@ export async function createProverNode(
|
|
|
148
160
|
|
|
149
161
|
const proofVerifier = new QueuedIVCVerifier(
|
|
150
162
|
config,
|
|
151
|
-
config.realProofs
|
|
163
|
+
config.realProofs || config.debugForceTxProofVerification
|
|
152
164
|
? await BBCircuitVerifier.new(config)
|
|
153
165
|
: new TestCircuitVerifier(config.proverTestVerificationDelayMs),
|
|
154
166
|
);
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { Fr } from '@aztec/foundation/
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
4
|
import { CommitteeAttestation } from '@aztec/stdlib/block';
|
|
5
5
|
import { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
@@ -2,7 +2,7 @@ import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
|
2
2
|
import { asyncPool } from '@aztec/foundation/async-pool';
|
|
3
3
|
import { BlockNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
4
4
|
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
5
|
-
import { Fr } from '@aztec/foundation/
|
|
5
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
6
|
import { createLogger } from '@aztec/foundation/log';
|
|
7
7
|
import { RunningPromise, promiseWithResolvers } from '@aztec/foundation/promise';
|
|
8
8
|
import { Timer } from '@aztec/foundation/timer';
|
|
@@ -213,6 +213,7 @@ export class EpochProvingJob implements Traceable {
|
|
|
213
213
|
skipFeeEnforcement: false,
|
|
214
214
|
collectDebugLogs: false,
|
|
215
215
|
collectHints: true,
|
|
216
|
+
collectPublicInputs: true,
|
|
216
217
|
collectStatistics: false,
|
|
217
218
|
});
|
|
218
219
|
const publicProcessor = this.publicProcessorFactory.create(db, globalVariables, config);
|
package/src/metrics.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RollupContract } from '@aztec/ethereum';
|
|
1
|
+
import type { RollupContract } from '@aztec/ethereum/contracts';
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import type { L1PublishProofStats, L1PublishStats } from '@aztec/stdlib/stats';
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
type TelemetryClient,
|
|
14
14
|
type Tracer,
|
|
15
15
|
type UpDownCounter,
|
|
16
|
-
ValueType,
|
|
17
16
|
} from '@aztec/telemetry-client';
|
|
18
17
|
|
|
19
18
|
import { formatEther, formatUnits } from 'viem';
|
|
@@ -30,28 +29,11 @@ export class ProverNodeJobMetrics {
|
|
|
30
29
|
public readonly tracer: Tracer,
|
|
31
30
|
private logger = createLogger('prover-node:publisher:metrics'),
|
|
32
31
|
) {
|
|
33
|
-
this.proverEpochExecutionDuration = this.meter.createHistogram(Metrics.PROVER_NODE_EXECUTION_DURATION
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.provingJobDuration = this.meter.createHistogram(Metrics.PROVER_NODE_JOB_DURATION, {
|
|
39
|
-
description: 'Duration of proving job',
|
|
40
|
-
unit: 's',
|
|
41
|
-
valueType: ValueType.DOUBLE,
|
|
42
|
-
});
|
|
43
|
-
this.provingJobCheckpoints = this.meter.createGauge(Metrics.PROVER_NODE_JOB_CHECKPOINTS, {
|
|
44
|
-
description: 'Number of checkpoints in a proven epoch',
|
|
45
|
-
valueType: ValueType.INT,
|
|
46
|
-
});
|
|
47
|
-
this.provingJobBlocks = this.meter.createGauge(Metrics.PROVER_NODE_JOB_BLOCKS, {
|
|
48
|
-
description: 'Number of blocks in a proven epoch',
|
|
49
|
-
valueType: ValueType.INT,
|
|
50
|
-
});
|
|
51
|
-
this.provingJobTransactions = this.meter.createGauge(Metrics.PROVER_NODE_JOB_TRANSACTIONS, {
|
|
52
|
-
description: 'Number of transactions in a proven epoch',
|
|
53
|
-
valueType: ValueType.INT,
|
|
54
|
-
});
|
|
32
|
+
this.proverEpochExecutionDuration = this.meter.createHistogram(Metrics.PROVER_NODE_EXECUTION_DURATION);
|
|
33
|
+
this.provingJobDuration = this.meter.createHistogram(Metrics.PROVER_NODE_JOB_DURATION);
|
|
34
|
+
this.provingJobCheckpoints = this.meter.createGauge(Metrics.PROVER_NODE_JOB_CHECKPOINTS);
|
|
35
|
+
this.provingJobBlocks = this.meter.createGauge(Metrics.PROVER_NODE_JOB_BLOCKS);
|
|
36
|
+
this.provingJobTransactions = this.meter.createGauge(Metrics.PROVER_NODE_JOB_TRANSACTIONS);
|
|
55
37
|
}
|
|
56
38
|
|
|
57
39
|
public recordProvingJob(
|
|
@@ -81,15 +63,9 @@ export class ProverNodeRewardsMetrics {
|
|
|
81
63
|
private rollup: RollupContract,
|
|
82
64
|
private logger = createLogger('prover-node:publisher:metrics'),
|
|
83
65
|
) {
|
|
84
|
-
this.rewards = this.meter.createObservableGauge(Metrics.PROVER_NODE_REWARDS_PER_EPOCH
|
|
85
|
-
valueType: ValueType.DOUBLE,
|
|
86
|
-
description: 'The rewards earned',
|
|
87
|
-
});
|
|
66
|
+
this.rewards = this.meter.createObservableGauge(Metrics.PROVER_NODE_REWARDS_PER_EPOCH);
|
|
88
67
|
|
|
89
|
-
this.accumulatedRewards = this.meter.createUpDownCounter(Metrics.PROVER_NODE_REWARDS_TOTAL
|
|
90
|
-
valueType: ValueType.DOUBLE,
|
|
91
|
-
description: 'The rewards earned (total)',
|
|
92
|
-
});
|
|
68
|
+
this.accumulatedRewards = this.meter.createUpDownCounter(Metrics.PROVER_NODE_REWARDS_TOTAL);
|
|
93
69
|
}
|
|
94
70
|
|
|
95
71
|
public async start() {
|
|
@@ -150,68 +126,25 @@ export class ProverNodePublisherMetrics {
|
|
|
150
126
|
) {
|
|
151
127
|
this.meter = client.getMeter(name);
|
|
152
128
|
|
|
153
|
-
this.gasPrice = this.meter.createHistogram(Metrics.L1_PUBLISHER_GAS_PRICE
|
|
154
|
-
description: 'The gas price used for transactions',
|
|
155
|
-
unit: 'gwei',
|
|
156
|
-
valueType: ValueType.DOUBLE,
|
|
157
|
-
});
|
|
129
|
+
this.gasPrice = this.meter.createHistogram(Metrics.L1_PUBLISHER_GAS_PRICE);
|
|
158
130
|
|
|
159
|
-
this.txCount = this.meter.createUpDownCounter(Metrics.L1_PUBLISHER_TX_COUNT
|
|
160
|
-
description: 'The number of transactions processed',
|
|
161
|
-
});
|
|
131
|
+
this.txCount = this.meter.createUpDownCounter(Metrics.L1_PUBLISHER_TX_COUNT);
|
|
162
132
|
|
|
163
|
-
this.txDuration = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_DURATION
|
|
164
|
-
description: 'The duration of transaction processing',
|
|
165
|
-
unit: 'ms',
|
|
166
|
-
valueType: ValueType.INT,
|
|
167
|
-
});
|
|
133
|
+
this.txDuration = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_DURATION);
|
|
168
134
|
|
|
169
|
-
this.txGas = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_GAS
|
|
170
|
-
description: 'The gas consumed by transactions',
|
|
171
|
-
unit: 'gas',
|
|
172
|
-
valueType: ValueType.INT,
|
|
173
|
-
});
|
|
135
|
+
this.txGas = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_GAS);
|
|
174
136
|
|
|
175
|
-
this.txCalldataSize = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_CALLDATA_SIZE
|
|
176
|
-
description: 'The size of the calldata in transactions',
|
|
177
|
-
unit: 'By',
|
|
178
|
-
valueType: ValueType.INT,
|
|
179
|
-
});
|
|
137
|
+
this.txCalldataSize = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_CALLDATA_SIZE);
|
|
180
138
|
|
|
181
|
-
this.txCalldataGas = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_CALLDATA_GAS
|
|
182
|
-
description: 'The gas consumed by the calldata in transactions',
|
|
183
|
-
unit: 'gas',
|
|
184
|
-
valueType: ValueType.INT,
|
|
185
|
-
});
|
|
139
|
+
this.txCalldataGas = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_CALLDATA_GAS);
|
|
186
140
|
|
|
187
|
-
this.txBlobDataGasUsed = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_USED
|
|
188
|
-
description: 'The amount of blob gas used in transactions',
|
|
189
|
-
unit: 'gas',
|
|
190
|
-
valueType: ValueType.INT,
|
|
191
|
-
});
|
|
141
|
+
this.txBlobDataGasUsed = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_USED);
|
|
192
142
|
|
|
193
|
-
this.txBlobDataGasCost = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_COST
|
|
194
|
-
description: 'The gas cost of blobs in transactions',
|
|
195
|
-
unit: 'gwei',
|
|
196
|
-
valueType: ValueType.INT,
|
|
197
|
-
});
|
|
143
|
+
this.txBlobDataGasCost = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_BLOBDATA_GAS_COST);
|
|
198
144
|
|
|
199
|
-
this.txTotalFee = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_TOTAL_FEE
|
|
200
|
-
description: 'How much L1 tx costs',
|
|
201
|
-
unit: 'gwei',
|
|
202
|
-
valueType: ValueType.DOUBLE,
|
|
203
|
-
advice: {
|
|
204
|
-
explicitBucketBoundaries: [
|
|
205
|
-
0.001, 0.002, 0.004, 0.008, 0.01, 0.02, 0.04, 0.08, 0.1, 0.2, 0.4, 0.8, 1, 1.2, 1.4, 1.8, 2,
|
|
206
|
-
],
|
|
207
|
-
},
|
|
208
|
-
});
|
|
145
|
+
this.txTotalFee = this.meter.createHistogram(Metrics.L1_PUBLISHER_TX_TOTAL_FEE);
|
|
209
146
|
|
|
210
|
-
this.senderBalance = this.meter.createGauge(Metrics.L1_PUBLISHER_BALANCE
|
|
211
|
-
unit: 'eth',
|
|
212
|
-
description: 'The balance of the sender address',
|
|
213
|
-
valueType: ValueType.DOUBLE,
|
|
214
|
-
});
|
|
147
|
+
this.senderBalance = this.meter.createGauge(Metrics.L1_PUBLISHER_BALANCE);
|
|
215
148
|
}
|
|
216
149
|
|
|
217
150
|
recordFailedTx() {
|
|
@@ -4,13 +4,7 @@ import { RunningPromise } from '@aztec/foundation/running-promise';
|
|
|
4
4
|
import { sleep } from '@aztec/foundation/sleep';
|
|
5
5
|
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
6
6
|
import { type L1RollupConstants, getEpochAtSlot } from '@aztec/stdlib/epoch-helpers';
|
|
7
|
-
import {
|
|
8
|
-
type TelemetryClient,
|
|
9
|
-
type Traceable,
|
|
10
|
-
type Tracer,
|
|
11
|
-
getTelemetryClient,
|
|
12
|
-
trackSpan,
|
|
13
|
-
} from '@aztec/telemetry-client';
|
|
7
|
+
import { type TelemetryClient, type Traceable, type Tracer, getTelemetryClient } from '@aztec/telemetry-client';
|
|
14
8
|
|
|
15
9
|
export interface EpochMonitorHandler {
|
|
16
10
|
handleEpochReadyToProve(epochNumber: EpochNumber): Promise<boolean>;
|
|
@@ -73,7 +67,6 @@ export class EpochMonitor implements Traceable {
|
|
|
73
67
|
this.log.info('Stopped EpochMonitor');
|
|
74
68
|
}
|
|
75
69
|
|
|
76
|
-
@trackSpan('EpochMonitor.work')
|
|
77
70
|
public async work() {
|
|
78
71
|
const { epochToProve, blockNumber, slotNumber } = await this.getEpochNumberToProve();
|
|
79
72
|
this.log.debug(`Epoch to prove: ${epochToProve}`, { blockNumber, slotNumber });
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { BatchedBlob, getEthBlobEvaluationInputs } from '@aztec/blob-lib';
|
|
2
2
|
import { AZTEC_MAX_EPOCH_DURATION } from '@aztec/constants';
|
|
3
|
-
import type {
|
|
3
|
+
import type { RollupContract, ViemCommitteeAttestation } from '@aztec/ethereum/contracts';
|
|
4
|
+
import type { L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
4
5
|
import { makeTuple } from '@aztec/foundation/array';
|
|
5
6
|
import { CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
6
7
|
import { areArraysEqual } from '@aztec/foundation/collection';
|
|
8
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
7
9
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
9
10
|
import { createLogger } from '@aztec/foundation/log';
|
|
10
11
|
import type { Tuple } from '@aztec/foundation/serialize';
|
|
11
12
|
import { Timer } from '@aztec/foundation/timer';
|
|
@@ -104,6 +105,7 @@ export class ProverNodePublisher {
|
|
|
104
105
|
|
|
105
106
|
const txReceipt = await this.sendSubmitEpochProofTx(args);
|
|
106
107
|
if (!txReceipt) {
|
|
108
|
+
this.log.error(`Failed to mine submitEpochProof tx`, undefined, ctx);
|
|
107
109
|
return false;
|
|
108
110
|
}
|
|
109
111
|
|
|
@@ -136,7 +138,7 @@ export class ProverNodePublisher {
|
|
|
136
138
|
}
|
|
137
139
|
|
|
138
140
|
this.metrics.recordFailedTx();
|
|
139
|
-
this.log.error(`Rollup
|
|
141
|
+
this.log.error(`Rollup submitEpochProof tx reverted ${txReceipt.transactionHash}`, undefined, ctx);
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
this.log.verbose('Checkpoint data syncing interrupted', ctx);
|
|
@@ -170,17 +172,17 @@ export class ProverNodePublisher {
|
|
|
170
172
|
|
|
171
173
|
// Check the archive for the immediate checkpoint before the epoch
|
|
172
174
|
const checkpointLog = await this.rollupContract.getCheckpoint(CheckpointNumber(fromCheckpoint - 1));
|
|
173
|
-
if (publicInputs.previousArchiveRoot.
|
|
175
|
+
if (!publicInputs.previousArchiveRoot.equals(checkpointLog.archive)) {
|
|
174
176
|
throw new Error(
|
|
175
|
-
`Previous archive root mismatch: ${publicInputs.previousArchiveRoot.toString()} !== ${checkpointLog.archive}`,
|
|
177
|
+
`Previous archive root mismatch: ${publicInputs.previousArchiveRoot.toString()} !== ${checkpointLog.archive.toString()}`,
|
|
176
178
|
);
|
|
177
179
|
}
|
|
178
180
|
|
|
179
181
|
// Check the archive for the last checkpoint in the epoch
|
|
180
182
|
const endCheckpointLog = await this.rollupContract.getCheckpoint(toCheckpoint);
|
|
181
|
-
if (publicInputs.endArchiveRoot.
|
|
183
|
+
if (!publicInputs.endArchiveRoot.equals(endCheckpointLog.archive)) {
|
|
182
184
|
throw new Error(
|
|
183
|
-
`End archive root mismatch: ${publicInputs.endArchiveRoot.toString()} !== ${endCheckpointLog.archive}`,
|
|
185
|
+
`End archive root mismatch: ${publicInputs.endArchiveRoot.toString()} !== ${endCheckpointLog.archive.toString()}`,
|
|
184
186
|
);
|
|
185
187
|
}
|
|
186
188
|
|
|
@@ -198,7 +200,7 @@ export class ProverNodePublisher {
|
|
|
198
200
|
);
|
|
199
201
|
const argsPublicInputs = [...publicInputs.toFields()];
|
|
200
202
|
|
|
201
|
-
if (!areArraysEqual(rollupPublicInputs
|
|
203
|
+
if (!areArraysEqual(rollupPublicInputs, argsPublicInputs, (a, b) => a.equals(b))) {
|
|
202
204
|
const fmt = (inputs: Fr[] | readonly string[]) => inputs.map(x => x.toString()).join(', ');
|
|
203
205
|
throw new Error(
|
|
204
206
|
`Root rollup public inputs mismatch:\nRollup: ${fmt(rollupPublicInputs)}\nComputed:${fmt(argsPublicInputs)}`,
|
|
@@ -228,21 +230,24 @@ export class ProverNodePublisher {
|
|
|
228
230
|
});
|
|
229
231
|
try {
|
|
230
232
|
const { receipt } = await this.l1TxUtils.sendAndMonitorTransaction({ to: this.rollupContract.address, data });
|
|
233
|
+
if (receipt.status !== 'success') {
|
|
234
|
+
const errorMsg = await this.l1TxUtils.tryGetErrorFromRevertedTx(
|
|
235
|
+
data,
|
|
236
|
+
{
|
|
237
|
+
args: [...txArgs],
|
|
238
|
+
functionName: 'submitEpochRootProof',
|
|
239
|
+
abi: RollupAbi,
|
|
240
|
+
address: this.rollupContract.address,
|
|
241
|
+
},
|
|
242
|
+
/*blobInputs*/ undefined,
|
|
243
|
+
/*stateOverride*/ [],
|
|
244
|
+
);
|
|
245
|
+
this.log.error(`Rollup submit epoch proof tx reverted with ${errorMsg ?? 'unknown error'}`);
|
|
246
|
+
return undefined;
|
|
247
|
+
}
|
|
231
248
|
return receipt;
|
|
232
249
|
} catch (err) {
|
|
233
250
|
this.log.error(`Rollup submit epoch proof failed`, err);
|
|
234
|
-
const errorMsg = await this.l1TxUtils.tryGetErrorFromRevertedTx(
|
|
235
|
-
data,
|
|
236
|
-
{
|
|
237
|
-
args: [...txArgs],
|
|
238
|
-
functionName: 'submitEpochRootProof',
|
|
239
|
-
abi: RollupAbi,
|
|
240
|
-
address: this.rollupContract.address,
|
|
241
|
-
},
|
|
242
|
-
/*blobInputs*/ undefined,
|
|
243
|
-
/*stateOverride*/ [],
|
|
244
|
-
);
|
|
245
|
-
this.log.error(`Rollup submit epoch proof tx reverted. ${errorMsg}`);
|
|
246
251
|
return undefined;
|
|
247
252
|
}
|
|
248
253
|
}
|
|
@@ -261,6 +266,7 @@ export class ProverNodePublisher {
|
|
|
261
266
|
{
|
|
262
267
|
previousArchive: args.publicInputs.previousArchiveRoot.toString(),
|
|
263
268
|
endArchive: args.publicInputs.endArchiveRoot.toString(),
|
|
269
|
+
outHash: args.publicInputs.outHash.toString(),
|
|
264
270
|
proverId: EthAddress.fromField(args.publicInputs.constants.proverId).toString(),
|
|
265
271
|
} /*_args*/,
|
|
266
272
|
makeTuple(AZTEC_MAX_EPOCH_DURATION * 2, i =>
|
package/src/prover-node.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Archiver } from '@aztec/archiver';
|
|
2
|
-
import type { RollupContract } from '@aztec/ethereum';
|
|
2
|
+
import type { RollupContract } from '@aztec/ethereum/contracts';
|
|
3
3
|
import { BlockNumber, CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
4
4
|
import { assertRequired, compact, pick, sum } from '@aztec/foundation/collection';
|
|
5
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
6
|
import { memoize } from '@aztec/foundation/decorators';
|
|
6
|
-
import type { Fr } from '@aztec/foundation/fields';
|
|
7
7
|
import { createLogger } from '@aztec/foundation/log';
|
|
8
8
|
import { DateProvider } from '@aztec/foundation/timer';
|
|
9
9
|
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
@@ -342,9 +342,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
|
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
private async gatherMessages(epochNumber: EpochNumber, checkpoints: Checkpoint[]) {
|
|
345
|
-
const messages = await Promise.all(
|
|
346
|
-
checkpoints.map(c => this.l1ToL2MessageSource.getL1ToL2MessagesForCheckpoint(c.number)),
|
|
347
|
-
);
|
|
345
|
+
const messages = await Promise.all(checkpoints.map(c => this.l1ToL2MessageSource.getL1ToL2Messages(c.number)));
|
|
348
346
|
const messageCount = sum(messages.map(m => m.length));
|
|
349
347
|
this.log.verbose(`Gathered all ${messageCount} messages for epoch ${epochNumber}`, { epochNumber });
|
|
350
348
|
const messagesByCheckpoint: Record<CheckpointNumber, Fr[]> = {};
|
|
@@ -397,7 +395,7 @@ export class ProverNode implements EpochMonitorHandler, ProverNodeApi, Traceable
|
|
|
397
395
|
private validateConfig() {
|
|
398
396
|
if (
|
|
399
397
|
this.config.proverNodeFailedEpochStore &&
|
|
400
|
-
(!this.config.dataDirectory || !this.config.l1ChainId ||
|
|
398
|
+
(!this.config.dataDirectory || !this.config.l1ChainId || this.config.rollupVersion === undefined)
|
|
401
399
|
) {
|
|
402
400
|
this.log.warn(
|
|
403
401
|
`Invalid prover-node config (missing dataDirectory, l1ChainId, or rollupVersion)`,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RollupContract } from '@aztec/ethereum/contracts';
|
|
2
|
+
import type { L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
3
|
+
import type { PublisherManager } from '@aztec/ethereum/publisher-manager';
|
|
2
4
|
import type { PublisherConfig, TxSenderConfig } from '@aztec/sequencer-client';
|
|
3
5
|
import type { TelemetryClient } from '@aztec/telemetry-client';
|
|
4
6
|
|