@aztec/aztec-node 0.76.4-devnet-test-rc3 → 0.77.0-testnet-ignition.17
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 +5 -3
- package/dest/aztec-node/config.d.ts.map +1 -1
- package/dest/aztec-node/config.js +12 -7
- package/dest/aztec-node/http_rpc_server.d.ts +1 -1
- package/dest/aztec-node/http_rpc_server.d.ts.map +1 -1
- package/dest/aztec-node/http_rpc_server.js +2 -4
- package/dest/aztec-node/node_metrics.js +7 -6
- package/dest/aztec-node/server.d.ts +24 -9
- package/dest/aztec-node/server.d.ts.map +1 -1
- package/dest/aztec-node/server.js +704 -698
- package/dest/bin/index.js +7 -8
- package/dest/index.js +0 -1
- package/package.json +21 -22
- package/src/aztec-node/config.ts +11 -3
- package/src/aztec-node/http_rpc_server.ts +1 -1
- package/src/aztec-node/server.ts +67 -66
package/dest/bin/index.js
CHANGED
|
@@ -6,18 +6,18 @@ const { AZTEC_NODE_PORT = 8081, API_PREFIX = '' } = process.env;
|
|
|
6
6
|
const logger = createLogger('node');
|
|
7
7
|
/**
|
|
8
8
|
* Creates the node from provided config
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
*/ async function createAndDeployAztecNode() {
|
|
10
|
+
const aztecNodeConfig = {
|
|
11
|
+
...getConfigEnvVars()
|
|
12
|
+
};
|
|
12
13
|
return await AztecNodeService.createAndSync(aztecNodeConfig);
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Create and start a new Aztec Node HTTP Server
|
|
16
|
-
*/
|
|
17
|
-
async function main() {
|
|
17
|
+
*/ async function main() {
|
|
18
18
|
logger.info(`Setting up Aztec Node...`);
|
|
19
19
|
const aztecNode = await createAndDeployAztecNode();
|
|
20
|
-
const shutdown = async ()
|
|
20
|
+
const shutdown = async ()=>{
|
|
21
21
|
logger.info('Shutting down...');
|
|
22
22
|
await aztecNode.stop();
|
|
23
23
|
process.exit(0);
|
|
@@ -33,8 +33,7 @@ async function main() {
|
|
|
33
33
|
httpServer.listen(+AZTEC_NODE_PORT);
|
|
34
34
|
logger.info(`Aztec Node JSON-RPC Server listening on port ${AZTEC_NODE_PORT}`);
|
|
35
35
|
}
|
|
36
|
-
main().catch(err
|
|
36
|
+
main().catch((err)=>{
|
|
37
37
|
logger.error(err);
|
|
38
38
|
process.exit(1);
|
|
39
39
|
});
|
|
40
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvYmluL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQSxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFckQsT0FBTyxJQUFJLE1BQU0sTUFBTSxDQUFDO0FBRXhCLE9BQU8sRUFBd0IsZ0JBQWdCLEVBQUUsd0JBQXdCLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFFakgsTUFBTSxFQUFFLGVBQWUsR0FBRyxJQUFJLEVBQUUsVUFBVSxHQUFHLEVBQUUsRUFBRSxHQUFHLE9BQU8sQ0FBQyxHQUFHLENBQUM7QUFFaEUsTUFBTSxNQUFNLEdBQUcsWUFBWSxDQUFDLE1BQU0sQ0FBQyxDQUFDO0FBRXBDOztHQUVHO0FBQ0gsS0FBSyxVQUFVLHdCQUF3QjtJQUNyQyxNQUFNLGVBQWUsR0FBb0IsRUFBRSxHQUFHLGdCQUFnQixFQUFFLEVBQUUsQ0FBQztJQUVuRSxPQUFPLE1BQU0sZ0JBQWdCLENBQUMsYUFBYSxDQUFDLGVBQWUsQ0FBQyxDQUFDO0FBQy9ELENBQUM7QUFFRDs7R0FFRztBQUNILEtBQUssVUFBVSxJQUFJO0lBQ2pCLE1BQU0sQ0FBQyxJQUFJLENBQUMsMEJBQTBCLENBQUMsQ0FBQztJQUV4QyxNQUFNLFNBQVMsR0FBRyxNQUFNLHdCQUF3QixFQUFFLENBQUM7SUFFbkQsTUFBTSxRQUFRLEdBQUcsS0FBSyxJQUFJLEVBQUU7UUFDMUIsTUFBTSxDQUFDLElBQUksQ0FBQyxrQkFBa0IsQ0FBQyxDQUFDO1FBQ2hDLE1BQU0sU0FBUyxDQUFDLElBQUksRUFBRSxDQUFDO1FBQ3ZCLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FBQyxDQUFDLENBQUM7SUFDbEIsQ0FBQyxDQUFDO0lBRUYsa0VBQWtFO0lBQ2xFLE9BQU8sQ0FBQyxJQUFJLENBQUMsUUFBUSxFQUFFLFFBQVEsQ0FBQyxDQUFDO0lBQ2pDLGtFQUFrRTtJQUNsRSxPQUFPLENBQUMsSUFBSSxDQUFDLFNBQVMsRUFBRSxRQUFRLENBQUMsQ0FBQztJQUVsQyxNQUFNLFNBQVMsR0FBRyx3QkFBd0IsQ0FBQyxTQUFTLENBQUMsQ0FBQztJQUN0RCxNQUFNLEdBQUcsR0FBRyxTQUFTLENBQUMsTUFBTSxDQUFDLFVBQVUsQ0FBQyxDQUFDO0lBRXpDLGtFQUFrRTtJQUNsRSxNQUFNLFVBQVUsR0FBRyxJQUFJLENBQUMsWUFBWSxDQUFDLEdBQUcsQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDO0lBQ3JELFVBQVUsQ0FBQyxNQUFNLENBQUMsQ0FBQyxlQUFlLENBQUMsQ0FBQztJQUNwQyxNQUFNLENBQUMsSUFBSSxDQUFDLGdEQUFnRCxlQUFlLEVBQUUsQ0FBQyxDQUFDO0FBQ2pGLENBQUM7QUFFRCxJQUFJLEVBQUUsQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLEVBQUU7SUFDakIsTUFBTSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUNsQixPQUFPLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2xCLENBQUMsQ0FBQyxDQUFDIn0=
|
package/dest/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export * from './aztec-node/config.js';
|
|
2
2
|
export * from './aztec-node/server.js';
|
|
3
3
|
export * from './aztec-node/http_rpc_server.js';
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLHdCQUF3QixDQUFDO0FBQ3ZDLGNBQWMsaUNBQWlDLENBQUMifQ==
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec-node",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.77.0-testnet-ignition.17",
|
|
4
4
|
"main": "dest/index.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
24
24
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
25
25
|
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
26
|
-
"test": "
|
|
26
|
+
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
27
27
|
},
|
|
28
28
|
"inherits": [
|
|
29
29
|
"../package.common.json"
|
|
@@ -56,31 +56,30 @@
|
|
|
56
56
|
"reporters": [
|
|
57
57
|
"default"
|
|
58
58
|
],
|
|
59
|
-
"testTimeout":
|
|
59
|
+
"testTimeout": 120000,
|
|
60
60
|
"setupFiles": [
|
|
61
61
|
"../../foundation/src/jest/setup.mjs"
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@aztec/archiver": "0.
|
|
66
|
-
"@aztec/bb-prover": "0.
|
|
67
|
-
"@aztec/blob-sink": "0.
|
|
68
|
-
"@aztec/
|
|
69
|
-
"@aztec/
|
|
70
|
-
"@aztec/
|
|
71
|
-
"@aztec/
|
|
72
|
-
"@aztec/
|
|
73
|
-
"@aztec/
|
|
74
|
-
"@aztec/
|
|
75
|
-
"@aztec/
|
|
76
|
-
"@aztec/
|
|
77
|
-
"@aztec/
|
|
78
|
-
"@aztec/
|
|
79
|
-
"@aztec/
|
|
80
|
-
"@aztec/telemetry-client": "0.
|
|
81
|
-
"@aztec/
|
|
82
|
-
"@aztec/
|
|
83
|
-
"@aztec/world-state": "0.76.4-devnet-test-rc3",
|
|
65
|
+
"@aztec/archiver": "0.77.0-testnet-ignition.17",
|
|
66
|
+
"@aztec/bb-prover": "0.77.0-testnet-ignition.17",
|
|
67
|
+
"@aztec/blob-sink": "0.77.0-testnet-ignition.17",
|
|
68
|
+
"@aztec/constants": "0.77.0-testnet-ignition.17",
|
|
69
|
+
"@aztec/epoch-cache": "0.77.0-testnet-ignition.17",
|
|
70
|
+
"@aztec/ethereum": "0.77.0-testnet-ignition.17",
|
|
71
|
+
"@aztec/foundation": "0.77.0-testnet-ignition.17",
|
|
72
|
+
"@aztec/kv-store": "0.77.0-testnet-ignition.17",
|
|
73
|
+
"@aztec/merkle-tree": "0.77.0-testnet-ignition.17",
|
|
74
|
+
"@aztec/p2p": "0.77.0-testnet-ignition.17",
|
|
75
|
+
"@aztec/protocol-contracts": "0.77.0-testnet-ignition.17",
|
|
76
|
+
"@aztec/prover-client": "0.77.0-testnet-ignition.17",
|
|
77
|
+
"@aztec/sequencer-client": "0.77.0-testnet-ignition.17",
|
|
78
|
+
"@aztec/simulator": "0.77.0-testnet-ignition.17",
|
|
79
|
+
"@aztec/stdlib": "0.77.0-testnet-ignition.17",
|
|
80
|
+
"@aztec/telemetry-client": "0.77.0-testnet-ignition.17",
|
|
81
|
+
"@aztec/validator-client": "0.77.0-testnet-ignition.17",
|
|
82
|
+
"@aztec/world-state": "0.77.0-testnet-ignition.17",
|
|
84
83
|
"koa": "^2.14.2",
|
|
85
84
|
"koa-router": "^12.0.0",
|
|
86
85
|
"tslib": "^2.4.0"
|
package/src/aztec-node/config.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { readFileSync } from 'fs';
|
|
|
11
11
|
import { dirname, resolve } from 'path';
|
|
12
12
|
import { fileURLToPath } from 'url';
|
|
13
13
|
|
|
14
|
-
export { sequencerClientConfigMappings, SequencerClientConfig };
|
|
14
|
+
export { sequencerClientConfigMappings, type SequencerClientConfig };
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* The configuration the aztec node.
|
|
@@ -22,10 +22,13 @@ export type AztecNodeConfig = ArchiverConfig &
|
|
|
22
22
|
ProverClientConfig &
|
|
23
23
|
WorldStateConfig &
|
|
24
24
|
Pick<ProverClientConfig, 'bbBinaryPath' | 'bbWorkingDirectory' | 'realProofs'> &
|
|
25
|
-
P2PConfig &
|
|
25
|
+
P2PConfig &
|
|
26
|
+
DataStoreConfig & {
|
|
26
27
|
/** Whether the validator is disabled for this node */
|
|
27
28
|
disableValidator: boolean;
|
|
28
|
-
|
|
29
|
+
/** Whether to populate the genesis state with initial fee juice for the test accounts */
|
|
30
|
+
testAccounts: boolean;
|
|
31
|
+
};
|
|
29
32
|
|
|
30
33
|
export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
31
34
|
...archiverConfigMappings,
|
|
@@ -40,6 +43,11 @@ export const aztecNodeConfigMappings: ConfigMappingsType<AztecNodeConfig> = {
|
|
|
40
43
|
description: 'Whether the validator is disabled for this node.',
|
|
41
44
|
...booleanConfigHelper(),
|
|
42
45
|
},
|
|
46
|
+
testAccounts: {
|
|
47
|
+
env: 'TEST_ACCOUNTS',
|
|
48
|
+
description: 'Whether to populate the genesis state with initial fee juice for the test accounts.',
|
|
49
|
+
...booleanConfigHelper(),
|
|
50
|
+
},
|
|
43
51
|
};
|
|
44
52
|
|
|
45
53
|
/**
|
package/src/aztec-node/server.ts
CHANGED
|
@@ -1,68 +1,24 @@
|
|
|
1
1
|
import { createArchiver } from '@aztec/archiver';
|
|
2
2
|
import { BBCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
|
|
3
3
|
import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
4
|
-
import {
|
|
5
|
-
type AztecNode,
|
|
6
|
-
type ClientProtocolCircuitVerifier,
|
|
7
|
-
type EpochProofQuote,
|
|
8
|
-
type GetContractClassLogsResponse,
|
|
9
|
-
type GetPublicLogsResponse,
|
|
10
|
-
type InBlock,
|
|
11
|
-
type L1ToL2MessageSource,
|
|
12
|
-
type L2Block,
|
|
13
|
-
type L2BlockNumber,
|
|
14
|
-
type L2BlockSource,
|
|
15
|
-
type L2LogsSource,
|
|
16
|
-
type LogFilter,
|
|
17
|
-
MerkleTreeId,
|
|
18
|
-
NullifierMembershipWitness,
|
|
19
|
-
type NullifierWithBlockSource,
|
|
20
|
-
P2PClientType,
|
|
21
|
-
type ProverConfig,
|
|
22
|
-
PublicDataWitness,
|
|
23
|
-
PublicSimulationOutput,
|
|
24
|
-
type SequencerConfig,
|
|
25
|
-
type Service,
|
|
26
|
-
SiblingPath,
|
|
27
|
-
type Tx,
|
|
28
|
-
type TxEffect,
|
|
29
|
-
type TxHash,
|
|
30
|
-
TxReceipt,
|
|
31
|
-
type TxScopedL2Log,
|
|
32
|
-
TxStatus,
|
|
33
|
-
type TxValidationResult,
|
|
34
|
-
type WorldStateSynchronizer,
|
|
35
|
-
tryStop,
|
|
36
|
-
} from '@aztec/circuit-types';
|
|
37
4
|
import {
|
|
38
5
|
type ARCHIVE_HEIGHT,
|
|
39
|
-
type BlockHeader,
|
|
40
|
-
type ContractClassPublic,
|
|
41
|
-
type ContractDataSource,
|
|
42
|
-
type ContractInstanceWithAddress,
|
|
43
|
-
EthAddress,
|
|
44
|
-
Fr,
|
|
45
|
-
type GasFees,
|
|
46
6
|
INITIAL_L2_BLOCK_NUM,
|
|
47
7
|
type L1_TO_L2_MSG_TREE_HEIGHT,
|
|
48
8
|
type NOTE_HASH_TREE_HEIGHT,
|
|
49
9
|
type NULLIFIER_TREE_HEIGHT,
|
|
50
|
-
type NodeInfo,
|
|
51
|
-
type NullifierLeafPreimage,
|
|
52
10
|
type PUBLIC_DATA_TREE_HEIGHT,
|
|
53
|
-
type PrivateLog,
|
|
54
|
-
type ProtocolContractAddresses,
|
|
55
|
-
type PublicDataTreeLeafPreimage,
|
|
56
11
|
REGISTERER_CONTRACT_ADDRESS,
|
|
57
|
-
} from '@aztec/
|
|
58
|
-
import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/circuits.js/hash';
|
|
12
|
+
} from '@aztec/constants';
|
|
59
13
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
60
14
|
import { type L1ContractAddresses, createEthereumChain } from '@aztec/ethereum';
|
|
61
|
-
import { AztecAddress } from '@aztec/foundation/aztec-address';
|
|
62
15
|
import { compactArray } from '@aztec/foundation/collection';
|
|
16
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
17
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
63
18
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
64
19
|
import { DateProvider, Timer } from '@aztec/foundation/timer';
|
|
65
|
-
import {
|
|
20
|
+
import { SiblingPath } from '@aztec/foundation/trees';
|
|
21
|
+
import type { AztecKVStore } from '@aztec/kv-store';
|
|
66
22
|
import { openTmpStore } from '@aztec/kv-store/lmdb';
|
|
67
23
|
import { SHA256Trunc, StandardTree, UnbalancedTree } from '@aztec/merkle-tree';
|
|
68
24
|
import { type P2P, createP2PClient } from '@aztec/p2p';
|
|
@@ -76,6 +32,43 @@ import {
|
|
|
76
32
|
getDefaultAllowedSetupFunctions,
|
|
77
33
|
} from '@aztec/sequencer-client';
|
|
78
34
|
import { PublicProcessorFactory } from '@aztec/simulator/server';
|
|
35
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
36
|
+
import type { InBlock, L2Block, L2BlockNumber, L2BlockSource, NullifierWithBlockSource } from '@aztec/stdlib/block';
|
|
37
|
+
import type {
|
|
38
|
+
ContractClassPublic,
|
|
39
|
+
ContractDataSource,
|
|
40
|
+
ContractInstanceWithAddress,
|
|
41
|
+
NodeInfo,
|
|
42
|
+
ProtocolContractAddresses,
|
|
43
|
+
} from '@aztec/stdlib/contract';
|
|
44
|
+
import type { GasFees } from '@aztec/stdlib/gas';
|
|
45
|
+
import { computePublicDataTreeLeafSlot, siloNullifier } from '@aztec/stdlib/hash';
|
|
46
|
+
import type { AztecNode, GetContractClassLogsResponse, GetPublicLogsResponse } from '@aztec/stdlib/interfaces/client';
|
|
47
|
+
import {
|
|
48
|
+
type ClientProtocolCircuitVerifier,
|
|
49
|
+
type L2LogsSource,
|
|
50
|
+
type ProverConfig,
|
|
51
|
+
type SequencerConfig,
|
|
52
|
+
type Service,
|
|
53
|
+
type WorldStateSyncStatus,
|
|
54
|
+
type WorldStateSynchronizer,
|
|
55
|
+
tryStop,
|
|
56
|
+
} from '@aztec/stdlib/interfaces/server';
|
|
57
|
+
import type { LogFilter, PrivateLog, TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
58
|
+
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
59
|
+
import { P2PClientType } from '@aztec/stdlib/p2p';
|
|
60
|
+
import { MerkleTreeId, NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
|
|
61
|
+
import type { NullifierLeafPreimage, PublicDataTreeLeaf, PublicDataTreeLeafPreimage } from '@aztec/stdlib/trees';
|
|
62
|
+
import {
|
|
63
|
+
type BlockHeader,
|
|
64
|
+
PublicSimulationOutput,
|
|
65
|
+
Tx,
|
|
66
|
+
TxEffect,
|
|
67
|
+
type TxHash,
|
|
68
|
+
TxReceipt,
|
|
69
|
+
TxStatus,
|
|
70
|
+
type TxValidationResult,
|
|
71
|
+
} from '@aztec/stdlib/tx';
|
|
79
72
|
import {
|
|
80
73
|
Attributes,
|
|
81
74
|
type TelemetryClient,
|
|
@@ -123,12 +116,9 @@ export class AztecNodeService implements AztecNode, Traceable {
|
|
|
123
116
|
this.log.info(`Aztec Node started on chain 0x${l1ChainId.toString(16)}`, config.l1Contracts);
|
|
124
117
|
}
|
|
125
118
|
|
|
126
|
-
public
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
public getEpochProofQuotes(epoch: bigint): Promise<EpochProofQuote[]> {
|
|
131
|
-
return this.p2pClient.getEpochProofQuotes(epoch);
|
|
119
|
+
public async getWorldStateSyncStatus(): Promise<WorldStateSyncStatus> {
|
|
120
|
+
const status = await this.worldStateSynchronizer.status();
|
|
121
|
+
return status.syncSummary;
|
|
132
122
|
}
|
|
133
123
|
|
|
134
124
|
public getL2Tips() {
|
|
@@ -149,12 +139,15 @@ export class AztecNodeService implements AztecNode, Traceable {
|
|
|
149
139
|
dateProvider?: DateProvider;
|
|
150
140
|
blobSinkClient?: BlobSinkClientInterface;
|
|
151
141
|
} = {},
|
|
142
|
+
options: {
|
|
143
|
+
prefilledPublicData?: PublicDataTreeLeaf[];
|
|
144
|
+
} = {},
|
|
152
145
|
): Promise<AztecNodeService> {
|
|
153
146
|
const telemetry = deps.telemetry ?? getTelemetryClient();
|
|
154
147
|
const log = deps.logger ?? createLogger('node');
|
|
155
148
|
const dateProvider = deps.dateProvider ?? new DateProvider();
|
|
156
149
|
const blobSinkClient = deps.blobSinkClient ?? createBlobSinkClient(config);
|
|
157
|
-
const ethereumChain = createEthereumChain(config.
|
|
150
|
+
const ethereumChain = createEthereumChain(config.l1RpcUrls, config.l1ChainId);
|
|
158
151
|
//validate that the actual chain id matches that specified in configuration
|
|
159
152
|
if (config.l1ChainId !== ethereumChain.chainInfo.id) {
|
|
160
153
|
throw new Error(
|
|
@@ -165,7 +158,12 @@ export class AztecNodeService implements AztecNode, Traceable {
|
|
|
165
158
|
const archiver = await createArchiver(config, blobSinkClient, { blockUntilSync: true }, telemetry);
|
|
166
159
|
|
|
167
160
|
// now create the merkle trees and the world state synchronizer
|
|
168
|
-
const worldStateSynchronizer = await createWorldStateSynchronizer(
|
|
161
|
+
const worldStateSynchronizer = await createWorldStateSynchronizer(
|
|
162
|
+
config,
|
|
163
|
+
archiver,
|
|
164
|
+
options.prefilledPublicData,
|
|
165
|
+
telemetry,
|
|
166
|
+
);
|
|
169
167
|
const proofVerifier = config.realProofs ? await BBCircuitVerifier.new(config) : new TestCircuitVerifier();
|
|
170
168
|
if (!config.realProofs) {
|
|
171
169
|
log.warn(`Aztec node is accepting fake proofs`);
|
|
@@ -188,6 +186,7 @@ export class AztecNodeService implements AztecNode, Traceable {
|
|
|
188
186
|
|
|
189
187
|
// start both and wait for them to sync from the block source
|
|
190
188
|
await Promise.all([p2pClient.start(), worldStateSynchronizer.start(), slasherClient.start()]);
|
|
189
|
+
log.verbose(`All Aztec Node subsystems synced`);
|
|
191
190
|
|
|
192
191
|
const validatorClient = createValidatorClient(config, { p2pClient, telemetry, dateProvider, epochCache });
|
|
193
192
|
|
|
@@ -834,11 +833,10 @@ export class AztecNodeService implements AztecNode, Traceable {
|
|
|
834
833
|
* Returns the currently committed block header, or the initial header if no blocks have been produced.
|
|
835
834
|
* @returns The current committed block header.
|
|
836
835
|
*/
|
|
837
|
-
public async getBlockHeader(blockNumber: L2BlockNumber = 'latest'): Promise<BlockHeader> {
|
|
838
|
-
return (
|
|
839
|
-
|
|
840
|
-
this.
|
|
841
|
-
);
|
|
836
|
+
public async getBlockHeader(blockNumber: L2BlockNumber = 'latest'): Promise<BlockHeader | undefined> {
|
|
837
|
+
return blockNumber === 0 || (blockNumber === 'latest' && (await this.blockSource.getBlockNumber()) === 0)
|
|
838
|
+
? this.worldStateSynchronizer.getCommitted().getInitialHeader()
|
|
839
|
+
: this.blockSource.getBlockHeader(blockNumber);
|
|
842
840
|
}
|
|
843
841
|
|
|
844
842
|
/**
|
|
@@ -848,7 +846,7 @@ export class AztecNodeService implements AztecNode, Traceable {
|
|
|
848
846
|
@trackSpan('AztecNodeService.simulatePublicCalls', async (tx: Tx) => ({
|
|
849
847
|
[Attributes.TX_HASH]: (await tx.getTxHash()).toString(),
|
|
850
848
|
}))
|
|
851
|
-
public async simulatePublicCalls(tx: Tx,
|
|
849
|
+
public async simulatePublicCalls(tx: Tx, skipFeeEnforcement = false): Promise<PublicSimulationOutput> {
|
|
852
850
|
const txHash = await tx.getTxHash();
|
|
853
851
|
const blockNumber = (await this.blockSource.getBlockNumber()) + 1;
|
|
854
852
|
|
|
@@ -875,7 +873,7 @@ export class AztecNodeService implements AztecNode, Traceable {
|
|
|
875
873
|
});
|
|
876
874
|
|
|
877
875
|
try {
|
|
878
|
-
const processor = publicProcessorFactory.create(fork, newGlobalVariables,
|
|
876
|
+
const processor = publicProcessorFactory.create(fork, newGlobalVariables, skipFeeEnforcement);
|
|
879
877
|
|
|
880
878
|
// REFACTOR: Consider merging ProcessReturnValues into ProcessedTx
|
|
881
879
|
const [processedTxs, failedTxs, returns] = await processor.process([tx]);
|
|
@@ -898,16 +896,19 @@ export class AztecNodeService implements AztecNode, Traceable {
|
|
|
898
896
|
}
|
|
899
897
|
}
|
|
900
898
|
|
|
901
|
-
public async isValidTx(
|
|
899
|
+
public async isValidTx(
|
|
900
|
+
tx: Tx,
|
|
901
|
+
{ isSimulation, skipFeeEnforcement }: { isSimulation?: boolean; skipFeeEnforcement?: boolean } = {},
|
|
902
|
+
): Promise<TxValidationResult> {
|
|
902
903
|
const blockNumber = (await this.blockSource.getBlockNumber()) + 1;
|
|
903
904
|
const db = this.worldStateSynchronizer.getCommitted();
|
|
904
905
|
const verifier = isSimulation ? undefined : this.proofVerifier;
|
|
905
906
|
const validator = createValidatorForAcceptingTxs(db, this.contractDataSource, verifier, {
|
|
906
907
|
blockNumber,
|
|
907
908
|
l1ChainId: this.l1ChainId,
|
|
908
|
-
enforceFees: !!this.config.enforceFees,
|
|
909
909
|
setupAllowList: this.config.allowedInSetup ?? (await getDefaultAllowedSetupFunctions()),
|
|
910
910
|
gasFees: await this.getCurrentBaseFees(),
|
|
911
|
+
skipFeeEnforcement,
|
|
911
912
|
});
|
|
912
913
|
|
|
913
914
|
return await validator.validateTx(tx);
|