Prepare Fluffy for usage of historical_roots (#2138)
This commit is contained in:
parent
d0ac3a1986
commit
c610053a09
|
@ -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.
|
||||
#
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue