@aztec/simulator 0.0.1-commit.c7c42ec → 0.0.1-commit.d1f2d6c

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 (122) hide show
  1. package/README.md +2 -0
  2. package/dest/common/errors.d.ts +7 -1
  3. package/dest/common/errors.d.ts.map +1 -1
  4. package/dest/private/circuit_recording/circuit_recorder.d.ts +1 -1
  5. package/dest/private/circuit_recording/circuit_recorder.d.ts.map +1 -1
  6. package/dest/private/circuit_recording/circuit_recorder.js +15 -14
  7. package/dest/public/avm/avm_memory_types.d.ts +1 -1
  8. package/dest/public/avm/avm_memory_types.d.ts.map +1 -1
  9. package/dest/public/avm/avm_memory_types.js +3 -0
  10. package/dest/public/avm/opcodes/accrued_substate.d.ts +15 -15
  11. package/dest/public/avm/opcodes/accrued_substate.d.ts.map +1 -1
  12. package/dest/public/avm/opcodes/accrued_substate.js +29 -29
  13. package/dest/public/avm/opcodes/arithmetic.d.ts +8 -8
  14. package/dest/public/avm/opcodes/arithmetic.d.ts.map +1 -1
  15. package/dest/public/avm/opcodes/arithmetic.js +1 -1
  16. package/dest/public/avm/opcodes/bitwise.d.ts +7 -7
  17. package/dest/public/avm/opcodes/bitwise.d.ts.map +1 -1
  18. package/dest/public/avm/opcodes/bitwise.js +5 -5
  19. package/dest/public/avm/opcodes/comparators.d.ts +4 -4
  20. package/dest/public/avm/opcodes/comparators.d.ts.map +1 -1
  21. package/dest/public/avm/opcodes/comparators.js +1 -1
  22. package/dest/public/avm/opcodes/contract.d.ts +3 -3
  23. package/dest/public/avm/opcodes/contract.d.ts.map +1 -1
  24. package/dest/public/avm/opcodes/contract.js +8 -8
  25. package/dest/public/avm/opcodes/control_flow.d.ts +3 -3
  26. package/dest/public/avm/opcodes/control_flow.d.ts.map +1 -1
  27. package/dest/public/avm/opcodes/control_flow.js +4 -4
  28. package/dest/public/avm/opcodes/conversion.d.ts +3 -3
  29. package/dest/public/avm/opcodes/conversion.d.ts.map +1 -1
  30. package/dest/public/avm/opcodes/conversion.js +4 -4
  31. package/dest/public/avm/opcodes/ec_add.d.ts +4 -4
  32. package/dest/public/avm/opcodes/ec_add.d.ts.map +1 -1
  33. package/dest/public/avm/opcodes/ec_add.js +15 -6
  34. package/dest/public/avm/opcodes/environment_getters.d.ts +5 -5
  35. package/dest/public/avm/opcodes/environment_getters.d.ts.map +1 -1
  36. package/dest/public/avm/opcodes/environment_getters.js +6 -6
  37. package/dest/public/avm/opcodes/external_calls.d.ts +9 -9
  38. package/dest/public/avm/opcodes/external_calls.d.ts.map +1 -1
  39. package/dest/public/avm/opcodes/external_calls.js +17 -16
  40. package/dest/public/avm/opcodes/hashing.d.ts +8 -8
  41. package/dest/public/avm/opcodes/hashing.d.ts.map +1 -1
  42. package/dest/public/avm/opcodes/hashing.js +12 -12
  43. package/dest/public/avm/opcodes/instruction_impl.d.ts +4 -4
  44. package/dest/public/avm/opcodes/instruction_impl.d.ts.map +1 -1
  45. package/dest/public/avm/opcodes/instruction_impl.js +4 -4
  46. package/dest/public/avm/opcodes/memory.d.ts +14 -14
  47. package/dest/public/avm/opcodes/memory.d.ts.map +1 -1
  48. package/dest/public/avm/opcodes/memory.js +24 -24
  49. package/dest/public/avm/opcodes/misc.d.ts +3 -3
  50. package/dest/public/avm/opcodes/misc.d.ts.map +1 -1
  51. package/dest/public/avm/opcodes/misc.js +4 -4
  52. package/dest/public/avm/opcodes/storage.d.ts +16 -15
  53. package/dest/public/avm/opcodes/storage.d.ts.map +1 -1
  54. package/dest/public/avm/opcodes/storage.js +34 -24
  55. package/dest/public/executor_metrics.d.ts +1 -1
  56. package/dest/public/executor_metrics.d.ts.map +1 -1
  57. package/dest/public/executor_metrics.js +8 -34
  58. package/dest/public/fixtures/bulk_test.d.ts +3 -3
  59. package/dest/public/fixtures/bulk_test.d.ts.map +1 -1
  60. package/dest/public/fixtures/bulk_test.js +1 -17
  61. package/dest/public/fixtures/custom_bytecode_tests.d.ts +11 -11
  62. package/dest/public/fixtures/custom_bytecode_tests.d.ts.map +1 -1
  63. package/dest/public/fixtures/custom_bytecode_tests.js +18 -18
  64. package/dest/public/fixtures/minimal_public_tx.js +2 -2
  65. package/dest/public/fixtures/opcode_spammer.d.ts +1 -1
  66. package/dest/public/fixtures/opcode_spammer.d.ts.map +1 -1
  67. package/dest/public/fixtures/opcode_spammer.js +92 -80
  68. package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts +21 -7
  69. package/dest/public/fuzzing/avm_fuzzer_simulator.d.ts.map +1 -1
  70. package/dest/public/fuzzing/avm_fuzzer_simulator.js +42 -10
  71. package/dest/public/fuzzing/avm_simulator_bin.js +29 -11
  72. package/dest/public/hinting_db_sources.js +3 -1
  73. package/dest/public/public_processor/guarded_merkle_tree.js +3 -1
  74. package/dest/public/public_processor/public_processor.d.ts +2 -2
  75. package/dest/public/public_processor/public_processor.d.ts.map +1 -1
  76. package/dest/public/public_processor/public_processor.js +402 -21
  77. package/dest/public/public_processor/public_processor_metrics.d.ts +1 -1
  78. package/dest/public/public_processor/public_processor_metrics.d.ts.map +1 -1
  79. package/dest/public/public_processor/public_processor_metrics.js +12 -45
  80. package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts +1 -1
  81. package/dest/public/public_tx_simulator/cpp_public_tx_simulator.d.ts.map +1 -1
  82. package/dest/public/public_tx_simulator/cpp_public_tx_simulator.js +2 -1
  83. package/dest/public/public_tx_simulator/measured_public_tx_simulator.d.ts +1 -1
  84. package/dest/public/public_tx_simulator/public_tx_simulator.d.ts +4 -3
  85. package/dest/public/public_tx_simulator/public_tx_simulator.d.ts.map +1 -1
  86. package/dest/public/public_tx_simulator/public_tx_simulator.js +5 -3
  87. package/dest/public/public_tx_simulator/telemetry_public_tx_simulator.js +395 -19
  88. package/dest/public/side_effect_trace.d.ts +2 -1
  89. package/dest/public/side_effect_trace.d.ts.map +1 -1
  90. package/dest/public/state_manager/state_manager.d.ts +1 -1
  91. package/dest/public/state_manager/state_manager.d.ts.map +1 -1
  92. package/dest/public/state_manager/state_manager.js +2 -2
  93. package/package.json +17 -17
  94. package/src/private/circuit_recording/circuit_recorder.ts +16 -15
  95. package/src/public/avm/avm_memory_types.ts +4 -0
  96. package/src/public/avm/opcodes/accrued_substate.ts +15 -15
  97. package/src/public/avm/opcodes/arithmetic.ts +1 -1
  98. package/src/public/avm/opcodes/bitwise.ts +3 -3
  99. package/src/public/avm/opcodes/comparators.ts +1 -1
  100. package/src/public/avm/opcodes/contract.ts +4 -7
  101. package/src/public/avm/opcodes/control_flow.ts +2 -2
  102. package/src/public/avm/opcodes/conversion.ts +3 -3
  103. package/src/public/avm/opcodes/ec_add.ts +13 -4
  104. package/src/public/avm/opcodes/environment_getters.ts +7 -7
  105. package/src/public/avm/opcodes/external_calls.ts +10 -9
  106. package/src/public/avm/opcodes/hashing.ts +6 -6
  107. package/src/public/avm/opcodes/instruction_impl.ts +2 -2
  108. package/src/public/avm/opcodes/memory.ts +18 -18
  109. package/src/public/avm/opcodes/misc.ts +2 -2
  110. package/src/public/avm/opcodes/storage.ts +30 -22
  111. package/src/public/executor_metrics.ts +7 -34
  112. package/src/public/fixtures/bulk_test.ts +2 -2
  113. package/src/public/fixtures/custom_bytecode_tests.ts +27 -18
  114. package/src/public/fixtures/minimal_public_tx.ts +2 -2
  115. package/src/public/fixtures/opcode_spammer.ts +197 -81
  116. package/src/public/fuzzing/avm_fuzzer_simulator.ts +60 -12
  117. package/src/public/fuzzing/avm_simulator_bin.ts +43 -8
  118. package/src/public/public_processor/public_processor.ts +3 -2
  119. package/src/public/public_processor/public_processor_metrics.ts +11 -45
  120. package/src/public/public_tx_simulator/cpp_public_tx_simulator.ts +9 -1
  121. package/src/public/public_tx_simulator/public_tx_simulator.ts +4 -2
  122. package/src/public/state_manager/state_manager.ts +2 -16
