@aztec/end-to-end 0.0.1-commit.5de5ca79e → 0.0.1-commit.6201a7b05
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/README.md +27 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +15 -30
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +3 -2
- 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 +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts +16 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +56 -8
- package/dest/e2e_fees/fees_test.d.ts +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +4 -4
- package/dest/e2e_p2p/inactivity_slash_test.js +3 -3
- package/dest/e2e_p2p/p2p_network.d.ts +10 -9
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +46 -27
- package/dest/e2e_p2p/reqresp/utils.d.ts +1 -1
- package/dest/e2e_p2p/reqresp/utils.d.ts.map +1 -1
- package/dest/e2e_p2p/reqresp/utils.js +10 -7
- package/dest/e2e_p2p/shared.d.ts +5 -7
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +36 -47
- package/dest/fixtures/authwit_proxy.d.ts +1 -1
- package/dest/fixtures/authwit_proxy.d.ts.map +1 -1
- package/dest/fixtures/authwit_proxy.js +4 -0
- package/dest/fixtures/e2e_prover_test.d.ts +4 -3
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +7 -12
- package/dest/fixtures/fixtures.d.ts +12 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +10 -0
- package/dest/fixtures/get_bb_config.d.ts +1 -1
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/get_bb_config.js +5 -5
- package/dest/fixtures/ha_setup.d.ts +2 -2
- package/dest/fixtures/ha_setup.d.ts.map +1 -1
- package/dest/fixtures/ha_setup.js +1 -1
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts +25 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.d.ts.map +1 -0
- package/dest/fixtures/schnorr_hardcoded_account_contract.js +39 -0
- package/dest/fixtures/setup.d.ts +17 -10
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +41 -22
- package/dest/fixtures/setup_p2p_test.d.ts +6 -6
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +8 -8
- package/dest/fixtures/token_utils.d.ts +1 -1
- package/dest/fixtures/token_utils.d.ts.map +1 -1
- package/dest/fixtures/token_utils.js +2 -5
- package/dest/forward-compatibility/wallet_rpc_client.d.ts +7 -0
- package/dest/forward-compatibility/wallet_rpc_client.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_rpc_client.js +15 -0
- package/dest/forward-compatibility/wallet_service.d.ts +3 -0
- package/dest/forward-compatibility/wallet_service.d.ts.map +1 -0
- package/dest/forward-compatibility/wallet_service.js +109 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/shared/gas_portal_test_harness.js +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +0 -4
- package/dest/simulators/lending_simulator.d.ts +1 -1
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +63 -45
- package/dest/spartan/tx_metrics.d.ts +1 -1
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +18 -2
- package/dest/test-wallet/test_wallet.d.ts +16 -8
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +111 -70
- package/dest/test-wallet/worker_wallet.d.ts +4 -4
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.d.ts +9 -4
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
- package/package.json +40 -39
- package/src/bench/client_flows/client_flows_benchmark.ts +33 -24
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +3 -6
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +1 -1
- package/src/e2e_epochs/epochs_test.ts +56 -7
- package/src/e2e_fees/fees_test.ts +5 -3
- package/src/e2e_p2p/inactivity_slash_test.ts +3 -3
- package/src/e2e_p2p/p2p_network.ts +57 -39
- package/src/e2e_p2p/reqresp/utils.ts +8 -7
- package/src/e2e_p2p/shared.ts +33 -61
- package/src/fixtures/authwit_proxy.ts +4 -0
- package/src/fixtures/e2e_prover_test.ts +12 -17
- package/src/fixtures/fixtures.ts +22 -0
- package/src/fixtures/get_bb_config.ts +7 -6
- package/src/fixtures/ha_setup.ts +4 -2
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +55 -26
- package/src/fixtures/setup_p2p_test.ts +9 -9
- package/src/fixtures/token_utils.ts +1 -4
- package/src/forward-compatibility/wallet_rpc_client.ts +14 -0
- package/src/forward-compatibility/wallet_service.ts +104 -0
- package/src/guides/up_quick_start.sh +0 -2
- package/src/legacy-jest-resolver.cjs +135 -0
- package/src/shared/gas_portal_test_harness.ts +0 -1
- package/src/shared/uniswap_l1_l2.ts +0 -4
- package/src/simulators/lending_simulator.ts +4 -2
- package/src/spartan/setup_test_wallets.ts +63 -39
- package/src/spartan/tx_metrics.ts +16 -4
- package/src/test-wallet/test_wallet.ts +137 -74
- package/src/test-wallet/worker_wallet.ts +3 -2
|
@@ -91,7 +91,7 @@ export async function runReqrespTxTest(params: {
|
|
|
91
91
|
t.bootstrapNodeEnr,
|
|
92
92
|
NUM_VALIDATORS,
|
|
93
93
|
BOOT_NODE_UDP_PORT,
|
|
94
|
-
t.
|
|
94
|
+
t.genesis,
|
|
95
95
|
dataDir,
|
|
96
96
|
shouldCollectMetrics(),
|
|
97
97
|
);
|
|
@@ -194,8 +194,8 @@ export async function runReqrespTxTest(params: {
|
|
|
194
194
|
// Wait for L1 checkpoint sync, which may lag behind P2P block propagation.
|
|
195
195
|
const checkpoints = await retryUntil(
|
|
196
196
|
async () => {
|
|
197
|
-
const cps = await nodes[0].getCheckpoints(CheckpointNumber(1), 50);
|
|
198
|
-
return cps.length > 0 && cps.some(cp => cp.
|
|
197
|
+
const cps = await nodes[0].getCheckpoints(CheckpointNumber(1), 50, { includeBlocks: true });
|
|
198
|
+
return cps.length > 0 && cps.some(cp => (cp.blocks?.length ?? 0) >= 2) ? cps : undefined;
|
|
199
199
|
},
|
|
200
200
|
'waiting for multi-block checkpoint to sync from L1',
|
|
201
201
|
30,
|
|
@@ -203,16 +203,17 @@ export async function runReqrespTxTest(params: {
|
|
|
203
203
|
);
|
|
204
204
|
|
|
205
205
|
let mbpsFound = false;
|
|
206
|
-
let expectedBlockNumber = checkpoints[0].
|
|
206
|
+
let expectedBlockNumber = checkpoints[0].blocks![0].number;
|
|
207
207
|
|
|
208
208
|
for (const published of checkpoints) {
|
|
209
|
-
const
|
|
209
|
+
const blocks = published.blocks!;
|
|
210
|
+
const blockCount = blocks.length;
|
|
210
211
|
mbpsFound = mbpsFound || blockCount >= 2;
|
|
211
212
|
|
|
212
213
|
for (let i = 0; i < blockCount; i++) {
|
|
213
|
-
const block =
|
|
214
|
+
const block = blocks[i];
|
|
214
215
|
expect(block.indexWithinCheckpoint).toBe(i);
|
|
215
|
-
expect(block.checkpointNumber).toBe(published.
|
|
216
|
+
expect(block.checkpointNumber).toBe(published.number);
|
|
216
217
|
expect(block.number).toBe(expectedBlockNumber);
|
|
217
218
|
expectedBlockNumber++;
|
|
218
219
|
}
|
package/src/e2e_p2p/shared.ts
CHANGED
|
@@ -7,11 +7,7 @@ import type { Logger } from '@aztec/aztec.js/log';
|
|
|
7
7
|
import { TxHash } from '@aztec/aztec.js/tx';
|
|
8
8
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
9
9
|
import type { EpochCacheInterface } from '@aztec/epoch-cache';
|
|
10
|
-
import type {
|
|
11
|
-
EmpireSlashingProposerContract,
|
|
12
|
-
RollupContract,
|
|
13
|
-
TallySlashingProposerContract,
|
|
14
|
-
} from '@aztec/ethereum/contracts';
|
|
10
|
+
import type { RollupContract, SlashingProposerContract } from '@aztec/ethereum/contracts';
|
|
15
11
|
import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
16
12
|
import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
17
13
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
@@ -22,8 +18,8 @@ import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.j
|
|
|
22
18
|
import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
23
19
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
24
20
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
25
|
-
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
26
21
|
|
|
22
|
+
import { SchnorrHardcodedKeyAccountContract } from '../fixtures/schnorr_hardcoded_account_contract.js';
|
|
27
23
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
28
24
|
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
29
25
|
import { type ProvenTx, proveInteraction } from '../test-wallet/utils.js';
|
|
@@ -60,10 +56,17 @@ export const submitTransactions = async (
|
|
|
60
56
|
rpcConfig.proverEnabled = false;
|
|
61
57
|
const wallet = await TestWallet.create(
|
|
62
58
|
node,
|
|
63
|
-
|
|
59
|
+
// Use checkpointed chain tip to avoid anchoring on provisional blocks that the archiver can prune
|
|
60
|
+
// when their slot ends without a checkpoint landing on L1.
|
|
61
|
+
{ ...getPXEConfig(), proverEnabled: false, syncChainTip: 'checkpointed' },
|
|
64
62
|
{ loggerActorLabel: 'pxe-tx' },
|
|
65
63
|
);
|
|
66
|
-
const
|
|
64
|
+
const contract = new SchnorrHardcodedKeyAccountContract();
|
|
65
|
+
const fundedAccountManager = await wallet.createAccount({
|
|
66
|
+
secret: fundedAccount.secret,
|
|
67
|
+
salt: fundedAccount.salt,
|
|
68
|
+
contract,
|
|
69
|
+
});
|
|
67
70
|
return submitTxsTo(wallet, fundedAccountManager.address, numTxs, logger);
|
|
68
71
|
};
|
|
69
72
|
|
|
@@ -78,10 +81,15 @@ export async function prepareTransactions(
|
|
|
78
81
|
|
|
79
82
|
const wallet = await TestWallet.create(
|
|
80
83
|
node,
|
|
81
|
-
{ ...getPXEConfig(), proverEnabled: false },
|
|
84
|
+
{ ...getPXEConfig(), proverEnabled: false, syncChainTip: 'checkpointed' },
|
|
82
85
|
{ loggerActorLabel: 'pxe-tx' },
|
|
83
86
|
);
|
|
84
|
-
const
|
|
87
|
+
const accountContract = new SchnorrHardcodedKeyAccountContract();
|
|
88
|
+
const fundedAccountManager = await wallet.createAccount({
|
|
89
|
+
secret: fundedAccount.secret,
|
|
90
|
+
salt: fundedAccount.salt,
|
|
91
|
+
contract: accountContract,
|
|
92
|
+
});
|
|
85
93
|
|
|
86
94
|
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
|
|
87
95
|
salt: Fr.random(),
|
|
@@ -99,7 +107,7 @@ export async function prepareTransactions(
|
|
|
99
107
|
}
|
|
100
108
|
|
|
101
109
|
export function awaitProposalExecution(
|
|
102
|
-
slashingProposer:
|
|
110
|
+
slashingProposer: SlashingProposerContract,
|
|
103
111
|
timeoutSeconds: number,
|
|
104
112
|
logger: Logger,
|
|
105
113
|
): Promise<bigint> {
|
|
@@ -109,24 +117,12 @@ export function awaitProposalExecution(
|
|
|
109
117
|
reject(new Error(`Timeout waiting for proposal execution after ${timeoutSeconds}s`));
|
|
110
118
|
}, timeoutSeconds * 1000);
|
|
111
119
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
logger.warn(`Proposal ${args.payload} from round ${args.round} executed`);
|
|
115
|
-
clearTimeout(timeout);
|
|
116
|
-
unwatch();
|
|
117
|
-
resolve(args.round);
|
|
118
|
-
});
|
|
119
|
-
} else if (slashingProposer.type === 'tally') {
|
|
120
|
-
const unwatch = slashingProposer.listenToRoundExecuted(args => {
|
|
121
|
-
logger.warn(`Slash from round ${args.round} executed`);
|
|
122
|
-
clearTimeout(timeout);
|
|
123
|
-
unwatch();
|
|
124
|
-
resolve(args.round);
|
|
125
|
-
});
|
|
126
|
-
} else {
|
|
120
|
+
const unwatch = slashingProposer.listenToRoundExecuted(args => {
|
|
121
|
+
logger.warn(`Slash from round ${args.round} executed`);
|
|
127
122
|
clearTimeout(timeout);
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
unwatch();
|
|
124
|
+
resolve(args.round);
|
|
125
|
+
});
|
|
130
126
|
});
|
|
131
127
|
}
|
|
132
128
|
|
|
@@ -245,7 +241,6 @@ export async function awaitCommitteeKicked({
|
|
|
245
241
|
rollup,
|
|
246
242
|
cheatCodes,
|
|
247
243
|
committee,
|
|
248
|
-
slashFactory,
|
|
249
244
|
slashingProposer,
|
|
250
245
|
slashingRoundSize,
|
|
251
246
|
aztecSlotDuration,
|
|
@@ -256,8 +251,7 @@ export async function awaitCommitteeKicked({
|
|
|
256
251
|
rollup: RollupContract;
|
|
257
252
|
cheatCodes: RollupCheatCodes;
|
|
258
253
|
committee: readonly `0x${string}`[];
|
|
259
|
-
|
|
260
|
-
slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
|
|
254
|
+
slashingProposer: SlashingProposerContract | undefined;
|
|
261
255
|
slashingRoundSize: number;
|
|
262
256
|
aztecSlotDuration: number;
|
|
263
257
|
aztecEpochDuration: number;
|
|
@@ -270,36 +264,14 @@ export async function awaitCommitteeKicked({
|
|
|
270
264
|
|
|
271
265
|
await cheatCodes.debugRollup();
|
|
272
266
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
const events = await slashFactory.getSlashPayloadCreatedEvents();
|
|
282
|
-
return events.length > 0 ? events : undefined;
|
|
283
|
-
},
|
|
284
|
-
'slash payload created',
|
|
285
|
-
120,
|
|
286
|
-
1,
|
|
287
|
-
);
|
|
288
|
-
expect(slashPayloadEvents.length).toBe(1);
|
|
289
|
-
// The uniqueness check is needed since a validator may be slashed more than once on the same round (eg because they let two epochs be pruned)
|
|
290
|
-
expect(unique(slashPayloadEvents[0].slashes.map(slash => slash.validator.toString()))).toHaveLength(
|
|
291
|
-
committee.length,
|
|
292
|
-
);
|
|
293
|
-
} else {
|
|
294
|
-
// Use the slash offset to ensure we are in the right epoch for tally
|
|
295
|
-
const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
|
|
296
|
-
const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
|
|
297
|
-
const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
|
|
298
|
-
const firstEpochInOffenseRound = offenseEpoch - (offenseEpoch % slashingRoundSizeInEpochs);
|
|
299
|
-
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
|
|
300
|
-
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
301
|
-
await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), { offset: -aztecSlotDuration / 2 });
|
|
302
|
-
}
|
|
267
|
+
// Use the slash offset to ensure we are in the right epoch for tally
|
|
268
|
+
const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
|
|
269
|
+
const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
|
|
270
|
+
const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
|
|
271
|
+
const firstEpochInOffenseRound = offenseEpoch - (offenseEpoch % slashingRoundSizeInEpochs);
|
|
272
|
+
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
|
|
273
|
+
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
274
|
+
await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), { offset: -aztecSlotDuration / 2 });
|
|
303
275
|
|
|
304
276
|
const attestersPre = await rollup.getAttesters();
|
|
305
277
|
expect(attestersPre.length).toBe(committee.length);
|
|
@@ -17,6 +17,10 @@ async function buildProxyCall(proxy: GenericProxyContract, action: ContractFunct
|
|
|
17
17
|
return proxy.methods.forward_private_3(call.to, call.selector, call.args);
|
|
18
18
|
} else if (argCount === 4) {
|
|
19
19
|
return proxy.methods.forward_private_4(call.to, call.selector, call.args);
|
|
20
|
+
} else if (argCount === 5) {
|
|
21
|
+
return proxy.methods.forward_private_5(call.to, call.selector, call.args);
|
|
22
|
+
} else if (argCount === 6) {
|
|
23
|
+
return proxy.methods.forward_private_6(call.to, call.selector, call.args);
|
|
20
24
|
}
|
|
21
25
|
throw new Error(`No forward_private_${argCount} method on proxy`);
|
|
22
26
|
}
|
|
@@ -4,12 +4,7 @@ import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
|
4
4
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
5
5
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
6
6
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
7
|
-
import {
|
|
8
|
-
BBCircuitVerifier,
|
|
9
|
-
type ClientProtocolCircuitVerifier,
|
|
10
|
-
QueuedIVCVerifier,
|
|
11
|
-
TestCircuitVerifier,
|
|
12
|
-
} from '@aztec/bb-prover';
|
|
7
|
+
import type { ClientProtocolCircuitVerifier } from '@aztec/bb-prover';
|
|
13
8
|
import { BackendType, Barretenberg } from '@aztec/bb.js';
|
|
14
9
|
import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
15
10
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
@@ -68,7 +63,10 @@ export class FullProverTest {
|
|
|
68
63
|
private provenComponents: ProvenSetup[] = [];
|
|
69
64
|
private bbConfigCleanup?: () => Promise<void>;
|
|
70
65
|
private acvmConfigCleanup?: () => Promise<void>;
|
|
71
|
-
|
|
66
|
+
/** Returns the proof verifier from the prover node (for test assertions). */
|
|
67
|
+
get circuitProofVerifier(): ClientProtocolCircuitVerifier | undefined {
|
|
68
|
+
return this.proverAztecNode?.getProofVerifier();
|
|
69
|
+
}
|
|
72
70
|
provenAsset!: TokenContract;
|
|
73
71
|
context!: EndToEndContext;
|
|
74
72
|
private proverAztecNode!: AztecNodeService;
|
|
@@ -106,15 +104,13 @@ export class FullProverTest {
|
|
|
106
104
|
await publicDeployAccounts(this.wallet, this.accounts.slice(0, 2));
|
|
107
105
|
|
|
108
106
|
this.logger.info('Applying base setup: deploying token contract');
|
|
109
|
-
const {
|
|
110
|
-
receipt: { contract: asset, instance },
|
|
111
|
-
} = await TokenContract.deploy(
|
|
107
|
+
const { contract: asset, instance } = await TokenContract.deploy(
|
|
112
108
|
this.wallet,
|
|
113
109
|
this.accounts[0],
|
|
114
110
|
FullProverTest.TOKEN_NAME,
|
|
115
111
|
FullProverTest.TOKEN_SYMBOL,
|
|
116
112
|
FullProverTest.TOKEN_DECIMALS,
|
|
117
|
-
).send({ from: this.accounts[0]
|
|
113
|
+
).send({ from: this.accounts[0] });
|
|
118
114
|
this.logger.verbose(`Token deployed to ${asset.address}`);
|
|
119
115
|
|
|
120
116
|
this.fakeProofsAsset = asset;
|
|
@@ -170,9 +166,6 @@ export class FullProverTest {
|
|
|
170
166
|
|
|
171
167
|
await Barretenberg.initSingleton({ backend: BackendType.NativeUnixSocket });
|
|
172
168
|
|
|
173
|
-
const verifier = await BBCircuitVerifier.new(bbConfig);
|
|
174
|
-
this.circuitProofVerifier = new QueuedIVCVerifier(bbConfig, verifier);
|
|
175
|
-
|
|
176
169
|
this.logger.debug(`Configuring the node for real proofs...`);
|
|
177
170
|
await this.aztecNodeAdmin.setConfig({
|
|
178
171
|
realProofs: true,
|
|
@@ -180,7 +173,6 @@ export class FullProverTest {
|
|
|
180
173
|
});
|
|
181
174
|
} else {
|
|
182
175
|
this.logger.debug(`Configuring the node min txs per block ${this.minNumberOfTxsPerBlock}...`);
|
|
183
|
-
this.circuitProofVerifier = new TestCircuitVerifier();
|
|
184
176
|
await this.aztecNodeAdmin.setConfig({
|
|
185
177
|
minTxsPerBlock: this.minNumberOfTxsPerBlock,
|
|
186
178
|
});
|
|
@@ -231,8 +223,11 @@ export class FullProverTest {
|
|
|
231
223
|
|
|
232
224
|
this.logger.verbose('Starting prover node');
|
|
233
225
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
234
|
-
const {
|
|
226
|
+
const { genesis } = await getGenesisValues(
|
|
235
227
|
this.context.initialFundedAccounts.map(a => a.address).concat(sponsoredFPCAddress),
|
|
228
|
+
undefined,
|
|
229
|
+
undefined,
|
|
230
|
+
this.context.genesis!.genesisTimestamp,
|
|
236
231
|
);
|
|
237
232
|
|
|
238
233
|
const proverNodeConfig: Parameters<typeof AztecNodeService.createAndSync>[0] = {
|
|
@@ -260,7 +255,7 @@ export class FullProverTest {
|
|
|
260
255
|
this.proverAztecNode = await AztecNodeService.createAndSync(
|
|
261
256
|
proverNodeConfig,
|
|
262
257
|
{ dateProvider: this.context.dateProvider, p2pClientDeps: { rpcTxProviders: [this.aztecNode] } },
|
|
263
|
-
{
|
|
258
|
+
{ genesis },
|
|
264
259
|
);
|
|
265
260
|
this.logger.warn(`Proofs are now enabled`, { realProofs: this.realProofs });
|
|
266
261
|
return this;
|
package/src/fixtures/fixtures.ts
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
|
+
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
2
|
+
import type { GasFees } from '@aztec/stdlib/gas';
|
|
3
|
+
|
|
1
4
|
export const METRICS_PORT = 4318;
|
|
2
5
|
|
|
6
|
+
/** Default fee padding applied to predicted min fees in e2e tests. */
|
|
7
|
+
export const DEFAULT_MIN_FEE_PADDING = 5;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Large fee padding for txs that may be mined significantly later than when they were created,
|
|
11
|
+
* such as cloned txs in throughput/capacity benchmarks, where fees may spike between creation and mining.
|
|
12
|
+
*/
|
|
13
|
+
export const LARGE_MIN_FEE_PADDING = 15;
|
|
14
|
+
|
|
15
|
+
/** Returns worst-case predicted min fees with padding applied, mirroring the BaseWallet pattern. */
|
|
16
|
+
export async function getPaddedMaxFeesPerGas(node: AztecNode, padding = DEFAULT_MIN_FEE_PADDING): Promise<GasFees> {
|
|
17
|
+
const predicted = await node.getPredictedMinFees();
|
|
18
|
+
const worstCase =
|
|
19
|
+
predicted.length > 0
|
|
20
|
+
? predicted.reduce((worst, fees) => (fees.feePerL2Gas > worst.feePerL2Gas ? fees : worst))
|
|
21
|
+
: await node.getCurrentMinFees();
|
|
22
|
+
return worstCase.mul(1 + padding);
|
|
23
|
+
}
|
|
24
|
+
|
|
3
25
|
export const shouldCollectMetrics = () => {
|
|
4
26
|
if (process.env.COLLECT_METRICS) {
|
|
5
27
|
return METRICS_PORT;
|
|
@@ -13,8 +13,10 @@ const {
|
|
|
13
13
|
BB_SKIP_CLEANUP = '',
|
|
14
14
|
TEMP_DIR = tmpdir(),
|
|
15
15
|
BB_WORKING_DIRECTORY = '',
|
|
16
|
-
BB_NUM_IVC_VERIFIERS = '
|
|
16
|
+
BB_NUM_IVC_VERIFIERS = '8',
|
|
17
17
|
BB_IVC_CONCURRENCY = '1',
|
|
18
|
+
BB_CHONK_VERIFY_MAX_BATCH = '16',
|
|
19
|
+
BB_CHONK_VERIFY_BATCH_CONCURRENCY = '6',
|
|
18
20
|
} = process.env;
|
|
19
21
|
|
|
20
22
|
export const getBBConfig = async (
|
|
@@ -41,16 +43,15 @@ export const getBBConfig = async (
|
|
|
41
43
|
const bbSkipCleanup = ['1', 'true'].includes(BB_SKIP_CLEANUP);
|
|
42
44
|
const cleanup = bbSkipCleanup ? () => Promise.resolve() : () => tryRmDir(directoryToCleanup);
|
|
43
45
|
|
|
44
|
-
const numIvcVerifiers = Number(BB_NUM_IVC_VERIFIERS);
|
|
45
|
-
const ivcConcurrency = Number(BB_IVC_CONCURRENCY);
|
|
46
|
-
|
|
47
46
|
return {
|
|
48
47
|
bbSkipCleanup,
|
|
49
48
|
bbBinaryPath,
|
|
50
49
|
bbWorkingDirectory,
|
|
51
50
|
cleanup,
|
|
52
|
-
numConcurrentIVCVerifiers:
|
|
53
|
-
bbIVCConcurrency:
|
|
51
|
+
numConcurrentIVCVerifiers: Number(BB_NUM_IVC_VERIFIERS),
|
|
52
|
+
bbIVCConcurrency: Number(BB_IVC_CONCURRENCY),
|
|
53
|
+
bbChonkVerifyMaxBatch: Number(BB_CHONK_VERIFY_MAX_BATCH),
|
|
54
|
+
bbChonkVerifyConcurrency: Number(BB_CHONK_VERIFY_BATCH_CONCURRENCY),
|
|
54
55
|
};
|
|
55
56
|
} catch (err) {
|
|
56
57
|
logger.error(`Native BB not available, error: ${err}`);
|
package/src/fixtures/ha_setup.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { privateKeyToAccount } from 'viem/accounts';
|
|
|
11
11
|
*/
|
|
12
12
|
export interface HADatabaseConfig {
|
|
13
13
|
/** PostgreSQL connection URL */
|
|
14
|
-
databaseUrl: string
|
|
14
|
+
databaseUrl: SecretValue<string>;
|
|
15
15
|
/** Node ID for HA coordination */
|
|
16
16
|
nodeId: string;
|
|
17
17
|
/** Enable HA signing */
|
|
@@ -28,7 +28,9 @@ export interface HADatabaseConfig {
|
|
|
28
28
|
* Get database configuration from environment variables
|
|
29
29
|
*/
|
|
30
30
|
export function createHADatabaseConfig(nodeId: string): HADatabaseConfig {
|
|
31
|
-
const databaseUrl =
|
|
31
|
+
const databaseUrl = new SecretValue(
|
|
32
|
+
process.env.DATABASE_URL || 'postgresql://aztec:aztec@localhost:5432/aztec_ha_test',
|
|
33
|
+
);
|
|
32
34
|
|
|
33
35
|
return {
|
|
34
36
|
databaseUrl,
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { DefaultAccountContract } from '@aztec/accounts/defaults';
|
|
2
|
+
import type { ContractArtifact } from '@aztec/aztec.js/abi';
|
|
3
|
+
import type { AuthWitnessProvider } from '@aztec/aztec.js/account';
|
|
4
|
+
import type { CompleteAddress } from '@aztec/aztec.js/addresses';
|
|
5
|
+
import { AuthWitness } from '@aztec/aztec.js/authorization';
|
|
6
|
+
import type { Fr } from '@aztec/aztec.js/fields';
|
|
7
|
+
import { Schnorr } from '@aztec/foundation/crypto/schnorr';
|
|
8
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
9
|
+
import { SchnorrHardcodedAccountContractArtifact } from '@aztec/noir-contracts.js/SchnorrHardcodedAccount';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* The private key that matches the hardcoded public key in the SchnorrHardcodedAccountContract.
|
|
13
|
+
* The corresponding public key is baked into the Noir contract as a global constant.
|
|
14
|
+
*/
|
|
15
|
+
export const SCHNORR_HARDCODED_PRIVATE_KEY = GrumpkinScalar.fromHexString(
|
|
16
|
+
'0xd35d743ac0dfe3d6dbe6be8c877cb524a00ab1e3d52d7bada095dfc8894ccfa',
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Account contract backed by the SchnorrHardcodedAccount Noir contract.
|
|
21
|
+
* This contract verifies Schnorr signatures against a public key that is hardcoded
|
|
22
|
+
* in the contract artifact (not stored in a note), so it does not require on-chain
|
|
23
|
+
* deployment or initialization. Useful for tests that need a working account without
|
|
24
|
+
* mining any blocks.
|
|
25
|
+
*/
|
|
26
|
+
export class SchnorrHardcodedKeyAccountContract extends DefaultAccountContract {
|
|
27
|
+
constructor(private privateKey: GrumpkinScalar = SCHNORR_HARDCODED_PRIVATE_KEY) {
|
|
28
|
+
super();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override getContractArtifact(): Promise<ContractArtifact> {
|
|
32
|
+
return Promise.resolve(SchnorrHardcodedAccountContractArtifact);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
getInitializationFunctionAndArgs() {
|
|
36
|
+
return Promise.resolve(undefined);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getAuthWitnessProvider(_address: CompleteAddress): AuthWitnessProvider {
|
|
40
|
+
const privateKey = this.privateKey;
|
|
41
|
+
return {
|
|
42
|
+
async createAuthWit(messageHash: Fr): Promise<AuthWitness> {
|
|
43
|
+
const signer = new Schnorr();
|
|
44
|
+
const signature = await signer.constructSignature(messageHash.toBuffer(), privateKey);
|
|
45
|
+
return new AuthWitness(messageHash, [...signature.toBuffer()]);
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|