Skip to content

Commit 15c2401

Browse files
committed
resolve impl change eth68
1 parent 82a1d76 commit 15c2401

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

execution_chain/sync/wire_protocol/handler.nim

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ proc getBlockBodies*(ctx: EthWireRef,
114114
list: seq[BlockBody]
115115
totalBytes = 0
116116

117+
# EIP-4444 limit
118+
# The way to prevent not to fetch till a particular limit
119+
# for in-future all storage profiles, if to check the header number
120+
# and limit the number of blocks to fetch
121+
117122
for blockHash in hashes:
118123
let body = ctx.chain.blockBodyByHash(blockHash).valueOr:
119124
trace "handlers.getBlockBodies: blockBody not found", blockHash
@@ -140,6 +145,16 @@ proc getBlockHeaders*(ctx: EthWireRef,
140145
return move(list)
141146
totalBytes = 0
142147

148+
# EIP-4444 limit
149+
if chain.isPortalActive:
150+
case req.reverse:
151+
of false:
152+
if req.startBlock.number + req.maxResults > chain.portal.limit:
153+
return move(list)
154+
of true:
155+
if req.startBlock.number > chain.portal.limit:
156+
return move(list)
157+
143158
totalBytes += getEncodedLength(header)
144159
list.add header
145160

0 commit comments

Comments
 (0)