From ef51e1cfb9a9ad3f22357ffd0ac95b03c6449581 Mon Sep 17 00:00:00 2001 From: Hsiao-Wei Wang Date: Tue, 28 Sep 2021 01:00:56 +0800 Subject: [PATCH] Change mainnet `TERMINAL_TOTAL_DIFFICULTY` placeholder to `2**256-2**10` to avoid overflow --- configs/mainnet.yaml | 4 ++-- .../eth2spec/test/merge/fork_choice/test_on_merge_block.py | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index 6f2f582fa..7609908b4 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -5,8 +5,8 @@ PRESET_BASE: 'mainnet' # Transition # --------------------------------------------------------------- -# TBD, 2**256-1 is a placeholder -TERMINAL_TOTAL_DIFFICULTY: 115792089237316195423570985008687907853269984665640564039457584007913129639935 +# TBD, 2**256-2**10 is a placeholder +TERMINAL_TOTAL_DIFFICULTY: 115792089237316195423570985008687907853269984665640564039457584007913129638912 # Genesis diff --git a/tests/core/pyspec/eth2spec/test/merge/fork_choice/test_on_merge_block.py b/tests/core/pyspec/eth2spec/test/merge/fork_choice/test_on_merge_block.py index fd141ce8d..830f20f23 100644 --- a/tests/core/pyspec/eth2spec/test/merge/fork_choice/test_on_merge_block.py +++ b/tests/core/pyspec/eth2spec/test/merge/fork_choice/test_on_merge_block.py @@ -1,6 +1,6 @@ from eth2spec.utils.ssz.ssz_typing import uint256 from eth2spec.test.exceptions import BlockNotFoundException -from eth2spec.test.context import spec_state_test, with_phases, with_presets, MERGE, MINIMAL +from eth2spec.test.context import spec_state_test, with_phases, MERGE from eth2spec.test.helpers.block import ( build_empty_block_for_next_slot, ) @@ -46,7 +46,6 @@ def with_pow_block_patch(spec, blocks, func): @with_phases([MERGE]) -@with_presets([MINIMAL], reason="mainnet `TERMINAL_TOTAL_DIFFICULTY` stub would cause overflow") @spec_state_test def test_all_valid(spec, state): test_steps = [] @@ -81,7 +80,6 @@ def test_all_valid(spec, state): @with_phases([MERGE]) -@with_presets([MINIMAL], reason="mainnet `TERMINAL_TOTAL_DIFFICULTY` stub would cause overflow") @spec_state_test def test_block_lookup_failed(spec, state): test_steps = [] @@ -112,7 +110,6 @@ def test_block_lookup_failed(spec, state): @with_phases([MERGE]) -@with_presets([MINIMAL], reason="mainnet `TERMINAL_TOTAL_DIFFICULTY` stub would cause overflow") @spec_state_test def test_too_early_for_merge(spec, state): test_steps = [] @@ -145,7 +142,6 @@ def test_too_early_for_merge(spec, state): @with_phases([MERGE]) -@with_presets([MINIMAL], reason="mainnet `TERMINAL_TOTAL_DIFFICULTY` stub would cause overflow") @spec_state_test def test_too_late_for_merge(spec, state): test_steps = []