[go: up one dir, main page]

SCORU/Injector/Alpha: make L1 batches below the block gas limit

Context

The simulation fails when a batch is above the block gas limit. With SCORU and TORU nodes it can happen that we may want to inject large L1 batches of operations (e.g., for missing commitments, messages in inboxes, etc.). This MR makes sure that the L1 batch that we build remains below the block gas limit.

Testing Manually

Apply this patch:

diff --git a/src/proto_alpha/lib_client/injection.ml b/src/proto_alpha/lib_client/injection.ml
index 6e982c8c9a..a7520fa555 100644
--- a/src/proto_alpha/lib_client/injection.ml
+++ b/src/proto_alpha/lib_client/injection.ml
@@ -614,7 +614,7 @@ let detect_script_failure : type kind. kind operation_metadata -> _ =
   fun {contents} -> detect_script_failure contents
 
 (* This value is used as a safety guard for gas limit. *)
-let safety_guard = Gas.Arith.(integral_of_int_exn 100)
+let safety_guard = Gas.Arith.(integral_of_int_exn 100000)
 
 (*
 
diff --git a/tezt/tests/sc_rollup.ml b/tezt/tests/sc_rollup.ml
index 13e8a64ff4..0c17b45e86 100644
--- a/tezt/tests/sc_rollup.ml
+++ b/tezt/tests/sc_rollup.ml
@@ -2773,6 +2773,7 @@ let test_late_rollup_node =
       variant = "late";
       description = "a late rollup should catch up";
     }
+    ~commitment_period:1
   @@ fun _protocol sc_rollup_node _sc_rollup_address _node client ->
   let* () = bake_levels 65 client in
   let* () = Sc_rollup_node.run sc_rollup_node in

and run the test:

dune exec tezt/tests/main.exe -- --verbose -f sc_rollup.ml late arith -v

Finally, verify that the injector does not report any error.

Edited by Alain Mebsout

Merge request reports

Loading