@aztec/end-to-end 0.0.1-commit.2b2662070 → 0.0.1-commit.2c0ee1788
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 +2 -2
- 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 +53 -5
- 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 +3 -3
- package/dest/e2e_p2p/p2p_network.d.ts +6 -3
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +38 -20
- 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 +9 -6
- 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 +20 -5
- 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/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 +7 -3
- package/dest/fixtures/setup.d.ts.map +1 -1
- package/dest/fixtures/setup.js +19 -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/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/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 +1 -1
- package/dest/test-wallet/test_wallet.d.ts.map +1 -1
- package/dest/test-wallet/test_wallet.js +10 -4
- package/package.json +39 -39
- package/src/bench/client_flows/client_flows_benchmark.ts +2 -2
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +1 -1
- package/src/e2e_epochs/epochs_test.ts +53 -4
- package/src/e2e_fees/fees_test.ts +5 -3
- package/src/e2e_p2p/p2p_network.ts +41 -18
- package/src/e2e_p2p/reqresp/utils.ts +7 -6
- package/src/e2e_p2p/shared.ts +17 -4
- package/src/fixtures/fixtures.ts +22 -0
- package/src/fixtures/ha_setup.ts +4 -2
- package/src/fixtures/schnorr_hardcoded_account_contract.ts +49 -0
- package/src/fixtures/setup.ts +27 -5
- 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/shared/gas_portal_test_harness.ts +0 -1
- package/src/shared/uniswap_l1_l2.ts +0 -4
- package/src/spartan/tx_metrics.ts +16 -4
- package/src/test-wallet/test_wallet.ts +9 -3
package/src/fixtures/setup.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { Fr } from '@aztec/aztec.js/fields';
|
|
|
17
17
|
import { type Logger, createLogger } from '@aztec/aztec.js/log';
|
|
18
18
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
19
19
|
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
20
|
-
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec/testing';
|
|
20
|
+
import { AnvilTestWatcher, type AnvilTestWatcherOpts, CheatCodes } from '@aztec/aztec/testing';
|
|
21
21
|
import { SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
22
22
|
import { isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
23
23
|
import { createExtendedL1Client } from '@aztec/ethereum/client';
|
|
@@ -185,6 +185,7 @@ export type SetupOptions = {
|
|
|
185
185
|
mockGossipSubNetworkLatency?: number;
|
|
186
186
|
/** Whether to disable the anvil test watcher (can still be manually started) */
|
|
187
187
|
disableAnvilTestWatcher?: boolean;
|
|
188
|
+
anvilTestWatcherOpts?: AnvilTestWatcherOpts;
|
|
188
189
|
/** Whether to enable anvil automine during deployment of L1 contracts (consider defaulting this to true). */
|
|
189
190
|
automineL1Setup?: boolean;
|
|
190
191
|
/** How many accounts to seed and unlock in anvil. */
|
|
@@ -206,8 +207,11 @@ export type SetupOptions = {
|
|
|
206
207
|
skipAccountDeployment?: boolean;
|
|
207
208
|
/** L1 contracts deployment arguments. */
|
|
208
209
|
l1ContractsArgs?: Partial<DeployAztecL1ContractsArgs>;
|
|
209
|
-
/** Wallet minimum fee padding multiplier
|
|
210
|
+
/** Wallet minimum fee padding multiplier */
|
|
210
211
|
walletMinFeePadding?: number;
|
|
212
|
+
/** Whether the initial node should be a lightweight RPC-only node (no sequencer, no validator).
|
|
213
|
+
* Use for tests that create their own validator nodes and don't need the initial sequencer. */
|
|
214
|
+
skipInitialSequencer?: boolean;
|
|
211
215
|
} & Partial<AztecNodeConfig>;
|
|
212
216
|
|
|
213
217
|
/** Context for an end-to-end test as returned by the `setup` function */
|
|
@@ -444,6 +448,7 @@ export async function setup(
|
|
|
444
448
|
deployL1ContractsValues.l1ContractAddresses.rollupAddress,
|
|
445
449
|
deployL1ContractsValues.l1Client,
|
|
446
450
|
dateProvider,
|
|
451
|
+
opts.anvilTestWatcherOpts,
|
|
447
452
|
);
|
|
448
453
|
if (!opts.disableAnvilTestWatcher) {
|
|
449
454
|
await watcher.start();
|
|
@@ -502,8 +507,23 @@ export async function setup(
|
|
|
502
507
|
}
|
|
503
508
|
}
|
|
504
509
|
|
|
510
|
+
// When skipInitialSequencer is set, the initial node is a lightweight RPC-only node.
|
|
511
|
+
// We apply these overrides to a copy so they don't leak into the returned config.
|
|
512
|
+
// Keep P2P enabled if mockGossipSubNetwork is used (needed for tx propagation to validators).
|
|
513
|
+
const initialNodeConfig = opts.skipInitialSequencer
|
|
514
|
+
? {
|
|
515
|
+
...config,
|
|
516
|
+
disableValidator: true,
|
|
517
|
+
...(opts.mockGossipSubNetwork ? {} : { p2pEnabled: false, bootstrapNodes: [] as string[] }),
|
|
518
|
+
}
|
|
519
|
+
: config;
|
|
520
|
+
|
|
505
521
|
const aztecNodeService = await withLoggerBindings({ actor: 'node-0' }, () =>
|
|
506
|
-
AztecNodeService.createAndSync(
|
|
522
|
+
AztecNodeService.createAndSync(
|
|
523
|
+
initialNodeConfig,
|
|
524
|
+
{ dateProvider, telemetry: telemetryClient, p2pClientDeps },
|
|
525
|
+
{ genesis, dontStartSequencer: opts.skipInitialSequencer },
|
|
526
|
+
),
|
|
507
527
|
);
|
|
508
528
|
const sequencerClient = aztecNodeService.getSequencer();
|
|
509
529
|
|
|
@@ -563,7 +583,9 @@ export async function setup(
|
|
|
563
583
|
|
|
564
584
|
let accounts: AztecAddress[] = [];
|
|
565
585
|
|
|
566
|
-
if (
|
|
586
|
+
if (opts.skipInitialSequencer) {
|
|
587
|
+
logger.info('Sequencer not started on initial node, skipping block progression');
|
|
588
|
+
} else if (shouldDeployAccounts) {
|
|
567
589
|
logger.info(
|
|
568
590
|
`${numberOfAccounts} accounts are being deployed. Reliably progressing past genesis by setting minTxsPerBlock to 1 and waiting for the accounts to be deployed`,
|
|
569
591
|
);
|
|
@@ -712,7 +734,7 @@ export async function waitForProvenChain(node: AztecNode, targetBlock?: BlockNum
|
|
|
712
734
|
targetBlock ??= await node.getBlockNumber();
|
|
713
735
|
|
|
714
736
|
await retryUntil(
|
|
715
|
-
async () => (await node.
|
|
737
|
+
async () => (await node.getBlockNumber('proven')) >= targetBlock,
|
|
716
738
|
'proven chain status',
|
|
717
739
|
timeoutSec,
|
|
718
740
|
intervalSec,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Wallet } from '@aztec/aztec.js/wallet';
|
|
2
|
+
import { WalletSchema } from '@aztec/aztec.js/wallet';
|
|
3
|
+
import { createSafeJsonRpcClient, makeFetch } from '@aztec/foundation/json-rpc/client';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Creates a JSON-RPC client that connects to a remote wallet service.
|
|
7
|
+
* The returned object implements the {@link Wallet} interface, proxying all calls over HTTP to the specified URL.
|
|
8
|
+
*/
|
|
9
|
+
export function createWalletClient(url: string): Wallet {
|
|
10
|
+
return createSafeJsonRpcClient<Wallet>(url, WalletSchema, {
|
|
11
|
+
namespaceMethods: 'wallet',
|
|
12
|
+
fetch: makeFetch([1, 2, 3], false),
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --no-warnings
|
|
2
|
+
/**
|
|
3
|
+
* Standalone entrypoint that spins up a local Aztec network (L1 + node) and exposes a {@link NodeEmbeddedWallet} over
|
|
4
|
+
* JSON-RPC.
|
|
5
|
+
*
|
|
6
|
+
* Intended for forward-compatibility testing: an **old** release image runs this script so that **new** tests can send
|
|
7
|
+
* new artifacts to old runtime code (loadContractArtifact, ACIR simulator, class-ID computation, entrypoint encoding,
|
|
8
|
+
* etc.).
|
|
9
|
+
*/
|
|
10
|
+
import { getSchnorrAccountContractAddress } from '@aztec/accounts/schnorr';
|
|
11
|
+
import { getInitialTestAccountsData } from '@aztec/accounts/testing';
|
|
12
|
+
import { createLocalNetwork } from '@aztec/aztec';
|
|
13
|
+
import { Fr } from '@aztec/aztec.js/fields';
|
|
14
|
+
import { WalletSchema } from '@aztec/aztec.js/wallet';
|
|
15
|
+
import { GrumpkinScalar } from '@aztec/foundation/curves/grumpkin';
|
|
16
|
+
import { createNamespacedSafeJsonRpcServer, startHttpRpcServer } from '@aztec/foundation/json-rpc/server';
|
|
17
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
18
|
+
import { AztecNodeApiSchema } from '@aztec/stdlib/interfaces/client';
|
|
19
|
+
import { EmbeddedWallet } from '@aztec/wallets/embedded';
|
|
20
|
+
|
|
21
|
+
const logger = createLogger('wallet-service');
|
|
22
|
+
|
|
23
|
+
const { ETHEREUM_HOSTS = 'http://localhost:8545', NODE_PORT = '8080', WALLET_PORT = '8081' } = process.env;
|
|
24
|
+
|
|
25
|
+
async function main() {
|
|
26
|
+
const l1RpcUrls = ETHEREUM_HOSTS.split(',').map(url => url.trim());
|
|
27
|
+
|
|
28
|
+
// Some tests (e.g. AMM) need 4 accounts but only 3 are funded via genesis. Generate deterministic keys for a 4th
|
|
29
|
+
// account so we can compute its address before network startup and include it in genesis funding. We cannot do this
|
|
30
|
+
// in the test because Wallet interface does not expose account creation functionality (only TestWallet exposes that
|
|
31
|
+
// but that's not used in forward compatibility testing).
|
|
32
|
+
const extraAccountSecret = Fr.fromHexString('0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef');
|
|
33
|
+
const extraAccountSalt = Fr.ZERO;
|
|
34
|
+
const extraAccountSigningKey = GrumpkinScalar.random();
|
|
35
|
+
const extraAccountAddress = await getSchnorrAccountContractAddress(
|
|
36
|
+
extraAccountSecret,
|
|
37
|
+
extraAccountSalt,
|
|
38
|
+
extraAccountSigningKey,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
logger.info('Starting wallet service...', { l1RpcUrls });
|
|
42
|
+
|
|
43
|
+
// createLocalNetwork deploys L1 contracts, starts the node, and optionally deploys funded test accounts (when
|
|
44
|
+
// TEST_ACCOUNTS=true via env). We are not proving anything just like is done when local network is started by
|
|
45
|
+
// the `aztecStart` function. The extra account address is passed via prefundAddresses so it gets fee juice at genesis.
|
|
46
|
+
const { node, stop: stopNetwork } = await createLocalNetwork(
|
|
47
|
+
{ l1RpcUrls, realProofs: false, prefundAddresses: [extraAccountAddress.toString()] },
|
|
48
|
+
logger.info,
|
|
49
|
+
);
|
|
50
|
+
|
|
51
|
+
// Create an ephemeral embedded wallet backed by the local node.
|
|
52
|
+
const wallet = await EmbeddedWallet.create(node, { ephemeral: true });
|
|
53
|
+
|
|
54
|
+
// Re-register the initial test accounts so they are available via wallet.getAccounts(). createLocalNetwork deploys
|
|
55
|
+
// them onchain but uses a temporary wallet that is then stopped.
|
|
56
|
+
//
|
|
57
|
+
// We use the non-lazy import path (@aztec/accounts/testing, not /lazy) to avoid the dynamic JSON import that is
|
|
58
|
+
// incompatible with Node.js import attribute enforcement.
|
|
59
|
+
const testAccountsData = await getInitialTestAccountsData();
|
|
60
|
+
const accounts = await Promise.all(
|
|
61
|
+
testAccountsData.map(({ secret, salt, signingKey }) => wallet.createSchnorrAccount(secret, salt, signingKey)),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
// Register and deploy the 4th account.
|
|
65
|
+
const extraAccount = await wallet.createSchnorrAccount(extraAccountSecret, extraAccountSalt, extraAccountSigningKey);
|
|
66
|
+
const deployMethod = await extraAccount.getDeployMethod();
|
|
67
|
+
await deployMethod.send({ from: accounts[0].address });
|
|
68
|
+
|
|
69
|
+
logger.info('Embedded wallet created', {
|
|
70
|
+
accounts: [...accounts, extraAccount].map(a => a.address.toString()),
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Contract artifacts are large, so allow generous body sizes for RPC requests.
|
|
74
|
+
const rpcOptions = { maxBodySizeBytes: '50mb' };
|
|
75
|
+
|
|
76
|
+
// Serve node RPC
|
|
77
|
+
const nodeRpcServer = createNamespacedSafeJsonRpcServer({ node: [node, AztecNodeApiSchema] }, rpcOptions);
|
|
78
|
+
const nodeHttpServer = await startHttpRpcServer(nodeRpcServer, { port: NODE_PORT });
|
|
79
|
+
logger.info(`Node JSON-RPC server listening on port ${nodeHttpServer.port}`);
|
|
80
|
+
|
|
81
|
+
// Serve wallet RPC
|
|
82
|
+
const walletRpcServer = createNamespacedSafeJsonRpcServer({ wallet: [wallet, WalletSchema] }, rpcOptions);
|
|
83
|
+
const walletHttpServer = await startHttpRpcServer(walletRpcServer, { port: WALLET_PORT });
|
|
84
|
+
logger.info(`Wallet JSON-RPC server listening on port ${walletHttpServer.port}`);
|
|
85
|
+
|
|
86
|
+
const shutdown = async () => {
|
|
87
|
+
logger.info('Shutting down...');
|
|
88
|
+
nodeHttpServer.close();
|
|
89
|
+
walletHttpServer.close();
|
|
90
|
+
await wallet.stop();
|
|
91
|
+
await stopNetwork();
|
|
92
|
+
process.exit(0);
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
96
|
+
process.once('SIGINT', shutdown);
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
|
98
|
+
process.once('SIGTERM', shutdown);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
main().catch(err => {
|
|
102
|
+
logger.error('Wallet service failed to start', err);
|
|
103
|
+
process.exit(1);
|
|
104
|
+
});
|
|
@@ -18,10 +18,8 @@ aztec-wallet() {
|
|
|
18
18
|
|
|
19
19
|
aztec-wallet import-test-accounts
|
|
20
20
|
|
|
21
|
-
# docs:start:declare-accounts
|
|
22
21
|
aztec-wallet create-account -a alice -f test0
|
|
23
22
|
aztec-wallet create-account -a bob -f test0
|
|
24
|
-
# docs:end:declare-accounts
|
|
25
23
|
|
|
26
24
|
aztec-wallet bridge-fee-juice 1000000000000000000000 accounts:alice --mint --no-wait
|
|
27
25
|
|
|
@@ -154,7 +154,6 @@ export const uniswapL1L2TestSuite = (
|
|
|
154
154
|
await cleanup();
|
|
155
155
|
});
|
|
156
156
|
|
|
157
|
-
// docs:start:uniswap_private
|
|
158
157
|
it('should uniswap trade on L1 from L2 funds privately (swaps WETH -> DAI)', async () => {
|
|
159
158
|
const wethL1BeforeBalance = await wethCrossChainHarness.getL1BalanceOf(ownerEthAddress);
|
|
160
159
|
|
|
@@ -345,10 +344,8 @@ export const uniswapL1L2TestSuite = (
|
|
|
345
344
|
logger.info('WETH balance after swap : ', wethL2BalanceAfterSwap.toString());
|
|
346
345
|
logger.info('DAI balance after swap : ', daiL2BalanceAfterSwap.toString());
|
|
347
346
|
});
|
|
348
|
-
// docs:end:uniswap_private
|
|
349
347
|
|
|
350
348
|
// TODO(#7463): reenable look into this failure https://github.com/AztecProtocol/aztec-packages/actions/runs/9912612912/job/27388320150?pr=7462
|
|
351
|
-
// // docs:start:uniswap_public
|
|
352
349
|
// it('should uniswap trade on L1 from L2 funds publicly (swaps WETH -> DAI)', async () => {
|
|
353
350
|
// const wethL1BeforeBalance = await wethCrossChainHarness.getL1BalanceOf(ownerEthAddress);
|
|
354
351
|
|
|
@@ -581,7 +578,6 @@ export const uniswapL1L2TestSuite = (
|
|
|
581
578
|
// logger.info('WETH balance after swap : ', wethL2BalanceAfterSwap.toString());
|
|
582
579
|
// logger.info('DAI balance after swap : ', daiL2BalanceAfterSwap.toString());
|
|
583
580
|
// });
|
|
584
|
-
// // docs:end:uniswap_public
|
|
585
581
|
|
|
586
582
|
// Edge cases for the private flow:
|
|
587
583
|
// note - tests for uniswapPortal.sol and minting asset on L2 are covered in other tests.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AztecNode } from '@aztec/aztec.js/node';
|
|
2
2
|
import type { Logger } from '@aztec/foundation/log';
|
|
3
|
-
import type {
|
|
3
|
+
import type { BlockResponse } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
import type { TopicType } from '@aztec/stdlib/p2p';
|
|
5
5
|
import { Tx, type TxReceipt } from '@aztec/stdlib/tx';
|
|
6
6
|
|
|
@@ -147,7 +147,7 @@ export type TxInclusionData = {
|
|
|
147
147
|
export class TxInclusionMetrics {
|
|
148
148
|
private data = new Map<string, TxInclusionData>();
|
|
149
149
|
private groups = new Set<string>();
|
|
150
|
-
private blocks = new Map<number, Promise<
|
|
150
|
+
private blocks = new Map<number, Promise<BlockResponse<{ includeTransactions: true }> | undefined>>();
|
|
151
151
|
|
|
152
152
|
private p2pGossipLatencyByTopic: Partial<Record<TopicType, { p50: number; p95: number }>> = {};
|
|
153
153
|
|
|
@@ -198,7 +198,7 @@ export class TxInclusionMetrics {
|
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
if (!this.blocks.has(blockNumber)) {
|
|
201
|
-
this.blocks.set(blockNumber, this.aztecNode.getBlock(blockNumber));
|
|
201
|
+
this.blocks.set(blockNumber, this.aztecNode.getBlock(blockNumber, { includeTransactions: true }));
|
|
202
202
|
}
|
|
203
203
|
|
|
204
204
|
const block = await this.blocks.get(blockNumber)!;
|
|
@@ -229,12 +229,24 @@ export class TxInclusionMetrics {
|
|
|
229
229
|
p99: number;
|
|
230
230
|
} {
|
|
231
231
|
const histogram = createHistogram({});
|
|
232
|
+
let nonPositive = 0;
|
|
232
233
|
for (const tx of this.data.values()) {
|
|
233
234
|
if (!tx.blocknumber || tx.group !== group || tx.minedAt === -1) {
|
|
234
235
|
continue;
|
|
235
236
|
}
|
|
236
237
|
|
|
237
|
-
|
|
238
|
+
// `minedAt` is the block's L2 slot timestamp (seconds) while `sentAt` is the wall-clock
|
|
239
|
+
// send time. Because the slot timestamp can precede or equal the send time, the delta
|
|
240
|
+
// can be <= 0, which perf_hooks.createHistogram rejects. Skip those instead of crashing.
|
|
241
|
+
const delta = tx.minedAt - tx.sentAt;
|
|
242
|
+
if (delta <= 0) {
|
|
243
|
+
nonPositive++;
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
histogram.record(delta);
|
|
247
|
+
}
|
|
248
|
+
if (nonPositive > 0) {
|
|
249
|
+
this.logger?.debug(`Dropped ${nonPositive} tx inclusion samples with non-positive delta`, { group });
|
|
238
250
|
}
|
|
239
251
|
|
|
240
252
|
if (histogram.count === 0) {
|
|
@@ -40,6 +40,7 @@ import { ExecutionPayload, mergeExecutionPayloads } from '@aztec/stdlib/tx';
|
|
|
40
40
|
import { BaseWallet, type SimulateViaEntrypointOptions } from '@aztec/wallet-sdk/base-wallet';
|
|
41
41
|
import type { AccountType } from '@aztec/wallets/embedded';
|
|
42
42
|
|
|
43
|
+
import { DEFAULT_MIN_FEE_PADDING } from '../fixtures/fixtures.js';
|
|
43
44
|
import { AztecNodeProxy, ProvenTx } from './utils.js';
|
|
44
45
|
|
|
45
46
|
/**
|
|
@@ -63,6 +64,7 @@ export class TestWallet extends BaseWallet {
|
|
|
63
64
|
private readonly nodeRef: AztecNodeProxy,
|
|
64
65
|
) {
|
|
65
66
|
super(pxe, nodeRef);
|
|
67
|
+
this.minFeePadding = DEFAULT_MIN_FEE_PADDING;
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
static async create(
|
|
@@ -178,7 +180,7 @@ export class TestWallet extends BaseWallet {
|
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
setMinFeePadding(value?: number) {
|
|
181
|
-
this.minFeePadding = value ??
|
|
183
|
+
this.minFeePadding = value ?? DEFAULT_MIN_FEE_PADDING;
|
|
182
184
|
}
|
|
183
185
|
|
|
184
186
|
protected getAccountFromAddress(address: AztecAddress): Promise<Account> {
|
|
@@ -258,7 +260,7 @@ export class TestWallet extends BaseWallet {
|
|
|
258
260
|
executionPayload: ExecutionPayload,
|
|
259
261
|
opts: SimulateViaEntrypointOptions,
|
|
260
262
|
): Promise<TxSimulationResultWithAppOffset> {
|
|
261
|
-
const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement } = opts;
|
|
263
|
+
const { from, feeOptions, additionalScopes, skipTxValidation, skipFeeEnforcement, sendMessagesAs } = opts;
|
|
262
264
|
const scopes = this.scopesFrom(from, additionalScopes);
|
|
263
265
|
const skipKernels = this.simulationMode !== 'full';
|
|
264
266
|
const useOverride = this.simulationMode === 'kernelless-override';
|
|
@@ -308,6 +310,7 @@ export class TestWallet extends BaseWallet {
|
|
|
308
310
|
skipTxValidation,
|
|
309
311
|
overrides,
|
|
310
312
|
scopes,
|
|
313
|
+
senderForTags: this.senderForTagsFrom(from, sendMessagesAs),
|
|
311
314
|
});
|
|
312
315
|
const appCallOffset = await this.computeAppCallOffset(from, feeOptions);
|
|
313
316
|
return TxSimulationResultWithAppOffset.fromResultAndOffset(result, appCallOffset);
|
|
@@ -320,7 +323,10 @@ export class TestWallet extends BaseWallet {
|
|
|
320
323
|
gasSettings: opts.fee?.gasSettings,
|
|
321
324
|
});
|
|
322
325
|
const txRequest = await this.createTxExecutionRequestFromPayloadAndFee(exec, opts.from, fee);
|
|
323
|
-
const txProvingResult = await this.pxe.proveTx(txRequest,
|
|
326
|
+
const txProvingResult = await this.pxe.proveTx(txRequest, {
|
|
327
|
+
scopes: this.scopesFrom(opts.from, opts.additionalScopes),
|
|
328
|
+
senderForTags: this.senderForTagsFrom(opts.from, opts.sendMessagesAs),
|
|
329
|
+
});
|
|
324
330
|
return new ProvenTx(
|
|
325
331
|
this.aztecNode,
|
|
326
332
|
await txProvingResult.toTx(),
|