@aztec/end-to-end 4.0.0-nightly.20260113 → 4.0.0-nightly.20260114
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 +10 -10
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +98 -133
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +5 -6
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +94 -112
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +5 -5
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +60 -62
- package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -3
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +15 -13
- package/dest/e2e_fees/bridging_race.notest.js +2 -4
- package/dest/e2e_fees/fees_test.d.ts +11 -11
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +118 -139
- package/dest/e2e_l1_publisher/write_json.d.ts +1 -1
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +1 -0
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +5 -8
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +29 -40
- package/dest/e2e_p2p/inactivity_slash_test.js +1 -1
- package/dest/e2e_p2p/p2p_network.d.ts +5 -3
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +99 -102
- package/dest/e2e_token_contract/token_contract_test.d.ts +15 -8
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +88 -92
- package/dest/fixtures/e2e_prover_test.d.ts +7 -13
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +78 -91
- package/dest/fixtures/snapshot_manager.d.ts +10 -44
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +12 -255
- package/dest/fixtures/utils.js +3 -3
- package/dest/quality_of_service/prometheus_client.d.ts +38 -0
- package/dest/quality_of_service/prometheus_client.d.ts.map +1 -0
- package/dest/quality_of_service/prometheus_client.js +67 -0
- package/dest/spartan/tx_metrics.d.ts +4 -1
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +21 -1
- package/dest/spartan/utils.d.ts +5 -1
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +25 -8
- package/package.json +38 -38
- package/src/bench/client_flows/client_flows_benchmark.ts +134 -192
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +104 -136
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +91 -103
- package/src/e2e_deploy_contract/deploy_test.ts +18 -14
- package/src/e2e_fees/bridging_race.notest.ts +2 -5
- package/src/e2e_fees/fees_test.ts +165 -210
- package/src/e2e_l1_publisher/write_json.ts +1 -0
- package/src/e2e_nested_contract/nested_contract_test.ts +30 -54
- package/src/e2e_p2p/inactivity_slash_test.ts +1 -1
- package/src/e2e_p2p/p2p_network.ts +149 -165
- package/src/e2e_token_contract/token_contract_test.ts +104 -113
- package/src/fixtures/e2e_prover_test.ts +97 -130
- package/src/fixtures/snapshot_manager.ts +12 -325
- package/src/fixtures/utils.ts +3 -3
- package/src/quality_of_service/prometheus_client.ts +113 -0
- package/src/spartan/tx_metrics.ts +21 -1
- package/src/spartan/utils.ts +26 -8
|
@@ -30,16 +30,14 @@ import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
|
30
30
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
31
31
|
import { getBBConfig } from './get_bb_config.js';
|
|
32
32
|
import {
|
|
33
|
-
type ISnapshotManager,
|
|
34
33
|
type SubsystemsContext,
|
|
35
|
-
createSnapshotManager,
|
|
36
34
|
deployAccounts,
|
|
37
35
|
publicDeployAccounts,
|
|
36
|
+
setupFromFresh,
|
|
37
|
+
teardown,
|
|
38
38
|
} from './snapshot_manager.js';
|
|
39
39
|
import { getPrivateKeyFromIndex, getSponsoredFPCAddress, setupPXEAndGetWallet } from './utils.js';
|
|
40
40
|
|
|
41
|
-
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
42
|
-
|
|
43
41
|
type ProvenSetup = {
|
|
44
42
|
wallet: TestWallet;
|
|
45
43
|
teardown: () => Promise<void>;
|
|
@@ -56,7 +54,6 @@ export class FullProverTest {
|
|
|
56
54
|
static TOKEN_NAME = 'USDC';
|
|
57
55
|
static TOKEN_SYMBOL = 'USD';
|
|
58
56
|
static TOKEN_DECIMALS = 18n;
|
|
59
|
-
private snapshotManager: ISnapshotManager;
|
|
60
57
|
logger: Logger;
|
|
61
58
|
wallet!: TestWallet;
|
|
62
59
|
provenWallet!: TestWallet;
|
|
@@ -73,91 +70,76 @@ export class FullProverTest {
|
|
|
73
70
|
private acvmConfigCleanup?: () => Promise<void>;
|
|
74
71
|
circuitProofVerifier?: ClientProtocolCircuitVerifier;
|
|
75
72
|
provenAsset!: TokenContract;
|
|
76
|
-
|
|
73
|
+
context!: SubsystemsContext;
|
|
77
74
|
private proverNode!: ProverNode;
|
|
78
75
|
private simulatedProverNode!: ProverNode;
|
|
79
76
|
public l1Contracts!: DeployAztecL1ContractsReturnType;
|
|
80
77
|
public proverAddress!: EthAddress;
|
|
78
|
+
private minNumberOfTxsPerBlock: number;
|
|
79
|
+
private coinbase: EthAddress;
|
|
80
|
+
private realProofs: boolean;
|
|
81
81
|
|
|
82
|
-
constructor(
|
|
83
|
-
testName: string,
|
|
84
|
-
private minNumberOfTxsPerBlock: number,
|
|
85
|
-
coinbase: EthAddress,
|
|
86
|
-
private realProofs = true,
|
|
87
|
-
) {
|
|
82
|
+
constructor(testName: string, minNumberOfTxsPerBlock: number, coinbase: EthAddress, realProofs = true) {
|
|
88
83
|
this.logger = createLogger(`e2e:full_prover_test:${testName}`);
|
|
89
|
-
this.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
{ startProverNode: true, coinbase },
|
|
93
|
-
{
|
|
94
|
-
realVerifier: realProofs,
|
|
95
|
-
},
|
|
96
|
-
);
|
|
84
|
+
this.minNumberOfTxsPerBlock = minNumberOfTxsPerBlock;
|
|
85
|
+
this.coinbase = coinbase;
|
|
86
|
+
this.realProofs = realProofs;
|
|
97
87
|
}
|
|
98
88
|
|
|
99
89
|
/**
|
|
100
|
-
*
|
|
101
|
-
* 1. Add 2 accounts.
|
|
102
|
-
* 2. Publicly deploy accounts, deploy token contract
|
|
90
|
+
* Applies base setup: deploys 2 accounts and token contract.
|
|
103
91
|
*/
|
|
104
|
-
async
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
this.fakeProofsAsset = TokenContract.at(tokenContractAddress, this.wallet);
|
|
141
|
-
this.fakeProofsAssetInstance = tokenContractInstance;
|
|
142
|
-
this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
|
|
143
|
-
|
|
144
|
-
this.tokenSim = new TokenSimulator(
|
|
145
|
-
this.fakeProofsAsset,
|
|
146
|
-
this.wallet,
|
|
147
|
-
this.accounts[0],
|
|
148
|
-
this.logger,
|
|
149
|
-
this.accounts,
|
|
150
|
-
);
|
|
151
|
-
|
|
152
|
-
expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0] })).toBe(
|
|
153
|
-
this.accounts[0].toBigInt(),
|
|
154
|
-
);
|
|
155
|
-
},
|
|
92
|
+
private async applyBaseSetup() {
|
|
93
|
+
this.logger.info('Applying base setup: deploying accounts');
|
|
94
|
+
const { deployedAccounts } = await deployAccounts(
|
|
95
|
+
2,
|
|
96
|
+
this.logger,
|
|
97
|
+
)({
|
|
98
|
+
wallet: this.context.wallet,
|
|
99
|
+
initialFundedAccounts: this.context.initialFundedAccounts,
|
|
100
|
+
});
|
|
101
|
+
this.deployedAccounts = deployedAccounts;
|
|
102
|
+
this.accounts = deployedAccounts.map(a => a.address);
|
|
103
|
+
this.wallet = this.context.wallet;
|
|
104
|
+
|
|
105
|
+
this.logger.info('Applying base setup: publicly deploying accounts');
|
|
106
|
+
await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
|
|
107
|
+
|
|
108
|
+
this.logger.info('Applying base setup: deploying token contract');
|
|
109
|
+
const { contract: asset, instance } = await TokenContract.deploy(
|
|
110
|
+
this.wallet,
|
|
111
|
+
this.accounts[0],
|
|
112
|
+
FullProverTest.TOKEN_NAME,
|
|
113
|
+
FullProverTest.TOKEN_SYMBOL,
|
|
114
|
+
FullProverTest.TOKEN_DECIMALS,
|
|
115
|
+
)
|
|
116
|
+
.send({ from: this.accounts[0] })
|
|
117
|
+
.wait();
|
|
118
|
+
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
119
|
+
|
|
120
|
+
this.fakeProofsAsset = asset;
|
|
121
|
+
this.fakeProofsAssetInstance = instance;
|
|
122
|
+
this.logger.verbose(`Token contract address: ${this.fakeProofsAsset.address}`);
|
|
123
|
+
|
|
124
|
+
this.tokenSim = new TokenSimulator(this.fakeProofsAsset, this.wallet, this.accounts[0], this.logger, this.accounts);
|
|
125
|
+
|
|
126
|
+
expect(await this.fakeProofsAsset.methods.get_admin().simulate({ from: this.accounts[0] })).toBe(
|
|
127
|
+
this.accounts[0].toBigInt(),
|
|
156
128
|
);
|
|
157
129
|
}
|
|
158
130
|
|
|
159
131
|
async setup() {
|
|
160
|
-
this.
|
|
132
|
+
this.logger.info('Setting up subsystems from fresh');
|
|
133
|
+
this.context = await setupFromFresh(
|
|
134
|
+
this.logger,
|
|
135
|
+
{ startProverNode: true, coinbase: this.coinbase },
|
|
136
|
+
{ realVerifier: this.realProofs },
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
await this.applyBaseSetup();
|
|
140
|
+
await this.applyMint();
|
|
141
|
+
|
|
142
|
+
this.logger.info(`Enabling proving`, { realProofs: this.realProofs });
|
|
161
143
|
|
|
162
144
|
// We don't wish to mark as proven automatically, so we set the flag to false
|
|
163
145
|
this.context.watcher.setIsMarkingAsProven(false);
|
|
@@ -286,7 +268,7 @@ export class FullProverTest {
|
|
|
286
268
|
);
|
|
287
269
|
await this.proverNode.start();
|
|
288
270
|
|
|
289
|
-
this.logger.warn(`Proofs are now enabled
|
|
271
|
+
this.logger.warn(`Proofs are now enabled`, { realProofs: this.realProofs });
|
|
290
272
|
return this;
|
|
291
273
|
}
|
|
292
274
|
|
|
@@ -299,15 +281,7 @@ export class FullProverTest {
|
|
|
299
281
|
await this.context.deployL1ContractsValues.l1Client.waitForTransactionReceipt({ hash });
|
|
300
282
|
}
|
|
301
283
|
|
|
302
|
-
snapshot = <T>(
|
|
303
|
-
name: string,
|
|
304
|
-
apply: (context: SubsystemsContext) => Promise<T>,
|
|
305
|
-
restore: (snapshotData: T, context: SubsystemsContext) => Promise<void> = () => Promise.resolve(),
|
|
306
|
-
): Promise<void> => this.snapshotManager.snapshot(name, apply, restore);
|
|
307
|
-
|
|
308
284
|
async teardown() {
|
|
309
|
-
await this.snapshotManager.teardown();
|
|
310
|
-
|
|
311
285
|
// Cleanup related to the full prover PXEs
|
|
312
286
|
for (let i = 0; i < this.provenComponents.length; i++) {
|
|
313
287
|
await this.provenComponents[i].teardown();
|
|
@@ -319,52 +293,45 @@ export class FullProverTest {
|
|
|
319
293
|
await Barretenberg.destroySingleton();
|
|
320
294
|
await this.bbConfigCleanup?.();
|
|
321
295
|
await this.acvmConfigCleanup?.();
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
async applyMintSnapshot() {
|
|
325
|
-
await this.snapshotManager.snapshot(
|
|
326
|
-
'mint',
|
|
327
|
-
async () => {
|
|
328
|
-
const { fakeProofsAsset: asset, accounts } = this;
|
|
329
|
-
const privateAmount = 10000n;
|
|
330
|
-
const publicAmount = 10000n;
|
|
331
|
-
|
|
332
|
-
this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
|
|
333
|
-
await asset.methods
|
|
334
|
-
.mint_to_public(accounts[0], privateAmount + publicAmount)
|
|
335
|
-
.send({ from: accounts[0] })
|
|
336
|
-
.wait();
|
|
337
296
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
this.logger.verbose(`Minting complete.`);
|
|
297
|
+
await teardown(this.context);
|
|
298
|
+
}
|
|
342
299
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
);
|
|
300
|
+
private async applyMint() {
|
|
301
|
+
this.logger.info('Applying mint setup');
|
|
302
|
+
const { fakeProofsAsset: asset, accounts } = this;
|
|
303
|
+
const privateAmount = 10000n;
|
|
304
|
+
const publicAmount = 10000n;
|
|
305
|
+
|
|
306
|
+
this.logger.verbose(`Minting ${privateAmount + publicAmount} publicly...`);
|
|
307
|
+
await asset.methods
|
|
308
|
+
.mint_to_public(accounts[0], privateAmount + publicAmount)
|
|
309
|
+
.send({ from: accounts[0] })
|
|
310
|
+
.wait();
|
|
311
|
+
|
|
312
|
+
this.logger.verbose(`Transferring ${privateAmount} to private...`);
|
|
313
|
+
await asset.methods.transfer_to_private(accounts[0], privateAmount).send({ from: accounts[0] }).wait();
|
|
314
|
+
|
|
315
|
+
this.logger.info(`Minting complete`);
|
|
316
|
+
|
|
317
|
+
const {
|
|
318
|
+
fakeProofsAsset,
|
|
319
|
+
accounts: [address],
|
|
320
|
+
tokenSim,
|
|
321
|
+
} = this;
|
|
322
|
+
tokenSim.mintPublic(address, publicAmount);
|
|
323
|
+
|
|
324
|
+
const publicBalance = await fakeProofsAsset.methods.balance_of_public(address).simulate({ from: address });
|
|
325
|
+
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
326
|
+
expect(publicBalance).toEqual(this.tokenSim.balanceOfPublic(address));
|
|
327
|
+
|
|
328
|
+
tokenSim.mintPrivate(address, publicAmount);
|
|
329
|
+
const privateBalance = await fakeProofsAsset.methods.balance_of_private(address).simulate({ from: address });
|
|
330
|
+
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
331
|
+
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(address));
|
|
332
|
+
|
|
333
|
+
const totalSupply = await fakeProofsAsset.methods.total_supply().simulate({ from: address });
|
|
334
|
+
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
335
|
+
expect(totalSupply).toEqual(tokenSim.totalSupply);
|
|
369
336
|
}
|
|
370
337
|
}
|