File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
execution_chain/sync/wire_protocol Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments