Implement the merge networking req/resp changes (#2922)

The other part of this change was already implemented in the `sendResponseChunk` function.
This commit is contained in:
zah 2021-09-29 19:44:43 +03:00 committed by GitHub
parent 4aed54200d
commit 554a31d20d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -10,7 +10,7 @@
import
options, tables, sets, macros,
chronicles, chronos, stew/ranges/bitranges, libp2p/switch,
../spec/datatypes/[phase0, altair],
../spec/datatypes/[phase0, altair, merge],
../spec/[helpers, forks, network],
".."/[beacon_node_types, beacon_clock],
../networking/eth2_network,
@ -79,6 +79,12 @@ proc readChunkPayload*(conn: Connection, peer: Peer,
return ok ForkedSignedBeaconBlock.init(res.get)
else:
return err(res.error)
elif contextBytes == peer.network.forkDigests.merge:
let res = await readChunkPayload(conn, peer, merge.SignedBeaconBlock)
if res.isOk:
return ok ForkedSignedBeaconBlock.init(res.get)
else:
return err(res.error)
else:
return neterr InvalidContextBytes