@aztec/end-to-end 2.0.0-nightly.20250826 → 2.0.0-nightly.20250828
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/e2e_epochs/epochs_test.d.ts +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +8 -3
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +2 -5
- 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 +220 -0
- package/dest/e2e_p2p/p2p_network.d.ts +3 -3
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +5 -8
- package/dest/e2e_p2p/shared.d.ts +13 -7
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +76 -38
- package/dest/fixtures/e2e_prover_test.js +4 -2
- package/dest/fixtures/setup_p2p_test.js +3 -1
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +9 -6
- package/dest/fixtures/utils.d.ts +6 -1
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +27 -9
- package/package.json +36 -35
- package/src/e2e_epochs/epochs_test.ts +11 -4
- package/src/e2e_fees/fees_test.ts +2 -2
- package/src/e2e_multi_validator/utils.ts +264 -0
- package/src/e2e_p2p/p2p_network.ts +9 -9
- package/src/e2e_p2p/shared.ts +101 -58
- package/src/fixtures/e2e_prover_test.ts +2 -2
- package/src/fixtures/setup_p2p_test.ts +1 -1
- package/src/fixtures/snapshot_manager.ts +6 -3
- package/src/fixtures/utils.ts +39 -9
|
@@ -6,7 +6,7 @@ import { ChainMonitor, type Delayer } from '@aztec/ethereum/test';
|
|
|
6
6
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
7
7
|
import { ProverNode } from '@aztec/prover-node';
|
|
8
8
|
import { type SequencerClient, type SequencerEvents } from '@aztec/sequencer-client';
|
|
9
|
-
import
|
|
9
|
+
import { EthAddress, type L2BlockNumber } from '@aztec/stdlib/block';
|
|
10
10
|
import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
11
11
|
import { type EndToEndContext, type SetupOptions } from '../fixtures/utils.js';
|
|
12
12
|
export declare const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,EAAE,EACF,KAAK,MAAM,EAEX,KAAK,MAAM,EAKZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAA4B,KAAK,wBAAwB,EAA0B,MAAM,iBAAiB,CAAC;AAClH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAkB,KAAK,OAAO,EAAqC,MAAM,sBAAsB,CAAC;AAIrH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,EAAE,UAAU,EAAuB,MAAM,oBAAoB,CAAC;AAErE,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,eAAe,EAGrB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,
|
|
1
|
+
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,EAAE,EACF,KAAK,MAAM,EAEX,KAAK,MAAM,EAKZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAA4B,KAAK,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3B,0EAA0E;IAC7D,mBAAmB,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO;IAW9E,oBAAoB,CACzB,UAAU,EAAE,eAAe,EAAE,EAC7B,WAAW,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAc;;;;CAiD/D"}
|
|
@@ -9,6 +9,7 @@ import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
|
9
9
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
10
10
|
import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
11
11
|
import { SequencerState } from '@aztec/sequencer-client';
|
|
12
|
+
import { EthAddress } from '@aztec/stdlib/block';
|
|
12
13
|
import { getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
13
14
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
14
15
|
import { join } from 'path';
|
|
@@ -78,7 +79,8 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
78
79
|
proverTestDelayMs: opts.proverTestDelayMs ?? 0,
|
|
79
80
|
// We use numeric incremental prover ids for simplicity, but we can switch to
|
|
80
81
|
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
81
|
-
|
|
82
|
+
// Use numeric EthAddress for deterministic prover id
|
|
83
|
+
proverId: EthAddress.fromNumber(1),
|
|
82
84
|
// This must be enough so that the tx from the prover is delayed properly,
|
|
83
85
|
// but not so much to hang the sequencer and timeout the teardown
|
|
84
86
|
txPropagationMaxQueryAttempts: opts.txPropagationMaxQueryAttempts ?? 12,
|
|
@@ -129,7 +131,7 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
129
131
|
const suffix = (this.proverNodes.length + 1).toString();
|
|
130
132
|
const proverNode = await withLogNameSuffix(suffix, ()=>createAndSyncProverNode(proverNodePrivateKey, {
|
|
131
133
|
...this.context.config,
|
|
132
|
-
proverId:
|
|
134
|
+
proverId: EthAddress.fromNumber(parseInt(suffix, 10))
|
|
133
135
|
}, {
|
|
134
136
|
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex'))
|
|
135
137
|
}, this.context.aztecNode, undefined, {
|
|
@@ -182,9 +184,12 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
182
184
|
// which directly exposes the delayer and sets any test config.
|
|
183
185
|
if (opts.txDelayerMaxInclusionTimeIntoSlot !== undefined) {
|
|
184
186
|
this.logger.info(`Setting tx delayer max inclusion time into slot to ${opts.txDelayerMaxInclusionTimeIntoSlot} seconds`);
|
|
187
|
+
// Here we reach into the sequencer and hook in a tx delayer. The problem is that the sequencer's l1 utils only uses a public client, not a wallet.
|
|
188
|
+
// The delayer needs a wallet (a client that can sign), so we have to create one here.
|
|
189
|
+
const l1Client = createExtendedL1Client(resolvedConfig.l1RpcUrls, resolvedConfig.publisherPrivateKeys[0].getValue());
|
|
185
190
|
const sequencer = node.getSequencer();
|
|
186
191
|
const publisher = sequencer.sequencer.publisher;
|
|
187
|
-
const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, this.L1_BLOCK_TIME_IN_S);
|
|
192
|
+
const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, this.L1_BLOCK_TIME_IN_S, l1Client);
|
|
188
193
|
delayed.delayer.setMaxInclusionTimeIntoSlot(opts.txDelayerMaxInclusionTimeIntoSlot);
|
|
189
194
|
publisher.l1TxUtils = delayed;
|
|
190
195
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU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E2E_DATA_PATH: dataPath } = process.env;
|
|
|
75
75
|
if (!numberOfAccounts) {
|
|
76
76
|
throw new Error('There must be at least 1 initial account.');
|
|
77
77
|
}
|
|
78
|
+
setupOptions.coinbase ??= EthAddress.random();
|
|
79
|
+
this.coinbase = setupOptions.coinbase;
|
|
78
80
|
this.logger = createLogger(`e2e:e2e_fees:${testName}`);
|
|
79
81
|
this.snapshotManager = createSnapshotManager(`e2e_fees/${testName}-${numberOfAccounts}`, dataPath, {
|
|
80
82
|
startProverNode: true,
|
|
@@ -85,10 +87,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
85
87
|
}
|
|
86
88
|
async setup() {
|
|
87
89
|
const context = await this.snapshotManager.setup();
|
|
88
|
-
await context.aztecNode.setConfig({
|
|
89
|
-
feeRecipient: this.sequencerAddress,
|
|
90
|
-
coinbase: this.coinbase
|
|
91
|
-
});
|
|
92
90
|
this.rollupContract = RollupContract.getFromConfig(context.aztecNodeConfig);
|
|
93
91
|
this.chainMonitor = new ChainMonitor(this.rollupContract, context.dateProvider, this.logger, 200).start();
|
|
94
92
|
return this;
|
|
@@ -157,7 +155,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
157
155
|
this.fpcAdmin = this.aliceAddress;
|
|
158
156
|
const canonicalFeeJuice = await getCanonicalFeeJuice();
|
|
159
157
|
this.feeJuiceContract = await FeeJuiceContract.at(canonicalFeeJuice.address, this.aliceWallet);
|
|
160
|
-
this.coinbase = EthAddress.random();
|
|
161
158
|
});
|
|
162
159
|
}
|
|
163
160
|
async applyPublicDeployAccountsSnapshot() {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AztecAddress } from '@aztec/aztec.js';
|
|
2
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import type { EthPrivateKey } from '@aztec/node-keystore';
|
|
4
|
+
export declare function createJSONRPCSigner(keyLookup: Map<string, EthPrivateKey>, stats: Map<string, number>): import("http").Server<typeof import("http").IncomingMessage, typeof import("http").ServerResponse>;
|
|
5
|
+
export declare function createKeyFile1(fileName: string, mnemonic: string, validatorIndex: number, publisher1Key: EthPrivateKey, publisher2Key: EthPrivateKey, coinbase: EthAddress, feeRecipient: AztecAddress): Promise<void>;
|
|
6
|
+
export declare function createKeyFile2(fileName: string, validatorKey: EthPrivateKey, publisherMnemonic: string, publisher1Index: number, coinbase: EthAddress, feeRecipient: AztecAddress): Promise<void>;
|
|
7
|
+
export declare function createKeyFile3(fileName: string, validatorAddress: EthAddress, publisher1Key: EthPrivateKey, publisher2Key: EthPrivateKey, coinbase: EthAddress, remoteSignerUrl: string, feeRecipient: AztecAddress): Promise<void>;
|
|
8
|
+
export declare function createKeyFile4(fileName: string, validator1Address: EthAddress, validator2Address: EthAddress, publisher1Index: number, publisher2Key: EthPrivateKey, mnemonic: string, publisher3Key: EthPrivateKey, coinbase1: EthAddress, coinbase2: EthAddress, remoteSignerUrl: string, feeRecipient1: AztecAddress, feeRecipient2: AztecAddress): Promise<void>;
|
|
9
|
+
export declare function createKeyFile5(fileName: string, proverAddress: EthAddress, remoteSignerUrl: string): Promise<void>;
|
|
10
|
+
export declare function createKeyFile6(fileName: string, mnemonic: string, validator1Index: number, coinbase: EthAddress, feeRecipient: AztecAddress): Promise<void>;
|
|
11
|
+
export declare function addressForPrivateKey(privateKey: EthPrivateKey): EthAddress;
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/e2e_multi_validator/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAW1D,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa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AY,iBAkB3B;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,aAAa,GAAG,UAAU,CAE1E"}
|
|
@@ -0,0 +1,220 @@
|
|
|
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: {
|
|
134
|
+
address: validatorAddress.toChecksumString()
|
|
135
|
+
},
|
|
136
|
+
coinbase: coinbase.toChecksumString(),
|
|
137
|
+
publisher: [
|
|
138
|
+
publisher1Key,
|
|
139
|
+
publisher2Key
|
|
140
|
+
],
|
|
141
|
+
feeRecipient: feeRecipient.toString(),
|
|
142
|
+
remoteSigner: {
|
|
143
|
+
remoteSignerUrl: remoteSignerUrl
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
};
|
|
148
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
149
|
+
}
|
|
150
|
+
export async function createKeyFile4(fileName, validator1Address, validator2Address, publisher1Index, publisher2Key, mnemonic, publisher3Key, coinbase1, coinbase2, remoteSignerUrl, feeRecipient1, feeRecipient2) {
|
|
151
|
+
const obj = {
|
|
152
|
+
schemaVersion: 1,
|
|
153
|
+
remoteSigner: {
|
|
154
|
+
remoteSignerUrl: remoteSignerUrl
|
|
155
|
+
},
|
|
156
|
+
validators: [
|
|
157
|
+
{
|
|
158
|
+
attester: {
|
|
159
|
+
address: validator1Address.toChecksumString()
|
|
160
|
+
},
|
|
161
|
+
coinbase: coinbase1.toChecksumString(),
|
|
162
|
+
publisher: {
|
|
163
|
+
mnemonic: mnemonic,
|
|
164
|
+
accountIndex: 0,
|
|
165
|
+
addressIndex: publisher1Index,
|
|
166
|
+
addressCount: 2
|
|
167
|
+
},
|
|
168
|
+
feeRecipient: feeRecipient1.toString()
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
attester: {
|
|
172
|
+
address: validator2Address.toChecksumString()
|
|
173
|
+
},
|
|
174
|
+
coinbase: coinbase2.toChecksumString(),
|
|
175
|
+
publisher: [
|
|
176
|
+
publisher2Key,
|
|
177
|
+
publisher3Key
|
|
178
|
+
],
|
|
179
|
+
feeRecipient: feeRecipient2.toString()
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
};
|
|
183
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
184
|
+
}
|
|
185
|
+
export async function createKeyFile5(fileName, proverAddress, remoteSignerUrl) {
|
|
186
|
+
const obj = {
|
|
187
|
+
schemaVersion: 1,
|
|
188
|
+
prover: {
|
|
189
|
+
id: '0x1234567890123456789012345678901234567890',
|
|
190
|
+
publisher: [
|
|
191
|
+
{
|
|
192
|
+
address: proverAddress.toChecksumString(),
|
|
193
|
+
remoteSignerUrl: remoteSignerUrl
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
199
|
+
}
|
|
200
|
+
export async function createKeyFile6(fileName, mnemonic, validator1Index, coinbase, feeRecipient) {
|
|
201
|
+
const obj = {
|
|
202
|
+
schemaVersion: 1,
|
|
203
|
+
validators: [
|
|
204
|
+
{
|
|
205
|
+
attester: {
|
|
206
|
+
mnemonic: mnemonic,
|
|
207
|
+
accountIndex: 0,
|
|
208
|
+
addressIndex: validator1Index,
|
|
209
|
+
addressCount: 2
|
|
210
|
+
},
|
|
211
|
+
coinbase: coinbase.toChecksumString(),
|
|
212
|
+
feeRecipient: feeRecipient.toString()
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
};
|
|
216
|
+
await writeFile(fileName, JSON.stringify(obj, null, 2));
|
|
217
|
+
}
|
|
218
|
+
export function addressForPrivateKey(privateKey) {
|
|
219
|
+
return EthAddress.fromString(getAddressFromPrivateKey(privateKey));
|
|
220
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import type { AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
3
3
|
import { type AccountWalletWithSecretKey, AztecAddress } from '@aztec/aztec.js';
|
|
4
|
-
import { type Operator, RollupContract, type ViemClient } from '@aztec/ethereum';
|
|
4
|
+
import { type EmpireSlashingProposerContract, type Operator, RollupContract, type TallySlashingProposerContract, type ViemClient } from '@aztec/ethereum';
|
|
5
5
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
6
6
|
import { type Logger } from '@aztec/foundation/log';
|
|
7
|
-
import {
|
|
7
|
+
import { SlasherAbi } from '@aztec/l1-artifacts';
|
|
8
8
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
9
9
|
import type { BootstrapNode } from '@aztec/p2p/bootstrap';
|
|
10
10
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
@@ -87,7 +87,7 @@ export declare class P2PNetworkTest {
|
|
|
87
87
|
getContracts(): Promise<{
|
|
88
88
|
rollup: RollupContract;
|
|
89
89
|
slasherContract: GetContractReturnType<typeof SlasherAbi, ViemClient>;
|
|
90
|
-
slashingProposer:
|
|
90
|
+
slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
|
|
91
91
|
slashFactory: SlashFactoryContract;
|
|
92
92
|
}>;
|
|
93
93
|
}
|
|
@@ -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,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,KAAK,0BAA0B,EAAE,YAAY,EAAkB,MAAM,iBAAiB,CAAC;AAChG,OAAO,
|
|
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,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,KAAK,0BAA0B,EAAE,YAAY,EAAkB,MAAM,iBAAiB,CAAC;AAChG,OAAO,EACL,KAAK,8BAA8B,EAInC,KAAK,QAAQ,EACb,cAAc,EACd,KAAK,6BAA6B,EAClC,KAAK,UAAU,EAIhB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAa,UAAU,EAAgB,MAAM,qBAAqB,CAAC;AAC1E,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ztec/aztec.js';
|
|
3
|
-
import { GSEContract,
|
|
3
|
+
import { GSEContract, MultiAdderArtifact, RollupContract, createL1TxUtilsFromViemWallet, deployL1Contract, getL1ContractsConfigEnvVars } from '@aztec/ethereum';
|
|
4
4
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
5
5
|
import { SecretValue } from '@aztec/foundation/config';
|
|
6
6
|
import { createLogger } from '@aztec/foundation/log';
|
|
7
|
-
import {
|
|
7
|
+
import { RollupAbi, SlasherAbi, TestERC20Abi } from '@aztec/l1-artifacts';
|
|
8
8
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
9
9
|
import { createBootstrapNodeFromPrivateKey, getBootstrapNodeEnr } from '@aztec/p2p/test-helpers';
|
|
10
10
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
@@ -237,7 +237,7 @@ export class P2PNetworkTest {
|
|
|
237
237
|
return await this._sendDummyTx(this.ctx.deployL1ContractsValues.l1Client);
|
|
238
238
|
}
|
|
239
239
|
async _sendDummyTx(l1Client) {
|
|
240
|
-
const l1TxUtils =
|
|
240
|
+
const l1TxUtils = createL1TxUtilsFromViemWallet(l1Client);
|
|
241
241
|
return await l1TxUtils.sendAndMonitorTransaction({
|
|
242
242
|
to: l1Client.account.address,
|
|
243
243
|
value: 1n
|
|
@@ -280,11 +280,8 @@ export class P2PNetworkTest {
|
|
|
280
280
|
abi: SlasherAbi,
|
|
281
281
|
client: this.ctx.deployL1ContractsValues.l1Client
|
|
282
282
|
});
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
abi: EmpireSlashingProposerAbi,
|
|
286
|
-
client: this.ctx.deployL1ContractsValues.l1Client
|
|
287
|
-
});
|
|
283
|
+
// Get the actual slashing proposer from rollup (which handles both empire and tally)
|
|
284
|
+
const slashingProposer = await rollup.getSlashingProposer();
|
|
288
285
|
const slashFactory = new SlashFactoryContract(this.ctx.deployL1ContractsValues.l1Client, getAddress(this.ctx.deployL1ContractsValues.l1ContractAddresses.slashFactoryAddress.toString()));
|
|
289
286
|
return {
|
|
290
287
|
rollup,
|
package/dest/e2e_p2p/shared.d.ts
CHANGED
|
@@ -2,12 +2,12 @@ import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
|
2
2
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
3
|
import { AztecAddress, type Logger, ProvenTx, type SentTx } from '@aztec/aztec.js';
|
|
4
4
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
5
|
-
import type { RollupContract,
|
|
6
|
-
import type {
|
|
5
|
+
import type { EmpireSlashingProposerContract, RollupContract, TallySlashingProposerContract } from '@aztec/ethereum';
|
|
6
|
+
import type { TestDateProvider } from '@aztec/foundation/timer';
|
|
7
7
|
import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
8
8
|
import { PXEService } from '@aztec/pxe/server';
|
|
9
|
+
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
9
10
|
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
10
|
-
import type { GetContractReturnType } from 'viem';
|
|
11
11
|
import type { NodeContext } from '../fixtures/setup_p2p_test.js';
|
|
12
12
|
export declare const submitComplexTxsTo: (logger: Logger, from: AztecAddress, spamContract: SpamContract, numTxs: number, opts?: {
|
|
13
13
|
callPublic?: boolean;
|
|
@@ -18,24 +18,30 @@ export declare function createPXEServiceAndPrepareTransactions(logger: Logger, n
|
|
|
18
18
|
txs: ProvenTx[];
|
|
19
19
|
node: AztecNodeService;
|
|
20
20
|
}>;
|
|
21
|
-
export declare function awaitProposalExecution(slashingProposer:
|
|
21
|
+
export declare function awaitProposalExecution(slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract, timeoutSeconds: number, logger: Logger): Promise<bigint>;
|
|
22
22
|
export declare function awaitCommitteeExists({ rollup, logger, }: {
|
|
23
23
|
rollup: RollupContract;
|
|
24
24
|
logger: Logger;
|
|
25
25
|
}): Promise<readonly `0x${string}`[]>;
|
|
26
|
+
export declare function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSize, epochDuration, }: {
|
|
27
|
+
nodeAdmin: AztecNodeAdmin;
|
|
28
|
+
logger: Logger;
|
|
29
|
+
slashingRoundSize: number;
|
|
30
|
+
epochDuration: number;
|
|
31
|
+
}): Promise<import("@aztec/slasher").Offense[]>;
|
|
26
32
|
/**
|
|
27
33
|
* Await the committee to be slashed out of the validator set.
|
|
28
34
|
* Currently assumes that the committee is the same size as the validator set.
|
|
29
35
|
*/
|
|
30
|
-
export declare function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger,
|
|
36
|
+
export declare function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashFactory, slashingProposer, slashingRoundSize, aztecSlotDuration, logger, dateProvider, }: {
|
|
31
37
|
rollup: RollupContract;
|
|
32
38
|
cheatCodes: RollupCheatCodes;
|
|
33
39
|
committee: readonly `0x${string}`[];
|
|
34
40
|
slashFactory: SlashFactoryContract;
|
|
35
|
-
slashingProposer:
|
|
41
|
+
slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
|
|
36
42
|
slashingRoundSize: number;
|
|
37
43
|
aztecSlotDuration: number;
|
|
44
|
+
dateProvider: TestDateProvider;
|
|
38
45
|
logger: Logger;
|
|
39
|
-
sendDummyTx: () => Promise<void>;
|
|
40
46
|
}): Promise<void>;
|
|
41
47
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,YAAY,EAEZ,KAAK,MAAM,EACX,QAAQ,EACR,KAAK,MAAM,EAIZ,MAAM,iBAAiB,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