@aztec/end-to-end 0.0.0-test.1 → 0.0.1-fake-ceab37513c
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 +60 -0
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/benchmark.js +261 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +69 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -0
- package/dest/bench/client_flows/client_flows_benchmark.js +315 -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 +99 -0
- package/dest/bench/utils.d.ts +10 -27
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +27 -43
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +15 -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 +66 -38
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +10 -18
- 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 +34 -53
- package/dest/e2e_deploy_contract/deploy_test.d.ts +4 -2
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +9 -6
- package/dest/e2e_epochs/epochs_test.d.ts +56 -17
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +222 -42
- 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 +60 -0
- package/dest/e2e_fees/fees_test.d.ts +16 -5
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +87 -88
- package/dest/e2e_l1_publisher/write_json.d.ts +8 -0
- package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
- package/dest/e2e_l1_publisher/write_json.js +57 -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 +5 -5
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +19 -14
- 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 +132 -0
- package/dest/e2e_p2p/p2p_network.d.ts +56 -21
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +154 -125
- package/dest/e2e_p2p/shared.d.ts +41 -3
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +146 -6
- package/dest/e2e_token_contract/token_contract_test.d.ts +10 -5
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +51 -24
- package/dest/{e2e_prover → fixtures}/e2e_prover_test.d.ts +7 -4
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
- package/dest/{e2e_prover → fixtures}/e2e_prover_test.js +67 -62
- package/dest/fixtures/fixtures.d.ts +5 -6
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +4 -3
- package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
- package/dest/fixtures/get_acvm_config.js +2 -14
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +8 -15
- package/dest/fixtures/l1_to_l2_messaging.d.ts +8 -5
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +44 -18
- package/dest/fixtures/setup_l1_contracts.d.ts +3 -3
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_l1_contracts.js +3 -3
- package/dest/fixtures/setup_p2p_test.d.ts +14 -6
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +73 -21
- package/dest/fixtures/snapshot_manager.d.ts +8 -3
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +120 -104
- package/dest/fixtures/token_utils.d.ts +4 -3
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +24 -7
- package/dest/fixtures/utils.d.ts +65 -22
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +439 -318
- 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/dest/shared/cross_chain_test_harness.d.ts +28 -18
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +97 -41
- package/dest/shared/gas_portal_test_harness.d.ts +23 -18
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +43 -25
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +5 -6
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +136 -90
- package/dest/simulators/lending_simulator.d.ts +5 -6
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +11 -15
- package/dest/simulators/token_simulator.d.ts +2 -1
- 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 +8 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +108 -22
- package/dest/spartan/utils.d.ts +60 -307
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +200 -115
- package/package.json +60 -56
- package/src/bench/client_flows/benchmark.ts +341 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +422 -0
- package/src/bench/client_flows/config.ts +61 -0
- package/src/bench/client_flows/data_extractor.ts +111 -0
- package/src/bench/utils.ts +26 -52
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +60 -40
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +47 -75
- package/src/e2e_deploy_contract/deploy_test.ts +11 -8
- package/src/e2e_epochs/epochs_test.ts +276 -54
- package/src/e2e_fees/bridging_race.notest.ts +75 -0
- package/src/e2e_fees/fees_test.ts +121 -108
- package/src/e2e_l1_publisher/write_json.ts +74 -0
- package/src/e2e_multi_validator/utils.ts +258 -0
- package/src/e2e_nested_contract/nested_contract_test.ts +22 -14
- package/src/e2e_p2p/inactivity_slash_test.ts +174 -0
- package/src/e2e_p2p/p2p_network.ts +212 -144
- package/src/e2e_p2p/shared.ts +234 -14
- package/src/e2e_token_contract/token_contract_test.ts +42 -38
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/{e2e_prover → fixtures}/e2e_prover_test.ts +62 -69
- package/src/fixtures/fixtures.ts +4 -3
- package/src/fixtures/get_acvm_config.ts +2 -10
- package/src/fixtures/get_bb_config.ts +15 -11
- package/src/fixtures/l1_to_l2_messaging.ts +53 -23
- package/src/fixtures/setup_l1_contracts.ts +5 -6
- package/src/fixtures/setup_p2p_test.ts +112 -30
- package/src/fixtures/snapshot_manager.ts +150 -102
- package/src/fixtures/token_utils.ts +33 -8
- package/src/fixtures/utils.ts +530 -352
- package/src/fixtures/web3signer.ts +46 -0
- package/src/guides/up_quick_start.sh +4 -4
- package/src/shared/cross_chain_test_harness.ts +92 -52
- package/src/shared/gas_portal_test_harness.ts +47 -31
- package/src/shared/uniswap_l1_l2.ts +127 -124
- package/src/simulators/lending_simulator.ts +11 -15
- package/src/simulators/token_simulator.ts +17 -12
- package/src/spartan/DEVELOP.md +116 -0
- package/src/spartan/setup_test_wallets.ts +144 -29
- package/src/spartan/utils.ts +194 -116
- package/dest/e2e_prover/e2e_prover_test.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/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
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { getAddressFromPrivateKey } from '@aztec/ethereum';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import { writeFile } from 'fs/promises';
|
|
4
|
+
import { createServer } from 'http';
|
|
5
|
+
import { signMessage, signTypedData } from 'viem/accounts';
|
|
6
|
+
// Create a mock JSON RPC signer
|
|
7
|
+
// Only supports signing messages and type data
|
|
8
|
+
const SUPPORTED_METHODS = [
|
|
9
|
+
'eth_sign',
|
|
10
|
+
'eth_signTypedData_v4'
|
|
11
|
+
];
|
|
12
|
+
export function createJSONRPCSigner(keyLookup, stats) {
|
|
13
|
+
return createServer((req, res)=>{
|
|
14
|
+
if (req.method === 'POST') {
|
|
15
|
+
let body = '';
|
|
16
|
+
req.on('data', (chunk)=>{
|
|
17
|
+
body += chunk.toString();
|
|
18
|
+
});
|
|
19
|
+
req.on('end', ()=>{
|
|
20
|
+
try {
|
|
21
|
+
const jsonRequest = JSON.parse(body);
|
|
22
|
+
res.writeHead(200, {
|
|
23
|
+
'Content-Type': 'application/json'
|
|
24
|
+
});
|
|
25
|
+
if (!SUPPORTED_METHODS.includes(jsonRequest.method)) {
|
|
26
|
+
res.end(JSON.stringify({
|
|
27
|
+
jsonrpc: '2.0',
|
|
28
|
+
id: jsonRequest.id,
|
|
29
|
+
error: {
|
|
30
|
+
code: -32601,
|
|
31
|
+
message: 'Method not supported'
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
// Get the address sending the transaction
|
|
37
|
+
const [address, data] = jsonRequest.params;
|
|
38
|
+
const lowerCaseAddress = address.toLowerCase();
|
|
39
|
+
stats.set(lowerCaseAddress, (stats.get(lowerCaseAddress) ?? 0) + 1);
|
|
40
|
+
// Find the private key for the address
|
|
41
|
+
const privateKey = keyLookup.get(address.toLowerCase());
|
|
42
|
+
if (!privateKey) {
|
|
43
|
+
res.end(JSON.stringify({
|
|
44
|
+
jsonrpc: '2.0',
|
|
45
|
+
id: jsonRequest.id,
|
|
46
|
+
error: {
|
|
47
|
+
code: -32602,
|
|
48
|
+
message: `No private key found for address ${address}`
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const promise = jsonRequest.method === 'eth_sign' ? signMessage({
|
|
54
|
+
message: {
|
|
55
|
+
raw: data
|
|
56
|
+
},
|
|
57
|
+
privateKey
|
|
58
|
+
}) : signTypedData({
|
|
59
|
+
privateKey,
|
|
60
|
+
...data
|
|
61
|
+
});
|
|
62
|
+
void promise.then((signature)=>{
|
|
63
|
+
res.end(JSON.stringify({
|
|
64
|
+
jsonrpc: '2.0',
|
|
65
|
+
id: jsonRequest.id,
|
|
66
|
+
result: signature
|
|
67
|
+
}));
|
|
68
|
+
});
|
|
69
|
+
} catch (err) {
|
|
70
|
+
res.end(JSON.stringify({
|
|
71
|
+
jsonrpc: '2.0',
|
|
72
|
+
id: 1,
|
|
73
|
+
error: {
|
|
74
|
+
code: -32603,
|
|
75
|
+
message: `${err}`
|
|
76
|
+
}
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
res.writeHead(405);
|
|
82
|
+
res.end('Method not allowed');
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
// Functions for creating file based key stores for the e2e_multi_validator_node_key_store test
|
|
87
|
+
export async function createKeyFile1(fileName, mnemonic, validatorIndex, publisher1Key, publisher2Key, coinbase, feeRecipient) {
|
|
88
|
+
const obj = {
|
|
89
|
+
schemaVersion: 1,
|
|
90
|
+
validators: [
|
|
91
|
+
{
|
|
92
|
+
attester: {
|
|
93
|
+
mnemonic: mnemonic,
|
|
94
|
+
accountIndex: 0,
|
|
95
|
+
addressIndex: validatorIndex,
|
|
96
|
+
addressCount: 1
|
|
97
|
+
},
|
|
98
|
+
coinbase: coinbase.toChecksumString(),
|
|
99
|
+
publisher: [
|
|
100
|
+
publisher1Key,
|
|
101
|
+
publisher2Key
|
|
102
|
+
],
|
|
103
|
+
feeRecipient: feeRecipient.toString()
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
};
|
|
107
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
108
|
+
}
|
|
109
|
+
export async function createKeyFile2(fileName, validatorKey, publisherMnemonic, publisher1Index, coinbase, feeRecipient) {
|
|
110
|
+
const obj = {
|
|
111
|
+
schemaVersion: 1,
|
|
112
|
+
validators: [
|
|
113
|
+
{
|
|
114
|
+
attester: validatorKey,
|
|
115
|
+
coinbase: coinbase.toChecksumString(),
|
|
116
|
+
publisher: {
|
|
117
|
+
mnemonic: publisherMnemonic,
|
|
118
|
+
accountIndex: 0,
|
|
119
|
+
addressIndex: publisher1Index,
|
|
120
|
+
addressCount: 2
|
|
121
|
+
},
|
|
122
|
+
feeRecipient: feeRecipient.toString()
|
|
123
|
+
}
|
|
124
|
+
]
|
|
125
|
+
};
|
|
126
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
127
|
+
}
|
|
128
|
+
export async function createKeyFile3(fileName, validatorAddress, publisher1Key, publisher2Key, coinbase, remoteSignerUrl, feeRecipient) {
|
|
129
|
+
const obj = {
|
|
130
|
+
schemaVersion: 1,
|
|
131
|
+
validators: [
|
|
132
|
+
{
|
|
133
|
+
attester: validatorAddress.toChecksumString(),
|
|
134
|
+
coinbase: coinbase.toChecksumString(),
|
|
135
|
+
publisher: [
|
|
136
|
+
publisher1Key,
|
|
137
|
+
publisher2Key
|
|
138
|
+
],
|
|
139
|
+
feeRecipient: feeRecipient.toString(),
|
|
140
|
+
remoteSigner: {
|
|
141
|
+
remoteSignerUrl: remoteSignerUrl
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
};
|
|
146
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
147
|
+
}
|
|
148
|
+
export async function createKeyFile4(fileName, validator1Address, validator2Address, publisher1Index, publisher2Key, mnemonic, publisher3Key, coinbase1, coinbase2, remoteSignerUrl, feeRecipient1, feeRecipient2) {
|
|
149
|
+
const obj = {
|
|
150
|
+
schemaVersion: 1,
|
|
151
|
+
remoteSigner: {
|
|
152
|
+
remoteSignerUrl: remoteSignerUrl
|
|
153
|
+
},
|
|
154
|
+
validators: [
|
|
155
|
+
{
|
|
156
|
+
attester: validator1Address.toChecksumString(),
|
|
157
|
+
coinbase: coinbase1.toChecksumString(),
|
|
158
|
+
publisher: {
|
|
159
|
+
mnemonic: mnemonic,
|
|
160
|
+
accountIndex: 0,
|
|
161
|
+
addressIndex: publisher1Index,
|
|
162
|
+
addressCount: 2
|
|
163
|
+
},
|
|
164
|
+
feeRecipient: feeRecipient1.toString()
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
attester: validator2Address.toChecksumString(),
|
|
168
|
+
coinbase: coinbase2.toChecksumString(),
|
|
169
|
+
publisher: [
|
|
170
|
+
publisher2Key,
|
|
171
|
+
publisher3Key
|
|
172
|
+
],
|
|
173
|
+
feeRecipient: feeRecipient2.toString()
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
};
|
|
177
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
178
|
+
}
|
|
179
|
+
export async function createKeyFile5(fileName, proverAddress, remoteSignerUrl) {
|
|
180
|
+
const obj = {
|
|
181
|
+
schemaVersion: 1,
|
|
182
|
+
prover: {
|
|
183
|
+
id: '0x1234567890123456789012345678901234567890',
|
|
184
|
+
publisher: [
|
|
185
|
+
{
|
|
186
|
+
address: proverAddress.toChecksumString(),
|
|
187
|
+
remoteSignerUrl: remoteSignerUrl
|
|
188
|
+
}
|
|
189
|
+
]
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
193
|
+
}
|
|
194
|
+
export async function createKeyFile6(fileName, mnemonic, validator1Index, coinbase, feeRecipient) {
|
|
195
|
+
const obj = {
|
|
196
|
+
schemaVersion: 1,
|
|
197
|
+
validators: [
|
|
198
|
+
{
|
|
199
|
+
attester: {
|
|
200
|
+
mnemonic: mnemonic,
|
|
201
|
+
accountIndex: 0,
|
|
202
|
+
addressIndex: validator1Index,
|
|
203
|
+
addressCount: 2
|
|
204
|
+
},
|
|
205
|
+
coinbase: coinbase.toChecksumString(),
|
|
206
|
+
feeRecipient: feeRecipient.toString()
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
};
|
|
210
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
211
|
+
}
|
|
212
|
+
export function addressForPrivateKey(privateKey) {
|
|
213
|
+
return EthAddress.fromString(getAddressFromPrivateKey(privateKey));
|
|
214
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { type AccountWallet,
|
|
2
|
-
import { ChildContract } from '@aztec/noir-contracts.js/Child';
|
|
3
|
-
import { ParentContract } from '@aztec/noir-contracts.js/Parent';
|
|
1
|
+
import { type AccountWallet, AztecAddress, type Logger, type PXE } from '@aztec/aztec.js';
|
|
2
|
+
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
3
|
+
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
4
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
5
5
|
export declare class NestedContractTest {
|
|
6
6
|
private numberOfAccounts;
|
|
7
7
|
private snapshotManager;
|
|
8
8
|
logger: Logger;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
wallet: AccountWallet;
|
|
10
|
+
defaultAccountAddress: AztecAddress;
|
|
11
11
|
pxe: PXE;
|
|
12
12
|
parentContract: ParentContract;
|
|
13
13
|
childContract: ChildContract;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nested_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_nested_contract/nested_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"nested_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_nested_contract/nested_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,YAAY,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAgB,MAAM,iBAAiB,CAAC;AACxG,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,sCAAsC,CAAC;AAEtE,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AAIzC,qBAAa,kBAAkB;IAY3B,OAAO,CAAC,gBAAgB;IAX1B,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAG,aAAa,CAAC;IACvB,qBAAqB,EAAG,YAAY,CAAC;IACrC,GAAG,EAAG,GAAG,CAAC;IAEV,cAAc,EAAG,cAAc,CAAC;IAChC,aAAa,EAAG,aAAa,CAAC;gBAG5B,QAAQ,EAAE,MAAM,EACR,gBAAgB,SAAI;IAM9B;;;;OAIG;IACG,kBAAkB;IAuBlB,KAAK;IAIL,QAAQ;IAId,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,oBAAoB;CAkB3B"}
|
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { createLogger } from '@aztec/aztec.js';
|
|
3
|
-
import { ChildContract } from '@aztec/noir-contracts.js/Child';
|
|
4
|
-
import { ParentContract } from '@aztec/noir-contracts.js/Parent';
|
|
3
|
+
import { ChildContract } from '@aztec/noir-test-contracts.js/Child';
|
|
4
|
+
import { ParentContract } from '@aztec/noir-test-contracts.js/Parent';
|
|
5
5
|
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
6
6
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
7
7
|
export class NestedContractTest {
|
|
8
8
|
numberOfAccounts;
|
|
9
9
|
snapshotManager;
|
|
10
10
|
logger;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
wallet;
|
|
12
|
+
defaultAccountAddress;
|
|
13
13
|
pxe;
|
|
14
14
|
parentContract;
|
|
15
15
|
childContract;
|
|
16
16
|
constructor(testName, numberOfAccounts = 1){
|
|
17
17
|
this.numberOfAccounts = numberOfAccounts;
|
|
18
|
-
this.wallets = [];
|
|
19
|
-
this.accounts = [];
|
|
20
18
|
this.snapshot = (name, apply, restore = ()=>Promise.resolve())=>this.snapshotManager.snapshot(name, apply, restore);
|
|
21
19
|
this.logger = createLogger(`e2e:e2e_nested_contract:${testName}`);
|
|
22
20
|
this.snapshotManager = createSnapshotManager(`e2e_nested_contract/${testName}-${numberOfAccounts}`, dataPath);
|
|
@@ -27,14 +25,17 @@ export class NestedContractTest {
|
|
|
27
25
|
* 2. Publicly deploy accounts
|
|
28
26
|
*/ async applyBaseSnapshots() {
|
|
29
27
|
await this.snapshotManager.snapshot('accounts', deployAccounts(this.numberOfAccounts, this.logger), async ({ deployedAccounts }, { pxe })=>{
|
|
30
|
-
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
28
|
+
const wallets = await Promise.all(deployedAccounts.map((a)=>getSchnorrWallet(pxe, a.address, a.signingKey)));
|
|
29
|
+
wallets.forEach((w, i)=>this.logger.verbose(`Wallet ${i} address: ${w.getAddress()}`));
|
|
30
|
+
[this.wallet] = wallets;
|
|
31
|
+
this.defaultAccountAddress = this.wallet.getAddress();
|
|
33
32
|
this.pxe = pxe;
|
|
34
33
|
});
|
|
35
34
|
await this.snapshotManager.snapshot('public_deploy', async ()=>{}, async ()=>{
|
|
36
35
|
this.logger.verbose(`Public deploy accounts...`);
|
|
37
|
-
await publicDeployAccounts(this.
|
|
36
|
+
await publicDeployAccounts(this.wallet, [
|
|
37
|
+
this.defaultAccountAddress
|
|
38
|
+
]);
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
41
|
async setup() {
|
|
@@ -46,15 +47,19 @@ export class NestedContractTest {
|
|
|
46
47
|
snapshot;
|
|
47
48
|
async applyManualSnapshots() {
|
|
48
49
|
await this.snapshotManager.snapshot('manual', async ()=>{
|
|
49
|
-
const parentContract = await ParentContract.deploy(this.
|
|
50
|
-
|
|
50
|
+
const parentContract = await ParentContract.deploy(this.wallet).send({
|
|
51
|
+
from: this.defaultAccountAddress
|
|
52
|
+
}).deployed();
|
|
53
|
+
const childContract = await ChildContract.deploy(this.wallet).send({
|
|
54
|
+
from: this.defaultAccountAddress
|
|
55
|
+
}).deployed();
|
|
51
56
|
return {
|
|
52
57
|
parentContractAddress: parentContract.address,
|
|
53
58
|
childContractAddress: childContract.address
|
|
54
59
|
};
|
|
55
60
|
}, async ({ parentContractAddress, childContractAddress })=>{
|
|
56
|
-
this.parentContract = await ParentContract.at(parentContractAddress, this.
|
|
57
|
-
this.childContract = await ChildContract.at(childContractAddress, this.
|
|
61
|
+
this.parentContract = await ParentContract.at(parentContractAddress, this.wallet);
|
|
62
|
+
this.childContract = await ChildContract.at(childContractAddress, this.wallet);
|
|
58
63
|
});
|
|
59
64
|
}
|
|
60
65
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
+
import { EthAddress } from '@aztec/aztec.js';
|
|
3
|
+
import { RollupContract } from '@aztec/ethereum';
|
|
4
|
+
import 'jest-extended';
|
|
5
|
+
import { P2PNetworkTest } from './p2p_network.js';
|
|
6
|
+
export declare class P2PInactivityTest {
|
|
7
|
+
readonly test: P2PNetworkTest;
|
|
8
|
+
nodes: AztecNodeService[];
|
|
9
|
+
activeNodes: AztecNodeService[];
|
|
10
|
+
inactiveNodes: AztecNodeService[];
|
|
11
|
+
rollup: RollupContract;
|
|
12
|
+
offlineValidators: EthAddress[];
|
|
13
|
+
private dataDir;
|
|
14
|
+
private inactiveNodeCount;
|
|
15
|
+
private keepInitialNode;
|
|
16
|
+
constructor(test: P2PNetworkTest, opts: {
|
|
17
|
+
inactiveNodeCount: number;
|
|
18
|
+
keepInitialNode?: boolean;
|
|
19
|
+
});
|
|
20
|
+
static create(testName: string, opts: {
|
|
21
|
+
slashInactivityConsecutiveEpochThreshold: number;
|
|
22
|
+
inactiveNodeCount: number;
|
|
23
|
+
keepInitialNode?: boolean;
|
|
24
|
+
}): Promise<P2PInactivityTest>;
|
|
25
|
+
setup(): Promise<this>;
|
|
26
|
+
teardown(): Promise<void>;
|
|
27
|
+
get ctx(): import("../fixtures/snapshot_manager.js").SubsystemsContext;
|
|
28
|
+
get logger(): import("@aztec/aztec.js").Logger;
|
|
29
|
+
get slashingAmount(): bigint;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=inactivity_slash_test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inactivity_slash_test.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/inactivity_slash_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,eAAe,CAAC;AAKvB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBlD,qBAAa,iBAAiB;aAaV,IAAI,EAAE,cAAc;IAZ/B,KAAK,EAAG,gBAAgB,EAAE,CAAC;IAC3B,WAAW,EAAG,gBAAgB,EAAE,CAAC;IACjC,aAAa,EAAG,gBAAgB,EAAE,CAAC;IAEnC,MAAM,EAAG,cAAc,CAAC;IACxB,iBAAiB,EAAG,UAAU,EAAE,CAAC;IAExC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,eAAe,CAAU;gBAGf,IAAI,EAAE,cAAc,EACpC,IAAI,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE;WAOnD,MAAM,CACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;QAAE,wCAAwC,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE;IAgCrG,KAAK;IAwEL,QAAQ;IAQrB,IAAW,GAAG,gEAEb;IAED,IAAW,MAAM,qCAEhB;IAED,IAAW,cAAc,WAExB;CACF"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import 'jest-extended';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { createNodes } from '../fixtures/setup_p2p_test.js';
|
|
6
|
+
import { P2PNetworkTest } from './p2p_network.js';
|
|
7
|
+
const NUM_NODES = 6;
|
|
8
|
+
const NUM_VALIDATORS = NUM_NODES;
|
|
9
|
+
const COMMITTEE_SIZE = NUM_VALIDATORS;
|
|
10
|
+
const SLASHING_QUORUM = 3;
|
|
11
|
+
const EPOCH_DURATION = 2;
|
|
12
|
+
const SLASHING_ROUND_SIZE_IN_EPOCHS = 2;
|
|
13
|
+
const BOOT_NODE_UDP_PORT = 4500;
|
|
14
|
+
const ETHEREUM_SLOT_DURATION = 4;
|
|
15
|
+
const AZTEC_SLOT_DURATION = 8;
|
|
16
|
+
const SLASHING_UNIT = BigInt(1e18);
|
|
17
|
+
const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
|
|
18
|
+
// How many epochs it may take to set everything up, so we dont slash during this period
|
|
19
|
+
const SETUP_EPOCH_DURATION = 5;
|
|
20
|
+
export class P2PInactivityTest {
|
|
21
|
+
test;
|
|
22
|
+
nodes;
|
|
23
|
+
activeNodes;
|
|
24
|
+
inactiveNodes;
|
|
25
|
+
rollup;
|
|
26
|
+
offlineValidators;
|
|
27
|
+
dataDir;
|
|
28
|
+
inactiveNodeCount;
|
|
29
|
+
keepInitialNode;
|
|
30
|
+
constructor(test, opts){
|
|
31
|
+
this.test = test;
|
|
32
|
+
this.dataDir = fs.mkdtempSync(path.join(os.tmpdir(), test.testName));
|
|
33
|
+
this.inactiveNodeCount = opts.inactiveNodeCount;
|
|
34
|
+
this.keepInitialNode = opts.keepInitialNode ?? false;
|
|
35
|
+
}
|
|
36
|
+
static async create(testName, opts) {
|
|
37
|
+
const test = await P2PNetworkTest.create({
|
|
38
|
+
testName,
|
|
39
|
+
numberOfNodes: 0,
|
|
40
|
+
numberOfValidators: NUM_VALIDATORS,
|
|
41
|
+
basePort: BOOT_NODE_UDP_PORT,
|
|
42
|
+
startProverNode: true,
|
|
43
|
+
initialConfig: {
|
|
44
|
+
proverNodeConfig: {
|
|
45
|
+
proverNodeEpochProvingDelayMs: AZTEC_SLOT_DURATION * 1000
|
|
46
|
+
},
|
|
47
|
+
aztecTargetCommitteeSize: COMMITTEE_SIZE,
|
|
48
|
+
aztecSlotDuration: AZTEC_SLOT_DURATION,
|
|
49
|
+
ethereumSlotDuration: ETHEREUM_SLOT_DURATION,
|
|
50
|
+
aztecProofSubmissionEpochs: 1024,
|
|
51
|
+
listenAddress: '127.0.0.1',
|
|
52
|
+
minTxsPerBlock: 0,
|
|
53
|
+
aztecEpochDuration: EPOCH_DURATION,
|
|
54
|
+
validatorReexecute: false,
|
|
55
|
+
sentinelEnabled: true,
|
|
56
|
+
slashingQuorum: SLASHING_QUORUM,
|
|
57
|
+
slashingRoundSizeInEpochs: SLASHING_ROUND_SIZE_IN_EPOCHS,
|
|
58
|
+
slashInactivityTargetPercentage: 0.8,
|
|
59
|
+
slashGracePeriodL2Slots: SETUP_EPOCH_DURATION * EPOCH_DURATION,
|
|
60
|
+
slashAmountSmall: SLASHING_UNIT,
|
|
61
|
+
slashAmountMedium: SLASHING_UNIT * 2n,
|
|
62
|
+
slashAmountLarge: SLASHING_UNIT * 3n,
|
|
63
|
+
...opts
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return new P2PInactivityTest(test, opts);
|
|
67
|
+
}
|
|
68
|
+
async setup() {
|
|
69
|
+
await this.test.applyBaseSnapshots();
|
|
70
|
+
await this.test.setup();
|
|
71
|
+
// Set slashing penalties for inactivity
|
|
72
|
+
const { rollup } = await this.test.getContracts();
|
|
73
|
+
const [activationThreshold, ejectionThreshold, localEjectionThreshold] = await Promise.all([
|
|
74
|
+
rollup.getActivationThreshold(),
|
|
75
|
+
rollup.getEjectionThreshold(),
|
|
76
|
+
rollup.getLocalEjectionThreshold()
|
|
77
|
+
]);
|
|
78
|
+
const biggestEjection = ejectionThreshold > localEjectionThreshold ? ejectionThreshold : localEjectionThreshold;
|
|
79
|
+
expect(activationThreshold - SLASHING_AMOUNT).toBeLessThan(biggestEjection);
|
|
80
|
+
this.test.ctx.aztecNodeConfig.slashInactivityPenalty = SLASHING_AMOUNT;
|
|
81
|
+
this.rollup = rollup;
|
|
82
|
+
if (!this.keepInitialNode) {
|
|
83
|
+
await this.test.ctx.aztecNode.stop();
|
|
84
|
+
}
|
|
85
|
+
// Create all active nodes
|
|
86
|
+
this.activeNodes = await createNodes(this.test.ctx.aztecNodeConfig, this.test.ctx.dateProvider, this.test.bootstrapNodeEnr, NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode), BOOT_NODE_UDP_PORT, this.test.prefilledPublicData, this.dataDir, undefined, Number(this.keepInitialNode));
|
|
87
|
+
// And the ones with an initially disabled sequencer
|
|
88
|
+
const inactiveConfig = {
|
|
89
|
+
...this.test.ctx.aztecNodeConfig,
|
|
90
|
+
dontStartSequencer: true
|
|
91
|
+
};
|
|
92
|
+
this.inactiveNodes = await createNodes(inactiveConfig, this.test.ctx.dateProvider, this.test.bootstrapNodeEnr, this.inactiveNodeCount, BOOT_NODE_UDP_PORT, this.test.prefilledPublicData, this.dataDir, undefined, NUM_NODES - this.inactiveNodeCount);
|
|
93
|
+
this.nodes = [
|
|
94
|
+
...this.keepInitialNode ? [
|
|
95
|
+
this.test.ctx.aztecNode
|
|
96
|
+
] : [],
|
|
97
|
+
...this.activeNodes,
|
|
98
|
+
...this.inactiveNodes
|
|
99
|
+
];
|
|
100
|
+
if (this.nodes.length !== NUM_NODES) {
|
|
101
|
+
throw new Error(`Expected ${NUM_NODES} nodes but got ${this.nodes.length}`);
|
|
102
|
+
}
|
|
103
|
+
this.offlineValidators = this.test.validators.slice(this.test.validators.length - this.inactiveNodeCount).map((a)=>a.attester);
|
|
104
|
+
this.test.logger.warn(`Setup complete. Offline validators are ${this.offlineValidators.join(', ')}.`, {
|
|
105
|
+
validators: this.test.validators,
|
|
106
|
+
offlineValidators: this.offlineValidators
|
|
107
|
+
});
|
|
108
|
+
this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION + 1} to start slashing`);
|
|
109
|
+
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(SETUP_EPOCH_DURATION + 1);
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
async teardown() {
|
|
113
|
+
await this.test.stopNodes(this.nodes);
|
|
114
|
+
await this.test.teardown();
|
|
115
|
+
for(let i = 0; i < NUM_NODES; i++){
|
|
116
|
+
fs.rmSync(`${this.dataDir}-${i}`, {
|
|
117
|
+
recursive: true,
|
|
118
|
+
force: true,
|
|
119
|
+
maxRetries: 3
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
get ctx() {
|
|
124
|
+
return this.test.ctx;
|
|
125
|
+
}
|
|
126
|
+
get logger() {
|
|
127
|
+
return this.test.logger;
|
|
128
|
+
}
|
|
129
|
+
get slashingAmount() {
|
|
130
|
+
return SLASHING_AMOUNT;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -1,61 +1,96 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
|
-
import type {
|
|
3
|
-
import type
|
|
4
|
-
import {
|
|
2
|
+
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
+
import { type AccountWalletWithSecretKey, AztecAddress } from '@aztec/aztec.js';
|
|
4
|
+
import { type EmpireSlashingProposerContract, type Operator, RollupContract, type TallySlashingProposerContract, type ViemClient } from '@aztec/ethereum';
|
|
5
|
+
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
5
6
|
import { type Logger } from '@aztec/foundation/log';
|
|
6
|
-
import {
|
|
7
|
+
import { SlasherAbi } from '@aztec/l1-artifacts';
|
|
8
|
+
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
7
9
|
import type { BootstrapNode } from '@aztec/p2p/bootstrap';
|
|
10
|
+
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
8
11
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
12
|
+
import { type GetContractReturnType } from 'viem';
|
|
9
13
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
14
|
+
import { type SetupOptions } from '../fixtures/utils.js';
|
|
10
15
|
export declare const WAIT_FOR_TX_TIMEOUT: number;
|
|
11
|
-
export declare const
|
|
16
|
+
export declare const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES: {
|
|
12
17
|
aztecSlotDuration: number;
|
|
13
18
|
ethereumSlotDuration: number;
|
|
19
|
+
aztecProofSubmissionWindow: number;
|
|
14
20
|
};
|
|
15
21
|
export declare class P2PNetworkTest {
|
|
22
|
+
readonly testName: string;
|
|
16
23
|
bootstrapNodeEnr: string;
|
|
17
24
|
bootNodePort: number;
|
|
18
|
-
|
|
25
|
+
numberOfValidators: number;
|
|
26
|
+
numberOfNodes: number;
|
|
19
27
|
private metricsPort?;
|
|
20
28
|
private snapshotManager;
|
|
21
|
-
|
|
29
|
+
baseAccountPrivateKey: `0x${string}`;
|
|
30
|
+
baseAccount: {
|
|
31
|
+
address: import("viem").Address;
|
|
32
|
+
nonceManager?: import("viem").NonceManager | undefined;
|
|
33
|
+
sign: (parameters: {
|
|
34
|
+
hash: import("viem").Hash;
|
|
35
|
+
}) => Promise<import("viem").Hex>;
|
|
36
|
+
signAuthorization: (parameters: import("viem").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
|
|
37
|
+
signMessage: ({ message }: {
|
|
38
|
+
message: import("viem").SignableMessage;
|
|
39
|
+
}) => Promise<import("viem").Hex>;
|
|
40
|
+
signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
|
|
41
|
+
serializer?: serializer | undefined;
|
|
42
|
+
} | undefined) => Promise<import("viem").Hex>;
|
|
43
|
+
signTypedData: <const typedData extends import("viem").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<import("viem").Hex>;
|
|
44
|
+
publicKey: import("viem").Hex;
|
|
45
|
+
source: "privateKey";
|
|
46
|
+
type: "local";
|
|
47
|
+
};
|
|
22
48
|
logger: Logger;
|
|
23
49
|
monitor: ChainMonitor;
|
|
24
50
|
ctx: SubsystemsContext;
|
|
25
51
|
attesterPrivateKeys: `0x${string}`[];
|
|
26
52
|
attesterPublicKeys: string[];
|
|
27
|
-
proposerPrivateKeys: `0x${string}`[];
|
|
28
53
|
peerIdPrivateKeys: string[];
|
|
54
|
+
validators: Operator[];
|
|
29
55
|
deployedAccounts: InitialAccountData[];
|
|
30
56
|
prefilledPublicData: PublicDataTreeLeaf[];
|
|
31
57
|
wallet?: AccountWalletWithSecretKey;
|
|
58
|
+
defaultAccountAddress?: AztecAddress;
|
|
32
59
|
spamContract?: SpamContract;
|
|
33
60
|
bootstrapNode?: BootstrapNode;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
constructor(testName: string, bootstrapNodeEnr: string, bootNodePort: number, numberOfNodes: number, initialValidatorConfig: AztecNodeConfig, metricsPort?: number | undefined);
|
|
37
|
-
static create({ testName, numberOfNodes, basePort, metricsPort, initialConfig, }: {
|
|
61
|
+
constructor(testName: string, bootstrapNodeEnr: string, bootNodePort: number, numberOfValidators: number, initialValidatorConfig: SetupOptions, numberOfNodes?: number, metricsPort?: number | undefined, startProverNode?: boolean, mockZkPassportVerifier?: boolean);
|
|
62
|
+
static create({ testName, numberOfNodes, numberOfValidators, basePort, metricsPort, initialConfig, startProverNode, mockZkPassportVerifier, }: {
|
|
38
63
|
testName: string;
|
|
39
64
|
numberOfNodes: number;
|
|
65
|
+
numberOfValidators: number;
|
|
40
66
|
basePort?: number;
|
|
41
67
|
metricsPort?: number;
|
|
42
|
-
initialConfig?:
|
|
68
|
+
initialConfig?: SetupOptions;
|
|
69
|
+
startProverNode?: boolean;
|
|
70
|
+
mockZkPassportVerifier?: boolean;
|
|
43
71
|
}): Promise<P2PNetworkTest>;
|
|
44
72
|
get fundedAccount(): InitialAccountData;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* When using fake timers, we need to keep the system and anvil clocks in sync.
|
|
51
|
-
*/
|
|
52
|
-
syncMockSystemTime(): Promise<void>;
|
|
73
|
+
addBootstrapNode(): Promise<void>;
|
|
74
|
+
getValidators(): {
|
|
75
|
+
validators: Operator[];
|
|
76
|
+
};
|
|
53
77
|
applyBaseSnapshots(): Promise<void>;
|
|
54
78
|
setupAccount(): Promise<void>;
|
|
55
79
|
deploySpamContract(): Promise<void>;
|
|
56
80
|
removeInitialNode(): Promise<void>;
|
|
81
|
+
sendDummyTx(): Promise<{
|
|
82
|
+
receipt: import("viem").TransactionReceipt;
|
|
83
|
+
state: import("@aztec/ethereum").L1TxState;
|
|
84
|
+
}>;
|
|
85
|
+
private _sendDummyTx;
|
|
57
86
|
setup(): Promise<void>;
|
|
58
87
|
stopNodes(nodes: AztecNodeService[]): Promise<void>;
|
|
59
88
|
teardown(): Promise<void>;
|
|
89
|
+
getContracts(): Promise<{
|
|
90
|
+
rollup: RollupContract;
|
|
91
|
+
slasherContract: GetContractReturnType<typeof SlasherAbi, ViemClient>;
|
|
92
|
+
slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
|
|
93
|
+
slashFactory: SlashFactoryContract;
|
|
94
|
+
}>;
|
|
60
95
|
}
|
|
61
96
|
//# sourceMappingURL=p2p_network.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"p2p_network.d.ts","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