Skip to content

Commit

Permalink
add kzg proof to fetcher (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
zobront authored Jul 15, 2024
1 parent a0c3281 commit a6fe0ad
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions bin/host/src/fetcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,19 @@ where
sidecar.blob[(i as usize) << 5..(i as usize + 1) << 5].to_vec(),
);
}

// Write the KZG Proof as the 4096th element.
blob_key[72..].copy_from_slice((FIELD_ELEMENTS_PER_BLOB).to_be_bytes().as_ref());
let blob_key_hash = keccak256(blob_key.as_ref());

kv_write_lock.set(
PreimageKey::new(*blob_key_hash, PreimageKeyType::Keccak256).into(),
blob_key.into(),
);
kv_write_lock.set(
PreimageKey::new(*blob_key_hash, PreimageKeyType::Blob).into(),
sidecar.kzg_proof.to_vec(),
);
}
HintType::L1Precompile => {
// Validate the hint data length.
Expand Down

0 comments on commit a6fe0ad

Please sign in to comment.