@aztec/prover-client 0.0.0-test.1 → 0.0.1-commit.b655e406

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 (121) hide show
  1. package/dest/block-factory/index.d.ts +2 -0
  2. package/dest/block-factory/index.d.ts.map +1 -0
  3. package/dest/block-factory/light.d.ts +38 -0
  4. package/dest/block-factory/light.d.ts.map +1 -0
  5. package/dest/block-factory/light.js +94 -0
  6. package/dest/config.d.ts +6 -6
  7. package/dest/config.d.ts.map +1 -1
  8. package/dest/config.js +11 -1
  9. package/dest/mocks/fixtures.d.ts +7 -4
  10. package/dest/mocks/fixtures.d.ts.map +1 -1
  11. package/dest/mocks/fixtures.js +32 -4
  12. package/dest/mocks/test_context.d.ts +43 -15
  13. package/dest/mocks/test_context.d.ts.map +1 -1
  14. package/dest/mocks/test_context.js +110 -48
  15. package/dest/orchestrator/block-building-helpers.d.ts +37 -28
  16. package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
  17. package/dest/orchestrator/block-building-helpers.js +156 -150
  18. package/dest/orchestrator/block-proving-state.d.ts +62 -46
  19. package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
  20. package/dest/orchestrator/block-proving-state.js +223 -179
  21. package/dest/orchestrator/checkpoint-proving-state.d.ts +63 -0
  22. package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -0
  23. package/dest/orchestrator/checkpoint-proving-state.js +211 -0
  24. package/dest/orchestrator/epoch-proving-state.d.ts +37 -24
  25. package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
  26. package/dest/orchestrator/epoch-proving-state.js +143 -73
  27. package/dest/orchestrator/orchestrator.d.ts +34 -31
  28. package/dest/orchestrator/orchestrator.d.ts.map +1 -1
  29. package/dest/orchestrator/orchestrator.js +392 -234
  30. package/dest/orchestrator/orchestrator_metrics.d.ts +2 -0
  31. package/dest/orchestrator/orchestrator_metrics.d.ts.map +1 -1
  32. package/dest/orchestrator/orchestrator_metrics.js +9 -0
  33. package/dest/orchestrator/tx-proving-state.d.ts +12 -10
  34. package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
  35. package/dest/orchestrator/tx-proving-state.js +30 -38
  36. package/dest/prover-client/prover-client.d.ts +3 -3
  37. package/dest/prover-client/prover-client.d.ts.map +1 -1
  38. package/dest/prover-client/prover-client.js +5 -4
  39. package/dest/prover-client/server-epoch-prover.d.ts +13 -10
  40. package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
  41. package/dest/prover-client/server-epoch-prover.js +11 -11
  42. package/dest/proving_broker/broker_prover_facade.d.ts +22 -15
  43. package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
  44. package/dest/proving_broker/broker_prover_facade.js +64 -39
  45. package/dest/proving_broker/config.d.ts +9 -4
  46. package/dest/proving_broker/config.d.ts.map +1 -1
  47. package/dest/proving_broker/config.js +15 -4
  48. package/dest/proving_broker/factory.d.ts +1 -1
  49. package/dest/proving_broker/factory.d.ts.map +1 -1
  50. package/dest/proving_broker/factory.js +5 -1
  51. package/dest/proving_broker/fixtures.js +1 -1
  52. package/dest/proving_broker/proof_store/factory.js +1 -1
  53. package/dest/proving_broker/proof_store/gcs_proof_store.d.ts.map +1 -1
  54. package/dest/proving_broker/proof_store/gcs_proof_store.js +1 -0
  55. package/dest/proving_broker/proof_store/index.d.ts +1 -0
  56. package/dest/proving_broker/proof_store/index.d.ts.map +1 -1
  57. package/dest/proving_broker/proof_store/index.js +1 -0
  58. package/dest/proving_broker/proving_agent.d.ts +3 -3
  59. package/dest/proving_broker/proving_agent.d.ts.map +1 -1
  60. package/dest/proving_broker/proving_agent.js +83 -47
  61. package/dest/proving_broker/proving_broker.d.ts +11 -2
  62. package/dest/proving_broker/proving_broker.d.ts.map +1 -1
  63. package/dest/proving_broker/proving_broker.js +34 -22
  64. package/dest/proving_broker/proving_broker_database/memory.js +1 -1
  65. package/dest/proving_broker/proving_broker_database/persisted.d.ts.map +1 -1
  66. package/dest/proving_broker/proving_broker_database/persisted.js +9 -8
  67. package/dest/proving_broker/proving_job_controller.d.ts +7 -8
  68. package/dest/proving_broker/proving_job_controller.d.ts.map +1 -1
  69. package/dest/proving_broker/proving_job_controller.js +89 -61
  70. package/dest/proving_broker/rpc.d.ts +3 -5
  71. package/dest/proving_broker/rpc.d.ts.map +1 -1
  72. package/dest/proving_broker/rpc.js +1 -4
  73. package/dest/test/mock_proof_store.d.ts +9 -0
  74. package/dest/test/mock_proof_store.d.ts.map +1 -0
  75. package/dest/test/mock_proof_store.js +10 -0
  76. package/dest/test/mock_prover.d.ts +23 -16
  77. package/dest/test/mock_prover.d.ts.map +1 -1
  78. package/dest/test/mock_prover.js +38 -20
  79. package/package.json +29 -29
  80. package/src/block-factory/index.ts +1 -0
  81. package/src/block-factory/light.ts +140 -0
  82. package/src/config.ts +24 -8
  83. package/src/mocks/fixtures.ts +43 -15
  84. package/src/mocks/test_context.ts +201 -75
  85. package/src/orchestrator/block-building-helpers.ts +247 -243
  86. package/src/orchestrator/block-proving-state.ts +247 -231
  87. package/src/orchestrator/checkpoint-proving-state.ts +299 -0
  88. package/src/orchestrator/epoch-proving-state.ts +187 -111
  89. package/src/orchestrator/orchestrator.ts +590 -289
  90. package/src/orchestrator/orchestrator_metrics.ts +20 -1
  91. package/src/orchestrator/tx-proving-state.ts +60 -61
  92. package/src/prover-client/prover-client.ts +16 -14
  93. package/src/prover-client/server-epoch-prover.ts +40 -21
  94. package/src/proving_broker/broker_prover_facade.ts +200 -113
  95. package/src/proving_broker/config.ts +17 -6
  96. package/src/proving_broker/factory.ts +2 -1
  97. package/src/proving_broker/fixtures.ts +1 -1
  98. package/src/proving_broker/proof_store/factory.ts +1 -1
  99. package/src/proving_broker/proof_store/gcs_proof_store.ts +5 -1
  100. package/src/proving_broker/proof_store/index.ts +1 -0
  101. package/src/proving_broker/proof_store/inline_proof_store.ts +1 -1
  102. package/src/proving_broker/proving_agent.ts +89 -47
  103. package/src/proving_broker/proving_broker.ts +51 -32
  104. package/src/proving_broker/proving_broker_database/memory.ts +1 -1
  105. package/src/proving_broker/proving_broker_database/persisted.ts +9 -8
  106. package/src/proving_broker/proving_job_controller.ts +92 -81
  107. package/src/proving_broker/rpc.ts +1 -6
  108. package/src/test/mock_proof_store.ts +14 -0
  109. package/src/test/mock_prover.ts +164 -60
  110. package/dest/bin/get-proof-inputs.d.ts +0 -2
  111. package/dest/bin/get-proof-inputs.d.ts.map +0 -1
  112. package/dest/bin/get-proof-inputs.js +0 -51
  113. package/dest/block_builder/index.d.ts +0 -6
  114. package/dest/block_builder/index.d.ts.map +0 -1
  115. package/dest/block_builder/light.d.ts +0 -33
  116. package/dest/block_builder/light.d.ts.map +0 -1
  117. package/dest/block_builder/light.js +0 -82
  118. package/src/bin/get-proof-inputs.ts +0 -59
  119. package/src/block_builder/index.ts +0 -6
  120. package/src/block_builder/light.ts +0 -101
  121. /package/dest/{block_builder → block-factory}/index.js +0 -0
