diff --git a/Cargo.lock b/Cargo.lock index 7b6d067b..329d726a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -927,6 +927,24 @@ dependencies = [ "serde", ] +[[package]] +name = "bip39" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" +dependencies = [ + "bitcoin_hashes", + "rand_core", + "serde", + "unicode-normalization", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" + [[package]] name = "bitflags" version = "1.3.2" @@ -1144,6 +1162,7 @@ dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", + "serde", "winapi", ] @@ -1176,7 +1195,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim 0.11.1", ] [[package]] @@ -1564,8 +1583,18 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + +[[package]] +name = "darling" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +dependencies = [ + "darling_core 0.20.9", + "darling_macro 0.20.9", ] [[package]] @@ -1582,17 +1611,42 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.11.1", + "syn 2.0.52", +] + [[package]] name = "darling_macro" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core", + "darling_core 0.13.4", "quote", "syn 1.0.109", ] +[[package]] +name = "darling_macro" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +dependencies = [ + "darling_core 0.20.9", + "quote", + "syn 2.0.52", +] + [[package]] name = "debugid" version = "0.8.0" @@ -1630,6 +1684,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", + "serde", ] [[package]] @@ -1730,6 +1785,15 @@ dependencies = [ "signature 1.6.4", ] +[[package]] +name = "ed25519-bip32" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb588f93c0d91b2f668849fd6d030cddb0b2e31f105963be189da5acdf492a21" +dependencies = [ + "cryptoxide", +] + [[package]] name = "either" version = "1.10.0" @@ -1754,7 +1818,7 @@ dependencies = [ "rustc_version 0.2.3", "serde", "serde_json", - "serde_with", + "serde_with 1.14.0", "url", "void", ] @@ -2376,7 +2440,7 @@ dependencies = [ "thiserror", "tokio", "tokio-retry", - "tonic", + "tonic 0.9.2", "tower", "tracing", ] @@ -2388,8 +2452,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a3b24a3f57be08afc02344e693afb55e48172c9c2ab86ff3fdb8efff550e4b9" dependencies = [ "prost 0.11.9", - "prost-types", - "tonic", + "prost-types 0.11.9", + "tonic 0.9.2", ] [[package]] @@ -2414,7 +2478,7 @@ dependencies = [ "google-cloud-gax", "google-cloud-googleapis", "google-cloud-token", - "prost-types", + "prost-types 0.11.9", "thiserror", "tokio", "tokio-util", @@ -2656,7 +2720,7 @@ dependencies = [ "hyper", "log", "rustls 0.20.9", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.23.4", ] @@ -2672,7 +2736,7 @@ dependencies = [ "hyper", "log", "rustls 0.21.10", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", ] @@ -2755,6 +2819,7 @@ checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde", ] [[package]] @@ -2853,6 +2918,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.12.1" @@ -2936,15 +3010,6 @@ dependencies = [ "twox-hash", ] -[[package]] -name = "keccak" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" -dependencies = [ - "cpufeatures", -] - [[package]] name = "lapin" version = "2.3.1" @@ -3517,11 +3582,11 @@ dependencies = [ "strum_macros", "thiserror", "tokio", - "tonic", + "tonic 0.11.0", "tracing", "tracing-subscriber", "unicode-truncate", - "utxorpc", + "utxorpc-spec", ] [[package]] @@ -3566,53 +3631,42 @@ dependencies = [ [[package]] name = "pallas" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b1aeedd0e1c254374f10f5b0b59672a81421e1e55feccc41863dc37c1626ba4" dependencies = [ "pallas-addresses", - "pallas-applying", "pallas-codec", "pallas-configs", "pallas-crypto", "pallas-network", "pallas-primitives", "pallas-traverse", + "pallas-txbuilder", "pallas-utxorpc", ] [[package]] name = "pallas-addresses" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48a8c469b0328e61398c6ff65dce717acf664a5e1f15a788b7d8f0efc10f3153" dependencies = [ "base58", "bech32", "crc", + "cryptoxide", "hex", "pallas-codec", "pallas-crypto", - "sha3", "thiserror", ] -[[package]] -name = "pallas-applying" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" -dependencies = [ - "hex", - "pallas-addresses", - "pallas-codec", - "pallas-crypto", - "pallas-primitives", - "pallas-traverse", - "rand", -] - [[package]] name = "pallas-codec" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ea50feb0c8f87b5ee38df90ed3c125d7f7ecd81a7fe1eafc1a90931dd127590" dependencies = [ "hex", "minicbor", @@ -3622,22 +3676,27 @@ dependencies = [ [[package]] name = "pallas-configs" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c2ae97ad0c054a9c6881085c84ca6620337844473e77dc2620c1b83f29c08d9" dependencies = [ - "base64 0.21.7", + "base64 0.22.0", "hex", + "num-rational", "pallas-addresses", "pallas-codec", "pallas-crypto", + "pallas-primitives", "serde", "serde_json", + "serde_with 3.8.1", ] [[package]] name = "pallas-crypto" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5705ee695a2429d8a352af62671cc3470ba5f76fd48968b59bc6c049ef75a7e0" dependencies = [ "cryptoxide", "hex", @@ -3649,8 +3708,9 @@ dependencies = [ [[package]] name = "pallas-network" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfa79aae99af76af6882a6eb6ac461e3a7b69d795e2f34d68cff04aa0897eaa" dependencies = [ "byteorder", "hex", @@ -3666,8 +3726,9 @@ dependencies = [ [[package]] name = "pallas-primitives" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0476fed841261c33a0fcba321bd69961c3d392eba50821dc0e64808439c71aa" dependencies = [ "base58", "bech32", @@ -3681,8 +3742,9 @@ dependencies = [ [[package]] name = "pallas-traverse" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb366f1daf4c32fe9875dc14e509112a1a0e1036aa741abe98d1b6d3ba83642a" dependencies = [ "hex", "pallas-addresses", @@ -3694,17 +3756,52 @@ dependencies = [ "thiserror", ] +[[package]] +name = "pallas-txbuilder" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2d5a784a78c1d7d5b335531770250bada239c65b255a509dd5d6a038126da6" +dependencies = [ + "hex", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "pallas-traverse", + "pallas-wallet", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "pallas-utxorpc" -version = "0.23.0" -source = "git+https://github.com/txpipe/pallas#94b37fd798bb2528223aaa7946a9293083df5003" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f66c70dc23aaf018e6b595d4b7a2182fe845e92a4a2dc248a23ee6cb7d771df" dependencies = [ "pallas-codec", + "pallas-crypto", "pallas-primitives", "pallas-traverse", "utxorpc-spec", ] +[[package]] +name = "pallas-wallet" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b326ca34ee0d4ffff0199375be943b0cc5a78c4eb6c86d2a0bdd15611fd657eb" +dependencies = [ + "bech32", + "bip39", + "cryptoxide", + "ed25519-bip32", + "pallas-crypto", + "rand", + "thiserror", +] + [[package]] name = "parking" version = "2.2.0" @@ -3748,37 +3845,37 @@ checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" [[package]] name = "pbjson" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048f9ac93c1eab514f9470c4bc8d97ca2a0a236b84f45cc19d69a59fc11467f6" +checksum = "1030c719b0ec2a2d25a5df729d6cff1acf3cc230bf766f4f97833591f7577b90" dependencies = [ - "base64 0.13.1", + "base64 0.21.7", "serde", ] [[package]] name = "pbjson-build" -version = "0.5.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbb7b706f2afc610f3853550cdbbf6372fd324824a087806bd4480ea4996e24" +checksum = "2580e33f2292d34be285c5bc3dba5259542b083cfad6037b6d70345f24dcb735" dependencies = [ "heck", - "itertools 0.10.5", - "prost 0.11.9", - "prost-types", + "itertools 0.11.0", + "prost 0.12.3", + "prost-types 0.12.3", ] [[package]] name = "pbjson-types" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a88c8d87f99a4ac14325e7a4c24af190fca261956e3b82dd7ed67e77e6c7043" +checksum = "18f596653ba4ac51bdecbb4ef6773bc7f56042dc13927910de1684ad3d32aa12" dependencies = [ "bytes", "chrono", "pbjson", "pbjson-build", - "prost 0.11.9", + "prost 0.12.3", "prost-build", "serde", ] @@ -4004,12 +4101,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.1.25" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" dependencies = [ "proc-macro2", - "syn 1.0.109", + "syn 2.0.52", ] [[package]] @@ -4105,22 +4202,22 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.9" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" dependencies = [ "bytes", "heck", "itertools 0.10.5", - "lazy_static", "log", "multimap", + "once_cell", "petgraph", "prettyplease", - "prost 0.11.9", - "prost-types", + "prost 0.12.3", + "prost-types 0.12.3", "regex", - "syn 1.0.109", + "syn 2.0.52", "tempfile", "which", ] @@ -4160,6 +4257,15 @@ dependencies = [ "prost 0.11.9", ] +[[package]] +name = "prost-types" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +dependencies = [ + "prost 0.12.3", +] + [[package]] name = "psm" version = "0.1.21" @@ -4399,7 +4505,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", @@ -4604,7 +4710,7 @@ checksum = "25da151615461c7347114b1ad1a7458b4cdebc69cb220cd140cd5cb324b1dd37" dependencies = [ "log", "rustls 0.21.10", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "rustls-webpki 0.101.7", ] @@ -4615,7 +4721,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "schannel", "security-framework", ] @@ -4629,6 +4748,16 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.0", + "rustls-pki-types", +] + [[package]] name = "rustls-pki-types" version = "1.3.1" @@ -4829,7 +4958,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" dependencies = [ "serde", - "serde_with_macros", + "serde_with_macros 1.5.2", +] + +[[package]] +name = "serde_with" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +dependencies = [ + "base64 0.22.0", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.2.5", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros 3.8.1", + "time", ] [[package]] @@ -4838,12 +4985,24 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ - "darling", + "darling 0.13.4", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "serde_with_macros" +version = "3.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +dependencies = [ + "darling 0.20.9", + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "sha1" version = "0.6.1" @@ -4881,16 +5040,6 @@ 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 = "sharded-slab" version = "0.1.7" @@ -5297,9 +5446,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -5406,7 +5555,7 @@ dependencies = [ "cfg-if 1.0.0", "p12", "rustls-connector", - "rustls-pemfile", + "rustls-pemfile 1.0.4", ] [[package]] @@ -5588,6 +5737,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.2", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.14" @@ -5689,8 +5849,7 @@ dependencies = [ "percent-encoding", "pin-project", "prost 0.11.9", - "rustls-native-certs", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "tokio", "tokio-rustls 0.24.1", "tokio-stream", @@ -5701,6 +5860,37 @@ dependencies = [ "webpki-roots 0.23.1", ] +[[package]] +name = "tonic" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64 0.21.7", + "bytes", + "h2", + "http 0.2.11", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost 0.12.3", + "rustls-native-certs 0.7.0", + "rustls-pemfile 2.1.2", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.25.0", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + [[package]] name = "tower" version = "0.4.13" @@ -5847,9 +6037,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -5939,30 +6129,19 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" -[[package]] -name = "utxorpc" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a98857edfd2d93f425c531a047030b118a293e17596a22d6bdf31f11300bf8e" -dependencies = [ - "thiserror", - "tokio", - "tonic", - "utxorpc-spec", -] - [[package]] name = "utxorpc-spec" -version = "0.3.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88f80e24bfe310d0972406d15c0892ff09b6c81ded2cdefc0183aac35cf0514f" +checksum = "e6ed1da9027ea2010458a9aa5da7d896518176165d630f0325ad2c994f69772b" dependencies = [ "bytes", + "futures-core", "pbjson", "pbjson-types", - "prost 0.11.9", + "prost 0.12.3", "serde", - "tonic", + "tonic 0.11.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8ee6987c..f433c42e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,16 +22,16 @@ u5c = ["tonic"] # kafka = auto feature flag [dependencies] -# pallas = "0.21.0" +pallas = "0.27.0" # pallas = { path = "../pallas/pallas" } -pallas = { git = "https://github.com/txpipe/pallas" } +# pallas = { git = "https://github.com/txpipe/pallas" } gasket = { version = "^0.7", features = ["derive"] } gasket-prometheus = { version = "^0.7" } # gasket = { path = "../../construkts/gasket-rs/gasket", features = ["derive"] } # gasket = { git = "https://github.com/construkts/gasket-rs.git", features = ["derive"] } -utxorpc = { version = "^0.1" } +utxorpc-spec = { version = "^0.5" } hex = "0.4.3" net2 = "0.2.37" @@ -68,7 +68,7 @@ google-cloud-googleapis = { version = "0.10.0", optional = true } google-cloud-default = { version = "0.4.0", optional = true, features = ["pubsub"] } r2d2_redis = { version = "0.14.0", optional = true } jsonwebtoken = { version = "8.3.0", optional = true } -tonic = { version = "0.9.2", features = ["tls", "tls-roots"], optional = true } +tonic = { version = "0.11", features = ["tls", "tls-roots"], optional = true } futures = { version = "0.3.28", optional = true } sqlx = { version = "0.7", features = ["runtime-tokio", "tls-native-tls", "any", "sqlite", "postgres"], optional = true } aws-config = { version = "^1.1", optional = true } diff --git a/src/filters/legacy_v1/crawl.rs b/src/filters/legacy_v1/crawl.rs index da370cf2..4b1b3c08 100644 --- a/src/filters/legacy_v1/crawl.rs +++ b/src/filters/legacy_v1/crawl.rs @@ -86,7 +86,7 @@ impl EventWriter<'_> { } for redeemer in tx.redeemers() { - self.append_from(self.to_plutus_redeemer_record(redeemer))?; + self.append_from(self.to_plutus_redeemer_record(&redeemer))?; } for datum in tx.plutus_data() { diff --git a/src/filters/legacy_v1/map.rs b/src/filters/legacy_v1/map.rs index 71e6d441..2ab2ac00 100644 --- a/src/filters/legacy_v1/map.rs +++ b/src/filters/legacy_v1/map.rs @@ -1,4 +1,6 @@ use gasket::framework::AsWorkError; +use pallas::codec::utils::Nullable; +use pallas::ledger::primitives::conway; use serde_json::{json, Value as JsonValue}; use std::collections::HashMap; use std::ops::Deref as _; @@ -14,7 +16,7 @@ use pallas::ledger::primitives::{ }; use pallas::ledger::traverse::{ ComputeHash, MultiEraAsset, MultiEraBlock, MultiEraCert, MultiEraInput, MultiEraOutput, - MultiEraTx, OriginalHash, + MultiEraRedeemer, MultiEraTx, OriginalHash, }; use pallas::network::miniprotocols::Point; use pallas::{codec::utils::KeepRaw, crypto::hash::Hash}; @@ -106,19 +108,19 @@ fn relay_to_string(relay: &Relay) -> String { match relay { Relay::SingleHostAddr(port, ipv4, ipv6) => { let ip = match (ipv6, ipv4) { - (None, None) => "".to_string(), - (_, Some(x)) => ip_string_from_bytes(x.as_ref()), - (Some(x), _) => ip_string_from_bytes(x.as_ref()), + (_, Nullable::Some(x)) => ip_string_from_bytes(x.as_ref()), + (Nullable::Some(x), _) => ip_string_from_bytes(x.as_ref()), + _ => "".to_string(), }; match port { - Some(port) => format!("{ip}:{port}"), - None => ip, + Nullable::Some(port) => format!("{ip}:{port}"), + _ => ip, } } Relay::SingleHostName(port, host) => match port { - Some(port) => format!("{host}:{port}"), - None => host.clone(), + Nullable::Some(port) => format!("{host}:{port}"), + _ => host.clone(), }, Relay::MultiHostName(host) => host.clone(), } @@ -396,18 +398,20 @@ impl EventWriter<'_> { } } - pub fn to_plutus_redeemer_record(&self, redeemer: &alonzo::Redeemer) -> PlutusRedeemerRecord { + pub fn to_plutus_redeemer_record(&self, redeemer: &MultiEraRedeemer) -> PlutusRedeemerRecord { PlutusRedeemerRecord { - purpose: match redeemer.tag { - alonzo::RedeemerTag::Spend => "spend".to_string(), - alonzo::RedeemerTag::Mint => "mint".to_string(), - alonzo::RedeemerTag::Cert => "cert".to_string(), - alonzo::RedeemerTag::Reward => "reward".to_string(), + purpose: match redeemer.tag() { + conway::RedeemerTag::Spend => "spend".to_string(), + conway::RedeemerTag::Mint => "mint".to_string(), + conway::RedeemerTag::Cert => "cert".to_string(), + conway::RedeemerTag::Reward => "reward".to_string(), + conway::RedeemerTag::Vote => "vote".to_string(), + conway::RedeemerTag::Propose => "propose".to_string(), }, - ex_units_mem: redeemer.ex_units.mem, - ex_units_steps: redeemer.ex_units.steps, - input_idx: redeemer.index, - plutus_data: redeemer.data.to_json(), + ex_units_mem: redeemer.ex_units().mem, + ex_units_steps: redeemer.ex_units().steps, + input_idx: redeemer.index(), + plutus_data: redeemer.data().to_json(), } } @@ -476,8 +480,14 @@ impl EventWriter<'_> { reward_account: reward_account.to_hex(), pool_owners: pool_owners.iter().map(|p| p.to_hex()).collect(), relays: relays.iter().map(relay_to_string).collect(), - pool_metadata: pool_metadata.as_ref().map(|m| m.url.clone()), - pool_metadata_hash: pool_metadata.as_ref().map(|m| m.hash.clone().to_hex()), + pool_metadata: match pool_metadata { + Nullable::Some(x) => Some(x.url.clone()), + _ => None, + }, + pool_metadata_hash: match pool_metadata { + Nullable::Some(x) => Some(x.hash.clone().to_hex()), + _ => None, + }, }, Certificate::PoolRetirement(pool, epoch) => EventData::PoolRetirement { pool: pool.to_hex(), diff --git a/src/filters/parse_cbor.rs b/src/filters/parse_cbor.rs index 35e8c679..0cb836ed 100644 --- a/src/filters/parse_cbor.rs +++ b/src/filters/parse_cbor.rs @@ -3,17 +3,32 @@ use gasket::framework::*; use serde::Deserialize; -use pallas::interop::utxorpc as interop; +use pallas::interop::utxorpc::{self as interop}; use pallas::ledger::traverse as trv; use crate::framework::*; +#[derive(Clone, Default)] +struct NoOpContext; + +impl interop::Context for NoOpContext { + fn get_txo<'a>( + &self, + _tx_hash: pallas::crypto::hash::Hash<32>, + _txo_index: u32, + ) -> Option> { + None + } +} + #[derive(Default, Stage)] #[stage(name = "filter-parse-cbor", unit = "ChainEvent", worker = "Worker")] pub struct Stage { pub input: FilterInputPort, pub output: FilterOutputPort, + mapper: interop::Mapper, + #[metric] ops_count: gasket::metrics::Counter, } @@ -31,7 +46,7 @@ gasket::impl_mapper!(|_worker: Worker, stage: Stage, unit: ChainEvent| => { let output = unit.clone().try_map_record(|r| match r { Record::CborTx(cbor) => { let tx = trv::MultiEraTx::decode(&cbor).or_panic()?; - let tx = interop::map_tx(&tx); + let tx = stage.mapper.map_tx(&tx); Ok(Record::ParsedTx(tx)) } x => Ok(x), diff --git a/src/filters/select/eval/mod.rs b/src/filters/select/eval/mod.rs index 469acd49..67dbb808 100644 --- a/src/filters/select/eval/mod.rs +++ b/src/filters/select/eval/mod.rs @@ -2,7 +2,9 @@ use std::{ops::Deref, str::FromStr}; use serde::{Deserialize, Serialize}; use tracing::warn; -use utxorpc::spec::cardano::{Asset, AuxData, Metadata, Metadatum, Multiasset, TxInput, TxOutput}; +use utxorpc_spec::utxorpc::v1alpha::cardano::{ + Asset, AuxData, Metadata, Metadatum, Multiasset, TxInput, TxOutput, +}; use crate::framework::*; @@ -216,7 +218,7 @@ impl PatternOf<&[u8]> for TextPattern { impl PatternOf<&Metadatum> for TextPattern { fn is_match(&self, subject: &Metadatum) -> MatchOutcome { match subject.metadatum.as_ref() { - Some(utxorpc::spec::cardano::metadatum::Metadatum::Text(subject)) => { + Some(utxorpc_spec::utxorpc::v1alpha::cardano::metadatum::Metadatum::Text(subject)) => { self.is_match(subject.as_str()) } _ => MatchOutcome::Negative, diff --git a/src/filters/select/eval/testing.rs b/src/filters/select/eval/testing.rs index 24b51b8e..84c0116e 100644 --- a/src/filters/select/eval/testing.rs +++ b/src/filters/select/eval/testing.rs @@ -1,4 +1,4 @@ -use utxorpc::spec::cardano::{metadatum, AuxData, Metadata, Metadatum, Tx}; +use utxorpc_spec::utxorpc::v1alpha::cardano::{metadatum, AuxData, Metadata, Metadatum, Tx}; use super::*; diff --git a/src/framework/mod.rs b/src/framework/mod.rs index 632df501..81b76e99 100644 --- a/src/framework/mod.rs +++ b/src/framework/mod.rs @@ -10,8 +10,8 @@ use std::path::PathBuf; pub use crate::cursor::Config as CursorConfig; // we use UtxoRpc as our canonical representation of a parsed Tx -pub use utxorpc::spec::cardano::Block as ParsedBlock; -pub use utxorpc::spec::cardano::Tx as ParsedTx; +pub use utxorpc_spec::utxorpc::v1alpha::cardano::Block as ParsedBlock; +pub use utxorpc_spec::utxorpc::v1alpha::cardano::Tx as ParsedTx; // we use GenesisValues from Pallas as our ChainConfig pub use pallas::ledger::traverse::wellknown::GenesisValues; @@ -174,7 +174,10 @@ impl ChainEvent { } } - pub fn try_map_record(self, f: fn(Record) -> Result) -> Result { + pub fn try_map_record(self, f: F) -> Result + where + F: FnOnce(Record) -> Result, + { let out = match self { Self::Apply(p, x) => Self::Apply(p, f(x)?), Self::Undo(p, x) => Self::Undo(p, f(x)?), diff --git a/src/sources/u5c.rs b/src/sources/u5c.rs index 1847a0d9..8f8bf8c2 100644 --- a/src/sources/u5c.rs +++ b/src/sources/u5c.rs @@ -8,10 +8,12 @@ use tonic::transport::Channel; use tonic::Streaming; use tracing::{debug, error}; -use utxorpc::spec::sync::any_chain_block::Chain; -use utxorpc::spec::sync::chain_sync_service_client::ChainSyncServiceClient; -use utxorpc::spec::sync::follow_tip_response::Action; -use utxorpc::spec::sync::{BlockRef, DumpHistoryRequest, FollowTipRequest, FollowTipResponse}; +use utxorpc_spec::utxorpc::v1alpha::sync::any_chain_block::Chain; +use utxorpc_spec::utxorpc::v1alpha::sync::chain_sync_service_client::ChainSyncServiceClient; +use utxorpc_spec::utxorpc::v1alpha::sync::follow_tip_response::Action; +use utxorpc_spec::utxorpc::v1alpha::sync::{ + BlockRef, DumpHistoryRequest, FollowTipRequest, FollowTipResponse, +}; use crate::framework::*;