EVM Node: Fix timing advertized by the `blueprint_applied` event
The timing advertized was limited to the function modifying the
session_state, and excluding the actual application of the blueprint and
commit to the on-disk stores.
This patch addresses this by introducing a new helper with_timing_f_e, where
f stands for function (i.e., the continution called by the helper also
takes the result of the computation), and e stands for error (i.e., the
computation is in the error monad, not Lwt).
Manually testing the MR
Run an observer with and without this patch. I go from
Dec 10 13:51:41.541: Applied a blueprint for level 4172872 at 2024-11-07T20:49:05Z containing 1
Dec 10 13:51:41.541: transactions for 4547719 gas leading to creating block
Dec 10 13:51:41.541: 0xd9ba4f59918b1f81cefdfd29a8e764782dda0e23b20108a2671782368[...] in
Dec 10 13:51:41.541: 1.224us.
to something like
Dec 10 13:53:09.861: Applied a blueprint for level 4172901 at 2024-11-07T20:50:53Z containing 1
Dec 10 13:53:09.861: transactions for 4547661 gas leading to creating block
Dec 10 13:53:09.861: 0xf2e38ae160838c6b94fc8811cbe5487bf883684712e4e32cf791e4c21[...] in
Dec 10 13:53:09.861: 23.589ms.
The latter makes more sense.
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.rstfor the protocol and the environment,CHANGES.rstat the root of the repository for everything else). -
Select suitable reviewers using the Reviewersfield below. -
Select as Assigneethe next person who should take action on that MR
Edited by Thomas Letan