Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

engine_getPayloadBodiesByRangeV1 can fetch too many payload bodies #3055

Closed
tersec opened this issue Feb 9, 2025 · 0 comments · Fixed by #3057
Closed

engine_getPayloadBodiesByRangeV1 can fetch too many payload bodies #3055

tersec opened this issue Feb 9, 2025 · 0 comments · Fixed by #3057
Labels

Comments

@tersec
Copy link
Contributor

tersec commented Feb 9, 2025

var
last = start+count-1
if start > ben.chain.latestNumber:
# requested range beyond the latest known block
return
if last > ben.chain.latestNumber:
last = ben.chain.latestNumber
# get bodies from database
for bn in start..ben.chain.baseNumber:
let blk = ben.chain.blockByNumber(bn).valueOr:
result.add Opt.none(ExecutionPayloadBodyV1)
continue
result.add Opt.some(blk.toPayloadBody)

It calculates this last payload body to fetch but ultimately that doesn't matter, it fetches all of start..ben.chain.baseNumber, which could be arbitrarily more more than the maxBodyRequest == 32 intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant