Do not allow pre-merge headers without an AccumulatorProof (#1426)

This commit is contained in:
Kim De Mey 2023-01-17 14:47:22 +01:00 committed by GitHub
parent 52a2257922
commit a1163b4ade
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 7 deletions

View File

@ -170,13 +170,16 @@ func verifyHeader*(
of BlockHeaderProofType.accumulatorProof:
a.verifyAccumulatorProof(header, proof.accumulatorProof)
of BlockHeaderProofType.none:
# TODO:
# Currently there is no proof solution for verifying headers post-merge.
# Skipping canonical verification will allow for nodes to push block data
# that is not part of the canonical chain.
# For now we accept this flaw as the focus lies on testing data availability
# up to the head of the chain.
ok()
if header.isPreMerge():
err("Pre merge header requires AccumulatorProof")
else:
# TODO:
# Currently there is no proof solution for verifying headers post-merge.
# Skipping canonical verification will allow for nodes to push block data
# that is not part of the canonical chain.
# For now we accept this flaw as the focus lies on testing data
# availability up to the head of the chain.
ok()
func buildProof*(
header: BlockHeader,