From c51423d204e40247a765624e46f1556a388958ac 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 52b79fa5c676c057516bc9a22cf558a937b0a00c 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 2708e329097c..72f2181395b4 100644 --- a/tezt/tests/forge_block.ml +++ b/tezt/tests/forge_block.ml @@ -57,7 +57,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 08dbfcb1b38b482144e91188aea154f5389b2444 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 a514658860b7..8f200be46211 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -87,6 +87,9 @@ Node an ``unlimited`` option to remove the threshold of RPC connections. (MR :gl:`!12324`) +- 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 503fac647afb01595992bfd8277f5cfdb5010025 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 372bcaa47184..cd1260970c12 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