diff --git a/fluffy/network/history/experimental/beacon_chain_block_proof.nim b/fluffy/network/history/beacon_chain_block_proof_bellatrix.nim similarity index 100% rename from fluffy/network/history/experimental/beacon_chain_block_proof.nim rename to fluffy/network/history/beacon_chain_block_proof_bellatrix.nim diff --git a/fluffy/network/history/experimental/beacon_chain_historical_roots.nim b/fluffy/network/history/beacon_chain_historical_roots.nim similarity index 100% rename from fluffy/network/history/experimental/beacon_chain_historical_roots.nim rename to fluffy/network/history/beacon_chain_historical_roots.nim diff --git a/fluffy/network/history/experimental/beacon_chain_block_proof_capella.nim b/fluffy/network/history/experimental/beacon_chain_block_proof_capella.nim index 5f0014078..c66b1d614 100644 --- a/fluffy/network/history/experimental/beacon_chain_block_proof_capella.nim +++ b/fluffy/network/history/experimental/beacon_chain_block_proof_capella.nim @@ -16,7 +16,7 @@ # The usage of this PoC can be seen in # ./fluffy/tests/test_beacon_chain_block_proof_capella.nim # -# TODO: Fit both beacon_chain_block_proof.nim and +# TODO: Fit both beacon_chain_block_proof_bellatrix.nim and # beacon_chain_block_proof_capella.nim better together and add fork selection # on top of it. # diff --git a/fluffy/network/history/history_network.nim b/fluffy/network/history/history_network.nim index 5816125c8..3fc8f75c1 100644 --- a/fluffy/network/history/history_network.nim +++ b/fluffy/network/history/history_network.nim @@ -18,7 +18,7 @@ import ../../network_metadata, ../../../nimbus/[constants, db/core_db], ../wire/[portal_protocol, portal_stream, portal_protocol_config], - "."/[history_content, accumulator] + "."/[history_content, accumulator, beacon_chain_historical_roots] logScope: topics = "portal_hist" @@ -56,6 +56,7 @@ type contentDB*: ContentDB contentQueue*: AsyncQueue[(Opt[NodeId], ContentKeysList, seq[seq[byte]])] accumulator*: FinishedAccumulator + historicalRoots*: HistoricalRoots processContentLoop: Future[void] statusLogLoop: Future[void] @@ -699,6 +700,7 @@ proc new*( contentDB: ContentDB, streamManager: StreamManager, accumulator: FinishedAccumulator, + historicalRoots: HistoricalRoots = loadHistoricalRoots(), bootstrapRecords: openArray[Record] = [], portalConfig: PortalProtocolConfig = defaultPortalProtocolConfig, ): T = @@ -725,6 +727,7 @@ proc new*( contentDB: contentDB, contentQueue: contentQueue, accumulator: accumulator, + historicalRoots: historicalRoots, ) proc validateContent( diff --git a/fluffy/tests/all_fluffy_tests.nim b/fluffy/tests/all_fluffy_tests.nim index 2aefa4bca..1c4c2a7ac 100644 --- a/fluffy/tests/all_fluffy_tests.nim +++ b/fluffy/tests/all_fluffy_tests.nim @@ -17,7 +17,7 @@ import ./test_history_network, ./test_content_db, ./test_discovery_rpc, - ./test_beacon_chain_block_proof, + ./test_beacon_chain_block_proof_bellatrix, ./test_beacon_chain_block_proof_capella, ./test_beacon_chain_historical_roots, ./test_beacon_chain_historical_summaries, diff --git a/fluffy/tests/portal_spec_tests/mainnet/test_history_block_proof_bellatrix.nim b/fluffy/tests/portal_spec_tests/mainnet/test_history_block_proof_bellatrix.nim index 7cecb2742..2ad25bc8c 100644 --- a/fluffy/tests/portal_spec_tests/mainnet/test_history_block_proof_bellatrix.nim +++ b/fluffy/tests/portal_spec_tests/mainnet/test_history_block_proof_bellatrix.nim @@ -16,7 +16,7 @@ import beacon_chain/spec/datatypes/bellatrix, ../../../common/common_types, ../../../network_metadata, - ../../../network/history/experimental/beacon_chain_block_proof, + ../../../network/history/beacon_chain_block_proof_bellatrix, ../../test_yaml_utils type YamlTestProof = object diff --git a/fluffy/tests/test_beacon_chain_block_proof.nim b/fluffy/tests/test_beacon_chain_block_proof_bellatrix.nim similarity index 98% rename from fluffy/tests/test_beacon_chain_block_proof.nim rename to fluffy/tests/test_beacon_chain_block_proof_bellatrix.nim index 4a7729a94..b727a1383 100644 --- a/fluffy/tests/test_beacon_chain_block_proof.nim +++ b/fluffy/tests/test_beacon_chain_block_proof_bellatrix.nim @@ -16,7 +16,7 @@ import beacon_chain /../ tests/testblockutil, # Mock helpers beacon_chain /../ tests/mocking/mock_genesis, - ../network/history/experimental/beacon_chain_block_proof + ../network/history/beacon_chain_block_proof_bellatrix # Test suite for the proofs: # - HistoricalRootsProof @@ -37,7 +37,7 @@ import # TODO: Add more blocks to reach 1+ historical roots, to make sure that indexing # is properly tested. -suite "Beacon Chain Block Proofs": +suite "Beacon Chain Block Proofs - Bellatrix": let cfg = block: var res = defaultRuntimeConfig diff --git a/fluffy/tests/test_beacon_chain_block_proof_capella.nim b/fluffy/tests/test_beacon_chain_block_proof_capella.nim index afc039918..f6e1ae119 100644 --- a/fluffy/tests/test_beacon_chain_block_proof_capella.nim +++ b/fluffy/tests/test_beacon_chain_block_proof_capella.nim @@ -40,7 +40,7 @@ import # - Adjust tests to test usage of historical_summaries and historical_roots # together. -suite "Beacon Chain Block Proofs": +suite "Beacon Chain Block Proofs - Capella": let cfg = block: var res = defaultRuntimeConfig diff --git a/fluffy/tests/test_beacon_chain_historical_roots.nim b/fluffy/tests/test_beacon_chain_historical_roots.nim index 70c0410fb..606e8e71d 100644 --- a/fluffy/tests/test_beacon_chain_historical_roots.nim +++ b/fluffy/tests/test_beacon_chain_historical_roots.nim @@ -17,7 +17,7 @@ import beacon_chain /../ tests/testblockutil, beacon_chain /../ tests/mocking/mock_genesis, beacon_chain /../ tests/consensus_spec/fixtures_utils, - ../network/history/experimental/beacon_chain_historical_roots + ../network/history/beacon_chain_historical_roots suite "Beacon Chain Historical Roots": let diff --git a/fluffy/tools/eth_data_exporter/cl_data_exporter.nim b/fluffy/tools/eth_data_exporter/cl_data_exporter.nim index 01fe1bd21..08cbbb230 100644 --- a/fluffy/tools/eth_data_exporter/cl_data_exporter.nim +++ b/fluffy/tools/eth_data_exporter/cl_data_exporter.nim @@ -20,7 +20,7 @@ import beacon_chain/beacon_clock, ../../network/beacon/beacon_content, ../../network/beacon/beacon_init_loader, - ../../network/history/experimental/beacon_chain_block_proof, + ../../network/history/beacon_chain_block_proof_bellatrix, ../../network_metadata, ./exporter_common