Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oxidize prove_rpc.sh #796

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions .github/workflows/jerigon-native.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- # Run and populate blockchain with transactions and generate proofs using native tracer
--- # Run and populate blockchain with transactions and generate proofs using native tracer

Check warning on line 1 in .github/workflows/jerigon-native.yml

View workflow job for this annotation

GitHub Actions / yamllint-check

1:5 [comments] too few spaces before comment

name: Jerigon Integration

Expand Down Expand Up @@ -76,14 +76,14 @@
run: |
ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)"
ulimit -n 8192
OUTPUT_TO_TERMINAL=true ./scripts/prove_rpc.sh 1 15 $ETH_RPC_URL native 0 3000 100 test_only
cargo xtask prove-rpc -u $ETH_RPC_URL -s 1 -e 15 -t native -c 0 -b 3000 -r 100 -m test
echo "Proving blocks in test_only mode finished"

- name: Run prove blocks with native tracer in real mode
run: |
ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)"
rm -rf proofs/* circuits/* ./proofs.json test.out verify.out leader.out
OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./scripts/prove_rpc.sh 4 7 $ETH_RPC_URL native 3 3000 100
cargo xtask prove-rpc -u $ETH_RPC_URL -s 4 -e 7 -t native -c 3 -b 3000 -r 100 -m verify
echo "Proving blocks in real mode finished"

- name: Shut down network
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/jerigon-zero.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--- # Run and populate blockchain with transactions and generate proofs using zero tracer
--- # Run and populate blockchain with transactions and generate proofs using zero tracer

Check warning on line 1 in .github/workflows/jerigon-zero.yml

View workflow job for this annotation

GitHub Actions / yamllint-check

1:5 [comments] too few spaces before comment

name: Jerigon Integration

Expand Down Expand Up @@ -76,14 +76,14 @@
run: |
ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)"
ulimit -n 8192
OUTPUT_TO_TERMINAL=true ./scripts/prove_rpc.sh 1 15 $ETH_RPC_URL jerigon 0 3000 100 test_only
cargo xtask prove-rpc -u $ETH_RPC_URL -s 1 -e 15 -t jerigon -c 0 -b 3000 -r 100 -m test
echo "Proving blocks in test_only mode finished"

- name: Run prove blocks with zero tracer in real mode
run: |
ETH_RPC_URL="$(kurtosis port print cancun-testnet el-2-erigon-lighthouse ws-rpc)"
rm -rf proofs/* circuits/* ./proofs.json test.out verify.out leader.out
OUTPUT_TO_TERMINAL=true RUN_VERIFICATION=true ./scripts/prove_rpc.sh 2 5 $ETH_RPC_URL jerigon 1 3000 100
cargo xtask prove-rpc -u $ETH_RPC_URL -s 2 -e 5 -t jerigon -c 1 -b 3000 -r 100 -m verify
echo "Proving blocks in real mode finished"

- name: Shut down network
Expand Down
82 changes: 80 additions & 2 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions scripts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ categories.workspace = true
publish = false

[dependencies]
alloy.workspace = true
anyhow.workspace = true
clap = { workspace = true, features = ["derive"] }
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true
sysinfo = "0.32.0"

[lints]
workspace = true
Expand Down
54 changes: 54 additions & 0 deletions scripts/outdated.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
use std::process::{Command, Stdio};

use anyhow::Result;
use anyhow::{ensure, Context as _};
use serde::Deserialize;

#[derive(Deserialize)]
struct Outdated<'a> {
crate_name: &'a str,
dependencies: Vec<Dependency<'a>>,
}

#[derive(Deserialize)]
struct Dependency<'a> {
name: &'a str,
project: &'a str,
latest: &'a str,
}

pub fn list_outdated_deps() -> Result<()> {
let output = Command::new("cargo")
.args(["outdated", "--root-deps-only", "--format=json"])
.stderr(Stdio::inherit())
.stdout(Stdio::piped())
.output()
.context("couldn't exec `cargo`")?;
ensure!(
output.status.success(),
"command failed with {}",
output.status
);

let outdated_items = serde_json::Deserializer::from_slice(&output.stdout)
.into_iter::<Outdated<'_>>()
.collect::<Result<Vec<_>, _>>()
.context("failed to parse output from `cargo outdated`")?;
for Outdated {
crate_name,
dependencies,
} in outdated_items
{
for Dependency {
name,
project,
latest,
} in dependencies
{
// https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#setting-a-warning-message
println!("::warning title=outdated-dependency::dependency {name} of crate {crate_name} is at version {project}, but the latest is {latest}")
}
}

Ok(())
}
Loading
Loading