Skip to content

Commit

Permalink
resolve impl change eth68
Browse files Browse the repository at this point in the history
  • Loading branch information
advaita-saha committed Mar 9, 2025
1 parent 82a1d76 commit 15c2401
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions execution_chain/sync/wire_protocol/handler.nim
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ proc getBlockBodies*(ctx: EthWireRef,
list: seq[BlockBody]
totalBytes = 0

# EIP-4444 limit
# The way to prevent not to fetch till a particular limit
# for in-future all storage profiles, if to check the header number
# and limit the number of blocks to fetch

for blockHash in hashes:
let body = ctx.chain.blockBodyByHash(blockHash).valueOr:
trace "handlers.getBlockBodies: blockBody not found", blockHash
Expand All @@ -140,6 +145,16 @@ proc getBlockHeaders*(ctx: EthWireRef,
return move(list)
totalBytes = 0

# EIP-4444 limit
if chain.isPortalActive:
case req.reverse:
of false:
if req.startBlock.number + req.maxResults > chain.portal.limit:
return move(list)
of true:
if req.startBlock.number > chain.portal.limit:
return move(list)

totalBytes += getEncodedLength(header)
list.add header

Expand Down

0 comments on commit 15c2401

Please sign in to comment.