remove break condition

This commit is contained in:
Agnish Ghosh 2024-10-02 02:03:56 +05:30
parent e540c67fd1
commit beb539faa9
2 changed files with 11 additions and 2 deletions

View File

@ -388,6 +388,17 @@ proc verify_data_column_sidecar_kzg_proofs*(sidecar: DataColumnSidecar): Result[
# https://github.com/ethereum/consensus-specs/blob/5f48840f4d768bf0e0a8156a3ed06ec333589007/specs/_features/eip7594/p2p-interface.md#verify_data_column_sidecar_inclusion_proof
func verify_data_column_sidecar_inclusion_proof*(sidecar: DataColumnSidecar): Result[void, string] =
# Check if the data column sidecar index < NUMBER_OF_COLUMNS
if not (sidecar.index < NUMBER_OF_COLUMNS):
return err("EIP7594: Data column sidecar index exceeds the NUMBER_OF_COLUMNS")
# Check is the sidecar column length == sidecar.kzg_commitments length == sidecar.kzg_proofs mixInLength
if not (sidecar.column.len == sidecar.kzg_commitments.len and sidecar.column.len == 0):
return err("EIP7594: Data column sidecar length is not equal to the kzg_commitments length")
if not (sidecar.kzg_commitments.len == sidecar.kzg_proofs.len and sidecar.kzg_commitments.len == 0):
return err("EIP7594: Data column sidecar kzg_commitments length is not equal to the kzg_proofs length")
# Verify if the given KZG commitments are included in the beacon block
let gindex = 27.GeneralizedIndex
if not is_valid_merkle_branch(

View File

@ -500,8 +500,6 @@ p2pProtocol BeaconSync(version = 1,
cols.add(k)
debug "Responded to DataColumnSidecar range request",
peer, blck = shortLog(blockIds[i]), columns = cols
else:
break
debug "DataColumnSidecar range request done",
peer, startSlot, count = reqCount, columns = reqColumns, found