Prepare Fluffy for usage of historical_roots (#2138)

This commit is contained in:
Kim De Mey 2024-04-17 17:58:47 +02:00 committed by GitHub
parent d0ac3a1986
commit c610053a09
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 12 additions and 9 deletions

View File

@ -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.
#

View File

@ -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(

View File

@ -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,

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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