@aztec/aztec-node 0.0.0-test.0 → 0.0.1-commit.001888fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/aztec-node/config.d.ts +22 -11
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +90 -15
- package/dest/aztec-node/node_metrics.d.ts +5 -1
- package/dest/aztec-node/node_metrics.d.ts.map +1 -1
- package/dest/aztec-node/node_metrics.js +20 -6
- package/dest/aztec-node/server.d.ts +132 -154
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +1292 -371
- package/dest/bin/index.d.ts +1 -1
- package/dest/bin/index.js +4 -2
- package/dest/index.d.ts +1 -2
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +0 -1
- package/dest/sentinel/config.d.ts +8 -0
- package/dest/sentinel/config.d.ts.map +1 -0
- package/dest/sentinel/config.js +29 -0
- package/dest/sentinel/factory.d.ts +9 -0
- package/dest/sentinel/factory.d.ts.map +1 -0
- package/dest/sentinel/factory.js +17 -0
- package/dest/sentinel/index.d.ts +3 -0
- package/dest/sentinel/index.d.ts.map +1 -0
- package/dest/sentinel/index.js +1 -0
- package/dest/sentinel/sentinel.d.ts +93 -0
- package/dest/sentinel/sentinel.d.ts.map +1 -0
- package/dest/sentinel/sentinel.js +429 -0
- package/dest/sentinel/store.d.ts +35 -0
- package/dest/sentinel/store.d.ts.map +1 -0
- package/dest/sentinel/store.js +174 -0
- package/dest/test/index.d.ts +31 -0
- package/dest/test/index.d.ts.map +1 -0
- package/dest/test/index.js +1 -0
- package/package.json +47 -35
- package/src/aztec-node/config.ts +149 -26
- package/src/aztec-node/node_metrics.ts +23 -6
- package/src/aztec-node/server.ts +1162 -467
- package/src/bin/index.ts +4 -2
- package/src/index.ts +0 -1
- package/src/sentinel/config.ts +37 -0
- package/src/sentinel/factory.ts +31 -0
- package/src/sentinel/index.ts +8 -0
- package/src/sentinel/sentinel.ts +543 -0
- package/src/sentinel/store.ts +185 -0
- package/src/test/index.ts +32 -0
- package/dest/aztec-node/http_rpc_server.d.ts +0 -8
- package/dest/aztec-node/http_rpc_server.d.ts.map +0 -1
- package/dest/aztec-node/http_rpc_server.js +0 -9
- package/src/aztec-node/http_rpc_server.ts +0 -11
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
import { type ArchiverConfig } from '@aztec/archiver/config';
|
|
2
|
+
import { type GenesisStateConfig } from '@aztec/ethereum/config';
|
|
3
|
+
import { type L1ContractAddresses } from '@aztec/ethereum/l1-contract-addresses';
|
|
2
4
|
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
3
|
-
import { type
|
|
5
|
+
import { type KeyStore } from '@aztec/node-keystore';
|
|
6
|
+
import { type SharedNodeConfig } from '@aztec/node-lib/config';
|
|
4
7
|
import { type P2PConfig } from '@aztec/p2p/config';
|
|
5
|
-
import { type
|
|
6
|
-
import { type
|
|
8
|
+
import { type ProverClientUserConfig } from '@aztec/prover-client/config';
|
|
9
|
+
import { type ProverNodeConfig } from '@aztec/prover-node/config';
|
|
10
|
+
import { type SequencerClientConfig, type SequencerTxSenderConfig, sequencerClientConfigMappings } from '@aztec/sequencer-client/config';
|
|
11
|
+
import { type NodeRPCConfig } from '@aztec/stdlib/config';
|
|
12
|
+
import type { SlasherConfig } from '@aztec/stdlib/interfaces/server';
|
|
13
|
+
import { type DataStoreConfig } from '@aztec/stdlib/kv-store';
|
|
7
14
|
import { type ValidatorClientConfig } from '@aztec/validator-client/config';
|
|
8
15
|
import { type WorldStateConfig } from '@aztec/world-state/config';
|
|
16
|
+
import { type SentinelConfig } from '../sentinel/config.js';
|
|
9
17
|
export { sequencerClientConfigMappings, type SequencerClientConfig };
|
|
10
18
|
/**
|
|
11
19
|
* The configuration the aztec node.
|
|
12
20
|
*/
|
|
13
|
-
export type AztecNodeConfig = ArchiverConfig & SequencerClientConfig & ValidatorClientConfig &
|
|
21
|
+
export type AztecNodeConfig = ArchiverConfig & SequencerClientConfig & ValidatorClientConfig & ProverClientUserConfig & WorldStateConfig & Pick<ProverClientUserConfig, 'bbBinaryPath' | 'bbWorkingDirectory' | 'realProofs'> & P2PConfig & DataStoreConfig & SentinelConfig & SharedNodeConfig & GenesisStateConfig & NodeRPCConfig & SlasherConfig & ProverNodeConfig & {
|
|
22
|
+
/** L1 contracts addresses */
|
|
23
|
+
l1Contracts: L1ContractAddresses;
|
|
14
24
|
/** Whether the validator is disabled for this node */
|
|
15
25
|
disableValidator: boolean;
|
|
16
|
-
/** Whether to
|
|
17
|
-
|
|
26
|
+
/** Whether to skip waiting for the archiver to be fully synced before starting other services */
|
|
27
|
+
skipArchiverInitialSync: boolean;
|
|
28
|
+
/** A flag to force verification of tx Chonk proofs. Only used for testnet */
|
|
29
|
+
debugForceTxProofVerification: boolean;
|
|
30
|
+
/** Whether to enable the prover node as a subsystem. */
|
|
31
|
+
enableProverNode: boolean;
|
|
18
32
|
};
|
|
19
33
|
export declare const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig>;
|
|
20
34
|
/**
|
|
@@ -22,8 +36,5 @@ export declare const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig
|
|
|
22
36
|
* @returns A valid aztec node config.
|
|
23
37
|
*/
|
|
24
38
|
export declare function getConfigEnvVars(): AztecNodeConfig;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*/
|
|
28
|
-
export declare function getPackageVersion(): any;
|
|
29
|
-
//# sourceMappingURL=config.d.ts.map
|
|
39
|
+
export declare function createKeyStoreForValidator(config: SequencerTxSenderConfig & SequencerClientConfig & SharedNodeConfig): KeyStore | undefined;
|
|
40
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYXp0ZWMtbm9kZS9jb25maWcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkF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|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/aztec-node/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,KAAK,kBAAkB,EAA8C,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/aztec-node/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,KAAK,kBAAkB,EAA8B,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,KAAK,mBAAmB,EAA8B,MAAM,uCAAuC,CAAC;AAC7G,OAAO,EAAE,KAAK,kBAAkB,EAA8C,MAAM,0BAA0B,CAAC;AAE/G,OAAO,EACL,KAAK,QAAQ,EAId,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,KAAK,gBAAgB,EAA4B,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAE,KAAK,sBAAsB,EAA8B,MAAM,6BAA6B,CAAC;AACtG,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,uBAAuB,EAC5B,6BAA6B,EAC9B,MAAM,gCAAgC,CAAC;AAGxC,OAAO,EAAE,KAAK,aAAa,EAAyB,MAAM,sBAAsB,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAE,KAAK,qBAAqB,EAAiC,MAAM,gCAAgC,CAAC;AAC3G,OAAO,EAAE,KAAK,gBAAgB,EAA4B,MAAM,2BAA2B,CAAC;AAI5F,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,uBAAuB,CAAC;AAEpF,OAAO,EAAE,6BAA6B,EAAE,KAAK,qBAAqB,EAAE,CAAC;AAErE;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,cAAc,GAC1C,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,GACtB,gBAAgB,GAChB,IAAI,CAAC,sBAAsB,EAAE,cAAc,GAAG,oBAAoB,GAAG,YAAY,CAAC,GAClF,SAAS,GACT,eAAe,GACf,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,aAAa,GACb,aAAa,GACb,gBAAgB,GAAG;IACjB,6BAA6B;IAC7B,WAAW,EAAE,mBAAmB,CAAC;IACjC,sDAAsD;IACtD,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iGAAiG;IACjG,uBAAuB,EAAE,OAAO,CAAC;IACjC,6EAA6E;IAC7E,6BAA6B,EAAE,OAAO,CAAC;IACvC,wDAAwD;IACxD,gBAAgB,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEJ,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,CAAC,eAAe,CAwCvE,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,eAAe,CAElD;AAsED,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,uBAAuB,GAAG,qBAAqB,GAAG,gBAAgB,GACzE,QAAQ,GAAG,SAAS,CAMtB"}
|
|
@@ -1,32 +1,62 @@
|
|
|
1
1
|
import { archiverConfigMappings } from '@aztec/archiver/config';
|
|
2
|
+
import { genesisStateConfigMappings } from '@aztec/ethereum/config';
|
|
3
|
+
import { l1ContractAddressesMapping } from '@aztec/ethereum/l1-contract-addresses';
|
|
2
4
|
import { booleanConfigHelper, getConfigFromMappings } from '@aztec/foundation/config';
|
|
3
|
-
import {
|
|
5
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
|
+
import { ethPrivateKeySchema, keyStoreConfigMappings } from '@aztec/node-keystore';
|
|
7
|
+
import { sharedNodeConfigMappings } from '@aztec/node-lib/config';
|
|
4
8
|
import { p2pConfigMappings } from '@aztec/p2p/config';
|
|
5
9
|
import { proverClientConfigMappings } from '@aztec/prover-client/config';
|
|
10
|
+
import { proverNodeConfigMappings, specificProverNodeConfigMappings } from '@aztec/prover-node/config';
|
|
6
11
|
import { sequencerClientConfigMappings } from '@aztec/sequencer-client/config';
|
|
12
|
+
import { slasherConfigMappings } from '@aztec/slasher';
|
|
13
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
14
|
+
import { nodeRpcConfigMappings } from '@aztec/stdlib/config';
|
|
15
|
+
import { dataConfigMappings } from '@aztec/stdlib/kv-store';
|
|
7
16
|
import { validatorClientConfigMappings } from '@aztec/validator-client/config';
|
|
8
17
|
import { worldStateConfigMappings } from '@aztec/world-state/config';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { fileURLToPath } from 'url';
|
|
18
|
+
import { privateKeyToAddress } from 'viem/accounts';
|
|
19
|
+
import { sentinelConfigMappings } from '../sentinel/config.js';
|
|
12
20
|
export { sequencerClientConfigMappings };
|
|
13
21
|
export const aztecNodeConfigMappings = {
|
|
22
|
+
...dataConfigMappings,
|
|
23
|
+
...keyStoreConfigMappings,
|
|
14
24
|
...archiverConfigMappings,
|
|
15
25
|
...sequencerClientConfigMappings,
|
|
26
|
+
...proverNodeConfigMappings,
|
|
16
27
|
...validatorClientConfigMappings,
|
|
17
28
|
...proverClientConfigMappings,
|
|
18
29
|
...worldStateConfigMappings,
|
|
19
30
|
...p2pConfigMappings,
|
|
20
|
-
...
|
|
31
|
+
...sentinelConfigMappings,
|
|
32
|
+
...sharedNodeConfigMappings,
|
|
33
|
+
...genesisStateConfigMappings,
|
|
34
|
+
...nodeRpcConfigMappings,
|
|
35
|
+
...slasherConfigMappings,
|
|
36
|
+
...specificProverNodeConfigMappings,
|
|
37
|
+
l1Contracts: {
|
|
38
|
+
description: 'The deployed L1 contract addresses',
|
|
39
|
+
nested: l1ContractAddressesMapping
|
|
40
|
+
},
|
|
21
41
|
disableValidator: {
|
|
22
42
|
env: 'VALIDATOR_DISABLED',
|
|
23
43
|
description: 'Whether the validator is disabled for this node.',
|
|
24
44
|
...booleanConfigHelper()
|
|
25
45
|
},
|
|
26
|
-
|
|
27
|
-
env: '
|
|
28
|
-
description: 'Whether to
|
|
29
|
-
...booleanConfigHelper()
|
|
46
|
+
skipArchiverInitialSync: {
|
|
47
|
+
env: 'SKIP_ARCHIVER_INITIAL_SYNC',
|
|
48
|
+
description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
|
|
49
|
+
...booleanConfigHelper(false)
|
|
50
|
+
},
|
|
51
|
+
debugForceTxProofVerification: {
|
|
52
|
+
env: 'DEBUG_FORCE_TX_PROOF_VERIFICATION',
|
|
53
|
+
description: 'Whether to skip waiting for the archiver to be fully synced before starting other services.',
|
|
54
|
+
...booleanConfigHelper(false)
|
|
55
|
+
},
|
|
56
|
+
enableProverNode: {
|
|
57
|
+
env: 'ENABLE_PROVER_NODE',
|
|
58
|
+
description: 'Whether to enable the prover node as a subsystem.',
|
|
59
|
+
...booleanConfigHelper(false)
|
|
30
60
|
}
|
|
31
61
|
};
|
|
32
62
|
/**
|
|
@@ -35,10 +65,55 @@ export const aztecNodeConfigMappings = {
|
|
|
35
65
|
*/ export function getConfigEnvVars() {
|
|
36
66
|
return getConfigFromMappings(aztecNodeConfigMappings);
|
|
37
67
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
68
|
+
function createKeyStoreFromWeb3Signer(config) {
|
|
69
|
+
const validatorKeyStores = [];
|
|
70
|
+
if (config.web3SignerUrl === undefined || config.web3SignerUrl.length === 0 || config.validatorAddresses === undefined || config.validatorAddresses.length === 0) {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
validatorKeyStores.push({
|
|
74
|
+
attester: config.validatorAddresses,
|
|
75
|
+
feeRecipient: config.feeRecipient ?? AztecAddress.ZERO,
|
|
76
|
+
coinbase: config.coinbase ?? config.validatorAddresses[0],
|
|
77
|
+
remoteSigner: config.web3SignerUrl,
|
|
78
|
+
publisher: config.sequencerPublisherAddresses ?? []
|
|
79
|
+
});
|
|
80
|
+
const keyStore = {
|
|
81
|
+
schemaVersion: 1,
|
|
82
|
+
slasher: undefined,
|
|
83
|
+
prover: undefined,
|
|
84
|
+
remoteSigner: undefined,
|
|
85
|
+
validators: validatorKeyStores
|
|
86
|
+
};
|
|
87
|
+
return keyStore;
|
|
88
|
+
}
|
|
89
|
+
function createKeyStoreFromPrivateKeys(config) {
|
|
90
|
+
const validatorKeyStores = [];
|
|
91
|
+
const ethPrivateKeys = config.validatorPrivateKeys ? config.validatorPrivateKeys.getValue().map((x)=>ethPrivateKeySchema.parse(x)) : [];
|
|
92
|
+
if (!ethPrivateKeys.length) {
|
|
93
|
+
return undefined;
|
|
94
|
+
}
|
|
95
|
+
const coinbase = config.coinbase ?? EthAddress.fromString(privateKeyToAddress(ethPrivateKeys[0]));
|
|
96
|
+
const feeRecipient = config.feeRecipient ?? AztecAddress.ZERO;
|
|
97
|
+
const publisherKeys = config.sequencerPublisherPrivateKeys ? config.sequencerPublisherPrivateKeys.map((k)=>ethPrivateKeySchema.parse(k.getValue())) : [];
|
|
98
|
+
validatorKeyStores.push({
|
|
99
|
+
attester: ethPrivateKeys,
|
|
100
|
+
feeRecipient: feeRecipient,
|
|
101
|
+
coinbase: coinbase,
|
|
102
|
+
remoteSigner: undefined,
|
|
103
|
+
publisher: publisherKeys
|
|
104
|
+
});
|
|
105
|
+
const keyStore = {
|
|
106
|
+
schemaVersion: 1,
|
|
107
|
+
slasher: undefined,
|
|
108
|
+
prover: undefined,
|
|
109
|
+
remoteSigner: undefined,
|
|
110
|
+
validators: validatorKeyStores
|
|
111
|
+
};
|
|
112
|
+
return keyStore;
|
|
113
|
+
}
|
|
114
|
+
export function createKeyStoreForValidator(config) {
|
|
115
|
+
if (config.web3SignerUrl !== undefined && config.web3SignerUrl.length > 0) {
|
|
116
|
+
return createKeyStoreFromWeb3Signer(config);
|
|
117
|
+
}
|
|
118
|
+
return createKeyStoreFromPrivateKeys(config);
|
|
44
119
|
}
|
|
@@ -2,7 +2,11 @@ import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
|
2
2
|
export declare class NodeMetrics {
|
|
3
3
|
private receiveTxCount;
|
|
4
4
|
private receiveTxDuration;
|
|
5
|
+
private snapshotErrorCount;
|
|
6
|
+
private snapshotDuration;
|
|
5
7
|
constructor(client: TelemetryClient, name?: string);
|
|
6
8
|
receivedTx(durationMs: number, isAccepted: boolean): void;
|
|
9
|
+
recordSnapshot(durationMs: number): void;
|
|
10
|
+
recordSnapshotError(): void;
|
|
7
11
|
}
|
|
8
|
-
//# sourceMappingURL=
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9kZV9tZXRyaWNzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYXp0ZWMtbm9kZS9ub2RlX21ldHJpY3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUlMLEtBQUssZUFBZSxFQUdyQixNQUFNLHlCQUF5QixDQUFDO0FBRWpDLHFCQUFhLFdBQVc7SUFDdEIsT0FBTyxDQUFDLGNBQWMsQ0FBZ0I7SUFDdEMsT0FBTyxDQUFDLGlCQUFpQixDQUFZO0lBRXJDLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBZ0I7SUFDMUMsT0FBTyxDQUFDLGdCQUFnQixDQUFZO0lBRXBDLFlBQVksTUFBTSxFQUFFLGVBQWUsRUFBRSxJQUFJLFNBQWMsRUFVdEQ7SUFFRCxVQUFVLENBQUMsVUFBVSxFQUFFLE1BQU0sRUFBRSxVQUFVLEVBQUUsT0FBTyxRQU9qRDtJQUVELGNBQWMsQ0FBQyxVQUFVLEVBQUUsTUFBTSxRQU1oQztJQUVELG1CQUFtQixTQUVsQjtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node_metrics.d.ts","sourceRoot":"","sources":["../../src/aztec-node/node_metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAEjC,qBAAa,WAAW;IACtB,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,iBAAiB,CAAY;
|
|
1
|
+
{"version":3,"file":"node_metrics.d.ts","sourceRoot":"","sources":["../../src/aztec-node/node_metrics.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAEjC,qBAAa,WAAW;IACtB,OAAO,CAAC,cAAc,CAAgB;IACtC,OAAO,CAAC,iBAAiB,CAAY;IAErC,OAAO,CAAC,kBAAkB,CAAgB;IAC1C,OAAO,CAAC,gBAAgB,CAAY;IAEpC,YAAY,MAAM,EAAE,eAAe,EAAE,IAAI,SAAc,EAUtD;IAED,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,QAOjD;IAED,cAAc,CAAC,UAAU,EAAE,MAAM,QAMhC;IAED,mBAAmB,SAElB;CACF"}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import { Attributes, Metrics,
|
|
1
|
+
import { Attributes, Metrics, createUpDownCounterWithDefault } from '@aztec/telemetry-client';
|
|
2
2
|
export class NodeMetrics {
|
|
3
3
|
receiveTxCount;
|
|
4
4
|
receiveTxDuration;
|
|
5
|
+
snapshotErrorCount;
|
|
6
|
+
snapshotDuration;
|
|
5
7
|
constructor(client, name = 'AztecNode'){
|
|
6
8
|
const meter = client.getMeter(name);
|
|
7
|
-
this.receiveTxCount = meter
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
this.receiveTxCount = createUpDownCounterWithDefault(meter, Metrics.NODE_RECEIVE_TX_COUNT, {
|
|
10
|
+
[Attributes.OK]: [
|
|
11
|
+
true,
|
|
12
|
+
false
|
|
13
|
+
]
|
|
12
14
|
});
|
|
15
|
+
this.receiveTxDuration = meter.createHistogram(Metrics.NODE_RECEIVE_TX_DURATION);
|
|
16
|
+
this.snapshotDuration = meter.createHistogram(Metrics.NODE_SNAPSHOT_DURATION);
|
|
17
|
+
this.snapshotErrorCount = createUpDownCounterWithDefault(meter, Metrics.NODE_SNAPSHOT_ERROR_COUNT);
|
|
13
18
|
}
|
|
14
19
|
receivedTx(durationMs, isAccepted) {
|
|
15
20
|
this.receiveTxDuration.record(Math.ceil(durationMs), {
|
|
@@ -19,4 +24,13 @@ export class NodeMetrics {
|
|
|
19
24
|
[Attributes.OK]: isAccepted
|
|
20
25
|
});
|
|
21
26
|
}
|
|
27
|
+
recordSnapshot(durationMs) {
|
|
28
|
+
if (isNaN(durationMs)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
this.snapshotDuration.record(Math.ceil(durationMs));
|
|
32
|
+
}
|
|
33
|
+
recordSnapshotError() {
|
|
34
|
+
this.snapshotErrorCount.add(1);
|
|
35
|
+
}
|
|
22
36
|
}
|