Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Dec 20, 2024
1 parent cf99d40 commit 0ff5615
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 19 deletions.
4 changes: 2 additions & 2 deletions bin/host/src/eigenda_fetcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use std::sync::Arc;
use tokio::sync::RwLock;
use tracing::{error, info, trace, warn};
use hokulea_eigenda::BlobInfo;
use alloy_rlp::{Decodable};
use alloy_rlp::Decodable;

/// The [FetcherWithEigenDASupport] struct wraps and extends kona's [Fetcher] struct with the ability
/// to fetch preimages from EigenDA.
Expand Down Expand Up @@ -139,7 +139,7 @@ where

if hint_type == ExtendedHintType::EigenDACommitment {

let item_slice= hint_data.as_ref();
let item_slice = hint_data.as_ref();

// the fourth because 0x01010000 in the beginnin is metadata
let cert_blob_info = BlobInfo::decode(&mut &item_slice[4..])?;
Expand Down
22 changes: 5 additions & 17 deletions crates/eigenda/src/certificate.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// data struct copied from https://github.com/Layr-Labs/eigenda-client-rs/blob/3ac1f62ae3d99aedf3de7a2fe827fab17db7b874/src/blob_info.rs
use core::fmt;

use alloy_primitives::Bytes;
use alloy_rlp::{RlpDecodable, RlpEncodable};

Expand All @@ -13,7 +10,6 @@ pub struct G1Commitment {
pub y: [u8; 32],
}


#[derive(Debug, PartialEq, Clone, RlpEncodable, RlpDecodable)]
pub struct BlobQuorumParam {
pub quorum_number: u32,
Expand All @@ -22,19 +18,7 @@ pub struct BlobQuorumParam {
pub chunk_length: u32,
}

impl BlobQuorumParam {
pub fn to_bytes(&self) -> Vec<u8> {
let mut bytes = Vec::new();
bytes.extend(&self.quorum_number.to_be_bytes());
bytes.extend(&self.adversary_threshold_percentage.to_be_bytes());
bytes.extend(&self.confirmation_threshold_percentage.to_be_bytes());
bytes.extend(&self.chunk_length.to_be_bytes());

bytes
}
}


/// eigenda v1 blob header
#[derive(Debug, PartialEq, Clone, RlpEncodable, RlpDecodable)]
pub struct BlobHeader {
pub commitment: G1Commitment,
Expand All @@ -60,6 +44,7 @@ pub struct BatchMetadata {
pub batch_header_hash: Bytes,
}

/// eigenda v1 blob verification proof
#[derive(Debug, PartialEq, Clone, RlpEncodable, RlpDecodable)]
pub struct BlobVerificationProof {
pub batch_id: u32,
Expand All @@ -69,8 +54,11 @@ pub struct BlobVerificationProof {
pub quorum_indexes: Bytes,
}

/// eigenda v1 certificate
#[derive(Debug, PartialEq, Clone, RlpEncodable, RlpDecodable)]
pub struct BlobInfo {
/// v1 blob header
pub blob_header: BlobHeader,
/// v1 blob verification proof with merkle tree
pub blob_verification_proof: BlobVerificationProof,
}

0 comments on commit 0ff5615

Please sign in to comment.