@@ -449,7 +449,7 @@ export const EXTERNAL_CALL_CONFIG: SpamConfig = {
449
449
  { offset: CONST_MAX_U32_OFFSET, value: new Uint32(MAX_U32) }, // l2Gas/daGas - MAX_U32 gets capped to remaining gas
450
450
  () => [
451
451
  new CalldataCopy(
452
- /*indirect=*/ 0,
452
+ /*addressing_mode=*/ 0,
453
453
  /*copySizeOffset=*/ CALL_COPY_SIZE_OFFSET,
454
454
  /*cdStartOffset=*/ CALL_CALLDATA_INDEX_OFFSET,
455
455
  /*dstOffset=*/ CALL_ADDR_OFFSET,
@@ -458,7 +458,7 @@ export const EXTERNAL_CALL_CONFIG: SpamConfig = {
458
458
  ],
459
459
  targetInstructions: () => [
460
460
  new Call(
461
- /*indirect=*/ 0,
461
+ /*addressing_mode=*/ 0,
462
462
  /*l2GasOffset=*/ CALL_L2_GAS_OFFSET,
463
463
  /*daGasOffset=*/ CALL_DA_GAS_OFFSET,
464
464
  /*addrOffset=*/ CALL_ADDR_OFFSET,
@@ -477,7 +477,7 @@ const STATIC_CALL_CONFIG: SpamConfig = {
477
477
  { offset: CONST_MAX_U32_OFFSET, value: new Uint32(MAX_U32) }, // l2Gas/daGas - MAX_U32 gets capped to remaining gas
478
478
  () => [
479
479
  new CalldataCopy(
480
- /*indirect=*/ 0,
480
+ /*addressing_mode=*/ 0,
481
481
  /*copySizeOffset=*/ CALL_COPY_SIZE_OFFSET,
482
482
  /*cdStartOffset=*/ CALL_CALLDATA_INDEX_OFFSET,
483
483
  /*dstOffset=*/ CALL_ADDR_OFFSET,
@@ -486,7 +486,7 @@ const STATIC_CALL_CONFIG: SpamConfig = {
486
486
  ],
487
487
  targetInstructions: () => [
488
488
  new StaticCall(
489
- /*indirect=*/ 0,
489
+ /*addressing_mode=*/ 0,
490
490
  /*l2GasOffset=*/ CALL_L2_GAS_OFFSET,
491
491
  /*daGasOffset=*/ CALL_DA_GAS_OFFSET,
492
492
  /*addrOffset=*/ CALL_ADDR_OFFSET,
@@ -517,7 +517,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
517
517
  { offset: 1, value: randomWithTag(tag) }, // random addend
518
518
  ],
519
519
  targetInstructions: () => [
520
- new Add(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.ADD_8, Add.wireFormat8),
520
+ new Add(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
521
+ Opcode.ADD_8,
522
+ Add.wireFormat8,
523
+ ),
521
524
  ],
522
525
  })),
523
526
 
@@ -528,7 +531,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
528
531
  { offset: 1, value: randomWithTag(tag) }, // random subtrahend
529
532
  ],
530
533
  targetInstructions: () => [
531
- new Sub(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.SUB_8, Sub.wireFormat8),
534
+ new Sub(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
535
+ Opcode.SUB_8,
536
+ Sub.wireFormat8,
537
+ ),
532
538
  ],
533
539
  })),
534
540
 
@@ -539,7 +545,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
539
545
  { offset: 1, value: randomWithTag(tag) }, // random multiplier
540
546
  ],
541
547
  targetInstructions: () => [
542
- new Mul(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.MUL_8, Mul.wireFormat8),
548
+ new Mul(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
549
+ Opcode.MUL_8,
550
+ Mul.wireFormat8,
551
+ ),
543
552
  ],
544
553
  })),
