[go: up one dir, main page]

Baker: emit events on too long signature and block forge

What

Similar to RPCs in !19985 (merged) applies the same logic to signature of block header and block forge.

Why

We want details in case a baker misses its rounds. It doesn't cost much to wrap with a timeout that emit events.

Manually testing the MR

You could setup a baker with a remote signer and emulate some delays. Alternatively you can change artificially the duration:

diff --git a/src/proto_alpha/lib_delegate/baking_actions.ml b/src/proto_alpha/lib_delegate/baking_actions.ml
index 4f772a6792e..f5a6b6dceff 100644
--- a/src/proto_alpha/lib_delegate/baking_actions.ml
+++ b/src/proto_alpha/lib_delegate/baking_actions.ml
@@ -435,8 +435,9 @@ let prepare_block (global_state : global_state) (block_to_bake : block_to_bake)
        () [@profiler.record_s {verbosity = Info} "live blocks"])
   in
   let round_duration =
-    Round.round_duration global_state.round_durations round
-    |> Period.to_seconds |> Int64.to_float
+    0.001
+    (* Round.round_duration global_state.round_durations round *)
+    (* |> Period.to_seconds |> Int64.to_float *)
   in
   let* {unsigned_block_header; operations; manager_operations_infos} =
     Utils.event_on_stalling_promise

and run some tezt tests in verbose, such as

tezt --title 'Protocol migration from protocol t024 to protocol alpha with agnostic baker using HTTP remote signer' --verbose

Checklist

  • Document the interface of any function added or modified (see the coding guidelines)
  • Document any change to the user interface, including configuration parameters (see node configuration)
  • Provide automatic testing (see the testing guide).
  • For new features and bug fixes, add an item in the appropriate changelog (docs/protocols/alpha.rst for the protocol and the environment, CHANGES.rst at the root of the repository for everything else).
  • Select suitable reviewers using the Reviewers field below.
  • Select as Assignee the next person who should take action on that MR

Merge request reports

Loading