File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ use reqwest::{Client, Url};
55use serde:: { Deserialize , Serialize } ;
66use serde_json:: Value ;
77
8+ // See https://eips.ethereum.org/EIPS/eip-4844#parameters
89pub const KZG_VERSIONED_HASH : u8 = 0x1 ;
910
1011pub struct BeaconClient {
@@ -29,6 +30,7 @@ pub enum BeaconClientError {
2930
3031#[ derive( Deserialize , Debug ) ]
3132#[ allow( dead_code) ]
33+ // https://ethereum.github.io/beacon-APIs/#/Beacon/getBlobSidecars
3234pub struct BlobData {
3335 pub index : String ,
3436 pub blob : String ,
@@ -39,13 +41,16 @@ pub struct BlobData {
3941
4042#[ derive( Deserialize , Debug ) ]
4143#[ allow( dead_code) ]
44+
45+ // https://ethereum.github.io/beacon-APIs/#/Beacon/getBlockHeaders
4246pub struct BeaconBlock {
4347 pub root : String ,
4448 pub canonical : bool ,
4549 pub header : BeaconBlockHeader ,
4650}
4751
4852#[ derive( Deserialize , Debug ) ]
53+
4954pub struct BeaconBlockHeader {
5055 pub message : BeaconBlockMessage ,
5156}
Original file line number Diff line number Diff line change @@ -93,9 +93,12 @@ pub async fn is_proof_verified_in_aggregation_mode(
9393
9494 let logs = eth_rpc_provider. get_logs ( & filter) . await . unwrap ( ) ;
9595 for log in logs {
96+ // First 32 bytes of the data are the bytes of the blob versioned hash
9697 let blob_versioned_hash: [ u8 ; 32 ] = log. data [ 0 ..32 ]
9798 . try_into ( )
9899 . map_err ( |_| ProofVerificationAggModeError :: EventDecoding ) ?;
100+
101+ // Event is indexed by merkle root
99102 let merkle_root = log. topics [ 1 ] . 0 ;
100103
101104 // Block Number shouldn't be empty, in case it is,
You can’t perform that action at this time.
0 commit comments