Don't pass RuntimeConfig to RequestManager (#4589)

This commit is contained in:
henridf 2023-02-04 12:13:09 +01:00 committed by GitHub
parent bca781b1b0
commit 9233a52e4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -387,7 +387,9 @@ proc initFullNode(
node.processor = processor node.processor = processor
node.blockProcessor = blockProcessor node.blockProcessor = blockProcessor
node.consensusManager = consensusManager node.consensusManager = consensusManager
node.requestManager = RequestManager.init(node.network, dag.cfg, getBeaconTime, node.requestManager = RequestManager.init(node.network,
dag.cfg.EIP4844_FORK_EPOCH,
getBeaconTime,
blockVerifier, blockBlobsVerifier) blockVerifier, blockBlobsVerifier)
node.syncManager = syncManager node.syncManager = syncManager
node.backfiller = backfiller node.backfiller = backfiller

View File

@ -39,7 +39,7 @@ type
RequestManager* = object RequestManager* = object
network*: Eth2Node network*: Eth2Node
inpQueue*: AsyncQueue[FetchRecord] inpQueue*: AsyncQueue[FetchRecord]
cfg: RuntimeConfig EIP4844_FORK_EPOCH: Epoch
getBeaconTime: GetBeaconTimeFn getBeaconTime: GetBeaconTimeFn
blockVerifier: BlockVerifier blockVerifier: BlockVerifier
blockBlobsVerifier: BlockBlobsVerifier blockBlobsVerifier: BlockBlobsVerifier
@ -52,14 +52,14 @@ func shortLog*(x: seq[FetchRecord]): string =
"[" & x.mapIt(shortLog(it.root)).join(", ") & "]" "[" & x.mapIt(shortLog(it.root)).join(", ") & "]"
proc init*(T: type RequestManager, network: Eth2Node, proc init*(T: type RequestManager, network: Eth2Node,
cfg: RuntimeConfig, eip4844Epoch: Epoch,
getBeaconTime: GetBeaconTimeFn, getBeaconTime: GetBeaconTimeFn,
blockVerifier: BlockVerifier, blockVerifier: BlockVerifier,
blockBlobsVerifier: BlockBlobsVerifier): RequestManager = blockBlobsVerifier: BlockBlobsVerifier): RequestManager =
RequestManager( RequestManager(
network: network, network: network,
inpQueue: newAsyncQueue[FetchRecord](), inpQueue: newAsyncQueue[FetchRecord](),
cfg: cfg, EIP4844_FORK_EPOCH: eip4844Epoch,
getBeaconTime: getBeaconTime, getBeaconTime: getBeaconTime,
blockVerifier: blockVerifier, blockVerifier: blockVerifier,
blockBlobsVerifier: blockBlobsVerifier, blockBlobsVerifier: blockBlobsVerifier,
@ -249,7 +249,7 @@ proc fetchAncestorBlocksAndBlobsFromNetwork(rman: RequestManager,
proc isBlobsTime(rman: RequestManager): bool = proc isBlobsTime(rman: RequestManager): bool =
rman.getBeaconTime().slotOrZero.epoch >= rman.cfg.EIP4844_FORK_EPOCH rman.getBeaconTime().slotOrZero.epoch >= rman.EIP4844_FORK_EPOCH
proc requestManagerLoop(rman: RequestManager) {.async.} = proc requestManagerLoop(rman: RequestManager) {.async.} =
var rootList = newSeq[Eth2Digest]() var rootList = newSeq[Eth2Digest]()