Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
465006f
Implement tx submit evaluation via pallas
ginnun May 5, 2025
2ee68e0
Ignare dead code warnings in the test code
ginnun May 27, 2025
597b7c1
Update pallas and resolve breaking changes
ginnun May 28, 2025
52a6f76
chore: add missing compile-time dependencies
michalrus May 29, 2025
e45a901
chore: relax `cargo-deny`
michalrus May 29, 2025
bbf706a
chore: fix the OCI (Docker) build
michalrus May 30, 2025
f06e1a0
chore: lint the Dockerfile
michalrus May 30, 2025
581d7de
feat: Create compile config 'evaluate'
ginnun Jun 18, 2025
c177b7a
fix: `aarch64-linux` compilation of Pallas’ `phase2`
michalrus Jun 30, 2025
d719558
fix: a silly redirection bug
michalrus Jun 30, 2025
d99849e
fix: `cargo-clippy` issues
michalrus Jun 30, 2025
079683f
fix: `devshell` on `aarch64-linux`
michalrus Jun 30, 2025
65d0f78
fix: don’t use `musl` on `aarch64-linux` – back to GNU
michalrus Jun 30, 2025
46dc341
fix: drop `-fexternal-interpreter` for `plutus-core`
michalrus Jun 30, 2025
bf6469e
chore: update `nixpkgs` for the new Rust and Clippy
michalrus Jun 30, 2025
52cd86c
chore: apply Clippy’s corrections
michalrus Jun 30, 2025
136faf8
fix: the DMGs
michalrus Jul 1, 2025
e58483b
Merge pull request #332 from blockfrost/feat/phase2-aarch64-linux
vladimirvolek Jul 1, 2025
6795489
chore: use the native `aarch64-linux` build of `testgen-hs` (with ext…
michalrus Jul 3, 2025
0ee8127
feat: connect `testgen-hs` new `Tx'Conway` generator to the Rust eval…
michalrus Jul 7, 2025
9086d55
fix: compilation warnings about unused variables
michalrus Jul 7, 2025
c8e5fb0
fix: make the failures prettier, and _not_ `panic`s
michalrus Jul 7, 2025
d14978d
Merge pull request #340 from blockfrost/feat/tx-testgen
ginnun Jul 14, 2025
0fdfd5b
feat: Native Rust evaluate, Haskell evaluate and tests
ginnun Jul 24, 2025
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
584 changes: 223 additions & 361 deletions Cargo.lock

Large diffs are not rendered by default.

21 changes: 12 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@ sentry = "0.36.0"
blake2 = "0.10.6"
base64 = "0.22.1"
num_cpus = "1"
pallas = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha2" }
pallas-network = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha2" }
pallas-crypto = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha2" }
pallas-traverse = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha2" }
pallas-codec = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha2" }
pallas-addresses = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha2" }
pallas-primitives = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha2" }
pallas-hardano = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha2" }
pallas-validate = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha2" }
pallas-network = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha5" }
pallas-crypto = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha5" }
pallas-traverse = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha5" }
pallas-codec = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha5" }
pallas-addresses = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha5" }
pallas-primitives = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha5" }
pallas-hardano = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha5" }
reqwest = "0.12.12"
hex = "0.4.3"
metrics = { version = "0.24.1", default-features = false }
Expand All @@ -59,6 +57,11 @@ blockfrost-openapi = "0.1.75"
bech32 = "0.9.1"
cardano-serialization-lib = "12.1.1"

[target.'cfg(not(target_os = "windows"))'.dependencies]
pallas-validate = { git = "https://github.com/blockfrost/pallas.git", tag = "blockfrost-platform-0.0.3-alpha5", features = [
"phase2",
] }

[features]
tarpaulin = []

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM lukemathwalker/cargo-chef:0.1.68-rust-slim-bookworm AS base
RUN apt-get update ; apt-get install sccache=0.4.* pkg-config=1.8.* libssl-dev=3.0.* bzip2=1.0.* -y --no-install-recommends \
RUN apt-get update ; apt-get install build-essential=12.* m4=1.4.* sccache=0.4.* pkg-config=1.8.* libssl-dev=3.0.* bzip2=1.0.* -y --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV RUSTC_WRAPPER=sccache SCCACHE_DIR=/sccache
Expand Down
90 changes: 54 additions & 36 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
fn main() {
let os = target_os();
let arch = target_arch();

git_revision::set();
testgen_hs::ensure();
features::evaluate(os, arch);
testgen_hs::ensure(os, arch);
}

fn target_os() -> &'static str {
(if cfg!(target_os = "macos") {
"darwin"
} else if cfg!(target_os = "linux") {
"linux"
} else if cfg!(target_os = "windows") {
"windows"
} else {
panic!("Unsupported OS");
}) as _
}