@@ -1,9 +1,17 @@
1
- import { type Histogram, Metrics, type TelemetryClient, type Tracer, ValueType } from '@aztec/telemetry-client';
1
+ import {
2
+ type Histogram,
3
+ Metrics,
4
+ type TelemetryClient,
5
+ type Tracer,
6
+ type UpDownCounter,
7
+ ValueType,
8
+ } from '@aztec/telemetry-client';
2
9
 
3
10
  export class ProvingOrchestratorMetrics {
4
11
  public readonly tracer: Tracer;
5
12
 
6
13
  private baseRollupInputsDuration: Histogram;
14
+ private avmFallbackCount: UpDownCounter;
7
15
 
8
16
  constructor(client: TelemetryClient, name = 'ProvingOrchestrator') {
9
17
  this.tracer = client.getTracer(name);
@@ -14,9 +22,20 @@ export class ProvingOrchestratorMetrics {
14
22
  description: 'Duration to build base rollup inputs',
15
23
  valueType: ValueType.INT,
16
24
  });
25
+
26
+ this.avmFallbackCount = meter.createUpDownCounter(Metrics.PROVING_ORCHESTRATOR_AVM_FALLBACK_COUNT, {
27
+ description: 'How many times the AVM fallback was used',
28
+ valueType: ValueType.INT,
29
+ });
30
+
31
+ this.avmFallbackCount.add(0);
17
32
  }
