Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ celestia-types = "=0.11.2"
ed25519-dalek = { version = "2.1.0", features = ["alloc", "serde"] }
eq-common = "0.1.4"
ethers = { version = "2.0", features = ["ws", "rustls"] }
ev-types = { version = "0.0.1", default-features = false }
ev-types = { git = "https://github.com/evstack/ev-node.git", rev = "677ed6d33f36233544acbe00c3dad2c29af11af5", package = "ev-types", default-features = false }
hex = "0.4.3"
nmt-rs = "*"
prost = "0.12"
Expand Down
8 changes: 6 additions & 2 deletions crates/sp1/evm-exec/program/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ use std::sync::Arc;
use alloy_consensus::{proofs, BlockHeader};
use alloy_primitives::B256;
use alloy_rlp::Decodable;
use bytes::Bytes;
use celestia_types::nmt::{Namespace, NamespaceProof, NamespacedHash};
use celestia_types::Blob;
use celestia_types::DataAvailabilityHeader;
use ed25519_dalek::{Signature, Verifier, VerifyingKey};
use ev_types::v1::{Data, SignedData};
use ev_types::BlobCompressor;
use evm_exec_types::BlockExecOutput;
use nmt_rs::NamespacedSha2Hasher;
use prost::Message;
Expand Down Expand Up @@ -170,9 +170,13 @@ pub fn main() {
// -----------------------------
println!("cycle-tracker-report-start: filter signed data blobs and verify signatures");

let blob_compressor = BlobCompressor::new();
let signed_data: Vec<SignedData> = blobs
.into_iter()
.filter_map(|blob| SignedData::decode(Bytes::from(blob.data)).ok())
.filter_map(|blob| {
let decompressed = blob_compressor.decompress(blob.data.as_slice()).ok()?;
SignedData::decode(decompressed).ok()
})
.collect();

let mut tx_data: Vec<Data> = Vec::new();
Expand Down
1 change: 1 addition & 0 deletions crates/sp1/evm-exec/script/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ tendermint-proto = { workspace = true }
tokio = { version = "1.44", features = ["full"] }
tokio-retry = "0.3"
tracing = "0.1.40"
zstd = "0.13"

[build-dependencies]
sp1-build = { workspace = true }
36 changes: 30 additions & 6 deletions crates/sp1/evm-exec/script/src/bin/datagen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use clap::Parser;
use ev_types::v1::get_block_request::Identifier;
use ev_types::v1::store_service_client::StoreServiceClient;
use ev_types::v1::{GetBlockRequest, SignedData};
use ev_types::BlobCompressor;
use eyre::Context;
use prost::Message;
use reth_chainspec::ChainSpec;
Expand Down Expand Up @@ -143,13 +144,18 @@ async fn main() -> Result<(), Box<dyn Error>> {
println!("Got NamespaceProofs, total: {}", proofs.len());

let mut executor_inputs: Vec<EthClientExecutorInput> = Vec::new();
for blob in blobs.as_slice() {
let data = match SignedData::decode(blob.data.as_slice()) {
Ok(data) => data.data.unwrap(),
Err(_) => continue,
};

let height = data.metadata.unwrap().height;
let blob_compressor = BlobCompressor::new();
let signed_data: Vec<SignedData> = blobs
.into_iter()
.filter_map(|blob| {
let decompressed = blob_compressor.decompress(blob.data.as_slice()).ok()?;
SignedData::decode(decompressed).ok()
})
.collect();

for data in signed_data {
let height = data.data.unwrap().metadata.unwrap().height;
println!("Got SignedData for EVM block {}", height);

let client_executor_input =
Expand All @@ -159,6 +165,24 @@ async fn main() -> Result<(), Box<dyn Error>> {
executor_inputs.push(client_executor_input);
}

// let compressor = ev_client::BlobCompressor::new();
// for blob in blobs.as_slice() {
// let decompressed = compressor.decompress(&blob.data[..]).unwrap();
// let data = match SignedData::decode(decompressed) {
// Ok(data) => data.data.unwrap(),
// Err(_) => continue,
// };

// let height = data.metadata.unwrap().height;
// println!("Got SignedData for EVM block {}", height);

// let client_executor_input =
// generate_client_executor_input(config::EVM_RPC_URL, height, chain_spec.clone(), genesis.clone())
// .await?;

// executor_inputs.push(client_executor_input);
// }

println!("Got EthClientExecutorInputs, total: {}", executor_inputs.len());

// Create output dir: testdata/inputs/block-{celestia_block_number}/
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ services:
- celestia-zkevm-net

ev-node-evm-single:
image: ghcr.io/evstack/ev-node-evm-single:main
image: ghcr.io/evstack/ev-node-evm-single:pr-2547
container_name: ev-node-evm-single
entrypoint: /scripts/entrypoint.sh
ports:
Expand Down
Loading