@aztec/end-to-end 0.0.0-test.0 → 0.0.1-commit.023c3e5
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 +62 -0
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/benchmark.js +281 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +79 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/client_flows_benchmark.js +321 -0
- package/dest/bench/client_flows/config.d.ts +14 -0
- package/dest/bench/client_flows/config.d.ts.map +1 -0
- package/dest/bench/client_flows/config.js +106 -0
- package/dest/bench/client_flows/data_extractor.d.ts +2 -0
- package/dest/bench/client_flows/data_extractor.d.ts.map +1 -0
- package/dest/bench/client_flows/data_extractor.js +79 -0
- package/dest/bench/utils.d.ts +16 -41
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +41 -72
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +26 -19
- 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 +114 -102
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +32 -32
- 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 +104 -104
- package/dest/e2e_deploy_contract/deploy_test.d.ts +19 -10
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +26 -27
- package/dest/e2e_epochs/epochs_test.d.ts +71 -22
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +260 -54
- package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/e2e_fees/bridging_race.notest.js +61 -0
- package/dest/e2e_fees/fees_test.d.ts +38 -23
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +162 -183
- package/dest/e2e_l1_publisher/write_json.d.ts +11 -0
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
- package/dest/e2e_l1_publisher/write_json.js +56 -0
- package/dest/e2e_multi_validator/utils.d.ts +12 -0
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -0
- package/dest/e2e_multi_validator/utils.js +214 -0
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +15 -15
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +37 -41
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
- package/dest/e2e_p2p/inactivity_slash_test.js +136 -0
- package/dest/e2e_p2p/p2p_network.d.ts +281 -27
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +237 -175
- package/dest/e2e_p2p/reqresp/utils.d.ts +22 -0
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -0
- package/dest/e2e_p2p/reqresp/utils.js +153 -0
- package/dest/e2e_p2p/shared.d.ts +44 -8
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +165 -27
- package/dest/e2e_token_contract/token_contract_test.d.ts +27 -14
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +96 -74
- package/dest/fixtures/e2e_prover_test.d.ts +55 -0
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
- package/dest/fixtures/e2e_prover_test.js +278 -0
- package/dest/fixtures/fixtures.d.ts +6 -8
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +5 -5
- package/dest/fixtures/get_acvm_config.d.ts +2 -2
- package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
- package/dest/fixtures/get_acvm_config.js +3 -15
- package/dest/fixtures/get_bb_config.d.ts +2 -2
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +10 -17
- package/dest/fixtures/index.d.ts +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +11 -7
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +45 -19
- package/dest/fixtures/logging.d.ts +1 -1
- package/dest/fixtures/setup.d.ts +218 -0
- package/dest/fixtures/setup.d.ts.map +1 -0
- package/dest/fixtures/setup.js +695 -0
- package/dest/fixtures/setup_p2p_test.d.ts +15 -15
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +96 -31
- package/dest/fixtures/token_utils.d.ts +10 -4
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +31 -12
- package/dest/fixtures/utils.d.ts +5 -153
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +4 -552
- package/dest/fixtures/web3signer.d.ts +5 -0
- package/dest/fixtures/web3signer.d.ts.map +1 -0
- package/dest/fixtures/web3signer.js +53 -0
- 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/index.d.ts +1 -1
- 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 +44 -27
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +105 -51
- package/dest/shared/gas_portal_test_harness.d.ts +33 -25
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +51 -30
- package/dest/shared/index.d.ts +2 -2
- package/dest/shared/index.d.ts.map +1 -1
- package/dest/shared/jest_setup.d.ts +1 -1
- package/dest/shared/jest_setup.js +1 -1
- package/dest/shared/submit-transactions.d.ts +6 -4
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.js +15 -16
- package/dest/shared/uniswap_l1_l2.d.ts +3 -25
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +176 -126
- package/dest/simulators/index.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts +7 -7
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +17 -18
- package/dest/simulators/token_simulator.d.ts +6 -3
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +16 -13
- package/dest/spartan/setup_test_wallets.d.ts +27 -11
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +233 -62
- package/dest/spartan/tx_metrics.d.ts +88 -0
- package/dest/spartan/tx_metrics.d.ts.map +1 -0
- package/dest/spartan/tx_metrics.js +422 -0
- package/dest/spartan/utils/bot.d.ts +27 -0
- package/dest/spartan/utils/bot.d.ts.map +1 -0
- package/dest/spartan/utils/bot.js +141 -0
- package/dest/spartan/utils/chaos.d.ts +79 -0
- package/dest/spartan/utils/chaos.d.ts.map +1 -0
- package/dest/spartan/utils/chaos.js +142 -0
- package/dest/spartan/utils/clients.d.ts +39 -0
- package/dest/spartan/utils/clients.d.ts.map +1 -0
- package/dest/spartan/utils/clients.js +90 -0
- package/dest/spartan/utils/config.d.ts +36 -0
- package/dest/spartan/utils/config.d.ts.map +1 -0
- package/dest/spartan/utils/config.js +20 -0
- package/dest/spartan/utils/health.d.ts +63 -0
- package/dest/spartan/utils/health.d.ts.map +1 -0
- package/dest/spartan/utils/health.js +202 -0
- package/dest/spartan/utils/helm.d.ts +15 -0
- package/dest/spartan/utils/helm.d.ts.map +1 -0
- package/dest/spartan/utils/helm.js +47 -0
- package/dest/spartan/utils/index.d.ts +9 -0
- package/dest/spartan/utils/index.d.ts.map +1 -0
- package/dest/spartan/utils/index.js +18 -0
- package/dest/spartan/utils/k8s.d.ts +126 -0
- package/dest/spartan/utils/k8s.d.ts.map +1 -0
- package/dest/spartan/utils/k8s.js +375 -0
- package/dest/spartan/utils/nodes.d.ts +41 -0
- package/dest/spartan/utils/nodes.d.ts.map +1 -0
- package/dest/spartan/utils/nodes.js +461 -0
- package/dest/spartan/utils/scripts.d.ts +16 -0
- package/dest/spartan/utils/scripts.d.ts.map +1 -0
- package/dest/spartan/utils/scripts.js +66 -0
- package/dest/spartan/utils.d.ts +2 -415
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +1 -445
- package/package.json +66 -58
- package/src/bench/client_flows/benchmark.ts +363 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +384 -0
- package/src/bench/client_flows/config.ts +61 -0
- package/src/bench/client_flows/data_extractor.ts +89 -0
- package/src/bench/utils.ts +41 -85
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +134 -169
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +156 -182
- package/src/e2e_deploy_contract/deploy_test.ts +40 -48
- package/src/e2e_epochs/epochs_test.ts +341 -81
- package/src/e2e_fees/bridging_race.notest.ts +74 -0
- package/src/e2e_fees/fees_test.ts +220 -258
- package/src/e2e_l1_publisher/write_json.ts +77 -0
- package/src/e2e_multi_validator/utils.ts +258 -0
- package/src/e2e_nested_contract/nested_contract_test.ts +46 -59
- package/src/e2e_p2p/inactivity_slash_test.ts +179 -0
- package/src/e2e_p2p/p2p_network.ts +341 -234
- package/src/e2e_p2p/reqresp/utils.ts +207 -0
- package/src/e2e_p2p/shared.ts +260 -39
- package/src/e2e_token_contract/token_contract_test.ts +115 -126
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/e2e_prover_test.ts +336 -0
- package/src/fixtures/fixtures.ts +5 -7
- package/src/fixtures/get_acvm_config.ts +4 -12
- package/src/fixtures/get_bb_config.ts +18 -13
- package/src/fixtures/l1_to_l2_messaging.ts +56 -24
- package/src/fixtures/setup.ts +1017 -0
- package/src/fixtures/setup_p2p_test.ts +133 -50
- package/src/fixtures/token_utils.ts +33 -15
- package/src/fixtures/utils.ts +27 -820
- package/src/fixtures/web3signer.ts +63 -0
- package/src/fixtures/with_telemetry_utils.ts +2 -2
- package/src/guides/up_quick_start.sh +7 -15
- package/src/quality_of_service/{alert_checker.ts → grafana_client.ts} +2 -2
- package/src/quality_of_service/prometheus_client.ts +113 -0
- package/src/shared/cross_chain_test_harness.ts +103 -91
- package/src/shared/gas_portal_test_harness.ts +59 -50
- package/src/shared/index.ts +1 -1
- package/src/shared/jest_setup.ts +1 -1
- package/src/shared/submit-transactions.ts +18 -20
- package/src/shared/uniswap_l1_l2.ts +197 -221
- package/src/simulators/lending_simulator.ts +16 -17
- package/src/simulators/token_simulator.ts +21 -13
- package/src/spartan/DEVELOP.md +128 -0
- package/src/spartan/setup_test_wallets.ts +308 -95
- package/src/spartan/tx_metrics.ts +376 -0
- package/src/spartan/utils/bot.ts +185 -0
- package/src/spartan/utils/chaos.ts +253 -0
- package/src/spartan/utils/clients.ts +100 -0
- package/src/spartan/utils/config.ts +26 -0
- package/src/spartan/utils/health.ts +255 -0
- package/src/spartan/utils/helm.ts +84 -0
- package/src/spartan/utils/index.ts +64 -0
- package/src/spartan/utils/k8s.ts +527 -0
- package/src/spartan/utils/nodes.ts +538 -0
- package/src/spartan/utils/scripts.ts +63 -0
- package/src/spartan/utils.ts +1 -582
- package/dest/e2e_prover/e2e_prover_test.d.ts +0 -56
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +0 -1
- package/dest/e2e_prover/e2e_prover_test.js +0 -291
- package/dest/fixtures/setup_l1_contracts.d.ts +0 -6
- 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 -87
- package/dest/fixtures/snapshot_manager.d.ts.map +0 -1
- package/dest/fixtures/snapshot_manager.js +0 -479
- package/dest/quality_of_service/alert_checker.d.ts +0 -41
- package/dest/quality_of_service/alert_checker.d.ts.map +0 -1
- package/dest/sample-dapp/connect.js +0 -12
- package/dest/sample-dapp/contracts.js +0 -10
- package/dest/sample-dapp/deploy.js +0 -35
- package/dest/sample-dapp/index.js +0 -98
- package/src/e2e_prover/e2e_prover_test.ts +0 -418
- package/src/fixtures/setup_l1_contracts.ts +0 -27
- package/src/fixtures/snapshot_manager.ts +0 -617
- package/src/sample-dapp/connect.mjs +0 -16
- package/src/sample-dapp/contracts.mjs +0 -14
- package/src/sample-dapp/deploy.mjs +0 -40
- package/src/sample-dapp/index.mjs +0 -128
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// Convenience struct to hold an account's address and secret that can easily be passed around.
|
|
2
|
-
import { AztecAddress
|
|
3
|
-
import {
|
|
2
|
+
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
3
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
4
|
+
import { CheatCodes } from '@aztec/aztec/testing';
|
|
5
|
+
import type { RollupContract } from '@aztec/ethereum/contracts';
|
|
6
|
+
import { SlotNumber } from '@aztec/foundation/branded-types';
|
|
7
|
+
import { poseidon2Hash } from '@aztec/foundation/crypto/poseidon';
|
|
4
8
|
import type { TestDateProvider } from '@aztec/foundation/timer';
|
|
5
|
-
import type { RollupAbi } from '@aztec/l1-artifacts';
|
|
6
9
|
import type { LendingContract } from '@aztec/noir-contracts.js/Lending';
|
|
7
10
|
|
|
8
|
-
import type { Account, GetContractReturnType, HttpTransport, WalletClient } from 'viem';
|
|
9
|
-
import type * as chains from 'viem/chains';
|
|
10
|
-
|
|
11
11
|
import type { TokenSimulator } from './token_simulator.js';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -29,7 +29,7 @@ export class LendingAccount {
|
|
|
29
29
|
* @returns Key in public space
|
|
30
30
|
*/
|
|
31
31
|
public key() {
|
|
32
|
-
return
|
|
32
|
+
return poseidon2Hash([this.address, this.secret]);
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -83,7 +83,7 @@ export class LendingSimulator {
|
|
|
83
83
|
private rate: bigint,
|
|
84
84
|
private ethereumSlotDuration: number,
|
|
85
85
|
/** the rollup contract */
|
|
86
|
-
public rollup:
|
|
86
|
+
public rollup: RollupContract,
|
|
87
87
|
/** the lending contract */
|
|
88
88
|
public lendingContract: LendingContract,
|
|
89
89
|
/** the collateral asset used in the lending contract */
|
|
@@ -94,10 +94,8 @@ export class LendingSimulator {
|
|
|
94
94
|
|
|
95
95
|
async prepare() {
|
|
96
96
|
this.accumulator = BASE;
|
|
97
|
-
const slot = await this.rollup.
|
|
98
|
-
|
|
99
|
-
]);
|
|
100
|
-
this.time = Number(await this.rollup.read.getTimestampForSlot([slot]));
|
|
97
|
+
const slot = await this.rollup.getSlotAt(BigInt(await this.cc.eth.timestamp()) + BigInt(this.ethereumSlotDuration));
|
|
98
|
+
this.time = Number(await this.rollup.getTimestampForSlot(slot));
|
|
101
99
|
}
|
|
102
100
|
|
|
103
101
|
async progressSlots(diff: number, dateProvider?: TestDateProvider) {
|
|
@@ -105,8 +103,9 @@ export class LendingSimulator {
|
|
|
105
103
|
return;
|
|
106
104
|
}
|
|
107
105
|
|
|
108
|
-
const slot = await this.rollup.
|
|
109
|
-
const
|
|
106
|
+
const slot = await this.rollup.getSlotAt(BigInt(await this.cc.eth.timestamp()));
|
|
107
|
+
const targetSlot = SlotNumber(slot + diff);
|
|
108
|
+
const ts = Number(await this.rollup.getTimestampForSlot(targetSlot));
|
|
110
109
|
const timeDiff = ts - this.time;
|
|
111
110
|
this.time = ts;
|
|
112
111
|
|
|
@@ -115,7 +114,7 @@ export class LendingSimulator {
|
|
|
115
114
|
if (dateProvider) {
|
|
116
115
|
dateProvider.setTime(this.time * 1000);
|
|
117
116
|
}
|
|
118
|
-
await this.cc.rollup.markAsProven(await this.rollup.
|
|
117
|
+
await this.cc.rollup.markAsProven(await this.rollup.getCheckpointNumber());
|
|
119
118
|
this.accumulator = muldivDown(this.accumulator, computeMultiplier(this.rate, BigInt(timeDiff)), BASE);
|
|
120
119
|
}
|
|
121
120
|
|
|
@@ -187,14 +186,14 @@ export class LendingSimulator {
|
|
|
187
186
|
|
|
188
187
|
expect(this.borrowed).toEqual(this.stableCoin.totalSupply - this.mintedOutside);
|
|
189
188
|
|
|
190
|
-
const asset = await this.lendingContract.methods.get_asset(0).simulate();
|
|
189
|
+
const asset = await this.lendingContract.methods.get_asset(0).simulate({ from: this.account.address });
|
|
191
190
|
|
|
192
191
|
const interestAccumulator = asset['interest_accumulator'];
|
|
193
192
|
expect(interestAccumulator).toEqual(this.accumulator);
|
|
194
193
|
expect(asset['last_updated_ts']).toEqual(BigInt(this.time));
|
|
195
194
|
|
|
196
195
|
for (const key of [this.account.address, AztecAddress.fromField(await this.account.key())]) {
|
|
197
|
-
const privatePos = await this.lendingContract.methods.get_position(key).simulate();
|
|
196
|
+
const privatePos = await this.lendingContract.methods.get_position(key).simulate({ from: this.account.address });
|
|
198
197
|
expect(new Fr(privatePos['collateral'])).toEqual(this.collateral[key.toString()] ?? Fr.ZERO);
|
|
199
198
|
expect(new Fr(privatePos['static_debt'])).toEqual(this.staticDebt[key.toString()] ?? Fr.ZERO);
|
|
200
199
|
expect(privatePos['debt']).toEqual(
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
+
import { BatchCall } from '@aztec/aztec.js/contracts';
|
|
3
|
+
import type { Logger } from '@aztec/aztec.js/log';
|
|
4
|
+
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
3
5
|
import type { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
6
|
|
|
5
7
|
import chunk from 'lodash.chunk';
|
|
@@ -14,6 +16,7 @@ export class TokenSimulator {
|
|
|
14
16
|
constructor(
|
|
15
17
|
protected token: TokenContract,
|
|
16
18
|
protected defaultWallet: Wallet,
|
|
19
|
+
protected defaultAddress: AztecAddress,
|
|
17
20
|
protected logger: Logger,
|
|
18
21
|
protected accounts: AztecAddress[],
|
|
19
22
|
) {}
|
|
@@ -97,13 +100,15 @@ export class TokenSimulator {
|
|
|
97
100
|
|
|
98
101
|
async checkPublic() {
|
|
99
102
|
// public calls
|
|
100
|
-
const calls = [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
const calls = [
|
|
104
|
+
this.token.methods.total_supply(),
|
|
105
|
+
...this.accounts.map(address => this.token.methods.balance_of_public(address)),
|
|
106
|
+
];
|
|
104
107
|
|
|
105
108
|
const results = (
|
|
106
|
-
await Promise.all(
|
|
109
|
+
await Promise.all(
|
|
110
|
+
chunk(calls, 5).map(batch => new BatchCall(this.defaultWallet, batch).simulate({ from: this.defaultAddress })),
|
|
111
|
+
)
|
|
107
112
|
).flat();
|
|
108
113
|
expect(results[0]).toEqual(this.totalSupply);
|
|
109
114
|
|
|
@@ -126,12 +131,13 @@ export class TokenSimulator {
|
|
|
126
131
|
}
|
|
127
132
|
}
|
|
128
133
|
|
|
129
|
-
const defaultCalls =
|
|
130
|
-
for (const address of defaultLookups) {
|
|
131
|
-
defaultCalls.push(await this.token.methods.balance_of_private(address).request());
|
|
132
|
-
}
|
|
134
|
+
const defaultCalls = defaultLookups.map(address => this.token.methods.balance_of_private(address));
|
|
133
135
|
const results = (
|
|
134
|
-
await Promise.all(
|
|
136
|
+
await Promise.all(
|
|
137
|
+
chunk(defaultCalls, 4).map(batch =>
|
|
138
|
+
new BatchCall(this.defaultWallet, batch).simulate({ from: this.defaultAddress }),
|
|
139
|
+
),
|
|
140
|
+
)
|
|
135
141
|
).flat();
|
|
136
142
|
for (let i = 0; i < defaultLookups.length; i++) {
|
|
137
143
|
expect(results[i]).toEqual(this.balanceOfPrivate(defaultLookups[i]));
|
|
@@ -143,7 +149,9 @@ export class TokenSimulator {
|
|
|
143
149
|
const wallet = this.lookupProvider.get(address.toString());
|
|
144
150
|
const asset = wallet ? this.token.withWallet(wallet) : this.token;
|
|
145
151
|
|
|
146
|
-
const actualPrivateBalance = await asset.methods
|
|
152
|
+
const actualPrivateBalance = await asset.methods
|
|
153
|
+
.balance_of_private({ address })
|
|
154
|
+
.simulate({ from: this.defaultAddress });
|
|
147
155
|
expect(actualPrivateBalance).toEqual(this.balanceOfPrivate(address));
|
|
148
156
|
}
|
|
149
157
|
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
The flow is as follows:
|
|
2
|
+
|
|
3
|
+
1. Install/start KIND locally
|
|
4
|
+
2. Bootstrap (to build an aztec image)
|
|
5
|
+
3. Load image into kind
|
|
6
|
+
4. Deploy networks
|
|
7
|
+
5. Run tests in `yarn-project/end-to-end/src/spartan`
|
|
8
|
+
|
|
9
|
+
# Setup KIND
|
|
10
|
+
|
|
11
|
+
KIND is a kubernetes cluster that runs locally out of docker containers.
|
|
12
|
+
|
|
13
|
+
You can just
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
spartan/bootstrap.sh kind
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
You only need to do that once. If you do it again, it will destroy the cluster and recreate it (which you almost never need to do).
|
|
20
|
+
|
|
21
|
+
Now you’ll likely want some visibility into your cluster. You can
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
spartan/scripts/create_k8s_dashboard.sh
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
And after ~30 seconds or so you can
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
spartan/scripts/forward_k8s_dashboard.sh
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
That will run a port forward to your port `8443` . If you’re running in a remote environment (e.g. the mainframe), you’ll need to subsequently forward that back to your local machine. Cursor/VSCode have built in port forwarding (cmd/ctrl shift P, “forward”)
|
|
34
|
+
|
|
35
|
+
Open the forwarded page, and copy/paste the token that was generated when you forwarded the dashboard.
|
|
36
|
+
|
|
37
|
+
# Build an aztecprotocol:aztec image
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
./bootstrap.sh
|
|
41
|
+
export AZTEC_DOCKER_IMAGE="aztecprotocol/aztec:$(docker images "aztecprotocol/aztec" --format json | \
|
|
42
|
+
jq -r 'select(.Tag != "latest") | .Tag' | \
|
|
43
|
+
head -1)"
|
|
44
|
+
kind load docker-image $AZTEC_DOCKER_IMAGE
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
If you just changed typescript, you can (after the initial bootstrap)
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
./yarn-project/bootstrap.sh
|
|
51
|
+
./release-image/bootstrap.sh
|
|
52
|
+
export AZTEC_DOCKER_IMAGE="aztecprotocol/aztec:$(docker images "aztecprotocol/aztec" --format json | \
|
|
53
|
+
jq -r 'select(.Tag != "latest") | .Tag' | \
|
|
54
|
+
head -1)"
|
|
55
|
+
kind load docker-image $AZTEC_DOCKER_IMAGE
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The export is important there. The `AZTEC_DOCKER_IMAGE` env var is used as both:
|
|
59
|
+
|
|
60
|
+
- the container that runs the rollup contract deployment
|
|
61
|
+
- the containers for the aztec infrastructure (validators, provers, etc)
|
|
62
|
+
|
|
63
|
+
# Deploy Metrics
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
./spartan/bootstrap.sh metrics-kind
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
# Install Chaos Mesh
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
./spartan/bootstrap.sh chaos-mesh
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
# Deploy stuff
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
./spartan/bootstrap.sh network_deploy scenario.local
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
That will take 1-3 minutes. But at the end you should have everything you need.
|
|
82
|
+
|
|
83
|
+
You can (`k` is just an alias over `kubectl`)
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
❯ k get pods -n scenario
|
|
87
|
+
NAME READY STATUS RESTARTS AGE
|
|
88
|
+
deploy-rollup-contracts-2025-08-31-1511-w2dlb 0/1 Completed 0 2m34s
|
|
89
|
+
scenario-eth-beacon-0 1/1 Running 0 39m
|
|
90
|
+
scenario-eth-execution-0 1/1 Running 0 39m
|
|
91
|
+
scenario-eth-validator-0 1/1 Running 0 39m
|
|
92
|
+
scenario-p2p-bootstrap-node-5cbf9658b9-6vd9b 1/1 Running 0 20m
|
|
93
|
+
scenario-prover-agent-59bd96899d-46k5s 1/1 Running 0 116s
|
|
94
|
+
scenario-prover-agent-59bd96899d-vzvkd 1/1 Running 0 116s
|
|
95
|
+
scenario-prover-broker-0 1/1 Running 0 116s
|
|
96
|
+
scenario-prover-node-0 1/1 Running 0 116s
|
|
97
|
+
scenario-rpc-aztec-node-0 1/1 Running 0 116s
|
|
98
|
+
scenario-validator-0 1/1 Running 0 116s
|
|
99
|
+
scenario-validator-1 1/1 Running 0 116s
|
|
100
|
+
scenario-validator-2 1/1 Running 0 116s
|
|
101
|
+
scenario-validator-3 1/1 Running 0 116s
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
For example, you can forward back the ethereum node with
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
k port-forward -n scenario services/eth-devnet-eth-execution 8545:8545
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
And then do whatever you like with it.
|
|
111
|
+
|
|
112
|
+
# Run tests
|
|
113
|
+
|
|
114
|
+
With the cluster running, you can now easily run tests.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# run one
|
|
118
|
+
./spartan/bootstrap.sh single_test scenario.local spartan/smoke.test.ts
|
|
119
|
+
|
|
120
|
+
# run all (serially)
|
|
121
|
+
./spartan/bootstrap.sh network_tests scenario.local
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Right now, I recommend running the smoke test first, always, as it waits for the committee to exist.
|
|
125
|
+
|
|
126
|
+
# Teardown
|
|
127
|
+
|
|
128
|
+
You can just `k delete namespace scenario`. That will destroy everything in your kind cluster. To destroy the associated terraform state that was stored locally, just `./spartan/terraform/purge_local_state.sh`.
|