@aztec/end-to-end 3.0.0-nightly.20250925 → 3.0.0-nightly.20250927
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/bench/client_flows/client_flows_benchmark.d.ts +0 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +2 -3
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +3 -3
- package/dest/fixtures/e2e_prover_test.js +2 -2
- package/dest/fixtures/setup_p2p_test.d.ts +4 -0
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +37 -20
- package/dest/fixtures/snapshot_manager.js +3 -3
- package/dest/fixtures/utils.d.ts +4 -4
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +11 -11
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +42 -0
- package/package.json +37 -37
- package/src/bench/client_flows/client_flows_benchmark.ts +3 -5
- package/src/e2e_p2p/shared.ts +3 -11
- package/src/fixtures/e2e_prover_test.ts +2 -2
- package/src/fixtures/setup_p2p_test.ts +53 -16
- package/src/fixtures/snapshot_manager.ts +3 -3
- package/src/fixtures/utils.ts +12 -12
- package/src/fixtures/web3signer.ts +46 -0
|
@@ -37,7 +37,6 @@ export declare class ClientFlowsBenchmark {
|
|
|
37
37
|
liquidityToken: TokenContract;
|
|
38
38
|
sponsoredFPC: SponsoredFPCContract;
|
|
39
39
|
userWallet: TestWallet;
|
|
40
|
-
private userPXE;
|
|
41
40
|
realProofs: boolean;
|
|
42
41
|
paymentMethods: Record<BenchmarkingFeePaymentMethod, {
|
|
43
42
|
forWallet: FeePaymentMethodGetter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EACd,qBAAqB,EACrB,8BAA8B,EAC9B,KAAK,gBAAgB,EACrB,KAAK,MAAM,
|
|
1
|
+
{"version":3,"file":"client_flows_benchmark.d.ts","sourceRoot":"","sources":["../../../src/bench/client_flows/client_flows_benchmark.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EACd,qBAAqB,EACrB,8BAA8B,EAC9B,KAAK,gBAAgB,EACrB,KAAK,MAAM,EACX,uBAAuB,EACvB,yBAAyB,EACzB,KAAK,MAAM,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,KAAK,qBAAqB,EAA4D,MAAM,iBAAiB,CAAC;AACvH,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAK5F,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,yCAAyC,CAA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qBAAqB,CAAM;IAazF,KAAK;IAUL,QAAQ;IAKR,qBAAqB,CAAC,OAAO,EAAE,YAAY;IASjD,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAa9D,gCAAgC,CAAC,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,GAAG,SAAS;IAgBnE,kBAAkB;IAKzB,4BAA4B;IAkC5B,0BAA0B;IAoB1B,8BAA8B;IAgB9B,gCAAgC;IAgBzB,qBAAqB;IAwB5B,+BAA+B;IAcxB,2BAA2B,CAAC,KAAK,EAAE,YAAY;IAwB/C,4CAA4C,CAAC,WAAW,EAAE,WAAW;IAgBrE,sBAAsB;IA0BtB,wCAAwC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;IAKpF,mCAAmC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;IAIxE,qCAAqC,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAI5E,iCAAiC,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY;CAG/E"}
|
|
@@ -13,7 +13,7 @@ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
|
13
13
|
import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
14
14
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
15
15
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
16
|
-
import {
|
|
16
|
+
import { getPXEConfig } from '@aztec/pxe/server';
|
|
17
17
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
18
18
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
19
19
|
import { MNEMONIC } from '../../fixtures/fixtures.js';
|
|
@@ -54,7 +54,6 @@ export class ClientFlowsBenchmark {
|
|
|
54
54
|
sponsoredFPC;
|
|
55
55
|
// PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
|
|
56
56
|
userWallet;
|
|
57
|
-
userPXE;
|
|
58
57
|
realProofs = [
|
|
59
58
|
'true',
|
|
60
59
|
'1'
|
|
@@ -157,7 +156,7 @@ export class ClientFlowsBenchmark {
|
|
|
157
156
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
158
157
|
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
159
158
|
this.coinbase = EthAddress.random();
|
|
160
|
-
const userPXEConfig =
|
|
159
|
+
const userPXEConfig = getPXEConfig();
|
|
161
160
|
const userPXEConfigWithContracts = {
|
|
162
161
|
...userPXEConfig,
|
|
163
162
|
proverEnabled: this.realProofs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,YAAY,EAEZ,KAAK,MAAM,EACX,QAAQ,EACR,KAAK,MAAM,EAIZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,8BAA8B,EAAE,cAAc,EAAE,6BAA6B,EAAE,MAAM,iBAAiB,CAAC;AAGrH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAIvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAMvE,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,MAAM,EACd,MAAM,YAAY,EAClB,cAAc,YAAY,EAC1B,QAAQ,MAAM,EACd,OAAM;IAAE,UAAU,CAAC,EAAE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package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Fr, TxStatus, getContractInstanceFromInstantiationParams, retryUntil }
|
|
|
2
2
|
import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
3
3
|
import { pluralize } from '@aztec/foundation/string';
|
|
4
4
|
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
5
|
-
import {
|
|
5
|
+
import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
6
6
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
7
7
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
8
8
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
@@ -32,7 +32,7 @@ export const submitTransactions = async (logger, node, numTxs, fundedAccount)=>{
|
|
|
32
32
|
const rpcConfig = getRpcConfig();
|
|
33
33
|
rpcConfig.proverEnabled = false;
|
|
34
34
|
const wallet = await TestWallet.create(node, {
|
|
35
|
-
...
|
|
35
|
+
...getPXEConfig(),
|
|
36
36
|
proverEnabled: false
|
|
37
37
|
}, {
|
|
38
38
|
useLogSuffix: true
|
|
@@ -44,7 +44,7 @@ export async function prepareTransactions(logger, node, numTxs, fundedAccount) {
|
|
|
44
44
|
const rpcConfig = getRpcConfig();
|
|
45
45
|
rpcConfig.proverEnabled = false;
|
|
46
46
|
const wallet = await TestWallet.create(node, {
|
|
47
|
-
...
|
|
47
|
+
...getPXEConfig(),
|
|
48
48
|
proverEnabled: false
|
|
49
49
|
}, {
|
|
50
50
|
useLogSuffix: true
|
|
@@ -14,7 +14,7 @@ import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
|
14
14
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
15
15
|
import { getBBConfig } from './get_bb_config.js';
|
|
16
16
|
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from './snapshot_manager.js';
|
|
17
|
-
import { getPrivateKeyFromIndex, getSponsoredFPCAddress,
|
|
17
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEAndGetWallet } from './utils.js';
|
|
18
18
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
19
19
|
/**
|
|
20
20
|
* Largely taken from the e2e_token_contract test file. We deploy 2 accounts and a token contract.
|
|
@@ -144,7 +144,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
144
144
|
await this.context.cheatCodes.rollup.markAsProven();
|
|
145
145
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
146
146
|
for(let i = 0; i < 2; i++){
|
|
147
|
-
const { wallet: provenWallet, teardown: provenTeardown } = await
|
|
147
|
+
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(this.aztecNode, {
|
|
148
148
|
proverEnabled: this.realProofs,
|
|
149
149
|
bbBinaryPath: bbConfig?.bbBinaryPath,
|
|
150
150
|
bbWorkingDirectory: bbConfig?.bbWorkingDirectory
|
|
@@ -11,9 +11,13 @@ export declare function generatePrivateKeys(startIndex: number, numberOfKeys: nu
|
|
|
11
11
|
export declare function createNodes(config: AztecNodeConfig & {
|
|
12
12
|
dontStartSequencer?: boolean;
|
|
13
13
|
}, dateProvider: DateProvider, bootstrapNodeEnr: string, numNodes: number, bootNodePort: number, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, indexOffset?: number): Promise<AztecNodeService[]>;
|
|
14
|
+
/** Creates a P2P enabled instance of Aztec Node Service with a validator */
|
|
14
15
|
export declare function createNode(config: AztecNodeConfig & {
|
|
15
16
|
dontStartSequencer?: boolean;
|
|
16
17
|
}, dateProvider: DateProvider, tcpPort: number, bootstrapNode: string | undefined, addressIndex: number, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<AztecNodeService>;
|
|
18
|
+
/** Creates a P2P enabled instance of Aztec Node Service without a validator */
|
|
19
|
+
export declare function createNonValidatorNode(baseConfig: AztecNodeConfig, dateProvider: DateProvider, tcpPort: number, bootstrapNode: string | undefined, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<AztecNodeService>;
|
|
17
20
|
export declare function createProverNode(config: AztecNodeConfig, tcpPort: number, bootstrapNode: string | undefined, addressIndex: number, proverNodeDeps: ProverNodeDeps & Required<Pick<ProverNodeDeps, 'dateProvider'>>, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<import("@aztec/prover-node").ProverNode>;
|
|
21
|
+
export declare function createP2PConfig(config: AztecNodeConfig, bootstrapNodeEnr?: string, port?: number, dataDirectory?: string): Promise<AztecNodeConfig>;
|
|
18
22
|
export declare function createValidatorConfig(config: AztecNodeConfig, bootstrapNodeEnr?: string, port?: number, addressIndex?: number, dataDirectory?: string): Promise<AztecNodeConfig>;
|
|
19
23
|
//# sourceMappingURL=setup_p2p_test.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_p2p_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/setup_p2p_test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AASrD,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,EAAE,CAO7F;AAED,wBAAsB,WAA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E,MAAM,4BAgBvB;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,eAAe,EACvB,gBAAgB,CAAC,EAAE,MAAM,EACzB,IAAI,CAAC,EAAE,MAAM,EACb,YAAY,GAAE,MAAU,EACxB,aAAa,CAAC,EAAE,MAAM,4BAYvB"}
|
|
@@ -43,8 +43,7 @@ export async function createNodes(config, dateProvider, bootstrapNodeEnr, numNod
|
|
|
43
43
|
removeLogNameHandler(logNameHandler);
|
|
44
44
|
return nodes;
|
|
45
45
|
}
|
|
46
|
-
|
|
47
|
-
export async function createNode(config, dateProvider, tcpPort, bootstrapNode, addressIndex, prefilledPublicData, dataDirectory, metricsPort, loggerIdStorage) {
|
|
46
|
+
/** Creates a P2P enabled instance of Aztec Node Service with a validator */ export async function createNode(config, dateProvider, tcpPort, bootstrapNode, addressIndex, prefilledPublicData, dataDirectory, metricsPort, loggerIdStorage) {
|
|
48
47
|
const createNode = async ()=>{
|
|
49
48
|
const validatorConfig = await createValidatorConfig(config, bootstrapNode, tcpPort, addressIndex, dataDirectory);
|
|
50
49
|
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
@@ -58,20 +57,30 @@ export async function createNode(config, dateProvider, tcpPort, bootstrapNode, a
|
|
|
58
57
|
};
|
|
59
58
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
60
59
|
}
|
|
60
|
+
/** Creates a P2P enabled instance of Aztec Node Service without a validator */ export async function createNonValidatorNode(baseConfig, dateProvider, tcpPort, bootstrapNode, prefilledPublicData, dataDirectory, metricsPort, loggerIdStorage) {
|
|
61
|
+
const createNode = async ()=>{
|
|
62
|
+
const p2pConfig = await createP2PConfig(baseConfig, bootstrapNode, tcpPort, dataDirectory);
|
|
63
|
+
const config = {
|
|
64
|
+
...p2pConfig,
|
|
65
|
+
disableValidator: true,
|
|
66
|
+
validatorPrivateKeys: undefined,
|
|
67
|
+
publisherPrivateKeys: []
|
|
68
|
+
};
|
|
69
|
+
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
70
|
+
return await AztecNodeService.createAndSync(config, {
|
|
71
|
+
telemetry,
|
|
72
|
+
dateProvider
|
|
73
|
+
}, {
|
|
74
|
+
prefilledPublicData
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
78
|
+
}
|
|
61
79
|
export async function createProverNode(config, tcpPort, bootstrapNode, addressIndex, proverNodeDeps, prefilledPublicData, dataDirectory, metricsPort, loggerIdStorage) {
|
|
62
80
|
const createProverNode = async ()=>{
|
|
63
81
|
const proverNodePrivateKey = getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex);
|
|
64
82
|
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
65
|
-
const proverConfig =
|
|
66
|
-
p2pIp: `127.0.0.1`,
|
|
67
|
-
p2pPort: tcpPort ?? await getPort(),
|
|
68
|
-
p2pEnabled: true,
|
|
69
|
-
peerCheckIntervalMS: TEST_PEER_CHECK_INTERVAL_MS,
|
|
70
|
-
blockCheckIntervalMS: 1000,
|
|
71
|
-
bootstrapNodes: bootstrapNode ? [
|
|
72
|
-
bootstrapNode
|
|
73
|
-
] : []
|
|
74
|
-
};
|
|
83
|
+
const proverConfig = await createP2PConfig(config, bootstrapNode, tcpPort, dataDirectory);
|
|
75
84
|
const aztecNodeRpcTxProvider = undefined;
|
|
76
85
|
return await createAndSyncProverNode(bufferToHex(proverNodePrivateKey), config, {
|
|
77
86
|
...proverConfig,
|
|
@@ -83,15 +92,8 @@ export async function createProverNode(config, tcpPort, bootstrapNode, addressIn
|
|
|
83
92
|
};
|
|
84
93
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createProverNode) : createProverNode();
|
|
85
94
|
}
|
|
86
|
-
export async function
|
|
95
|
+
export async function createP2PConfig(config, bootstrapNodeEnr, port, dataDirectory) {
|
|
87
96
|
port = port ?? await getPort();
|
|
88
|
-
const attesterPrivateKey = bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex));
|
|
89
|
-
config.validatorPrivateKeys = new SecretValue([
|
|
90
|
-
attesterPrivateKey
|
|
91
|
-
]);
|
|
92
|
-
config.publisherPrivateKeys = [
|
|
93
|
-
new SecretValue(attesterPrivateKey)
|
|
94
|
-
];
|
|
95
97
|
const nodeConfig = {
|
|
96
98
|
...config,
|
|
97
99
|
p2pIp: `127.0.0.1`,
|
|
@@ -106,3 +108,18 @@ export async function createValidatorConfig(config, bootstrapNodeEnr, port, addr
|
|
|
106
108
|
};
|
|
107
109
|
return nodeConfig;
|
|
108
110
|
}
|
|
111
|
+
export async function createValidatorConfig(config, bootstrapNodeEnr, port, addressIndex = 1, dataDirectory) {
|
|
112
|
+
const attesterPrivateKey = bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex));
|
|
113
|
+
const p2pConfig = await createP2PConfig(config, bootstrapNodeEnr, port, dataDirectory);
|
|
114
|
+
const nodeConfig = {
|
|
115
|
+
...config,
|
|
116
|
+
...p2pConfig,
|
|
117
|
+
validatorPrivateKeys: new SecretValue([
|
|
118
|
+
attesterPrivateKey
|
|
119
|
+
]),
|
|
120
|
+
publisherPrivateKeys: [
|
|
121
|
+
new SecretValue(attesterPrivateKey)
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
return nodeConfig;
|
|
125
|
+
}
|
|
@@ -14,7 +14,7 @@ import { tryRmDir } from '@aztec/foundation/fs';
|
|
|
14
14
|
import { createLogger } from '@aztec/foundation/log';
|
|
15
15
|
import { resolver, reviver } from '@aztec/foundation/serialize';
|
|
16
16
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
17
|
-
import {
|
|
17
|
+
import { getPXEConfig } from '@aztec/pxe/server';
|
|
18
18
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
19
19
|
import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
20
20
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
@@ -326,7 +326,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
326
326
|
}, aztecNode, prefilledPublicData);
|
|
327
327
|
}
|
|
328
328
|
logger.verbose('Creating pxe...');
|
|
329
|
-
const pxeConfig =
|
|
329
|
+
const pxeConfig = getPXEConfig();
|
|
330
330
|
pxeConfig.dataDirectory = statePath ?? path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
331
331
|
// Only enable proving if specifically requested.
|
|
332
332
|
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
@@ -425,7 +425,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
425
425
|
}, aztecNode, prefilledPublicData);
|
|
426
426
|
}
|
|
427
427
|
logger.verbose('Creating pxe...');
|
|
428
|
-
const pxeConfig =
|
|
428
|
+
const pxeConfig = getPXEConfig();
|
|
429
429
|
pxeConfig.dataDirectory = statePath;
|
|
430
430
|
const wallet = await TestWallet.create(aztecNode, pxeConfig);
|
|
431
431
|
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode, dateProvider);
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { TestDateProvider } from '@aztec/foundation/timer';
|
|
|
11
11
|
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
12
12
|
import { MockGossipSubNetwork } from '@aztec/p2p/test-helpers';
|
|
13
13
|
import { type ProverNode, type ProverNodeConfig, type ProverNodeDeps } from '@aztec/prover-node';
|
|
14
|
-
import { type
|
|
14
|
+
import { type PXEConfig } from '@aztec/pxe/server';
|
|
15
15
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
16
16
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
17
17
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
@@ -26,12 +26,12 @@ export declare const setupL1Contracts: (l1RpcUrls: string[], account: HDAccount
|
|
|
26
26
|
/**
|
|
27
27
|
* Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
|
|
28
28
|
* @param aztecNode - An instance of Aztec Node.
|
|
29
|
-
* @param opts - Partial configuration for the PXE
|
|
29
|
+
* @param opts - Partial configuration for the PXE.
|
|
30
30
|
* @param logger - The logger to be used.
|
|
31
31
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
32
32
|
* @returns A test wallet, logger and teardown function.
|
|
33
33
|
*/
|
|
34
|
-
export declare function
|
|
34
|
+
export declare function setupPXEAndGetWallet(aztecNode: AztecNode, opts?: Partial<PXEConfig>, logger?: Logger, useLogSuffix?: boolean): Promise<{
|
|
35
35
|
/**
|
|
36
36
|
* The wallet instance.
|
|
37
37
|
*/
|
|
@@ -143,7 +143,7 @@ export type EndToEndContext = {
|
|
|
143
143
|
* @param opts - Options to pass to the node initialization and to the setup script.
|
|
144
144
|
* @param pxeOpts - Options to pass to the PXE initialization.
|
|
145
145
|
*/
|
|
146
|
-
export declare function setup(numberOfAccounts?: number, opts?: SetupOptions, pxeOpts?: Partial<
|
|
146
|
+
export declare function setup(numberOfAccounts?: number, opts?: SetupOptions, pxeOpts?: Partial<PXEConfig>, chain?: Chain): Promise<EndToEndContext>;
|
|
147
147
|
/**
|
|
148
148
|
* Registers the contract class used for test accounts and publicly deploys the instances requested.
|
|
149
149
|
* Use this when you need to make a public call to an account contract, such as for requesting a public authwit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAuD,MAAM,yBAAyB,CAAC;AAEvH,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAEd,KAAK,c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oot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
|
23
23
|
import { MockGossipSubNetwork, getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
24
24
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
25
25
|
import { createProverNode } from '@aztec/prover-node';
|
|
26
|
-
import {
|
|
26
|
+
import { getPXEConfig } from '@aztec/pxe/server';
|
|
27
27
|
import { getContractClassFromArtifact, getContractInstanceFromInstantiationParams } from '@aztec/stdlib/contract';
|
|
28
28
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
29
29
|
import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
@@ -84,24 +84,24 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
84
84
|
/**
|
|
85
85
|
* Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
|
|
86
86
|
* @param aztecNode - An instance of Aztec Node.
|
|
87
|
-
* @param opts - Partial configuration for the PXE
|
|
87
|
+
* @param opts - Partial configuration for the PXE.
|
|
88
88
|
* @param logger - The logger to be used.
|
|
89
89
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
90
90
|
* @returns A test wallet, logger and teardown function.
|
|
91
|
-
*/ export async function
|
|
92
|
-
const
|
|
93
|
-
...
|
|
91
|
+
*/ export async function setupPXEAndGetWallet(aztecNode, opts = {}, logger = getLogger(), useLogSuffix = false) {
|
|
92
|
+
const PXEConfig = {
|
|
93
|
+
...getPXEConfig(),
|
|
94
94
|
...opts
|
|
95
95
|
};
|
|
96
96
|
// For tests we only want proving enabled if specifically requested
|
|
97
|
-
|
|
97
|
+
PXEConfig.proverEnabled = !!opts.proverEnabled;
|
|
98
98
|
// If no data directory provided, create a temp directory and clean up afterwards
|
|
99
|
-
const configuredDataDirectory =
|
|
99
|
+
const configuredDataDirectory = PXEConfig.dataDirectory;
|
|
100
100
|
if (!configuredDataDirectory) {
|
|
101
|
-
|
|
101
|
+
PXEConfig.dataDirectory = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
102
102
|
}
|
|
103
|
-
const teardown = configuredDataDirectory ? ()=>Promise.resolve() : ()=>tryRmDir(
|
|
104
|
-
const wallet = await TestWallet.create(aztecNode,
|
|
103
|
+
const teardown = configuredDataDirectory ? ()=>Promise.resolve() : ()=>tryRmDir(PXEConfig.dataDirectory);
|
|
104
|
+
const wallet = await TestWallet.create(aztecNode, PXEConfig, {
|
|
105
105
|
useLogSuffix
|
|
106
106
|
});
|
|
107
107
|
return {
|
|
@@ -397,7 +397,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
397
397
|
proverNode = await createAndSyncProverNode(proverNodePrivateKeyHex, config, proverNodeConfig, aztecNode, prefilledPublicData);
|
|
398
398
|
}
|
|
399
399
|
logger.verbose('Creating a pxe...');
|
|
400
|
-
const { wallet, teardown: pxeTeardown } = await
|
|
400
|
+
const { wallet, teardown: pxeTeardown } = await setupPXEAndGetWallet(aztecNode, pxeOpts, logger);
|
|
401
401
|
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode, dateProvider);
|
|
402
402
|
if (opts.aztecTargetCommitteeSize && opts.aztecTargetCommitteeSize > 0 || opts.initialValidators && opts.initialValidators.length > 0) {
|
|
403
403
|
// We need to advance such that the committee is set up.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function createWeb3SignerKeystore(dir: string, ...privateKeys: string[]): Promise<void>;
|
|
2
|
+
export declare function refreshWeb3Signer(url: string): Promise<void>;
|
|
3
|
+
export declare function getWeb3SignerTestKeystoreDir(): string;
|
|
4
|
+
export declare function getWeb3SignerUrl(): string;
|
|
5
|
+
//# sourceMappingURL=web3signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web3signer.d.ts","sourceRoot":"","sources":["../../src/fixtures/web3signer.ts"],"names":[],"mappings":"AAOA,wBAAsB,wBAAwB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE,MAAM,EAAE,iBAcnF;AAED,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,iBAKlD;AAED,wBAAgB,4BAA4B,IAAI,MAAM,CAOrD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAMzC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { sleep } from '@aztec/aztec.js';
|
|
2
|
+
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
import { mkdirSync } from 'node:fs';
|
|
4
|
+
import { writeFile } from 'node:fs/promises';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
export async function createWeb3SignerKeystore(dir, ...privateKeys) {
|
|
7
|
+
const yaml = privateKeys.map((pk)=>`\
|
|
8
|
+
type: file-raw
|
|
9
|
+
keyType: SECP256K1
|
|
10
|
+
privateKey: ${pk}`).join('\n---\n');
|
|
11
|
+
// NOTE: nodejs stdlib can only create temp directories, not temp files!
|
|
12
|
+
// this write uses wx (write-exclusive) so it'll throw if the file already exists
|
|
13
|
+
const path = join(dir, `keystore-${randomBytes(4).toString('hex')}.yaml`);
|
|
14
|
+
await writeFile(path, yaml, {
|
|
15
|
+
flag: 'wx'
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export async function refreshWeb3Signer(url) {
|
|
19
|
+
await fetch(new URL('reload', url), {
|
|
20
|
+
method: 'POST'
|
|
21
|
+
});
|
|
22
|
+
// give the service a chance to load up the new files
|
|
23
|
+
// 1s might not be enough if there are a lot of files to scan
|
|
24
|
+
await sleep(1000);
|
|
25
|
+
}
|
|
26
|
+
export function getWeb3SignerTestKeystoreDir() {
|
|
27
|
+
if (process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR) {
|
|
28
|
+
mkdirSync(process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR, {
|
|
29
|
+
recursive: true
|
|
30
|
+
});
|
|
31
|
+
return process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR;
|
|
32
|
+
} else {
|
|
33
|
+
throw new Error('Web3signer not running');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
export function getWeb3SignerUrl() {
|
|
37
|
+
if (process.env.WEB3_SIGNER_URL) {
|
|
38
|
+
return process.env.WEB3_SIGNER_URL;
|
|
39
|
+
} else {
|
|
40
|
+
throw new Error('Web3signer not running');
|
|
41
|
+
}
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250927",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,42 +25,42 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "3.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
46
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
47
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
48
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
51
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
52
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
53
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
55
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
56
|
-
"@aztec/sequencer-client": "3.0.0-nightly.
|
|
57
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
58
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
59
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
60
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
61
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
62
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
63
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "3.0.0-nightly.20250927",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20250927",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20250927",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20250927",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250927",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250927",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250927",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-nightly.20250927",
|
|
36
|
+
"@aztec/bot": "3.0.0-nightly.20250927",
|
|
37
|
+
"@aztec/cli": "3.0.0-nightly.20250927",
|
|
38
|
+
"@aztec/constants": "3.0.0-nightly.20250927",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250927",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20250927",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-nightly.20250927",
|
|
42
|
+
"@aztec/foundation": "3.0.0-nightly.20250927",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-nightly.20250927",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250927",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20250927",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-nightly.20250927",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250927",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250927",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250927",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250927",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20250927",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250927",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-nightly.20250927",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-nightly.20250927",
|
|
55
|
+
"@aztec/pxe": "3.0.0-nightly.20250927",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20250927",
|
|
57
|
+
"@aztec/simulator": "3.0.0-nightly.20250927",
|
|
58
|
+
"@aztec/slasher": "3.0.0-nightly.20250927",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-nightly.20250927",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20250927",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250927",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-nightly.20250927",
|
|
63
|
+
"@aztec/world-state": "3.0.0-nightly.20250927",
|
|
64
64
|
"@iarna/toml": "^2.2.5",
|
|
65
65
|
"@jest/globals": "^30.0.0",
|
|
66
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
FeeJuicePaymentMethodWithClaim,
|
|
6
6
|
type FeePaymentMethod,
|
|
7
7
|
type Logger,
|
|
8
|
-
type PXE,
|
|
9
8
|
PrivateFeePaymentMethod,
|
|
10
9
|
SponsoredFeePaymentMethod,
|
|
11
10
|
type Wallet,
|
|
@@ -26,7 +25,7 @@ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
|
26
25
|
import { TokenContract as BananaCoin, TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
27
26
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
28
27
|
import { getCanonicalFeeJuice } from '@aztec/protocol-contracts/fee-juice';
|
|
29
|
-
import { type
|
|
28
|
+
import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
30
29
|
import { deriveSigningKey } from '@aztec/stdlib/keys';
|
|
31
30
|
import { TestWallet } from '@aztec/test-wallet/server';
|
|
32
31
|
|
|
@@ -87,7 +86,6 @@ export class ClientFlowsBenchmark {
|
|
|
87
86
|
|
|
88
87
|
// PXE and Wallet used by the benchmarking user. It can be set up with client-side proving enabled
|
|
89
88
|
public userWallet!: TestWallet;
|
|
90
|
-
private userPXE!: PXE;
|
|
91
89
|
|
|
92
90
|
public realProofs = ['true', '1'].includes(process.env.REAL_PROOFS ?? '');
|
|
93
91
|
|
|
@@ -214,11 +212,11 @@ export class ClientFlowsBenchmark {
|
|
|
214
212
|
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.adminWallet);
|
|
215
213
|
this.coinbase = EthAddress.random();
|
|
216
214
|
|
|
217
|
-
const userPXEConfig =
|
|
215
|
+
const userPXEConfig = getPXEConfig();
|
|
218
216
|
const userPXEConfigWithContracts = {
|
|
219
217
|
...userPXEConfig,
|
|
220
218
|
proverEnabled: this.realProofs,
|
|
221
|
-
} as
|
|
219
|
+
} as PXEConfig;
|
|
222
220
|
|
|
223
221
|
this.userWallet = await TestWallet.create(this.aztecNode, userPXEConfigWithContracts, {
|
|
224
222
|
loggers: {
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
|
16
16
|
import { pluralize } from '@aztec/foundation/string';
|
|
17
17
|
import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
18
18
|
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
19
|
-
import {
|
|
19
|
+
import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
20
20
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
21
21
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
22
22
|
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
@@ -63,11 +63,7 @@ export const submitTransactions = async (
|
|
|
63
63
|
): Promise<SentTx[]> => {
|
|
64
64
|
const rpcConfig = getRpcConfig();
|
|
65
65
|
rpcConfig.proverEnabled = false;
|
|
66
|
-
const wallet = await TestWallet.create(
|
|
67
|
-
node,
|
|
68
|
-
{ ...getPXEServiceConfig(), proverEnabled: false },
|
|
69
|
-
{ useLogSuffix: true },
|
|
70
|
-
);
|
|
66
|
+
const wallet = await TestWallet.create(node, { ...getPXEConfig(), proverEnabled: false }, { useLogSuffix: true });
|
|
71
67
|
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
72
68
|
return submitTxsTo(wallet, fundedAccountManager.getAddress(), numTxs, logger);
|
|
73
69
|
};
|
|
@@ -81,11 +77,7 @@ export async function prepareTransactions(
|
|
|
81
77
|
const rpcConfig = getRpcConfig();
|
|
82
78
|
rpcConfig.proverEnabled = false;
|
|
83
79
|
|
|
84
|
-
const wallet = await TestWallet.create(
|
|
85
|
-
node,
|
|
86
|
-
{ ...getPXEServiceConfig(), proverEnabled: false },
|
|
87
|
-
{ useLogSuffix: true },
|
|
88
|
-
);
|
|
80
|
+
const wallet = await TestWallet.create(node, { ...getPXEConfig(), proverEnabled: false }, { useLogSuffix: true });
|
|
89
81
|
const fundedAccountManager = await wallet.createSchnorrAccount(fundedAccount.secret, fundedAccount.salt);
|
|
90
82
|
|
|
91
83
|
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
deployAccounts,
|
|
34
34
|
publicDeployAccounts,
|
|
35
35
|
} from './snapshot_manager.js';
|
|
36
|
-
import { getPrivateKeyFromIndex, getSponsoredFPCAddress,
|
|
36
|
+
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEAndGetWallet } from './utils.js';
|
|
37
37
|
|
|
38
38
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
39
39
|
|
|
@@ -208,7 +208,7 @@ export class FullProverTest {
|
|
|
208
208
|
|
|
209
209
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
210
210
|
for (let i = 0; i < 2; i++) {
|
|
211
|
-
const { wallet: provenWallet, teardown: provenTeardown } = await
|
|
211
|
+
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(
|
|
212
212
|
this.aztecNode,
|
|
213
213
|
{
|
|
214
214
|
proverEnabled: this.realProofs,
|
|
@@ -78,7 +78,7 @@ export async function createNodes(
|
|
|
78
78
|
return nodes;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
|
|
81
|
+
/** Creates a P2P enabled instance of Aztec Node Service with a validator */
|
|
82
82
|
export async function createNode(
|
|
83
83
|
config: AztecNodeConfig & { dontStartSequencer?: boolean },
|
|
84
84
|
dateProvider: DateProvider,
|
|
@@ -102,6 +102,31 @@ export async function createNode(
|
|
|
102
102
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
103
103
|
}
|
|
104
104
|
|
|
105
|
+
/** Creates a P2P enabled instance of Aztec Node Service without a validator */
|
|
106
|
+
export async function createNonValidatorNode(
|
|
107
|
+
baseConfig: AztecNodeConfig,
|
|
108
|
+
dateProvider: DateProvider,
|
|
109
|
+
tcpPort: number,
|
|
110
|
+
bootstrapNode: string | undefined,
|
|
111
|
+
prefilledPublicData?: PublicDataTreeLeaf[],
|
|
112
|
+
dataDirectory?: string,
|
|
113
|
+
metricsPort?: number,
|
|
114
|
+
loggerIdStorage?: AsyncLocalStorage<string>,
|
|
115
|
+
) {
|
|
116
|
+
const createNode = async () => {
|
|
117
|
+
const p2pConfig = await createP2PConfig(baseConfig, bootstrapNode, tcpPort, dataDirectory);
|
|
118
|
+
const config: AztecNodeConfig = {
|
|
119
|
+
...p2pConfig,
|
|
120
|
+
disableValidator: true,
|
|
121
|
+
validatorPrivateKeys: undefined,
|
|
122
|
+
publisherPrivateKeys: [],
|
|
123
|
+
};
|
|
124
|
+
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
125
|
+
return await AztecNodeService.createAndSync(config, { telemetry, dateProvider }, { prefilledPublicData });
|
|
126
|
+
};
|
|
127
|
+
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
128
|
+
}
|
|
129
|
+
|
|
105
130
|
export async function createProverNode(
|
|
106
131
|
config: AztecNodeConfig,
|
|
107
132
|
tcpPort: number,
|
|
@@ -117,14 +142,13 @@ export async function createProverNode(
|
|
|
117
142
|
const proverNodePrivateKey = getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!;
|
|
118
143
|
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
119
144
|
|
|
120
|
-
const proverConfig: Partial<ProverNodeConfig> =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
};
|
|
145
|
+
const proverConfig: Partial<ProverNodeConfig> = await createP2PConfig(
|
|
146
|
+
config,
|
|
147
|
+
bootstrapNode,
|
|
148
|
+
tcpPort,
|
|
149
|
+
dataDirectory,
|
|
150
|
+
);
|
|
151
|
+
|
|
128
152
|
const aztecNodeRpcTxProvider = undefined;
|
|
129
153
|
return await createAndSyncProverNode(
|
|
130
154
|
bufferToHex(proverNodePrivateKey),
|
|
@@ -138,20 +162,14 @@ export async function createProverNode(
|
|
|
138
162
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createProverNode) : createProverNode();
|
|
139
163
|
}
|
|
140
164
|
|
|
141
|
-
export async function
|
|
165
|
+
export async function createP2PConfig(
|
|
142
166
|
config: AztecNodeConfig,
|
|
143
167
|
bootstrapNodeEnr?: string,
|
|
144
168
|
port?: number,
|
|
145
|
-
addressIndex: number = 1,
|
|
146
169
|
dataDirectory?: string,
|
|
147
170
|
) {
|
|
148
171
|
port = port ?? (await getPort());
|
|
149
172
|
|
|
150
|
-
const attesterPrivateKey = bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!);
|
|
151
|
-
|
|
152
|
-
config.validatorPrivateKeys = new SecretValue([attesterPrivateKey]);
|
|
153
|
-
config.publisherPrivateKeys = [new SecretValue(attesterPrivateKey)];
|
|
154
|
-
|
|
155
173
|
const nodeConfig: AztecNodeConfig = {
|
|
156
174
|
...config,
|
|
157
175
|
p2pIp: `127.0.0.1`,
|
|
@@ -165,3 +183,22 @@ export async function createValidatorConfig(
|
|
|
165
183
|
|
|
166
184
|
return nodeConfig;
|
|
167
185
|
}
|
|
186
|
+
|
|
187
|
+
export async function createValidatorConfig(
|
|
188
|
+
config: AztecNodeConfig,
|
|
189
|
+
bootstrapNodeEnr?: string,
|
|
190
|
+
port?: number,
|
|
191
|
+
addressIndex: number = 1,
|
|
192
|
+
dataDirectory?: string,
|
|
193
|
+
) {
|
|
194
|
+
const attesterPrivateKey = bufferToHex(getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex)!);
|
|
195
|
+
const p2pConfig = await createP2PConfig(config, bootstrapNodeEnr, port, dataDirectory);
|
|
196
|
+
const nodeConfig: AztecNodeConfig = {
|
|
197
|
+
...config,
|
|
198
|
+
...p2pConfig,
|
|
199
|
+
validatorPrivateKeys: new SecretValue([attesterPrivateKey]),
|
|
200
|
+
publisherPrivateKeys: [new SecretValue(attesterPrivateKey)],
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
return nodeConfig;
|
|
204
|
+
}
|
|
@@ -31,7 +31,7 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
31
31
|
import { resolver, reviver } from '@aztec/foundation/serialize';
|
|
32
32
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
33
33
|
import type { ProverNode } from '@aztec/prover-node';
|
|
34
|
-
import {
|
|
34
|
+
import { getPXEConfig } from '@aztec/pxe/server';
|
|
35
35
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
36
36
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
37
37
|
import { getConfigEnvVars as getTelemetryConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
@@ -442,7 +442,7 @@ async function setupFromFresh(
|
|
|
442
442
|
}
|
|
443
443
|
|
|
444
444
|
logger.verbose('Creating pxe...');
|
|
445
|
-
const pxeConfig =
|
|
445
|
+
const pxeConfig = getPXEConfig();
|
|
446
446
|
pxeConfig.dataDirectory = statePath ?? path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
447
447
|
// Only enable proving if specifically requested.
|
|
448
448
|
pxeConfig.proverEnabled = !!opts.realProofs;
|
|
@@ -572,7 +572,7 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
|
|
|
572
572
|
}
|
|
573
573
|
|
|
574
574
|
logger.verbose('Creating pxe...');
|
|
575
|
-
const pxeConfig =
|
|
575
|
+
const pxeConfig = getPXEConfig();
|
|
576
576
|
pxeConfig.dataDirectory = statePath;
|
|
577
577
|
const wallet = await TestWallet.create(aztecNode, pxeConfig);
|
|
578
578
|
const cheatCodes = await CheatCodes.create(aztecNodeConfig.l1RpcUrls, wallet, aztecNode, dateProvider);
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -54,7 +54,7 @@ import type { P2PClientDeps } from '@aztec/p2p';
|
|
|
54
54
|
import { MockGossipSubNetwork, getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
55
55
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
56
56
|
import { type ProverNode, type ProverNodeConfig, type ProverNodeDeps, createProverNode } from '@aztec/prover-node';
|
|
57
|
-
import { type
|
|
57
|
+
import { type PXEConfig, getPXEConfig } from '@aztec/pxe/server';
|
|
58
58
|
import type { SequencerClient } from '@aztec/sequencer-client';
|
|
59
59
|
import type { TestSequencerClient } from '@aztec/sequencer-client/test';
|
|
60
60
|
import {
|
|
@@ -140,14 +140,14 @@ export const setupL1Contracts = async (
|
|
|
140
140
|
/**
|
|
141
141
|
* Sets up Private eXecution Environment (PXE) and returns the corresponding test wallet.
|
|
142
142
|
* @param aztecNode - An instance of Aztec Node.
|
|
143
|
-
* @param opts - Partial configuration for the PXE
|
|
143
|
+
* @param opts - Partial configuration for the PXE.
|
|
144
144
|
* @param logger - The logger to be used.
|
|
145
145
|
* @param useLogSuffix - Whether to add a randomly generated suffix to the PXE debug logs.
|
|
146
146
|
* @returns A test wallet, logger and teardown function.
|
|
147
147
|
*/
|
|
148
|
-
export async function
|
|
148
|
+
export async function setupPXEAndGetWallet(
|
|
149
149
|
aztecNode: AztecNode,
|
|
150
|
-
opts: Partial<
|
|
150
|
+
opts: Partial<PXEConfig> = {},
|
|
151
151
|
logger = getLogger(),
|
|
152
152
|
useLogSuffix = false,
|
|
153
153
|
): Promise<{
|
|
@@ -164,19 +164,19 @@ export async function setupPXEServiceAndGetWallet(
|
|
|
164
164
|
*/
|
|
165
165
|
teardown: () => Promise<void>;
|
|
166
166
|
}> {
|
|
167
|
-
const
|
|
167
|
+
const PXEConfig = { ...getPXEConfig(), ...opts };
|
|
168
168
|
// For tests we only want proving enabled if specifically requested
|
|
169
|
-
|
|
169
|
+
PXEConfig.proverEnabled = !!opts.proverEnabled;
|
|
170
170
|
|
|
171
171
|
// If no data directory provided, create a temp directory and clean up afterwards
|
|
172
|
-
const configuredDataDirectory =
|
|
172
|
+
const configuredDataDirectory = PXEConfig.dataDirectory;
|
|
173
173
|
if (!configuredDataDirectory) {
|
|
174
|
-
|
|
174
|
+
PXEConfig.dataDirectory = path.join(tmpdir(), randomBytes(8).toString('hex'));
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
const teardown = configuredDataDirectory ? () => Promise.resolve() : () => tryRmDir(
|
|
177
|
+
const teardown = configuredDataDirectory ? () => Promise.resolve() : () => tryRmDir(PXEConfig.dataDirectory!);
|
|
178
178
|
|
|
179
|
-
const wallet = await TestWallet.create(aztecNode,
|
|
179
|
+
const wallet = await TestWallet.create(aztecNode, PXEConfig, {
|
|
180
180
|
useLogSuffix,
|
|
181
181
|
});
|
|
182
182
|
|
|
@@ -360,7 +360,7 @@ export type EndToEndContext = {
|
|
|
360
360
|
export async function setup(
|
|
361
361
|
numberOfAccounts = 1,
|
|
362
362
|
opts: SetupOptions = {},
|
|
363
|
-
pxeOpts: Partial<
|
|
363
|
+
pxeOpts: Partial<PXEConfig> = {},
|
|
364
364
|
chain: Chain = foundry,
|
|
365
365
|
): Promise<EndToEndContext> {
|
|
366
366
|
let anvil: Anvil | undefined;
|
|
@@ -634,7 +634,7 @@ export async function setup(
|
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
logger.verbose('Creating a pxe...');
|
|
637
|
-
const { wallet, teardown: pxeTeardown } = await
|
|
637
|
+
const { wallet, teardown: pxeTeardown } = await setupPXEAndGetWallet(aztecNode!, pxeOpts, logger);
|
|
638
638
|
|
|
639
639
|
const cheatCodes = await CheatCodes.create(config.l1RpcUrls, wallet, aztecNode, dateProvider);
|
|
640
640
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { sleep } from '@aztec/aztec.js';
|
|
2
|
+
import { randomBytes } from '@aztec/foundation/crypto';
|
|
3
|
+
|
|
4
|
+
import { mkdirSync } from 'node:fs';
|
|
5
|
+
import { writeFile } from 'node:fs/promises';
|
|
6
|
+
import { join } from 'node:path';
|
|
7
|
+
|
|
8
|
+
export async function createWeb3SignerKeystore(dir: string, ...privateKeys: string[]) {
|
|
9
|
+
const yaml = privateKeys
|
|
10
|
+
.map(
|
|
11
|
+
pk => `\
|
|
12
|
+
type: file-raw
|
|
13
|
+
keyType: SECP256K1
|
|
14
|
+
privateKey: ${pk}`,
|
|
15
|
+
)
|
|
16
|
+
.join('\n---\n');
|
|
17
|
+
|
|
18
|
+
// NOTE: nodejs stdlib can only create temp directories, not temp files!
|
|
19
|
+
// this write uses wx (write-exclusive) so it'll throw if the file already exists
|
|
20
|
+
const path = join(dir, `keystore-${randomBytes(4).toString('hex')}.yaml`);
|
|
21
|
+
await writeFile(path, yaml, { flag: 'wx' });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export async function refreshWeb3Signer(url: string) {
|
|
25
|
+
await fetch(new URL('reload', url), { method: 'POST' });
|
|
26
|
+
// give the service a chance to load up the new files
|
|
27
|
+
// 1s might not be enough if there are a lot of files to scan
|
|
28
|
+
await sleep(1000);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export function getWeb3SignerTestKeystoreDir(): string {
|
|
32
|
+
if (process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR) {
|
|
33
|
+
mkdirSync(process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR, { recursive: true });
|
|
34
|
+
return process.env.WEB3_SIGNER_TEST_KEYSTORE_DIR;
|
|
35
|
+
} else {
|
|
36
|
+
throw new Error('Web3signer not running');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function getWeb3SignerUrl(): string {
|
|
41
|
+
if (process.env.WEB3_SIGNER_URL) {
|
|
42
|
+
return process.env.WEB3_SIGNER_URL;
|
|
43
|
+
} else {
|
|
44
|
+
throw new Error('Web3signer not running');
|
|
45
|
+
}
|
|
46
|
+
}
|