@aztec/end-to-end 0.0.1-commit.d3ec352c → 0.0.1-commit.f295ac2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bench/client_flows/benchmark.d.ts +3 -2
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +21 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +14 -15
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +110 -138
- package/dest/bench/client_flows/data_extractor.js +3 -1
- package/dest/bench/utils.d.ts +6 -6
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +18 -11
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +6 -7
- 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 +98 -113
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +19 -13
- 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 +91 -71
- 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 +18 -13
- package/dest/e2e_epochs/epochs_test.d.ts +3 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +13 -11
- package/dest/e2e_fees/bridging_race.notest.js +3 -5
- package/dest/e2e_fees/fees_test.d.ts +18 -15
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +126 -141
- package/dest/e2e_l1_publisher/write_json.d.ts +3 -3
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -1
- package/dest/e2e_l1_publisher/write_json.js +19 -15
- package/dest/e2e_multi_validator/utils.js +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +6 -9
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +32 -40
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +4 -4
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +6 -9
- package/dest/e2e_p2p/p2p_network.d.ts +13 -11
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +116 -111
- package/dest/e2e_p2p/shared.d.ts +2 -2
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +4 -4
- package/dest/e2e_token_contract/token_contract_test.d.ts +16 -9
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +90 -92
- package/dest/fixtures/e2e_prover_test.d.ts +10 -18
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +88 -103
- package/dest/fixtures/fixtures.d.ts +2 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +1 -2
- package/dest/fixtures/get_acvm_config.js +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +4 -3
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +2 -2
- package/dest/fixtures/setup.d.ts +216 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +684 -0
- package/dest/fixtures/setup_p2p_test.js +3 -3
- package/dest/fixtures/utils.d.ts +5 -638
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -647
- package/dest/fixtures/web3signer.js +1 -1
- package/dest/fixtures/with_telemetry_utils.d.ts +2 -2
- package/dest/fixtures/with_telemetry_utils.d.ts.map +1 -1
- package/dest/fixtures/with_telemetry_utils.js +2 -2
- package/dest/quality_of_service/grafana_client.d.ts +41 -0
- package/dest/quality_of_service/grafana_client.d.ts.map +1 -0
- package/dest/quality_of_service/{alert_checker.js → grafana_client.js} +1 -1
- 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/shared/cross_chain_test_harness.d.ts +16 -4
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +3 -3
- package/dest/shared/gas_portal_test_harness.d.ts +12 -2
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/index.d.ts +2 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +3 -27
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +43 -23
- package/dest/simulators/lending_simulator.d.ts +6 -2
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts +4 -3
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +2 -1
- package/dest/spartan/tx_metrics.d.ts +42 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +118 -0
- package/dest/spartan/utils.d.ts +51 -12
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +262 -102
- package/package.json +40 -39
- package/src/bench/client_flows/benchmark.ts +24 -2
- package/src/bench/client_flows/client_flows_benchmark.ts +150 -200
- package/src/bench/client_flows/data_extractor.ts +1 -1
- package/src/bench/utils.ts +22 -14
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +107 -142
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +140 -125
- package/src/e2e_deploy_contract/deploy_test.ts +21 -14
- package/src/e2e_epochs/epochs_test.ts +26 -13
- package/src/e2e_fees/bridging_race.notest.ts +3 -6
- package/src/e2e_fees/fees_test.ts +177 -216
- package/src/e2e_l1_publisher/write_json.ts +22 -17
- package/src/e2e_multi_validator/utils.ts +1 -1
- package/src/e2e_nested_contract/nested_contract_test.ts +35 -56
- package/src/e2e_p2p/inactivity_slash_test.ts +9 -12
- package/src/e2e_p2p/p2p_network.ts +174 -183
- package/src/e2e_p2p/shared.ts +11 -6
- package/src/e2e_token_contract/token_contract_test.ts +105 -118
- package/src/fixtures/e2e_prover_test.ts +112 -144
- package/src/fixtures/fixtures.ts +1 -3
- package/src/fixtures/get_acvm_config.ts +1 -1
- package/src/fixtures/l1_to_l2_messaging.ts +4 -2
- package/src/fixtures/setup.ts +1010 -0
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/fixtures/utils.ts +27 -966
- package/src/fixtures/web3signer.ts +1 -1
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +1 -1
- package/src/quality_of_service/prometheus_client.ts +113 -0
- package/src/shared/cross_chain_test_harness.ts +6 -10
- package/src/shared/gas_portal_test_harness.ts +1 -1
- package/src/shared/index.ts +1 -1
- package/src/shared/uniswap_l1_l2.ts +53 -67
- package/src/simulators/lending_simulator.ts +2 -2
- package/src/spartan/setup_test_wallets.ts +9 -2
- package/src/spartan/tx_metrics.ts +153 -0
- package/src/spartan/utils.ts +308 -45
- package/dest/fixtures/setup_l1_contracts.d.ts +0 -477
- package/dest/fixtures/setup_l1_contracts.d.ts.map +0 -1
- package/dest/fixtures/setup_l1_contracts.js +0 -17
- package/dest/fixtures/snapshot_manager.d.ts +0 -95
- package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
- package/dest/fixtures/snapshot_manager.js +0 -505
- package/dest/quality_of_service/alert_checker.d.ts +0 -41
- package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
- package/src/fixtures/setup_l1_contracts.ts +0 -26
- package/src/fixtures/snapshot_manager.ts +0 -665
|
@@ -6,17 +6,15 @@ import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
|
6
6
|
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
7
7
|
|
|
8
8
|
import {
|
|
9
|
-
type
|
|
10
|
-
type SubsystemsContext,
|
|
11
|
-
createSnapshotManager,
|
|
9
|
+
type EndToEndContext,
|
|
12
10
|
deployAccounts,
|
|
13
11
|
publicDeployAccounts,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
setup,
|
|
13
|
+
teardown as teardownSubsystems,
|
|
14
|
+
} from '../fixtures/setup.js';
|
|
17
15
|
|
|
18
16
|
export class NestedContractTest {
|
|
19
|
-
|
|
17
|
+
context!: EndToEndContext;
|
|
20
18
|
logger: Logger;
|
|
21
19
|
wallet!: Wallet;
|
|
22
20
|
defaultAccountAddress!: AztecAddress;
|
|
@@ -30,67 +28,48 @@ export class NestedContractTest {
|
|
|
30
28
|
private numberOfAccounts = 1,
|
|
31
29
|
) {
|
|
32
30
|
this.logger = createLogger(`e2e:e2e_nested_contract:${testName}`);
|
|
33
|
-
this.snapshotManager = createSnapshotManager(`e2e_nested_contract/${testName}-${numberOfAccounts}`, dataPath);
|
|
34
31
|
}
|
|
35
32
|
|
|
36
33
|
/**
|
|
37
|
-
*
|
|
38
|
-
* 1. Add 3 accounts.
|
|
39
|
-
* 2. Publicly deploy accounts
|
|
34
|
+
* Applies base setup by deploying accounts and publicly deploying them.
|
|
40
35
|
*/
|
|
41
|
-
async
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
async applyBaseSetup() {
|
|
37
|
+
this.logger.info('Deploying accounts');
|
|
38
|
+
const { deployedAccounts } = await deployAccounts(
|
|
39
|
+
this.numberOfAccounts,
|
|
40
|
+
this.logger,
|
|
41
|
+
)({
|
|
42
|
+
wallet: this.context.wallet,
|
|
43
|
+
initialFundedAccounts: this.context.initialFundedAccounts,
|
|
44
|
+
});
|
|
45
|
+
this.wallet = this.context.wallet;
|
|
46
|
+
[{ address: this.defaultAccountAddress }] = deployedAccounts;
|
|
47
|
+
this.aztecNode = this.context.aztecNodeService!;
|
|
52
48
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
async () => {},
|
|
56
|
-
async () => {
|
|
57
|
-
this.logger.verbose(`Public deploy accounts...`);
|
|
58
|
-
await publicDeployAccounts(this.wallet, [this.defaultAccountAddress]);
|
|
59
|
-
},
|
|
60
|
-
);
|
|
49
|
+
this.logger.info('Public deploy accounts');
|
|
50
|
+
await publicDeployAccounts(this.wallet, [this.defaultAccountAddress]);
|
|
61
51
|
}
|
|
62
52
|
|
|
63
53
|
async setup() {
|
|
64
|
-
|
|
54
|
+
this.logger.info('Setting up fresh subsystems');
|
|
55
|
+
this.context = await setup(0, {
|
|
56
|
+
fundSponsoredFPC: true,
|
|
57
|
+
skipAccountDeployment: true,
|
|
58
|
+
});
|
|
59
|
+
await this.applyBaseSetup();
|
|
65
60
|
}
|
|
66
61
|
|
|
67
62
|
async teardown() {
|
|
68
|
-
await this.
|
|
63
|
+
await teardownSubsystems(this.context);
|
|
69
64
|
}
|
|
70
65
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
'manual',
|
|
80
|
-
async () => {
|
|
81
|
-
const parentContract = await ParentContract.deploy(this.wallet)
|
|
82
|
-
.send({ from: this.defaultAccountAddress })
|
|
83
|
-
.deployed();
|
|
84
|
-
const childContract = await ChildContract.deploy(this.wallet)
|
|
85
|
-
.send({ from: this.defaultAccountAddress })
|
|
86
|
-
.deployed();
|
|
87
|
-
return { parentContractAddress: parentContract.address, childContractAddress: childContract.address };
|
|
88
|
-
},
|
|
89
|
-
({ parentContractAddress, childContractAddress }) => {
|
|
90
|
-
this.parentContract = ParentContract.at(parentContractAddress, this.wallet);
|
|
91
|
-
this.childContract = ChildContract.at(childContractAddress, this.wallet);
|
|
92
|
-
return Promise.resolve();
|
|
93
|
-
},
|
|
94
|
-
);
|
|
66
|
+
async applyManual() {
|
|
67
|
+
this.logger.info('Deploying parent and child contracts');
|
|
68
|
+
const parentContract = await ParentContract.deploy(this.wallet)
|
|
69
|
+
.send({ from: this.defaultAccountAddress })
|
|
70
|
+
.deployed();
|
|
71
|
+
const childContract = await ChildContract.deploy(this.wallet).send({ from: this.defaultAccountAddress }).deployed();
|
|
72
|
+
this.parentContract = parentContract;
|
|
73
|
+
this.childContract = childContract;
|
|
95
74
|
}
|
|
96
75
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { EthAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
-
import { RollupContract } from '@aztec/ethereum';
|
|
3
|
+
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
4
4
|
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
5
5
|
|
|
6
6
|
import fs from 'fs';
|
|
@@ -24,7 +24,7 @@ const SLASHING_UNIT = BigInt(1e18);
|
|
|
24
24
|
const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
|
|
25
25
|
|
|
26
26
|
// How many epochs it may take to set everything up, so we dont slash during this period
|
|
27
|
-
const SETUP_EPOCH_DURATION =
|
|
27
|
+
const SETUP_EPOCH_DURATION = 8;
|
|
28
28
|
|
|
29
29
|
export class P2PInactivityTest {
|
|
30
30
|
public nodes!: AztecNodeService[];
|
|
@@ -82,8 +82,8 @@ export class P2PInactivityTest {
|
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
public async setup() {
|
|
85
|
-
await this.test.applyBaseSnapshots();
|
|
86
85
|
await this.test.setup();
|
|
86
|
+
await this.test.applyBaseSetup();
|
|
87
87
|
|
|
88
88
|
// Set slashing penalties for inactivity
|
|
89
89
|
const { rollup } = await this.test.getContracts();
|
|
@@ -98,13 +98,13 @@ export class P2PInactivityTest {
|
|
|
98
98
|
this.rollup = rollup;
|
|
99
99
|
|
|
100
100
|
if (!this.keepInitialNode) {
|
|
101
|
-
await this.test.ctx.
|
|
101
|
+
await this.test.ctx.aztecNodeService!.stop();
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
// Create all active nodes
|
|
105
105
|
this.activeNodes = await createNodes(
|
|
106
106
|
this.test.ctx.aztecNodeConfig,
|
|
107
|
-
this.test.ctx.dateProvider
|
|
107
|
+
this.test.ctx.dateProvider!,
|
|
108
108
|
this.test.bootstrapNodeEnr,
|
|
109
109
|
NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode),
|
|
110
110
|
BOOT_NODE_UDP_PORT,
|
|
@@ -118,7 +118,7 @@ export class P2PInactivityTest {
|
|
|
118
118
|
const inactiveConfig = { ...this.test.ctx.aztecNodeConfig, dontStartSequencer: true };
|
|
119
119
|
this.inactiveNodes = await createNodes(
|
|
120
120
|
inactiveConfig,
|
|
121
|
-
this.test.ctx.dateProvider
|
|
121
|
+
this.test.ctx.dateProvider!,
|
|
122
122
|
this.test.bootstrapNodeEnr,
|
|
123
123
|
this.inactiveNodeCount,
|
|
124
124
|
BOOT_NODE_UDP_PORT,
|
|
@@ -129,7 +129,7 @@ export class P2PInactivityTest {
|
|
|
129
129
|
);
|
|
130
130
|
|
|
131
131
|
this.nodes = [
|
|
132
|
-
...(this.keepInitialNode ? [this.test.ctx.
|
|
132
|
+
...(this.keepInitialNode ? [this.test.ctx.aztecNodeService!] : []),
|
|
133
133
|
...this.activeNodes,
|
|
134
134
|
...this.inactiveNodes,
|
|
135
135
|
];
|
|
@@ -151,11 +151,8 @@ export class P2PInactivityTest {
|
|
|
151
151
|
// This prevents race conditions where validators propose blocks before the network is ready
|
|
152
152
|
await this.test.waitForP2PMeshConnectivity(this.nodes, NUM_NODES);
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
this.test.
|
|
156
|
-
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(EpochNumber(SETUP_EPOCH_DURATION + 1), {
|
|
157
|
-
offset: -ethereumSlotDuration,
|
|
158
|
-
});
|
|
154
|
+
this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION - 1} (slashing will start after it is completed)`);
|
|
155
|
+
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(EpochNumber(SETUP_EPOCH_DURATION - 1));
|
|
159
156
|
|
|
160
157
|
return this;
|
|
161
158
|
}
|