andri lim c300b41c07
Add engine_getBlobsV1 implementation (#3071)
* Add engine_getBlobsV1 implementation

* Addressing review
2025-02-15 12:18:07 +00:00

29 lines
931 B
Nim

# Nimbus
# Copyright (c) 2025 Status Research & Development GmbH
# Licensed under either of
# * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE))
# * MIT license ([LICENSE-MIT](LICENSE-MIT))
# at your option.
# This file may not be copied, modified, or distributed except according to
# those terms.
import
results,
json_rpc/errors,
web3/engine_api_types,
../../core/tx_pool,
../beacon_engine,
./api_utils
{.push gcsafe, raises:[InvalidRequest].}
proc getBlobsV1*(ben: BeaconEngineRef,
versionedHashes: openArray[VersionedHash]):
seq[Opt[BlobAndProofV1]] =
# https://github.com/ethereum/execution-apis/blob/c710097abda52b5a190d831eb8b1eddd3d28c603/src/engine/cancun.md#specification-3
if versionedHashes.len > 128:
raise tooLargeRequest("the number of requested blobs is too large")
for v in versionedHashes:
result.add ben.txPool.getBlobAndProofV1(v)