Skip to content

Commit

Permalink
merge base
Browse files Browse the repository at this point in the history
  • Loading branch information
temaniarpit27 committed Aug 5, 2024
2 parents d5baa5b + 1abd61c commit ce08f9a
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 30 deletions.
5 changes: 2 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ axum = "0.7.5"
bitflags = "2.5.0"
bitvec = "1.0.1"
bytes = "1.6.0"
cargo_metadata = "0.18.1"
ciborium = "0.2.2"
ciborium-io = "0.2.2"
clap = { version = "4.5.7", features = ["derive", "env"] }
Expand Down Expand Up @@ -104,6 +105,7 @@ tracing-subscriber = { version = "0.3", features = ["env-filter"] }
u4 = "0.1.0"
uint = "0.9.5"
url = "2.5.2"
vergen = { version = "9.0.0", features = ["build", "rustc"] }
winnow = "0.6.13"

# local dependencies
Expand Down Expand Up @@ -131,6 +133,3 @@ proc-macro2 = "1.0"
quote = "1.0"
syn = "2.0"
trybuild = "1.0"

vergen = { version = "9.0.0", features = ["build", "rustc"] }
cargo_metadata = "0.18.1"
1 change: 1 addition & 0 deletions zero_bin/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ vergen = { workspace = true }
[build-dependencies]
cargo_metadata = { workspace = true }
vergen = { workspace = true }
anyhow = { workspace = true }
11 changes: 0 additions & 11 deletions zero_bin/common/src/build_version.rs → zero_bin/common/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,3 @@ fn main() -> anyhow::Result<()> {

Ok(())
}

pub fn print_version(
evm_arithmetization_package_version: &str,
rustc_commit_hash: &str,
rustc_timestamp: &str,
) {
println!(
"evm_arithmetization Package Version: {}\nBuild Commit Hash: {}\nBuild Timestamp: {}",
evm_arithmetization_package_version, rustc_commit_hash, rustc_timestamp
)
}
2 changes: 1 addition & 1 deletion zero_bin/common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
pub mod block_interval;
pub mod build_version;
pub mod debug_utils;
pub mod fs;
pub mod parsing;
pub mod prover_state;
pub mod version;
10 changes: 10 additions & 0 deletions zero_bin/common/src/version.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pub fn print_version(
evm_arithmetization_package_version: &str,
rustc_commit_hash: &str,
rustc_timestamp: &str,
) {
println!(
"evm_arithmetization Package Version: {}\nBuild Commit Hash: {}\nBuild Timestamp: {}",
evm_arithmetization_package_version, rustc_commit_hash, rustc_timestamp
)
}
2 changes: 1 addition & 1 deletion zero_bin/leader/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
build = "../common/src/build_version.rs"
build = "../common/build.rs"

[dependencies]
paladin-core = { workspace = true }
Expand Down
5 changes: 2 additions & 3 deletions zero_bin/leader/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use paladin::runtime::Runtime;
use proof_gen::proof_types::GeneratedBlockProof;
use tracing::{info, warn};
use zero_bin_common::block_interval::BlockInterval;
use zero_bin_common::build_version;
use zero_bin_common::version;

use crate::client::{client_main, ProofParams};

Expand Down Expand Up @@ -46,7 +46,6 @@ async fn main() -> Result<()> {
unsafe {
env::set_var(
EVM_ARITHMETIZATION_PKG_VER,
// see version.rs
env!("EVM_ARITHMETIZATION_PKG_VER"),
);
}
Expand All @@ -55,7 +54,7 @@ async fn main() -> Result<()> {
let args: Vec<String> = env::args().collect();

if args.contains(&"--version".to_string()) {
build_version::print_version(
version::print_version(
env!("EVM_ARITHMETIZATION_PKG_VER"),
env!("VERGEN_RUSTC_COMMIT_HASH"),
env!("VERGEN_BUILD_TIMESTAMP"),
Expand Down
2 changes: 1 addition & 1 deletion zero_bin/rpc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
build = "../common/src/build_version.rs"
build = "../common/build.rs"

[dependencies]
__compat_primitive_types = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions zero_bin/rpc/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use rpc::{retry::build_http_retry_provider, RpcType};
use tracing_subscriber::{prelude::*, EnvFilter};
use url::Url;
use zero_bin_common::block_interval::BlockInterval;
use zero_bin_common::build_version;
use zero_bin_common::version;

#[derive(Parser)]
pub enum Cli {
Expand Down Expand Up @@ -81,7 +81,7 @@ impl Cli {
async fn main() -> anyhow::Result<()> {
let args: Vec<String> = env::args().collect();
if args.contains(&"--version".to_string()) {
build_version::print_version(
version::print_version(
env!("EVM_ARITHMETIZATION_PKG_VER"),
env!("VERGEN_RUSTC_COMMIT_HASH"),
env!("VERGEN_BUILD_TIMESTAMP"),
Expand Down
2 changes: 1 addition & 1 deletion zero_bin/verifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "verifier"
authors = ["Polygon Zero <[email protected]>"]
version = "0.1.0"
edition = "2021"
build = "../common/src/build_version.rs"
build = "../common/build.rs"

[dependencies]
clap = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions zero_bin/verifier/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::string;
use std::path::PathBuf;

use clap::{Parser, ValueHint};
use zero_bin_common::prover_state::cli::CliProverStateConfig;
Expand All @@ -7,7 +7,7 @@ use zero_bin_common::prover_state::cli::CliProverStateConfig;
pub(crate) struct Cli {
/// The file containing the proof to verify
#[arg(short, long, value_hint = ValueHint::FilePath)]
pub(crate) file_path: string::String,
pub(crate) file_path: PathBuf,
/// The prover configuration used to generate the preprocessed circuits
/// and the verifier state.
#[clap(flatten)]
Expand Down
4 changes: 2 additions & 2 deletions zero_bin/verifier/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use dotenvy::dotenv;
use proof_gen::proof_types::GeneratedBlockProof;
use serde_json::Deserializer;
use tracing::info;
use zero_bin_common::build_version;
use zero_bin_common::version;

mod cli;
mod init;
Expand All @@ -18,7 +18,7 @@ fn main() -> Result<()> {

let args: Vec<String> = env::args().collect();
if args.contains(&"--version".to_string()) {
build_version::print_version(
version::print_version(
env!("EVM_ARITHMETIZATION_PKG_VER"),
env!("VERGEN_RUSTC_COMMIT_HASH"),
env!("VERGEN_BUILD_TIMESTAMP"),
Expand Down
2 changes: 1 addition & 1 deletion zero_bin/worker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license.workspace = true
repository.workspace = true
keywords.workspace = true
categories.workspace = true
build = "../common/src/build_version.rs"
build = "../common/build.rs"

[dependencies]
paladin-core = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions zero_bin/worker/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use clap::Parser;
use dotenvy::dotenv;
use ops::register;
use paladin::runtime::WorkerRuntime;
use zero_bin_common::build_version;
use zero_bin_common::prover_state::cli::CliProverStateConfig;
use zero_bin_common::version;

mod init;

Expand All @@ -28,7 +28,7 @@ struct Cli {
async fn main() -> Result<()> {
let args: Vec<String> = env::args().collect();
if args.contains(&"--version".to_string()) {
build_version::print_version(
version::print_version(
env!("EVM_ARITHMETIZATION_PKG_VER"),
env!("VERGEN_RUSTC_COMMIT_HASH"),
env!("VERGEN_BUILD_TIMESTAMP"),
Expand Down

0 comments on commit ce08f9a

Please sign in to comment.