simplify `chunkMaxSize[T]` helper implementation (#5614)

There is no longer a `MAX_CHUNK_SIZE_BELLATRIX` since #5284, and we have
not used separate limits since #4558. Clean up to reflect that.
This commit is contained in:
Etan Kissling 2023-11-21 14:08:31 -08:00 committed by GitHub
parent 375f276f31
commit 946ebe54cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 9 deletions

View File

@ -812,17 +812,10 @@ proc uncompressFramedStream(conn: Connection,
func chunkMaxSize[T](): uint32 =
# compiler error on (T: type) syntax...
static: doAssert MAX_CHUNK_SIZE < high(uint32).uint64
when T is ForkySignedBeaconBlock:
when T is phase0.SignedBeaconBlock or T is altair.SignedBeaconBlock or
T is bellatrix.SignedBeaconBlock or T is capella.SignedBeaconBlock or
T is deneb.SignedBeaconBlock:
MAX_CHUNK_SIZE.uint32
else:
{.fatal: "what's the chunk size here?".}
elif isFixedSize(T):
when isFixedSize(T):
uint32 fixedPortionSize(T)
else:
static: doAssert MAX_CHUNK_SIZE < high(uint32).uint64
MAX_CHUNK_SIZE.uint32
from ../spec/datatypes/capella import SignedBeaconBlock