18
33
 
19
34
  recordBaseRollupInputs(durationMs: number) {
20
35
  this.baseRollupInputsDuration.record(Math.ceil(durationMs));
21
36
  }
37
+
38
+ incAvmFallback() {
39
+ this.avmFallbackCount.add(1);
40
+ }
22
41
  }
@@ -1,22 +1,32 @@
1
- import { type AVM_PROOF_LENGTH_IN_FIELDS, AVM_VK_INDEX, type TUBE_PROOF_LENGTH, TUBE_VK_INDEX } from '@aztec/constants';
2
- import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
1
+ import {
2
+ AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED,
3
+ AVM_VK_INDEX,
4
+ NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
5
+ } from '@aztec/constants';
6
+ import type { Fr } from '@aztec/foundation/fields';
7
+ import { getVkData } from '@aztec/noir-protocol-circuits-types/server/vks';
8
+ import { getVKSiblingPath } from '@aztec/noir-protocol-circuits-types/vk-tree';
3
9
  import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
4
- import type { ProofAndVerificationKey } from '@aztec/stdlib/interfaces/server';
10
+ import type { ProofAndVerificationKey, PublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
11
+ import { ProofData } from '@aztec/stdlib/proofs';
5
12
  import {
6
- AvmProofData,
7
13
  type BaseRollupHints,
8
14
  PrivateBaseRollupHints,
9
- PrivateBaseRollupInputs,
10
- PrivateTubeData,
15
+ PrivateTxBaseRollupPrivateInputs,
11
16
  PublicBaseRollupHints,
12
- PublicBaseRollupInputs,
13
- PublicTubeData,
14
- TubeInputs,
17
+ PublicChonkVerifierPublicInputs,
18
+ PublicTxBaseRollupPrivateInputs,
15
19
  } from '@aztec/stdlib/rollup';
16
20
  import type { CircuitName } from '@aztec/stdlib/stats';
17
21
  import type { AppendOnlyTreeSnapshot, MerkleTreeId } from '@aztec/stdlib/trees';
18
22
  import type { ProcessedTx } from '@aztec/stdlib/tx';
19
- import { VkWitnessData } from '@aztec/stdlib/vks';
23
+ import { VerificationKeyData, VkData } from '@aztec/stdlib/vks';
24
+
25
+ import {
26
+ getChonkProofFromTx,
27
+ getPublicChonkVerifierPrivateInputsFromTx,
28
+ toProofData,
29
+ } from './block-building-helpers.js';
20
30
 
21
31
  /**
22
32
  * Helper class to manage the proving cycle of a transaction
@@ -24,13 +34,17 @@ import { VkWitnessData } from '@aztec/stdlib/vks';
24
34
  * Also stores the inputs to the base rollup for this transaction and the tree snapshots
25
35
  */
26
36
  export class TxProvingState {
27
- private tube?: ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>;
28
- private avm?: ProofAndVerificationKey<typeof AVM_PROOF_LENGTH_IN_FIELDS>;
37
+ private publicChonkVerifier?: PublicInputsAndRecursiveProof<
38
+ PublicChonkVerifierPublicInputs,
39
+ typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
40
+ >;
41
+ private avm?: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>;
29
42
 
30
43
  constructor(
31
44
  public readonly processedTx: ProcessedTx,
32
45
  private readonly baseRollupHints: BaseRollupHints,
33
46
  public readonly treeSnapshots: Map<MerkleTreeId, AppendOnlyTreeSnapshot>,
47
+ private readonly proverId: Fr,
34
48
  ) {}
35
49
 
36
50
  get requireAvmProof() {
@@ -38,102 +52,87 @@ export class TxProvingState {
38
52
  }
39
53
 
40
54
  public ready() {
41
- return !!this.tube && (!this.requireAvmProof || !!this.avm);
42
- }
43
-
44
- public getTubeInputs() {
45
- return new TubeInputs(this.processedTx.clientIvcProof);
55
+ return !this.requireAvmProof || (!!this.avm && !!this.publicChonkVerifier);
46
56
  }
47
57
 
48
58
  public getAvmInputs(): AvmCircuitInputs {
49
59
  return this.processedTx.avmProvingRequest!.inputs;
50
60
  }
51
61
 
62
+ public getPublicChonkVerifierPrivateInputs() {
63
+ return getPublicChonkVerifierPrivateInputsFromTx(this.processedTx, this.proverId);
64
+ }
65
+
52
66
  public getBaseRollupTypeAndInputs() {
53
67
  if (this.requireAvmProof) {
54
68
  return {
55
- rollupType: 'public-base-rollup' satisfies CircuitName,
69
+ rollupType: 'rollup-tx-base-public' satisfies CircuitName,
56
70
  inputs: this.#getPublicBaseInputs(),
57
71
  };
58
72
  } else {
59
73
  return {
60
- rollupType: 'private-base-rollup' satisfies CircuitName,
74
+ rollupType: 'rollup-tx-base-private' satisfies CircuitName,
61
75
  inputs: this.#getPrivateBaseInputs(),
62
76
  };
63
77
  }
64
78
  }
65
79
 
66
- public setTubeProof(tubeProofAndVk: ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>) {
67
- this.tube = tubeProofAndVk;
80
+ public setPublicChonkVerifierProof(
81
+ publicChonkVerifierProofAndVk: PublicInputsAndRecursiveProof<
82
+ PublicChonkVerifierPublicInputs,
83
+ typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH
84
+ >,
85
+ ) {
86
+ this.publicChonkVerifier = publicChonkVerifierProofAndVk;
68
87
  }
69
88
 
70
- public setAvmProof(avmProofAndVk: ProofAndVerificationKey<typeof AVM_PROOF_LENGTH_IN_FIELDS>) {
89
+ public setAvmProof(avmProofAndVk: ProofAndVerificationKey<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>) {
71
90
  this.avm = avmProofAndVk;
72
91
  }
73
92
 
74
93
  #getPrivateBaseInputs() {
75
- if (!this.tube) {
76
- throw new Error('Tx not ready for proving base rollup.');
94
+ if (!(this.baseRollupHints instanceof PrivateBaseRollupHints)) {
95
+ throw new Error('Mismatched base rollup hints, expected private base rollup hints');
77
96
  }
78
97
 
79
- const vkData = this.#getTubeVkData();
80
- const tubeData = new PrivateTubeData(
98
+ const privateTailProofData = new ProofData(
81
99
  this.processedTx.data.toPrivateToRollupKernelCircuitPublicInputs(),
82
- this.tube.proof,
83
- vkData,
100
+ getChonkProofFromTx(this.processedTx),
101
+ getVkData('HidingKernelToRollup'),
84
102
  );
85
103
 
86
- if (!(this.baseRollupHints instanceof PrivateBaseRollupHints)) {
87
- throw new Error('Mismatched base rollup hints, expected private base rollup hints');
88
- }
89
- return new PrivateBaseRollupInputs(tubeData, this.baseRollupHints);
104
+ return new PrivateTxBaseRollupPrivateInputs(privateTailProofData, this.baseRollupHints);
90
105
  }
91
106
 
92
107
  #getPublicBaseInputs() {
93
108
  if (!this.processedTx.avmProvingRequest) {
94
109
  throw new Error('Should create private base rollup for a tx not requiring avm proof.');
95
110
  }
96
- if (!this.tube) {
97
- throw new Error('Tx not ready for proving base rollup: tube proof undefined');
111
+ if (!this.publicChonkVerifier) {
112
+ throw new Error('Tx not ready for proving base rollup: public chonk verifier proof undefined');
98
113
  }
99
114
  if (!this.avm) {
100
115
  throw new Error('Tx not ready for proving base rollup: avm proof undefined');
101
116
  }
102
-
103
- const tubeData = new PublicTubeData(
104
- this.processedTx.data.toPrivateToPublicKernelCircuitPublicInputs(),
105
- this.tube.proof,
106
- this.#getTubeVkData(),
107
- );
108
-
109
- const avmProofData = new AvmProofData(
110
- this.processedTx.avmProvingRequest.inputs.publicInputs,
111
- this.avm.proof,
112
- this.#getAvmVkData(),
113
- );
114
-
115
117
  if (!(this.baseRollupHints instanceof PublicBaseRollupHints)) {
116
118
  throw new Error('Mismatched base rollup hints, expected public base rollup hints');
117
119
  }
118
120
 
119
- return new PublicBaseRollupInputs(tubeData, avmProofData, this.baseRollupHints);
120
- }
121
+ const publicChonkVerifierProofData = toProofData(this.publicChonkVerifier);
121
122
 
122
- #getTubeVkData() {
123
- let vkIndex = TUBE_VK_INDEX;
124
- try {
125
- vkIndex = getVKIndex(this.tube!.verificationKey);
126
- } catch (_ignored) {
127
- // TODO(#7410) The VK for the tube won't be in the tree for now, so we manually set it to the tube vk index
128
- }
129
- const vkPath = getVKSiblingPath(vkIndex);
123
+ const avmProofData = new ProofData(
124
+ this.processedTx.avmProvingRequest.inputs.publicInputs,
125
+ this.avm.proof,
126
+ this.#getVkData(this.avm!.verificationKey, AVM_VK_INDEX),
127
+ );
130
128
 
131
- return new VkWitnessData(this.tube!.verificationKey, vkIndex, vkPath);
129
+ return new PublicTxBaseRollupPrivateInputs(publicChonkVerifierProofData, avmProofData, this.baseRollupHints);
132
130
  }
133
131
 
134
- #getAvmVkData() {
135
- const vkIndex = AVM_VK_INDEX;
132
+ #getVkData(verificationKey: VerificationKeyData, vkIndex: number) {
133
+ // TODO(#17162): Add avm vk hash to the tree and call `getVkData('AVM')` instead.
134
+ // Below will return a path to an empty leaf.
136
135
  const vkPath = getVKSiblingPath(vkIndex);
137
- return new VkWitnessData(this.avm!.verificationKey, AVM_VK_INDEX, vkPath);
136
+ return new VkData(verificationKey, vkIndex, vkPath);
138
137
  }
139
138
  }
@@ -1,17 +1,18 @@
1
1
  import { type ACVMConfig, type BBConfig, BBNativeRollupProver, TestCircuitProver } from '@aztec/bb-prover';
2
2
  import { times } from '@aztec/foundation/collection';
3
- import { Fr } from '@aztec/foundation/fields';
3
+ import type { EthAddress } from '@aztec/foundation/eth-address';
4
4
  import { createLogger } from '@aztec/foundation/log';
5
5
  import { NativeACVMSimulator } from '@aztec/simulator/server';
6
- import type {
7
- ActualProverConfig,
8
- EpochProver,
9
- EpochProverManager,
10
- ForkMerkleTreeOperations,
11
- ProvingJobBroker,
12
- ProvingJobConsumer,
13
- ProvingJobProducer,
14
- ServerCircuitProver,
6
+ import {
7
+ type ActualProverConfig,
8
+ type EpochProver,
9
+ type EpochProverManager,
10
+ type ForkMerkleTreeOperations,
11
+ type ProvingJobBroker,
12
+ type ProvingJobConsumer,
13
+ type ProvingJobProducer,
14
+ type ServerCircuitProver,
15
+ tryStop,
15
16
  } from '@aztec/stdlib/interfaces/server';
16
17
  import { type TelemetryClient, getTelemetryClient } from '@aztec/telemetry-client';
17
18
 
@@ -48,8 +49,8 @@ export class ProverClient implements EpochProverManager {
48
49
  return new ServerEpochProver(facade, orchestrator);
49
50
  }
50
51
 
51
- public getProverId(): Fr {
52
- return this.config.proverId ?? Fr.ZERO;
52
+ public getProverId(): EthAddress {
53
+ return this.config.proverId;
53
54
  }
54
55
 
55
56
  async updateProverConfig(config: Partial<ProverClientConfig>): Promise<void> {
@@ -87,6 +88,7 @@ export class ProverClient implements EpochProverManager {
87
88
  }
88
89
  this.running = false;
89
90
  await this.stopAgents();
91
+ await tryStop(this.orchestratorClient);
90
92
  }
91
93
 
92
94
  /**
@@ -154,9 +156,9 @@ export function buildServerCircuitProver(
154
156
  return BBNativeRollupProver.new(config, telemetry);
155
157
  }
156
158
 
157
- const simulationProvider = config.acvmBinaryPath
159
+ const simulator = config.acvmBinaryPath
158
160
  ? new NativeACVMSimulator(config.acvmWorkingDirectory, config.acvmBinaryPath)
159
161
  : undefined;
160
162
 
161
- return Promise.resolve(new TestCircuitProver(simulationProvider, config, telemetry));
163
+ return Promise.resolve(new TestCircuitProver(simulator, config, telemetry));
162
164
  }
@@ -1,49 +1,68 @@
1
+ import type { BatchedBlob, FinalBlobBatchingChallenges } from '@aztec/blob-lib';
1
2
  import type { Fr } from '@aztec/foundation/fields';
2
- import type { L2Block } from '@aztec/stdlib/block';
3
+ import type { EthAddress } from '@aztec/stdlib/block';
3
4
  import type { EpochProver } from '@aztec/stdlib/interfaces/server';
4
5
  import type { Proof } from '@aztec/stdlib/proofs';
5
- import type { RootRollupPublicInputs } from '@aztec/stdlib/rollup';
6
- import type { BlockHeader, GlobalVariables, ProcessedTx, Tx } from '@aztec/stdlib/tx';
6
+ import type { CheckpointConstantData, RootRollupPublicInputs } from '@aztec/stdlib/rollup';
7
+ import type { BlockHeader, ProcessedTx, Tx } from '@aztec/stdlib/tx';
8
+ import type { UInt64 } from '@aztec/stdlib/types';
7
9
 
8
10
  import type { ProvingOrchestrator } from '../orchestrator/orchestrator.js';
9
11
  import type { BrokerCircuitProverFacade } from '../proving_broker/broker_prover_facade.js';
10
12
 
11
13
  /** Encapsulates the proving orchestrator and the broker facade */
12
14
  export class ServerEpochProver implements EpochProver {
13
- constructor(private facade: BrokerCircuitProverFacade, private orchestrator: ProvingOrchestrator) {}
15
+ constructor(
16
+ private facade: BrokerCircuitProverFacade,
17
+ private orchestrator: ProvingOrchestrator,
18
+ ) {}
14
19
 
15
- startNewEpoch(epochNumber: number, firstBlockNumber: number, totalNumBlocks: number): void {
16
- this.orchestrator.startNewEpoch(epochNumber, firstBlockNumber, totalNumBlocks);
20
+ startNewEpoch(
21
+ epochNumber: number,
22
+ totalNumCheckpoints: number,
23
+ finalBlobBatchingChallenges: FinalBlobBatchingChallenges,
24
+ ): void {
25
+ this.orchestrator.startNewEpoch(epochNumber, totalNumCheckpoints, finalBlobBatchingChallenges);
17
26
  this.facade.start();
18
27
  }
19
- startTubeCircuits(txs: Tx[]): Promise<void> {
20
- return this.orchestrator.startTubeCircuits(txs);
28
+ startNewCheckpoint(
29
+ checkpointIndex: number,
30
+ constants: CheckpointConstantData,
31
+ l1ToL2Messages: Fr[],
32
+ totalNumBlocks: number,
33
+ totalNumBlobFields: number,
34
+ headerOfLastBlockInPreviousCheckpoint: BlockHeader,
35
+ ): Promise<void> {
36
+ return this.orchestrator.startNewCheckpoint(
37
+ checkpointIndex,
38
+ constants,
39
+ l1ToL2Messages,
40
+ totalNumBlocks,
41
+ totalNumBlobFields,
42
+ headerOfLastBlockInPreviousCheckpoint,
43
+ );
44
+ }
45
+ startChonkVerifierCircuits(txs: Tx[]): Promise<void> {
46
+ return this.orchestrator.startChonkVerifierCircuits(txs);
21
47
  }
22
- setBlockCompleted(blockNumber: number, expectedBlockHeader?: BlockHeader): Promise<L2Block> {
48
+ setBlockCompleted(blockNumber: number, expectedBlockHeader?: BlockHeader): Promise<BlockHeader> {
23
49
  return this.orchestrator.setBlockCompleted(blockNumber, expectedBlockHeader);
24
50
  }
25
- finaliseEpoch(): Promise<{ publicInputs: RootRollupPublicInputs; proof: Proof }> {
26
- return this.orchestrator.finaliseEpoch();
51
+ finalizeEpoch(): Promise<{ publicInputs: RootRollupPublicInputs; proof: Proof; batchedBlobInputs: BatchedBlob }> {
52
+ return this.orchestrator.finalizeEpoch();
27
53
  }
28
54
  cancel(): void {
29
55
  this.orchestrator.cancel();
30
56
  }
31
- getProverId(): Fr {
57
+ getProverId(): EthAddress {
32
58
  return this.orchestrator.getProverId();
33
59
  }
34
- getBlock(index: number): L2Block {
35
- return this.orchestrator.getBlock(index);
36
- }
37
60
  async stop(): Promise<void> {
38
61
  await this.facade.stop();
39
62
  await this.orchestrator.stop();
40
63
  }
41
- startNewBlock(
42
- globalVariables: GlobalVariables,
43
- l1ToL2Messages: Fr[],
44
- previousBlockHeader: BlockHeader,
45
- ): Promise<void> {
46
- return this.orchestrator.startNewBlock(globalVariables, l1ToL2Messages, previousBlockHeader);
64
+ startNewBlock(blockNumber: number, timestamp: UInt64, totalNumTxs: number): Promise<void> {
65
+ return this.orchestrator.startNewBlock(blockNumber, timestamp, totalNumTxs);
47
66
  }
48
67
  addTxs(txs: ProcessedTx[]): Promise<void> {
49
68
  return this.orchestrator.addTxs(txs);