gindex fix
This commit is contained in:
parent
eb46f4c486
commit
14afc82a1d
|
@ -327,12 +327,12 @@ 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
|
# https://github.com/ethereum/consensus-specs/blob/5f48840f4d768bf0e0a8156a3ed06ec333589007/specs/_features/eip7594/p2p-interface.md#verify_data_column_sidecar_inclusion_proof
|
||||||
proc verify_data_column_sidecar_inclusion_proof*(sidecar: DataColumnSidecar): Result[void, string] =
|
proc verify_data_column_sidecar_inclusion_proof*(sidecar: DataColumnSidecar): Result[void, string] =
|
||||||
# Verify if the given KZG commitments are included in the beacon block
|
# Verify if the given KZG commitments are included in the beacon block
|
||||||
let gindex = kzg_commitment_inclusion_proof_gindex(sidecar.index)
|
let gindex = 11.GeneralizedIndex
|
||||||
if not is_valid_merkle_branch(
|
if not is_valid_merkle_branch(
|
||||||
hash_tree_root(sidecar.kzg_commitments),
|
hash_tree_root(sidecar.kzg_commitments),
|
||||||
sidecar.kzg_commitments_inclusion_proof,
|
sidecar.kzg_commitments_inclusion_proof,
|
||||||
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH,
|
KZG_COMMITMENT_INCLUSION_PROOF_DEPTH,
|
||||||
get_subtree_index(gindex),
|
gindex,
|
||||||
sidecar.signed_block_header.message.body_root):
|
sidecar.signed_block_header.message.body_root):
|
||||||
|
|
||||||
return err("DataColumnSidecar: inclusion proof not valid")
|
return err("DataColumnSidecar: inclusion proof not valid")
|
||||||
|
|
Loading…
Reference in New Issue