From 94d631c179c489b387b940b06ec04efee427819d Mon Sep 17 00:00:00 2001 From: hade Date: Sat, 1 Jun 2024 19:54:30 +0700 Subject: [PATCH] chore: single thread bls --- packages/uplc/rust/Cargo.lock | 174 +++++++++++++++++++++++----------- packages/uplc/rust/Cargo.toml | 2 +- 2 files changed, 119 insertions(+), 57 deletions(-) diff --git a/packages/uplc/rust/Cargo.lock b/packages/uplc/rust/Cargo.lock index 9528b76f..78864801 100644 --- a/packages/uplc/rust/Cargo.lock +++ b/packages/uplc/rust/Cargo.lock @@ -2,12 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "anyhow" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" - [[package]] name = "arrayvec" version = "0.5.2" @@ -53,6 +47,17 @@ dependencies = [ "generic-array", ] +[[package]] +name = "blst" +version = "0.3.4" +source = "git+https://github.com/LIT-Protocol/blst.git#8a7204617bbde28461732cef7432fcf9431238b5" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + [[package]] name = "bumpalo" version = "3.16.0" @@ -86,6 +91,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -124,12 +144,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - [[package]] name = "digest" version = "0.10.7" @@ -201,16 +215,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "flat-rs" -version = "1.0.20-alpha" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3dec6a9ab899cfae3e9ba75caa4d5cb0e27862a3252d87059389ce5c9855ee0" -dependencies = [ - "anyhow", - "thiserror", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -235,6 +239,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "group" version = "0.13.0" @@ -264,6 +274,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "hex" version = "0.4.3" @@ -327,6 +343,15 @@ dependencies = [ "signature", ] +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "libc" version = "0.2.154" @@ -364,9 +389,9 @@ dependencies = [ [[package]] name = "minicbor" -version = "0.19.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7005aaf257a59ff4de471a9d5538ec868a21586534fff7f85dd97d4043a6139" +checksum = "9d15f4203d71fdf90903c2696e55426ac97a363c67b218488a73b534ce7aca10" dependencies = [ "half", "minicbor-derive", @@ -411,6 +436,16 @@ dependencies = [ "autocfg", ] +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + [[package]] name = "once_cell" version = "1.19.0" @@ -419,34 +454,38 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "pallas-addresses" -version = "0.18.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8db28c4050dea032d497555bc68c269ae8e691486d8ec83f02b090487da0d0be" +checksum = "a186bac65200a9b720326082b2bd64fe2f0f9284e8709c70fa16d9f9aeed89e6" dependencies = [ "base58", "bech32", + "crc", "hex", "pallas-codec", "pallas-crypto", + "sha3", "thiserror", ] [[package]] name = "pallas-codec" -version = "0.18.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6e03d05d42a663526d78c8b1d4f2554f09bbf4cc846e1a9e839c558bf6103c" +checksum = "4530d1a558070d6b46bfd68cfd77f3a7b2cff3b4426b32ad9f02ff270387b248" dependencies = [ "hex", "minicbor", + "num-bigint", "serde", + "thiserror", ] [[package]] name = "pallas-crypto" -version = "0.18.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a35fc93b3613c0a628d0820f8d5d9a52709d795b59a1754a337aee0fca289dd" +checksum = "12dd0ccf9909e47c1273000eb11945b3d909356c0f0fd2a380f49ced849d2c77" dependencies = [ "cryptoxide", "hex", @@ -458,9 +497,9 @@ dependencies = [ [[package]] name = "pallas-primitives" -version = "0.18.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5fdf328f41971e0b1457e2377abeb09143fa50ab79f1a6a6ab5740bc94dc4b" +checksum = "fb19819e37c14cafa0a5bba51cd2966b07b72399a8096910f48e34d49c05adf1" dependencies = [ "base58", "bech32", @@ -474,18 +513,26 @@ dependencies = [ [[package]] name = "pallas-traverse" -version = "0.18.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58c353ecb175a63422386c80301493db9fc448407bc63322534522579e22879" +checksum = "ebf62cdadb4d9d15b390fd540fc639fcbeaf3875a6bee490c104d305426cb262" dependencies = [ "hex", "pallas-addresses", "pallas-codec", "pallas-crypto", "pallas-primitives", + "paste", + "serde", "thiserror", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "peg" version = "0.8.3" @@ -535,16 +582,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "pretty_assertions" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cee1a6c8a5b9208b3cb1061f10c0cb689087b3d8ce85fb9d2dd7a29b6ba66" -dependencies = [ - "diff", - "yansi", -] - [[package]] name = "proc-macro2" version = "1.0.82" @@ -668,6 +705,16 @@ dependencies = [ "digest", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "signature" version = "2.2.0" @@ -755,6 +802,15 @@ dependencies = [ "syn 2.0.63", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + [[package]] name = "traitobject" version = "0.1.0" @@ -799,13 +855,11 @@ checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "uplc" -version = "1.0.20-alpha" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc043e5649db68d6af33f2cb8e96db66c5cf9b459b95e0b24489a34b3c79589" +version = "1.0.28-alpha" +source = "git+https://github.com/hadelive/aiken.git?branch=single-thread-bls#d73b3d3e439420e97c0ee7d97b4c765f321ee075" dependencies = [ - "anyhow", + "blst", "cryptoxide", - "flat-rs", "hex", "indexmap", "itertools", @@ -814,6 +868,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits", + "once_cell", "pallas-addresses", "pallas-codec", "pallas-crypto", @@ -821,7 +876,6 @@ dependencies = [ "pallas-traverse", "peg", "pretty", - "pretty_assertions", "secp256k1", "serde", "serde_json", @@ -908,14 +962,22 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - [[package]] name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +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.63", +] diff --git a/packages/uplc/rust/Cargo.toml b/packages/uplc/rust/Cargo.toml index 5167b04d..9ad3ce50 100644 --- a/packages/uplc/rust/Cargo.toml +++ b/packages/uplc/rust/Cargo.toml @@ -9,7 +9,7 @@ crate-type = ["cdylib"] [dependencies] error = "0.1.9" -uplc = "1.0.20-alpha" +uplc = { git = "https://github.com/hadelive/aiken.git", branch = "single-thread-bls" } wasm-bindgen = "0.2.89" k256 = { version = "0.13.0" } js-sys = "0.3.61"