From 898914144610ebc8c32e4b1285b296f307e1b800 Mon Sep 17 00:00:00 2001 From: Kim De Mey Date: Mon, 13 Mar 2023 21:30:57 +0100 Subject: [PATCH] Renames on Portal beacon LC code (#1496) --- fluffy/fluffy.nim | 7 ++----- .../network/beacon_light_client/beacon_light_client.nim | 8 +++++--- ...client_content.nim => beacon_light_client_content.nim} | 0 .../{light_client_db.nim => beacon_light_client_db.nim} | 2 +- ...nit_loader.nim => beacon_light_client_init_loader.nim} | 0 .../beacon_light_client/beacon_light_client_manager.nim | 4 ++-- ...client_network.nim => beacon_light_client_network.nim} | 6 ++++-- .../all_beacon_light_client_tests.nim | 6 +++--- ...t_helpers.nim => beacon_light_client_test_helpers.nim} | 3 +-- .../test_beacon_light_client.nim | 4 ++-- ...t_content.nim => test_beacon_light_client_content.nim} | 4 ++-- ...t_network.nim => test_beacon_light_client_network.nim} | 4 ++-- 12 files changed, 24 insertions(+), 24 deletions(-) rename fluffy/network/beacon_light_client/{light_client_content.nim => beacon_light_client_content.nim} (100%) rename fluffy/network/beacon_light_client/{light_client_db.nim => beacon_light_client_db.nim} (99%) rename fluffy/network/beacon_light_client/{light_client_init_loader.nim => beacon_light_client_init_loader.nim} (100%) rename fluffy/network/beacon_light_client/{light_client_network.nim => beacon_light_client_network.nim} (98%) rename fluffy/tests/beacon_light_client_tests/{light_client_test_helpers.nim => beacon_light_client_test_helpers.nim} (97%) rename fluffy/tests/beacon_light_client_tests/{test_light_client_content.nim => test_beacon_light_client_content.nim} (96%) rename fluffy/tests/beacon_light_client_tests/{test_light_client_network.nim => test_beacon_light_client_network.nim} (98%) diff --git a/fluffy/fluffy.nim b/fluffy/fluffy.nim index 119517d60..8bb89ef64 100644 --- a/fluffy/fluffy.nim +++ b/fluffy/fluffy.nim @@ -24,11 +24,8 @@ import ./network/state/[state_network, state_content], ./network/history/[history_network, history_content], ./network/beacon_light_client/[ - light_client_init_loader, - light_client_content, + beacon_light_client_init_loader, beacon_light_client, - light_client_db, - light_client_network ], ./network/wire/[portal_stream, portal_protocol_config], ./eth_data/history_data_ssz_e2s, @@ -49,7 +46,7 @@ proc initializeBridgeClient(maybeUri: Option[string]): Option[BridgeClient] = notice "Failed to initialize bridge client", error = err.msg return none(BridgeClient) -proc run(config: PortalConf) {.raises: [CatchableError, Defect].} = +proc run(config: PortalConf) {.raises: [CatchableError].} = # Make sure dataDir exists let pathExists = createPath(config.dataDir.string) if pathExists.isErr(): diff --git a/fluffy/network/beacon_light_client/beacon_light_client.nim b/fluffy/network/beacon_light_client/beacon_light_client.nim index 93002d6dc..068508b20 100644 --- a/fluffy/network/beacon_light_client/beacon_light_client.nim +++ b/fluffy/network/beacon_light_client/beacon_light_client.nim @@ -13,11 +13,13 @@ import beacon_chain/gossip_processing/light_client_processor, beacon_chain/spec/datatypes/altair, beacon_chain/beacon_clock, - "."/[light_client_network, beacon_light_client_manager] + "."/[beacon_light_client_network, beacon_light_client_manager] -export LightClientFinalizationMode +export + LightClientFinalizationMode, + beacon_light_client_network, beacon_light_client_manager -logScope: topics = "lightcl" +logScope: topics = "portal_beacon_lc" type LightClientHeaderCallback* = diff --git a/fluffy/network/beacon_light_client/light_client_content.nim b/fluffy/network/beacon_light_client/beacon_light_client_content.nim similarity index 100% rename from fluffy/network/beacon_light_client/light_client_content.nim rename to fluffy/network/beacon_light_client/beacon_light_client_content.nim diff --git a/fluffy/network/beacon_light_client/light_client_db.nim b/fluffy/network/beacon_light_client/beacon_light_client_db.nim similarity index 99% rename from fluffy/network/beacon_light_client/light_client_db.nim rename to fluffy/network/beacon_light_client/beacon_light_client_db.nim index 732226cd3..750249cee 100644 --- a/fluffy/network/beacon_light_client/light_client_db.nim +++ b/fluffy/network/beacon_light_client/beacon_light_client_db.nim @@ -16,7 +16,7 @@ import stint, stew/[results, byteutils], ssz_serialization, - ./light_client_content, + ./beacon_light_client_content, ../wire/portal_protocol export kvstore_sqlite3 diff --git a/fluffy/network/beacon_light_client/light_client_init_loader.nim b/fluffy/network/beacon_light_client/beacon_light_client_init_loader.nim similarity index 100% rename from fluffy/network/beacon_light_client/light_client_init_loader.nim rename to fluffy/network/beacon_light_client/beacon_light_client_init_loader.nim diff --git a/fluffy/network/beacon_light_client/beacon_light_client_manager.nim b/fluffy/network/beacon_light_client/beacon_light_client_manager.nim index 9453febd8..09323748f 100644 --- a/fluffy/network/beacon_light_client/beacon_light_client_manager.nim +++ b/fluffy/network/beacon_light_client/beacon_light_client_manager.nim @@ -14,12 +14,12 @@ import beacon_chain/spec/datatypes/[phase0, altair, bellatrix, capella, deneb], beacon_chain/spec/[forks_light_client, digest], beacon_chain/beacon_clock, - "."/[light_client_network, light_client_content] + "."/[beacon_light_client_network, beacon_light_client_content] from beacon_chain/consensus_object_pools/block_pools_types import VerifierError logScope: - topics = "lcman" + topics = "beacon_lc_man" type Nothing = object diff --git a/fluffy/network/beacon_light_client/light_client_network.nim b/fluffy/network/beacon_light_client/beacon_light_client_network.nim similarity index 98% rename from fluffy/network/beacon_light_client/light_client_network.nim rename to fluffy/network/beacon_light_client/beacon_light_client_network.nim index 618e9b515..03a18c0a7 100644 --- a/fluffy/network/beacon_light_client/light_client_network.nim +++ b/fluffy/network/beacon_light_client/beacon_light_client_network.nim @@ -15,10 +15,12 @@ import beacon_chain/spec/datatypes/[phase0, altair, bellatrix], ../../../nimbus/constants, ../wire/[portal_protocol, portal_stream, portal_protocol_config], - "."/[light_client_content, light_client_db] + "."/[beacon_light_client_content, beacon_light_client_db] + +export beacon_light_client_content, beacon_light_client_db logScope: - topics = "portal_lc" + topics = "portal_beacon_lc" const lightClientProtocolId* = [byte 0x50, 0x1A] diff --git a/fluffy/tests/beacon_light_client_tests/all_beacon_light_client_tests.nim b/fluffy/tests/beacon_light_client_tests/all_beacon_light_client_tests.nim index 532b68364..47a0dc62e 100644 --- a/fluffy/tests/beacon_light_client_tests/all_beacon_light_client_tests.nim +++ b/fluffy/tests/beacon_light_client_tests/all_beacon_light_client_tests.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2022 Status Research & Development GmbH +# Copyright (c) 2022-2023 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) # * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) @@ -8,6 +8,6 @@ {. warning[UnusedImport]:off .} import - ./test_light_client_content, - ./test_light_client_network, + ./test_beacon_light_client_content, + ./test_beacon_light_client_network, ./test_beacon_light_client diff --git a/fluffy/tests/beacon_light_client_tests/light_client_test_helpers.nim b/fluffy/tests/beacon_light_client_tests/beacon_light_client_test_helpers.nim similarity index 97% rename from fluffy/tests/beacon_light_client_tests/light_client_test_helpers.nim rename to fluffy/tests/beacon_light_client_tests/beacon_light_client_test_helpers.nim index a2051d1d1..413da0e7e 100644 --- a/fluffy/tests/beacon_light_client_tests/light_client_test_helpers.nim +++ b/fluffy/tests/beacon_light_client_tests/beacon_light_client_test_helpers.nim @@ -11,8 +11,7 @@ import beacon_chain/spec/forks, ../../network/wire/[portal_protocol, portal_stream], ../../network/beacon_light_client/[ - light_client_network, - light_client_db + beacon_light_client_network ], ../test_helpers diff --git a/fluffy/tests/beacon_light_client_tests/test_beacon_light_client.nim b/fluffy/tests/beacon_light_client_tests/test_beacon_light_client.nim index 33f2fa702..9ea57c7c1 100644 --- a/fluffy/tests/beacon_light_client_tests/test_beacon_light_client.nim +++ b/fluffy/tests/beacon_light_client_tests/test_beacon_light_client.nim @@ -16,8 +16,8 @@ import beacon_chain/beacon_clock, beacon_chain/conf, ../../network/wire/[portal_protocol, portal_stream], - ../../network/beacon_light_client/[light_client_content, beacon_light_client], - "."/[light_client_test_data, light_client_test_helpers] + ../../network/beacon_light_client/beacon_light_client, + "."/[light_client_test_data, beacon_light_client_test_helpers] procSuite "Portal Beacon Light Client": let rng = newRng() diff --git a/fluffy/tests/beacon_light_client_tests/test_light_client_content.nim b/fluffy/tests/beacon_light_client_tests/test_beacon_light_client_content.nim similarity index 96% rename from fluffy/tests/beacon_light_client_tests/test_light_client_content.nim rename to fluffy/tests/beacon_light_client_tests/test_beacon_light_client_content.nim index b3ed120fd..71d92a973 100644 --- a/fluffy/tests/beacon_light_client_tests/test_light_client_content.nim +++ b/fluffy/tests/beacon_light_client_tests/test_beacon_light_client_content.nim @@ -11,8 +11,8 @@ import unittest2, beacon_chain/spec/forks, beacon_chain/spec/datatypes/altair, - ../../network/beacon_light_client/light_client_content, - "."/[light_client_test_data, light_client_test_helpers] + ../../network/beacon_light_client/beacon_light_client_content, + "."/[light_client_test_data, beacon_light_client_test_helpers] suite "Beacon Light Client Content Encodings": let forkDigests = testForkDigests diff --git a/fluffy/tests/beacon_light_client_tests/test_light_client_network.nim b/fluffy/tests/beacon_light_client_tests/test_beacon_light_client_network.nim similarity index 98% rename from fluffy/tests/beacon_light_client_tests/test_light_client_network.nim rename to fluffy/tests/beacon_light_client_tests/test_beacon_light_client_network.nim index 6fc966dc7..24ddacd25 100644 --- a/fluffy/tests/beacon_light_client_tests/test_light_client_network.nim +++ b/fluffy/tests/beacon_light_client_tests/test_beacon_light_client_network.nim @@ -11,8 +11,8 @@ import beacon_chain/spec/forks, beacon_chain/spec/datatypes/altair, ../../network/wire/portal_protocol, - ../../network/beacon_light_client/[light_client_network, light_client_content], - "."/[light_client_test_data, light_client_test_helpers] + ../../network/beacon_light_client/beacon_light_client_network, + "."/[light_client_test_data, beacon_light_client_test_helpers] procSuite "Beacon Light Client Content Network": let rng = newRng()