545
554
 
@@ -551,7 +560,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
551
560
  { offset: 1, value: randomNonZeroWithTag(tag) }, // random non-zero divisor
552
561
  ],
553
562
  targetInstructions: () => [
554
- new Div(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.DIV_8, Div.wireFormat8),
563
+ new Div(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
564
+ Opcode.DIV_8,
565
+ Div.wireFormat8,
566
+ ),
555
567
  ],
556
568
  })),
557
569
 
@@ -563,7 +575,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
563
575
  { offset: 1, value: randomNonZeroField() }, // random non-zero divisor
564
576
  ],
565
577
  targetInstructions: () => [
566
- new FieldDiv(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
578
+ new FieldDiv(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
567
579
  Opcode.FDIV_8,
568
580
  FieldDiv.wireFormat8,
569
581
  ),
@@ -581,7 +593,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
581
593
  { offset: 1, value: randomWithTag(tag) }, // random value b
582
594
  ],
583
595
  targetInstructions: () => [
584
- new Eq(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 2).as(Opcode.EQ_8, Eq.wireFormat8),
596
+ new Eq(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 2).as(Opcode.EQ_8, Eq.wireFormat8),
585
597
  ],
586
598
  })),
587
599
 
@@ -592,7 +604,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
592
604
  { offset: 1, value: randomWithTag(tag) }, // random value b
593
605
  ],
594
606
  targetInstructions: () => [
595
- new Lt(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 2).as(Opcode.LT_8, Lt.wireFormat8),
607
+ new Lt(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 2).as(Opcode.LT_8, Lt.wireFormat8),
596
608
  ],
597
609
  })),
598
610
 
@@ -603,7 +615,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
603
615
  { offset: 1, value: randomWithTag(tag) }, // random value b
604
616
  ],
605
617
  targetInstructions: () => [
606
- new Lte(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 2).as(Opcode.LTE_8, Lte.wireFormat8),
618
+ new Lte(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 2).as(
619
+ Opcode.LTE_8,
620
+ Lte.wireFormat8,
621
+ ),
607
622
  ],
608
623
  })),
609
624
 
@@ -617,7 +632,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
617
632
  { offset: 1, value: randomWithTag(tag) }, // random value b
618
633
  ],
619
634
  targetInstructions: () => [
620
- new And(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.AND_8, And.wireFormat8),
635
+ new And(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
636
+ Opcode.AND_8,
637
+ And.wireFormat8,
638
+ ),
621
639
  ],
622
640
  })),
623
641
 
@@ -628,7 +646,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
628
646
  { offset: 1, value: randomWithTag(tag) }, // random value b
629
647
  ],
630
648
  targetInstructions: () => [
631
- new Or(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.OR_8, Or.wireFormat8),
649
+ new Or(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.OR_8, Or.wireFormat8),
632
650
  ],
633
651
  })),
634
652
 
@@ -639,7 +657,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
639
657
  { offset: 1, value: randomWithTag(tag) }, // random value b
640
658
  ],
641
659
  targetInstructions: () => [
642
- new Xor(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.XOR_8, Xor.wireFormat8),
660
+ new Xor(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
661
+ Opcode.XOR_8,
662
+ Xor.wireFormat8,
663
+ ),
643
664
  ],
644
665
  })),
645
666
 
@@ -647,7 +668,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
647
668
  label: TypeTag[tag],
648
669
  setup: [{ offset: 0, value: randomWithTag(tag) }], // random value
649
670
  targetInstructions: () => [
650
- new Not(/*indirect=*/ 0, /*srcOffset=*/ 0, /*dstOffset=*/ 0).as(Opcode.NOT_8, Not.wireFormat8),
671
+ new Not(/*addressing_mode=*/ 0, /*srcOffset=*/ 0, /*dstOffset=*/ 0).as(Opcode.NOT_8, Not.wireFormat8),
651
672
  ],
652
673
  })),
653
674
 
@@ -658,7 +679,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
658
679
  { offset: 1, value: withTag(1n, tag) }, // shift by 1 (small fixed amount to avoid overflow)
659
680
  ],
660
681
  targetInstructions: () => [
661
- new Shl(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.SHL_8, Shl.wireFormat8),
682
+ new Shl(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
683
+ Opcode.SHL_8,
684
+ Shl.wireFormat8,
685
+ ),
662
686
  ],
663
687
  })),
664
688
 
@@ -669,7 +693,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
669
693
  { offset: 1, value: withTag(1n, tag) }, // shift by 1 (small fixed amount)
670
694
  ],
671
695
  targetInstructions: () => [
672
- new Shr(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.SHR_8, Shr.wireFormat8),
696
+ new Shr(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
697
+ Opcode.SHR_8,
698
+ Shr.wireFormat8,
699
+ ),
673
700
  ],
674
701
  })),
675
702
 
@@ -680,7 +707,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
680
707
  label: TypeTag[tag],
681
708
  setup: [{ offset: 0, value: randomWithTag(tag) }], // random value to cast
682
709
  targetInstructions: () => [
683
- new Cast(/*indirect=*/ 0, /*srcOffset=*/ 0, /*dstOffset=*/ 1, /*dstTag=*/ TypeTag.UINT32).as(
710
+ new Cast(/*addressing_mode=*/ 0, /*srcOffset=*/ 0, /*dstOffset=*/ 1, /*dstTag=*/ TypeTag.UINT32).as(
684
711
  Opcode.CAST_8,
685
712
  Cast.wireFormat8,
686
713
  ),
@@ -691,7 +718,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
691
718
  label: TypeTag[tag],
692
719
  setup: [{ offset: 0, value: randomWithTag(tag) }], // random value to move
693
720
  targetInstructions: () => [
694
- new Mov(/*indirect=*/ 0, /*srcOffset=*/ 0, /*dstOffset=*/ 1).as(Opcode.MOV_8, Mov.wireFormat8),
721
+ new Mov(/*addressing_mode=*/ 0, /*srcOffset=*/ 0, /*dstOffset=*/ 1).as(Opcode.MOV_8, Mov.wireFormat8),
695
722
  ],
696
723
  })),
697
724
 
