From a630db37959bfffc45503cebacb6216a48f56bc9 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Mon, 6 May 2024 14:56:52 +0200 Subject: [PATCH 1/4] lib_shell: reduce max_timestamp_drift value --- src/lib_shell/clock_drift.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib_shell/clock_drift.ml b/src/lib_shell/clock_drift.ml index 7acbe557e6bf..5c67fd95ef8f 100644 --- a/src/lib_shell/clock_drift.ml +++ b/src/lib_shell/clock_drift.ml @@ -22,7 +22,7 @@ (* *) (*****************************************************************************) -let max_timestamp_drift : Ptime.span = Ptime.Span.of_int_s 5 +let max_timestamp_drift : Ptime.span = Ptime.Span.of_int_s 1 let soon : unit -> Time.Protocol.t = fun () -> -- GitLab From 7028a040eccbb0750094a7f85f52ca9005d90499 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 7 May 2024 10:56:42 +0200 Subject: [PATCH 2/4] tezt/tests: update forge_block with new drift value --- tezt/tests/forge_block.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tezt/tests/forge_block.ml b/tezt/tests/forge_block.ml index 47944b7465ce..3aaf62d46b18 100644 --- a/tezt/tests/forge_block.ml +++ b/tezt/tests/forge_block.ml @@ -58,7 +58,7 @@ let test_forge_block () : unit = Log.info "Test activate proto demo time shifted ok" ; let parameter_file = Temp.file (protocol_hash ^ "-parameters.json") in Base.write_file parameter_file ~contents:"{}" ; - let delta = Ptime.Span.of_int_s (-5) in + let delta = Ptime.Span.of_int_s (-1) in let* () = Client.activate_protocol_and_wait ~parameter_file -- GitLab From a1e84a06763de8c8d38d98dd095de5c4c19a7f16 Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 7 May 2024 15:14:44 +0200 Subject: [PATCH 3/4] changes: add entry for new timestamp drift value --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index f18ae9ea9c22..eb95f3a10ab1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -40,6 +40,9 @@ Node that returns the consumed output's indexes for the given outbox level. (MR :gl:`!12776`) +- Reduced the maximum allowed timestamp drift to 1 seconds. It is recommended to + use NTP to sync the clock of the node. (MR :gl:`!13198`) + Client ------ -- GitLab From ff09425d3342e65d05088ef991dc76df3197d24b Mon Sep 17 00:00:00 2001 From: Albin Coquereau Date: Tue, 7 May 2024 15:24:21 +0200 Subject: [PATCH 4/4] docs: add a note in the howtouse page to advertise the use of NTP --- docs/introduction/howtouse.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/introduction/howtouse.rst b/docs/introduction/howtouse.rst index bd311c7bf673..05567e32ebbf 100644 --- a/docs/introduction/howtouse.rst +++ b/docs/introduction/howtouse.rst @@ -124,6 +124,14 @@ concurrently and selects the best one based on its fitness (see process. Thus, an ``octez-validator`` process can appear while monitoring the active processes of the machine. +.. warning:: + + To ensure the best conditions to run a node, we recommend users to use `NTP + `__ to avoid clock + drift. Clock drift may result in not being able to get recent blocks in case + of negative lag time, and in not being able to inject new blocks in case of + positive lag time. + Node Identity ~~~~~~~~~~~~~ -- GitLab