41
41
import net .consensys .linea .zktracer .module .hub .fragment .*;
42
42
import net .consensys .linea .zktracer .module .hub .fragment .misc .MiscFragment ;
43
43
import net .consensys .linea .zktracer .module .hub .section .*;
44
+ import net .consensys .linea .zktracer .module .legacy .hash .HashData ;
45
+ import net .consensys .linea .zktracer .module .legacy .hash .HashInfo ;
44
46
import net .consensys .linea .zktracer .module .limits .Keccak ;
45
47
import net .consensys .linea .zktracer .module .limits .L2Block ;
46
48
import net .consensys .linea .zktracer .module .limits .L2L1Logs ;
47
49
import net .consensys .linea .zktracer .module .limits .precompiles .Blake2fRounds ;
48
50
import net .consensys .linea .zktracer .module .limits .precompiles .EcAddEffectiveCall ;
49
51
import net .consensys .linea .zktracer .module .limits .precompiles .EcMulEffectiveCall ;
50
- import net .consensys .linea .zktracer .module .limits .precompiles .EcPairingCallEffectiveCall ;
52
+ import net .consensys .linea .zktracer .module .limits .precompiles .EcPairingEffectiveCall ;
51
53
import net .consensys .linea .zktracer .module .limits .precompiles .EcPairingMillerLoop ;
52
54
import net .consensys .linea .zktracer .module .limits .precompiles .EcRecoverEffectiveCall ;
53
- import net .consensys .linea .zktracer .module .limits .precompiles .ModexpEffectiveCall ;
55
+ import net .consensys .linea .zktracer .module .limits .precompiles .Modexp ;
54
56
import net .consensys .linea .zktracer .module .limits .precompiles .Rip160Blocks ;
55
57
import net .consensys .linea .zktracer .module .limits .precompiles .Sha256Blocks ;
56
58
import net .consensys .linea .zktracer .module .logData .LogData ;
@@ -183,15 +185,29 @@ public void addTraceSection(TraceSection section) {
183
185
private final RomLex romLex ;
184
186
private final TxnData txnData ;
185
187
private final Trm trm = new Trm ();
186
- private final ModexpEffectiveCall modexp ;
187
188
private final Stp stp = new Stp (this , wcp , mod );
188
189
private final L2Block l2Block = new L2Block ();
190
+ private final HashInfo hashInfo ;
191
+ private final HashData hashData ;
192
+
193
+ // Precompiles stuff
194
+ Blake2fRounds blake2f ;
195
+ EcAddEffectiveCall ecAdd ;
196
+ EcMulEffectiveCall ecMul ;
197
+ EcPairingEffectiveCall ecPairing ;
198
+ EcRecoverEffectiveCall ecRecover ;
199
+ Modexp modexp ;
200
+ Rip160Blocks rip160 ;
201
+ Sha256Blocks sha256 ;
189
202
190
203
private final List <Module > modules ;
191
204
/* Those modules are not traced, we just compute the number of calls to those precompile to meet the prover limits */
192
205
private final List <Module > precompileLimitModules ;
193
206
194
207
public Hub () {
208
+ //
209
+ // Module
210
+ //
195
211
this .pch = new PlatformController (this );
196
212
this .mmu = new Mmu (this .callStack );
197
213
this .mxp = new Mxp (this );
@@ -201,24 +217,46 @@ public Hub() {
201
217
this .txnData = new TxnData (this , this .romLex , this .wcp );
202
218
this .ecData = new EcData (this , this .wcp , this .ext );
203
219
this .euc = new Euc (this .wcp );
220
+ this .hashData = new HashData (this );
221
+ this .hashInfo = new HashInfo (this );
222
+
223
+ //
224
+ // Precompiles
225
+ //
226
+ this .blake2f = new Blake2fRounds (this );
227
+ this .ecAdd = new EcAddEffectiveCall (this );
228
+ this .ecMul = new EcMulEffectiveCall (this );
229
+ this .ecPairing = new EcPairingEffectiveCall (this );
230
+ this .ecRecover = new EcRecoverEffectiveCall (this );
231
+ this .modexp = new Modexp (this );
232
+ this .rip160 = new Rip160Blocks (this );
233
+ this .sha256 = new Sha256Blocks (this );
204
234
205
- final EcRecoverEffectiveCall ecRec = new EcRecoverEffectiveCall (this );
206
- this .modexp = new ModexpEffectiveCall (this );
207
- final EcPairingCallEffectiveCall ecpairingCall = new EcPairingCallEffectiveCall (this );
208
235
this .precompileLimitModules =
209
236
List .of (
210
- new Sha256Blocks (this ),
211
- ecRec ,
212
- new Rip160Blocks (this ),
237
+ this .blake2f ,
238
+ this .blake2f .callCounter (),
239
+ this .ecAdd ,
240
+ this .ecAdd .callCounter (),
241
+ this .ecMul ,
242
+ this .ecMul .callCounter (),
243
+ this .ecPairing ,
244
+ this .ecPairing .callCounter (),
245
+ new EcPairingMillerLoop (this .ecPairing ),
246
+ this .ecRecover ,
247
+ this .ecRecover .callCounter (),
213
248
this .modexp ,
214
- new EcAddEffectiveCall (this ),
215
- new EcMulEffectiveCall (this ),
216
- ecpairingCall ,
217
- new EcPairingMillerLoop (ecpairingCall ),
218
- new Blake2fRounds (this ),
249
+ this .modexp .callCounter (),
250
+ this .rip160 ,
251
+ this .rip160 .callCounter (),
252
+ this .sha256 ,
253
+ this .sha256 .callCounter (),
254
+
219
255
// Block level limits
256
+ this .hashData ,
257
+ this .hashInfo ,
220
258
this .l2Block ,
221
- new Keccak (this , ecRec , this .l2Block ),
259
+ new Keccak (this , this . ecRecover , this .l2Block ),
222
260
new L2L1Logs (this .l2Block ));
223
261
224
262
this .modules =
@@ -241,7 +279,7 @@ public Hub() {
241
279
this .rom ,
242
280
this .shf ,
243
281
this .trm ,
244
- this .txnData ,
282
+ // this.txnData,
245
283
this .stp ,
246
284
this .wcp ),
247
285
this .precompileLimitModules .stream ())
@@ -253,11 +291,15 @@ public Hub() {
253
291
*/
254
292
public List <Module > getModulesToTrace () {
255
293
return List .of (
294
+ //
256
295
// Reference tables
296
+ //
257
297
new BinRt (),
258
298
new InstructionDecoder (),
259
299
new ShfRt (),
300
+ //
260
301
// Modules
302
+ //
261
303
this ,
262
304
this .add ,
263
305
this .bin ,
@@ -276,7 +318,7 @@ public List<Module> getModulesToTrace() {
276
318
this .romLex ,
277
319
this .shf ,
278
320
this .stp ,
279
- this .txnData ,
321
+ // this.txnData,
280
322
this .wcp );
281
323
}
282
324
@@ -302,8 +344,10 @@ public List<Module> getModulesToCount() {
302
344
this .rom ,
303
345
this .shf ,
304
346
this .trm ,
305
- this .txnData ,
306
- this .wcp ),
347
+ // this.txnData,
348
+ this .wcp ,
349
+ this .hashData ,
350
+ this .hashInfo ),
307
351
this .precompileLimitModules .stream ())
308
352
.toList ();
309
353
}
@@ -514,7 +558,7 @@ void triggerModules(MessageFrame frame) {
514
558
// TODO: this.oob.tracePreOpcode(frame);
515
559
}
516
560
if (this .pch .signals ().stp ()) {
517
- this .stp .tracePreOpcode (frame );
561
+ // this.stp.tracePreOpcode(frame);
518
562
}
519
563
if (this .pch .signals ().exp ()) {
520
564
this .modexp .tracePreOpcode (frame );
0 commit comments