@@ -732,7 +759,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
732
759
  {
733
760
  setup: [],
734
761
  targetInstructions: () => [
735
- new Set(/*indirect=*/ 0, /*dstOffset=*/ 0, /*inTag=*/ TypeTag.UINT128, /*value=*/ 4242424242424242n).as(
762
+ new Set(/*addressing_mode=*/ 0, /*dstOffset=*/ 0, /*inTag=*/ TypeTag.UINT128, /*value=*/ 4242424242424242n).as(
736
763
  Opcode.SET_128,
737
764
  Set.wireFormat128,
738
765
  ),
@@ -761,7 +788,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
761
788
  [Opcode.JUMPI_32]: [
762
789
  {
763
790
  setup: [{ offset: 0, value: new Uint1(0n) }], // Always false
764
- targetInstructions: () => [new JumpI(/*indirect=*/ 0, /*condOffset=*/ 0, /*loc=*/ 0)],
791
+ targetInstructions: () => [new JumpI(/*addressing_mode=*/ 0, /*condOffset=*/ 0, /*loc=*/ 0)],
765
792
  },
766
793
  ],
767
794
 
@@ -801,7 +828,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
801
828
  { offset: 0, value: new Uint32(0) }, // returnSize = 0
802
829
  ],
803
830
  targetInstructions: () => [
804
- new Return(/*indirect=*/ 0, /*returnSizeOffset=*/ 0, /*returnOffset=*/ 0), // return nothing (size=0)
831
+ new Return(/*addressing_mode=*/ 0, /*returnSizeOffset=*/ 0, /*returnOffset=*/ 0), // return nothing (size=0)
805
832
  ],
806
833
  // Use the side-effect-limit pattern (even though it's not a side-effect) as it fits
807
834
  // this case (we want to CALL, RETURN, then CALL again back in parent). We omit "cleanup"
@@ -818,7 +845,10 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
818
845
  { offset: 0, value: new Uint32(0) }, // retSize = 0
819
846
  ],
820
847
  targetInstructions: () => [
821
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 0, /*returnOffset=*/ 1).as(Opcode.REVERT_8, Revert.wireFormat8),
848
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 0, /*returnOffset=*/ 1).as(
849
+ Opcode.REVERT_8,
850
+ Revert.wireFormat8,
851
+ ),
822
852
  ],
823
853
  limit: 1, // REVERT can only execute once per call
824
854
  },
@@ -831,7 +861,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
831
861
  {
832
862
  setup: [],
833
863
  targetInstructions: () => [
834
- new GetEnvVar(/*indirect=*/ 0, /*dstOffset=*/ 0, /*varEnum=*/ 0).as(
864
+ new GetEnvVar(/*addressing_mode=*/ 0, /*dstOffset=*/ 0, /*varEnum=*/ 0).as(
835
865
  Opcode.GETENVVAR_16,
836
866
  GetEnvVar.wireFormat16,
837
867
  ),
@@ -849,7 +879,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
849
879
  { offset: 1, value: new Uint32(0n) }, // cdStart = 0
850
880
  ],
851
881
  targetInstructions: () => [
852
- new CalldataCopy(/*indirect=*/ 0, /*copySizeOffset=*/ 0, /*cdStartOffset=*/ 1, /*dstOffset=*/ 2),
882
+ new CalldataCopy(/*addressing_mode=*/ 0, /*copySizeOffset=*/ 0, /*cdStartOffset=*/ 1, /*dstOffset=*/ 2),
853
883
  ],
854
884
  },
855
885
  {
@@ -862,7 +892,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
862
892
  { offset: 1, value: new Uint32(0n) }, // cdStart = 0
863
893
  ],
864
894
  targetInstructions: () => [
865
- new CalldataCopy(/*indirect=*/ 0, /*copySizeOffset=*/ 0, /*cdStartOffset=*/ 1, /*dstOffset=*/ 2),
895
+ new CalldataCopy(/*addressing_mode=*/ 0, /*copySizeOffset=*/ 0, /*cdStartOffset=*/ 1, /*dstOffset=*/ 2),
866
896
  ],
867
897
  },
868
898
  {
@@ -873,7 +903,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
873
903
  { offset: 1, value: new Uint32(0n) }, // cdStart = 0
874
904
  ],
875
905
  targetInstructions: () => [
876
- new CalldataCopy(/*indirect=*/ 0, /*copySizeOffset=*/ 0, /*cdStartOffset=*/ 1, /*dstOffset=*/ 2),
906
+ new CalldataCopy(/*addressing_mode=*/ 0, /*copySizeOffset=*/ 0, /*cdStartOffset=*/ 1, /*dstOffset=*/ 2),
877
907
  ],
878
908
  },
879
909
  ],
@@ -881,14 +911,14 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
881
911
  [Opcode.SUCCESSCOPY]: [
882
912
  {
883
913
  setup: [],
884
- targetInstructions: () => [new SuccessCopy(/*indirect=*/ 0, /*dstOffset=*/ 0)],
914
+ targetInstructions: () => [new SuccessCopy(/*addressing_mode=*/ 0, /*dstOffset=*/ 0)],
885
915
  },
886
916
  ],
887
917
 
888
918
  [Opcode.RETURNDATASIZE]: [
889
919
  {
890
920
  setup: [],
891
- targetInstructions: () => [new ReturndataSize(/*indirect=*/ 0, /*dstOffset=*/ 0)],
921
+ targetInstructions: () => [new ReturndataSize(/*addressing_mode=*/ 0, /*dstOffset=*/ 0)],
892
922
  },
893
923
  ],
894
924
 
@@ -901,7 +931,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
901
931
  { offset: 1, value: new Uint32(0n) }, // rdOffset
902
932
  ],
903
933
  targetInstructions: () => [
904
- new ReturndataCopy(/*indirect=*/ 0, /*copySizeOffset=*/ 0, /*rdStartOffset=*/ 1, /*dstOffset=*/ 2),
934
+ new ReturndataCopy(/*addressing_mode=*/ 0, /*copySizeOffset=*/ 0, /*rdStartOffset=*/ 1, /*dstOffset=*/ 2),
905
935
  ],
906
936
  },
907
937
  {
@@ -914,7 +944,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
914
944
  { offset: 1, value: new Uint32(0n) }, // rdOffset
915
945
  ],
916
946
  targetInstructions: () => [
917
- new ReturndataCopy(/*indirect=*/ 0, /*copySizeOffset=*/ 0, /*rdStartOffset=*/ 1, /*dstOffset=*/ 2),
947
+ new ReturndataCopy(/*addressing_mode=*/ 0, /*copySizeOffset=*/ 0, /*rdStartOffset=*/ 1, /*dstOffset=*/ 2),
918
948
  ],
