Skip to content

Commit 766bd8f

Browse files
client/block: ensure BlockBodies requests get properly propagated (#3673)
1 parent 47f388b commit 766bd8f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/block/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export type BlockBodyBytes = [
160160
TransactionsBytes,
161161
UncleHeadersBytes,
162162
WithdrawalsBytes?,
163-
RequestBytes?,
163+
RequestsBytes?,
164164
]
165165
/**
166166
* TransactionsBytes can be an array of serialized txs for Typed Transactions or an array of Uint8Array Arrays for legacy transactions.

packages/client/src/sync/fetcher/blockfetcher.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class BlockFetcher extends BlockFetcherBase<Block[], Block> {
7373
`Requested blocks=${blocksRange} from ${peerInfo} (received: ${headers.length} headers / ${bodies.length} bodies)`,
7474
)
7575
const blocks: Block[] = []
76-
for (const [i, [txsData, unclesData, withdrawalsData]] of bodies.entries()) {
76+
for (const [i, [txsData, unclesData, withdrawalsData, requestsData]] of bodies.entries()) {
7777
const header = headers[i]
7878
if (
7979
(!equalsBytes(header.transactionsTrie, KECCAK256_RLP) && txsData.length === 0) ||
@@ -92,6 +92,9 @@ export class BlockFetcher extends BlockFetcherBase<Block[], Block> {
9292
if (withdrawalsData !== undefined) {
9393
values.push(withdrawalsData)
9494
}
95+
if (requestsData !== undefined) {
96+
values.push(requestsData)
97+
}
9598
// Supply the common from the corresponding block header already set on correct fork
9699
const block = createBlockFromBytesArray(values, { common: headers[i].common })
97100
// Only validate the data integrity

0 commit comments

Comments
 (0)