From bdcc2d674bc3c1557c7d14ed3495bd13452fc76f Mon Sep 17 00:00:00 2001 From: Gabriel Levcovitz Date: Wed, 7 Jun 2023 20:20:12 -0300 Subject: [PATCH] chore(events): move event queue option to unsafe args --- hathor/builder/cli_builder.py | 4 ---- hathor/cli/run_node.py | 1 + hathor/conf/settings.py | 2 -- hathor/conf/unittests.py | 1 - hathor/conf/unittests.yml | 1 - .../others/fixtures/invalid_byte_hathor_settings_fixture.yml | 1 - .../fixtures/invalid_features_hathor_settings_fixture.yml | 1 - tests/others/fixtures/missing_hathor_settings_fixture.yml | 1 - tests/others/fixtures/valid_hathor_settings_fixture.yml | 1 - tests/others/test_hathor_settings.py | 1 - 10 files changed, 1 insertion(+), 13 deletions(-) diff --git a/hathor/builder/cli_builder.py b/hathor/builder/cli_builder.py index 7bae0c888..52cd8cbff 100644 --- a/hathor/builder/cli_builder.py +++ b/hathor/builder/cli_builder.py @@ -170,10 +170,6 @@ def create_manager(self, reactor: PosixReactorBase, args: Namespace) -> HathorMa consensus_algorithm = ConsensusAlgorithm(soft_voided_tx_ids, pubsub=pubsub) if args.x_enable_event_queue: - if not settings.ENABLE_EVENT_QUEUE_FEATURE: - self.log.error('The event queue feature is not available yet') - sys.exit(-1) - self.log.info('--x-enable-event-queue flag provided. ' 'The events detected by the full node will be stored and can be retrieved by clients') diff --git a/hathor/cli/run_node.py b/hathor/cli/run_node.py index 51a2692da..30a3567e6 100644 --- a/hathor/cli/run_node.py +++ b/hathor/cli/run_node.py @@ -33,6 +33,7 @@ class RunNode: ('--enable-crash-api', lambda args: bool(args.enable_crash_api)), ('--x-sync-bridge', lambda args: bool(args.x_sync_bridge)), ('--x-sync-v2-only', lambda args: bool(args.x_sync_v2_only)), + ('--x-enable-event-queue', lambda args: bool(args.x_enable_event_queue)) ] @classmethod diff --git a/hathor/conf/settings.py b/hathor/conf/settings.py index fb55819fb..62deef54d 100644 --- a/hathor/conf/settings.py +++ b/hathor/conf/settings.py @@ -377,8 +377,6 @@ def MAXIMUM_NUMBER_OF_HALVINGS(self) -> int: # Identifier used in metadata's voided_by to mark a tx as partially validated. PARTIALLY_VALIDATED_ID: bytes = b'pending-validation' - ENABLE_EVENT_QUEUE_FEATURE: bool = False - EVENT_API_DEFAULT_BATCH_SIZE: int = 100 EVENT_API_MAX_BATCH_SIZE: int = 1000 diff --git a/hathor/conf/unittests.py b/hathor/conf/unittests.py index 862ea7a23..df85ae851 100644 --- a/hathor/conf/unittests.py +++ b/hathor/conf/unittests.py @@ -33,6 +33,5 @@ GENESIS_TX2_HASH=bytes.fromhex('33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869'), REWARD_SPEND_MIN_BLOCKS=10, SLOW_ASSERTS=True, - ENABLE_EVENT_QUEUE_FEATURE=True, MAX_TX_WEIGHT_DIFF_ACTIVATION=0.0, ) diff --git a/hathor/conf/unittests.yml b/hathor/conf/unittests.yml index 94328344f..a2cf9dcd5 100644 --- a/hathor/conf/unittests.yml +++ b/hathor/conf/unittests.yml @@ -16,5 +16,4 @@ GENESIS_TX2_NONCE: 2 GENESIS_TX2_HASH: 33e14cb555a96967841dcbe0f95e9eab5810481d01de8f4f73afb8cce365e869 REWARD_SPEND_MIN_BLOCKS: 10 SLOW_ASSERTS: true -ENABLE_EVENT_QUEUE_FEATURE: true MAX_TX_WEIGHT_DIFF_ACTIVATION: 0.0 diff --git a/tests/others/fixtures/invalid_byte_hathor_settings_fixture.yml b/tests/others/fixtures/invalid_byte_hathor_settings_fixture.yml index 515a11690..a425f1cdd 100644 --- a/tests/others/fixtures/invalid_byte_hathor_settings_fixture.yml +++ b/tests/others/fixtures/invalid_byte_hathor_settings_fixture.yml @@ -27,7 +27,6 @@ BLOCK_DIFFICULTY_N_BLOCKS: 20 REWARD_SPEND_MIN_BLOCKS: 10 SLOW_ASSERTS: true -ENABLE_EVENT_QUEUE_FEATURE: true MAX_TX_WEIGHT_DIFF_ACTIVATION: 0.0 CHECKPOINTS: diff --git a/tests/others/fixtures/invalid_features_hathor_settings_fixture.yml b/tests/others/fixtures/invalid_features_hathor_settings_fixture.yml index 4835ae207..4d69c84e6 100644 --- a/tests/others/fixtures/invalid_features_hathor_settings_fixture.yml +++ b/tests/others/fixtures/invalid_features_hathor_settings_fixture.yml @@ -27,7 +27,6 @@ BLOCK_DIFFICULTY_N_BLOCKS: 20 REWARD_SPEND_MIN_BLOCKS: 10 SLOW_ASSERTS: true -ENABLE_EVENT_QUEUE_FEATURE: true MAX_TX_WEIGHT_DIFF_ACTIVATION: 0.0 CHECKPOINTS: diff --git a/tests/others/fixtures/missing_hathor_settings_fixture.yml b/tests/others/fixtures/missing_hathor_settings_fixture.yml index 78ee76f16..f03053bc9 100644 --- a/tests/others/fixtures/missing_hathor_settings_fixture.yml +++ b/tests/others/fixtures/missing_hathor_settings_fixture.yml @@ -26,7 +26,6 @@ BLOCK_DIFFICULTY_N_BLOCKS: 20 REWARD_SPEND_MIN_BLOCKS: 10 SLOW_ASSERTS: true -ENABLE_EVENT_QUEUE_FEATURE: true MAX_TX_WEIGHT_DIFF_ACTIVATION: 0.0 CHECKPOINTS: diff --git a/tests/others/fixtures/valid_hathor_settings_fixture.yml b/tests/others/fixtures/valid_hathor_settings_fixture.yml index 81eb5cf3c..a1c8a847a 100644 --- a/tests/others/fixtures/valid_hathor_settings_fixture.yml +++ b/tests/others/fixtures/valid_hathor_settings_fixture.yml @@ -27,7 +27,6 @@ BLOCK_DIFFICULTY_N_BLOCKS: 20 REWARD_SPEND_MIN_BLOCKS: 10 SLOW_ASSERTS: true -ENABLE_EVENT_QUEUE_FEATURE: true MAX_TX_WEIGHT_DIFF_ACTIVATION: 0.0 CHECKPOINTS: diff --git a/tests/others/test_hathor_settings.py b/tests/others/test_hathor_settings.py index 135effdee..46c305db1 100644 --- a/tests/others/test_hathor_settings.py +++ b/tests/others/test_hathor_settings.py @@ -58,7 +58,6 @@ def test_valid_hathor_settings_from_yaml(filepath): ], REWARD_SPEND_MIN_BLOCKS=10, SLOW_ASSERTS=True, - ENABLE_EVENT_QUEUE_FEATURE=True, MAX_TX_WEIGHT_DIFF_ACTIVATION=0.0, BLOCKS_PER_HALVING=120, MIN_BLOCK_WEIGHT=2,