EIP4844 gossip transition (#4463)

This commit is contained in:
henridf 2023-01-05 22:35:07 +01:00 committed by GitHub
parent 3a84d61b2e
commit 2fc08dfb3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 3 deletions

View File

@ -906,6 +906,11 @@ proc addCapellaMessageHandlers(
node.addAltairMessageHandlers(forkDigest, slot)
node.network.subscribe(getBlsToExecutionChangeTopic(forkDigest), basicParams)
proc addEIP4844MessageHandlers(
node: BeaconNode, forkDigest: ForkDigest, slot: Slot) =
node.addCapellaMessageHandlers(forkDigest, slot)
node.network.subscribe(getBeaconBlockAndBlobsSidecarTopic(forkDigest), basicParams)
proc removeAltairMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
node.removePhase0MessageHandlers(forkDigest)
@ -921,6 +926,10 @@ proc removeCapellaMessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
node.removeAltairMessageHandlers(forkDigest)
node.network.unsubscribe(getBlsToExecutionChangeTopic(forkDigest))
proc removeEIP4844MessageHandlers(node: BeaconNode, forkDigest: ForkDigest) =
node.removeCapellaMessageHandlers(forkDigest)
node.network.unsubscribe(getBeaconBlockAndBlobsSidecarTopic(forkDigest))
proc updateSyncCommitteeTopics(node: BeaconNode, slot: Slot) =
template lastSyncUpdate: untyped =
node.consensusManager[].actionTracker.lastSyncUpdate
@ -1073,7 +1082,7 @@ proc updateGossipStatus(node: BeaconNode, slot: Slot) {.async.} =
removeAltairMessageHandlers,
removeAltairMessageHandlers, # bellatrix (altair handlers, different forkDigest)
removeCapellaMessageHandlers,
removeCapellaMessageHandlers # eip4844 (capella handlers, different forkDigest)
removeEIP4844MessageHandlers
]
for gossipFork in oldGossipForks:
@ -1082,9 +1091,9 @@ proc updateGossipStatus(node: BeaconNode, slot: Slot) {.async.} =
const addMessageHandlers: array[BeaconStateFork, auto] = [
addPhase0MessageHandlers,
addAltairMessageHandlers,
addAltairMessageHandlers, # bellatrix (altair handlers, with different forkDigest)
addAltairMessageHandlers, # bellatrix (altair handlers, different forkDigest)
addCapellaMessageHandlers,
addCapellaMessageHandlers # eip4844 (capella handlers, different forkDigest)
addEIP4844MessageHandlers
]
for gossipFork in newGossipForks: