Skip to content

Commit 13ba7ab

Browse files
committed
address feedback
1 parent c7565b0 commit 13ba7ab

File tree

1 file changed

+3
-11
lines changed
  • packages/portalnetwork/src/networks/history

1 file changed

+3
-11
lines changed

packages/portalnetwork/src/networks/history/history.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,6 @@ export class HistoryNetwork extends BaseNetwork {
172172
const proof = headerProof.proof
173173

174174
if (header.number < MERGE_BLOCK) {
175-
if (proof === null) {
176-
throw new Error('Received pre-merge block header without proof')
177-
}
178175
let deserializedProof: Uint8Array[]
179176
try {
180177
deserializedProof = AccumulatorProofType.deserialize(proof)
@@ -200,10 +197,6 @@ export class HistoryNetwork extends BaseNetwork {
200197
throw new Error('Unable to validate proof for pre-merge header')
201198
}
202199
} else if (header.number < SHANGHAI_BLOCK) {
203-
if (proof === null) {
204-
this.logger('Received post-merge block without proof')
205-
throw new Error('Received post-merge block header without proof')
206-
}
207200
let deserializedProof: ReturnType<typeof HistoricalRootsBlockProof.deserialize>
208201
try {
209202
deserializedProof = HistoricalRootsBlockProof.deserialize(proof)
@@ -222,9 +215,7 @@ export class HistoryNetwork extends BaseNetwork {
222215
}
223216
} else {
224217
// TODO: Check proof slot to ensure header is from previous sync period and handle ephemeral headers separately
225-
if (proof === null) {
226-
this.logger('Received post-merge block without proof')
227-
}
218+
228219
let deserializedProof: ReturnType<typeof HistoricalSummariesBlockProof.deserialize>
229220
try {
230221
deserializedProof = HistoricalSummariesBlockProof.deserialize(proof)
@@ -386,7 +377,8 @@ export class HistoryNetwork extends BaseNetwork {
386377
this.gossipManager.add(contentKey)
387378
}
388379
this.logger(
389-
`${HistoryNetworkContentType[contentType]} added for ${keyOpt instanceof Uint8Array ? bytesToHex(keyOpt) : keyOpt
380+
`${HistoryNetworkContentType[contentType]} added for ${
381+
keyOpt instanceof Uint8Array ? bytesToHex(keyOpt) : keyOpt
390382
}`,
391383
)
392384
}

0 commit comments

Comments
 (0)