diff --git a/Cargo.lock b/Cargo.lock index 28330a82..87641106 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -49,6 +49,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -121,15 +127,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] -name = "async-trait" -version = "0.1.88" +name = "arrayvec" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "atomic-waker" @@ -150,7 +151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de45108900e1f9b9242f7f2e254aa3e2c029c921c258fe9e6b4217eeebd54288" dependencies = [ "axum-core", - "base64 0.22.1", + "base64", "bytes", "form_urlencoded", "futures-util", @@ -221,12 +222,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -270,7 +265,7 @@ dependencies = [ "bitflags 2.9.0", "cexpr", "clang-sys", - "itertools 0.13.0", + "itertools 0.10.5", "proc-macro2", "quote", "regex", @@ -285,8 +280,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33415e24172c1b7d6066f6d999545375ab8e1d95421d6784bdfff9496f292387" dependencies = [ - "bitcoin_hashes", - "rand_core 0.6.4", + "bitcoin_hashes 0.13.0", "serde", "unicode-normalization", ] @@ -312,6 +306,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" +[[package]] +name = "bitcoin-io" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" + [[package]] name = "bitcoin_hashes" version = "0.13.0" @@ -319,7 +319,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" dependencies = [ "bitcoin-internals", - "hex-conservative", + "hex-conservative 0.1.2", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" +dependencies = [ + "bitcoin-io", + "hex-conservative 0.2.1", ] [[package]] @@ -397,7 +407,7 @@ version = "0.0.2" dependencies = [ "anyhow", "axum", - "base64 0.22.1", + "base64", "bech32 0.9.1", "bip39", "blake2", @@ -421,7 +431,6 @@ dependencies = [ "metrics-exporter-prometheus", "metrics-process", "num_cpus", - "pallas", "pallas-addresses", "pallas-codec", "pallas-crypto", @@ -456,6 +465,18 @@ dependencies = [ "zip", ] +[[package]] +name = "blst" +version = "0.3.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fd49896f12ac9b6dcd7a5998466b9b58263a695a3dd1ecc1aaca2e12a90b080" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "bumpalo" version = "3.17.0" @@ -575,6 +596,19 @@ dependencies = [ "windows-link", ] +[[package]] +name = "chumsky" +version = "1.0.0-alpha.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7b80276986f86789dc56ca6542d53bba9cda3c66091ebbe7bd96fc1bdf20f1f" +dependencies = [ + "hashbrown 0.14.5", + "regex-automata 0.3.9", + "serde", + "stacker", + "unicode-ident", +] + [[package]] name = "cipher" version = "0.4.4" @@ -1084,12 +1118,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "fixedbitset" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" - [[package]] name = "flate2" version = "1.1.1" @@ -1344,6 +1372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", + "allocator-api2", ] [[package]] @@ -1394,6 +1423,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" +[[package]] +name = "hex-conservative" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" +dependencies = [ + "arrayvec", +] + [[package]] name = "hmac" version = "0.12.1" @@ -1546,7 +1584,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.61.0", + "windows-core 0.58.0", ] [[package]] @@ -1558,6 +1596,17 @@ dependencies = [ "cc", ] +[[package]] +name = "ibig" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1fcc7f316b2c079dde77564a1360639c1a956a23fa96122732e416cb10717bb" +dependencies = [ + "cfg-if", + "num-traits", + "static_assertions", +] + [[package]] name = "icu_collections" version = "1.5.0" @@ -1843,7 +1892,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.48.5", ] [[package]] @@ -1957,7 +2006,7 @@ version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd7399781913e5393588a8d8c6a2867bf85fb38eaf2502fdce465aad2dc6f034" dependencies = [ - "base64 0.22.1", + "base64", "indexmap 2.9.0", "metrics", "metrics-util", @@ -2013,6 +2062,15 @@ dependencies = [ "unicase", ] +[[package]] +name = "minicbor" +version = "0.25.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0452a60c1863c1f50b5f77cd295e8d2786849f35883f0b9e18e7e6e1b5691b0" +dependencies = [ + "minicbor-derive 0.15.3", +] + [[package]] name = "minicbor" version = "0.26.4" @@ -2020,7 +2078,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acb9d59e79ad66121ab441a0d1950890906a41e01ae14145ecf8401aa8894f50" dependencies = [ "half", - "minicbor-derive", + "minicbor-derive 0.16.2", +] + +[[package]] +name = "minicbor-derive" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd2209fff77f705b00c737016a48e73733d7fbccb8b007194db148f03561fb70" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", ] [[package]] @@ -2072,12 +2141,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "multimap" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" - [[package]] name = "native-tls" version = "0.2.14" @@ -2327,27 +2390,10 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" -[[package]] -name = "pallas" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" -dependencies = [ - "pallas-addresses", - "pallas-codec", - "pallas-configs", - "pallas-crypto", - "pallas-network", - "pallas-primitives", - "pallas-traverse", - "pallas-txbuilder", - "pallas-utxorpc", - "pallas-validate", -] - [[package]] name = "pallas-addresses" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" +version = "1.0.0-alpha.2" +source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha5#b35d3bd96f29cb19b80fbc0acfa038532ddd0da4" dependencies = [ "base58", "bech32 0.9.1", @@ -2361,34 +2407,19 @@ dependencies = [ [[package]] name = "pallas-codec" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" +version = "1.0.0-alpha.2" +source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha5#b35d3bd96f29cb19b80fbc0acfa038532ddd0da4" dependencies = [ "hex", - "minicbor", + "minicbor 0.26.4", "serde", "thiserror 1.0.69", ] -[[package]] -name = "pallas-configs" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" -dependencies = [ - "base64 0.22.1", - "num-rational", - "pallas-addresses", - "pallas-crypto", - "pallas-primitives", - "serde", - "serde_json", - "serde_with", -] - [[package]] name = "pallas-crypto" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" +version = "1.0.0-alpha.2" +source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha5#b35d3bd96f29cb19b80fbc0acfa038532ddd0da4" dependencies = [ "cryptoxide", "hex", @@ -2400,8 +2431,8 @@ dependencies = [ [[package]] name = "pallas-hardano" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" +version = "1.0.0-alpha.2" +source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha5#b35d3bd96f29cb19b80fbc0acfa038532ddd0da4" dependencies = [ "binary-layout", "hex", @@ -2420,8 +2451,8 @@ dependencies = [ [[package]] name = "pallas-network" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" +version = "1.0.0-alpha.2" +source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha5#b35d3bd96f29cb19b80fbc0acfa038532ddd0da4" dependencies = [ "byteorder", "hex", @@ -2437,8 +2468,8 @@ dependencies = [ [[package]] name = "pallas-primitives" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" +version = "1.0.0-alpha.2" +source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha5#b35d3bd96f29cb19b80fbc0acfa038532ddd0da4" dependencies = [ "hex", "pallas-codec", @@ -2449,8 +2480,8 @@ dependencies = [ [[package]] name = "pallas-traverse" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" +version = "1.0.0-alpha.2" +source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha5#b35d3bd96f29cb19b80fbc0acfa038532ddd0da4" dependencies = [ "hex", "itertools 0.13.0", @@ -2463,41 +2494,10 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "pallas-txbuilder" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" -dependencies = [ - "hex", - "pallas-addresses", - "pallas-codec", - "pallas-crypto", - "pallas-primitives", - "pallas-traverse", - "pallas-wallet", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "pallas-utxorpc" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" -dependencies = [ - "pallas-codec", - "pallas-crypto", - "pallas-primitives", - "pallas-traverse", - "pallas-validate", - "prost-types", - "utxorpc-spec", -] - [[package]] name = "pallas-validate" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" +version = "1.0.0-alpha.2" +source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha5#b35d3bd96f29cb19b80fbc0acfa038532ddd0da4" dependencies = [ "chrono", "hex", @@ -2510,20 +2510,7 @@ dependencies = [ "serde", "thiserror 1.0.69", "tracing", -] - -[[package]] -name = "pallas-wallet" -version = "1.0.0-alpha.1" -source = "git+https://github.com/blockfrost/pallas.git?tag=blockfrost-platform-0.0.3-alpha2#fa233715b67b22fd8b191c9294858a3185e1207b" -dependencies = [ - "bech32 0.9.1", - "bip39", - "cryptoxide", - "ed25519-bip32", - "pallas-crypto", - "rand 0.8.5", - "thiserror 1.0.69", + "uplc-turbo", ] [[package]] @@ -2566,43 +2553,6 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" -[[package]] -name = "pbjson" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e6349fa080353f4a597daffd05cb81572a9c031a6d4fff7e504947496fcc68" -dependencies = [ - "base64 0.21.7", - "serde", -] - -[[package]] -name = "pbjson-build" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eea3058763d6e656105d1403cb04e0a41b7bbac6362d413e7c33be0c32279c9" -dependencies = [ - "heck 0.5.0", - "itertools 0.13.0", - "prost", - "prost-types", -] - -[[package]] -name = "pbjson-types" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54e5e7bfb1652f95bc361d76f3c780d8e526b134b85417e774166ee941f0887" -dependencies = [ - "bytes", - "chrono", - "pbjson", - "pbjson-build", - "prost", - "prost-build", - "serde", -] - [[package]] name = "pbkdf2" version = "0.11.0" @@ -2621,36 +2571,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "petgraph" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" -dependencies = [ - "fixedbitset", - "indexmap 2.9.0", -] - -[[package]] -name = "pin-project" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "pin-project-lite" version = "0.2.16" @@ -2700,16 +2620,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "prettyplease" -version = "0.2.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" -dependencies = [ - "proc-macro2", - "syn 2.0.100", -] - [[package]] name = "proc-macro-crate" version = "3.3.0" @@ -2771,55 +2681,12 @@ dependencies = [ ] [[package]] -name = "prost" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-build" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" -dependencies = [ - "heck 0.5.0", - "itertools 0.14.0", - "log", - "multimap", - "once_cell", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn 2.0.100", - "tempfile", -] - -[[package]] -name = "prost-derive" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" -dependencies = [ - "anyhow", - "itertools 0.14.0", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "prost-types" -version = "0.13.5" +name = "psm" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ - "prost", + "cc", ] [[package]] @@ -3062,6 +2929,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.5", +] + [[package]] name = "regex-automata" version = "0.4.9" @@ -3079,6 +2957,12 @@ version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + [[package]] name = "regex-syntax" version = "0.8.5" @@ -3097,7 +2981,7 @@ version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ - "base64 0.22.1", + "base64", "bytes", "encoding_rs", "futures-channel", @@ -3339,6 +3223,26 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "secp256k1" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" +dependencies = [ + "bitcoin_hashes 0.14.0", + "rand 0.8.5", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" +dependencies = [ + "cc", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -3567,7 +3471,7 @@ version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" dependencies = [ - "base64 0.22.1", + "base64", "chrono", "hex", "indexmap 1.9.3", @@ -3717,6 +3621,25 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "stacker" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cddb07e32ddb770749da91081d8d0ac3a16f1a569a18b20348cd371f5dead06b" +dependencies = [ + "cc", + "cfg-if", + "libc", + "psm", + "windows-sys 0.59.0", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.11.1" @@ -3886,6 +3809,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "time" version = "0.3.41" @@ -3990,17 +3922,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-stream" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-tungstenite" version = "0.26.2" @@ -4069,27 +3990,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tonic" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" -dependencies = [ - "async-trait", - "base64 0.22.1", - "bytes", - "http", - "http-body", - "http-body-util", - "percent-encoding", - "pin-project", - "prost", - "tokio-stream", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tower" version = "0.5.2" @@ -4315,13 +4215,30 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "uplc-turbo" +version = "0.1.0" +source = "git+https://github.com/txpipe/uplc-turbo.git?rev=bd174b3#bd174b318a69b09d4b67642e60b60cc2be51b087" +dependencies = [ + "blst", + "bumpalo", + "chumsky", + "cryptoxide", + "ibig", + "minicbor 0.25.1", + "num-traits", + "once_cell", + "secp256k1", + "thiserror 1.0.69", +] + [[package]] name = "ureq" version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" dependencies = [ - "base64 0.22.1", + "base64", "log", "native-tls", "once_cell", @@ -4364,22 +4281,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" -[[package]] -name = "utxorpc-spec" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7148c5cd211c397a41245cfbd8d4cb8371d748ed5e3cf131ebcd9cacfa794206" -dependencies = [ - "bytes", - "futures-core", - "pbjson", - "pbjson-types", - "prost", - "prost-types", - "serde", - "tonic", -] - [[package]] name = "uuid" version = "1.16.0" @@ -4580,23 +4481,10 @@ dependencies = [ "windows-implement 0.58.0", "windows-interface 0.58.0", "windows-result 0.2.0", - "windows-strings 0.1.0", + "windows-strings", "windows-targets 0.52.6", ] -[[package]] -name = "windows-core" -version = "0.61.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" -dependencies = [ - "windows-implement 0.60.0", - "windows-interface 0.59.1", - "windows-link", - "windows-result 0.3.2", - "windows-strings 0.4.0", -] - [[package]] name = "windows-implement" version = "0.57.0" @@ -4619,17 +4507,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "windows-implement" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "windows-interface" version = "0.57.0" @@ -4652,17 +4529,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "windows-interface" -version = "0.59.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "windows-link" version = "0.1.1" @@ -4676,7 +4542,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ "windows-result 0.2.0", - "windows-strings 0.1.0", + "windows-strings", "windows-targets 0.52.6", ] @@ -4698,15 +4564,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-result" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" -dependencies = [ - "windows-link", -] - [[package]] name = "windows-strings" version = "0.1.0" @@ -4717,15 +4574,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-strings" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" -dependencies = [ - "windows-link", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -5010,6 +4858,20 @@ name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] [[package]] name = "zerovec" diff --git a/Cargo.toml b/Cargo.toml index 3fe039ae..bb346f02 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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 } @@ -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 = [] diff --git a/Dockerfile b/Dockerfile index 22899df8..a6cf3e81 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/build.rs b/build.rs index 17dc484a..c20823b2 100644 --- a/build.rs +++ b/build.rs @@ -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; @@ -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; } @@ -33,7 +58,7 @@ mod git_revision { .to_string() }; - println!("cargo:rustc-env={}={}", GIT_REVISION, revision); + println!("cargo:rustc-env={GIT_REVISION}={revision}"); } } @@ -50,34 +75,13 @@ 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" @@ -85,13 +89,12 @@ mod testgen_hs { ".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 = @@ -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") @@ -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") @@ -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!( @@ -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"); + } + } +} diff --git a/deny.toml b/deny.toml index 55a4d71e..e8792caf 100644 --- a/deny.toml +++ b/deny.toml @@ -5,6 +5,7 @@ allow = [ "BSD-3-Clause", "CC0-1.0", "ISC", + "LGPL-3.0", "MIT", "Unicode-3.0", "MPL-2.0", diff --git a/flake.lock b/flake.lock index 587928ab..e2534c77 100644 --- a/flake.lock +++ b/flake.lock @@ -3,11 +3,11 @@ "advisory-db": { "flake": false, "locked": { - "lastModified": 1748950236, - "narHash": "sha256-kNiGMrXi5Bq/aWoQmnpK0v+ufQA4FOInhbkY56iUndc=", + "lastModified": 1750151065, + "narHash": "sha256-il+CAqChFIB82xP6bO43dWlUVs+NlG7a4g8liIP5HcI=", "owner": "rustsec", "repo": "advisory-db", - "rev": "a1f651cba8bf224f52c5d55d8182b3bb0ebce49e", + "rev": "7573f55ba337263f61167dbb0ea926cdc7c8eb5d", "type": "github" }, "original": { @@ -52,11 +52,11 @@ }, "crane": { "locked": { - "lastModified": 1743908961, - "narHash": "sha256-e1idZdpnnHWuosI3KsBgAgrhMR05T2oqskXCmNzGPq0=", + "lastModified": 1750266157, + "narHash": "sha256-tL42YoNg9y30u7zAqtoGDNdTyXTi8EALDeCB13FtbQA=", "owner": "ipetkov", "repo": "crane", - "rev": "80ceeec0dc94ef967c371dcdc56adb280328f591", + "rev": "e37c943371b73ed87faf33f7583860f81f1d5a48", "type": "github" }, "original": { @@ -93,11 +93,11 @@ "rust-analyzer-src": "rust-analyzer-src" }, "locked": { - "lastModified": 1742452566, - "narHash": "sha256-sVuLDQ2UIWfXUBbctzrZrXM2X05YjX08K7XHMztt36E=", + "lastModified": 1751265761, + "narHash": "sha256-VSbk7ppgFSqBxlsWtzIO52iT9TKkLJrmVYOIhQi13Kg=", "owner": "nix-community", "repo": "fenix", - "rev": "7d9ba794daf5e8cc7ee728859bc688d8e26d5f06", + "rev": "19c910fe3de1768e64e76b5ee6daa346e6b07410", "type": "github" }, "original": { @@ -127,11 +127,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1743550720, - "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "lastModified": 1749398372, + "narHash": "sha256-tYBdgS56eXYaWVW3fsnPQ/nFlgWi/Z2Ymhyu21zVM98=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "rev": "9305fe4e5c2a6fcf5ba6a3ff155720fbe4076569", "type": "github" }, "original": { @@ -158,27 +158,27 @@ }, "nixpkgs": { "locked": { - "lastModified": 1743975612, - "narHash": "sha256-o4FjFOUmjSRMK7dn0TFdAT0RRWUWD+WsspPHa+qEQT8=", + "lastModified": 1751211869, + "narHash": "sha256-1Cu92i1KSPbhPCKxoiVG5qnoRiKTgR5CcGSRyLpOd7Y=", "owner": "nixos", "repo": "nixpkgs", - "rev": "a880f49904d68b5e53338d1e8c7bf80f59903928", + "rev": "b43c397f6c213918d6cfe6e3550abfe79b5d1c51", "type": "github" }, "original": { "owner": "nixos", - "ref": "nixos-24.11", + "ref": "nixos-25.05", "repo": "nixpkgs", "type": "github" } }, "nixpkgs-lib": { "locked": { - "lastModified": 1743296961, - "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "lastModified": 1748740939, + "narHash": "sha256-rQaysilft1aVMwF14xIdGS3sj1yHlI6oKQNBRTF40cc=", "owner": "nix-community", "repo": "nixpkgs.lib", - "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "rev": "656a64127e9d791a334452c6b6606d17539476e2", "type": "github" }, "original": { @@ -224,11 +224,11 @@ "rust-analyzer-src": { "flake": false, "locked": { - "lastModified": 1742296961, - "narHash": "sha256-gCpvEQOrugHWLimD1wTFOJHagnSEP6VYBDspq96Idu0=", + "lastModified": 1751210071, + "narHash": "sha256-v7XmmLBNRMzRXiVCeH60ZeGEqo+aagmwawI0Z9+EoXY=", "owner": "rust-lang", "repo": "rust-analyzer", - "rev": "15d87419f1a123d8f888d608129c3ce3ff8f13d4", + "rev": "6df12139bccaaeecf6a34789e0ca799d1fe99c53", "type": "github" }, "original": { @@ -241,16 +241,16 @@ "testgen-hs": { "flake": false, "locked": { - "lastModified": 1748953639, - "narHash": "sha256-DgbM5UUsxYMPJ1nl19AnCi3VdTj8WElB1A7zSE8iPII=", + "lastModified": 1751542906, + "narHash": "sha256-FYz1P11du5tSakpl2ec9CGdwEB5h+0FcdGPU3zXte60=", "owner": "input-output-hk", "repo": "testgen-hs", - "rev": "4f81d654fbd4a2bfa9d00c99b75e9725e8abd8e7", + "rev": "7d58736ed578a9ccf8337376b302bb188b74303f", "type": "github" }, "original": { "owner": "input-output-hk", - "ref": "10.4.1.0", + "ref": "10.4.1.2", "repo": "testgen-hs", "type": "github" } @@ -262,11 +262,11 @@ ] }, "locked": { - "lastModified": 1743748085, - "narHash": "sha256-uhjnlaVTWo5iD3LXics1rp9gaKgDRQj6660+gbUU3cE=", + "lastModified": 1750931469, + "narHash": "sha256-0IEdQB1nS+uViQw4k3VGUXntjkDp7aAlqcxdewb/hAc=", "owner": "numtide", "repo": "treefmt-nix", - "rev": "815e4121d6a5d504c0f96e5be2dd7f871e4fd99d", + "rev": "ac8e6f32e11e9c7f153823abc3ab007f2a65d3e1", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index a1224f05..fee8cc54 100644 --- a/flake.nix +++ b/flake.nix @@ -1,6 +1,6 @@ { inputs = { - nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11"; + nixpkgs.url = "github:nixos/nixpkgs/nixos-25.05"; flake-parts.url = "github:hercules-ci/flake-parts"; treefmt-nix.url = "github:numtide/treefmt-nix"; treefmt-nix.inputs.nixpkgs.follows = "nixpkgs"; @@ -11,7 +11,7 @@ flake-compat.flake = false; cardano-node.url = "github:IntersectMBO/cardano-node/10.4.1"; cardano-node.flake = false; # otherwise, +2k dependencies we don’t really use - testgen-hs.url = "github:input-output-hk/testgen-hs/10.4.1.0"; # make sure it follows cardano-node + testgen-hs.url = "github:input-output-hk/testgen-hs/10.4.1.2"; # make sure it follows cardano-node testgen-hs.flake = false; # otherwise, +2k dependencies we don’t really use devshell.url = "github:numtide/devshell"; devshell.inputs.nixpkgs.follows = "nixpkgs"; @@ -36,7 +36,7 @@ systems = [ "x86_64-linux" - # "aarch64-linux" + "aarch64-linux" "aarch64-darwin" "x86_64-darwin" ]; @@ -51,7 +51,6 @@ } // (lib.optionalAttrs (system == "x86_64-linux") { blockfrost-platform-x86_64-windows = inputs.self.internal.x86_64-windows.package; - blockfrost-platform-aarch64-linux = inputs.self.internal.aarch64-linux.package; }); devshells.default = import ./nix/devshells.nix {inherit inputs;}; @@ -113,9 +112,6 @@ ) // lib.genAttrs ["x86_64-windows"] ( targetSystem: import ./nix/internal/windows.nix {inherit inputs targetSystem;} - ) - // lib.genAttrs ["aarch64-linux"] ( - targetSystem: import ./nix/internal/linux-cross-arm64.nix {inherit inputs targetSystem;} ); nixosModule = { @@ -128,7 +124,7 @@ }; hydraJobs = let - crossSystems = ["x86_64-windows" "aarch64-linux"]; + crossSystems = ["x86_64-windows"]; allJobs = { blockfrost-platform = lib.genAttrs (config.systems ++ crossSystems) ( targetSystem: inputs.self.internal.${targetSystem}.package diff --git a/nix/devshells.nix b/nix/devshells.nix index be8ee28f..638e5a55 100644 --- a/nix/devshells.nix +++ b/nix/devshells.nix @@ -10,7 +10,6 @@ in { imports = [ "${inputs.devshell}/extra/language/c.nix" - "${inputs.devshell}/extra/language/rust.nix" ]; commands = [ @@ -31,10 +30,11 @@ in { name = "cardano-address"; package = internal.cardano-address; } - {package = config.language.rust.packageSet.cargo;} {package = pkgs.cargo-nextest;} {package = pkgs.cargo-tarpaulin;} - {package = config.language.rust.packageSet.rust-analyzer;} + {package = internal.rustPackages.cargo;} + {package = internal.rustPackages.clippy;} + {package = internal.rustPackages.rust-analyzer;} { category = "handy"; package = internal.runNode "preview"; @@ -66,18 +66,16 @@ in { includes = internal.commonArgs.buildInputs; }; - language.rust.packageSet = - internal.rustPackages - // { - clippy = internal.rustPackages.clippy-unwrapped; - }; - env = [ { name = "TESTGEN_HS_PATH"; value = lib.getExe internal.testgen-hs; } + { + name = "RUST_SRC_PATH"; + value = "${internal.rustPackages.rust-src}/lib/rustlib/src/rust/library"; + } ] ++ lib.optionals pkgs.stdenv.isDarwin [ { @@ -88,7 +86,13 @@ in { devshell = { packages = - [pkgs.unixtools.xxd] + [ + pkgs.unixtools.xxd + pkgs.gnum4 + pkgs.gnumake + pkgs.gawk + pkgs.diffutils + ] ++ lib.optionals pkgs.stdenv.isLinux [ pkgs.pkg-config ] diff --git a/nix/internal/darwin.nix b/nix/internal/darwin.nix index c85fbc62..59a3c48d 100644 --- a/nix/internal/darwin.nix +++ b/nix/internal/darwin.nix @@ -40,19 +40,18 @@ in }; # Portable directory that can be run on any modern Darwin: - bundle = - (nix-bundle-exe-lib-subdir "${unix.package}/libexec/${unix.packageName}") + bundle = (nix-bundle-exe-lib-subdir "${unix.package}/libexec/${unix.packageName}") .overrideAttrs (drv: { - name = unix.packageName; - buildCommand = - drv.buildCommand - + '' - mkdir -p $out/libexec - mv $out/{${unix.packageName},lib} $out/libexec - mkdir -p $out/bin - ( cd $out/bin ; ln -s ../libexec/${unix.packageName} ./ ; ) - ''; - }); + name = unix.packageName; + buildCommand = + drv.buildCommand + + '' + mkdir -p $out/libexec + mv $out/{${unix.packageName},lib} $out/libexec + mkdir -p $out/bin + ( cd $out/bin ; ln -s ../libexec/${unix.packageName} ./ ; ) + ''; + }); bundle-testgen-hs = nix-bundle-exe-lib-subdir (lib.getExe unix.testgen-hs); @@ -427,7 +426,7 @@ in }; buildInputs = with pkgs; [apple-sdk_11 (darwinMinVersionHook "11.0") darwin.libffi]; hardeningDisable = ["strictoverflow"]; # -fno-strict-overflow is not supported in clang on darwin - NIX_CFLAGS_COMPILE = ["-Wno-error=deprecated-declarations" "-Wno-error=cast-of-sel-type"]; + NIX_CFLAGS_COMPILE = ["-Wno-error=deprecated-declarations" "-Wno-error=cast-of-sel-type" "-Wno-error=cast-function-type-mismatch"]; preBuild = commonPreBuild + '' diff --git a/nix/internal/linux-cross-arm64.nix b/nix/internal/linux-cross-arm64.nix deleted file mode 100644 index 0c29fa48..00000000 --- a/nix/internal/linux-cross-arm64.nix +++ /dev/null @@ -1,92 +0,0 @@ -{ - inputs, - targetSystem, -}: -assert builtins.elem targetSystem ["aarch64-linux"]; let - buildSystem = "x86_64-linux"; - pkgs = inputs.nixpkgs.legacyPackages.${buildSystem}; -in rec { - toolchain = with inputs.fenix.packages.${buildSystem}; - combine [ - minimal.rustc - minimal.cargo - targets.aarch64-unknown-linux-gnu.latest.rust-std - ]; - - craneLib = (inputs.crane.mkLib pkgs).overrideToolchain toolchain; - - src = craneLib.cleanCargoSource ../../.; - - pkgsCross = pkgs.pkgsCross.aarch64-multiplatform; - - commonArgs = rec { - inherit src; - strictDeps = true; - - CARGO_BUILD_TARGET = "aarch64-unknown-linux-gnu"; - TARGET_CC = "${pkgsCross.stdenv.cc}/bin/${pkgsCross.stdenv.cc.targetPrefix}cc"; - - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER = TARGET_CC; - - TESTGEN_HS_PATH = "unused"; # Don’t try to download it in `build.rs`. - - OPENSSL_DIR = "${pkgsCross.openssl.dev}"; - OPENSSL_LIB_DIR = "${pkgsCross.openssl.out}/lib"; - OPENSSL_INCLUDE_DIR = "${pkgsCross.openssl.dev}/include/"; - - depsBuildBuild = [ - pkgsCross.stdenv.cc - #pkgsCross.windows.pthreads - ]; - }; - - # For better caching: - cargoArtifacts = craneLib.buildDepsOnly commonArgs; - - packageName = (craneLib.crateNameFromCargoToml {cargoToml = src + "/Cargo.toml";}).pname; - - GIT_REVISION = inputs.self.rev or "dirty"; - - package = craneLib.buildPackage (commonArgs - // { - inherit cargoArtifacts GIT_REVISION; - doCheck = false; - postPatch = '' - sed -r '/^build = .*/d' -i Cargo.toml - rm build.rs - ''; - }); - - archive = let - outFileName = "${package.pname}-${package.version}-${inputs.self.shortRev or "dirty"}-${targetSystem}.tar.bz2"; - in - pkgs.runCommandNoCC "${package.pname}-archive" {} '' - cp -r ${bundle} ${package.pname} - - mkdir -p $out - tar -cjvf $out/${outFileName} ${package.pname}/ - - # Make it downloadable from Hydra: - mkdir -p $out/nix-support - echo "file binary-dist \"$out/${outFileName}\"" >$out/nix-support/hydra-build-products - ''; - - nix-bundle-exe = import inputs.nix-bundle-exe; - - # Portable directory that can be run on any modern Linux: - bundle = - (nix-bundle-exe { - inherit pkgs; - bin_dir = "bin"; - exe_dir = "exe"; - lib_dir = "lib"; - } "${package}/bin/${packageName}") - .overrideAttrs (drv: { - name = packageName; - buildCommand = - drv.buildCommand - + '' - ( cd $out ; ln -s bin/${packageName} . ; ) - ''; - }); -} diff --git a/nix/internal/unix.nix b/nix/internal/unix.nix index 784f9edf..2864d946 100644 --- a/nix/internal/unix.nix +++ b/nix/internal/unix.nix @@ -27,13 +27,16 @@ in { inherit src; strictDeps = true; - nativeBuildInputs = lib.optionals pkgs.stdenv.isLinux [ - pkgs.pkg-config - ]; + nativeBuildInputs = + [pkgs.gnum4] + ++ lib.optionals pkgs.stdenv.isLinux [ + pkgs.pkg-config + ]; TESTGEN_HS_PATH = lib.getExe testgen-hs; # Don’t try to download it in `build.rs`. buildInputs = lib.optionals pkgs.stdenv.isLinux [ pkgs.openssl + pkgs.gnum4 ] ++ lib.optionals pkgs.stdenv.isDarwin [ pkgs.libiconv @@ -163,14 +166,17 @@ in in (import inputs.flake-compat { src = - if targetSystem != "aarch64-darwin" + if targetSystem != "aarch64-darwin" && targetSystem != "aarch64-linux" then unpatched else { outPath = toString (pkgs.runCommand "source" {} '' cp -r ${unpatched} $out chmod -R +w $out cd $out - echo ${lib.escapeShellArg (builtins.toJSON [targetSystem])} $out/nix/supported-systems.nix + echo ${lib.escapeShellArg (builtins.toJSON [targetSystem])} >$out/nix/supported-systems.nix + ${lib.optionalString (targetSystem == "aarch64-linux") '' + sed -r 's/"-fexternal-interpreter"//g' -i $out/nix/haskell.nix + ''} ''); inherit (unpatched) rev shortRev lastModified lastModifiedDate; }; @@ -180,9 +186,11 @@ in cardano-node-packages = { x86_64-linux = cardano-node-flake.hydraJobs.x86_64-linux.musl; - inherit (cardano-node-flake.packages) x86_64-darwin aarch64-darwin; + inherit (cardano-node-flake.packages) x86_64-darwin aarch64-darwin aarch64-linux; } - .${targetSystem}; + .${ + targetSystem + }; inherit (cardano-node-packages) cardano-node cardano-cli cardano-submit-api; @@ -234,37 +242,51 @@ in # For generating a signing key from a recovery phrase. It’s a little # controversial to download a binary, but we only need it for the devshell. If # needed, we can use the source instead. - cardano-address = let - release = "v2024-09-29"; - baseUrl = "https://github.com/cardano-foundation/cardano-wallet/releases/download/${release}/cardano-wallet"; - archive = pkgs.fetchzip { - name = "cardano-wallet-${release}"; - url = - { - "x86_64-linux" = "${baseUrl}-${release}-linux64.tar.gz"; - "x86_64-darwin" = "${baseUrl}-${release}-macos-intel.tar.gz"; - "aarch64-darwin" = "${baseUrl}-${release}-macos-silicon.tar.gz"; - } - .${targetSystem}; - hash = - { - "x86_64-linux" = "sha256-EOe6ooqvSGylJMJnWbqDrUIVYzwTCw5Up/vU/gPK6tE="; - "x86_64-darwin" = "sha256-POUj3Loo8o7lBI4CniaA/Z9mTRAmWv9VWAdtcIMe27I="; - "aarch64-darwin" = "sha256-+6bzdUXnJ+nnYdZuhLueT0+bYmXzwDXTe9JqWrWnfe4="; - } - .${targetSystem}; - }; - in - pkgs.runCommandNoCC "cardano-address" { - meta.description = "Command-line for address and key manipulation in Cardano"; - } '' - mkdir -p $out/bin $out/libexec - cp ${archive}/cardano-address $out/libexec/ - ${lib.optionalString pkgs.stdenv.isDarwin '' - cp ${archive}/{libz,libiconv.2,libgmp.10,libffi.8}.dylib $out/libexec - ''} - ln -sf $out/libexec/cardano-address $out/bin/ - ''; + cardano-address = + if targetSystem == "aarch64-linux" + then + pkgs.writeShellApplication { + name = "cardano-address"; + text = '' + echo >&2 "TODO: unimplemented: compile \`cardano-address\` for \`${targetSystem}\`!" + exit 1 + ''; + } + else let + release = "v2024-09-29"; + baseUrl = "https://github.com/cardano-foundation/cardano-wallet/releases/download/${release}/cardano-wallet"; + archive = pkgs.fetchzip { + name = "cardano-wallet-${release}"; + url = + { + "x86_64-linux" = "${baseUrl}-${release}-linux64.tar.gz"; + "x86_64-darwin" = "${baseUrl}-${release}-macos-intel.tar.gz"; + "aarch64-darwin" = "${baseUrl}-${release}-macos-silicon.tar.gz"; + } + .${ + targetSystem + }; + hash = + { + "x86_64-linux" = "sha256-EOe6ooqvSGylJMJnWbqDrUIVYzwTCw5Up/vU/gPK6tE="; + "x86_64-darwin" = "sha256-POUj3Loo8o7lBI4CniaA/Z9mTRAmWv9VWAdtcIMe27I="; + "aarch64-darwin" = "sha256-+6bzdUXnJ+nnYdZuhLueT0+bYmXzwDXTe9JqWrWnfe4="; + } + .${ + targetSystem + }; + }; + in + pkgs.runCommandNoCC "cardano-address" { + meta.description = "Command-line for address and key manipulation in Cardano"; + } '' + mkdir -p $out/bin $out/libexec + cp ${archive}/cardano-address $out/libexec/ + ${lib.optionalString pkgs.stdenv.isDarwin '' + cp ${archive}/{libz,libiconv.2,libgmp.10,libffi.8}.dylib $out/libexec + ''} + ln -sf $out/libexec/cardano-address $out/bin/ + ''; tx-build = pkgs.writeShellApplication { name = "tx-build"; diff --git a/src/api/tx/submit.rs b/src/api/tx/submit.rs index 5122bf1a..5d27ad5b 100644 --- a/src/api/tx/submit.rs +++ b/src/api/tx/submit.rs @@ -1,4 +1,7 @@ -use crate::{BlockfrostError, NodePool, common::validate_content_type}; +use crate::{ + BlockfrostError, NodePool, + common::{binary_or_hex_heuristic, validate_content_type}, +}; use axum::{Extension, Json, http::HeaderMap, response::IntoResponse}; use metrics::counter; @@ -39,44 +42,3 @@ pub async fn route( Ok((response_headers, Json(response_body))) } - -/// This function allows us to take both hex-encoded and raw bytes. It has -/// to be a heuristic: if there are input bytes that are not `[0-9a-f]`, -/// then it must be a binary string. Otherwise, we assume it’s hex encoded. -/// -/// **Note**: there is a small probability that the user gave us a binary -/// string that only _looked_ like a hex-encoded one, but it’s rare enough -/// to ignore it. -pub fn binary_or_hex_heuristic(xs: &[u8]) -> Vec { - let even_length = xs.len() % 2 == 0; - let contains_non_hex = xs.iter().any(|&x| !x.is_ascii_hexdigit()); - - if !even_length || contains_non_hex { - xs.to_vec() - } else { - hex::decode(xs).unwrap_or_else(|_| unreachable!()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - use proptest::prelude::*; - - proptest! { - #[test] - fn proptest_binary_or_hex_heuristic( - binary in prop::collection::vec(any::(), 0..=128) - .prop_filter("exclude values made up only of hex digits", |xs| { - let contains_non_hex = xs.iter().any(|&x| !x.is_ascii_hexdigit()); - contains_non_hex - }) - ) { - let hex_string = hex::encode(&binary); - assert_eq!( - binary_or_hex_heuristic(hex_string.as_bytes()), - binary_or_hex_heuristic(&binary) - ) - } - } -} diff --git a/src/api/utils.rs b/src/api/utils.rs index e9dad824..02060e91 100644 --- a/src/api/utils.rs +++ b/src/api/utils.rs @@ -1 +1,2 @@ +#[cfg(evaluate)] pub mod txs; diff --git a/src/api/utils/txs.rs b/src/api/utils/txs.rs index 98a84498..67a328e5 100644 --- a/src/api/utils/txs.rs +++ b/src/api/utils/txs.rs @@ -1 +1,2 @@ +#[cfg(evaluate)] pub mod evaluate; diff --git a/src/api/utils/txs/evaluate.rs b/src/api/utils/txs/evaluate.rs index b1ee3085..dbfda6ba 100644 --- a/src/api/utils/txs/evaluate.rs +++ b/src/api/utils/txs/evaluate.rs @@ -1,2 +1,3 @@ +pub mod model; pub mod root; pub mod utxos; diff --git a/src/api/utils/txs/evaluate/model.rs b/src/api/utils/txs/evaluate/model.rs new file mode 100644 index 00000000..388f5a3d --- /dev/null +++ b/src/api/utils/txs/evaluate/model.rs @@ -0,0 +1,358 @@ +use std::collections::HashMap; + +use pallas_primitives::{Bytes, ExUnits, KeepRaw, conway::RedeemerTag}; +use pallas_validate::phase2::EvalReport; +use pallas_validate::phase2::tx::TxEvalResult; +use serde::{Deserialize, Serialize, ser::SerializeMap}; + +// JSON request +#[derive(Deserialize)] +pub struct TxEvaluationRequest { + pub cbor: String, // @todo can be base16 or base64 CBOR + #[serde(rename = "additionalUtxoSet")] + pub additional_utxo_set: Option, +} + +pub type AdditionalUtxoSet = Vec<(TxIn, TxOut)>; +#[derive(Deserialize, Debug)] +pub struct TxIn { + #[serde(rename = "txId")] + pub tx_id: String, + pub index: u64, +} +#[derive(Deserialize, Debug)] +pub struct TxOut { + pub address: String, + pub value: Value, + #[serde(rename = "datumHash")] + pub datum_hash: Option, + pub datum: Option, + pub script: Option