@aztec/sequencer-client 0.7.9 → 0.8.6

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 (73) hide show
  1. package/README.md +1 -1
  2. package/dest/client/sequencer-client.d.ts +3 -3
  3. package/dest/client/sequencer-client.d.ts.map +1 -1
  4. package/dest/client/sequencer-client.js +6 -6
  5. package/dest/config.d.ts.map +1 -1
  6. package/dest/config.js +14 -7
  7. package/dest/global_variable_builder/config.d.ts +5 -5
  8. package/dest/global_variable_builder/config.d.ts.map +1 -1
  9. package/dest/global_variable_builder/viem-reader.js +3 -3
  10. package/dest/publisher/config.d.ts +6 -2
  11. package/dest/publisher/config.d.ts.map +1 -1
  12. package/dest/publisher/index.d.ts +27 -0
  13. package/dest/publisher/index.d.ts.map +1 -1
  14. package/dest/publisher/index.js +1 -1
  15. package/dest/publisher/l1-publisher.d.ts +26 -11
  16. package/dest/publisher/l1-publisher.d.ts.map +1 -1
  17. package/dest/publisher/l1-publisher.js +18 -4
  18. package/dest/publisher/viem-tx-sender.d.ts +2 -1
  19. package/dest/publisher/viem-tx-sender.d.ts.map +1 -1
  20. package/dest/publisher/viem-tx-sender.js +27 -7
  21. package/dest/sequencer/public_processor.d.ts +4 -2
  22. package/dest/sequencer/public_processor.d.ts.map +1 -1
  23. package/dest/sequencer/public_processor.js +11 -5
  24. package/dest/sequencer/sequencer.d.ts +13 -9
  25. package/dest/sequencer/sequencer.d.ts.map +1 -1
  26. package/dest/sequencer/sequencer.js +53 -34
  27. package/dest/simulator/index.d.ts +0 -1
  28. package/dest/simulator/index.d.ts.map +1 -1
  29. package/dest/simulator/index.js +2 -2
  30. package/dest/simulator/public_executor.d.ts +28 -4
  31. package/dest/simulator/public_executor.d.ts.map +1 -1
  32. package/dest/simulator/public_executor.js +46 -7
  33. package/dest/simulator/public_kernel.d.ts +1 -0
  34. package/dest/simulator/public_kernel.d.ts.map +1 -1
  35. package/dest/simulator/public_kernel.js +26 -5
  36. package/dest/simulator/rollup.d.ts +2 -8
  37. package/dest/simulator/rollup.d.ts.map +1 -1
  38. package/dest/simulator/rollup.js +37 -18
  39. package/package.json +70 -11
  40. package/src/client/sequencer-client.ts +7 -6
  41. package/src/config.ts +14 -5
  42. package/src/global_variable_builder/config.ts +6 -5
  43. package/src/global_variable_builder/viem-reader.ts +2 -2
  44. package/src/publisher/config.ts +7 -2
  45. package/src/publisher/index.ts +28 -0
  46. package/src/publisher/l1-publisher.ts +46 -13
  47. package/src/publisher/viem-tx-sender.ts +33 -13
  48. package/src/sequencer/public_processor.ts +13 -4
  49. package/src/sequencer/sequencer.ts +59 -45
  50. package/src/simulator/index.ts +0 -2
  51. package/src/simulator/public_executor.ts +53 -7
  52. package/src/simulator/public_kernel.ts +24 -4
  53. package/src/simulator/rollup.ts +38 -21
  54. package/.eslintrc.cjs +0 -1
  55. package/.tsbuildinfo +0 -1
  56. package/dest/block_builder/solo_block_builder.test.d.ts +0 -3
  57. package/dest/block_builder/solo_block_builder.test.d.ts.map +0 -1
  58. package/dest/block_builder/solo_block_builder.test.js +0 -277
  59. package/dest/publisher/l1-publisher.test.d.ts +0 -2
  60. package/dest/publisher/l1-publisher.test.d.ts.map +0 -1
  61. package/dest/publisher/l1-publisher.test.js +0 -58
  62. package/dest/sequencer/public_processor.test.d.ts +0 -2
  63. package/dest/sequencer/public_processor.test.d.ts.map +0 -1
  64. package/dest/sequencer/public_processor.test.js +0 -164
  65. package/dest/sequencer/sequencer.test.d.ts +0 -2
  66. package/dest/sequencer/sequencer.test.d.ts.map +0 -1
  67. package/dest/sequencer/sequencer.test.js +0 -99
  68. package/jest.integration.config.json +0 -13
  69. package/src/block_builder/solo_block_builder.test.ts +0 -425
  70. package/src/publisher/l1-publisher.test.ts +0 -79
  71. package/src/sequencer/public_processor.test.ts +0 -265
  72. package/src/sequencer/sequencer.test.ts +0 -160
  73. package/tsconfig.json +0 -38
