@aztec/end-to-end 0.0.0-test.0 → 0.0.1-fake-c83136db25

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.
Files changed (166) hide show
  1. package/dest/bench/client_flows/benchmark.d.ts +61 -0
  2. package/dest/bench/client_flows/benchmark.d.ts.map +1 -0
  3. package/dest/bench/client_flows/benchmark.js +261 -0
  4. package/dest/bench/client_flows/client_flows_benchmark.d.ts +73 -0
  5. package/dest/bench/client_flows/client_flows_benchmark.d.ts.map +1 -0
  6. package/dest/bench/client_flows/client_flows_benchmark.js +311 -0
  7. package/dest/bench/client_flows/config.d.ts +14 -0
  8. package/dest/bench/client_flows/config.d.ts.map +1 -0
  9. package/dest/bench/client_flows/config.js +106 -0
  10. package/dest/bench/client_flows/data_extractor.d.ts +2 -0
  11. package/dest/bench/client_flows/data_extractor.d.ts.map +1 -0
  12. package/dest/bench/client_flows/data_extractor.js +99 -0
  13. package/dest/bench/utils.d.ts +10 -36
  14. package/dest/bench/utils.d.ts.map +1 -1
  15. package/dest/bench/utils.js +26 -66
  16. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +20 -12
  17. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
  18. package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +85 -57
  19. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts +18 -24
  20. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
  21. package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +48 -69
  22. package/dest/e2e_deploy_contract/deploy_test.d.ts +14 -6
  23. package/dest/e2e_deploy_contract/deploy_test.d.ts.map +1 -1
  24. package/dest/e2e_deploy_contract/deploy_test.js +13 -19
  25. package/dest/e2e_epochs/epochs_test.d.ts +58 -17
  26. package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
  27. package/dest/e2e_epochs/epochs_test.js +224 -43
  28. package/dest/e2e_fees/bridging_race.notest.d.ts +2 -0
  29. package/dest/e2e_fees/bridging_race.notest.d.ts.map +1 -0
  30. package/dest/e2e_fees/bridging_race.notest.js +63 -0
  31. package/dest/e2e_fees/fees_test.d.ts +20 -9
  32. package/dest/e2e_fees/fees_test.d.ts.map +1 -1
  33. package/dest/e2e_fees/fees_test.js +98 -107
  34. package/dest/e2e_l1_publisher/write_json.d.ts +10 -0
  35. package/dest/e2e_l1_publisher/write_json.d.ts.map +1 -0
  36. package/dest/e2e_l1_publisher/write_json.js +57 -0
  37. package/dest/e2e_multi_validator/utils.d.ts +12 -0
  38. package/dest/e2e_multi_validator/utils.d.ts.map +1 -0
  39. package/dest/e2e_multi_validator/utils.js +214 -0
  40. package/dest/e2e_nested_contract/nested_contract_test.d.ts +9 -6
  41. package/dest/e2e_nested_contract/nested_contract_test.d.ts.map +1 -1
  42. package/dest/e2e_nested_contract/nested_contract_test.js +22 -19
  43. package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
  44. package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
  45. package/dest/e2e_p2p/inactivity_slash_test.js +135 -0
  46. package/dest/e2e_p2p/p2p_network.d.ts +69 -22
  47. package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
  48. package/dest/e2e_p2p/p2p_network.js +180 -129
  49. package/dest/e2e_p2p/shared.d.ts +41 -5
  50. package/dest/e2e_p2p/shared.d.ts.map +1 -1
  51. package/dest/e2e_p2p/shared.js +163 -19
  52. package/dest/e2e_token_contract/token_contract_test.d.ts +11 -5
  53. package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
  54. package/dest/e2e_token_contract/token_contract_test.js +50 -26
  55. package/dest/{e2e_prover → fixtures}/e2e_prover_test.d.ts +14 -9
  56. package/dest/fixtures/e2e_prover_test.d.ts.map +1 -0
  57. package/dest/{e2e_prover → fixtures}/e2e_prover_test.js +95 -100
  58. package/dest/fixtures/fixtures.d.ts +5 -6
  59. package/dest/fixtures/fixtures.d.ts.map +1 -1
  60. package/dest/fixtures/fixtures.js +4 -3
  61. package/dest/fixtures/get_acvm_config.d.ts +1 -1
  62. package/dest/fixtures/get_acvm_config.d.ts.map +1 -1
  63. package/dest/fixtures/get_acvm_config.js +2 -14
  64. package/dest/fixtures/get_bb_config.d.ts +1 -1
  65. package/dest/fixtures/get_bb_config.d.ts.map +1 -1
  66. package/dest/fixtures/get_bb_config.js +10 -17
  67. package/dest/fixtures/l1_to_l2_messaging.d.ts +8 -5
  68. package/dest/fixtures/l1_to_l2_messaging.d.ts.map +1 -1
  69. package/dest/fixtures/l1_to_l2_messaging.js +44 -18
  70. package/dest/fixtures/setup_l1_contracts.d.ts +3 -3
  71. package/dest/fixtures/setup_l1_contracts.d.ts.map +1 -1
  72. package/dest/fixtures/setup_l1_contracts.js +4 -4
  73. package/dest/fixtures/setup_p2p_test.d.ts +14 -13
  74. package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
  75. package/dest/fixtures/setup_p2p_test.js +73 -21
  76. package/dest/fixtures/snapshot_manager.d.ts +15 -7
  77. package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
  78. package/dest/fixtures/snapshot_manager.js +147 -121
  79. package/dest/fixtures/token_utils.d.ts +6 -3
  80. package/dest/fixtures/token_utils.d.ts.map +1 -1
  81. package/dest/fixtures/token_utils.js +23 -10
  82. package/dest/fixtures/utils.d.ts +76 -37
  83. package/dest/fixtures/utils.d.ts.map +1 -1
  84. package/dest/fixtures/utils.js +464 -368
  85. package/dest/fixtures/web3signer.d.ts +5 -0
  86. package/dest/fixtures/web3signer.d.ts.map +1 -0
  87. package/dest/fixtures/web3signer.js +53 -0
  88. package/dest/quality_of_service/alert_checker.d.ts +1 -1
  89. package/dest/quality_of_service/alert_checker.d.ts.map +1 -1
  90. package/dest/shared/cross_chain_test_harness.d.ts +41 -25
  91. package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
  92. package/dest/shared/cross_chain_test_harness.js +104 -50
  93. package/dest/shared/gas_portal_test_harness.d.ts +32 -24
  94. package/dest/shared/gas_portal_test_harness.d.ts.map +1 -1
  95. package/dest/shared/gas_portal_test_harness.js +50 -29
  96. package/dest/shared/jest_setup.js +1 -1
  97. package/dest/shared/submit-transactions.d.ts +5 -3
  98. package/dest/shared/submit-transactions.d.ts.map +1 -1
  99. package/dest/shared/submit-transactions.js +8 -7
  100. package/dest/shared/uniswap_l1_l2.d.ts +13 -11
  101. package/dest/shared/uniswap_l1_l2.d.ts.map +1 -1
  102. package/dest/shared/uniswap_l1_l2.js +138 -108
  103. package/dest/simulators/lending_simulator.d.ts +6 -6
  104. package/dest/simulators/lending_simulator.d.ts.map +1 -1
  105. package/dest/simulators/lending_simulator.js +13 -16
  106. package/dest/simulators/token_simulator.d.ts +5 -2
  107. package/dest/simulators/token_simulator.d.ts.map +1 -1
  108. package/dest/simulators/token_simulator.js +16 -13
  109. package/dest/spartan/setup_test_wallets.d.ts +23 -10
  110. package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
  111. package/dest/spartan/setup_test_wallets.js +167 -58
  112. package/dest/spartan/utils.d.ts +100 -303
  113. package/dest/spartan/utils.d.ts.map +1 -1
  114. package/dest/spartan/utils.js +407 -130
  115. package/package.json +61 -56
  116. package/src/bench/client_flows/benchmark.ts +341 -0
  117. package/src/bench/client_flows/client_flows_benchmark.ts +402 -0
  118. package/src/bench/client_flows/config.ts +61 -0
  119. package/src/bench/client_flows/data_extractor.ts +111 -0
  120. package/src/bench/utils.ts +22 -76
  121. package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +80 -77
  122. package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +63 -105
  123. package/src/e2e_deploy_contract/deploy_test.ts +23 -38
  124. package/src/e2e_epochs/epochs_test.ts +274 -54
  125. package/src/e2e_fees/bridging_race.notest.ts +80 -0
  126. package/src/e2e_fees/fees_test.ts +137 -136
  127. package/src/e2e_l1_publisher/write_json.ts +76 -0
  128. package/src/e2e_multi_validator/utils.ts +258 -0
  129. package/src/e2e_nested_contract/nested_contract_test.ts +27 -18
  130. package/src/e2e_p2p/inactivity_slash_test.ts +178 -0
  131. package/src/e2e_p2p/p2p_network.ts +272 -166
  132. package/src/e2e_p2p/shared.ts +244 -29
  133. package/src/e2e_token_contract/token_contract_test.ts +43 -39
  134. package/src/fixtures/dumps/epoch_proof_result.json +1 -1
  135. package/src/{e2e_prover → fixtures}/e2e_prover_test.ts +101 -145
  136. package/src/fixtures/fixtures.ts +4 -3
  137. package/src/fixtures/get_acvm_config.ts +3 -11
  138. package/src/fixtures/get_bb_config.ts +18 -13
  139. package/src/fixtures/l1_to_l2_messaging.ts +53 -23
  140. package/src/fixtures/setup_l1_contracts.ts +6 -7
  141. package/src/fixtures/setup_p2p_test.ts +112 -38
  142. package/src/fixtures/snapshot_manager.ts +187 -139
  143. package/src/fixtures/token_utils.ts +29 -12
  144. package/src/fixtures/utils.ts +552 -425
  145. package/src/fixtures/web3signer.ts +63 -0
  146. package/src/guides/up_quick_start.sh +6 -14
  147. package/src/quality_of_service/alert_checker.ts +1 -1
  148. package/src/shared/cross_chain_test_harness.ts +108 -79
  149. package/src/shared/gas_portal_test_harness.ts +58 -49
  150. package/src/shared/jest_setup.ts +1 -1
  151. package/src/shared/submit-transactions.ts +12 -8
  152. package/src/shared/uniswap_l1_l2.ts +173 -176
  153. package/src/simulators/lending_simulator.ts +12 -15
  154. package/src/simulators/token_simulator.ts +21 -13
  155. package/src/spartan/DEVELOP.md +121 -0
  156. package/src/spartan/setup_test_wallets.ts +215 -93
  157. package/src/spartan/utils.ts +458 -130
  158. package/dest/e2e_prover/e2e_prover_test.d.ts.map +0 -1
  159. package/dest/sample-dapp/connect.js +0 -12
  160. package/dest/sample-dapp/contracts.js +0 -10
  161. package/dest/sample-dapp/deploy.js +0 -35
  162. package/dest/sample-dapp/index.js +0 -98
  163. package/src/sample-dapp/connect.mjs +0 -16
  164. package/src/sample-dapp/contracts.mjs +0 -14
  165. package/src/sample-dapp/deploy.mjs +0 -40
  166. package/src/sample-dapp/index.mjs +0 -128
