@aztec/end-to-end 0.0.1-commit.72dcdcda8 → 0.0.1-commit.7689c7f
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/benchmark.d.ts +15 -1
- package/dest/bench/client_flows/benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/benchmark.js +17 -0
- package/dest/bench/client_flows/client_flows_benchmark.d.ts +2 -2
- package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -1
- package/dest/bench/client_flows/client_flows_benchmark.js +32 -36
- package/dest/bench/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +8 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +5 -4
- 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 +28 -19
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +15 -4
- 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 +39 -7
- package/dest/e2e_deploy_contract/deploy_test.d.ts +3 -3
- package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
- package/dest/e2e_deploy_contract/deploy_test.js +2 -1
- package/dest/e2e_epochs/epochs_test.d.ts +25 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +88 -14
- package/dest/e2e_fees/fees_test.d.ts +5 -2
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +44 -11
- package/dest/e2e_nested_contract/nested_contract_test.d.ts +3 -3
- package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
- package/dest/e2e_nested_contract/nested_contract_test.js +6 -7
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +5 -3
- package/dest/e2e_p2p/p2p_network.d.ts +13 -11
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +65 -43
- 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 +42 -13
- package/dest/e2e_p2p/shared.d.ts +25 -7
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +73 -50
- package/dest/e2e_token_contract/token_contract_test.d.ts +3 -3
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +15 -13
- package/dest/fixtures/authwit_proxy.d.ts +3 -3
- 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 +6 -5
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +13 -17
- package/dest/fixtures/fixtures.d.ts +73 -1
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +68 -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 +37 -0
- package/dest/fixtures/setup.d.ts +43 -11
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +138 -29
- package/dest/fixtures/setup_p2p_test.d.ts +10 -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/fixtures/utils.d.ts +2 -2
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +1 -1
- 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/install_legacy_contracts.d.cts +10 -0
- package/dest/install_legacy_contracts.d.cts.map +1 -0
- package/dest/legacy-jest-resolver.d.cts +3 -0
- package/dest/legacy-jest-resolver.d.cts.map +1 -0
- package/dest/shared/cross_chain_test_harness.d.ts +4 -2
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +22 -18
- package/dest/shared/gas_portal_test_harness.d.ts +8 -5
- package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
- package/dest/shared/gas_portal_test_harness.js +19 -10
- package/dest/shared/submit-transactions.d.ts +1 -1
- package/dest/shared/submit-transactions.d.ts.map +1 -1
- package/dest/shared/submit-transactions.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 +60 -39
- package/dest/shared/wait_for_l1_to_l2_message.d.ts +13 -0
- package/dest/shared/wait_for_l1_to_l2_message.d.ts.map +1 -0
- package/dest/shared/wait_for_l1_to_l2_message.js +10 -0
- package/dest/simulators/lending_simulator.d.ts +10 -3
- package/dest/simulators/lending_simulator.d.ts.map +1 -1
- package/dest/simulators/lending_simulator.js +26 -14
- package/dest/simulators/token_simulator.d.ts +1 -1
- package/dest/simulators/token_simulator.d.ts.map +1 -1
- package/dest/simulators/token_simulator.js +2 -2
- package/dest/spartan/setup_test_wallets.d.ts +4 -2
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +72 -39
- package/dest/spartan/tx_metrics.d.ts +18 -4
- package/dest/spartan/tx_metrics.d.ts.map +1 -1
- package/dest/spartan/tx_metrics.js +74 -21
- package/dest/spartan/utils/config.d.ts +9 -32
- package/dest/spartan/utils/config.d.ts.map +1 -1
- package/dest/spartan/utils/config.js +1 -0
- package/dest/spartan/utils/index.d.ts +2 -1
- package/dest/spartan/utils/index.d.ts.map +1 -1
- package/dest/spartan/utils/index.js +2 -0
- package/dest/spartan/utils/nodes.js +2 -2
- package/dest/spartan/utils/pod_logs.d.ts +25 -0
- package/dest/spartan/utils/pod_logs.d.ts.map +1 -0
- package/dest/spartan/utils/pod_logs.js +74 -0
- package/dest/test-wallet/test_wallet.d.ts +25 -23
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +146 -87
- package/dest/test-wallet/utils.d.ts +3 -3
- package/dest/test-wallet/utils.d.ts.map +1 -1
- package/dest/test-wallet/utils.js +2 -7
- package/dest/test-wallet/wallet_worker_script.js +2 -2
- package/dest/test-wallet/worker_wallet.d.ts +5 -4
- package/dest/test-wallet/worker_wallet.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet.js +5 -1
- package/dest/test-wallet/worker_wallet_schema.d.ts +110 -224
- package/dest/test-wallet/worker_wallet_schema.d.ts.map +1 -1
- package/dest/test-wallet/worker_wallet_schema.js +14 -2
- package/package.json +46 -42
- package/src/bench/client_flows/benchmark.ts +19 -0
- package/src/bench/client_flows/client_flows_benchmark.ts +59 -41
- package/src/bench/utils.ts +9 -3
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +42 -24
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +49 -11
- package/src/e2e_deploy_contract/deploy_test.ts +3 -2
- package/src/e2e_epochs/epochs_test.ts +99 -11
- package/src/e2e_fees/fees_test.ts +49 -9
- package/src/e2e_nested_contract/nested_contract_test.ts +9 -5
- package/src/e2e_p2p/inactivity_slash_test.ts +5 -3
- package/src/e2e_p2p/p2p_network.ts +82 -60
- package/src/e2e_p2p/reqresp/utils.ts +51 -12
- package/src/e2e_p2p/shared.ts +92 -64
- package/src/e2e_token_contract/token_contract_test.ts +28 -10
- package/src/fixtures/authwit_proxy.ts +4 -0
- package/src/fixtures/e2e_prover_test.ts +22 -19
- package/src/fixtures/fixtures.ts +86 -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 +175 -33
- package/src/fixtures/setup_p2p_test.ts +13 -9
- package/src/fixtures/token_utils.ts +1 -2
- package/src/fixtures/utils.ts +2 -0
- 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/install_legacy_contracts.cjs +75 -0
- package/src/legacy-jest-resolver.cjs +112 -0
- package/src/shared/cross_chain_test_harness.ts +27 -13
- package/src/shared/gas_portal_test_harness.ts +21 -11
- package/src/shared/submit-transactions.ts +1 -4
- package/src/shared/uniswap_l1_l2.ts +77 -50
- package/src/shared/wait_for_l1_to_l2_message.ts +23 -0
- package/src/simulators/lending_simulator.ts +32 -14
- package/src/simulators/token_simulator.ts +6 -2
- package/src/spartan/setup_test_wallets.ts +91 -37
- package/src/spartan/tx_metrics.ts +82 -24
- package/src/spartan/utils/config.ts +1 -0
- package/src/spartan/utils/index.ts +3 -0
- package/src/spartan/utils/nodes.ts +2 -2
- package/src/spartan/utils/pod_logs.ts +99 -0
- package/src/test-wallet/test_wallet.ts +174 -104
- package/src/test-wallet/utils.ts +3 -7
- package/src/test-wallet/wallet_worker_script.ts +2 -2
- package/src/test-wallet/worker_wallet.ts +9 -4
- package/src/test-wallet/worker_wallet_schema.ts +2 -2
|
@@ -11,7 +11,7 @@ import os from 'os';
|
|
|
11
11
|
import path from 'path';
|
|
12
12
|
import { getBootNodeUdpPort, shouldCollectMetrics } from '../../fixtures/fixtures.js';
|
|
13
13
|
import { createNodes } from '../../fixtures/setup_p2p_test.js';
|
|
14
|
-
import { P2PNetworkTest
|
|
14
|
+
import { P2PNetworkTest } from '../p2p_network.js';
|
|
15
15
|
import { prepareTransactions } from '../shared.js';
|
|
16
16
|
// Don't set this to a higher value than 9 because each node will use a different L1 publisher account and anvil seeds
|
|
17
17
|
export const NUM_VALIDATORS = 6;
|
|
@@ -40,7 +40,11 @@ export async function createReqrespTest(options = {}) {
|
|
|
40
40
|
p2pDisableStatusHandshake: true
|
|
41
41
|
} : {},
|
|
42
42
|
listenAddress: '127.0.0.1',
|
|
43
|
-
aztecEpochDuration: 64
|
|
43
|
+
aztecEpochDuration: 64,
|
|
44
|
+
// Pipelining: target-slot is one ahead of build-slot; inboxLag sources L1->L2
|
|
45
|
+
// messages from the previous checkpoint to avoid L1ToL2MessagesNotReadyError.
|
|
46
|
+
enableProposerPipelining: true,
|
|
47
|
+
inboxLag: 2
|
|
44
48
|
}
|
|
45
49
|
});
|
|
46
50
|
await t.setup();
|
|
@@ -72,7 +76,7 @@ export async function runReqrespTxTest(params) {
|
|
|
72
76
|
...t.ctx.aztecNodeConfig,
|
|
73
77
|
p2pDisableStatusHandshake: true
|
|
74
78
|
} : t.ctx.aztecNodeConfig;
|
|
75
|
-
const nodes = await createNodes(aztecNodeConfig, t.ctx.dateProvider, t.bootstrapNodeEnr, NUM_VALIDATORS, BOOT_NODE_UDP_PORT, t.
|
|
79
|
+
const nodes = await createNodes(aztecNodeConfig, t.ctx.dateProvider, t.bootstrapNodeEnr, NUM_VALIDATORS, BOOT_NODE_UDP_PORT, t.genesis, dataDir, shouldCollectMetrics());
|
|
76
80
|
t.logger.info('Waiting for nodes to connect');
|
|
77
81
|
await t.waitForP2PMeshConnectivity(nodes, NUM_VALIDATORS);
|
|
78
82
|
await t.setupAccount();
|
|
@@ -89,7 +93,11 @@ export async function runReqrespTxTest(params) {
|
|
|
89
93
|
const [timestamp] = await t.ctx.cheatCodes.rollup.advanceToNextSlot();
|
|
90
94
|
t.ctx.dateProvider.setTime(Number(timestamp) * 1000);
|
|
91
95
|
const startSlotTimestamp = BigInt(timestamp);
|
|
92
|
-
|
|
96
|
+
// Under pipelining the active builder during wallclock slot S targets slot S+1, so
|
|
97
|
+
// we must address the proposer of S+1 (not S) for batch 0. Shift the proposer lookup
|
|
98
|
+
// window by the pipelining offset so we always send to the currently-building proposer.
|
|
99
|
+
const proposerSlotOffset = t.ctx.aztecNodeConfig.enableProposerPipelining ? 1 : 0;
|
|
100
|
+
const { proposerIndexes, nodesToTurnOffTxGossip } = await getProposerIndexes(t, startSlotTimestamp, proposerSlotOffset);
|
|
93
101
|
t.logger.info(`Turning off tx gossip for nodes: ${nodesToTurnOffTxGossip.map(getNodePort)}`);
|
|
94
102
|
t.logger.info(`Sending txs to proposer nodes: ${proposerIndexes.map(getNodePort)}`);
|
|
95
103
|
// Replace the p2p node implementation of some of the nodes with a spy such that it does not store transactions that are gossiped to it
|
|
@@ -108,6 +116,11 @@ export async function runReqrespTxTest(params) {
|
|
|
108
116
|
t.logger.info('Sending transactions through proposer nodes');
|
|
109
117
|
const submittedTxs = await Promise.all(txBatches.map(async (batch, batchIndex)=>{
|
|
110
118
|
const proposerNode = nodes[proposerIndexes[batchIndex]];
|
|
119
|
+
for (const tx of batch){
|
|
120
|
+
t.logger.info(`Tx ${tx.getTxHash().toString()} base64: ${tx.toBuffer().toString('base64')}`);
|
|
121
|
+
}
|
|
122
|
+
const txHashes = batch.map((tx)=>tx.getTxHash().toString());
|
|
123
|
+
t.logger.info(`Sending batch ${batchIndex} to proposer ${getNodePort(proposerIndexes[batchIndex])}: ${txHashes.join(', ')}`);
|
|
111
124
|
await Promise.all(batch.map(async (tx)=>{
|
|
112
125
|
try {
|
|
113
126
|
await proposerNode.sendTx(tx);
|
|
@@ -121,28 +134,44 @@ export async function runReqrespTxTest(params) {
|
|
|
121
134
|
txHash: tx.getTxHash()
|
|
122
135
|
}));
|
|
123
136
|
}));
|
|
137
|
+
// Log pool state per node after sending
|
|
138
|
+
for(let i = 0; i < NUM_VALIDATORS; i++){
|
|
139
|
+
const count = await nodes[i].getPendingTxCount();
|
|
140
|
+
t.logger.info(`Node ${getNodePort(i)} pool has ${count} pending txs`);
|
|
141
|
+
}
|
|
142
|
+
// Use the test's own aztecSlotDuration (not the env default that p2p_network's
|
|
143
|
+
// WAIT_FOR_TX_TIMEOUT is derived from) so the timeout scales with this test's 36s slot.
|
|
144
|
+
// Under pipelining the round-trip is roughly build-slot + target-slot + L1 publish, so
|
|
145
|
+
// budget for >= 3 slots.
|
|
146
|
+
const waitForTxTimeout = t.ctx.aztecNodeConfig.aztecSlotDuration * 4.5;
|
|
124
147
|
t.logger.info('Waiting for all transactions to be mined');
|
|
125
148
|
await Promise.all(submittedTxs.flatMap((batch, batchIndex)=>batch.map(async (submittedTx, txIndex)=>{
|
|
126
149
|
t.logger.info(`Waiting for tx ${batchIndex}-${txIndex} ${submittedTx.txHash.toString()} to be mined`);
|
|
127
150
|
await waitForTx(submittedTx.node, submittedTx.txHash, {
|
|
128
|
-
timeout:
|
|
151
|
+
timeout: waitForTxTimeout
|
|
129
152
|
});
|
|
130
153
|
t.logger.info(`Tx ${batchIndex}-${txIndex} ${submittedTx.txHash.toString()} has been mined`);
|
|
131
154
|
})));
|
|
132
155
|
t.logger.info('All transactions mined');
|
|
133
156
|
// Assert that multiple blocks were built for at least one slot
|
|
134
157
|
t.logger.info('Verifying multiple blocks for at least one checkpoint');
|
|
135
|
-
|
|
136
|
-
|
|
158
|
+
// Wait for L1 checkpoint sync, which may lag behind P2P block propagation.
|
|
159
|
+
const checkpoints = await retryUntil(async ()=>{
|
|
160
|
+
const cps = await nodes[0].getCheckpoints(CheckpointNumber(1), 50, {
|
|
161
|
+
includeBlocks: true
|
|
162
|
+
});
|
|
163
|
+
return cps.length > 0 && cps.some((cp)=>(cp.blocks?.length ?? 0) >= 2) ? cps : undefined;
|
|
164
|
+
}, 'waiting for multi-block checkpoint to sync from L1', 30, 1);
|
|
137
165
|
let mbpsFound = false;
|
|
138
|
-
let expectedBlockNumber = checkpoints[0].
|
|
166
|
+
let expectedBlockNumber = checkpoints[0].blocks[0].number;
|
|
139
167
|
for (const published of checkpoints){
|
|
140
|
-
const
|
|
168
|
+
const blocks = published.blocks;
|
|
169
|
+
const blockCount = blocks.length;
|
|
141
170
|
mbpsFound = mbpsFound || blockCount >= 2;
|
|
142
171
|
for(let i = 0; i < blockCount; i++){
|
|
143
|
-
const block =
|
|
172
|
+
const block = blocks[i];
|
|
144
173
|
expect(block.indexWithinCheckpoint).toBe(i);
|
|
145
|
-
expect(block.checkpointNumber).toBe(published.
|
|
174
|
+
expect(block.checkpointNumber).toBe(published.number);
|
|
146
175
|
expect(block.number).toBe(expectedBlockNumber);
|
|
147
176
|
expectedBlockNumber++;
|
|
148
177
|
}
|
|
@@ -150,7 +179,7 @@ export async function runReqrespTxTest(params) {
|
|
|
150
179
|
expect(mbpsFound).toBe(true);
|
|
151
180
|
return nodes;
|
|
152
181
|
}
|
|
153
|
-
async function getProposerIndexes(t, startSlotTimestamp) {
|
|
182
|
+
async function getProposerIndexes(t, startSlotTimestamp, slotOffset = 0) {
|
|
154
183
|
// Get the nodes for the next set of slots
|
|
155
184
|
const rollupContract = new RollupContract(t.ctx.deployL1ContractsValues.l1Client, t.ctx.deployL1ContractsValues.l1ContractAddresses.rollupAddress);
|
|
156
185
|
const attesters = await rollupContract.getAttesters();
|
|
@@ -158,7 +187,7 @@ async function getProposerIndexes(t, startSlotTimestamp) {
|
|
|
158
187
|
const proposers = await Promise.all(Array.from({
|
|
159
188
|
length: 3
|
|
160
189
|
}, async (_, i)=>{
|
|
161
|
-
const slot = SlotNumber(startSlot + i);
|
|
190
|
+
const slot = SlotNumber(startSlot + slotOffset + i);
|
|
162
191
|
const slotTimestamp = await rollupContract.getTimestampForSlot(slot);
|
|
163
192
|
return await rollupContract.getProposerAt(slotTimestamp);
|
|
164
193
|
}));
|
package/dest/e2e_p2p/shared.d.ts
CHANGED
|
@@ -4,21 +4,40 @@ import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
|
4
4
|
import type { Logger } from '@aztec/aztec.js/log';
|
|
5
5
|
import { TxHash } from '@aztec/aztec.js/tx';
|
|
6
6
|
import type { RollupCheatCodes } from '@aztec/aztec/testing';
|
|
7
|
-
import type {
|
|
7
|
+
import type { EpochCacheInterface } from '@aztec/epoch-cache';
|
|
8
|
+
import type { RollupContract, SlashingProposerContract } from '@aztec/ethereum/contracts';
|
|
9
|
+
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
10
|
+
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
8
11
|
import type { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
9
12
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
10
|
-
import type { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
11
13
|
import { type ProvenTx } from '../test-wallet/utils.js';
|
|
12
14
|
export declare const submitComplexTxsTo: (logger: Logger, from: AztecAddress, spamContract: SpamContract, numTxs: number, opts?: {
|
|
13
15
|
callPublic?: boolean | undefined;
|
|
14
16
|
}) => Promise<TxHash[]>;
|
|
15
17
|
export declare const submitTransactions: (logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData) => Promise<TxHash[]>;
|
|
16
18
|
export declare function prepareTransactions(logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData): Promise<ProvenTx[]>;
|
|
17
|
-
export declare function awaitProposalExecution(slashingProposer:
|
|
19
|
+
export declare function awaitProposalExecution(slashingProposer: SlashingProposerContract, timeoutSeconds: number, logger: Logger): Promise<bigint>;
|
|
18
20
|
export declare function awaitCommitteeExists({ rollup, logger }: {
|
|
19
21
|
rollup: RollupContract;
|
|
20
22
|
logger: Logger;
|
|
21
23
|
}): Promise<readonly `0x${string}`[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Advance epochs until we find one where the target proposer is selected for at least one slot,
|
|
26
|
+
* then stop one epoch before it. This leaves time for the caller to start sequencers before
|
|
27
|
+
* warping to the target epoch, avoiding the race where the target epoch passes before sequencers
|
|
28
|
+
* are ready.
|
|
29
|
+
*
|
|
30
|
+
* Returns the target epoch number so the caller can warp to it after starting sequencers.
|
|
31
|
+
*/
|
|
32
|
+
export declare function advanceToEpochBeforeProposer({ epochCache, cheatCodes, targetProposer, logger, maxAttempts }: {
|
|
33
|
+
epochCache: EpochCacheInterface;
|
|
34
|
+
cheatCodes: RollupCheatCodes;
|
|
35
|
+
targetProposer: EthAddress;
|
|
36
|
+
logger: Logger;
|
|
37
|
+
maxAttempts?: number;
|
|
38
|
+
}): Promise<{
|
|
39
|
+
targetEpoch: EpochNumber;
|
|
40
|
+
}>;
|
|
22
41
|
export declare function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSize, epochDuration, waitUntilOffenseCount, timeoutSeconds }: {
|
|
23
42
|
nodeAdmin: AztecNodeAdmin;
|
|
24
43
|
logger: Logger;
|
|
@@ -31,16 +50,15 @@ export declare function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundS
|
|
|
31
50
|
* Await the committee to be slashed out of the validator set.
|
|
32
51
|
* Currently assumes that the committee is the same size as the validator set.
|
|
33
52
|
*/
|
|
34
|
-
export declare function awaitCommitteeKicked({ rollup, cheatCodes, committee,
|
|
53
|
+
export declare function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashingProposer, slashingRoundSize, aztecSlotDuration, aztecEpochDuration, logger, offenseEpoch }: {
|
|
35
54
|
rollup: RollupContract;
|
|
36
55
|
cheatCodes: RollupCheatCodes;
|
|
37
56
|
committee: readonly `0x${string}`[];
|
|
38
|
-
|
|
39
|
-
slashingProposer: EmpireSlashingProposerContract | TallySlashingProposerContract | undefined;
|
|
57
|
+
slashingProposer: SlashingProposerContract | undefined;
|
|
40
58
|
slashingRoundSize: number;
|
|
41
59
|
aztecSlotDuration: number;
|
|
42
60
|
aztecEpochDuration: number;
|
|
43
61
|
logger: Logger;
|
|
44
62
|
offenseEpoch: number;
|
|
45
63
|
}): Promise<void>;
|
|
46
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
64
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hhcmVkLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZTJlX3AycC9zaGFyZWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUNsRSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQzFELE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUd6RCxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNsRCxPQUFPLEVBQUUsTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDNUMsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUM3RCxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQzlELE9BQU8sS0FBSyxFQUFFLGNBQWMsRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzFGLE9BQU8sRUFBRSxXQUFXLEVBQWMsTUFBTSxpQ0FB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IsR0FBRyxTQUFTLENBQUM7SUFDdkQsaUJBQWlCLEVBQUUsTUFBTSxDQUFDO0lBQzFCLGlCQUFpQixFQUFFLE1BQU0sQ0FBQztJQUMxQixrQkFBa0IsRUFBRSxNQUFNLENBQUM7SUFDM0IsTUFBTSxFQUFFLE1BQU0sQ0FBQztJQUNmLFlBQVksRUFBRSxNQUFNLENBQUM7Q0FDdEIsaUJBMERBIn0=
|
|
@@ -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,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,
|
|
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,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,KAAK,EA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AA;CAAE,CAAC,CA8BxC;AAED,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,SAAS,EACT,iBAAiB,EACjB,aAAa,EACb,qBAAqB,EACrB,cAAoB,EACrB,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,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,MAAM,EACN,YAAY,EACb,EAAE;IACD,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,gBAAgB,CAAC;IAC7B,SAAS,EAAE,SAAS,KAAK,MAAM,EAAE,EAAE,CAAC;IACpC,gBAAgB,EAAE,wBAAwB,GAAG,SAAS,CAAC;IACvD,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,iBA0DA"}
|
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { NO_WAIT, getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
|
|
2
2
|
import { Fr } from '@aztec/aztec.js/fields';
|
|
3
|
-
import { EpochNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { EpochNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
4
4
|
import { timesAsync, unique } from '@aztec/foundation/collection';
|
|
5
5
|
import { retryUntil } from '@aztec/foundation/retry';
|
|
6
6
|
import { pluralize } from '@aztec/foundation/string';
|
|
7
7
|
import { TestContract, TestContractArtifact } from '@aztec/noir-test-contracts.js/Test';
|
|
8
8
|
import { getPXEConfig, getPXEConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
9
9
|
import { getRoundForOffense } from '@aztec/slasher';
|
|
10
|
+
import { SchnorrHardcodedKeyAccountContract } from '../fixtures/schnorr_hardcoded_account_contract.js';
|
|
10
11
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
11
12
|
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
12
13
|
import { proveInteraction } from '../test-wallet/utils.js';
|
|
@@ -17,7 +18,7 @@ export const submitComplexTxsTo = async (logger, from, spamContract, numTxs, opt
|
|
|
17
18
|
const spamCount = 15;
|
|
18
19
|
for(let i = 0; i < numTxs; i++){
|
|
19
20
|
const method = spamContract.methods.spam(seed + BigInt(i * spamCount), spamCount, !!opts.callPublic);
|
|
20
|
-
const txHash = await method.send({
|
|
21
|
+
const { txHash } = await method.send({
|
|
21
22
|
from,
|
|
22
23
|
wait: NO_WAIT
|
|
23
24
|
});
|
|
@@ -30,13 +31,21 @@ export const submitComplexTxsTo = async (logger, from, spamContract, numTxs, opt
|
|
|
30
31
|
export const submitTransactions = async (logger, node, numTxs, fundedAccount)=>{
|
|
31
32
|
const rpcConfig = getRpcConfig();
|
|
32
33
|
rpcConfig.proverEnabled = false;
|
|
33
|
-
const wallet = await TestWallet.create(node,
|
|
34
|
+
const wallet = await TestWallet.create(node, // Use checkpointed chain tip to avoid anchoring on provisional blocks that the archiver can prune
|
|
35
|
+
// when their slot ends without a checkpoint landing on L1.
|
|
36
|
+
{
|
|
34
37
|
...getPXEConfig(),
|
|
35
|
-
proverEnabled: false
|
|
38
|
+
proverEnabled: false,
|
|
39
|
+
syncChainTip: 'checkpointed'
|
|
36
40
|
}, {
|
|
37
41
|
loggerActorLabel: 'pxe-tx'
|
|
38
42
|
});
|
|
39
|
-
const
|
|
43
|
+
const contract = new SchnorrHardcodedKeyAccountContract();
|
|
44
|
+
const fundedAccountManager = await wallet.createAccount({
|
|
45
|
+
secret: fundedAccount.secret,
|
|
46
|
+
salt: fundedAccount.salt,
|
|
47
|
+
contract
|
|
48
|
+
});
|
|
40
49
|
return submitTxsTo(wallet, fundedAccountManager.address, numTxs, logger);
|
|
41
50
|
};
|
|
42
51
|
export async function prepareTransactions(logger, node, numTxs, fundedAccount) {
|
|
@@ -44,11 +53,17 @@ export async function prepareTransactions(logger, node, numTxs, fundedAccount) {
|
|
|
44
53
|
rpcConfig.proverEnabled = false;
|
|
45
54
|
const wallet = await TestWallet.create(node, {
|
|
46
55
|
...getPXEConfig(),
|
|
47
|
-
proverEnabled: false
|
|
56
|
+
proverEnabled: false,
|
|
57
|
+
syncChainTip: 'checkpointed'
|
|
48
58
|
}, {
|
|
49
59
|
loggerActorLabel: 'pxe-tx'
|
|
50
60
|
});
|
|
51
|
-
const
|
|
61
|
+
const accountContract = new SchnorrHardcodedKeyAccountContract();
|
|
62
|
+
const fundedAccountManager = await wallet.createAccount({
|
|
63
|
+
secret: fundedAccount.secret,
|
|
64
|
+
salt: fundedAccount.salt,
|
|
65
|
+
contract: accountContract
|
|
66
|
+
});
|
|
52
67
|
const testContractInstance = await getContractInstanceFromInstantiationParams(TestContractArtifact, {
|
|
53
68
|
salt: Fr.random()
|
|
54
69
|
});
|
|
@@ -68,24 +83,12 @@ export function awaitProposalExecution(slashingProposer, timeoutSeconds, logger)
|
|
|
68
83
|
logger.warn(`Timed out waiting for proposal execution`);
|
|
69
84
|
reject(new Error(`Timeout waiting for proposal execution after ${timeoutSeconds}s`));
|
|
70
85
|
}, timeoutSeconds * 1000);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
logger.warn(`Proposal ${args.payload} from round ${args.round} executed`);
|
|
74
|
-
clearTimeout(timeout);
|
|
75
|
-
unwatch();
|
|
76
|
-
resolve(args.round);
|
|
77
|
-
});
|
|
78
|
-
} else if (slashingProposer.type === 'tally') {
|
|
79
|
-
const unwatch = slashingProposer.listenToRoundExecuted((args)=>{
|
|
80
|
-
logger.warn(`Slash from round ${args.round} executed`);
|
|
81
|
-
clearTimeout(timeout);
|
|
82
|
-
unwatch();
|
|
83
|
-
resolve(args.round);
|
|
84
|
-
});
|
|
85
|
-
} else {
|
|
86
|
+
const unwatch = slashingProposer.listenToRoundExecuted((args)=>{
|
|
87
|
+
logger.warn(`Slash from round ${args.round} executed`);
|
|
86
88
|
clearTimeout(timeout);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
unwatch();
|
|
90
|
+
resolve(args.round);
|
|
91
|
+
});
|
|
89
92
|
});
|
|
90
93
|
}
|
|
91
94
|
export async function awaitCommitteeExists({ rollup, logger }) {
|
|
@@ -100,6 +103,37 @@ export async function awaitCommitteeExists({ rollup, logger }) {
|
|
|
100
103
|
});
|
|
101
104
|
return committee.map((c)=>c.toString());
|
|
102
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* Advance epochs until we find one where the target proposer is selected for at least one slot,
|
|
108
|
+
* then stop one epoch before it. This leaves time for the caller to start sequencers before
|
|
109
|
+
* warping to the target epoch, avoiding the race where the target epoch passes before sequencers
|
|
110
|
+
* are ready.
|
|
111
|
+
*
|
|
112
|
+
* Returns the target epoch number so the caller can warp to it after starting sequencers.
|
|
113
|
+
*/ export async function advanceToEpochBeforeProposer({ epochCache, cheatCodes, targetProposer, logger, maxAttempts = 20 }) {
|
|
114
|
+
const { epochDuration } = await cheatCodes.getConfig();
|
|
115
|
+
for(let attempt = 0; attempt < maxAttempts; attempt++){
|
|
116
|
+
const currentEpoch = await cheatCodes.getEpoch();
|
|
117
|
+
// Check the NEXT epoch's slots so we stay one epoch before the target,
|
|
118
|
+
// giving the caller time to start sequencers before the target epoch arrives.
|
|
119
|
+
const nextEpoch = Number(currentEpoch) + 1;
|
|
120
|
+
const startSlot = nextEpoch * Number(epochDuration);
|
|
121
|
+
const endSlot = startSlot + Number(epochDuration);
|
|
122
|
+
logger.info(`Checking next epoch ${nextEpoch} (slots ${startSlot}-${endSlot - 1}) for proposer ${targetProposer} (current epoch: ${currentEpoch})`);
|
|
123
|
+
for(let s = startSlot; s < endSlot; s++){
|
|
124
|
+
const proposer = await epochCache.getProposerAttesterAddressInSlot(SlotNumber(s));
|
|
125
|
+
if (proposer && proposer.equals(targetProposer)) {
|
|
126
|
+
logger.warn(`Found target proposer ${targetProposer} in slot ${s} of epoch ${nextEpoch}. Staying at epoch ${currentEpoch} to allow sequencer startup.`);
|
|
127
|
+
return {
|
|
128
|
+
targetEpoch: EpochNumber(nextEpoch)
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
logger.info(`Target proposer not found in epoch ${nextEpoch}, advancing to next epoch`);
|
|
133
|
+
await cheatCodes.advanceToNextEpoch();
|
|
134
|
+
}
|
|
135
|
+
throw new Error(`Target proposer ${targetProposer} not found in any slot after ${maxAttempts} epoch attempts`);
|
|
136
|
+
}
|
|
103
137
|
export async function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSize, epochDuration, waitUntilOffenseCount, timeoutSeconds = 120 }) {
|
|
104
138
|
const targetOffenseCount = waitUntilOffenseCount ?? 1;
|
|
105
139
|
logger.warn(`Waiting for ${pluralize('offense', targetOffenseCount)} to be detected`);
|
|
@@ -120,42 +154,31 @@ export async function awaitOffenseDetected({ logger, nodeAdmin, slashingRoundSiz
|
|
|
120
154
|
/**
|
|
121
155
|
* Await the committee to be slashed out of the validator set.
|
|
122
156
|
* Currently assumes that the committee is the same size as the validator set.
|
|
123
|
-
*/ export async function awaitCommitteeKicked({ rollup, cheatCodes, committee,
|
|
157
|
+
*/ export async function awaitCommitteeKicked({ rollup, cheatCodes, committee, slashingProposer, slashingRoundSize, aztecSlotDuration, aztecEpochDuration, logger, offenseEpoch }) {
|
|
124
158
|
if (!slashingProposer) {
|
|
125
159
|
throw new Error('No slashing proposer configured. Cannot test slashing.');
|
|
126
160
|
}
|
|
127
161
|
await cheatCodes.debugRollup();
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
// 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)
|
|
139
|
-
expect(unique(slashPayloadEvents[0].slashes.map((slash)=>slash.validator.toString()))).toHaveLength(committee.length);
|
|
140
|
-
} else {
|
|
141
|
-
// Use the slash offset to ensure we are in the right epoch for tally
|
|
142
|
-
const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
|
|
143
|
-
const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
|
|
144
|
-
const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
|
|
145
|
-
const firstEpochInOffenseRound = offenseEpoch - offenseEpoch % slashingRoundSizeInEpochs;
|
|
146
|
-
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
|
|
147
|
-
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
148
|
-
await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), {
|
|
149
|
-
offset: -aztecSlotDuration / 2
|
|
150
|
-
});
|
|
151
|
-
}
|
|
162
|
+
// Use the slash offset to ensure we are in the right epoch for tally
|
|
163
|
+
const slashOffsetInRounds = await slashingProposer.getSlashOffsetInRounds();
|
|
164
|
+
const slashingRoundSizeInEpochs = slashingRoundSize / aztecEpochDuration;
|
|
165
|
+
const slashingOffsetInEpochs = Number(slashOffsetInRounds) * slashingRoundSizeInEpochs;
|
|
166
|
+
const firstEpochInOffenseRound = offenseEpoch - offenseEpoch % slashingRoundSizeInEpochs;
|
|
167
|
+
const targetEpoch = firstEpochInOffenseRound + slashingOffsetInEpochs;
|
|
168
|
+
logger.info(`Advancing to epoch ${targetEpoch} so we start slashing`);
|
|
169
|
+
await cheatCodes.advanceToEpoch(EpochNumber(targetEpoch), {
|
|
170
|
+
offset: -aztecSlotDuration / 2
|
|
171
|
+
});
|
|
152
172
|
const attestersPre = await rollup.getAttesters();
|
|
153
173
|
expect(attestersPre.length).toBe(committee.length);
|
|
154
174
|
for (const attester of attestersPre){
|
|
155
175
|
const attesterInfo = await rollup.getAttesterView(attester);
|
|
156
176
|
expect(attesterInfo.status).toEqual(1); // Validating
|
|
157
177
|
}
|
|
158
|
-
|
|
178
|
+
// Allow up to four round-lengths so that under proposer pipelining, where individual rounds
|
|
179
|
+
// sometimes fail to gather quorum because parts of the committee miss votes due to chain-state
|
|
180
|
+
// races, we still see a later round execute the slash.
|
|
181
|
+
const timeout = slashingRoundSize * 4 * aztecSlotDuration + 30;
|
|
159
182
|
logger.info(`Waiting for slash to be executed (timeout ${timeout}s)`);
|
|
160
183
|
await awaitProposalExecution(slashingProposer, timeout, logger);
|
|
161
184
|
// The attesters should still form the committee but they should be reduced to the "living" status
|
|
@@ -4,7 +4,7 @@ import type { AztecNode } from '@aztec/aztec.js/node';
|
|
|
4
4
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
5
5
|
import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
|
|
6
6
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
7
|
-
import { type EndToEndContext } from '../fixtures/setup.js';
|
|
7
|
+
import { type EndToEndContext, type SetupOptions } from '../fixtures/setup.js';
|
|
8
8
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
9
9
|
import type { TestWallet } from '../test-wallet/test_wallet.js';
|
|
10
10
|
export declare class TokenContractTest {
|
|
@@ -37,8 +37,8 @@ export declare class TokenContractTest {
|
|
|
37
37
|
*/
|
|
38
38
|
applyMintSnapshot(): void;
|
|
39
39
|
private applyBaseSetup;
|
|
40
|
-
setup(): Promise<void>;
|
|
40
|
+
setup(opts?: Partial<SetupOptions>): Promise<void>;
|
|
41
41
|
teardown(): Promise<void>;
|
|
42
42
|
private applyMint;
|
|
43
43
|
}
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,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IsS0FBSyxFQUFHLGFBQWEsQ0FBQztJQUN0QixRQUFRLEVBQUcsY0FBYyxDQUFDO0lBQzFCLElBQUksRUFBRyxTQUFTLENBQUM7SUFFakIsVUFBVSxFQUFHLHNCQUFzQixDQUFDO0lBQ3BDLFlBQVksRUFBRyxvQkFBb0IsQ0FBQztJQUNwQyxNQUFNLEVBQUcsVUFBVSxDQUFDO0lBQ3BCLFlBQVksRUFBRyxZQUFZLENBQUM7SUFDNUIsZUFBZSxFQUFHLFlBQVksQ0FBQztJQUMvQixlQUFlLEVBQUcsWUFBWSxDQUFDO0lBRS9CLE9BQU8sQ0FBQyxvQkFBb0IsQ0FBUztJQUNyQyxPQUFPLENBQUMsZUFBZSxDQUFTO0lBRWhDLFlBQVksUUFBUSxFQUFFLE1BQU0sRUFHM0I7SUFFRDs7O09BR0c7SUFDSCxrQkFBa0IsU0FFakI7SUFFRDs7O09BR0c7SUFDSCxpQkFBaUIsU0FFaEI7WUFLYSxjQUFjO0lBeUR0QixLQUFLLENBQUMsSUFBSSxHQUFFLE9BQU8sQ0FBQyxZQUFZLENBQU0saUJBZTNDO0lBRUssUUFBUSxrQkFFYjtZQUVhLFNBQVM7Q0ErQnhCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAClF,OAAO,EAAE,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAItF,OAAO,
|
|
1
|
+
{"version":3,"file":"token_contract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SAEhB;YAKa,cAAc;IAyDtB,KAAK,CAAC,IAAI,GAAE,OAAO,CAAC,YAAY,CAAM,iBAe3C;IAEK,QAAQ,kBAEb;YAEa,SAAS;CA+BxB"}
|
|
@@ -3,7 +3,7 @@ import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
|
3
3
|
import { GenericProxyContract } from '@aztec/noir-test-contracts.js/GenericProxy';
|
|
4
4
|
import { InvalidAccountContract } from '@aztec/noir-test-contracts.js/InvalidAccount';
|
|
5
5
|
import { jest } from '@jest/globals';
|
|
6
|
-
import { deployAccounts, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
6
|
+
import { deployAccounts, ensureAuthRegistryPublished, publicDeployAccounts, setup, teardown } from '../fixtures/setup.js';
|
|
7
7
|
import { mintTokensToPrivate } from '../fixtures/token_utils.js';
|
|
8
8
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
9
9
|
const { METRICS_PORT: metricsPort } = process.env;
|
|
@@ -55,39 +55,41 @@ export class TokenContractTest {
|
|
|
55
55
|
this.wallet = this.context.wallet;
|
|
56
56
|
[this.adminAddress, this.account1Address, this.account2Address] = deployedAccounts.map((acc)=>acc.address);
|
|
57
57
|
this.logger.info('Applying base setup - deploying token contract');
|
|
58
|
+
await ensureAuthRegistryPublished(this.wallet, this.adminAddress);
|
|
58
59
|
this.logger.verbose(`Public deploy accounts...`);
|
|
59
60
|
await publicDeployAccounts(this.wallet, [
|
|
60
61
|
this.adminAddress,
|
|
61
62
|
this.account1Address
|
|
62
63
|
]);
|
|
63
64
|
this.logger.verbose(`Deploying TokenContract...`);
|
|
64
|
-
this.asset = await TokenContract.deploy(this.wallet, this.adminAddress, TokenContractTest.TOKEN_NAME, TokenContractTest.TOKEN_SYMBOL, TokenContractTest.TOKEN_DECIMALS).send({
|
|
65
|
+
({ contract: this.asset } = await TokenContract.deploy(this.wallet, this.adminAddress, TokenContractTest.TOKEN_NAME, TokenContractTest.TOKEN_SYMBOL, TokenContractTest.TOKEN_DECIMALS).send({
|
|
65
66
|
from: this.adminAddress
|
|
66
|
-
});
|
|
67
|
+
}));
|
|
67
68
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
68
69
|
this.logger.verbose(`Deploying bad account...`);
|
|
69
|
-
this.badAccount = await InvalidAccountContract.deploy(this.wallet).send({
|
|
70
|
+
({ contract: this.badAccount } = await InvalidAccountContract.deploy(this.wallet).send({
|
|
70
71
|
from: this.adminAddress
|
|
71
|
-
});
|
|
72
|
+
}));
|
|
72
73
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
73
74
|
// Deploy a proxy contract for "on behalf of other" tests. The note owner must be the tx sender
|
|
74
75
|
// (so their notes are in scope), but msg_sender in the target must differ from the note owner
|
|
75
76
|
// to trigger authwit validation. The proxy forwards calls so that msg_sender != tx sender.
|
|
76
77
|
this.logger.verbose(`Deploying generic proxy...`);
|
|
77
|
-
this.authwitProxy = await GenericProxyContract.deploy(this.wallet).send({
|
|
78
|
+
({ contract: this.authwitProxy } = await GenericProxyContract.deploy(this.wallet).send({
|
|
78
79
|
from: this.adminAddress
|
|
79
|
-
});
|
|
80
|
+
}));
|
|
80
81
|
this.logger.verbose(`Deployed to ${this.authwitProxy.address}.`);
|
|
81
82
|
this.tokenSim = new TokenSimulator(this.asset, this.wallet, this.adminAddress, this.logger, [
|
|
82
83
|
this.adminAddress,
|
|
83
84
|
this.account1Address
|
|
84
85
|
]);
|
|
85
|
-
expect(await this.asset.methods.get_admin().simulate({
|
|
86
|
+
expect((await this.asset.methods.get_admin().simulate({
|
|
86
87
|
from: this.adminAddress
|
|
87
|
-
})).toBe(this.adminAddress.toBigInt());
|
|
88
|
+
})).result).toBe(this.adminAddress.toBigInt());
|
|
88
89
|
}
|
|
89
|
-
async setup() {
|
|
90
|
+
async setup(opts = {}) {
|
|
90
91
|
this.context = await setup(0, {
|
|
92
|
+
...opts,
|
|
91
93
|
metricsPort: this.metricsPort,
|
|
92
94
|
fundSponsoredFPC: true,
|
|
93
95
|
skipAccountDeployment: true
|
|
@@ -111,7 +113,7 @@ export class TokenContractTest {
|
|
|
111
113
|
from: adminAddress
|
|
112
114
|
});
|
|
113
115
|
tokenSim.mintPublic(adminAddress, amount);
|
|
114
|
-
const publicBalance = await asset.methods.balance_of_public(adminAddress).simulate({
|
|
116
|
+
const { result: publicBalance } = await asset.methods.balance_of_public(adminAddress).simulate({
|
|
115
117
|
from: adminAddress
|
|
116
118
|
});
|
|
117
119
|
this.logger.verbose(`Public balance of wallet 0: ${publicBalance}`);
|
|
@@ -119,12 +121,12 @@ export class TokenContractTest {
|
|
|
119
121
|
this.logger.verbose(`Minting ${amount} privately...`);
|
|
120
122
|
await mintTokensToPrivate(asset, adminAddress, adminAddress, amount);
|
|
121
123
|
tokenSim.mintPrivate(adminAddress, amount);
|
|
122
|
-
const privateBalance = await asset.methods.balance_of_private(adminAddress).simulate({
|
|
124
|
+
const { result: privateBalance } = await asset.methods.balance_of_private(adminAddress).simulate({
|
|
123
125
|
from: adminAddress
|
|
124
126
|
});
|
|
125
127
|
this.logger.verbose(`Private balance of wallet 0: ${privateBalance}`);
|
|
126
128
|
expect(privateBalance).toEqual(tokenSim.balanceOfPrivate(adminAddress));
|
|
127
|
-
const totalSupply = await asset.methods.total_supply().simulate({
|
|
129
|
+
const { result: totalSupply } = await asset.methods.total_supply().simulate({
|
|
128
130
|
from: adminAddress
|
|
129
131
|
});
|
|
130
132
|
this.logger.verbose(`Total supply: ${totalSupply}`);
|
|
@@ -5,11 +5,11 @@ import type { GenericProxyContract } from '@aztec/noir-test-contracts.js/Generic
|
|
|
5
5
|
* The proxy becomes msg_sender in the target (triggering authwit validation),
|
|
6
6
|
* while the actual tx sender retains their keys in scope.
|
|
7
7
|
*/
|
|
8
|
-
export declare function sendThroughAuthwitProxy(proxy: GenericProxyContract, action: ContractFunctionInteraction, options: SendInteractionOptions): Promise<import("@aztec/stdlib/tx").TxReceipt
|
|
8
|
+
export declare function sendThroughAuthwitProxy(proxy: GenericProxyContract, action: ContractFunctionInteraction, options: SendInteractionOptions): Promise<import("@aztec/aztec.js/contracts").TxSendResultMined<import("@aztec/stdlib/tx").TxReceipt>>;
|
|
9
9
|
/**
|
|
10
10
|
* Simulates a contract call through the authwit proxy.
|
|
11
11
|
* The proxy becomes msg_sender in the target (triggering authwit validation),
|
|
12
12
|
* while the actual tx sender retains their keys in scope.
|
|
13
13
|
*/
|
|
14
|
-
export declare function simulateThroughAuthwitProxy(proxy: GenericProxyContract, action: ContractFunctionInteraction, options: SimulateInteractionOptions): Promise<
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
export declare function simulateThroughAuthwitProxy(proxy: GenericProxyContract, action: ContractFunctionInteraction, options: SimulateInteractionOptions): Promise<import("@aztec/aztec.js/contracts").SimulationResult>;
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aHdpdF9wcm94eS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZpeHR1cmVzL2F1dGh3aXRfcHJveHkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQ1YsMkJBQTJCLEVBQzNCLHNCQUFzQixFQUN0QiwwQkFBMEIsRUFDM0IsTUFBTSwyQkFBMkIsQ0FBQztBQUNuQyxPQUFPLEtBQUssRUFBRSxvQkFBb0IsRUFBRSxNQUFNLDRDQUE0QyxDQUFDO0FBc0J2Rjs7OztHQUlHO0FBQ0gsd0JBQXNCLHVCQUF1QixDQUMzQyxLQUFLLEVBQUUsb0JBQW9CLEVBQzNCLE1BQU0sRUFBRSwyQkFBMkIsRUFDbkMsT0FBTyxFQUFFLHNCQUFzQix3R0FJaEM7QUFFRDs7OztHQUlHO0FBQ0gsd0JBQXNCLDJCQUEyQixDQUMvQyxLQUFLLEVBQUUsb0JBQW9CLEVBQzNCLE1BQU0sRUFBRSwyQkFBMkIsRUFDbkMsT0FBTyxFQUFFLDBCQUEwQixpRUFJcEMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authwit_proxy.d.ts","sourceRoot":"","sources":["../../src/fixtures/authwit_proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"authwit_proxy.d.ts","sourceRoot":"","sources":["../../src/fixtures/authwit_proxy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,0BAA0B,EAC3B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAsBvF;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,oBAAoB,EAC3B,MAAM,EAAE,2BAA2B,EACnC,OAAO,EAAE,sBAAsB,wGAIhC;AAED;;;;GAIG;AACH,wBAAsB,2BAA2B,CAC/C,KAAK,EAAE,oBAAoB,EAC3B,MAAM,EAAE,2BAA2B,EACnC,OAAO,EAAE,0BAA0B,iEAIpC"}
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
return proxy.methods.forward_private_3(call.to, call.selector, call.args);
|
|
10
10
|
} else if (argCount === 4) {
|
|
11
11
|
return proxy.methods.forward_private_4(call.to, call.selector, call.args);
|
|
12
|
+
} else if (argCount === 5) {
|
|
13
|
+
return proxy.methods.forward_private_5(call.to, call.selector, call.args);
|
|
14
|
+
} else if (argCount === 6) {
|
|
15
|
+
return proxy.methods.forward_private_6(call.to, call.selector, call.args);
|
|
12
16
|
}
|
|
13
17
|
throw new Error(`No forward_private_${argCount} method on proxy`);
|
|
14
18
|
}
|
|
@@ -3,14 +3,14 @@ import { AztecAddress, EthAddress } from '@aztec/aztec.js/addresses';
|
|
|
3
3
|
import { type Logger } from '@aztec/aztec.js/log';
|
|
4
4
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
5
5
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
6
|
-
import {
|
|
6
|
+
import type { ClientProtocolCircuitVerifier } from '@aztec/bb-prover';
|
|
7
7
|
import type { DeployAztecL1ContractsReturnType } from '@aztec/ethereum/deploy-aztec-l1-contracts';
|
|
8
8
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
9
|
import type { ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
10
10
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
11
11
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
12
12
|
import { TestWallet } from '../test-wallet/test_wallet.js';
|
|
13
|
-
import { type EndToEndContext } from './setup.js';
|
|
13
|
+
import { type EndToEndContext, type SetupOptions } from './setup.js';
|
|
14
14
|
/**
|
|
15
15
|
* Largely taken from the e2e_token_contract test file. We deploy 2 accounts and a token contract.
|
|
16
16
|
* However, we then setup a second PXE with a full prover instance.
|
|
@@ -35,7 +35,8 @@ export declare class FullProverTest {
|
|
|
35
35
|
private provenComponents;
|
|
36
36
|
private bbConfigCleanup?;
|
|
37
37
|
private acvmConfigCleanup?;
|
|
38
|
-
|
|
38
|
+
/** Returns the proof verifier from the prover node (for test assertions). */
|
|
39
|
+
get circuitProofVerifier(): ClientProtocolCircuitVerifier | undefined;
|
|
39
40
|
provenAsset: TokenContract;
|
|
40
41
|
context: EndToEndContext;
|
|
41
42
|
private proverAztecNode;
|
|
@@ -47,9 +48,9 @@ export declare class FullProverTest {
|
|
|
47
48
|
private realProofs;
|
|
48
49
|
constructor(testName: string, minNumberOfTxsPerBlock: number, coinbase: EthAddress, realProofs?: boolean);
|
|
49
50
|
private applyBaseSetup;
|
|
50
|
-
setup(): Promise<this>;
|
|
51
|
+
setup(opts?: Partial<SetupOptions>): Promise<this>;
|
|
51
52
|
private mintFeeJuice;
|
|
52
53
|
teardown(): Promise<void>;
|
|
53
54
|
private applyMint;
|
|
54
55
|
}
|
|
55
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZTJlX3Byb3Zlcl90ZXN0LmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZml4dHVyZXMvZTJlX3Byb3Zlcl90ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFbEUsT0FBTyxFQUFFLFlBQVksRUFBRSxVQUFVLEVBQUUsTUFBTSwyQkFBMkIsQ0FBQztBQUNyRSxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0scUJBQXFCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDdEQsT0FBTyxFQUFFLFVBQVUsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQ2xELE9BQU8sS0FBSyxFQUFFLDZCQUE2QixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFdEUsT0FBTyxLQUFLLEVBQUUsZ0NBQWdDLEVBQUUsTUFBTSwyQ0FBMkMsQ0FBQztBQUlsRyxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDL0QsT0FBTyxLQUFLLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUMxRSxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQU10RSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFDbEUsT0FBTyxFQU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