fn target_arch() -> &'static str {
(if cfg!(target_arch = "x86_64") {
"x86_64"
} else if cfg!(target_arch = "aarch64") {
"aarch64"
} else {
panic!("Unsupported architecture");
}) as _
}
mod git_revision {
use std::env;

Expand All @@ -12,7 +37,7 @@ mod git_revision {
use std::process::Command;

if env::var(GIT_REVISION).is_ok() {
println!("Environment variable {} is set. Not setting.", GIT_REVISION);
println!("Environment variable {GIT_REVISION} is set. Not setting.");
return;
}

Expand All @@ -33,7 +58,7 @@ mod git_revision {
.to_string()
};

println!("cargo:rustc-env={}={}", GIT_REVISION, revision);
println!("cargo:rustc-env={GIT_REVISION}={revision}");
}
}

Expand All @@ -50,48 +75,26 @@ mod testgen_hs {

const TESTGEN_HS_PATH: &str = "TESTGEN_HS_PATH";

pub fn ensure() {
pub fn ensure(target_os: &str, arch: &str) {
if env::var(TESTGEN_HS_PATH).is_ok() {
println!(
"Environment variable {} is set. Skipping the download.",
TESTGEN_HS_PATH
);
println!("Environment variable {TESTGEN_HS_PATH} is set. Skipping the download.");
return;
}

let testgen_lib_version = "10.4.1.0";

let target_os = if cfg!(target_os = "macos") {
"darwin"
} else if cfg!(target_os = "linux") {
"linux"
} else if cfg!(target_os = "windows") {
"windows"
} else {
panic!("Unsupported OS");
};

let arch = if cfg!(target_arch = "x86_64") {
"x86_64"
} else if cfg!(target_arch = "aarch64") {
"aarch64"
} else {
panic!("Unsupported architecture");
};
let testgen_lib_version = "10.4.1.2";

let suffix = if target_os == "windows" {
".zip"
} else {
".tar.bz2"
};

let file_name = format!("testgen-hs-{}-{}-{}", testgen_lib_version, arch, target_os);
let file_name = format!("testgen-hs-{testgen_lib_version}-{arch}-{target_os}");
let download_url = format!(
"https://github.com/input-output-hk/testgen-hs/releases/download/{}/{}{}",
testgen_lib_version, file_name, suffix
"https://github.com/input-output-hk/testgen-hs/releases/download/{testgen_lib_version}/{file_name}{suffix}"
);

println!("Looking for {}", file_name);
println!("Looking for {file_name}");

// Use the project’s target directory instead of a system cache location.
let cargo_manifest_dir =
Expand All @@ -105,16 +108,16 @@ mod testgen_hs {
create_dir_all(&download_dir).expect("Unable to create testgen directory");

let archive_name = if target_os == "windows" {
format!("{}.zip", file_name)
format!("{file_name}.zip")
} else {
format!("{}.tar.bz2", file_name)
format!("{file_name}.tar.bz2")
};

let archive_path = download_dir.join(&archive_name);

// Download the artifact if not already in the target directory.
if !archive_path.exists() {
println!("Downloading from: {}", download_url);
println!("Downloading from: {download_url}");

let response = reqwest::blocking::get(&download_url)
.expect("Failed to download archive")
Expand Down Expand Up @@ -158,7 +161,7 @@ mod testgen_hs {

// Verify version by running --version.
println!("Verifying testgen-hs version...");
println!("Executing: {:?}", executable);
println!("Executing: {executable:?}");

let output = Command::new(&executable)
.arg("--version")
Expand All @@ -175,7 +178,7 @@ mod testgen_hs {
let version_output = String::from_utf8_lossy(&output.stdout);
println!("testgen-hs version: {}", version_output.trim());

let testgen_lib_version = format!("testgen-hs {}", testgen_lib_version);
let testgen_lib_version = format!("testgen-hs {testgen_lib_version}");

if version_output.trim() != testgen_lib_version {
panic!(
Expand Down Expand Up @@ -227,3 +230,18 @@ mod testgen_hs {
}
}
}

mod features {
pub fn evaluate(target_os: &str, target_arch: &str) {
println!("cargo::rustc-check-cfg=cfg(evaluate)");

if target_os == "windows" {
println!("cargo:warning=Skipping 'evaluate' cfg for {target_os}-{target_arch}");
} else {
println!(
"cargo:warning=Going to build with 'evaluate' cfg for {target_os}-{target_arch}"
);
println!("cargo:rustc-cfg=evaluate");
}
}
}
1 change: 1 addition & 0 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ allow = [
"BSD-3-Clause",
"CC0-1.0",
"ISC",
"LGPL-3.0",
"MIT",
"Unicode-3.0",
"MPL-2.0",
Expand Down
58 changes: 29 additions & 29 deletions flake.lock

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

Loading
Loading