allow syncing capella blocks (#4423)
This commit is contained in:
parent
cd993ca418
commit
2440954555
|
@ -804,7 +804,7 @@ func chunkMaxSize[T](): uint32 =
|
|||
when T is ForkySignedBeaconBlock:
|
||||
when T is phase0.SignedBeaconBlock or T is altair.SignedBeaconBlock:
|
||||
MAX_CHUNK_SIZE
|
||||
elif T is bellatrix.SignedBeaconBlock:
|
||||
elif T is bellatrix.SignedBeaconBlock or T is capella.SignedBeaconBlock:
|
||||
MAX_CHUNK_SIZE_BELLATRIX
|
||||
else:
|
||||
{.fatal: "what's the chunk size here?".}
|
||||
|
|
|
@ -14,7 +14,7 @@ import
|
|||
std/[options, tables, sets, macros],
|
||||
chronicles, chronos, snappy/codec,
|
||||
libp2p/switch,
|
||||
../spec/datatypes/[phase0, altair, bellatrix],
|
||||
../spec/datatypes/[phase0, altair, bellatrix, capella],
|
||||
../spec/[helpers, forks, network],
|
||||
".."/[beacon_clock],
|
||||
../networking/eth2_network,
|
||||
|
@ -106,6 +106,12 @@ proc readChunkPayload*(
|
|||
return ok newClone(ForkedSignedBeaconBlock.init(res.get))
|
||||
else:
|
||||
return err(res.error)
|
||||
elif contextBytes == peer.network.forkDigests.capella:
|
||||
let res = await readChunkPayload(conn, peer, capella.SignedBeaconBlock)
|
||||
if res.isOk:
|
||||
return ok newClone(ForkedSignedBeaconBlock.init(res.get))
|
||||
else:
|
||||
return err(res.error)
|
||||
else:
|
||||
return neterr InvalidContextBytes
|
||||
|
||||
|
|
Loading…
Reference in New Issue