919
949
  },
920
950
  {
@@ -925,7 +955,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
925
955
  { offset: 1, value: new Uint32(0n) }, // rdOffset
926
956
  ],
927
957
  targetInstructions: () => [
928
- new ReturndataCopy(/*indirect=*/ 0, /*copySizeOffset=*/ 0, /*rdStartOffset=*/ 1, /*dstOffset=*/ 2),
958
+ new ReturndataCopy(/*addressing_mode=*/ 0, /*copySizeOffset=*/ 0, /*rdStartOffset=*/ 1, /*dstOffset=*/ 2),
929
959
  ],
930
960
  },
931
961
  ],
@@ -936,31 +966,66 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
936
966
  [Opcode.SLOAD]: [
937
967
  {
938
968
  label: 'Cold read (slot not written)',
939
- setup: [{ offset: 0, value: new Field(Fr.random()) }], // random slot
940
- targetInstructions: () => [new SLoad(/*indirect=*/ 0, /*slotOffset=*/ 0, /*dstOffset=*/ 1)],
969
+ setup: [
970
+ { offset: 0, value: new Field(Fr.random()) }, // random slot
971
+ () => [
972
+ // Get current contract address into offset 1
973
+ new GetEnvVar(/*addressing_mode=*/ 0, /*dstOffset=*/ 1, /*varEnum=*/ 0).as(
974
+ Opcode.GETENVVAR_16,
975
+ GetEnvVar.wireFormat16,
976
+ ),
977
+ ],
978
+ ],
979
+ targetInstructions: () => [
980
+ new SLoad(/*addressing_mode=*/ 0, /*slotOffset=*/ 0, /*contractAddressOffset=*/ 1, /*dstOffset=*/ 2),
981
+ ],
941
982
  },
942
983
  {
943
984
  label: 'Warm read (from tree)',
944
985
  // Uses pre-inserted storage from insertWarmTreeEntries() which is called after contract deployment
945
- setup: [{ offset: 0, value: new Field(WARM_STORAGE_SLOT) }], // pre-inserted slot
946
- targetInstructions: () => [new SLoad(/*indirect=*/ 0, /*slotOffset=*/ 0, /*dstOffset=*/ 1)],
986
+ setup: [
987
+ { offset: 0, value: new Field(WARM_STORAGE_SLOT) }, // pre-inserted slot
988
+ () => [
989
+ // Get current contract address into offset 1
990
+ new GetEnvVar(/*addressing_mode=*/ 0, /*dstOffset=*/ 1, /*varEnum=*/ 0).as(
991
+ Opcode.GETENVVAR_16,
992
+ GetEnvVar.wireFormat16,
993
+ ),
994
+ ],
995
+ ],
996
+ targetInstructions: () => [
997
+ new SLoad(/*addressing_mode=*/ 0, /*slotOffset=*/ 0, /*contractAddressOffset=*/ 1, /*dstOffset=*/ 2),
998
+ ],
947
999
  },
948
1000
  {
949
1001
  label: 'Warm read (SSTORE first, unique slot per SLOAD)',
950
- // Memory layout: slot (incremented), value, constant 1, revertSize, loaded value
1002
+ // Memory layout: slot (incremented), value, constant 1, contract address (from GETENVVAR), revertSize, loaded value
951
1003
  setup: [
952
1004
  { offset: 0, value: new Field(Fr.random()) }, // slot (will be incremented)
953
1005
  { offset: 1, value: new Field(Fr.random()) }, // value to store
954
1006
  { offset: 2, value: new Field(1n) }, // constant 1 for ADD
955
- { offset: 3, value: new Uint32(0n) }, // revertSize
1007
+ () => [
1008
+ // Get current contract address into offset 3
1009
+ new GetEnvVar(/*addressing_mode=*/ 0, /*dstOffset=*/ 3, /*varEnum=*/ 0).as(
1010
+ Opcode.GETENVVAR_16,
1011
+ GetEnvVar.wireFormat16,
1012
+ ),
1013
+ ],
1014
+ { offset: 4, value: new Uint32(0n) }, // revertSize
956
1015
  ],
957
1016
  targetInstructions: () => [
958
- new SStore(/*indirect=*/ 0, /*srcOffset=*/ 1, /*slotOffset=*/ 0),
959
- new SLoad(/*indirect=*/ 0, /*slotOffset=*/ 0, /*dstOffset=*/ 4),
960
- new Add(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 2, /*dstOffset=*/ 0).as(Opcode.ADD_8, Add.wireFormat8), // slot++
1017
+ new SStore(/*addressing_mode=*/ 0, /*srcOffset=*/ 1, /*slotOffset=*/ 0),
1018
+ new SLoad(/*addressing_mode=*/ 0, /*slotOffset=*/ 0, /*contractAddressOffset=*/ 3, /*dstOffset=*/ 5),
1019
+ new Add(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 2, /*dstOffset=*/ 0).as(
1020
+ Opcode.ADD_8,
1021
+ Add.wireFormat8,
1022
+ ), // slot++
961
1023
  ],
962
1024
  cleanupInstructions: () => [
963
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 3, /*returnOffset=*/ 0).as(Opcode.REVERT_8, Revert.wireFormat8),
1025
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 4, /*returnOffset=*/ 0).as(
1026
+ Opcode.REVERT_8,
1027
+ Revert.wireFormat8,
1028
+ ),
964
1029
  ],
965
1030
  limit: MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
966
1031
  },
@@ -976,7 +1041,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
976
1041
  { offset: 1, value: randomWithTag(TypeTag.UINT64) }, // random leafIndex
977
1042
  ],
978
1043
  targetInstructions: () => [
979
- new NoteHashExists(/*indirect=*/ 0, /*noteHashOffset=*/ 0, /*leafIndexOffset=*/ 1, /*existsOffset=*/ 2),
1044
+ new NoteHashExists(/*addressing_mode=*/ 0, /*noteHashOffset=*/ 0, /*leafIndexOffset=*/ 1, /*existsOffset=*/ 2),
980
1045
  ],
981
1046
  },
982
1047
  {
@@ -987,7 +1052,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
987
1052
  { offset: 1, value: new Uint64(WARM_NOTE_HASH_LEAF_INDEX) }, // known leafIndex
988
1053
  ],
989
1054
  targetInstructions: () => [
990
- new NoteHashExists(/*indirect=*/ 0, /*noteHashOffset=*/ 0, /*leafIndexOffset=*/ 1, /*existsOffset=*/ 2),
1055
+ new NoteHashExists(/*addressing_mode=*/ 0, /*noteHashOffset=*/ 0, /*leafIndexOffset=*/ 1, /*existsOffset=*/ 2),
991
1056
  ],
992
1057
  },
993
1058
  ],
@@ -1000,7 +1065,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1000
1065
  { offset: 1, value: new Field(Fr.random()) }, // random address
1001
1066
  ],
1002
1067
  targetInstructions: () => [
1003
- new NullifierExists(/*indirect=*/ 0, /*nullifierOffset=*/ 0, /*addressOffset=*/ 1, /*existsOffset=*/ 2),
1068
+ new NullifierExists(/*addressing_mode=*/ 0, /*nullifierOffset=*/ 0, /*addressOffset=*/ 1, /*existsOffset=*/ 2),
1004
1069
  ],
1005
1070
  },
1006
1071
  {
@@ -1011,7 +1076,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1011
1076
  { offset: 1, value: new Field(WARM_NULLIFIER_ADDRESS.toField()) }, // address it was siloed with
1012
1077
  ],
1013
1078
  targetInstructions: () => [
1014
- new NullifierExists(/*indirect=*/ 0, /*nullifierOffset=*/ 0, /*addressOffset=*/ 1, /*existsOffset=*/ 2),
1079
+ new NullifierExists(/*addressing_mode=*/ 0, /*nullifierOffset=*/ 0, /*addressOffset=*/ 1, /*existsOffset=*/ 2),
1015
1080
  ],
1016
1081
  },
1017
1082
  {
@@ -1022,7 +1087,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1022
1087
  { offset: 1, value: new Field(1n) }, // constant 1 for ADD
1023
1088
  () => [
1024
1089
  // Get current contract address into offset 2
1025
- new GetEnvVar(/*indirect=*/ 0, /*dstOffset=*/ 2, /*varEnum=*/ 0).as(
1090
+ new GetEnvVar(/*addressing_mode=*/ 0, /*dstOffset=*/ 2, /*varEnum=*/ 0).as(
1026
1091
  Opcode.GETENVVAR_16,
1027
1092
  GetEnvVar.wireFormat16,
1028
1093
  ),
@@ -1030,12 +1095,18 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1030
1095
  { offset: 3, value: new Uint32(0n) }, // revertSize
1031
1096
  ],
1032
1097
  targetInstructions: () => [
1033
- new EmitNullifier(/*indirect=*/ 0, /*nullifierOffset=*/ 0),
1034
- new NullifierExists(/*indirect=*/ 0, /*nullifierOffset=*/ 0, /*addressOffset=*/ 2, /*existsOffset=*/ 4),
1035
- new Add(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.ADD_8, Add.wireFormat8), // nullifier++
1098
+ new EmitNullifier(/*addressing_mode=*/ 0, /*nullifierOffset=*/ 0),
1099
+ new NullifierExists(/*addressing_mode=*/ 0, /*nullifierOffset=*/ 0, /*addressOffset=*/ 2, /*existsOffset=*/ 4),
1100
+ new Add(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
1101
+ Opcode.ADD_8,
1102
+ Add.wireFormat8,
1103
+ ), // nullifier++
1036
1104
  ],
1037
1105
  cleanupInstructions: () => [
1038
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 3, /*returnOffset=*/ 0).as(Opcode.REVERT_8, Revert.wireFormat8),
1106
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 3, /*returnOffset=*/ 0).as(
1107
+ Opcode.REVERT_8,
1108
+ Revert.wireFormat8,
1109
+ ),
1039
1110
  ],
1040
1111
  limit: MAX_NULLIFIERS_PER_TX - 1,
1041
1112
  },
@@ -1049,7 +1120,12 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1049
1120
  { offset: 1, value: randomWithTag(TypeTag.UINT64) }, // random msgLeafIndex
1050
1121
  ],
1051
1122
  targetInstructions: () => [
1052
- new L1ToL2MessageExists(/*indirect=*/ 0, /*msgHashOffset=*/ 0, /*msgLeafIndexOffset=*/ 1, /*existsOffset=*/ 2),
1123
+ new L1ToL2MessageExists(
1124
+ /*addressing_mode=*/ 0,
1125
+ /*msgHashOffset=*/ 0,
1126
+ /*msgLeafIndexOffset=*/ 1,
1127
+ /*existsOffset=*/ 2,
1128
+ ),
1053
1129
  ],
1054
1130
  },
1055
1131
  {
@@ -1060,7 +1136,12 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1060
1136
  { offset: 1, value: new Uint64(WARM_L1_TO_L2_MSG_LEAF_INDEX) }, // known msgLeafIndex
1061
1137
  ],
1062
1138
  targetInstructions: () => [
1063
- new L1ToL2MessageExists(/*indirect=*/ 0, /*msgHashOffset=*/ 0, /*msgLeafIndexOffset=*/ 1, /*existsOffset=*/ 2),
1139
+ new L1ToL2MessageExists(
1140
+ /*addressing_mode=*/ 0,
1141
+ /*msgHashOffset=*/ 0,
1142
+ /*msgLeafIndexOffset=*/ 1,
1143
+ /*existsOffset=*/ 2,
1144
+ ),
1064
1145
  ],
1065
1146
  },
1066
1147
  ],
@@ -1071,7 +1152,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1071
1152
  // This ensures we're querying a valid deployed contract
1072
1153
  setup: [
1073
1154
  () => [
1074
- new GetEnvVar(/*indirect=*/ 0, /*dstOffset=*/ 0, /*varEnum=*/ 0).as(
1155
+ new GetEnvVar(/*addressing_mode=*/ 0, /*dstOffset=*/ 0, /*varEnum=*/ 0).as(
1075
1156
  Opcode.GETENVVAR_16,
1076
1157
  GetEnvVar.wireFormat16,
1077
1158
  ),
@@ -1079,7 +1160,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1079
1160
  ],
1080
1161
  // memberEnum 0 = DEPLOYER
1081
1162
  targetInstructions: () => [
1082
- new GetContractInstance(/*indirect=*/ 0, /*addressOffset=*/ 0, /*dstOffset=*/ 1, /*memberEnum=*/ 0),
1163
+ new GetContractInstance(/*addressing_mode=*/ 0, /*addressOffset=*/ 0, /*dstOffset=*/ 1, /*memberEnum=*/ 0),
1083
1164
  ],
1084
1165
  },
1085
1166
  ],
