@aztec/end-to-end 0.86.0 → 0.87.0-nightly.20250521
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bench/client_flows/client_flows_benchmark.js +1 -1
- package/dest/bench/client_flows/config.d.ts +1 -1
- package/dest/bench/client_flows/config.d.ts.map +1 -1
- package/dest/bench/client_flows/config.js +22 -3
- package/dest/bench/client_flows/data_extractor.d.ts.map +1 -1
- package/dest/bench/client_flows/data_extractor.js +23 -12
- package/dest/bench/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +9 -5
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +1 -1
- 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.d.ts +5 -2
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +8 -4
- package/dest/e2e_deploy_contract/deploy_test.d.ts +1 -1
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.d.ts +13 -5
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +41 -16
- package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
- package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
- package/dest/e2e_fees/bridging_race.notest.js +60 -0
- package/dest/e2e_fees/fees_test.d.ts +1 -1
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +15 -9
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +2 -2
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +2 -2
- package/dest/e2e_p2p/p2p_network.d.ts +10 -214
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +20 -23
- package/dest/e2e_p2p/shared.d.ts +1 -1
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +3 -7
- package/dest/e2e_prover/e2e_prover_test.d.ts.map +1 -1
- package/dest/e2e_prover/e2e_prover_test.js +2 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +1 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +1 -1
- package/dest/fixtures/fixtures.d.ts +4 -6
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +2 -2
- package/dest/fixtures/get_bb_config.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts +5 -1
- package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
- package/dest/fixtures/l1_to_l2_messaging.js +5 -4
- package/dest/fixtures/setup_l1_contracts.d.ts +1 -1
- package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.d.ts +1 -2
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +3 -3
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +6 -2
- package/dest/fixtures/utils.d.ts +6 -6
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +64 -63
- package/dest/shared/capture_private_execution_steps.d.ts.map +1 -1
- package/dest/shared/capture_private_execution_steps.js +8 -4
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
- package/dest/shared/uniswap_l1_l2.js +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +1 -1
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/utils.d.ts +0 -1
- package/dest/spartan/utils.d.ts.map +1 -1
- package/package.json +38 -37
- package/src/bench/client_flows/client_flows_benchmark.ts +1 -1
- package/src/bench/client_flows/config.ts +12 -4
- package/src/bench/client_flows/data_extractor.ts +40 -20
- package/src/bench/utils.ts +7 -3
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +1 -1
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +16 -5
- package/src/e2e_deploy_contract/deploy_test.ts +1 -1
- package/src/e2e_epochs/epochs_test.ts +51 -18
- package/src/e2e_fees/bridging_race.notest.ts +74 -0
- package/src/e2e_fees/fees_test.ts +24 -9
- package/src/e2e_nested_contract/nested_contract_test.ts +6 -3
- package/src/e2e_p2p/p2p_network.ts +27 -21
- package/src/e2e_p2p/shared.ts +4 -6
- package/src/e2e_prover/e2e_prover_test.ts +1 -0
- package/src/e2e_token_contract/token_contract_test.ts +1 -1
- package/src/fixtures/dumps/epoch_proof_result.json +1 -1
- package/src/fixtures/fixtures.ts +2 -2
- package/src/fixtures/l1_to_l2_messaging.ts +1 -1
- package/src/fixtures/setup_p2p_test.ts +3 -3
- package/src/fixtures/snapshot_manager.ts +2 -2
- package/src/fixtures/utils.ts +57 -66
- package/src/shared/capture_private_execution_steps.ts +9 -2
- package/src/shared/uniswap_l1_l2.ts +1 -1
- package/src/simulators/token_simulator.ts +0 -1
- package/src/spartan/setup_test_wallets.ts +6 -3
package/src/fixtures/fixtures.ts
CHANGED
|
@@ -14,8 +14,8 @@ export const privateKey = Buffer.from('ac0974bec39a17e36ba4a6b4d238ff944bacb478c
|
|
|
14
14
|
export const privateKey2 = Buffer.from('59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d', 'hex');
|
|
15
15
|
|
|
16
16
|
/// Common errors
|
|
17
|
-
export const U128_UNDERFLOW_ERROR =
|
|
18
|
-
export const U128_OVERFLOW_ERROR =
|
|
17
|
+
export const U128_UNDERFLOW_ERROR = 'Assertion failed: attempt to subtract with overflow';
|
|
18
|
+
export const U128_OVERFLOW_ERROR = 'Assertion failed: attempt to add with overflow';
|
|
19
19
|
export const BITSIZE_TOO_BIG_ERROR = "Assertion failed: call to assert_max_bit_size 'self.__assert_max_bit_size'";
|
|
20
20
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/5818): Make these a fixed error after transition.
|
|
21
21
|
export const DUPLICATE_NULLIFIER_ERROR = /dropped|nullifier|reverted/i;
|
|
@@ -46,5 +46,5 @@ export async function sendL1ToL2Message(
|
|
|
46
46
|
const receivedMsgHash = topics.args.hash;
|
|
47
47
|
const receivedGlobalLeafIndex = topics.args.index;
|
|
48
48
|
|
|
49
|
-
return
|
|
49
|
+
return { msgHash: Fr.fromHexString(receivedMsgHash), globalLeafIndex: new Fr(receivedGlobalLeafIndex), txReceipt };
|
|
50
50
|
}
|
|
@@ -15,9 +15,9 @@ import { TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
|
15
15
|
import { getPrivateKeyFromIndex } from './utils.js';
|
|
16
16
|
import { getEndToEndTestTelemetryClient } from './with_telemetry_utils.js';
|
|
17
17
|
|
|
18
|
-
// Setup snapshots will create a node with index 0,
|
|
19
|
-
// need to start from
|
|
20
|
-
export const PROPOSER_PRIVATE_KEYS_START_INDEX =
|
|
18
|
+
// Setup snapshots will create a node with index 0, and run extra bootstrap with
|
|
19
|
+
// index 1, so all of our loops here need to start from 2 to avoid running validators with the same key
|
|
20
|
+
export const PROPOSER_PRIVATE_KEYS_START_INDEX = 2;
|
|
21
21
|
export const ATTESTER_PRIVATE_KEYS_START_INDEX = 1001;
|
|
22
22
|
|
|
23
23
|
export interface NodeContext {
|
|
@@ -436,8 +436,8 @@ async function setupFromFresh(
|
|
|
436
436
|
proverNode = await createAndSyncProverNode(
|
|
437
437
|
`0x${proverNodePrivateKey!.toString('hex')}`,
|
|
438
438
|
aztecNodeConfig,
|
|
439
|
+
{ dataDirectory: path.join(directoryToCleanup, randomBytes(8).toString('hex')) },
|
|
439
440
|
aztecNode,
|
|
440
|
-
path.join(directoryToCleanup, randomBytes(8).toString('hex')),
|
|
441
441
|
prefilledPublicData,
|
|
442
442
|
);
|
|
443
443
|
}
|
|
@@ -560,8 +560,8 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
|
|
|
560
560
|
proverNode = await createAndSyncProverNode(
|
|
561
561
|
proverNodePrivateKeyHex,
|
|
562
562
|
aztecNodeConfig,
|
|
563
|
+
{ dataDirectory: path.join(directoryToCleanup, randomBytes(8).toString('hex')) },
|
|
563
564
|
aztecNode,
|
|
564
|
-
path.join(directoryToCleanup, randomBytes(8).toString('hex')),
|
|
565
565
|
prefilledPublicData,
|
|
566
566
|
);
|
|
567
567
|
}
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -16,7 +16,6 @@ import {
|
|
|
16
16
|
type ContractMethod,
|
|
17
17
|
type Logger,
|
|
18
18
|
type PXE,
|
|
19
|
-
SignerlessWallet,
|
|
20
19
|
type Wallet,
|
|
21
20
|
createAztecNodeClient,
|
|
22
21
|
createLogger,
|
|
@@ -25,12 +24,10 @@ import {
|
|
|
25
24
|
waitForPXE,
|
|
26
25
|
} from '@aztec/aztec.js';
|
|
27
26
|
import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
|
|
28
|
-
import { SponsoredFeePaymentMethod } from '@aztec/aztec.js/fee/testing';
|
|
29
27
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
30
28
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
31
29
|
import { type BlobSinkServer, createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
32
30
|
import { GENESIS_ARCHIVE_ROOT, SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
33
|
-
import { DefaultMultiCallEntrypoint } from '@aztec/entrypoints/multicall';
|
|
34
31
|
import {
|
|
35
32
|
type DeployL1ContractsArgs,
|
|
36
33
|
type DeployL1ContractsReturnType,
|
|
@@ -46,8 +43,10 @@ import { DelayedTxUtils, EthCheatCodesWithState, startAnvil } from '@aztec/ether
|
|
|
46
43
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
47
44
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
48
45
|
import { Fr } from '@aztec/foundation/fields';
|
|
46
|
+
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
49
47
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
50
48
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
49
|
+
import type { DataStoreConfig } from '@aztec/kv-store/config';
|
|
51
50
|
import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
|
|
52
51
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
53
52
|
import { protocolContractTreeRoot } from '@aztec/protocol-contracts';
|
|
@@ -294,6 +293,8 @@ export type SetupOptions = {
|
|
|
294
293
|
telemetryConfig?: Partial<TelemetryClientConfig> & { benchmark?: boolean };
|
|
295
294
|
/** Public data that will be inserted in the tree in genesis */
|
|
296
295
|
genesisPublicData?: PublicDataTreeLeaf[];
|
|
296
|
+
/** Specific config for the prover node, if set. */
|
|
297
|
+
proverNodeConfig?: Partial<ProverNodeConfig>;
|
|
297
298
|
} & Partial<AztecNodeConfig>;
|
|
298
299
|
|
|
299
300
|
/** Context for an end-to-end test as returned by the `setup` function */
|
|
@@ -532,11 +533,14 @@ export async function setup(
|
|
|
532
533
|
logger.verbose('Creating and syncing a simulated prover node...');
|
|
533
534
|
const proverNodePrivateKey = getPrivateKeyFromIndex(2);
|
|
534
535
|
const proverNodePrivateKeyHex: Hex = `0x${proverNodePrivateKey!.toString('hex')}`;
|
|
536
|
+
const proverNodeDataDirectory = path.join(directoryToCleanup, randomBytes(8).toString('hex'));
|
|
537
|
+
const proverNodeConfig = { ...config.proverNodeConfig, dataDirectory: proverNodeDataDirectory };
|
|
535
538
|
proverNode = await createAndSyncProverNode(
|
|
536
539
|
proverNodePrivateKeyHex,
|
|
537
540
|
config,
|
|
541
|
+
proverNodeConfig,
|
|
538
542
|
aztecNode,
|
|
539
|
-
|
|
543
|
+
prefilledPublicData,
|
|
540
544
|
);
|
|
541
545
|
}
|
|
542
546
|
|
|
@@ -745,22 +749,13 @@ export async function getSponsoredFPCAddress() {
|
|
|
745
749
|
* Deploy a sponsored FPC contract to a running instance.
|
|
746
750
|
*/
|
|
747
751
|
export async function setupSponsoredFPC(pxe: PXE) {
|
|
748
|
-
const
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
.send({
|
|
756
|
-
contractAddressSalt: new Fr(SPONSORED_FPC_SALT),
|
|
757
|
-
universalDeploy: true,
|
|
758
|
-
fee: { paymentMethod },
|
|
759
|
-
})
|
|
760
|
-
.deployed();
|
|
761
|
-
|
|
762
|
-
getLogger().info(`SponsoredFPC: ${deployed.address}`);
|
|
763
|
-
return deployed;
|
|
752
|
+
const instance = await getContractInstanceFromDeployParams(SponsoredFPCContract.artifact, {
|
|
753
|
+
salt: new Fr(SPONSORED_FPC_SALT),
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
await pxe.registerContract({ instance, artifact: SponsoredFPCContract.artifact });
|
|
757
|
+
getLogger().info(`SponsoredFPC: ${instance.address}`);
|
|
758
|
+
return instance;
|
|
764
759
|
}
|
|
765
760
|
|
|
766
761
|
export async function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec = 60, intervalSec = 1) {
|
|
@@ -774,60 +769,56 @@ export async function waitForProvenChain(node: AztecNode, targetBlock?: number,
|
|
|
774
769
|
);
|
|
775
770
|
}
|
|
776
771
|
|
|
777
|
-
export
|
|
772
|
+
export function createAndSyncProverNode(
|
|
778
773
|
proverNodePrivateKey: `0x${string}`,
|
|
779
774
|
aztecNodeConfig: AztecNodeConfig,
|
|
775
|
+
proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'>,
|
|
780
776
|
aztecNode: AztecNode,
|
|
781
|
-
dataDirectory: string,
|
|
782
777
|
prefilledPublicData: PublicDataTreeLeaf[] = [],
|
|
783
778
|
) {
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
const blobSinkClient = createBlobSinkClient(aztecNodeConfig, {
|
|
793
|
-
logger: createLogger('prover-node:blob-sink:client'),
|
|
794
|
-
});
|
|
795
|
-
// Creating temp store and archiver for simulated prover node
|
|
796
|
-
const archiverConfig = { ...aztecNodeConfig, dataDirectory };
|
|
797
|
-
const archiver = await createArchiver(archiverConfig, blobSinkClient, {
|
|
798
|
-
blockUntilSync: true,
|
|
799
|
-
});
|
|
779
|
+
return withLogNameSuffix('prover-node', async () => {
|
|
780
|
+
// Disable stopping the aztec node as the prover coordination test will kill it otherwise
|
|
781
|
+
// This is only required when stopping the prover node for testing
|
|
782
|
+
const aztecNodeTxProvider = {
|
|
783
|
+
getTxByHash: aztecNode.getTxByHash.bind(aztecNode),
|
|
784
|
+
getTxsByHash: aztecNode.getTxsByHash.bind(aztecNode),
|
|
785
|
+
stop: () => Promise.resolve(),
|
|
786
|
+
};
|
|
800
787
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
788
|
+
const blobSinkClient = createBlobSinkClient(aztecNodeConfig);
|
|
789
|
+
|
|
790
|
+
// Creating temp store and archiver for simulated prover node
|
|
791
|
+
const archiverConfig = { ...aztecNodeConfig, dataDirectory: proverNodeConfig.dataDirectory };
|
|
792
|
+
const archiver = await createArchiver(archiverConfig, blobSinkClient, { blockUntilSync: true });
|
|
793
|
+
|
|
794
|
+
// Prover node config is for simulated proofs
|
|
795
|
+
const proverConfig: ProverNodeConfig = {
|
|
796
|
+
...aztecNodeConfig,
|
|
797
|
+
proverCoordinationNodeUrls: [],
|
|
798
|
+
realProofs: false,
|
|
799
|
+
proverAgentCount: 2,
|
|
800
|
+
publisherPrivateKey: proverNodePrivateKey,
|
|
801
|
+
proverNodeMaxPendingJobs: 10,
|
|
802
|
+
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
803
|
+
proverNodePollingIntervalMs: 200,
|
|
804
|
+
txGatheringIntervalMs: 1000,
|
|
805
|
+
txGatheringBatchSize: 10,
|
|
806
|
+
txGatheringMaxParallelRequestsPerNode: 10,
|
|
807
|
+
proverNodeFailedEpochStore: undefined,
|
|
808
|
+
...proverNodeConfig,
|
|
809
|
+
};
|
|
816
810
|
|
|
817
|
-
|
|
811
|
+
const l1TxUtils = createDelayedL1TxUtils(aztecNodeConfig, proverNodePrivateKey, 'prover-node');
|
|
818
812
|
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
);
|
|
828
|
-
getLogger().info(`Created and synced prover node`, { publisherAddress: l1TxUtils.client.account!.address });
|
|
829
|
-
await proverNode.start();
|
|
830
|
-
return proverNode;
|
|
813
|
+
const proverNode = await createProverNode(
|
|
814
|
+
proverConfig,
|
|
815
|
+
{ aztecNodeTxProvider, archiver: archiver as Archiver, l1TxUtils },
|
|
816
|
+
{ prefilledPublicData },
|
|
817
|
+
);
|
|
818
|
+
getLogger().info(`Created and synced prover node`, { publisherAddress: l1TxUtils.client.account!.address });
|
|
819
|
+
await proverNode.start();
|
|
820
|
+
return proverNode;
|
|
821
|
+
});
|
|
831
822
|
}
|
|
832
823
|
|
|
833
824
|
function createDelayedL1TxUtils(aztecNodeConfig: AztecNodeConfig, privateKey: `0x${string}`, logName: string) {
|
|
@@ -44,9 +44,16 @@ export async function capturePrivateExecutionStepsIfEnvSet(
|
|
|
44
44
|
if (profileMode === 'full') {
|
|
45
45
|
// If we have gate counts, write the steps in human-readable format.
|
|
46
46
|
await fs.writeFile(
|
|
47
|
-
path.join(resultsDirectory, '
|
|
47
|
+
path.join(resultsDirectory, 'profile.json'),
|
|
48
48
|
JSON.stringify(
|
|
49
|
-
|
|
49
|
+
{
|
|
50
|
+
timings: result.timings,
|
|
51
|
+
steps: result.executionSteps.map(step => ({
|
|
52
|
+
fnName: step.functionName,
|
|
53
|
+
gateCount: step.gateCount,
|
|
54
|
+
timings: step.timings,
|
|
55
|
+
})),
|
|
56
|
+
},
|
|
50
57
|
null,
|
|
51
58
|
2,
|
|
52
59
|
),
|
|
@@ -170,9 +170,12 @@ export async function performTransfers({
|
|
|
170
170
|
for (let i = 0; i < rounds; i++) {
|
|
171
171
|
const interactions = await Promise.all(
|
|
172
172
|
testWallets.wallets.map(async w =>
|
|
173
|
-
(
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
(await TokenContract.at(testWallets.tokenAddress, w)).methods.transfer_in_public(
|
|
174
|
+
w.getAddress(),
|
|
175
|
+
recipient,
|
|
176
|
+
transferAmount,
|
|
177
|
+
0,
|
|
178
|
+
),
|
|
176
179
|
),
|
|
177
180
|
);
|
|
178
181
|
|