@aztec/end-to-end 3.0.0-nightly.20251016 → 3.0.0-nightly.20251023
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/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +4 -5
- package/dest/e2e_p2p/p2p_network.d.ts +2 -2
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- 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 +2 -2
- package/dest/fixtures/e2e_prover_test.d.ts +2 -1
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +18 -19
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +2 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +7 -4
- package/dest/spartan/utils.d.ts +33 -0
- package/dest/spartan/utils.d.ts.map +1 -1
- package/dest/spartan/utils.js +129 -19
- package/package.json +38 -38
- package/src/bench/utils.ts +3 -4
- package/src/e2e_p2p/shared.ts +6 -4
- package/src/fixtures/e2e_prover_test.ts +25 -25
- package/src/shared/uniswap_l1_l2.ts +2 -1
- package/src/spartan/DEVELOP.md +5 -0
- package/src/spartan/setup_test_wallets.ts +12 -6
- package/src/spartan/utils.ts +174 -16
package/dest/bench/utils.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export type GithubActionBenchmarkResult = {
|
|
|
38
38
|
* @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
|
|
39
39
|
* @returns Array of sent txs.
|
|
40
40
|
*/
|
|
41
|
-
export declare function sendTxs(txCount: number, context: EndToEndContext, contract: BenchmarkingContract, heavyPublicCompute?: boolean):
|
|
41
|
+
export declare function sendTxs(txCount: number, context: EndToEndContext, contract: BenchmarkingContract, heavyPublicCompute?: boolean): SentTx[];
|
|
42
42
|
export declare function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitOpts?: WaitOpts): Promise<void>;
|
|
43
43
|
export {};
|
|
44
44
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAA4C,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAKxH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAS,MAAM,sBAAsB,CAAC;AAEtF;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG;IAC5B,6BAA6B,CAAC,OAAO,EAAE,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;IACtE,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;;GAyBF;AAED,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAGF,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;A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AAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,QAAQ,iBAI3F"}
|
package/dest/bench/utils.js
CHANGED
|
@@ -112,15 +112,14 @@ function getMetricValues(points) {
|
|
|
112
112
|
* @param contract - Target contract.
|
|
113
113
|
* @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
|
|
114
114
|
* @returns Array of sent txs.
|
|
115
|
-
*/ export
|
|
115
|
+
*/ export function sendTxs(txCount, context, contract, heavyPublicCompute = false) {
|
|
116
116
|
const calls = times(txCount, (index)=>makeCall(index, context, contract, heavyPublicCompute));
|
|
117
117
|
context.logger.info(`Creating ${txCount} txs`);
|
|
118
118
|
const [from] = context.accounts;
|
|
119
|
-
const provenTxs = await Promise.all(calls.map((call)=>call.prove({
|
|
120
|
-
from
|
|
121
|
-
})));
|
|
122
119
|
context.logger.info(`Sending ${txCount} txs`);
|
|
123
|
-
return
|
|
120
|
+
return calls.map((call)=>call.send({
|
|
121
|
+
from
|
|
122
|
+
}));
|
|
124
123
|
}
|
|
125
124
|
export async function waitTxs(txs, context, txWaitOpts) {
|
|
126
125
|
context.logger.info(`Awaiting ${txs.length} txs to be mined`);
|
|
@@ -34,13 +34,13 @@ export declare class P2PNetworkTest {
|
|
|
34
34
|
sign: (parameters: {
|
|
35
35
|
hash: import("viem").Hash;
|
|
36
36
|
}) => Promise<import("viem").Hex>;
|
|
37
|
-
|
|
37
|
+
signAuthorization: (parameters: import("viem").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
|
|
38
38
|
signMessage: ({ message }: {
|
|
39
39
|
message: import("viem").SignableMessage;
|
|
40
40
|
}) => Promise<import("viem").Hex>;
|
|
41
41
|
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?: {
|
|
42
42
|
serializer?: serializer | undefined;
|
|
43
|
-
} | undefined) => Promise<import("viem").
|
|
43
|
+
} | undefined) => Promise<import("viem").Hex>;
|
|
44
44
|
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>;
|
|
45
45
|
publicKey: import("viem").Hex;
|
|
46
46
|
source: "privateKey";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAmB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAkB,MAAM,iBAAiB,CAAC;AAC/D,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,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAI5D,OAAO,EAAE,KAAK,qBAAqB,EAA2B,MAAM,MAAM,CAAC;AAQ3E,OAAO,EAEL,KAAK,iBAAi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AE,YAAY,EAC7B,aAAa,SAAI,EAEhB,WAAW,CAAC,EAAE,MAAM,YAAA,EAC5B,eAAe,CAAC,EAAE,OAAO,EACzB,sBAAsB,CAAC,EAAE,OAAO;WAwDrB,MAAM,CAAC,EAClB,QAAQ,EACR,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,sBAAsB,GACvB,EAAE;QACD,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,aAAa,CAAC,EAAE,YAAY,CAAC;QAC7B,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,sBAAsB,CAAC,EAAE,OAAO,CAAC;KAClC;IAwBD,IAAI,aAAa,uBAKhB;IAEK,gBAAgB;IActB,aAAa;;;IAkBP,kBAAkB;IAsElB,YAAY;IAaZ,kBAAkB;IAsBlB,iBAAiB;IAgBjB,WAAW;;;;YAIH,YAAY;IAQpB,KAAK;IAcL,SAAS,CAAC,KAAK,EAAE,gBAAgB,EAAE;IAanC,QAAQ;IAMR,YAAY,IAAI,OAAO,CAAC;QAC5B,MAAM,EAAE,cAAc,CAAC;QACvB,eAAe,EAAE,qBAAqB,CAAC,OAAO,UAAU,EAAE,UAAU,CAAC,CAAC;QACtE,gBAAgB,EAAE,8BAA8B,GAAG,6BAA6B,GAAG,SAAS,CAAC;QAC7F,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC;CA0BH"}
|
package/dest/e2e_p2p/shared.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { AztecAddress, type Logger,
|
|
3
|
+
import { AztecAddress, type Logger, type SentTx, Tx } from '@aztec/aztec.js';
|
|
4
4
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
5
5
|
import type { EmpireSlashingProposerContract, RollupContract, TallySlashingProposerContract } from '@aztec/ethereum';
|
|
6
6
|
import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
@@ -10,7 +10,7 @@ export declare const submitComplexTxsTo: (logger: Logger, from: AztecAddress, sp
|
|
|
10
10
|
callPublic?: boolean;
|
|
11
11
|
}) => Promise<SentTx[]>;
|
|
12
12
|
export declare const submitTransactions: (logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData) => Promise<SentTx[]>;
|
|
13
|
-
export declare function prepareTransactions(logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData): Promise<
|
|
13
|
+
export declare function prepareTransactions(logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData): Promise<Tx[]>;
|
|
14
14
|
export declare function awaitProposalExecution(slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract, timeoutSeconds: number, logger: Logger): Promise<bigint>;
|
|
15
15
|
export declare function awaitCommitteeExists({ rollup, logger, }: {
|
|
16
16
|
rollup: RollupContract;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AAAA,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,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EACL,YAAY,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AAoB,CAAC,EACzC,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,cAAoB,GACrB,EAAE;IACD,SAAS,EAAE,cAAc,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,MAAM,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,+CAkBA;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,UAAU,EACV,SAAS,EACT,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,EACN,YAAY,GACb,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE,SAAS,KAAK,MAAM,EAAE,EAAE,CAAC;IACpC,YAAY,EAAE,oBAAoB,CAAC;IACnC,gBAAgB,EAAE,8BAA8B,GAAG,6BAA6B,GAAG,SAAS,CAAC;IAC7F,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB,iBA2EA"}
|
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -4,7 +4,7 @@ import { pluralize } from '@aztec/foundation/string';
|
|
|
4
4
|
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
5
5
|
import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
6
6
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
7
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
7
|
+
import { TestWallet, proveInteraction } from '@aztec/test-wallet/server';
|
|
8
8
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
9
9
|
// submits a set of transactions to the provided Private eXecution Environment (PXE)
|
|
10
10
|
export const submitComplexTxsTo = async (logger, from, spamContract, numTxs, opts = {})=>{
|
|
@@ -56,7 +56,7 @@ export async function prepareTransactions(logger, node, numTxs, fundedAccount) {
|
|
|
56
56
|
await wallet.registerContract(testContractInstance, TestContractArtifact);
|
|
57
57
|
const contract = await TestContract.at(testContractInstance.address, wallet);
|
|
58
58
|
return timesAsync(numTxs, async ()=>{
|
|
59
|
-
const tx = await contract.methods.emit_nullifier(Fr.random())
|
|
59
|
+
const tx = await proveInteraction(wallet, contract.methods.emit_nullifier(Fr.random()), {
|
|
60
60
|
from: fundedAccountManager.address
|
|
61
61
|
});
|
|
62
62
|
const txHash = tx.getTxHash();
|
|
@@ -24,6 +24,7 @@ export declare class FullProverTest {
|
|
|
24
24
|
private snapshotManager;
|
|
25
25
|
logger: Logger;
|
|
26
26
|
wallet: TestWallet;
|
|
27
|
+
provenWallet: TestWallet;
|
|
27
28
|
accounts: AztecAddress[];
|
|
28
29
|
deployedAccounts: InitialAccountData[];
|
|
29
30
|
fakeProofsAsset: TokenContract;
|
|
@@ -36,7 +37,7 @@ export declare class FullProverTest {
|
|
|
36
37
|
private bbConfigCleanup?;
|
|
37
38
|
private acvmConfigCleanup?;
|
|
38
39
|
circuitProofVerifier?: ClientProtocolCircuitVerifier;
|
|
39
|
-
|
|
40
|
+
provenAsset: TokenContract;
|
|
40
41
|
private context;
|
|
41
42
|
private proverNode;
|
|
42
43
|
private simulatedProverNode;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,KAAK,MAAM,EAAgB,MAAM,iBAAiB,CA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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,QAAQ;IAeR,iBAAiB;CA8CxB"}
|
|
@@ -30,6 +30,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
30
30
|
snapshotManager;
|
|
31
31
|
logger;
|
|
32
32
|
wallet;
|
|
33
|
+
provenWallet;
|
|
33
34
|
accounts;
|
|
34
35
|
deployedAccounts;
|
|
35
36
|
fakeProofsAsset;
|
|
@@ -42,7 +43,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
42
43
|
bbConfigCleanup;
|
|
43
44
|
acvmConfigCleanup;
|
|
44
45
|
circuitProofVerifier;
|
|
45
|
-
|
|
46
|
+
provenAsset;
|
|
46
47
|
context;
|
|
47
48
|
proverNode;
|
|
48
49
|
simulatedProverNode;
|
|
@@ -53,7 +54,6 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
53
54
|
this.realProofs = realProofs;
|
|
54
55
|
this.accounts = [];
|
|
55
56
|
this.provenComponents = [];
|
|
56
|
-
this.provenAssets = [];
|
|
57
57
|
this.snapshot = (name, apply, restore = ()=>Promise.resolve())=>this.snapshotManager.snapshot(name, apply, restore);
|
|
58
58
|
this.logger = createLogger(`e2e:full_prover_test:${testName}`);
|
|
59
59
|
this.snapshotManager = createSnapshotManager(`full_prover_integration/${testName}`, dataPath, {
|
|
@@ -143,25 +143,24 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
143
143
|
this.logger.verbose(`Marking current block as proven`);
|
|
144
144
|
await this.context.cheatCodes.rollup.markAsProven();
|
|
145
145
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
146
|
+
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(this.aztecNode, {
|
|
147
|
+
proverEnabled: this.realProofs,
|
|
148
|
+
bbBinaryPath: bbConfig?.bbBinaryPath,
|
|
149
|
+
bbWorkingDirectory: bbConfig?.bbWorkingDirectory
|
|
150
|
+
}, undefined, true);
|
|
151
|
+
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
152
|
+
await provenWallet.registerContract(this.fakeProofsAsset);
|
|
146
153
|
for(let i = 0; i < 2; i++){
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
bbBinaryPath: bbConfig?.bbBinaryPath,
|
|
150
|
-
bbWorkingDirectory: bbConfig?.bbWorkingDirectory
|
|
151
|
-
}, undefined, true);
|
|
152
|
-
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
153
|
-
await provenWallet.registerContract(this.fakeProofsAsset);
|
|
154
|
-
for(let i = 0; i < 2; i++){
|
|
155
|
-
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
156
|
-
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
157
|
-
}
|
|
158
|
-
const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
159
|
-
this.provenComponents.push({
|
|
160
|
-
wallet: provenWallet,
|
|
161
|
-
teardown: provenTeardown
|
|
162
|
-
});
|
|
163
|
-
this.provenAssets.push(asset);
|
|
154
|
+
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
155
|
+
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
164
156
|
}
|
|
157
|
+
const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
158
|
+
this.provenComponents.push({
|
|
159
|
+
wallet: provenWallet,
|
|
160
|
+
teardown: provenTeardown
|
|
161
|
+
});
|
|
162
|
+
this.provenAsset = asset;
|
|
163
|
+
this.provenWallet = provenWallet;
|
|
165
164
|
this.logger.info(`Full prover PXE started`);
|
|
166
165
|
// Shutdown the current, simulated prover node
|
|
167
166
|
this.logger.verbose('Shutting down simulated prover node');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAGd,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAI9B,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAiB5D,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,kBAAkB;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,yBAAyB;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,0BAA0B;IAC1B,cAAc,EAAE,YAAY,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,OAAO,CAAC,mBAAmB,CAAC,EACzC,SAAS,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,gCAAkC,
|
|
1
|
+
{"version":3,"file":"uniswap_l1_l2.d.ts","sourceRoot":"","sources":["../../src/shared/uniswap_l1_l2.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAGd,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAI9B,MAAM,iBAAiB,CAAC;AAMzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAiB5D,2DAA2D;AAC3D,MAAM,MAAM,mBAAmB,GAAG;IAChC,0BAA0B;IAC1B,SAAS,EAAE,SAAS,CAAC;IACrB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,QAAQ,EAAE,wBAAwB,CAAC;IACnC,kBAAkB;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,yBAAyB;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,0BAA0B;IAC1B,cAAc,EAAE,YAAY,CAAC;IAC7B,OAAO;IACP,uBAAuB,EAAE,2BAA2B,CAAC;IACrD,4BAA4B;IAC5B,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,OAAO,CAAC,mBAAmB,CAAC,EACzC,SAAS,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,gCAAkC,SAg+BnC,CAAC"}
|
|
@@ -453,12 +453,12 @@ export const uniswapL1L2TestSuite = (setup, cleanup, expectedForkBlockNumber = 1
|
|
|
453
453
|
});
|
|
454
454
|
// 3. Swap but send the wrong token address
|
|
455
455
|
logger.info('Swap but send the wrong token address');
|
|
456
|
-
await expect(uniswapL2Contract.methods.swap_private(wethCrossChainHarness.l2Token.address, daiCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferToPublicApproval, uniswapFeeTier, minimumOutputAmount, Fr.random(), ownerEthAddress).
|
|
456
|
+
await expect(uniswapL2Contract.methods.swap_private(wethCrossChainHarness.l2Token.address, daiCrossChainHarness.l2Bridge.address, wethAmountToBridge, daiCrossChainHarness.l2Bridge.address, nonceForWETHTransferToPublicApproval, uniswapFeeTier, minimumOutputAmount, Fr.random(), ownerEthAddress).send({
|
|
457
457
|
from: ownerAddress,
|
|
458
458
|
authWitnesses: [
|
|
459
459
|
transferToPublicAuthwith
|
|
460
460
|
]
|
|
461
|
-
})).rejects.toThrow('Assertion failed: input_asset address is not the same as seen in the bridge contract');
|
|
461
|
+
}).wait()).rejects.toThrow('Assertion failed: input_asset address is not the same as seen in the bridge contract');
|
|
462
462
|
});
|
|
463
463
|
// edge cases for public flow:
|
|
464
464
|
it("I don't need approval to call swap_public if I'm swapping on my own behalf", async ()=>{
|
|
@@ -15,7 +15,8 @@ export interface TestAccounts {
|
|
|
15
15
|
export declare function setupTestAccountsWithTokens(nodeUrl: string, mintAmount: bigint, logger: Logger): Promise<TestAccounts>;
|
|
16
16
|
export declare function deploySponsoredTestAccounts(wallet: TestWallet, aztecNode: AztecNode, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
17
17
|
export declare function deployTestAccountsWithTokens(nodeUrl: string, l1RpcUrls: string[], mnemonicOrPrivateKey: string, mintAmount: bigint, logger: Logger, numberOfFundedWallets?: number): Promise<TestAccounts>;
|
|
18
|
-
export declare function performTransfers({ testAccounts, rounds, transferAmount, logger, feePaymentMethod, }: {
|
|
18
|
+
export declare function performTransfers({ wallet, testAccounts, rounds, transferAmount, logger, feePaymentMethod, }: {
|
|
19
|
+
wallet: TestWallet;
|
|
19
20
|
testAccounts: TestAccounts;
|
|
20
21
|
rounds: number;
|
|
21
22
|
transferAmount: bigint;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_test_wallets.d.ts","sourceRoot":"","sources":["../../src/spartan/setup_test_wallets.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,EACZ,KAAK,SAAS,EAEd,KAAK,gBAAgB,EAOtB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,M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MAAM,EACN,YAAY,EACZ,MAAM,EACN,cAAc,EACd,MAAM,EACN,gBAAgB,GACjB,EAAE;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;CACrC,iBAqBA;AAED,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;CAAE,CAAC,CAqBrF"}
|
|
@@ -2,7 +2,7 @@ import { generateSchnorrAccounts } from '@aztec/accounts/testing';
|
|
|
2
2
|
import { AztecAddress, FeeJuicePaymentMethodWithClaim, Fr, L1FeeJuicePortalManager, SponsoredFeePaymentMethod, createAztecNodeClient, retryUntil } from '@aztec/aztec.js';
|
|
3
3
|
import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
4
4
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
|
-
import { TestWallet, registerInitialSandboxAccountsInWallet } from '@aztec/test-wallet/server';
|
|
5
|
+
import { TestWallet, proveInteraction, registerInitialSandboxAccountsInWallet } from '@aztec/test-wallet/server';
|
|
6
6
|
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
7
7
|
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
8
8
|
import { getSponsoredFPCAddress, registerSponsoredFPC } from '../fixtures/utils.js';
|
|
@@ -155,17 +155,20 @@ async function deployTokenAndMint(wallet, accounts, admin, mintAmount, paymentMe
|
|
|
155
155
|
logger.verbose(`Minting complete.`);
|
|
156
156
|
return tokenAddress;
|
|
157
157
|
}
|
|
158
|
-
export async function performTransfers({ testAccounts, rounds, transferAmount, logger, feePaymentMethod }) {
|
|
158
|
+
export async function performTransfers({ wallet, testAccounts, rounds, transferAmount, logger, feePaymentMethod }) {
|
|
159
159
|
const recipient = testAccounts.recipientAddress;
|
|
160
160
|
// Default to sponsored fee payment if no fee method is provided
|
|
161
161
|
const defaultFeePaymentMethod = feePaymentMethod || new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
162
162
|
for(let i = 0; i < rounds; i++){
|
|
163
|
-
const txs = testAccounts.accounts.map(async (acc)=>
|
|
163
|
+
const txs = testAccounts.accounts.map(async (acc)=>{
|
|
164
|
+
const token = await TokenContract.at(testAccounts.tokenAddress, testAccounts.wallet);
|
|
165
|
+
return proveInteraction(wallet, token.methods.transfer_in_public(acc, recipient, transferAmount, 0), {
|
|
164
166
|
from: acc,
|
|
165
167
|
fee: {
|
|
166
168
|
paymentMethod: defaultFeePaymentMethod
|
|
167
169
|
}
|
|
168
|
-
})
|
|
170
|
+
});
|
|
171
|
+
});
|
|
169
172
|
const provenTxs = await Promise.all(txs);
|
|
170
173
|
await Promise.all(provenTxs.map((t)=>t.send().wait({
|
|
171
174
|
timeout: 600
|
package/dest/spartan/utils.d.ts
CHANGED
|
@@ -9,16 +9,25 @@ declare const testConfigSchema: z.ZodObject<{
|
|
|
9
9
|
REAL_VERIFIER: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodEffects<z.ZodNumber, 0 | 1, number>, boolean, number>, z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, boolean, string>]>>>;
|
|
10
10
|
CREATE_ETH_DEVNET: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodEffects<z.ZodEffects<z.ZodNumber, 0 | 1, number>, boolean, number>, z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, boolean, string>]>>>;
|
|
11
11
|
L1_RPC_URLS_JSON: z.ZodOptional<z.ZodString>;
|
|
12
|
+
L1_ACCOUNT_MNEMONIC: z.ZodOptional<z.ZodString>;
|
|
13
|
+
AZTEC_SLOT_DURATION: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
14
|
+
AZTEC_PROOF_SUBMISSION_WINDOW: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
12
15
|
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
AZTEC_SLOT_DURATION: number;
|
|
13
17
|
NAMESPACE: string;
|
|
14
18
|
REAL_VERIFIER: boolean;
|
|
15
19
|
CREATE_ETH_DEVNET: boolean;
|
|
20
|
+
AZTEC_PROOF_SUBMISSION_WINDOW: number;
|
|
16
21
|
L1_RPC_URLS_JSON?: string | undefined;
|
|
22
|
+
L1_ACCOUNT_MNEMONIC?: string | undefined;
|
|
17
23
|
}, {
|
|
24
|
+
AZTEC_SLOT_DURATION?: number | undefined;
|
|
18
25
|
NAMESPACE?: string | undefined;
|
|
19
26
|
REAL_VERIFIER?: string | number | boolean | undefined;
|
|
20
27
|
CREATE_ETH_DEVNET?: string | number | boolean | undefined;
|
|
21
28
|
L1_RPC_URLS_JSON?: string | undefined;
|
|
29
|
+
L1_ACCOUNT_MNEMONIC?: string | undefined;
|
|
30
|
+
AZTEC_PROOF_SUBMISSION_WINDOW?: number | undefined;
|
|
22
31
|
}>;
|
|
23
32
|
export type TestConfig = z.infer<typeof testConfigSchema>;
|
|
24
33
|
export declare function setupEnvironment(env: unknown): TestConfig;
|
|
@@ -134,6 +143,30 @@ export declare function applyNetworkShaping({ valuesFile, namespace, spartanDir,
|
|
|
134
143
|
}): Promise<string>;
|
|
135
144
|
export declare function awaitL2BlockNumber(rollupCheatCodes: RollupCheatCodes, blockNumber: bigint, timeoutSeconds: number, logger: Logger): Promise<void>;
|
|
136
145
|
export declare function restartBot(namespace: string, logger: Logger): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Installs or upgrades the transfer bot Helm release for the given namespace.
|
|
148
|
+
* Intended for test setup to enable L2 traffic generation only when needed.
|
|
149
|
+
*/
|
|
150
|
+
export declare function installTransferBot({ namespace, spartanDir, logger, replicas, txIntervalSeconds, followChain, mnemonic, mnemonicStartIndex, botPrivateKey, nodeUrl, timeout, reuseValues, aztecSlotDuration, }: {
|
|
151
|
+
namespace: string;
|
|
152
|
+
spartanDir: string;
|
|
153
|
+
logger: Logger;
|
|
154
|
+
replicas?: number;
|
|
155
|
+
txIntervalSeconds?: number;
|
|
156
|
+
followChain?: string;
|
|
157
|
+
mnemonic?: string;
|
|
158
|
+
mnemonicStartIndex?: number | string;
|
|
159
|
+
botPrivateKey?: string;
|
|
160
|
+
nodeUrl?: string;
|
|
161
|
+
timeout?: string;
|
|
162
|
+
reuseValues?: boolean;
|
|
163
|
+
aztecSlotDuration?: number;
|
|
164
|
+
}): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* Uninstalls the transfer bot Helm release from the given namespace.
|
|
167
|
+
* Intended for test teardown to clean up bot resources.
|
|
168
|
+
*/
|
|
169
|
+
export declare function uninstallTransferBot(namespace: string, logger: Logger): Promise<void>;
|
|
137
170
|
export declare function enableValidatorDynamicBootNode(instanceName: string, namespace: string, spartanDir: string, logger: Logger): Promise<void>;
|
|
138
171
|
export declare function getSequencers(namespace: string): Promise<string[]>;
|
|
139
172
|
export declare function updateSequencersConfig(env: TestConfig, config: Partial<AztecNodeAdminConfig>): Promise<AztecNodeAdminConfig[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/spartan/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,EACL,KAAK,cAAc,E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GAMG;AACH,wBAAsB,aAAa,CAAC,SAAS,EAAE,MAAM,iBAcpD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAW1C"}
|
package/dest/spartan/utils.js
CHANGED
|
@@ -13,7 +13,10 @@ const testConfigSchema = z.object({
|
|
|
13
13
|
NAMESPACE: z.string().default('scenario'),
|
|
14
14
|
REAL_VERIFIER: schemas.Boolean.optional().default(true),
|
|
15
15
|
CREATE_ETH_DEVNET: schemas.Boolean.optional().default(false),
|
|
16
|
-
L1_RPC_URLS_JSON: z.string().optional()
|
|
16
|
+
L1_RPC_URLS_JSON: z.string().optional(),
|
|
17
|
+
L1_ACCOUNT_MNEMONIC: z.string().optional(),
|
|
18
|
+
AZTEC_SLOT_DURATION: z.coerce.number().optional().default(24),
|
|
19
|
+
AZTEC_PROOF_SUBMISSION_WINDOW: z.coerce.number().optional().default(5)
|
|
17
20
|
});
|
|
18
21
|
export function setupEnvironment(env) {
|
|
19
22
|
const config = testConfigSchema.parse(env);
|
|
@@ -175,8 +178,12 @@ export async function waitForResourceByLabel({ resource, label, namespace, condi
|
|
|
175
178
|
export function getChartDir(spartanDir, chartName) {
|
|
176
179
|
return path.join(spartanDir.trim(), chartName);
|
|
177
180
|
}
|
|
181
|
+
function shellQuote(value) {
|
|
182
|
+
// Single-quote safe shell escaping: ' -> '\''
|
|
183
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
184
|
+
}
|
|
178
185
|
function valuesToArgs(values) {
|
|
179
|
-
return Object.entries(values).map(([key, value])
|
|
186
|
+
return Object.entries(values).map(([key, value])=>typeof value === 'number' || typeof value === 'boolean' ? `--set ${key}=${value}` : `--set-string ${key}=${shellQuote(String(value))}`).join(' ');
|
|
180
187
|
}
|
|
181
188
|
function createHelmCommand({ instanceName, helmChartDir, namespace, valuesFile, timeout, values, reuseValues = false }) {
|
|
182
189
|
const valuesFileArgs = valuesFile ? `--values ${helmChartDir}/values/${valuesFile}` : '';
|
|
@@ -205,26 +212,30 @@ async function execHelmCommand(args) {
|
|
|
205
212
|
* const stdout = await installChaosMeshChart({ instanceName: 'force-reorg', targetNamespace: 'smoke', valuesFile: 'prover-failure.yaml'});
|
|
206
213
|
* console.log(stdout);
|
|
207
214
|
* ```
|
|
208
|
-
*/ export async function installChaosMeshChart({ instanceName, targetNamespace, valuesFile, helmChartDir, chaosMeshNamespace = 'chaos-mesh', timeout = '
|
|
215
|
+
*/ export async function installChaosMeshChart({ instanceName, targetNamespace, valuesFile, helmChartDir, chaosMeshNamespace = 'chaos-mesh', timeout = '10m', clean = true, values = {}, logger }) {
|
|
209
216
|
if (clean) {
|
|
210
217
|
// uninstall the helm chart if it exists
|
|
211
218
|
logger.info(`Uninstalling helm chart ${instanceName}`);
|
|
212
219
|
await execAsync(`helm uninstall ${instanceName} --namespace ${chaosMeshNamespace} --wait --ignore-not-found`);
|
|
213
|
-
// and delete the
|
|
214
|
-
const
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
220
|
+
// and delete the chaos-mesh resources created by this release
|
|
221
|
+
const deleteByLabel = async (resource)=>{
|
|
222
|
+
const args = {
|
|
223
|
+
resource,
|
|
224
|
+
namespace: chaosMeshNamespace,
|
|
225
|
+
label: `app.kubernetes.io/instance=${instanceName}`
|
|
226
|
+
};
|
|
227
|
+
logger.info(`Deleting ${resource} resources for release ${instanceName}`);
|
|
228
|
+
await deleteResourceByLabel(args).catch((e)=>{
|
|
229
|
+
logger.error(`Error deleting ${resource}: ${e}`);
|
|
230
|
+
logger.info(`Force deleting ${resource}`);
|
|
231
|
+
return deleteResourceByLabel({
|
|
232
|
+
...args,
|
|
233
|
+
force: true
|
|
234
|
+
});
|
|
226
235
|
});
|
|
227
|
-
}
|
|
236
|
+
};
|
|
237
|
+
await deleteByLabel('podchaos');
|
|
238
|
+
await deleteByLabel('networkchaos');
|
|
228
239
|
}
|
|
229
240
|
return execHelmCommand({
|
|
230
241
|
instanceName,
|
|
@@ -321,16 +332,115 @@ export async function restartBot(namespace, logger) {
|
|
|
321
332
|
await deleteResourceByLabel({
|
|
322
333
|
resource: 'pods',
|
|
323
334
|
namespace,
|
|
324
|
-
label: 'app=bot'
|
|
335
|
+
label: 'app.kubernetes.io/name=bot'
|
|
325
336
|
});
|
|
326
337
|
await sleep(10 * 1000);
|
|
338
|
+
// Some bot images may take time to report Ready due to heavy boot-time proving.
|
|
339
|
+
// Waiting for PodReadyToStartContainers ensures the pod is scheduled and starting without blocking on full readiness.
|
|
327
340
|
await waitForResourceByLabel({
|
|
328
341
|
resource: 'pods',
|
|
329
342
|
namespace,
|
|
330
|
-
label: 'app=bot'
|
|
343
|
+
label: 'app.kubernetes.io/name=bot',
|
|
344
|
+
condition: 'PodReadyToStartContainers'
|
|
331
345
|
});
|
|
332
346
|
logger.info(`Bot restarted`);
|
|
333
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* Installs or upgrades the transfer bot Helm release for the given namespace.
|
|
350
|
+
* Intended for test setup to enable L2 traffic generation only when needed.
|
|
351
|
+
*/ export async function installTransferBot({ namespace, spartanDir, logger, replicas = 1, txIntervalSeconds = 10, followChain = 'PENDING', mnemonic = process.env.LABS_INFRA_MNEMONIC ?? 'test test test test test test test test test test test junk', mnemonicStartIndex, botPrivateKey = process.env.BOT_TRANSFERS_L2_PRIVATE_KEY ?? '0xcafe01', nodeUrl, timeout = '15m', reuseValues = true, aztecSlotDuration = Number(process.env.AZTEC_SLOT_DURATION ?? 12) }) {
|
|
352
|
+
const instanceName = `${namespace}-bot-transfers`;
|
|
353
|
+
const helmChartDir = getChartDir(spartanDir, 'aztec-bot');
|
|
354
|
+
const resolvedNodeUrl = nodeUrl ?? `http://${namespace}-rpc-aztec-node.${namespace}.svc.cluster.local:8080`;
|
|
355
|
+
logger.info(`Installing/upgrading transfer bot: replicas=${replicas}, followChain=${followChain}`);
|
|
356
|
+
const values = {
|
|
357
|
+
'bot.replicaCount': replicas,
|
|
358
|
+
'bot.txIntervalSeconds': txIntervalSeconds,
|
|
359
|
+
'bot.followChain': followChain,
|
|
360
|
+
'bot.botPrivateKey': botPrivateKey,
|
|
361
|
+
'bot.nodeUrl': resolvedNodeUrl,
|
|
362
|
+
'bot.mnemonic': mnemonic,
|
|
363
|
+
'bot.feePaymentMethod': 'fee_juice',
|
|
364
|
+
'aztec.slotDuration': aztecSlotDuration,
|
|
365
|
+
// Ensure bot can reach its own PXE started in-process (default rpc.port is 8080)
|
|
366
|
+
// Note: since aztec-bot depends on aztec-node with alias `bot`, env vars go under `bot.node.env`.
|
|
367
|
+
'bot.node.env.BOT_PXE_URL': 'http://127.0.0.1:8080',
|
|
368
|
+
// Provide L1 execution RPC for bridging fee juice
|
|
369
|
+
'bot.node.env.ETHEREUM_HOSTS': `http://${namespace}-eth-execution.${namespace}.svc.cluster.local:8545`,
|
|
370
|
+
// Provide L1 mnemonic for bridging (falls back to labs mnemonic)
|
|
371
|
+
'bot.node.env.BOT_L1_MNEMONIC': mnemonic
|
|
372
|
+
};
|
|
373
|
+
// Ensure we derive a funded L1 key (index 0 is funded on anvil default mnemonic)
|
|
374
|
+
if (mnemonicStartIndex === undefined) {
|
|
375
|
+
values['bot.mnemonicStartIndex'] = 0;
|
|
376
|
+
}
|
|
377
|
+
// Also pass a funded private key directly if available
|
|
378
|
+
if (process.env.FUNDING_PRIVATE_KEY) {
|
|
379
|
+
values['bot.node.env.BOT_L1_PRIVATE_KEY'] = process.env.FUNDING_PRIVATE_KEY;
|
|
380
|
+
}
|
|
381
|
+
// Align bot image with the running network image: prefer env var, else detect from a validator pod
|
|
382
|
+
let repositoryFromEnv;
|
|
383
|
+
let tagFromEnv;
|
|
384
|
+
const aztecDockerImage = process.env.AZTEC_DOCKER_IMAGE;
|
|
385
|
+
if (aztecDockerImage && aztecDockerImage.includes(':')) {
|
|
386
|
+
const lastColon = aztecDockerImage.lastIndexOf(':');
|
|
387
|
+
repositoryFromEnv = aztecDockerImage.slice(0, lastColon);
|
|
388
|
+
tagFromEnv = aztecDockerImage.slice(lastColon + 1);
|
|
389
|
+
}
|
|
390
|
+
let repository = repositoryFromEnv;
|
|
391
|
+
let tag = tagFromEnv;
|
|
392
|
+
if (!repository || !tag) {
|
|
393
|
+
try {
|
|
394
|
+
const { stdout } = await execAsync(`kubectl get pods -l app.kubernetes.io/component=validator -n ${namespace} -o jsonpath='{.items[0].spec.containers[?(@.name=="aztec")].image}' | cat`);
|
|
395
|
+
const image = stdout.trim().replace(/^'|'$/g, '');
|
|
396
|
+
if (image && image.includes(':')) {
|
|
397
|
+
const lastColon = image.lastIndexOf(':');
|
|
398
|
+
repository = image.slice(0, lastColon);
|
|
399
|
+
tag = image.slice(lastColon + 1);
|
|
400
|
+
}
|
|
401
|
+
} catch (err) {
|
|
402
|
+
logger.warn(`Could not detect aztec image from validator pod: ${String(err)}`);
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if (repository && tag) {
|
|
406
|
+
values['global.aztecImage.repository'] = repository;
|
|
407
|
+
values['global.aztecImage.tag'] = tag;
|
|
408
|
+
}
|
|
409
|
+
if (mnemonicStartIndex !== undefined) {
|
|
410
|
+
values['bot.mnemonicStartIndex'] = typeof mnemonicStartIndex === 'string' ? mnemonicStartIndex : Number(mnemonicStartIndex);
|
|
411
|
+
}
|
|
412
|
+
await execHelmCommand({
|
|
413
|
+
instanceName,
|
|
414
|
+
helmChartDir,
|
|
415
|
+
namespace,
|
|
416
|
+
valuesFile: undefined,
|
|
417
|
+
timeout,
|
|
418
|
+
values: values,
|
|
419
|
+
reuseValues
|
|
420
|
+
});
|
|
421
|
+
if (replicas > 0) {
|
|
422
|
+
await waitForResourceByLabel({
|
|
423
|
+
resource: 'pods',
|
|
424
|
+
namespace,
|
|
425
|
+
label: 'app.kubernetes.io/name=bot',
|
|
426
|
+
condition: 'PodReadyToStartContainers'
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
/**
|
|
431
|
+
* Uninstalls the transfer bot Helm release from the given namespace.
|
|
432
|
+
* Intended for test teardown to clean up bot resources.
|
|
433
|
+
*/ export async function uninstallTransferBot(namespace, logger) {
|
|
434
|
+
const instanceName = `${namespace}-bot-transfers`;
|
|
435
|
+
logger.info(`Uninstalling transfer bot release ${instanceName}`);
|
|
436
|
+
await execAsync(`helm uninstall ${instanceName} --namespace ${namespace} --wait --ignore-not-found`);
|
|
437
|
+
// Ensure any leftover pods are removed
|
|
438
|
+
await deleteResourceByLabel({
|
|
439
|
+
resource: 'pods',
|
|
440
|
+
namespace,
|
|
441
|
+
label: 'app.kubernetes.io/name=bot'
|
|
442
|
+
}).catch(()=>undefined);
|
|
443
|
+
}
|
|
334
444
|
export async function enableValidatorDynamicBootNode(instanceName, namespace, spartanDir, logger) {
|
|
335
445
|
logger.info(`Enabling validator dynamic boot node`);
|
|
336
446
|
await execHelmCommand({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251023",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,42 +25,42 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "3.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
46
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
47
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
48
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
51
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
52
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
53
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
55
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
56
|
-
"@aztec/sequencer-client": "3.0.0-nightly.
|
|
57
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
58
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
59
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
60
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
61
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
62
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
63
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "3.0.0-nightly.20251023",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20251023",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20251023",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20251023",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20251023",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20251023",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20251023",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-nightly.20251023",
|
|
36
|
+
"@aztec/bot": "3.0.0-nightly.20251023",
|
|
37
|
+
"@aztec/cli": "3.0.0-nightly.20251023",
|
|
38
|
+
"@aztec/constants": "3.0.0-nightly.20251023",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-nightly.20251023",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20251023",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-nightly.20251023",
|
|
42
|
+
"@aztec/foundation": "3.0.0-nightly.20251023",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-nightly.20251023",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20251023",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20251023",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-nightly.20251023",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20251023",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20251023",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251023",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20251023",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20251023",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251023",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-nightly.20251023",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-nightly.20251023",
|
|
55
|
+
"@aztec/pxe": "3.0.0-nightly.20251023",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20251023",
|
|
57
|
+
"@aztec/simulator": "3.0.0-nightly.20251023",
|
|
58
|
+
"@aztec/slasher": "3.0.0-nightly.20251023",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-nightly.20251023",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20251023",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-nightly.20251023",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-nightly.20251023",
|
|
63
|
+
"@aztec/world-state": "3.0.0-nightly.20251023",
|
|
64
64
|
"@iarna/toml": "^2.2.5",
|
|
65
65
|
"@jest/globals": "^30.0.0",
|
|
66
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"tslib": "^2.4.0",
|
|
98
98
|
"typescript": "^5.3.3",
|
|
99
99
|
"util": "^0.12.5",
|
|
100
|
-
"viem": "2.
|
|
100
|
+
"viem": "npm:@spalladino/viem@2.38.2-eip7594.0",
|
|
101
101
|
"zod": "^3.23.8"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
package/src/bench/utils.ts
CHANGED
|
@@ -129,18 +129,17 @@ function makeCall(
|
|
|
129
129
|
* @param heavyPublicCompute - Whether the transactions include heavy public compute (like a big sha256).
|
|
130
130
|
* @returns Array of sent txs.
|
|
131
131
|
*/
|
|
132
|
-
export
|
|
132
|
+
export function sendTxs(
|
|
133
133
|
txCount: number,
|
|
134
134
|
context: EndToEndContext,
|
|
135
135
|
contract: BenchmarkingContract,
|
|
136
136
|
heavyPublicCompute: boolean = false,
|
|
137
|
-
):
|
|
137
|
+
): SentTx[] {
|
|
138
138
|
const calls = times(txCount, index => makeCall(index, context, contract, heavyPublicCompute));
|
|
139
139
|
context.logger.info(`Creating ${txCount} txs`);
|
|
140
140
|
const [from] = context.accounts;
|
|
141
|
-
const provenTxs = await Promise.all(calls.map(call => call.prove({ from })));
|
|
142
141
|
context.logger.info(`Sending ${txCount} txs`);
|
|
143
|
-
return
|
|
142
|
+
return calls.map(call => call.send({ from }));
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
export async function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitOpts?: WaitOpts) {
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
AztecAddress,
|
|
5
5
|
Fr,
|
|
6
6
|
type Logger,
|
|
7
|
-
ProvenTx,
|
|
8
7
|
type SentTx,
|
|
8
|
+
Tx,
|
|
9
9
|
TxStatus,
|
|
10
10
|
getContractInstanceFromInstantiationParams,
|
|
11
11
|
retryUntil,
|
|
@@ -20,7 +20,7 @@ import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
|
20
20
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
21
21
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
22
22
|
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
23
|
-
import { TestWallet } from '@aztec/test-wallet/server';
|
|
23
|
+
import { TestWallet, proveInteraction } from '@aztec/test-wallet/server';
|
|
24
24
|
|
|
25
25
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
26
26
|
|
|
@@ -73,7 +73,7 @@ export async function prepareTransactions(
|
|
|
73
73
|
node: AztecNodeService,
|
|
74
74
|
numTxs: number,
|
|
75
75
|
fundedAccount: InitialAccountData,
|
|
76
|
-
): Promise<
|
|
76
|
+
): Promise<Tx[]> {
|
|
77
77
|
const rpcConfig = getRpcConfig();
|
|
78
78
|
rpcConfig.proverEnabled = false;
|
|
79
79
|
|
|
@@ -87,7 +87,9 @@ export async function prepareTransactions(
|
|
|
87
87
|
const contract = await TestContract.at(testContractInstance.address, wallet);
|
|
88
88
|
|
|
89
89
|
return timesAsync(numTxs, async () => {
|
|
90
|
-
const tx = await contract.methods.emit_nullifier(Fr.random())
|
|
90
|
+
const tx = await proveInteraction(wallet, contract.methods.emit_nullifier(Fr.random()), {
|
|
91
|
+
from: fundedAccountManager.address,
|
|
92
|
+
});
|
|
91
93
|
const txHash = tx.getTxHash();
|
|
92
94
|
logger.info(`Tx prepared with hash ${txHash}`);
|
|
93
95
|
return tx;
|
|
@@ -56,6 +56,7 @@ export class FullProverTest {
|
|
|
56
56
|
private snapshotManager: ISnapshotManager;
|
|
57
57
|
logger: Logger;
|
|
58
58
|
wallet!: TestWallet;
|
|
59
|
+
provenWallet!: TestWallet;
|
|
59
60
|
accounts: AztecAddress[] = [];
|
|
60
61
|
deployedAccounts!: InitialAccountData[];
|
|
61
62
|
fakeProofsAsset!: TokenContract;
|
|
@@ -68,7 +69,7 @@ export class FullProverTest {
|
|
|
68
69
|
private bbConfigCleanup?: () => Promise<void>;
|
|
69
70
|
private acvmConfigCleanup?: () => Promise<void>;
|
|
70
71
|
circuitProofVerifier?: ClientProtocolCircuitVerifier;
|
|
71
|
-
|
|
72
|
+
provenAsset!: TokenContract;
|
|
72
73
|
private context!: SubsystemsContext;
|
|
73
74
|
private proverNode!: ProverNode;
|
|
74
75
|
private simulatedProverNode!: ProverNode;
|
|
@@ -207,32 +208,31 @@ export class FullProverTest {
|
|
|
207
208
|
await this.context.cheatCodes.rollup.markAsProven();
|
|
208
209
|
|
|
209
210
|
this.logger.verbose(`Main setup completed, initializing full prover PXE, Node, and Prover Node`);
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
await provenWallet.registerContract(this.fakeProofsAsset);
|
|
223
|
-
|
|
224
|
-
for (let i = 0; i < 2; i++) {
|
|
225
|
-
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
226
|
-
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
227
|
-
}
|
|
211
|
+
const { wallet: provenWallet, teardown: provenTeardown } = await setupPXEAndGetWallet(
|
|
212
|
+
this.aztecNode,
|
|
213
|
+
{
|
|
214
|
+
proverEnabled: this.realProofs,
|
|
215
|
+
bbBinaryPath: bbConfig?.bbBinaryPath,
|
|
216
|
+
bbWorkingDirectory: bbConfig?.bbWorkingDirectory,
|
|
217
|
+
},
|
|
218
|
+
undefined,
|
|
219
|
+
true,
|
|
220
|
+
);
|
|
221
|
+
this.logger.debug(`Contract address ${this.fakeProofsAsset.address}`);
|
|
222
|
+
await provenWallet.registerContract(this.fakeProofsAsset);
|
|
228
223
|
|
|
229
|
-
|
|
230
|
-
this.
|
|
231
|
-
|
|
232
|
-
teardown: provenTeardown,
|
|
233
|
-
});
|
|
234
|
-
this.provenAssets.push(asset);
|
|
224
|
+
for (let i = 0; i < 2; i++) {
|
|
225
|
+
await provenWallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
226
|
+
await this.wallet.createSchnorrAccount(this.deployedAccounts[i].secret, this.deployedAccounts[i].salt);
|
|
235
227
|
}
|
|
228
|
+
|
|
229
|
+
const asset = await TokenContract.at(this.fakeProofsAsset.address, provenWallet);
|
|
230
|
+
this.provenComponents.push({
|
|
231
|
+
wallet: provenWallet,
|
|
232
|
+
teardown: provenTeardown,
|
|
233
|
+
});
|
|
234
|
+
this.provenAsset = asset;
|
|
235
|
+
this.provenWallet = provenWallet;
|
|
236
236
|
this.logger.info(`Full prover PXE started`);
|
|
237
237
|
|
|
238
238
|
// Shutdown the current, simulated prover node
|
|
@@ -666,7 +666,8 @@ export const uniswapL1L2TestSuite = (
|
|
|
666
666
|
Fr.random(),
|
|
667
667
|
ownerEthAddress,
|
|
668
668
|
)
|
|
669
|
-
.
|
|
669
|
+
.send({ from: ownerAddress, authWitnesses: [transferToPublicAuthwith] })
|
|
670
|
+
.wait(),
|
|
670
671
|
).rejects.toThrow('Assertion failed: input_asset address is not the same as seen in the bridge contract');
|
|
671
672
|
});
|
|
672
673
|
|
package/src/spartan/DEVELOP.md
CHANGED
|
@@ -60,6 +60,11 @@ The export is important there. The `AZTEC_DOCKER_IMAGE` env var is used as both:
|
|
|
60
60
|
- the container that runs the rollup contract deployment
|
|
61
61
|
- the containers for the aztec infrastructure (validators, provers, etc)
|
|
62
62
|
|
|
63
|
+
# Deploy Metrics
|
|
64
|
+
```bash
|
|
65
|
+
./spartan/bootstrap.sh metrics-kind
|
|
66
|
+
```
|
|
67
|
+
|
|
63
68
|
# Deploy stuff
|
|
64
69
|
|
|
65
70
|
```bash
|
|
@@ -15,7 +15,7 @@ import { createEthereumChain, createExtendedL1Client } from '@aztec/ethereum';
|
|
|
15
15
|
import type { Logger } from '@aztec/foundation/log';
|
|
16
16
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
17
17
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
18
|
-
import { TestWallet, registerInitialSandboxAccountsInWallet } from '@aztec/test-wallet/server';
|
|
18
|
+
import { TestWallet, proveInteraction, registerInitialSandboxAccountsInWallet } from '@aztec/test-wallet/server';
|
|
19
19
|
|
|
20
20
|
import { getACVMConfig } from '../fixtures/get_acvm_config.js';
|
|
21
21
|
import { getBBConfig } from '../fixtures/get_bb_config.js';
|
|
@@ -246,12 +246,14 @@ async function deployTokenAndMint(
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
export async function performTransfers({
|
|
249
|
+
wallet,
|
|
249
250
|
testAccounts,
|
|
250
251
|
rounds,
|
|
251
252
|
transferAmount,
|
|
252
253
|
logger,
|
|
253
254
|
feePaymentMethod,
|
|
254
255
|
}: {
|
|
256
|
+
wallet: TestWallet;
|
|
255
257
|
testAccounts: TestAccounts;
|
|
256
258
|
rounds: number;
|
|
257
259
|
transferAmount: bigint;
|
|
@@ -262,11 +264,15 @@ export async function performTransfers({
|
|
|
262
264
|
// Default to sponsored fee payment if no fee method is provided
|
|
263
265
|
const defaultFeePaymentMethod = feePaymentMethod || new SponsoredFeePaymentMethod(await getSponsoredFPCAddress());
|
|
264
266
|
for (let i = 0; i < rounds; i++) {
|
|
265
|
-
const txs = testAccounts.accounts.map(async acc =>
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
267
|
+
const txs = testAccounts.accounts.map(async acc => {
|
|
268
|
+
const token = await TokenContract.at(testAccounts.tokenAddress, testAccounts.wallet);
|
|
269
|
+
return proveInteraction(wallet, token.methods.transfer_in_public(acc, recipient, transferAmount, 0), {
|
|
270
|
+
from: acc,
|
|
271
|
+
fee: {
|
|
272
|
+
paymentMethod: defaultFeePaymentMethod,
|
|
273
|
+
},
|
|
274
|
+
});
|
|
275
|
+
});
|
|
270
276
|
|
|
271
277
|
const provenTxs = await Promise.all(txs);
|
|
272
278
|
|
package/src/spartan/utils.ts
CHANGED
|
@@ -26,6 +26,9 @@ const testConfigSchema = z.object({
|
|
|
26
26
|
REAL_VERIFIER: schemas.Boolean.optional().default(true),
|
|
27
27
|
CREATE_ETH_DEVNET: schemas.Boolean.optional().default(false),
|
|
28
28
|
L1_RPC_URLS_JSON: z.string().optional(),
|
|
29
|
+
L1_ACCOUNT_MNEMONIC: z.string().optional(),
|
|
30
|
+
AZTEC_SLOT_DURATION: z.coerce.number().optional().default(24),
|
|
31
|
+
AZTEC_PROOF_SUBMISSION_WINDOW: z.coerce.number().optional().default(5),
|
|
29
32
|
});
|
|
30
33
|
|
|
31
34
|
export type TestConfig = z.infer<typeof testConfigSchema>;
|
|
@@ -245,9 +248,18 @@ export function getChartDir(spartanDir: string, chartName: string) {
|
|
|
245
248
|
return path.join(spartanDir.trim(), chartName);
|
|
246
249
|
}
|
|
247
250
|
|
|
248
|
-
function
|
|
251
|
+
function shellQuote(value: string) {
|
|
252
|
+
// Single-quote safe shell escaping: ' -> '\''
|
|
253
|
+
return `'${value.replace(/'/g, "'\\''")}'`;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
function valuesToArgs(values: Record<string, string | number | boolean>) {
|
|
249
257
|
return Object.entries(values)
|
|
250
|
-
.map(([key, value]) =>
|
|
258
|
+
.map(([key, value]) =>
|
|
259
|
+
typeof value === 'number' || typeof value === 'boolean'
|
|
260
|
+
? `--set ${key}=${value}`
|
|
261
|
+
: `--set-string ${key}=${shellQuote(String(value))}`,
|
|
262
|
+
)
|
|
251
263
|
.join(' ');
|
|
252
264
|
}
|
|
253
265
|
|
|
@@ -305,7 +317,7 @@ export async function installChaosMeshChart({
|
|
|
305
317
|
valuesFile,
|
|
306
318
|
helmChartDir,
|
|
307
319
|
chaosMeshNamespace = 'chaos-mesh',
|
|
308
|
-
timeout = '
|
|
320
|
+
timeout = '10m',
|
|
309
321
|
clean = true,
|
|
310
322
|
values = {},
|
|
311
323
|
logger,
|
|
@@ -324,18 +336,23 @@ export async function installChaosMeshChart({
|
|
|
324
336
|
// uninstall the helm chart if it exists
|
|
325
337
|
logger.info(`Uninstalling helm chart ${instanceName}`);
|
|
326
338
|
await execAsync(`helm uninstall ${instanceName} --namespace ${chaosMeshNamespace} --wait --ignore-not-found`);
|
|
327
|
-
// and delete the
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
339
|
+
// and delete the chaos-mesh resources created by this release
|
|
340
|
+
const deleteByLabel = async (resource: string) => {
|
|
341
|
+
const args = {
|
|
342
|
+
resource,
|
|
343
|
+
namespace: chaosMeshNamespace,
|
|
344
|
+
label: `app.kubernetes.io/instance=${instanceName}`,
|
|
345
|
+
} as const;
|
|
346
|
+
logger.info(`Deleting ${resource} resources for release ${instanceName}`);
|
|
347
|
+
await deleteResourceByLabel(args).catch(e => {
|
|
348
|
+
logger.error(`Error deleting ${resource}: ${e}`);
|
|
349
|
+
logger.info(`Force deleting ${resource}`);
|
|
350
|
+
return deleteResourceByLabel({ ...args, force: true });
|
|
351
|
+
});
|
|
332
352
|
};
|
|
333
|
-
|
|
334
|
-
await
|
|
335
|
-
|
|
336
|
-
logger.info(`Force deleting podchaos resource`);
|
|
337
|
-
return deleteResourceByLabel({ ...deleteArgs, force: true });
|
|
338
|
-
});
|
|
353
|
+
|
|
354
|
+
await deleteByLabel('podchaos');
|
|
355
|
+
await deleteByLabel('networkchaos');
|
|
339
356
|
}
|
|
340
357
|
|
|
341
358
|
return execHelmCommand({
|
|
@@ -496,12 +513,153 @@ export async function awaitL2BlockNumber(
|
|
|
496
513
|
|
|
497
514
|
export async function restartBot(namespace: string, logger: Logger) {
|
|
498
515
|
logger.info(`Restarting bot`);
|
|
499
|
-
await deleteResourceByLabel({ resource: 'pods', namespace, label: 'app=bot' });
|
|
516
|
+
await deleteResourceByLabel({ resource: 'pods', namespace, label: 'app.kubernetes.io/name=bot' });
|
|
500
517
|
await sleep(10 * 1000);
|
|
501
|
-
|
|
518
|
+
// Some bot images may take time to report Ready due to heavy boot-time proving.
|
|
519
|
+
// Waiting for PodReadyToStartContainers ensures the pod is scheduled and starting without blocking on full readiness.
|
|
520
|
+
await waitForResourceByLabel({
|
|
521
|
+
resource: 'pods',
|
|
522
|
+
namespace,
|
|
523
|
+
label: 'app.kubernetes.io/name=bot',
|
|
524
|
+
condition: 'PodReadyToStartContainers',
|
|
525
|
+
});
|
|
502
526
|
logger.info(`Bot restarted`);
|
|
503
527
|
}
|
|
504
528
|
|
|
529
|
+
/**
|
|
530
|
+
* Installs or upgrades the transfer bot Helm release for the given namespace.
|
|
531
|
+
* Intended for test setup to enable L2 traffic generation only when needed.
|
|
532
|
+
*/
|
|
533
|
+
export async function installTransferBot({
|
|
534
|
+
namespace,
|
|
535
|
+
spartanDir,
|
|
536
|
+
logger,
|
|
537
|
+
replicas = 1,
|
|
538
|
+
txIntervalSeconds = 10,
|
|
539
|
+
followChain = 'PENDING',
|
|
540
|
+
mnemonic = process.env.LABS_INFRA_MNEMONIC ?? 'test test test test test test test test test test test junk',
|
|
541
|
+
mnemonicStartIndex,
|
|
542
|
+
botPrivateKey = process.env.BOT_TRANSFERS_L2_PRIVATE_KEY ?? '0xcafe01',
|
|
543
|
+
nodeUrl,
|
|
544
|
+
timeout = '15m',
|
|
545
|
+
reuseValues = true,
|
|
546
|
+
aztecSlotDuration = Number(process.env.AZTEC_SLOT_DURATION ?? 12),
|
|
547
|
+
}: {
|
|
548
|
+
namespace: string;
|
|
549
|
+
spartanDir: string;
|
|
550
|
+
logger: Logger;
|
|
551
|
+
replicas?: number;
|
|
552
|
+
txIntervalSeconds?: number;
|
|
553
|
+
followChain?: string;
|
|
554
|
+
mnemonic?: string;
|
|
555
|
+
mnemonicStartIndex?: number | string;
|
|
556
|
+
botPrivateKey?: string;
|
|
557
|
+
nodeUrl?: string;
|
|
558
|
+
timeout?: string;
|
|
559
|
+
reuseValues?: boolean;
|
|
560
|
+
aztecSlotDuration?: number;
|
|
561
|
+
}) {
|
|
562
|
+
const instanceName = `${namespace}-bot-transfers`;
|
|
563
|
+
const helmChartDir = getChartDir(spartanDir, 'aztec-bot');
|
|
564
|
+
const resolvedNodeUrl = nodeUrl ?? `http://${namespace}-rpc-aztec-node.${namespace}.svc.cluster.local:8080`;
|
|
565
|
+
|
|
566
|
+
logger.info(`Installing/upgrading transfer bot: replicas=${replicas}, followChain=${followChain}`);
|
|
567
|
+
|
|
568
|
+
const values: Record<string, string | number | boolean> = {
|
|
569
|
+
'bot.replicaCount': replicas,
|
|
570
|
+
'bot.txIntervalSeconds': txIntervalSeconds,
|
|
571
|
+
'bot.followChain': followChain,
|
|
572
|
+
'bot.botPrivateKey': botPrivateKey,
|
|
573
|
+
'bot.nodeUrl': resolvedNodeUrl,
|
|
574
|
+
'bot.mnemonic': mnemonic,
|
|
575
|
+
'bot.feePaymentMethod': 'fee_juice',
|
|
576
|
+
'aztec.slotDuration': aztecSlotDuration,
|
|
577
|
+
// Ensure bot can reach its own PXE started in-process (default rpc.port is 8080)
|
|
578
|
+
// Note: since aztec-bot depends on aztec-node with alias `bot`, env vars go under `bot.node.env`.
|
|
579
|
+
'bot.node.env.BOT_PXE_URL': 'http://127.0.0.1:8080',
|
|
580
|
+
// Provide L1 execution RPC for bridging fee juice
|
|
581
|
+
'bot.node.env.ETHEREUM_HOSTS': `http://${namespace}-eth-execution.${namespace}.svc.cluster.local:8545`,
|
|
582
|
+
// Provide L1 mnemonic for bridging (falls back to labs mnemonic)
|
|
583
|
+
'bot.node.env.BOT_L1_MNEMONIC': mnemonic,
|
|
584
|
+
};
|
|
585
|
+
// Ensure we derive a funded L1 key (index 0 is funded on anvil default mnemonic)
|
|
586
|
+
if (mnemonicStartIndex === undefined) {
|
|
587
|
+
values['bot.mnemonicStartIndex'] = 0;
|
|
588
|
+
}
|
|
589
|
+
// Also pass a funded private key directly if available
|
|
590
|
+
if (process.env.FUNDING_PRIVATE_KEY) {
|
|
591
|
+
values['bot.node.env.BOT_L1_PRIVATE_KEY'] = process.env.FUNDING_PRIVATE_KEY;
|
|
592
|
+
}
|
|
593
|
+
// Align bot image with the running network image: prefer env var, else detect from a validator pod
|
|
594
|
+
let repositoryFromEnv: string | undefined;
|
|
595
|
+
let tagFromEnv: string | undefined;
|
|
596
|
+
const aztecDockerImage = process.env.AZTEC_DOCKER_IMAGE;
|
|
597
|
+
if (aztecDockerImage && aztecDockerImage.includes(':')) {
|
|
598
|
+
const lastColon = aztecDockerImage.lastIndexOf(':');
|
|
599
|
+
repositoryFromEnv = aztecDockerImage.slice(0, lastColon);
|
|
600
|
+
tagFromEnv = aztecDockerImage.slice(lastColon + 1);
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
let repository = repositoryFromEnv;
|
|
604
|
+
let tag = tagFromEnv;
|
|
605
|
+
if (!repository || !tag) {
|
|
606
|
+
try {
|
|
607
|
+
const { stdout } = await execAsync(
|
|
608
|
+
`kubectl get pods -l app.kubernetes.io/component=validator -n ${namespace} -o jsonpath='{.items[0].spec.containers[?(@.name=="aztec")].image}' | cat`,
|
|
609
|
+
);
|
|
610
|
+
const image = stdout.trim().replace(/^'|'$/g, '');
|
|
611
|
+
if (image && image.includes(':')) {
|
|
612
|
+
const lastColon = image.lastIndexOf(':');
|
|
613
|
+
repository = image.slice(0, lastColon);
|
|
614
|
+
tag = image.slice(lastColon + 1);
|
|
615
|
+
}
|
|
616
|
+
} catch (err) {
|
|
617
|
+
logger.warn(`Could not detect aztec image from validator pod: ${String(err)}`);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
if (repository && tag) {
|
|
621
|
+
values['global.aztecImage.repository'] = repository;
|
|
622
|
+
values['global.aztecImage.tag'] = tag;
|
|
623
|
+
}
|
|
624
|
+
if (mnemonicStartIndex !== undefined) {
|
|
625
|
+
values['bot.mnemonicStartIndex'] =
|
|
626
|
+
typeof mnemonicStartIndex === 'string' ? mnemonicStartIndex : Number(mnemonicStartIndex);
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
await execHelmCommand({
|
|
630
|
+
instanceName,
|
|
631
|
+
helmChartDir,
|
|
632
|
+
namespace,
|
|
633
|
+
valuesFile: undefined,
|
|
634
|
+
timeout,
|
|
635
|
+
values: values as unknown as Record<string, string | number>,
|
|
636
|
+
reuseValues,
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
if (replicas > 0) {
|
|
640
|
+
await waitForResourceByLabel({
|
|
641
|
+
resource: 'pods',
|
|
642
|
+
namespace,
|
|
643
|
+
label: 'app.kubernetes.io/name=bot',
|
|
644
|
+
condition: 'PodReadyToStartContainers',
|
|
645
|
+
});
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
/**
|
|
650
|
+
* Uninstalls the transfer bot Helm release from the given namespace.
|
|
651
|
+
* Intended for test teardown to clean up bot resources.
|
|
652
|
+
*/
|
|
653
|
+
export async function uninstallTransferBot(namespace: string, logger: Logger) {
|
|
654
|
+
const instanceName = `${namespace}-bot-transfers`;
|
|
655
|
+
logger.info(`Uninstalling transfer bot release ${instanceName}`);
|
|
656
|
+
await execAsync(`helm uninstall ${instanceName} --namespace ${namespace} --wait --ignore-not-found`);
|
|
657
|
+
// Ensure any leftover pods are removed
|
|
658
|
+
await deleteResourceByLabel({ resource: 'pods', namespace, label: 'app.kubernetes.io/name=bot' }).catch(
|
|
659
|
+
() => undefined,
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
|
|
505
663
|
export async function enableValidatorDynamicBootNode(
|
|
506
664
|
instanceName: string,
|
|
507
665
|
namespace: string,
|