@@ -1,20 +1,30 @@
1
1
  import { AztecNodeService } from '@aztec/aztec-node';
2
- import { Fr, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js';
3
- import { ChainMonitor } from '@aztec/aztec.js/ethereum';
2
+ import { getTimestampRangeForEpoch } from '@aztec/aztec.js/block';
3
+ import { getContractInstanceFromInstantiationParams } from '@aztec/aztec.js/contracts';
4
+ import { Fr } from '@aztec/aztec.js/fields';
5
+ import { MerkleTreeId } from '@aztec/aztec.js/trees';
6
+ import { EpochCache } from '@aztec/epoch-cache';
7
+ import { DefaultL1ContractsConfig, createExtendedL1Client } from '@aztec/ethereum';
4
8
  import { RollupContract } from '@aztec/ethereum/contracts';
5
- import { waitUntilL1Timestamp } from '@aztec/ethereum/test';
9
+ import { ChainMonitor, DelayedTxUtils, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
10
+ import { SecretValue } from '@aztec/foundation/config';
6
11
  import { randomBytes } from '@aztec/foundation/crypto';
7
12
  import { withLogNameSuffix } from '@aztec/foundation/log';
8
- import { MerkleTreeId } from '@aztec/stdlib/trees';
13
+ import { retryUntil } from '@aztec/foundation/retry';
14
+ import { sleep } from '@aztec/foundation/sleep';
15
+ import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
16
+ import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
17
+ import { SequencerState } from '@aztec/sequencer-client';
18
+ import { EthAddress } from '@aztec/stdlib/block';
19
+ import { getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
20
+ import { tryStop } from '@aztec/stdlib/interfaces/server';
9
21
  import { join } from 'path';
22
+ import { privateKeyToAccount } from 'viem/accounts';
10
23
  import { createAndSyncProverNode, getPrivateKeyFromIndex, setup } from '../fixtures/utils.js';
11
- // This can be lowered to as much as 2s in non-CI
12
- export const L1_BLOCK_TIME_IN_S = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : 8;
13
- export const EPOCH_DURATION_IN_L2_SLOTS = 4;
14
- export const L2_SLOT_DURATION_IN_L1_SLOTS = 2;
15
24
  export const WORLD_STATE_BLOCK_HISTORY = 2;
16
25
  export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
17
26
  export const ARCHIVER_POLL_INTERVAL = 50;
27
+ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
18
28
  /**
19
29
  * Tests building of epochs using fast block times and short epochs.
20
30
  * Spawns an aztec node and a prover node with fake proofs.
@@ -26,38 +36,61 @@ export const ARCHIVER_POLL_INTERVAL = 50;
26
36
  constants;
27
37
  logger;
28
38
  monitor;
39
+ epochCache;
29
40
  proverDelayer;
30
41
  sequencerDelayer;
31
42
  proverNodes = [];
32
43
  nodes = [];
44
+ epochDuration;
45
+ L1_BLOCK_TIME_IN_S;
46
+ L2_SLOT_DURATION_IN_S;
33
47
  static async setup(opts = {}) {
34
48
  const test = new EpochsTestContext();
35
49
  await test.setup(opts);
36
50
  return test;
37
51
  }
52
+ static getSlotDurations(opts = {}) {
53
+ const envEthereumSlotDuration = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : DEFAULT_L1_BLOCK_TIME;
54
+ const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
55
+ const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
56
+ const aztecEpochDuration = opts.aztecEpochDuration ?? 6;
57
+ const aztecProofSubmissionEpochs = opts.aztecProofSubmissionEpochs ?? 1;
58
+ return {
59
+ ethereumSlotDuration,
60
+ aztecSlotDuration,
61
+ aztecEpochDuration,
62
+ aztecProofSubmissionEpochs
63
+ };
64
+ }
38
65
  async setup(opts = {}) {
66
+ const { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionEpochs } = EpochsTestContext.getSlotDurations(opts);
67
+ this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
68
+ this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
39
69
  // Set up system without any account nor protocol contracts
40
70
  // and with faster block times and shorter epochs.
41
- const context = await setup(0, {
71
+ const context = await setup(opts.numberOfAccounts ?? 0, {
72
+ automineL1Setup: true,
42
73
  checkIntervalMs: 50,
43
74
  archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
44
75
  worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
45
76
  skipProtocolContracts: true,
46
77
  salt: 1,
47
- aztecEpochDuration: EPOCH_DURATION_IN_L2_SLOTS,
48
- aztecSlotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
49
- ethereumSlotDuration: L1_BLOCK_TIME_IN_S,
50
- aztecProofSubmissionWindow: EPOCH_DURATION_IN_L2_SLOTS * 2 - 1,
78
+ aztecEpochDuration,
79
+ aztecSlotDuration,
80
+ ethereumSlotDuration,
81
+ aztecProofSubmissionEpochs,
82
+ aztecTargetCommitteeSize: opts.initialValidators?.length ?? 0,
51
83
  minTxsPerBlock: 0,
52
84
  realProofs: false,
53
85
  startProverNode: true,
86
+ proverTestDelayMs: opts.proverTestDelayMs ?? 0,
54
87
  // We use numeric incremental prover ids for simplicity, but we can switch to
55
88
  // using the prover's eth address if the proverId is used for something in the rollup contract
56
- proverId: Fr.fromString('1'),
57
- // This must be enough so that the tx from the prover is delayed properly,
58
- // but not so much to hang the sequencer and timeout the teardown
59
- txPropagationMaxQueryAttempts: 12,
89
+ // Use numeric EthAddress for deterministic prover id
90
+ proverId: EthAddress.fromNumber(1),
60
91
  worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
92
+ exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
93
+ slasherFlavor: 'none',
61
94
  ...opts
62
95
  });
63
96
  this.context = context;
@@ -68,52 +101,108 @@ export const ARCHIVER_POLL_INTERVAL = 50;
68
101
  context.aztecNode
69
102
  ] : [];
70
103
  this.logger = context.logger;
71
- this.l1Client = context.deployL1ContractsValues.publicClient;
104
+ this.l1Client = context.deployL1ContractsValues.l1Client;
72
105
  this.rollup = RollupContract.getFromConfig(context.config);
106
+ this.epochCache = await EpochCache.create(this.rollup, context.config, {
107
+ dateProvider: context.dateProvider
108
+ });
73
109
  // Loop that tracks L1 and L2 block numbers and logs whenever there's a new one.
74
- this.monitor = new ChainMonitor(this.rollup, this.logger).start();
110
+ this.monitor = new ChainMonitor(this.rollup, context.dateProvider, this.logger).start();
75
111
  // This is hideous.
76
112
  // We ought to have a definite reference to the l1TxUtils that we're using in both places, provided by the test context.
77
113
  this.proverDelayer = context.proverNode ? context.proverNode.publisher.l1TxUtils.delayer : undefined;
78
- this.sequencerDelayer = context.sequencer.sequencer.publisher.l1TxUtils.delayer;
79
- if (context.proverNode && !this.proverDelayer || !this.sequencerDelayer) {
114
+ this.sequencerDelayer = context.sequencer ? context.sequencer.sequencer.publisher.l1TxUtils.delayer : undefined;
115
+ if (context.proverNode && !this.proverDelayer || context.sequencer && !this.sequencerDelayer) {
80
116
  throw new Error(`Could not find prover or sequencer delayer`);
81
117
  }
82
118
  // Constants used for time calculation
119
+ this.epochDuration = aztecEpochDuration;
83
120
  this.constants = {
84
- epochDuration: EPOCH_DURATION_IN_L2_SLOTS,
85
- slotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
121
+ epochDuration: aztecEpochDuration,
122
+ slotDuration: aztecSlotDuration,
86
123
  l1StartBlock: await this.rollup.getL1StartBlock(),
87
124
  l1GenesisTime: await this.rollup.getL1GenesisTime(),
88
- ethereumSlotDuration: L1_BLOCK_TIME_IN_S
125
+ ethereumSlotDuration,
126
+ proofSubmissionEpochs: Number(await this.rollup.getProofSubmissionEpochs())
89
127
  };
90
128
  this.logger.info(`L2 genesis at L1 block ${this.constants.l1StartBlock} (timestamp ${this.constants.l1GenesisTime})`);
91
129
  }
92
130
  async teardown() {
93
- this.monitor.stop();
94
- await Promise.all(this.proverNodes.map((node)=>node.stop()));
95
- await Promise.all(this.nodes.map((node)=>node.stop()));
131
+ await this.monitor.stop();
132
+ await Promise.all(this.proverNodes.map((node)=>tryStop(node, this.logger)));
133
+ await Promise.all(this.nodes.map((node)=>tryStop(node, this.logger)));
96
134
  await this.context.teardown();
97
135
  }
98
- async createProverNode() {
136
+ async createProverNode(opts = {}) {
99
137
  this.logger.warn('Creating and syncing a simulated prover node...');
100
138
  const proverNodePrivateKey = this.getNextPrivateKey();
101
139
  const suffix = (this.proverNodes.length + 1).toString();
102
140
  const proverNode = await withLogNameSuffix(suffix, ()=>createAndSyncProverNode(proverNodePrivateKey, {
103
- ...this.context.config,
104
- proverId: Fr.fromString(suffix)
105
- }, this.context.aztecNode, join(this.context.config.dataDirectory, randomBytes(8).toString('hex'))));
141
+ ...this.context.config
142
+ }, {
143
+ dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex')),
144
+ proverId: EthAddress.fromNumber(parseInt(suffix, 10)),
145
+ dontStart: opts.dontStart,
146
+ ...opts
147
+ }, this.context.aztecNode, undefined, {
148
+ dateProvider: this.context.dateProvider
149
+ }));
106
150
  this.proverNodes.push(proverNode);
107
151
  return proverNode;
108
152
  }
109
- async createNonValidatorNode() {
153
+ createNonValidatorNode(opts = {}) {
110
154
  this.logger.warn('Creating and syncing a node without a validator...');
155
+ return this.createNode({
156
+ ...opts,
157
+ disableValidator: true
158
+ });
159
+ }
160
+ createValidatorNode(privateKeys, opts = {}) {
161
+ this.logger.warn('Creating and syncing a validator node...');
162
+ return this.createNode({
163
+ ...opts,
164
+ disableValidator: false,
165
+ validatorPrivateKeys: new SecretValue(privateKeys)
166
+ });
167
+ }
168
+ async createNode(opts = {}) {
111
169
  const suffix = (this.nodes.length + 1).toString();
170
+ const { mockGossipSubNetwork } = this.context;
171
+ const resolvedConfig = {
172
+ ...this.context.config,
173
+ ...opts
174
+ };
175
+ const p2pEnabled = resolvedConfig.p2pEnabled || mockGossipSubNetwork !== undefined;
176
+ const p2pIp = resolvedConfig.p2pIp ?? (p2pEnabled ? '127.0.0.1' : undefined);
112
177
  const node = await withLogNameSuffix(suffix, ()=>AztecNodeService.createAndSync({
113
- ...this.context.config,
114
- disableValidator: true,
115
- dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex'))
178
+ ...resolvedConfig,
179
+ dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex')),
180
+ validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
181
+ p2pEnabled,
182
+ p2pIp
183
+ }, {
184
+ dateProvider: this.context.dateProvider,
185
+ p2pClientDeps: {
186
+ p2pServiceFactory: mockGossipSubNetwork ? getMockPubSubP2PServiceFactory(mockGossipSubNetwork) : undefined
187
+ }
188
+ }, {
189
+ prefilledPublicData: this.context.prefilledPublicData,
190
+ ...opts
116
191
  }));
192
+ // REFACTOR: We're getting too much into the internals of the sequencer here.
193
+ // We should have a single method for constructing an aztec node that returns a TestAztecNodeService
194
+ // which directly exposes the delayer and sets any test config.
195
+ if (opts.txDelayerMaxInclusionTimeIntoSlot !== undefined) {
196
+ this.logger.info(`Setting tx delayer max inclusion time into slot to ${opts.txDelayerMaxInclusionTimeIntoSlot} seconds`);
197
+ // Here we reach into the sequencer and hook in a tx delayer. The problem is that the sequencer's l1 utils only uses a public client, not a wallet.
198
+ // The delayer needs a wallet (a client that can sign), so we have to create one here.
199
+ const l1Client = createExtendedL1Client(resolvedConfig.l1RpcUrls, resolvedConfig.publisherPrivateKeys[0].getValue());
200
+ const sequencer = node.getSequencer();
201
+ const publisher = sequencer.sequencer.publisher;
202
+ const delayed = DelayedTxUtils.fromL1TxUtils(publisher.l1TxUtils, this.L1_BLOCK_TIME_IN_S, l1Client);
203
+ delayed.delayer.setMaxInclusionTimeIntoSlot(opts.txDelayerMaxInclusionTimeIntoSlot);
204
+ publisher.l1TxUtils = delayed;
205
+ }
117
206
  this.nodes.push(node);
118
207
  return node;
119
208
  }
@@ -124,32 +213,124 @@ export const ARCHIVER_POLL_INTERVAL = 50;
124
213
  /** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */ async waitUntilEpochStarts(epoch) {
125
214
  const [start] = getTimestampRangeForEpoch(BigInt(epoch), this.constants);
126
215
  this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
127
- await waitUntilL1Timestamp(this.l1Client, start - BigInt(L1_BLOCK_TIME_IN_S));
216
+ await waitUntilL1Timestamp(this.l1Client, start - BigInt(this.L1_BLOCK_TIME_IN_S), undefined, 30 * this.epochDuration);
128
217
  return start;
129
218
  }
130
219
  /** Waits until the given L2 block number is mined. */ async waitUntilL2BlockNumber(target, timeout = 60) {
131
- await retryUntil(()=>Promise.resolve(target === this.monitor.l2BlockNumber), `Wait until L2 block ${target}`, timeout, 0.1);
220
+ await retryUntil(()=>Promise.resolve(target <= this.monitor.l2BlockNumber), `Wait until L2 block ${target}`, timeout, 0.1);
132
221
  }
133
222
  /** Waits until the given L2 block number is marked as proven. */ async waitUntilProvenL2BlockNumber(t, timeout = 60) {
134
- await retryUntil(()=>Promise.resolve(t === this.monitor.l2ProvenBlockNumber), `Wait proven L2 block ${t}`, timeout, 0.1);
223
+ await retryUntil(()=>Promise.resolve(t <= this.monitor.l2ProvenBlockNumber), `Wait proven L2 block ${t}`, timeout, 0.1);
224
+ return this.monitor.l2ProvenBlockNumber;
225
+ }
226
+ /** Waits until the last slot of the proof submission window for a given epoch. */ async waitUntilLastSlotOfProofSubmissionWindow(epochNumber) {
227
+ const deadline = getProofSubmissionDeadlineTimestamp(BigInt(epochNumber), this.constants);
228
+ const oneSlotBefore = deadline - BigInt(this.constants.slotDuration);
229
+ const date = new Date(Number(oneSlotBefore) * 1000);
230
+ this.logger.info(`Waiting until last slot of submission window for epoch ${epochNumber} at ${date}`, {
231
+ oneSlotBefore
232
+ });
233
+ await waitUntilL1Timestamp(this.l1Client, oneSlotBefore);
135
234
  }
136
235
  /** Waits for the aztec node to sync to the target block number. */ async waitForNodeToSync(blockNumber, type) {
137
236
  const waitTime = ARCHIVER_POLL_INTERVAL + WORLD_STATE_BLOCK_CHECK_INTERVAL;
138
237
  let synched = false;
139
238
  while(!synched){
140
239
  await sleep(waitTime);
141
- const syncState = await this.context.aztecNode.getWorldStateSyncStatus();
142
- if (type === 'finalised') {
143
- synched = syncState.finalisedBlockNumber >= blockNumber;
240
+ const [syncState, tips] = await Promise.all([
241
+ this.context.aztecNode.getWorldStateSyncStatus(),
242
+ await this.context.aztecNode.getL2Tips()
243
+ ]);
244
+ this.logger.info(`Wait for node synch ${blockNumber} ${type}`, {
245
+ blockNumber,
246
+ type,
247
+ syncState,
248
+ tips
249
+ });
250
+ if (type === 'proven') {
251
+ synched = tips.proven.number >= blockNumber && syncState.latestBlockNumber >= blockNumber;
252
+ } else if (type === 'finalized') {
253
+ synched = syncState.finalizedBlockNumber >= blockNumber;
144
254
  } else {
145
255
  synched = syncState.oldestHistoricBlockNumber >= blockNumber;
146
256
  }
147
257
  }
148
258
  }
259
+ /** Registers the SpamContract on the given wallet. */ async registerSpamContract(wallet, salt = Fr.ZERO) {
260
+ const instance = await getContractInstanceFromInstantiationParams(SpamContract.artifact, {
261
+ constructorArgs: [],
262
+ constructorArtifact: undefined,
263
+ salt,
264
+ publicKeys: undefined,
265
+ deployer: undefined
266
+ });
267
+ await wallet.registerContract(instance, SpamContract.artifact);
268
+ return SpamContract.at(instance.address, wallet);
269
+ }
270
+ /** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */ async createL1Client() {
271
+ const { client, delayer } = withDelayer(createExtendedL1Client([
272
+ ...this.l1Client.chain.rpcUrls.default.http
273
+ ], privateKeyToAccount(this.getNextPrivateKey()), this.l1Client.chain), this.context.dateProvider, {
274
+ ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S
275
+ });
276
+ expect(await client.getBalance({
277
+ address: client.account.address
278
+ })).toBeGreaterThan(0n);
279
+ return {
280
+ client,
281
+ delayer
282
+ };
283
+ }
149
284
  /** Verifies whether the given block number is found on the aztec node. */ async verifyHistoricBlock(blockNumber, expectedSuccess) {
150
- const result = await this.context.aztecNode.findBlockNumbersForIndexes(blockNumber, MerkleTreeId.NULLIFIER_TREE, [
151
- 0n
285
+ // We use `findLeavesIndexes` here, but could use any function that queries the world-state
286
+ // at a particular block, so we know whether that historic block is available or has been
287
+ // pruned. Note that `getBlock` would not work here, since it only hits the archiver.
288
+ const result = await this.context.aztecNode.findLeavesIndexes(blockNumber, MerkleTreeId.NULLIFIER_TREE, [
289
+ Fr.ZERO
152
290
  ]).then((_)=>true).catch((_)=>false);
153
291
  expect(result).toBe(expectedSuccess);
154
292
  }
293
+ watchSequencerEvents(sequencers, getMetadata = ()=>({})) {
294
+ const stateChanges = [];
295
+ const failEvents = [];
296
+ // Note we do not include the 'tx-count-check-failed' event here, since it is fine if we dont build
297
+ // due to lack of txs available.
298
+ const failEventsKeys = [
299
+ 'block-build-failed',
300
+ 'block-publish-failed',
301
+ 'proposer-rollup-check-failed'
302
+ ];
303
+ const makeEvent = (i, eventName, args)=>({
304
+ ...args,
305
+ type: eventName,
306
+ sequencerIndex: i + 2,
307
+ ...getMetadata(i)
308
+ });
309
+ sequencers.forEach((sequencer, i)=>{
310
+ const sequencerIndex = i + 2;
311
+ sequencer.getSequencer().on('state-changed', (args)=>{
312
+ const noisyStates = [
313
+ SequencerState.IDLE,
314
+ SequencerState.PROPOSER_CHECK,
315
+ SequencerState.SYNCHRONIZING
316
+ ];
317
+ if (!noisyStates.includes(args.newState)) {
318
+ const evt = makeEvent(i, 'state-changed', args);
319
+ stateChanges.push(evt);
320
+ this.logger.verbose(`Sequencer ${sequencerIndex} transitioned from state ${args.oldState} to state ${args.newState}`, evt);
321
+ }
322
+ });
323
+ failEventsKeys.forEach((eventName)=>{
324
+ sequencer.getSequencer().on(eventName, (args)=>{
325
+ const evt = makeEvent(i, eventName, args);
326
+ failEvents.push(evt);
327
+ this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, undefined, evt);
328
+ });
329
+ });
330
+ });
331
+ return {
332
+ failEvents,
333
+ stateChanges
334
+ };
335
+ }
155
336
  }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=bridging_race.notest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridging_race.notest.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/bridging_race.notest.ts"],"names":[],"mappings":""}
@@ -0,0 +1,63 @@
1
+ import { SchnorrAccountContract } from '@aztec/accounts/schnorr';
2
+ import { Fr } from '@aztec/aztec.js/fields';
3
+ import { Fq } from '@aztec/foundation/fields';
4
+ import { sleep } from '@aztec/foundation/sleep';
5
+ import { jest } from '@jest/globals';
6
+ import { FeesTest } from './fees_test.js';
7
+ jest.setTimeout(300_000);
8
+ // Regression for https://github.com/AztecProtocol/aztec-packages/issues/12366
9
+ // Similar to e2e_fees/account_init but with no automine
10
+ describe('e2e_fees bridging_race', ()=>{
11
+ const ETHEREUM_SLOT_DURATION = 4;
12
+ const AZTEC_SLOT_DURATION = ETHEREUM_SLOT_DURATION * 2;
13
+ const t = new FeesTest('bridging_race', 1, {
14
+ ethereumSlotDuration: ETHEREUM_SLOT_DURATION,
15
+ aztecSlotDuration: AZTEC_SLOT_DURATION,
16
+ minTxsPerBlock: 0
17
+ });
18
+ beforeAll(async ()=>{
19
+ await t.applyInitialAccountsSnapshot();
20
+ await t.applyPublicDeployAccountsSnapshot();
21
+ await t.applySetupFeeJuiceSnapshot();
22
+ ({ wallet, logger } = await t.setup());
23
+ });
24
+ afterAll(async ()=>{
25
+ await t.teardown();
26
+ });
27
+ let logger;
28
+ let bobsAddress;
29
+ let wallet;
30
+ beforeEach(async ()=>{
31
+ const bobsSecretKey = Fr.random();
32
+ const bobsPrivateSigningKey = Fq.random();
33
+ const bobsSalt = Fr.random();
34
+ const bobsAccountManager = await wallet.createAccount({
35
+ secret: bobsSecretKey,
36
+ salt: bobsSalt,
37
+ contract: new SchnorrAccountContract(bobsPrivateSigningKey)
38
+ });
39
+ bobsAddress = bobsAccountManager.address;
40
+ });
41
+ it('Alice bridges funds to Bob', async ()=>{
42
+ // Tweak the token manager so the bridging happens immediately before the end of the current L2 slot
43
+ // This caused the message to be "not in state" when tried to be used
44
+ const l1TokenManager = t.feeJuiceBridgeTestHarness.l1TokenManager;
45
+ const origApprove = l1TokenManager.approve.bind(l1TokenManager);
46
+ l1TokenManager.approve = async (amount, address, addressName = '')=>{
47
+ await origApprove(amount, address, addressName);
48
+ const sleepTime = (Number(t.chainMonitor.l2BlockTimestamp) + AZTEC_SLOT_DURATION) * 1000 - Date.now() - 500;
49
+ logger.info(`Sleeping for ${sleepTime}ms until near end of L2 slot before sending L1 fee juice to L2 inbox`);
50
+ await sleep(sleepTime);
51
+ };
52
+ // Waiting for the archiver to sync the message _before_ waiting for the mandatory 2 L2 blocks to pass fixed it
53
+ // This was added everywhere we wait for two blocks, which is spread across three different places in the codebase
54
+ // Yes, we need to REFACTOR it at some point
55
+ const claim = await t.feeJuiceBridgeTestHarness.prepareTokensOnL1(bobsAddress);
56
+ const { claimSecret: secret, messageLeafIndex: index } = claim;
57
+ await t.feeJuiceContract.methods.claim(bobsAddress, claim.claimAmount, secret, index).send({
58
+ from: bobsAddress
59
+ }).wait();
60
+ const [balance] = await t.getGasBalanceFn(bobsAddress);
61
+ expect(balance).toEqual(claim.claimAmount);
62
+ });
63
+ });
@@ -1,12 +1,18 @@
1
- import { type AccountWallet, type AztecAddress, type AztecNode, ChainMonitor, CheatCodes, type Logger, type PXE } from '@aztec/aztec.js';
2
- import { type DeployL1ContractsArgs } from '@aztec/ethereum';
1
+ import type { AztecAddress } from '@aztec/aztec.js/addresses';
2
+ import { type Logger } from '@aztec/aztec.js/log';
3
+ import type { AztecNode } from '@aztec/aztec.js/node';
4
+ import { CheatCodes } from '@aztec/aztec/testing';
5
+ import { type DeployL1ContractsArgs, RollupContract } from '@aztec/ethereum';
6
+ import { ChainMonitor } from '@aztec/ethereum/test';
3
7
  import { EthAddress } from '@aztec/foundation/eth-address';
4
8
  import { AppSubscriptionContract } from '@aztec/noir-contracts.js/AppSubscription';
5
- import { CounterContract } from '@aztec/noir-contracts.js/Counter';
6
9
  import { FPCContract } from '@aztec/noir-contracts.js/FPC';
7
10
  import { FeeJuiceContract } from '@aztec/noir-contracts.js/FeeJuice';
11
+ import { SponsoredFPCContract } from '@aztec/noir-contracts.js/SponsoredFPC';
8
12
  import { TokenContract as BananaCoin } from '@aztec/noir-contracts.js/Token';
13
+ import { CounterContract } from '@aztec/noir-test-contracts.js/Counter';
9
14
  import { GasSettings } from '@aztec/stdlib/gas';
15
+ import { TestWallet } from '@aztec/test-wallet/server';
10
16
  import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
11
17
  import { type BalancesFn, type SetupOptions } from '../fixtures/utils.js';
12
18
  import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.js';
@@ -16,28 +22,29 @@ import { type GasBridgingTestHarness } from '../shared/gas_portal_test_harness.j
16
22
  * PublicDeployAccounts: Deploys the accounts publicly.
17
23
  * DeployFeeJuice: Deploys the Fee Juice contract.
18
24
  * FPCSetup: Deploys BananaCoin and FPC contracts, and bridges gas from L1.
25
+ * SponsoredFPCSetup: Deploys Sponsored FPC contract, and bridges gas from L1.
19
26
  * FundAlice: Mints private and public bananas to Alice.
20
27
  * SetupSubscription: Deploys a counter contract and a subscription contract, and mints Fee Juice to the subscription contract.
21
28
  */
22
29
  export declare class FeesTest {
23
30
  private numberOfAccounts;
24
31
  private snapshotManager;
25
- private wallets;
32
+ private accounts;
26
33
  logger: Logger;
27
- pxe: PXE;
28
34
  aztecNode: AztecNode;
29
35
  cheatCodes: CheatCodes;
30
- aliceWallet: AccountWallet;
36
+ wallet: TestWallet;
31
37
  aliceAddress: AztecAddress;
32
- bobWallet: AccountWallet;
33
38
  bobAddress: AztecAddress;
34
39
  sequencerAddress: AztecAddress;
35
40
  coinbase: EthAddress;
36
41
  fpcAdmin: AztecAddress;
37
42
  gasSettings: GasSettings;
43
+ rollupContract: RollupContract;
38
44
  feeJuiceContract: FeeJuiceContract;
39
45
  bananaCoin: BananaCoin;
40
46
  bananaFPC: FPCContract;
47
+ sponsoredFPC: SponsoredFPCContract;
41
48
  counterContract: CounterContract;
42
49
  subscriptionContract: AppSubscriptionContract;
43
50
  feeJuiceBridgeTestHarness: GasBridgingTestHarness;
@@ -57,7 +64,11 @@ export declare class FeesTest {
57
64
  teardown(): Promise<void>;
58
65
  setIsMarkingAsProven(b: boolean): void;
59
66
  catchUpProvenChain(): Promise<void>;
60
- mintAndBridgeFeeJuice(address: AztecAddress, amount: bigint): Promise<void>;
67
+ getBlockRewards(): Promise<{
68
+ sequencerBlockRewards: bigint;
69
+ proverBlockRewards: bigint;
70
+ }>;
71
+ mintAndBridgeFeeJuice(minter: AztecAddress, recipient: AztecAddress): Promise<void>;
61
72
  /** Alice mints bananaCoin tokens privately to the target address and redeems them. */
62
73
  mintPrivateBananas(amount: bigint, address: AztecAddress): Promise<void>;
63
74
  applyBaseSnapshots(): Promise<void>;
@@ -66,8 +77,8 @@ export declare class FeesTest {
66
77
  applySetupFeeJuiceSnapshot(): Promise<void>;
67
78
  applyDeployBananaTokenSnapshot(): Promise<void>;
68
79
  applyFPCSetupSnapshot(): Promise<void>;
80
+ applySponsoredFPCSetupSnapshot(): Promise<void>;
69
81
  applyFundAliceWithBananas(): Promise<void>;
70
82
  applyFundAliceWithPrivateBananas(): Promise<void>;
71
- applySetupSubscription(): Promise<void>;
72
83
  }
73
84
  //# sourceMappingURL=fees_test.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,YAAY,EACZ,UAAU,EACV,KAAK,MAAM,EACX,KAAK,GAAG,EAGT,MAAM,iBAAiB,CAAC;AAEzB,OAAO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