Skip to content

Commit

Permalink
Remove unused eip_7594 methods
Browse files Browse the repository at this point in the history
  • Loading branch information
povi committed May 14, 2024
1 parent edbe9cc commit 851f208
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 58 deletions.
57 changes: 0 additions & 57 deletions eip_7594/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,63 +92,6 @@ pub fn verify_sidecar_inclusion_proof<P: Preset>(
);
}

pub fn verify_data_column_sidecar_kzg_proofs<P: Preset>(
sidecar: DataColumnSidecar<P>,
) -> Result<bool> {
assert!(sidecar.index < NumberOfColumns::U64);
assert!(
sidecar.column.len() == sidecar.kzg_commitments.len()
&& sidecar.column.len() == sidecar.kzg_proofs.len()
);
let mut row_ids = Vec::new();
for i in 0..sidecar.column.len() {
row_ids.push(i as u64);
}

let kzg_settings = load_kzg_settings()?;

let column = sidecar
.column
.into_iter()
.map(|a| CKzgCell::from_bytes(&a.as_bytes()).map_err(Into::into))
.collect::<Result<Vec<_>>>()?;

let commitment = sidecar
.kzg_commitments
.iter()
.map(|a| Bytes48::from_bytes(a.as_bytes()).map_err(Into::into))
.collect::<Result<Vec<_>>>()?;

let kzg_proofs = sidecar
.kzg_proofs
.iter()
.map(|a| Bytes48::from_bytes(&a.as_bytes()).map_err(Into::into))
.collect::<Result<Vec<_>>>()?;

Ok(CKzgProof::verify_cell_proof_batch(
&commitment[..],
&row_ids,
&vec![sidecar.index],
&column[..],
&kzg_proofs,
&kzg_settings,
)?)
}

pub fn verify_data_column_sidecar_inclusion_proof<P: Preset>(
sidecar: DataColumnSidecar<P>,
) -> bool {
let index_at_commitment_depth = index_at_commitment_depth::<P>(sidecar.index);

// is_valid_blob_sidecar_inclusion_proof
return is_valid_merkle_branch(
sidecar.kzg_commitments.hash_tree_root(),
sidecar.kzg_commitments_inclusion_proof,
index_at_commitment_depth,
sidecar.signed_block_header.message.body_root,
);
}

pub fn get_custody_columns(node_id: NodeId, custody_subnet_count: u64) -> Vec<ColumnIndex> {
assert!(custody_subnet_count <= DATA_COLUMN_SIDECAR_SUBNET_COUNT);

Expand Down
1 change: 0 additions & 1 deletion fork_choice_store/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use std::{
use anyhow::{anyhow, bail, ensure, Result};
use arithmetic::NonZeroExt as _;
use clock::Tick;
use eip_7594::{verify_data_column_sidecar_inclusion_proof, verify_data_column_sidecar_kzg_proofs};
use eip_7594::{verify_kzg_proofs, verify_sidecar_inclusion_proof};
use execution_engine::ExecutionEngine;
use features::Feature;
Expand Down
1 change: 1 addition & 0 deletions ssz/src/uint256.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ impl Uint256 {
Self(self.into_raw().saturating_mul(rhs.into_raw()))
}

#[must_use]
pub const fn into_raw(self) -> RawUint256 {
self.0
}
Expand Down

0 comments on commit 851f208

Please sign in to comment.