@@ -1093,9 +1174,12 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1093
1174
  { offset: 0, value: new Field(Fr.random()) }, // random noteHash
1094
1175
  { offset: 1, value: new Uint32(0n) }, // revertSize
1095
1176
  ],
1096
- targetInstructions: () => [new EmitNoteHash(/*indirect=*/ 0, /*noteHashOffset=*/ 0)],
1177
+ targetInstructions: () => [new EmitNoteHash(/*addressing_mode=*/ 0, /*noteHashOffset=*/ 0)],
1097
1178
  cleanupInstructions: () => [
1098
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 1, /*returnOffset=*/ 0).as(Opcode.REVERT_8, Revert.wireFormat8),
1179
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 1, /*returnOffset=*/ 0).as(
1180
+ Opcode.REVERT_8,
1181
+ Revert.wireFormat8,
1182
+ ),
1099
1183
  ], // revert with empty
1100
1184
  limit: MAX_NOTE_HASHES_PER_TX,
1101
1185
  },
@@ -1111,11 +1195,17 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1111
1195
  { offset: 2, value: new Uint32(0n) }, // revertSize
1112
1196
  ],
1113
1197
  targetInstructions: () => [
1114
- new EmitNullifier(/*indirect=*/ 0, /*nullifierOffset=*/ 0),
1115
- new Add(/*indirect=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(Opcode.ADD_8, Add.wireFormat8), // nullifier++
1198
+ new EmitNullifier(/*addressing_mode=*/ 0, /*nullifierOffset=*/ 0),
1199
+ new Add(/*addressing_mode=*/ 0, /*aOffset=*/ 0, /*bOffset=*/ 1, /*dstOffset=*/ 0).as(
1200
+ Opcode.ADD_8,
1201
+ Add.wireFormat8,
1202
+ ), // nullifier++
1116
1203
  ],
1117
1204
  cleanupInstructions: () => [
1118
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 2, /*returnOffset=*/ 0).as(Opcode.REVERT_8, Revert.wireFormat8),
1205
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 2, /*returnOffset=*/ 0).as(
1206
+ Opcode.REVERT_8,
1207
+ Revert.wireFormat8,
1208
+ ),
1119
1209
  ], // revert with empty
1120
1210
  limit: MAX_NULLIFIERS_PER_TX - 1, // minus 1 because a TX will always have 1 "TX nullifier" from private
1121
1211
  },
@@ -1128,9 +1218,14 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1128
1218
  { offset: 1, value: new Field(Fr.random()) }, // random content
1129
1219
  { offset: 2, value: new Uint32(0n) }, // revertSize
1130
1220
  ],
1131
- targetInstructions: () => [new SendL2ToL1Message(/*indirect=*/ 0, /*recipientOffset=*/ 0, /*contentOffset=*/ 1)],
1221
+ targetInstructions: () => [
1222
+ new SendL2ToL1Message(/*addressing_mode=*/ 0, /*recipientOffset=*/ 0, /*contentOffset=*/ 1),
1223
+ ],
1132
1224
  cleanupInstructions: () => [
1133
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 2, /*returnOffset=*/ 0).as(Opcode.REVERT_8, Revert.wireFormat8),
1225
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 2, /*returnOffset=*/ 0).as(
1226
+ Opcode.REVERT_8,
1227
+ Revert.wireFormat8,
1228
+ ),
1134
1229
  ], // revert with empty
1135
1230
  limit: MAX_L2_TO_L1_MSGS_PER_TX,
1136
1231
  },
@@ -1147,9 +1242,12 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1147
1242
  { offset: 1, value: new Field(Fr.random()) }, // random slot (same slot each iteration)
1148
1243
  { offset: 2, value: new Uint32(0n) }, // revertSize
1149
1244
  ],
1150
- targetInstructions: () => [new SStore(/*indirect=*/ 0, /*srcOffset=*/ 0, /*slotOffset=*/ 1)],
1245
+ targetInstructions: () => [new SStore(/*addressing_mode=*/ 0, /*srcOffset=*/ 0, /*slotOffset=*/ 1)],
1151
1246
  cleanupInstructions: () => [
1152
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 2, /*returnOffset=*/ 0).as(Opcode.REVERT_8, Revert.wireFormat8),
1247
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 2, /*returnOffset=*/ 0).as(
1248
+ Opcode.REVERT_8,
1249
+ Revert.wireFormat8,
1250
+ ),
1153
1251
  ], // revert with empty
1154
1252
  },
1155
1253
  {
@@ -1161,11 +1259,17 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1161
1259
  { offset: 3, value: new Uint32(0n) }, // revertSize
1162
1260
  ],
1163
1261
  targetInstructions: () => [
1164
- new SStore(/*indirect=*/ 0, /*srcOffset=*/ 0, /*slotOffset=*/ 1),
1165
- new Add(/*indirect=*/ 0, /*aOffset=*/ 1, /*bOffset=*/ 2, /*dstOffset=*/ 1).as(Opcode.ADD_8, Add.wireFormat8), // slot++
1262
+ new SStore(/*addressing_mode=*/ 0, /*srcOffset=*/ 0, /*slotOffset=*/ 1),
1263
+ new Add(/*addressing_mode=*/ 0, /*aOffset=*/ 1, /*bOffset=*/ 2, /*dstOffset=*/ 1).as(
1264
+ Opcode.ADD_8,
1265
+ Add.wireFormat8,
1266
+ ), // slot++
1166
1267
  ],
1167
1268
  cleanupInstructions: () => [
1168
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 3, /*returnOffset=*/ 0).as(Opcode.REVERT_8, Revert.wireFormat8),
1269
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 3, /*returnOffset=*/ 0).as(
1270
+ Opcode.REVERT_8,
1271
+ Revert.wireFormat8,
1272
+ ),
1169
1273
  ], // revert with empty
1170
1274
  limit: MAX_PUBLIC_DATA_UPDATE_REQUESTS_PER_TX,
1171
1275
  },
@@ -1179,9 +1283,14 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1179
1283
  { offset: 0, value: new Uint32(0n) }, // logSize = 0 fields (minimal)
1180
1284
  { offset: 1, value: new Uint32(0n) }, // revertSize
1181
1285
  ],
