From d3df7079853f0c40ebceaea38f9f80b7730f6d19 Mon Sep 17 00:00:00 2001 From: erhant Date: Thu, 31 Oct 2024 13:36:21 +0300 Subject: [PATCH 1/2] workflow fixes --- Cargo.lock | 734 +++++++++++------- Cargo.toml | 2 +- src/compute/handlers/generation.rs | 8 +- src/compute/workflows/executor.rs | 83 +- src/compute/workflows/mod.rs | 4 +- src/compute/workflows/postprocess/identity.rs | 6 +- src/compute/workflows/postprocess/mod.rs | 7 +- src/compute/workflows/postprocess/swan.rs | 8 +- src/compute/workflows/presets/generation.json | 2 +- src/main.rs | 1 + 10 files changed, 517 insertions(+), 338 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7584760..26f7749 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,10 +90,11 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.36" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94c225801d42099570d0674701dddd4142f0ef715282aeb5985042e2ec962df7" +checksum = "c660915971620592abe2c292c859957eb60e73a60c0eba34a6793eea60512cff" dependencies = [ + "alloy-primitives 0.8.10", "num_enum", "serde", "strum 0.26.3", @@ -106,7 +107,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04c309895995eaa4bfcc345f5515a39c7df9447798645cc8bf462b6c5bf1dc96" dependencies = [ "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "c-kzg", @@ -123,7 +124,7 @@ dependencies = [ "alloy-json-abi", "alloy-network", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-provider", "alloy-pubsub", "alloy-rpc-types-eth", @@ -142,7 +143,7 @@ checksum = "529fc6310dc1126c8de51c376cbc59c79c7f662bd742be7dc67055d5421a81b4" dependencies = [ "alloy-dyn-abi", "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-types", ] @@ -153,7 +154,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413902aa18a97569e60f679c23f46a18db1656d87ab4d4e49d0e1e52042f66df" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-type-parser", "alloy-sol-types", "const-hex", @@ -169,11 +170,11 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9431c99a3b3fe606ede4b3d4043bdfbcb780c45b8d8d226c3804e2b75cfbe68" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "c-kzg", - "derive_more", + "derive_more 0.99.18", "k256", "once_cell", "serde", @@ -186,7 +187,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79614dfe86144328da11098edcc7bc1a3f25ad8d3134a9eb9e857e06f0d9840d" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-serde", "serde", ] @@ -197,7 +198,7 @@ version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bc05b04ac331a9f07e3a4036ef7926e49a8bf84a99a1ccfc7e2ab55a5fcbb372" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-type-parser", "serde", "serde_json", @@ -209,7 +210,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57e2865c4c3bb4cdad3f0d9ec1ab5c0c657ba69a375651bd35e32fb6c180ccc2" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-types", "serde", "serde_json", @@ -227,7 +228,7 @@ dependencies = [ "alloy-eips", "alloy-json-rpc", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rpc-types-eth", "alloy-serde", "alloy-signer", @@ -244,7 +245,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec9d5a0f9170b10988b6774498a022845e13eda94318440d17709d50687f67f9" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-serde", "serde", ] @@ -256,7 +257,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16faebb9ea31a244fd6ce3288d47df4be96797d9c3c020144b8f2c31543a4512" dependencies = [ "alloy-genesis", - "alloy-primitives", + "alloy-primitives 0.7.7", "k256", "serde_json", "tempfile", @@ -272,10 +273,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccb3ead547f4532bc8af961649942f0b9c16ee9226e26caa3f38420651cc0bf4" dependencies = [ "alloy-rlp", - "bytes 1.7.2", + "bytes 1.8.0", "cfg-if 1.0.0", "const-hex", - "derive_more", + "derive_more 0.99.18", "hex-literal", "itoa 1.0.11", "k256", @@ -287,6 +288,33 @@ dependencies = [ "tiny-keccak", ] +[[package]] +name = "alloy-primitives" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8edae627382349b56cd6a7a2106f4fd69b243a9233e560c55c2e03cabb7e1d3c" +dependencies = [ + "alloy-rlp", + "bytes 1.8.0", + "cfg-if 1.0.0", + "const-hex", + "derive_more 1.0.0", + "foldhash", + "hex-literal", + "indexmap 2.6.0", + "itoa 1.0.11", + "k256", + "keccak-asm", + "paste", + "proptest", + "rand 0.8.5", + "ruint", + "rustc-hash 2.0.0", + "serde", + "sha3", + "tiny-keccak", +] + [[package]] name = "alloy-provider" version = "0.2.1" @@ -300,7 +328,7 @@ dependencies = [ "alloy-network", "alloy-network-primitives", "alloy-node-bindings", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-pubsub", "alloy-rpc-client", "alloy-rpc-types-anvil", @@ -318,10 +346,10 @@ dependencies = [ "futures-utils-wasm", "lru", "pin-project", - "reqwest 0.12.8", + "reqwest 0.12.9", "serde", "serde_json", - "tokio 1.40.0", + "tokio 1.41.0", "tracing", "url", ] @@ -333,13 +361,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f5da2c55cbaf229bad3c5f8b00b5ab66c74ef093e5f3a753d874cfecf7d2281" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-transport", "bimap", "futures", "serde", "serde_json", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-stream", "tower", "tracing", @@ -347,24 +375,24 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" dependencies = [ "alloy-rlp-derive", "arrayvec", - "bytes 1.7.2", + "bytes 1.8.0", ] [[package]] name = "alloy-rlp-derive" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" +checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -374,7 +402,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b38e3ffdb285df5d9f60cb988d336d9b8e3505acb78750c3bc60336a7af41d3" dependencies = [ "alloy-json-rpc", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-pubsub", "alloy-transport", "alloy-transport-http", @@ -382,10 +410,10 @@ dependencies = [ "alloy-transport-ws", "futures", "pin-project", - "reqwest 0.12.8", + "reqwest 0.12.9", "serde", "serde_json", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-stream", "tower", "tracing", @@ -410,7 +438,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ab6509cd38b2e8c8da726e0f61c1e314a81df06a38d37ddec8bced3f8d25ed" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-serde", "serde", ] @@ -423,7 +451,7 @@ checksum = "ff63f51b2fb2f547df5218527fd0653afb1947bf7fead5b3ce58c75d170b30f7" dependencies = [ "alloy-consensus", "alloy-eips", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-rpc-types-eth", "alloy-serde", @@ -442,7 +470,7 @@ dependencies = [ "alloy-consensus", "alloy-eips", "alloy-network-primitives", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-rlp", "alloy-serde", "alloy-sol-types", @@ -458,7 +486,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33feda6a53e6079895aed1d08dcb98a1377b000d80d16370fbbdb8155d547ef" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "serde", "serde_json", ] @@ -469,7 +497,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "740a25b92e849ed7b0fa013951fe2f64be9af1ad5abe805037b44fb7770c5c47" dependencies = [ - "alloy-primitives", + "alloy-primitives 0.7.7", "async-trait", "auto_impl", "elliptic-curve", @@ -485,7 +513,7 @@ checksum = "1b0707d4f63e4356a110b30ef3add8732ab6d181dd7be4607bf79b8777105cee" dependencies = [ "alloy-consensus", "alloy-network", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-signer", "async-trait", "k256", @@ -504,7 +532,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -521,7 +549,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "syn-solidity", "tiny-keccak", ] @@ -539,7 +567,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.79", + "syn 2.0.85", "syn-solidity", ] @@ -560,7 +588,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a91ca40fa20793ae9c3841b83e74569d1cc9af29a2f5237314fd3452d51e38c7" dependencies = [ "alloy-json-abi", - "alloy-primitives", + "alloy-primitives 0.7.7", "alloy-sol-macro", "const-hex", "serde", @@ -579,7 +607,7 @@ dependencies = [ "serde", "serde_json", "thiserror", - "tokio 1.40.0", + "tokio 1.41.0", "tower", "tracing", "url", @@ -593,7 +621,7 @@ checksum = "2437d145d80ea1aecde8574d2058cceb8b3c9cba05f6aea8e67907c660d46698" dependencies = [ "alloy-json-rpc", "alloy-transport", - "reqwest 0.12.8", + "reqwest 0.12.9", "serde_json", "tower", "tracing", @@ -609,12 +637,12 @@ dependencies = [ "alloy-json-rpc", "alloy-pubsub", "alloy-transport", - "bytes 1.7.2", + "bytes 1.8.0", "futures", "interprocess", "pin-project", "serde_json", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-util 0.7.12", "tracing", ] @@ -629,9 +657,9 @@ dependencies = [ "alloy-transport", "futures", "http 1.1.0", - "rustls 0.23.14", + "rustls 0.23.16", "serde_json", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-tungstenite", "tracing", "ws_stream_wasm", @@ -654,9 +682,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -669,43 +697,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "ark-ff" @@ -850,7 +878,7 @@ dependencies = [ "avro-rs", "base64 0.13.1", "borsh", - "bytes 1.7.2", + "bytes 1.8.0", "data-encoding", "futures", "infer", @@ -867,7 +895,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "thiserror", - "tokio 1.40.0", + "tokio 1.41.0", "url", ] @@ -899,18 +927,18 @@ dependencies = [ "async-convert", "backoff", "base64 0.22.1", - "bytes 1.7.2", + "bytes 1.8.0", "derive_builder 0.20.2", "eventsource-stream", "futures", "rand 0.8.5", - "reqwest 0.12.8", + "reqwest 0.12.9", "reqwest-eventsource", "secrecy", "serde", "serde_json", "thiserror", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-stream", "tokio-util 0.7.12", "tracing", @@ -935,7 +963,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -946,7 +974,7 @@ checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] @@ -957,7 +985,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -968,7 +996,7 @@ checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1008,7 +1036,7 @@ dependencies = [ "derive_utils", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1019,7 +1047,7 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1059,9 +1087,9 @@ dependencies = [ "futures-core", "getrandom 0.2.15", "instant", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "rand 0.8.5", - "tokio 1.40.0", + "tokio 1.41.0", ] [[package]] @@ -1271,10 +1299,10 @@ dependencies = [ "async-trait", "avro-rs", "bs58", - "bytes 1.7.2", + "bytes 1.8.0", "data-encoding", "derive_builder 0.10.2", - "derive_more", + "derive_more 0.99.18", "ed25519-dalek", "futures", "indexmap 1.9.3", @@ -1298,7 +1326,7 @@ dependencies = [ "strum 0.24.1", "strum_macros 0.24.3", "thiserror", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-util 0.6.10", "validator", "web3", @@ -1324,9 +1352,9 @@ checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] @@ -1346,11 +1374,17 @@ dependencies = [ "serde", ] +[[package]] +name = "cargo-husky" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad" + [[package]] name = "cc" -version = "1.1.28" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "shlex", ] @@ -1363,7 +1397,7 @@ checksum = "d38f2da7a0a2c4ccf0065be06397cc26a81f4e528be095826eee9d4adbb8c60f" dependencies = [ "byteorder", "fnv", - "uuid 1.10.0", + "uuid 1.11.0", ] [[package]] @@ -1378,6 +1412,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -1386,7 +1426,9 @@ checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", + "js-sys", "num-traits", + "wasm-bindgen", "windows-targets 0.52.6", ] @@ -1421,7 +1463,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1432,9 +1474,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" @@ -1601,7 +1643,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1683,7 +1725,7 @@ dependencies = [ "proc-macro2", "quote", "strsim 0.11.1", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1705,7 +1747,7 @@ checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core 0.20.10", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1807,7 +1849,7 @@ dependencies = [ "darling 0.20.10", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1827,7 +1869,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core 0.20.2", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1840,7 +1882,28 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.79", + "syn 2.0.85", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.85", + "unicode-xid", ] [[package]] @@ -1851,7 +1914,7 @@ checksum = "65f152f4b8559c4da5d574bafc7af85454d706b4c5fe8b530d508cacbb6807ea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -1877,14 +1940,14 @@ dependencies = [ [[package]] name = "dkn-oracle" -version = "0.1.6" +version = "0.1.7" dependencies = [ "alloy", "alloy-chains", "async-trait", "base64 0.22.1", "bundlr-sdk", - "bytes 1.7.2", + "bytes 1.8.0", "clap", "dkn-workflows", "dotenvy", @@ -1896,26 +1959,25 @@ dependencies = [ "lazy_static", "log", "rand 0.8.5", - "reqwest 0.12.8", + "reqwest 0.12.9", "serde", "serde_json", - "tokio 1.40.0", + "tokio 1.41.0", ] [[package]] name = "dkn-workflows" -version = "0.2.13" -source = "git+https://github.com/firstbatchxyz/dkn-compute-node#08946036570fbfdb335af1724c9c402afe4f884c" +version = "0.2.18" +source = "git+https://github.com/firstbatchxyz/dkn-compute-node#39a460b11b4d3d054cb0461937a53c952e8ad0fe" dependencies = [ - "async-trait", "eyre", "log", "ollama-workflows", "rand 0.8.5", - "reqwest 0.12.8", + "reqwest 0.12.9", "serde", "serde_json", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-util 0.7.12", ] @@ -2028,9 +2090,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if 1.0.0", ] @@ -2058,6 +2120,19 @@ dependencies = [ "termcolor", ] +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + [[package]] name = "env_logger" version = "0.11.5" @@ -2139,7 +2214,7 @@ checksum = "74fef4569247a5f429d9156b9d0a2599914385dd189c539334c625d8099d90ab" dependencies = [ "futures-core", "nom", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] @@ -2176,7 +2251,7 @@ checksum = "139834ddba373bbdd213dffe02c8d110508dcf1726c2be27e8d1f7d7e1856418" dependencies = [ "arrayvec", "auto_impl", - "bytes 1.7.2", + "bytes 1.8.0", ] [[package]] @@ -2337,7 +2412,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2371,7 +2446,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "pin-utils", "slab", ] @@ -2391,6 +2466,25 @@ dependencies = [ "byteorder", ] +[[package]] +name = "gem-rs" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e69a0d5679f63170c28494d7c1e955d0d179605fb88baab6db20ae0e4bcd85" +dependencies = [ + "base64 0.22.1", + "chrono", + "futures", + "log", + "pretty_env_logger", + "reqwest 0.12.9", + "reqwest-streams", + "serde", + "serde_json", + "sha256", + "tokio 1.41.0", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -2484,7 +2578,7 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "fnv", "futures-core", "futures-sink", @@ -2492,7 +2586,7 @@ dependencies = [ "http 0.2.12", "indexmap 2.6.0", "slab", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-util 0.7.12", "tracing", ] @@ -2504,14 +2598,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", - "bytes 1.7.2", + "bytes 1.8.0", "fnv", "futures-core", "futures-sink", "http 1.1.0", "indexmap 2.6.0", "slab", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-util 0.7.12", "tracing", ] @@ -2555,7 +2649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ "base64 0.21.7", - "bytes 1.7.2", + "bytes 1.8.0", "headers-core", "http 0.2.12", "httpdate 1.0.3", @@ -2608,6 +2702,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -2693,7 +2793,7 @@ dependencies = [ "markup5ever 0.12.1", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -2702,7 +2802,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "fnv", "itoa 1.0.11", ] @@ -2713,7 +2813,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "fnv", "itoa 1.0.11", ] @@ -2734,9 +2834,9 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "http 0.2.12", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] @@ -2745,7 +2845,7 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "http 1.1.0", ] @@ -2755,11 +2855,11 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "futures-util", "http 1.1.0", "http-body 1.0.1", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", ] [[package]] @@ -2812,11 +2912,11 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "futures-channel", "futures-core", "futures-util", @@ -2826,9 +2926,9 @@ dependencies = [ "httparse", "httpdate 1.0.3", "itoa 1.0.11", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "socket2 0.5.7", - "tokio 1.40.0", + "tokio 1.41.0", "tower-service", "tracing", "want", @@ -2836,11 +2936,11 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "futures-channel", "futures-util", "h2 0.4.6", @@ -2849,9 +2949,9 @@ dependencies = [ "httparse", "httpdate 1.0.3", "itoa 1.0.11", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "smallvec", - "tokio 1.40.0", + "tokio 1.41.0", "want", ] @@ -2863,9 +2963,9 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "rustls 0.21.12", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-rustls 0.24.1", ] @@ -2877,12 +2977,12 @@ checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", - "rustls 0.23.14", + "rustls 0.23.16", "rustls-native-certs", "rustls-pki-types", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-rustls 0.26.0", "tower-service", "webpki-roots 0.26.6", @@ -2907,10 +3007,10 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.7.2", - "hyper 0.14.30", + "bytes 1.8.0", + "hyper 0.14.31", "native-tls", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-native-tls", ] @@ -2920,31 +3020,31 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "native-tls", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-native-tls", "tower-service", ] [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", - "pin-project-lite 0.2.14", + "hyper 1.5.0", + "pin-project-lite 0.2.15", "socket2 0.5.7", - "tokio 1.40.0", + "tokio 1.41.0", "tower-service", "tracing", ] @@ -3096,7 +3196,7 @@ dependencies = [ "futures-core", "libc", "recvmsg", - "tokio 1.40.0", + "tokio 1.41.0", "widestring", "windows-sys 0.52.0", ] @@ -3116,6 +3216,17 @@ version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +[[package]] +name = "is-terminal" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +dependencies = [ + "hermit-abi 0.4.0", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "is_terminal_polyfill" version = "1.70.1" @@ -3154,9 +3265,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -3269,7 +3380,7 @@ dependencies = [ "mockito", "readability", "regex", - "reqwest 0.12.8", + "reqwest 0.12.9", "reqwest-eventsource", "scraper 0.20.0", "secrecy", @@ -3279,7 +3390,7 @@ dependencies = [ "text-splitter 0.16.1", "thiserror", "tiktoken-rs", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-stream", "url", "urlencoding", @@ -3296,9 +3407,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libflate" @@ -3322,9 +3433,9 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "linux-raw-sys" @@ -3368,7 +3479,7 @@ dependencies = [ "proc-macro2", "quote", "regex-syntax 0.6.29", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3554,13 +3665,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09b34bd91b9e5c5b06338d392463e1318d683cf82ec3d3af4014609be6e2108d" dependencies = [ "assert-json-diff", - "bytes 1.7.2", + "bytes 1.8.0", "colored", "futures-util", "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-util", "log", "rand 0.8.5", @@ -3568,7 +3679,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "similar", - "tokio 1.40.0", + "tokio 1.41.0", ] [[package]] @@ -3767,7 +3878,7 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3788,7 +3899,7 @@ dependencies = [ "async-trait", "log", "regex", - "reqwest 0.12.8", + "reqwest 0.12.9", "scraper 0.19.1", "serde", "serde_json", @@ -3799,12 +3910,13 @@ dependencies = [ [[package]] name = "ollama-workflows" version = "0.1.0" -source = "git+https://github.com/andthattoo/ollama-workflows#f1873801b731c287509f36e1966c4f3b28f7fd85" +source = "git+https://github.com/andthattoo/ollama-workflows#a0b5efb03d61c3a7c30382be19568980c65a8b52" dependencies = [ "async-trait", "colored", "dotenv", "env_logger 0.9.3", + "gem-rs", "html2text", "langchain-rust", "log", @@ -3813,14 +3925,14 @@ dependencies = [ "parking_lot", "rand 0.8.5", "regex", - "reqwest 0.12.8", + "reqwest 0.12.9", "scraper 0.19.1", "search_with_google", "serde", "serde_json", "simsimd", "text-splitter 0.13.3", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-util 0.7.12", ] @@ -3842,20 +3954,20 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf3d3fe8284533a78c1ab1cf7da0a682f6738c621a3639e55a6e8041901b151a" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "derive_builder 0.20.2", - "reqwest 0.12.8", + "reqwest 0.12.9", "serde", "serde_json", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-util 0.7.12", ] [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if 1.0.0", @@ -3874,7 +3986,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -3885,9 +3997,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -3983,9 +4095,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.13" +version = "2.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdbef9d1d47087a895abd220ed25eb4ad973a5e26f6a4367b038c25e28dfc2d9" +checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" dependencies = [ "memchr", "thiserror", @@ -4116,7 +4228,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4148,22 +4260,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -4174,9 +4286,9 @@ checksum = "257b64915a082f7811703966789728173279bdebb956b143dbcd23f6f970a777" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -4259,7 +4371,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7eeeab46e2b53b68efdb06712feddd52eaa8d040fcebec439d688fdc95819310" dependencies = [ "async-trait", - "bytes 1.7.2", + "bytes 1.8.0", "encoding_rs", "http 0.2.12", "mime", @@ -4285,6 +4397,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "pretty_env_logger" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "865724d4dbe39d9f3dd3b52b88d859d66bcb2d6a0acfd5ea68a65fb66d4bdc1c" +dependencies = [ + "env_logger 0.10.2", + "log", +] + [[package]] name = "primitive-types" version = "0.11.1" @@ -4359,9 +4481,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] @@ -4388,9 +4510,9 @@ dependencies = [ [[package]] name = "pulldown-cmark" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "666f0f59e259aea2d72e6012290c09877a780935cc3c18b1ceded41f3890d59c" +checksum = "f86ba2052aebccc42cbbb3ed234b8b13ce76f75c3551a303cb2bcffcff12bb14" dependencies = [ "bitflags 2.6.0", "memchr", @@ -4409,15 +4531,15 @@ version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ - "bytes 1.7.2", - "pin-project-lite 0.2.14", + "bytes 1.8.0", + "pin-project-lite 0.2.15", "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.14", + "rustls 0.23.16", "socket2 0.5.7", "thiserror", - "tokio 1.40.0", + "tokio 1.41.0", "tracing", ] @@ -4427,11 +4549,11 @@ version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "rand 0.8.5", "ring 0.17.8", "rustc-hash 2.0.0", - "rustls 0.23.14", + "rustls 0.23.16", "slab", "thiserror", "tinyvec", @@ -4440,10 +4562,11 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2 0.5.7", @@ -4587,9 +4710,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -4643,7 +4766,7 @@ dependencies = [ "mime_guess", "native-tls", "percent-encoding", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "serde", "serde_urlencoded", "tokio 0.2.25", @@ -4662,14 +4785,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64 0.21.7", - "bytes 1.7.2", + "bytes 1.8.0", "encoding_rs", "futures-core", "futures-util", "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", @@ -4679,7 +4802,7 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "rustls 0.21.12", "rustls-pemfile 1.0.4", "serde", @@ -4687,7 +4810,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 0.1.2", "system-configuration 0.5.1", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-native-tls", "tokio-rustls 0.24.1", "tower-service", @@ -4701,12 +4824,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.8" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", - "bytes 1.7.2", + "bytes 1.8.0", "encoding_rs", "futures-core", "futures-util", @@ -4714,7 +4837,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.0", "hyper-rustls 0.27.3", "hyper-tls 0.6.0", "hyper-util", @@ -4726,9 +4849,9 @@ dependencies = [ "native-tls", "once_cell", "percent-encoding", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "quinn", - "rustls 0.23.14", + "rustls 0.23.16", "rustls-native-certs", "rustls-pemfile 2.2.0", "rustls-pki-types", @@ -4737,7 +4860,7 @@ dependencies = [ "serde_urlencoded", "sync_wrapper 1.0.1", "system-configuration 0.6.1", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-native-tls", "tokio-rustls 0.26.0", "tokio-util 0.7.12", @@ -4762,11 +4885,28 @@ dependencies = [ "futures-timer", "mime", "nom", - "pin-project-lite 0.2.14", - "reqwest 0.12.8", + "pin-project-lite 0.2.15", + "reqwest 0.12.9", "thiserror", ] +[[package]] +name = "reqwest-streams" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee84cc47a7a0ac7562173c8f421c058e4c72089d6e662f32e2cb4bcc8e6e9201" +dependencies = [ + "async-trait", + "bytes 1.8.0", + "cargo-husky", + "futures", + "reqwest 0.12.9", + "serde", + "serde_json", + "tokio 1.41.0", + "tokio-util 0.7.12", +] + [[package]] name = "rfc6979" version = "0.4.0" @@ -4819,7 +4959,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "rustc-hex", ] @@ -4852,7 +4992,7 @@ dependencies = [ "alloy-rlp", "ark-ff 0.3.0", "ark-ff 0.4.2", - "bytes 1.7.2", + "bytes 1.8.0", "fastrlp", "num-bigint 0.4.6", "num-traits", @@ -4917,9 +5057,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags 2.6.0", "errno", @@ -4942,9 +5082,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" dependencies = [ "once_cell", "ring 0.17.8", @@ -4987,9 +5127,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -5014,9 +5154,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "rusty-fork" @@ -5224,7 +5364,7 @@ checksum = "df320f1889ac4ba6bc0cdc9c9af7af4bd64bb927bccdf32d81140dc1f9be12fe" dependencies = [ "bitflags 1.3.2", "cssparser 0.27.2", - "derive_more", + "derive_more 0.99.18", "fxhash", "log", "matches", @@ -5244,7 +5384,7 @@ checksum = "4eb30575f3638fc8f6815f448d50cb1a2e255b0897985c8c59f4d37b72a07b06" dependencies = [ "bitflags 2.6.0", "cssparser 0.31.2", - "derive_more", + "derive_more 0.99.18", "fxhash", "log", "new_debug_unreachable", @@ -5287,9 +5427,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] @@ -5307,20 +5447,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa 1.0.11", "memchr", @@ -5394,6 +5534,19 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha256" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18278f6a914fa3070aa316493f7d2ddfb9ac86ebc06fa3b83bffda487e9065b0" +dependencies = [ + "async-trait", + "bytes 1.8.0", + "hex", + "sha2 0.10.8", + "tokio 1.41.0", +] + [[package]] name = "sha3" version = "0.10.8" @@ -5655,7 +5808,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -5677,9 +5830,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -5695,7 +5848,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -5850,22 +6003,22 @@ checksum = "8eaa81235c7058867fa8c0e7314f33dcce9c215f535d1913822a2b3f5e289f3c" [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -5977,16 +6130,16 @@ dependencies = [ [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", - "bytes 1.7.2", + "bytes 1.8.0", "libc", "mio 1.0.2", "parking_lot", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "signal-hook-registry", "socket2 0.5.7", "tokio-macros", @@ -6001,7 +6154,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -6011,7 +6164,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", - "tokio 1.40.0", + "tokio 1.41.0", ] [[package]] @@ -6021,7 +6174,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls 0.21.12", - "tokio 1.40.0", + "tokio 1.41.0", ] [[package]] @@ -6030,9 +6183,9 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.14", + "rustls 0.23.16", "rustls-pki-types", - "tokio 1.40.0", + "tokio 1.41.0", ] [[package]] @@ -6042,8 +6195,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", - "pin-project-lite 0.2.14", - "tokio 1.40.0", + "pin-project-lite 0.2.15", + "tokio 1.41.0", "tokio-util 0.7.12", ] @@ -6065,9 +6218,9 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.14", + "rustls 0.23.16", "rustls-pki-types", - "tokio 1.40.0", + "tokio 1.41.0", "tokio-rustls 0.26.0", "tungstenite", "webpki-roots 0.26.6", @@ -6093,12 +6246,12 @@ version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "futures-core", "futures-sink", "log", - "pin-project-lite 0.2.14", - "tokio 1.40.0", + "pin-project-lite 0.2.15", + "tokio 1.41.0", ] [[package]] @@ -6107,13 +6260,13 @@ version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ - "bytes 1.7.2", + "bytes 1.8.0", "futures-core", "futures-sink", "futures-util", "hashbrown 0.14.5", - "pin-project-lite 0.2.14", - "tokio 1.40.0", + "pin-project-lite 0.2.15", + "tokio 1.41.0", ] [[package]] @@ -6151,7 +6304,7 @@ dependencies = [ "futures-core", "futures-util", "pin-project", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "tower-layer", "tower-service", "tracing", @@ -6176,7 +6329,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", - "pin-project-lite 0.2.14", + "pin-project-lite 0.2.15", "tracing-attributes", "tracing-core", ] @@ -6189,7 +6342,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -6224,13 +6377,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" dependencies = [ "byteorder", - "bytes 1.7.2", + "bytes 1.8.0", "data-encoding", "http 1.1.0", "httparse", "log", "rand 0.8.5", - "rustls 0.23.14", + "rustls 0.23.16", "rustls-pki-types", "sha1", "thiserror", @@ -6280,12 +6433,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" @@ -6385,9 +6535,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "validator" @@ -6487,9 +6637,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -6500,24 +6650,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -6527,9 +6677,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6537,28 +6687,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -6569,9 +6719,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -6585,8 +6735,8 @@ checksum = "5388522c899d1e1c96a4c307e3797e0f697ba7c77dd8e0e625ecba9dd0342937" dependencies = [ "arrayvec", "base64 0.21.7", - "bytes 1.7.2", - "derive_more", + "bytes 1.8.0", + "derive_more 0.99.18", "ethabi", "ethereum-types", "futures", @@ -6996,7 +7146,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] [[package]] @@ -7016,5 +7166,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.79", + "syn 2.0.85", ] diff --git a/Cargo.toml b/Cargo.toml index 0f8f57a..40af092 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "dkn-oracle" description = "Dria Knowledge Network: Oracle Node" -version = "0.1.6" +version = "0.1.7" edition = "2021" license = "Apache-2.0" readme = "README.md" diff --git a/src/compute/handlers/generation.rs b/src/compute/handlers/generation.rs index ab01e6f..b8faf99 100644 --- a/src/compute/handlers/generation.rs +++ b/src/compute/handlers/generation.rs @@ -51,14 +51,18 @@ pub async fn handle_generation( log::debug!("Executing the workflow"); let protocol_string = bytes32_to_string(&protocol)?; let executor = Executor::new(model); - let (output, metadata) = executor + let (output, metadata, use_storage) = executor .execute_raw(&request.input, &protocol_string) .await?; // do the Arweave trick for large inputs log::debug!("Uploading to Arweave if required"); let arweave = Arweave::new_from_env().wrap_err("could not create Arweave instance")?; - let output = arweave.put_if_large(output).await?; + let output = if use_storage { + arweave.put_if_large(output).await? + } else { + output + }; let metadata = arweave.put_if_large(metadata).await?; // mine nonce diff --git a/src/compute/workflows/executor.rs b/src/compute/workflows/executor.rs index 229ea95..cd0f474 100644 --- a/src/compute/workflows/executor.rs +++ b/src/compute/workflows/executor.rs @@ -8,8 +8,13 @@ use crate::data::{Arweave, OracleExternalData}; #[async_trait(?Send)] pub trait WorkflowsExt { - async fn prepare_input(&self, input_bytes: &Bytes) -> Result<(Option, Workflow)>; - async fn execute_raw(&self, input_bytes: &Bytes, protocol: &str) -> Result<(Bytes, Bytes)>; + async fn parse_input_bytes(&self, input_bytes: &Bytes) -> Result<(Option, Workflow)>; + async fn parse_input_string(&self, input_str: String) -> Result<(Option, Workflow)>; + async fn execute_raw( + &self, + input_bytes: &Bytes, + protocol: &str, + ) -> Result<(Bytes, Bytes, bool)>; /// Returns a generation workflow for the executor. #[inline] @@ -22,37 +27,40 @@ pub trait WorkflowsExt { #[async_trait(?Send)] impl WorkflowsExt for Executor { - /// Given an input, prepares it for the executer by providing the entry and workflow. + /// Given an input of byte-slice, parses it to an entry and workflow. /// - /// - If input is a JSON txid string (64-char hex), the entry is fetched from Arweave, and then we recurse. - /// - If input is a JSON string, it is converted to an entry and a generation workflow is returned. - /// - If input is a JSON workflow, entry is `None` and input is casted to a workflow - /// - Otherwise, error is returned. - async fn prepare_input(&self, input_bytes: &Bytes) -> Result<(Option, Workflow)> { + /// - If input is a byteslice of JSON string, it is passed to `parse_input_string`. + /// - If input is a byteslice of JSON workflow, entry is `None` and input is casted to a workflow. + async fn parse_input_bytes(&self, input_bytes: &Bytes) -> Result<(Option, Workflow)> { if let Ok(input_str) = serde_json::from_slice::(input_bytes) { - // this is a string, lets see if its a txid - if Arweave::is_key(input_str.clone()) { - // if its a txid, we download the data and parse it again - // we dont expect to recurse here too much, because there would have to txid within txid - // but still it is possible - let input_bytes = Arweave::default() - .get(input_str) - .await - .wrap_err("could not download from Arweave")?; - self.prepare_input(&input_bytes).await - } else { - // it is not a key, so we treat it as a generation request with plaintext input - let entry = Some(Entry::String(input_str)); - let workflow = self.get_generation_workflow()?; - Ok((entry, workflow)) - } + self.parse_input_string(input_str).await } else if let Ok(workflow) = serde_json::from_slice::(input_bytes) { // it is a workflow, so we can directly use it with no entry Ok((None, workflow)) } else { // it is unparsable, return as lossy-converted string - let input_string = String::from_utf8_lossy(input_bytes); - let entry = Some(Entry::String(input_string.into())); + let input_str = String::from_utf8_lossy(input_bytes); + self.parse_input_string(input_str.into()).await + } + } + + /// Given an input of string, parses it to an entry and workflow. + /// + /// - If input is a txid (64-char hex, without 0x), the entry is fetched from Arweave, and then we recurse back to `parse_input_bytes`. + /// - Otherwise, it is treated as a plaintext input and a generation workflow is returned. + async fn parse_input_string(&self, input_string: String) -> Result<(Option, Workflow)> { + if Arweave::is_key(input_string.clone()) { + // if its a txid, we download the data and parse it again + let input_bytes = Arweave::default() + .get(input_string) + .await + .wrap_err("could not download from Arweave")?; + + // we dont expect to recurse here again too much, because there would have to txid within txid + self.parse_input_bytes(&input_bytes).await + } else { + // it is not a key, so we treat it as a generation request with plaintext input + let entry = Some(Entry::String(input_string)); let workflow = self.get_generation_workflow()?; Ok((entry, workflow)) } @@ -61,10 +69,14 @@ impl WorkflowsExt for Executor { /// Executes a generation task for the given input. /// The workflow & entry is derived from the input. /// - /// Returns output and metadata. - async fn execute_raw(&self, input_bytes: &Bytes, protocol: &str) -> Result<(Bytes, Bytes)> { + /// Returns output, metadata, and a boolean indicating whether we shall upload the `output` to storage if large enough. + async fn execute_raw( + &self, + input_bytes: &Bytes, + protocol: &str, + ) -> Result<(Bytes, Bytes, bool)> { // parse & prepare input - let (entry, workflow) = self.prepare_input(input_bytes).await?; + let (entry, workflow) = self.parse_input_bytes(input_bytes).await?; // obtain raw output let mut memory = ProgramMemory::new(); @@ -92,7 +104,7 @@ mod tests { let input_str = "foobar"; let (entry, _) = executor - .prepare_input(&input_str.as_bytes().into()) + .parse_input_bytes(&input_str.as_bytes().into()) .await .unwrap(); assert_eq!(entry.unwrap(), Entry::String(input_str.into())); @@ -108,7 +120,14 @@ mod tests { let expected_str = "Hello, Arweave!"; let (entry, _) = executor - .prepare_input(&arweave_key.as_bytes().into()) + .parse_input_bytes(&arweave_key.as_bytes().into()) + .await + .unwrap(); + assert_eq!(entry.unwrap(), Entry::String(expected_str.into())); + + // without `"`s + let (entry, _) = executor + .parse_input_bytes(&arweave_key.trim_matches('"').as_bytes().into()) .await .unwrap(); assert_eq!(entry.unwrap(), Entry::String(expected_str.into())); @@ -120,7 +139,7 @@ mod tests { let workflow_str = include_str!("presets/generation.json"); let (entry, _) = executor - .prepare_input(&workflow_str.as_bytes().into()) + .parse_input_bytes(&workflow_str.as_bytes().into()) .await .unwrap(); diff --git a/src/compute/workflows/mod.rs b/src/compute/workflows/mod.rs index accbd1f..cd18989 100644 --- a/src/compute/workflows/mod.rs +++ b/src/compute/workflows/mod.rs @@ -14,7 +14,7 @@ mod tests { async fn test_ollama_generation() { dotenvy::dotenv().unwrap(); let executor = Executor::new(Model::Llama3_1_8B); - let (output, _) = executor + let (output, _, _) = executor .execute_raw(&Bytes::from_static(b"What is the result of 2 + 2?"), "") .await .unwrap(); @@ -29,7 +29,7 @@ mod tests { async fn test_openai_generation() { dotenvy::dotenv().unwrap(); let executor = Executor::new(Model::Llama3_1_8B); - let (output, _) = executor + let (output, _, _) = executor .execute_raw(&Bytes::from_static(b"What is the result of 2 + 2?"), "") .await .unwrap(); diff --git a/src/compute/workflows/postprocess/identity.rs b/src/compute/workflows/postprocess/identity.rs index 18d19c3..df47b55 100644 --- a/src/compute/workflows/postprocess/identity.rs +++ b/src/compute/workflows/postprocess/identity.rs @@ -11,8 +11,8 @@ pub struct IdentityPostProcessor; impl PostProcess for IdentityPostProcessor { const PROTOCOL: &'static str = ""; - fn post_process(&self, input: String) -> Result<(Bytes, Bytes)> { - Ok((input.into(), Default::default())) + fn post_process(&self, input: String) -> Result<(Bytes, Bytes, bool)> { + Ok((input.into(), Default::default(), true)) } } @@ -23,7 +23,7 @@ mod tests { #[test] fn test_identity_post_processor() { let input = "hello".to_string(); - let (output, metadata) = IdentityPostProcessor.post_process(input).unwrap(); + let (output, metadata, _) = IdentityPostProcessor.post_process(input).unwrap(); assert_eq!(output, Bytes::from("hello")); assert_eq!(metadata, Bytes::default()); } diff --git a/src/compute/workflows/postprocess/mod.rs b/src/compute/workflows/postprocess/mod.rs index 835bccc..740892b 100644 --- a/src/compute/workflows/postprocess/mod.rs +++ b/src/compute/workflows/postprocess/mod.rs @@ -14,5 +14,10 @@ pub trait PostProcess { const PROTOCOL: &'static str; /// A post-processing step that takes the raw output from the LLM and splits it into an output and metadata. - fn post_process(&self, input: String) -> eyre::Result<(Bytes, Bytes)>; + /// + /// Returns: + /// - The output that is used within the contract. + /// - The metadata that is externally checked. + /// - A boolean indicating if the output should be uploaded to a storage if large enough. + fn post_process(&self, input: String) -> eyre::Result<(Bytes, Bytes, bool)>; } diff --git a/src/compute/workflows/postprocess/swan.rs b/src/compute/workflows/postprocess/swan.rs index 8708f09..c4a356a 100644 --- a/src/compute/workflows/postprocess/swan.rs +++ b/src/compute/workflows/postprocess/swan.rs @@ -28,7 +28,7 @@ impl SwanPurchasePostProcessor { impl PostProcess for SwanPurchasePostProcessor { const PROTOCOL: &'static str = "swan-buyer-purchase"; - fn post_process(&self, input: String) -> Result<(Bytes, Bytes)> { + fn post_process(&self, input: String) -> Result<(Bytes, Bytes, bool)> { // we will cast strings to Address here use alloy::primitives::Address; @@ -58,7 +58,7 @@ impl PostProcess for SwanPurchasePostProcessor { // `abi.encode` the list of addresses to be decodable by contract let addresses_encoded = addresses.abi_encode(); - Ok((Bytes::from(addresses_encoded), Bytes::from(input))) + Ok((Bytes::from(addresses_encoded), Bytes::from(input), false)) } } @@ -85,7 +85,7 @@ some more blabla here let post_processor = SwanPurchasePostProcessor::new("", ""); - let (output, metadata) = post_processor.post_process(INPUT.to_string()).unwrap(); + let (output, metadata, _) = post_processor.post_process(INPUT.to_string()).unwrap(); assert_eq!( metadata, Bytes::from(INPUT), @@ -121,7 +121,7 @@ some more blabla here let post_processor = SwanPurchasePostProcessor::new("", ""); - let (output, _) = post_processor.post_process(INPUT.to_string()).unwrap(); + let (output, _, _) = post_processor.post_process(INPUT.to_string()).unwrap(); println!("{}", output); let addresses = >::abi_decode(&output, true).unwrap(); diff --git a/src/compute/workflows/presets/generation.json b/src/compute/workflows/presets/generation.json index 9d05398..7eacacd 100644 --- a/src/compute/workflows/presets/generation.json +++ b/src/compute/workflows/presets/generation.json @@ -2,7 +2,7 @@ "name": "LLM generation", "description": "Directly generate text with input", "config": { - "max_steps": 1, + "max_steps": 10, "max_time": 50, "tools": [""] }, diff --git a/src/main.rs b/src/main.rs index b999851..f2eff1e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -10,5 +10,6 @@ async fn main() -> Result<()> { dkn_oracle::cli().await?; + log::info!("Bye!"); Ok(()) } From ebac87dfa2e46b78c7e0bf139d1bf8ebe8217e0e Mon Sep 17 00:00:00 2001 From: erhant Date: Thu, 31 Oct 2024 13:39:51 +0300 Subject: [PATCH 2/2] added `start` check for registrations --- src/commands/coordinator.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/commands/coordinator.rs b/src/commands/coordinator.rs index 2d2f65d..b9dd2b7 100644 --- a/src/commands/coordinator.rs +++ b/src/commands/coordinator.rs @@ -27,6 +27,10 @@ pub async fn run_oracle( kinds.push(kind); } } + + if kinds.is_empty() { + return Err(eyre!("You are not registered as any type of oracle."))?; + } } else { // otherwise, make sure we are registered to required kinds for kind in &kinds {