stricter check for context bytes when recv LC data (#4480)

Bellatrix and Altair light client data share same body, but have other
fork digests. Validate that the peer's sent fork digest matches the one
that we expect (derived from `attested_header.slot`).
This commit is contained in:
Etan Kissling 2023-01-10 16:54:29 +01:00 committed by GitHub
parent 2fc0fa4288
commit ca01356d8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -135,6 +135,8 @@ proc readChunkPayload*(
return neterr InvalidContextBytes
if res.isErr:
return err(res.error)
if stateFork != peer.network.cfg.stateForkAtEpoch(res.get.contextEpoch):
return neterr InvalidContextBytes
return ok res.get
func shortLog*(s: StatusMsg): auto =