Skip to content

Commit

Permalink
add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
temaniarpit27 committed Nov 19, 2024
1 parent 7a2d98b commit 85e11ab
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 12 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/zeth-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
---
# Zeth Integration

name: Zeth Integration

on:
push:
branches: [develop, main]
pull_request:
branches:
- "**"
workflow_dispatch:
branches:
- "**"

env:
CARGO_TERM_COLOR: always

jobs:
zeth_integration:
name: Zeth Integration
runs-on: zero-ci
timeout-minutes: 30
steps:
- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Clone Repositories
uses: actions/checkout@v4
with:
repository: 0xPolygonZero/zeth
ref: "arpit/1"
path: zeth

- name: Run zeth network
run: |
cd zeth
touch polygon-zero.db
cargo run -- node --dev --http.api all &
echo "Zeth network started, Sleeping for sometime to let the network start"
sleep 120
- name: Generate txn
run: |
cast send --async --legacy \
--from "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266" \
--private-key "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" \
--rpc-url http://localhost:8545 --gas-limit 100000 --value 1 "0x852DA15b70a3e197d1D668a9a481B1F4c2168a5D"
- name: Checkout
uses: actions/checkout@v4
with:
path: zk_evm

- name: Run prove blocks with zero tracer in test_only mode
run: |
OUTPUT_TO_TERMINAL=true ./scripts/prove_rpc.sh 1 1 http://localhost:8545 zeth 0 3000 100 test_only
echo "Proving blocks in test_only mode finished"
14 changes: 2 additions & 12 deletions zero/src/rpc/zeth.rs
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
use alloy::{providers::Provider, rpc::types::eth::BlockId, transports::Transport};
use serde::Deserialize;
use trace_decoder::{BlockTrace, TxnInfo};
use trace_decoder::BlockTrace;

use super::fetch_other_block_data;
use crate::prover::BlockProverInput;
use crate::provider::CachedProvider;

/// Transaction traces retrieved from Erigon zeroTracer.
#[derive(Debug, Deserialize)]
pub struct ZeroTxResult {
#[serde(rename(deserialize = "txHash"))]
pub tx_hash: alloy::primitives::TxHash,
pub result: TxnInfo,
}

pub async fn block_prover_input<ProviderT, TransportT>(
cached_provider: std::sync::Arc<CachedProvider<ProviderT, TransportT>>,
target_block_id: BlockId,
Expand All @@ -36,8 +27,7 @@ where

let other_data =
fetch_other_block_data(cached_provider, target_block_id, checkpoint_block_number).await?;
println!("block_prover_input: {:?}", block_trace);
// Assemble

Ok(BlockProverInput {
block_trace,
other_data,
Expand Down

0 comments on commit 85e11ab

Please sign in to comment.