1182
- targetInstructions: () => [new EmitUnencryptedLog(/*indirect=*/ 0, /*logSizeOffset=*/ 0, /*logOffset=*/ 1)], // logOffset doesn't matter when size is 0
1286
+ targetInstructions: () => [
1287
+ new EmitUnencryptedLog(/*addressing_mode=*/ 0, /*logSizeOffset=*/ 0, /*logOffset=*/ 1),
1288
+ ], // logOffset doesn't matter when size is 0
1183
1289
  cleanupInstructions: () => [
1184
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 1, /*returnOffset=*/ 0).as(Opcode.REVERT_8, Revert.wireFormat8),
1290
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 1, /*returnOffset=*/ 0).as(
1291
+ Opcode.REVERT_8,
1292
+ Revert.wireFormat8,
1293
+ ),
1185
1294
  ], // revert with empty
1186
1295
  // Max logs with 0-field content: floor(4096 / 2) = 2048
1187
1296
  limit: Math.floor(FLAT_PUBLIC_LOGS_PAYLOAD_LENGTH / PUBLIC_LOG_HEADER_LENGTH),
@@ -1200,9 +1309,14 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1200
1309
  // value: new Field(0n),
1201
1310
  //})),
1202
1311
  ],
1203
- targetInstructions: () => [new EmitUnencryptedLog(/*indirect=*/ 0, /*logSizeOffset=*/ 0, /*logOffset=*/ 2)], // uses logOffset 2 (uninitialized Field(0))
1312
+ targetInstructions: () => [
1313
+ new EmitUnencryptedLog(/*addressing_mode=*/ 0, /*logSizeOffset=*/ 0, /*logOffset=*/ 2),
1314
+ ], // uses logOffset 2 (uninitialized Field(0))
1204
1315
  cleanupInstructions: () => [
1205
- new Revert(/*indirect=*/ 0, /*retSizeOffset=*/ 1, /*returnOffset=*/ 0).as(Opcode.REVERT_8, Revert.wireFormat8),
1316
+ new Revert(/*addressing_mode=*/ 0, /*retSizeOffset=*/ 1, /*returnOffset=*/ 0).as(
1317
+ Opcode.REVERT_8,
1318
+ Revert.wireFormat8,
1319
+ ),
1206
1320
  ], // revert with empty
1207
1321
  limit: 1, // Only 1 max-size log fits
1208
1322
  },
@@ -1219,7 +1333,9 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1219
1333
  value: new Field(Fr.random()), // random field element
1220
1334
  })),
1221
1335
  // Poseidon hash data at M[0..3], write result to M[0:3] (reuse results as next inputs)
1222
- targetInstructions: () => [new Poseidon2(/*indirect=*/ 0, /*inputStateOffset=*/ 0, /*outputStateOffset=*/ 0)],
1336
+ targetInstructions: () => [
1337
+ new Poseidon2(/*addressing_mode=*/ 0, /*inputStateOffset=*/ 0, /*outputStateOffset=*/ 0),
1338
+ ],
1223
1339
  },
1224
1340
  ],
1225
1341
 
@@ -1238,7 +1354,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1238
1354
  })),
1239
1355
  ],
1240
1356
  targetInstructions: () => [
1241
- new Sha256Compression(/*indirect=*/ 0, /*outputOffset=*/ 0, /*stateOffset=*/ 0, /*inputsOffset=*/ 8),
1357
+ new Sha256Compression(/*addressing_mode=*/ 0, /*outputOffset=*/ 0, /*stateOffset=*/ 0, /*inputsOffset=*/ 8),
1242
1358
  ],
1243
1359
  },
1244
1360
  ],
@@ -1250,7 +1366,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1250
1366
  offset: i,
1251
1367
  value: randomWithTag(TypeTag.UINT64),
1252
1368
  })),
1253
- targetInstructions: () => [new KeccakF1600(/*indirect=*/ 0, /*dstOffset=*/ 0, /*inputOffset=*/ 0)],
1369
+ targetInstructions: () => [new KeccakF1600(/*addressing_mode=*/ 0, /*dstOffset=*/ 0, /*inputOffset=*/ 0)],
1254
1370
  },
1255
1371
  ],
1256
1372
 
@@ -1267,7 +1383,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1267
1383
  ],
1268
1384
  targetInstructions: () => [
1269
1385
  new EcAdd(
1270
- /*indirect=*/ 0,
1386
+ /*addressing_mode=*/ 0,
1271
1387
  /*p1XOffset=*/ 0,
1272
1388
  /*p1YOffset=*/ 1,
1273
1389
  /*p1IsInfiniteOffset=*/ 2,
@@ -1292,7 +1408,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1292
1408
  ],
1293
1409
  targetInstructions: () => [
1294
1410
  new ToRadixBE(
1295
- /*indirect=*/ 0,
1411
+ /*addressing_mode=*/ 0,
1296
1412
  /*srcOffset=*/ 0,
1297
1413
  /*radixOffset=*/ 1,
1298
1414
  /*numLimbsOffset=*/ 2,
@@ -1311,7 +1427,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1311
1427
  ],
1312
1428
  targetInstructions: () => [
1313
1429
  new ToRadixBE(
1314
- /*indirect=*/ 0,
1430
+ /*addressing_mode=*/ 0,
1315
1431
  /*srcOffset=*/ 0,
1316
1432
  /*radixOffset=*/ 1,
1317
1433
  /*numLimbsOffset=*/ 2,
@@ -1332,7 +1448,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1332
1448
  ],
1333
1449
  targetInstructions: () => [
1334
1450
  new ToRadixBE(
1335
- /*indirect=*/ 0,
1451
+ /*addressing_mode=*/ 0,
1336
1452
  /*srcOffset=*/ 0,
1337
1453
  /*radixOffset=*/ 1,
1338
1454
  /*numLimbsOffset=*/ 2,
@@ -1359,7 +1475,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1359
1475
  // messageSize = 0
1360
1476
  targetInstructions: () => [
1361
1477
  new DebugLog(
1362
- /*indirect=*/ 0,
1478
+ /*addressing_mode=*/ 0,
1363
1479
  /*levelOffset=*/ 0,
1364
1480
  /*messageOffset=*/ 1,
1365
1481
  /*fieldsOffset=*/ 2,
@@ -1381,7 +1497,7 @@ export const SPAM_CONFIGS: Partial<Record<Opcode, SpamConfig[]>> = {
1381
1497
  // // messageSize = 1000 (large enough to show scaling)
1382
1498
  // targetInstructions: () => [
1383
1499
  // new DebugLog(
1384
- // /*indirect=*/ 0,
1500
+ // /*addressing_mode=*/ 0,
1385
1501
  // /*levelOffset=*/ 0,
1386
1502
  // /*messageOffset=*/ 1,
1387
1503
  // /*fieldsOffset=*/ 2,