From eea32cc908df18256b994a01aeeac4548da28ea8 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Mon, 25 Jan 2021 14:32:20 +0100 Subject: [PATCH 1/3] 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 744953f0d0c5..ba40f08ea8a0 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 15 +let max_timestamp_drift : Ptime.span = Ptime.Span.of_int_s 5 let soon : unit -> Time.Protocol.t = fun () -> -- GitLab From ca4dc17b5544848730a404f5e852be9e4f849490 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Tue, 2 Feb 2021 15:31:01 +0100 Subject: [PATCH 2/3] lib_shell: do not use hard-coded value in doc string --- src/lib_shell/bootstrap_pipeline.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib_shell/bootstrap_pipeline.ml b/src/lib_shell/bootstrap_pipeline.ml index eb9c8ff4f82c..3694c3bd0d84 100644 --- a/src/lib_shell/bootstrap_pipeline.ml +++ b/src/lib_shell/bootstrap_pipeline.ml @@ -143,8 +143,8 @@ type t = { (** A block is NOT acceptable if one of the following holds: - - The timestamp of the block is more than 15 seconds ahead in the - future. + - The timestamp of the block is more than s seconds in the + future, where s is specified by the module Clock_drift. - The block is at the same level as the checkpoint, but they are different. -- GitLab From 5ee30ff290c73e63eed0d141b52228fcd2b9e110 Mon Sep 17 00:00:00 2001 From: Eugen Zalinescu Date: Sat, 6 Feb 2021 18:14:23 +0100 Subject: [PATCH 3/3] Tests/Python: update forge in the future test --- tests_python/tests_008/test_forge_block.py | 4 ++-- tests_python/tests_009/test_forge_block.py | 4 ++-- tests_python/tests_alpha/test_forge_block.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests_python/tests_008/test_forge_block.py b/tests_python/tests_008/test_forge_block.py index 1aa64a36b477..babcdeb1d04c 100755 --- a/tests_python/tests_008/test_forge_block.py +++ b/tests_python/tests_008/test_forge_block.py @@ -9,7 +9,7 @@ PROTO_DEMO = 'ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp' @pytest.mark.slow @pytest.mark.incremental class TestForgeBlock: - """ Check that a block more than 15 seconds in the future is rejected """ + """ Check that a block more than 5 seconds in the future is rejected """ def test_setup_network(self, sandbox: Sandbox): sandbox.add_node(1, params=constants.NODE_PARAMS) @@ -21,7 +21,7 @@ class TestForgeBlock: def test_activate_proto_demo_time_shifted_ok(self, sandbox: Sandbox): parameters = {} # type: dict - delta = datetime.timedelta(seconds=10) + delta = datetime.timedelta(seconds=5) sandbox.client(1).activate_protocol_json( PROTO_DEMO, parameters, diff --git a/tests_python/tests_009/test_forge_block.py b/tests_python/tests_009/test_forge_block.py index 1aa64a36b477..babcdeb1d04c 100755 --- a/tests_python/tests_009/test_forge_block.py +++ b/tests_python/tests_009/test_forge_block.py @@ -9,7 +9,7 @@ PROTO_DEMO = 'ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp' @pytest.mark.slow @pytest.mark.incremental class TestForgeBlock: - """ Check that a block more than 15 seconds in the future is rejected """ + """ Check that a block more than 5 seconds in the future is rejected """ def test_setup_network(self, sandbox: Sandbox): sandbox.add_node(1, params=constants.NODE_PARAMS) @@ -21,7 +21,7 @@ class TestForgeBlock: def test_activate_proto_demo_time_shifted_ok(self, sandbox: Sandbox): parameters = {} # type: dict - delta = datetime.timedelta(seconds=10) + delta = datetime.timedelta(seconds=5) sandbox.client(1).activate_protocol_json( PROTO_DEMO, parameters, diff --git a/tests_python/tests_alpha/test_forge_block.py b/tests_python/tests_alpha/test_forge_block.py index 1aa64a36b477..babcdeb1d04c 100755 --- a/tests_python/tests_alpha/test_forge_block.py +++ b/tests_python/tests_alpha/test_forge_block.py @@ -9,7 +9,7 @@ PROTO_DEMO = 'ProtoDemoNoopsDemoNoopsDemoNoopsDemoNoopsDemo6XBoYp' @pytest.mark.slow @pytest.mark.incremental class TestForgeBlock: - """ Check that a block more than 15 seconds in the future is rejected """ + """ Check that a block more than 5 seconds in the future is rejected """ def test_setup_network(self, sandbox: Sandbox): sandbox.add_node(1, params=constants.NODE_PARAMS) @@ -21,7 +21,7 @@ class TestForgeBlock: def test_activate_proto_demo_time_shifted_ok(self, sandbox: Sandbox): parameters = {} # type: dict - delta = datetime.timedelta(seconds=10) + delta = datetime.timedelta(seconds=5) sandbox.client(1).activate_protocol_json( PROTO_DEMO, parameters, -- GitLab