@@ -10,6 +10,8 @@ import {
10
10
  mergeRollupSim,
11
11
  rootRollupSim,
12
12
  } from '@aztec/circuits.js';
13
+ import { createDebugLogger } from '@aztec/foundation/log';
14
+ import { elapsed } from '@aztec/foundation/timer';
13
15
 
14
16
  import { RollupSimulator } from './index.js';
15
17
 
@@ -17,31 +19,28 @@ import { RollupSimulator } from './index.js';
17
19
  * Implements the rollup circuit simulator using the wasm circuits implementation.
18
20
  */
19
21
  export class WasmRollupCircuitSimulator implements RollupSimulator {
20
- private wasm: CircuitsWasm;
21
-
22
- constructor(wasm: CircuitsWasm) {
23
- this.wasm = wasm;
24
- }
25
-
26
- /**
27
- * Creates a new instance using the default CircuitsWasm module.
28
- * @returns A new instance.
29
- */
30
- public static async new() {
31
- return new this(await CircuitsWasm.get());
32
- }
22
+ private log = createDebugLogger('aztec:rollup-simulator');
33
23
 
34
24
  /**
35
25
  * Simulates the base rollup circuit from its inputs.
36
26
  * @param input - Inputs to the circuit.
37
27
  * @returns The public inputs as outputs of the simulation.
38
28
  */
39
- baseRollupCircuit(input: BaseRollupInputs): Promise<BaseOrMergeRollupPublicInputs> {
40
- const result = baseRollupSim(this.wasm, input);
29
+ public async baseRollupCircuit(input: BaseRollupInputs): Promise<BaseOrMergeRollupPublicInputs> {
30
+ const wasm = await CircuitsWasm.get();
31
+ const [time, result] = await elapsed(() => baseRollupSim(wasm, input));
41
32
  if (result instanceof CircuitError) {
42
33
  throw new CircuitError(result.code, result.message);
43
34
  }
44
35
 
36
+ this.log(`Simulated base rollup circuit`, {
37
+ eventName: 'circuit-simulation',
38
+ circuitName: 'base-rollup',
39
+ duration: time.ms(),
40
+ inputSize: input.toBuffer().length,
41
+ outputSize: result.toBuffer().length,
42
+ });
43
+
45
44
  return Promise.resolve(result);
46
45
  }
47
46
  /**
@@ -49,13 +48,22 @@ export class WasmRollupCircuitSimulator implements RollupSimulator {
49
48
  * @param input - Inputs to the circuit.
50
49
  * @returns The public inputs as outputs of the simulation.
51
50
  */
52
- mergeRollupCircuit(input: MergeRollupInputs): Promise<BaseOrMergeRollupPublicInputs> {
53
- const result = mergeRollupSim(this.wasm, input);
51
+ public async mergeRollupCircuit(input: MergeRollupInputs): Promise<BaseOrMergeRollupPublicInputs> {
52
+ const wasm = await CircuitsWasm.get();
53
+ const [time, result] = await elapsed(() => mergeRollupSim(wasm, input));
54
54
  if (result instanceof CircuitError) {
55
55
  throw new CircuitError(result.code, result.message);
56
56
  }
57
57
 
58
- return Promise.resolve(result);
58
+ this.log(`Simulated merge rollup circuit`, {
59
+ eventName: 'circuit-simulation',
60
+ circuitName: 'merge-rollup',
61
+ duration: time.ms(),
62
+ inputSize: input.toBuffer().length,
63
+ outputSize: result.toBuffer().length,
64
+ });
65
+
66
+ return result;
59
67
  }
60
68
 
61
69
  /**
@@ -63,12 +71,21 @@ export class WasmRollupCircuitSimulator implements RollupSimulator {
63
71
  * @param input - Inputs to the circuit.
64
72
  * @returns The public inputs as outputs of the simulation.
65
73
  */
66
- rootRollupCircuit(input: RootRollupInputs): Promise<RootRollupPublicInputs> {
67
- const result = rootRollupSim(this.wasm, input);
74
+ public async rootRollupCircuit(input: RootRollupInputs): Promise<RootRollupPublicInputs> {
75
+ const wasm = await CircuitsWasm.get();
76
+ const [time, result] = await elapsed(() => rootRollupSim(wasm, input));
68
77
  if (result instanceof CircuitError) {
69
78
  throw new CircuitError(result.code, result.message);
70
79
  }
71
80
 
72
- return Promise.resolve(result);
81
+ this.log(`Simulated root rollup circuit`, {
82
+ eventName: 'circuit-simulation',
83
+ circuitName: 'root-rollup',
84
+ duration: time.ms(),
85
+ inputSize: input.toBuffer().length,
86
+ outputSize: result.toBuffer().length,
87
+ });
88
+
89
+ return result;
73
90
  }
74
91
  }
package/.eslintrc.cjs DELETED
@@ -1 +0,0 @@
1
- module.exports = require('@aztec/foundation/eslint');