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

Make header proof validation optional in addRLPSerializedBlock #604

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/portalnetwork/src/networks/history/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ export const reassembleBlock = (rawHeader: Uint8Array, rawBody?: Uint8Array) =>
* Takes an RLP encoded block as a hex string and adds the block header and block body to the `portal` content DB
* @param rlpHex RLP encoded block as hex string
* @param blockHash block hash as 0x prefixed hex string
* @param portal a running `PortalNetwork` client
* @param network a running `PortalNetwork` client
*/
export const addRLPSerializedBlock = async (
rlpHex: string,
Expand All @@ -185,7 +185,7 @@ export const addRLPSerializedBlock = async (
try {
await network.validateHeader(headerProof, blockHash)
} catch {
throw new Error('Header proof failed validation')
network.logger('Header proof failed validation while loading block from RLP')
}
await network.store(headerKey, headerProof)
} else {
Expand Down
Loading