From b749590590fad6afccb5576cc3f3f9a630b8a35e Mon Sep 17 00:00:00 2001 From: Povilas Liubauskas Date: Tue, 14 May 2024 11:33:35 +0300 Subject: [PATCH] Use correct blob KZG commitments generalized index when verifying data column sidecar's inclusion proof --- eip_7594/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/eip_7594/src/lib.rs b/eip_7594/src/lib.rs index 5e9523bf..3e3414ad 100644 --- a/eip_7594/src/lib.rs +++ b/eip_7594/src/lib.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use anyhow::{anyhow, ensure, Result}; use c_kzg::{Blob as CKzgBlob, Bytes48, Cell as CKzgCell, KzgProof as CKzgProof, KzgSettings}; use hashing::ZERO_HASHES; -use helper_functions::predicates::{index_at_commitment_depth, is_valid_merkle_branch}; +use helper_functions::predicates::is_valid_merkle_branch; use kzg::eip_4844::{load_trusted_setup_string, BYTES_PER_G1, BYTES_PER_G2}; use num_traits::One as _; use sha2::{Digest as _, Sha256}; @@ -117,14 +117,14 @@ pub fn verify_sidecar_inclusion_proof( data_column_sidecar: &DataColumnSidecar

, ) -> bool { let DataColumnSidecar { - index, kzg_commitments, signed_block_header, kzg_commitments_inclusion_proof, .. } = data_column_sidecar; - let index_at_commitment_depth = index_at_commitment_depth::

(*index); + // Fields in BeaconBlockBody before blob KZG commitments + let index_at_commitment_depth = 11; // is_valid_blob_sidecar_inclusion_proof return is_valid_merkle_branch(