baking_lib: sleep until forged block timestamp before injection
What
In the baking_lib
, with the option --minimal-timestamp
, blocks are injected as soon as possible.
In sandboxed block have a block delay of 1s. Using bake for --minimal-timestamp
could lead to block injected in the future.
This MR force the block to be injected after their timestamp is reached.
This MR fixes #7185
Why
How
Manually testing the MR
Run a sandboxed node and client on master
, activate_alpha
, and then bake blocks with --minimal-timestamp
with:
while true; do octez-client bake for --minimal-timestamp; done
After some blocks, a block will be produce with a timestamp more than 5s in the future and the node validator will reject it with Block in the future
error.
Try the same commands with this branch and check that the bake for command can run indefinitely.
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
Edited by Albin Coquereau