From 123bc0abe32206b7fa568b3fd129dfed8d99089e Mon Sep 17 00:00:00 2001 From: cong-or <60357579+cong-or@users.noreply.github.com> Date: Thu, 29 Feb 2024 07:45:36 +0000 Subject: [PATCH] feat: Gateway follower bootstrap (#260) * feat(initial boostrap): follower * feat(initial boostrap): follower * feat(initial boostrap): follower * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * fix ci * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * migration lints * fix deps * fix deps * fix deps * refactor(better error handling): skip * refactor(better error handling): skip * refactor(better error handling): skip * allow git - cargo deny * allow git - cargo deny * allow git - cargo deny * allow git - cargo deny * allow git - cargo deny * allow git - cargo deny * allow git - cargo deny * allow git - cargo deny * build(cargo deny): allow * build(cargo deny): allow * refactor( start from genesis ): no previous followers or metadata * refactor( start from genesis ): no previous followers or metadata * refactor( start from genesis ): no previous followers or metadata * refactor( start from genesis ): no previous followers or metadata * refactor( start from genesis ): no previous followers or metadata * build(ci tag): new release * build(markdown): lints * build(markdown): lints * build(markdown): lints * refactor(housekeeping): tidy * refactor(housekeeping): tidy * build(ci release version): cspell * build(cpsell): dict * build(cpsell): dict * build(clippy): lint * build(clippy): lint * build(clippy): lint * build(clippy): lint * refactor(housekeeping): clean * refactor(housekeeping): clean * test(docker ci tests): envs * test(docker ci tests): envs * test(docker ci tests): envs * refactor(housekeeping): clean * refactor(housekeeping): tidy * stall api fuzzer * refactor(start all services): non recoverable startup panic * refactor(start all services): non recoverable startup panic * refactor(start all services): non recoverable startup panic * refactor(start all services): non recoverable startup panic * refactor(housekeeping): clean * refactor(housekeeping): clean * refactor(housekeeping): clean * Update catalyst-gateway/Earthfile Co-authored-by: Stefano Cunego <93382903+kukkok3@users.noreply.github.com> * Update catalyst-gateway/event-db/Earthfile Co-authored-by: Stefano Cunego <93382903+kukkok3@users.noreply.github.com> * Update catalyst-gateway/event-db/Earthfile Co-authored-by: Stefano Cunego <93382903+kukkok3@users.noreply.github.com> * refactor(code review): suggestions * refactor(code review): suggestions * refactor(code review): suggestions * refactor(code review): suggestions --------- Co-authored-by: Stefano Cunego <93382903+kukkok3@users.noreply.github.com> --- .config/dictionaries/project.dic | 22 +- catalyst-gateway/Cargo.lock | 1524 +++++++++++++---- catalyst-gateway/Earthfile | 2 +- catalyst-gateway/bin/Cargo.toml | 8 + catalyst-gateway/bin/src/cli.rs | 43 +- catalyst-gateway/bin/src/event_db/config.rs | 81 + catalyst-gateway/bin/src/event_db/error.rs | 12 + catalyst-gateway/bin/src/event_db/follower.rs | 151 ++ catalyst-gateway/bin/src/event_db/mod.rs | 2 + catalyst-gateway/bin/src/follower.rs | 335 ++++ catalyst-gateway/bin/src/main.rs | 1 + .../bin/src/service/utilities/catch_panic.rs | 4 +- catalyst-gateway/bin/src/settings.rs | 32 + catalyst-gateway/deny.toml | 4 +- catalyst-gateway/event-db/Earthfile | 14 +- .../event-db/migrations/V1__config_tables.sql | 30 +- .../event-db/migrations/V6__registration.sql | 16 +- .../tests/schema-mismatch/Earthfile | 4 +- .../tests/schema-mismatch/docker-compose.yml | 4 + .../tests/schemathesis-docker-compose.yml | 4 + .../08_concepts/gateway/concrete.md | 126 -- 21 files changed, 1899 insertions(+), 520 deletions(-) create mode 100644 catalyst-gateway/bin/src/event_db/config.rs create mode 100644 catalyst-gateway/bin/src/event_db/follower.rs create mode 100644 catalyst-gateway/bin/src/follower.rs delete mode 100644 docs/src/architecture/08_concepts/gateway/concrete.md diff --git a/.config/dictionaries/project.dic b/.config/dictionaries/project.dic index 16415b06f3..9f2690a33a 100644 --- a/.config/dictionaries/project.dic +++ b/.config/dictionaries/project.dic @@ -132,4 +132,24 @@ xcodeproj xctest xctestrun xcworkspace -yoroi \ No newline at end of file +yoroi +idents +rustflags +rustdoc +rustdocflags +codegen +lintfix +testunit +nextest +testcov +testdocs +fmtchk +fmtfix +gethostname +afinet +netifas +UTXO +mithril +Arbritrary +iohk +wallclock \ No newline at end of file diff --git a/catalyst-gateway/Cargo.lock b/catalyst-gateway/Cargo.lock index 8ff4424936..a1c3321883 100644 --- a/catalyst-gateway/Cargo.lock +++ b/catalyst-gateway/Cargo.lock @@ -29,9 +29,9 @@ dependencies = [ [[package]] name = "aes" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" dependencies = [ "cfg-if", "cipher", @@ -54,26 +54,15 @@ dependencies = [ [[package]] name = "ahash" -version = "0.7.6" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" dependencies = [ "getrandom", "once_cell", "version_check", ] -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", -] - [[package]] name = "aho-corasick" version = "1.1.2" @@ -115,9 +104,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" dependencies = [ "anstyle", "anstyle-parse", @@ -129,38 +118,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.52.0", ] +[[package]] +name = "anyhow" +version = "1.0.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" + [[package]] name = "arrayvec" version = "0.7.4" @@ -169,9 +164,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.4" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f658e2baef915ba0f26f1f7c42bfb8e12f532a01f449a090ded75ae7a07e9ba2" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" dependencies = [ "brotli", "flate2", @@ -181,15 +176,26 @@ dependencies = [ "tokio", ] +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.51", +] + [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", ] [[package]] @@ -198,6 +204,51 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags 1.3.2", + "bytes", + "futures-util", + "http 0.2.11", + "http-body 0.4.6", + "hyper 0.14.28", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 0.2.11", + "http-body 0.4.6", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.69" @@ -213,17 +264,29 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base58" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6107fe1be6682a68940da878d9e9f5e90ca5745b3dec9fd1bb393c8777d4f581" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bb8" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98b4b0f25f18bcdc3ac72bdb486ed0acf7e185221fd4dc985bc15db5800b0ba2" +checksum = "df7c2093d15d6a1d33b1f972e1c5ea3177748742b97a5f392aa83a65262c6780" dependencies = [ "async-trait", "futures-channel", @@ -244,6 +307,22 @@ dependencies = [ "tokio-postgres", ] +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + +[[package]] +name = "binary-layout" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5845e3504cf59b9588fff324710f27ee519515b8a8a9f1207042da9a9e64f819" +dependencies = [ + "doc-comment", + "paste", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -252,9 +331,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "bitvec" @@ -279,47 +358,26 @@ dependencies = [ [[package]] name = "borsh" -version = "0.10.3" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028" dependencies = [ "borsh-derive", - "hashbrown 0.13.1", + "cfg_aliases", ] [[package]] name = "borsh-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" -dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", - "proc-macro-crate 0.1.5", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.3" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" dependencies = [ + "once_cell", + "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.51", + "syn_derive", ] [[package]] @@ -335,9 +393,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -345,15 +403,15 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" [[package]] name = "bytecheck" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" dependencies = [ "bytecheck_derive", "ptr_meta", @@ -362,9 +420,9 @@ dependencies = [ [[package]] name = "bytecheck_derive" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" dependencies = [ "proc-macro2", "quote", @@ -383,19 +441,34 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +[[package]] +name = "cardano-chain-follower" +version = "0.0.1" +source = "git+https://github.com/input-output-hk/hermes.git#c8471d46999441e7115596d1673f041113822a7f" +dependencies = [ + "pallas", + "pallas-hardano", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "cat-gateway" version = "0.0.1" dependencies = [ + "async-recursion", "async-trait", "bb8", "bb8-postgres", + "cardano-chain-follower", "chrono", "clap", "cpu-time", "cryptoxide", "dotenvy", "gethostname", + "hex", "lazy_static", "local-ip-address", "panic-message", @@ -419,12 +492,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" [[package]] name = "cfg-if" @@ -432,18 +502,24 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets", + "windows-targets 0.52.3", ] [[package]] @@ -458,9 +534,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.6" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", @@ -468,33 +544,33 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.0", ] [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", ] [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -515,7 +591,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" dependencies = [ "aes-gcm", - "base64", + "base64 0.21.7", "hkdf", "hmac", "percent-encoding", @@ -544,18 +620,33 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -588,9 +679,9 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ "darling_core", "darling_macro", @@ -598,34 +689,34 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim", - "syn 2.0.38", + "strsim 0.10.0", + "syn 2.0.51", ] [[package]] name = "darling_macro" -version = "0.20.3" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ "darling_core", "quote", - "syn 2.0.38", + "syn 2.0.51", ] [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -654,6 +745,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "doc-comment" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" + [[package]] name = "dotenvy" version = "0.15.7" @@ -662,9 +759,9 @@ checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "encoding_rs" @@ -683,12 +780,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -709,6 +806,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.28" @@ -727,9 +830,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -742,9 +845,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -752,15 +855,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -769,32 +872,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -823,18 +926,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" dependencies = [ "libc", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -849,9 +954,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -861,17 +966,17 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.4.2" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", "futures-core", "futures-sink", "futures-util", - "http", - "indexmap", + "http 0.2.11", + "indexmap 2.2.3", "slab", "tokio", "tokio-util", @@ -879,28 +984,44 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "h2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "31d030e59af851932b72ceebadf4a2b5986dba4c3b99dd2493f8273a0f151943" dependencies = [ - "ahash 0.7.6", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 1.0.0", + "indexmap 2.2.3", + "slab", + "tokio", + "tokio-util", + "tracing", ] +[[package]] +name = "half" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b43ede17f21864e81be2fa654110bf1e793774238d86ef8555c37e6519c0403" + [[package]] name = "hashbrown" -version = "0.13.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ff8ae62cd3a9102e5637afc8452c55acf3844001bd5374e0b0bd7b6616c038" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.8.3", + "ahash", ] [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "headers" @@ -908,10 +1029,10 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322106e6bd0cba2d5ead589ddb8150a13d7c4217cf80d7c4f682ca994ccc6aa9" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "headers-core", - "http", + "http 1.0.0", "httpdate", "mime", "sha1", @@ -923,7 +1044,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54b4a22553d4242c49fddb9ba998a99962b5cc6f22cb5a3482bec22522403ce4" dependencies = [ - "http", + "http 1.0.0", ] [[package]] @@ -934,9 +1055,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "379dada1584ad501b383485dd706b8afb7a70fcbc7f4da7d780638a5a6124a60" [[package]] name = "hex" @@ -946,9 +1067,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac", ] @@ -962,6 +1083,26 @@ dependencies = [ "digest", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http" version = "1.0.0" @@ -973,6 +1114,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http 0.2.11", + "pin-project-lite", +] + [[package]] name = "http-body" version = "1.0.0" @@ -980,7 +1132,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" dependencies = [ "bytes", - "http", + "http 1.0.0", ] [[package]] @@ -991,8 +1143,8 @@ checksum = "41cb79eb393015dadd30fc252023adb0b2400a0caee0fa2a077e6e21a551e840" dependencies = [ "bytes", "futures-util", - "http", - "http-body", + "http 1.0.0", + "http-body 1.0.0", "pin-project-lite", ] @@ -1010,46 +1162,81 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "1.1.0" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", + "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.3.24", + "http 0.2.11", + "http-body 0.4.6", "httparse", "httpdate", "itoa", "pin-project-lite", + "socket2", "tokio", + "tower-service", + "tracing", + "want", ] [[package]] -name = "hyper-util" -version = "0.1.2" +name = "hyper" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdea9aac0dbe5a9240d68cfd9501e2db94222c6dc06843e06640b9e07f0fdc67" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" dependencies = [ "bytes", "futures-channel", "futures-util", - "http", - "http-body", - "hyper", + "h2 0.4.2", + "http 1.0.0", + "http-body 1.0.0", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper 0.14.28", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-util", + "http 1.0.0", + "http-body 1.0.0", + "hyper 1.2.0", "pin-project-lite", "socket2", "tokio", - "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1076,9 +1263,9 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1086,12 +1273,22 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.3", ] [[package]] @@ -1103,21 +1300,39 @@ dependencies = [ "generic-array", ] +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1126,15 +1341,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.149" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "local-ip-address" @@ -1145,7 +1360,7 @@ dependencies = [ "libc", "neli", "thiserror", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1164,6 +1379,12 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + [[package]] name = "md-5" version = "0.10.6" @@ -1176,9 +1397,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "mime" @@ -1196,24 +1417,45 @@ dependencies = [ "unicase", ] +[[package]] +name = "minicbor" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d15f4203d71fdf90903c2696e55426ac97a363c67b218488a73b534ce7aca10" +dependencies = [ + "half", + "minicbor-derive", +] + +[[package]] +name = "minicbor-derive" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1154809406efdb7982841adb6311b3d095b46f78342dd646736122fe6b19e267" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1225,7 +1467,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http", + "http 1.0.0", "httparse", "log", "memchr", @@ -1235,6 +1477,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + [[package]] name = "neli" version = "0.6.4" @@ -1266,7 +1514,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -1281,11 +1529,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -1302,18 +1556,18 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -1329,7 +1583,7 @@ checksum = "1e32339a5dc40459130b3bd269e9892439f55b33e772d2a9d402a789baaf4e8a" dependencies = [ "futures-core", "futures-sink", - "indexmap", + "indexmap 2.2.3", "js-sys", "once_cell", "pin-project-lite", @@ -1382,6 +1636,171 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "pallas" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d414da3cb1cdddd5a11ae11ddbdbd0be42917619e18ea8ddfc942ce564177207" +dependencies = [ + "pallas-addresses", + "pallas-applying", + "pallas-codec", + "pallas-configs", + "pallas-crypto", + "pallas-network", + "pallas-primitives", + "pallas-traverse", + "pallas-utxorpc", +] + +[[package]] +name = "pallas-addresses" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a186bac65200a9b720326082b2bd64fe2f0f9284e8709c70fa16d9f9aeed89e6" +dependencies = [ + "base58", + "bech32", + "crc", + "hex", + "pallas-codec", + "pallas-crypto", + "sha3", + "thiserror", +] + +[[package]] +name = "pallas-applying" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f0bda8d2f978d1482470484d3efcd1a029d9a1f560bb75e32a7a67539e68c58" +dependencies = [ + "hex", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "pallas-traverse", + "rand", +] + +[[package]] +name = "pallas-codec" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4530d1a558070d6b46bfd68cfd77f3a7b2cff3b4426b32ad9f02ff270387b248" +dependencies = [ + "hex", + "minicbor", + "serde", + "thiserror", +] + +[[package]] +name = "pallas-configs" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e6aa7902aefb3fd30f04a345be664df3a36af8a5be38efc55027ef8e2536e69" +dependencies = [ + "base64 0.21.7", + "hex", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "serde", + "serde_json", +] + +[[package]] +name = "pallas-crypto" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12dd0ccf9909e47c1273000eb11945b3d909356c0f0fd2a380f49ced849d2c77" +dependencies = [ + "cryptoxide", + "hex", + "pallas-codec", + "rand_core", + "serde", + "thiserror", +] + +[[package]] +name = "pallas-hardano" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714ec01774a50e2b5da2cf87344194b689d4cc173c378b3d8a65823888e847a1" +dependencies = [ + "binary-layout", + "pallas-network", + "pallas-traverse", + "tap", + "thiserror", + "tracing", +] + +[[package]] +name = "pallas-network" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc07ddecbb424ebf1e23ad5202442a7ae7c3cb909eb375c65a57f9acc521665a" +dependencies = [ + "byteorder", + "hex", + "itertools", + "pallas-codec", + "pallas-crypto", + "rand", + "socket2", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "pallas-primitives" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb19819e37c14cafa0a5bba51cd2966b07b72399a8096910f48e34d49c05adf1" +dependencies = [ + "base58", + "bech32", + "hex", + "log", + "pallas-codec", + "pallas-crypto", + "serde", + "serde_json", +] + +[[package]] +name = "pallas-traverse" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebf62cdadb4d9d15b390fd540fc639fcbeaf3875a6bee490c104d305426cb262" +dependencies = [ + "hex", + "pallas-addresses", + "pallas-codec", + "pallas-crypto", + "pallas-primitives", + "paste", + "serde", + "thiserror", +] + +[[package]] +name = "pallas-utxorpc" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9547f8ada5e3d89894e89a1a372e75b61c526b7081ca1962f39ea264180d2778" +dependencies = [ + "pallas-codec", + "pallas-primitives", + "pallas-traverse", + "utxorpc", +] + [[package]] name = "panic-message" version = "0.3.0" @@ -1406,16 +1825,69 @@ checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pbjson" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "048f9ac93c1eab514f9470c4bc8d97ca2a0a236b84f45cc19d69a59fc11467f6" +dependencies = [ + "base64 0.13.1", + "serde", +] + +[[package]] +name = "pbjson-build" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdbb7b706f2afc610f3853550cdbbf6372fd324824a087806bd4480ea4996e24" +dependencies = [ + "heck", + "itertools", + "prost", + "prost-types", +] + +[[package]] +name = "pbjson-types" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a88c8d87f99a4ac14325e7a4c24af190fca261956e3b82dd7ed67e77e6c7043" +dependencies = [ + "bytes", + "chrono", + "pbjson", + "pbjson-build", + "prost", + "prost-build", + "serde", ] [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "petgraph" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.2.3", +] [[package]] name = "phf" @@ -1435,6 +1907,26 @@ dependencies = [ "siphasher", ] +[[package]] +name = "pin-project" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.51", +] + [[package]] name = "pin-project-lite" version = "0.2.13" @@ -1461,9 +1953,9 @@ dependencies = [ "futures-util", "headers", "hex", - "http", + "http 1.0.0", "http-body-util", - "hyper", + "hyper 1.2.0", "hyper-util", "mime", "mime_guess", @@ -1502,10 +1994,10 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e2bd3f82499a00ecb2d0e06bb1b9a17540aeaa28bab14336a94255ff5185f8f" dependencies = [ - "proc-macro-crate 2.0.1", + "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", ] [[package]] @@ -1528,7 +2020,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", "thiserror", ] @@ -1538,12 +2030,12 @@ version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c7c12d9e19a0cda311f46515b819eb1e8425a4bee004540aff7b9c587e02b82" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "chrono", "derive_more", "futures-util", - "indexmap", + "indexmap 2.2.3", "mime", "num-traits", "poem", @@ -1567,14 +2059,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5d485fb9cc4ca9a8364beedd4ea81294b1f028d459c8fd7bb352e38f87f8ffa" dependencies = [ "darling", - "http", - "indexmap", + "http 1.0.0", + "indexmap 2.2.3", "mime", - "proc-macro-crate 2.0.1", + "proc-macro-crate", "proc-macro2", "quote", "regex", - "syn 2.0.38", + "syn 2.0.51", "thiserror", ] @@ -1610,7 +2102,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64", + "base64 0.21.7", "byteorder", "bytes", "fallible-iterator", @@ -1634,6 +2126,7 @@ dependencies = [ "postgres-protocol", "serde", "serde_json", + "time", ] [[package]] @@ -1649,29 +2142,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "proc-macro-crate" -version = "0.1.5" +name = "prettyplease" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ - "toml", + "proc-macro2", + "syn 1.0.109", ] [[package]] name = "proc-macro-crate" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" +checksum = "b00f26d3400549137f92511a46ac1cd8ce37cb5598a96d382381458b992a5d24" dependencies = [ "toml_datetime", "toml_edit", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -1691,6 +2208,60 @@ dependencies = [ "thiserror", ] +[[package]] +name = "prost" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +dependencies = [ + "bytes", + "heck", + "itertools", + "lazy_static", + "log", + "multimap", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "regex", + "syn 1.0.109", + "tempfile", + "which", +] + +[[package]] +name = "prost-derive" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +dependencies = [ + "prost", +] + [[package]] name = "protobuf" version = "2.28.0" @@ -1729,9 +2300,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -1772,15 +2343,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -1792,9 +2354,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -1804,9 +2366,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -1821,9 +2383,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rend" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" dependencies = [ "bytecheck", ] @@ -1839,12 +2401,13 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.42" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" dependencies = [ "bitvec", "bytecheck", + "bytes", "hashbrown 0.12.3", "ptr_meta", "rend", @@ -1856,9 +2419,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.42" +version = "0.7.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" dependencies = [ "proc-macro2", "quote", @@ -1867,9 +2430,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.0.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e7d90385b59f0a6bf3d3b757f3ca4ece2048265d70db20a2016043d4509a40" +checksum = "a82c0bbc10308ed323529fd3c1dce8badda635aa319a5ff0e6466f33b8101e3f" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -1878,22 +2441,22 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.0.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3d8c6fd84090ae348e63a84336b112b5c3918b3bf0493a581f7bd8ee623c29" +checksum = "6227c01b1783cdfee1bcf844eb44594cd16ec71c35305bf1c9fb5aade2735e16" dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.38", + "syn 2.0.51", "walkdir", ] [[package]] name = "rust-embed-utils" -version = "8.0.0" +version = "8.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "873feff8cb7bf86fdf0a71bb21c95159f4e4a37dd7a4bd1855a940909b583ada" +checksum = "8cb0a25bfbb2d4b4402179c2cf030387d9990857ce08a32592c6238db9fa8665" dependencies = [ "sha2", "walkdir", @@ -1901,9 +2464,9 @@ dependencies = [ [[package]] name = "rust_decimal" -version = "1.32.0" +version = "1.34.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c4216490d5a413bc6d10fa4742bd7d4955941d062c0ef873141d6b0e7b30fd" +checksum = "b39449a79f45e8da28c57c341891b69a183044b29518bb8f86dbac9df60bb7df" dependencies = [ "arrayvec", "borsh", @@ -1934,22 +2497,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.19" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.52.0", ] +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -1974,35 +2543,35 @@ checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" [[package]] name = "semver" -version = "1.0.20" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -2023,11 +2592,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.25" +version = "0.9.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" +checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" dependencies = [ - "indexmap", + "indexmap 2.2.3", "itoa", "ryu", "serde", @@ -2056,6 +2625,16 @@ dependencies = [ "digest", ] +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + [[package]] name = "sharded-slab" version = "0.1.7" @@ -2088,18 +2667,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2125,6 +2704,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "subtle" version = "2.5.0" @@ -2144,15 +2729,27 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "6ab617d94515e94ae53b8406c628598680aa0c9587474ecbe58188f7b345d66c" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.51", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -2170,42 +2767,41 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.3.5", "rustix", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -2213,12 +2809,13 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", + "num-conv", "powerfmt", "serde", "time-core", @@ -2233,10 +2830,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -2257,9 +2855,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -2270,18 +2868,28 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", ] [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", ] [[package]] @@ -2323,9 +2931,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -2335,15 +2943,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml_datetime" version = "0.6.3" @@ -2356,11 +2955,71 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap", + "indexmap 2.2.3", "toml_datetime", "winnow", ] +[[package]] +name = "tonic" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +dependencies = [ + "async-trait", + "axum", + "base64 0.21.7", + "bytes", + "futures-core", + "futures-util", + "h2 0.3.24", + "http 0.2.11", + "http-body 0.4.6", + "hyper 0.14.28", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + [[package]] name = "tracing" version = "0.1.40" @@ -2381,7 +3040,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", ] [[package]] @@ -2396,12 +3055,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -2417,9 +3076,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "nu-ansi-term", "serde", @@ -2433,6 +3092,12 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + [[package]] name = "typenum" version = "1.17.0" @@ -2441,20 +3106,22 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "ulid" -version = "1.1.0" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e37c4b6cbcc59a8dcd09a6429fbc7890286bcbb79215cea7b38a3c4c0921d93" +checksum = "34778c17965aa2a08913b57e1f34db9b4a63f5de31768b55bf20d2795f921259" dependencies = [ + "getrandom", "rand", "serde", "uuid", + "web-time", ] [[package]] name = "uncased" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b9bc53168a4be7402ab86c3aad243a84dd7381d09be0eddc81280c1da95ca68" +checksum = "e1b88fcfe09e89d3866a5c11019378088af2d24c3fbd4f0543f96b479ec90697" dependencies = [ "version_check", ] @@ -2470,9 +3137,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -2482,9 +3149,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -2507,9 +3174,9 @@ checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -2528,11 +3195,49 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +[[package]] +name = "utxorpc" +version = "1.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1841467f5ca405d4e878be56e1a8c8ae1f6f62b50984988027f6b4859d36c0" +dependencies = [ + "utxorpc-spec-cardano", + "utxorpc-spec-sync", +] + +[[package]] +name = "utxorpc-spec-cardano" +version = "1.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb1a8c03aef60aa154ae04fe871c9a6fab18c99f468f0ddc096e45c21c5b6814" +dependencies = [ + "bytes", + "pbjson", + "pbjson-types", + "prost", + "serde", +] + +[[package]] +name = "utxorpc-spec-sync" +version = "1.0.0-alpha.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f7ab73d37f96892e16a5c89f9aa430b9efdcaa5f2a0259a87f99a2eb732ea0" +dependencies = [ + "bytes", + "pbjson", + "pbjson-types", + "prost", + "serde", + "tonic", + "utxorpc-spec-cardano", +] + [[package]] name = "uuid" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad59a7560b41a70d191093a945f0b87bc1deeda46fb237479708a1d6b6cdfc" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ "getrandom", "serde", @@ -2560,6 +3265,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2568,9 +3282,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2578,24 +3292,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2603,33 +3317,55 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.51", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "2ee269d72cc29bf77a2c4bc689cc750fb39f5cbd493d2205bbb3f5c7779cf7b0" dependencies = [ "js-sys", "wasm-bindgen", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + [[package]] name = "whoami" version = "1.4.1" @@ -2679,11 +3415,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets", + "windows-targets 0.52.3", ] [[package]] @@ -2692,7 +3428,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.3", ] [[package]] @@ -2701,13 +3446,28 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +dependencies = [ + "windows_aarch64_gnullvm 0.52.3", + "windows_aarch64_msvc 0.52.3", + "windows_i686_gnu 0.52.3", + "windows_i686_msvc 0.52.3", + "windows_x86_64_gnu 0.52.3", + "windows_x86_64_gnullvm 0.52.3", + "windows_x86_64_msvc 0.52.3", ] [[package]] @@ -2716,47 +3476,89 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" + [[package]] name = "windows_i686_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" + [[package]] name = "windows_i686_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" + [[package]] name = "winnow" -version = "0.5.17" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] diff --git a/catalyst-gateway/Earthfile b/catalyst-gateway/Earthfile index 767e1b4bad..850a05f1dd 100644 --- a/catalyst-gateway/Earthfile +++ b/catalyst-gateway/Earthfile @@ -4,7 +4,7 @@ VERSION --try --global-cache 0.7 # Set up our target toolchains, and copy our files. builder: - DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.7.0+SETUP + DO github.com/input-output-hk/catalyst-ci/earthly/rust:v2.9.3+SETUP COPY --dir .cargo .config Cargo.* clippy.toml deny.toml rustfmt.toml bin crates tests . diff --git a/catalyst-gateway/bin/Cargo.toml b/catalyst-gateway/bin/Cargo.toml index c91dee5cab..deabd8ed16 100644 --- a/catalyst-gateway/bin/Cargo.toml +++ b/catalyst-gateway/bin/Cargo.toml @@ -22,6 +22,7 @@ bb8-postgres = { workspace = true } tokio-postgres = { workspace = true, features = [ "with-chrono-0_4", "with-serde_json-1", + "with-time-0_3", ] } clap = { workspace = true, features = ["derive", "env"] } @@ -70,3 +71,10 @@ ulid = { workspace = true, features = ["serde", "uuid"] } rust-embed = { workspace = true } local-ip-address.workspace = true gethostname.workspace = true + +hex = "0.4.3" +async-recursion = "1.0.5" + + +cardano-chain-follower= { git = "https://github.com/input-output-hk/hermes.git", version="0.0.1"} + diff --git a/catalyst-gateway/bin/src/cli.rs b/catalyst-gateway/bin/src/cli.rs index 9ab4a95392..f48060af5e 100644 --- a/catalyst-gateway/bin/src/cli.rs +++ b/catalyst-gateway/bin/src/cli.rs @@ -2,8 +2,12 @@ use std::{io::Write, sync::Arc}; use clap::Parser; +use tokio::time; +use tracing::{error, info}; use crate::{ + event_db::config::ConfigQueries, + follower::start_followers, logger, service, settings::{DocsSettings, ServiceSettings}, state::State, @@ -48,8 +52,45 @@ impl Cli { Self::Run(settings) => { logger::init(settings.log_level)?; + let check_config_tick = settings.follower_settings.check_config_tick; + let data_refresh_tick = settings.follower_settings.data_refresh_tick; + + // Unique machine id + let machine_id = settings.follower_settings.machine_uid; + let state = Arc::new(State::new(Some(settings.database_url)).await?); - service::run(&settings.docs_settings, state).await?; + let event_db = state.event_db()?; + + tokio::spawn(async move { + match service::run(&settings.docs_settings, state.clone()).await { + Ok(()) => info!("Endpoints started ok"), + Err(err) => { + error!("Error starting endpoints {err}"); + }, + } + }); + + // tick until config exists + let mut interval = + time::interval(time::Duration::from_secs(check_config_tick.parse::()?)); + let config = loop { + interval.tick().await; + + match event_db.get_config().await { + Ok(config) => break config, + Err(err) => error!("no config {:?}", err), + } + }; + + start_followers( + config, + event_db.clone(), + data_refresh_tick.parse::()?, + check_config_tick.parse::()?, + machine_id, + ) + .await?; + Ok(()) }, Self::Docs(settings) => { diff --git a/catalyst-gateway/bin/src/event_db/config.rs b/catalyst-gateway/bin/src/event_db/config.rs new file mode 100644 index 0000000000..9b2f7dd4cc --- /dev/null +++ b/catalyst-gateway/bin/src/event_db/config.rs @@ -0,0 +1,81 @@ +//! Config Queries +use async_trait::async_trait; +use serde::{Deserialize, Serialize}; +use tracing::error; + +use crate::event_db::{Error, EventDB}; + +#[async_trait] +#[allow(clippy::module_name_repetitions)] +/// Config Queries Trait +pub(crate) trait ConfigQueries: Sync + Send + 'static { + async fn get_config(&self) -> Result<(Vec, FollowerMeta), Error>; +} +use crate::event_db::Error::JsonParseIssue; + +#[derive(Serialize, Deserialize, Debug, PartialEq, PartialOrd, Clone)] +/// Network config metadata +pub(crate) struct NetworkMeta { + /// Mainnet, preview, preprod + pub network: String, + /// Cardano relay address + pub relay: String, +} + +#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)] +/// Follower metadata +pub(crate) struct FollowerMeta { + /// Path to snapshot file for bootstrap + pub mithril_snapshot_path: String, + /// Defines when data is stale or not + pub timing_pattern: u8, +} + +impl EventDB { + /// Get config + const CONFIG_QUERY: &'static str = "SELECT cardano, follower, preview FROM config"; +} + +#[async_trait] +impl ConfigQueries for EventDB { + async fn get_config(&self) -> Result<(Vec, FollowerMeta), Error> { + let conn = self.pool.get().await?; + + let rows = conn.query(Self::CONFIG_QUERY, &[]).await?; + + let Some(row) = rows.first() else { + return Err(Error::NoConfig); + }; + + let mut networks: Vec = Vec::new(); + + let follower_meta: String = row.try_get("follower")?; + let follower_metadata: FollowerMeta = + serde_json::from_str(&follower_meta).map_err(|e| { + Error::NotFound(JsonParseIssue(format!("issue parsing db json {e}")).to_string()) + })?; + + row.try_get("cardano") + .map(|network| networks.push(network)) + .ok(); + + row.try_get("preview") + .map(|network| networks.push(network)) + .ok(); + + let mut parse_errors = vec![]; + + let network_metadata: Vec = networks + .iter() + .map(|meta| serde_json::from_str(meta)) + .filter_map(|r| r.map_err(|e| parse_errors.push(e)).ok()) + .collect(); + + if !parse_errors.is_empty() { + error!("Parsing errors {:?}", parse_errors); + return Err(Error::JsonParseIssue("Unable to parse config".to_string())); + } + + Ok((network_metadata, follower_metadata)) + } +} diff --git a/catalyst-gateway/bin/src/event_db/error.rs b/catalyst-gateway/bin/src/event_db/error.rs index 3e80a2c30d..72196074bd 100644 --- a/catalyst-gateway/bin/src/event_db/error.rs +++ b/catalyst-gateway/bin/src/event_db/error.rs @@ -29,6 +29,18 @@ pub(crate) enum Error { /// Variable error #[error(transparent)] VarErr(#[from] VarError), + /// No config + #[error("No config")] + NoConfig, + /// JSON Parsing error + #[error("Unable to parse database data: {0}")] + JsonParseIssue(String), + #[error("Decode Error: {0}")] + /// Unable to decode hex + DecodeHex(String), + /// No previous followers hence no last updates metadata + #[error("LastUpdate metadata not present: {0}")] + NoLastUpdateMetadata(String), } impl From> for Error { diff --git a/catalyst-gateway/bin/src/event_db/follower.rs b/catalyst-gateway/bin/src/event_db/follower.rs new file mode 100644 index 0000000000..d1cce9ac85 --- /dev/null +++ b/catalyst-gateway/bin/src/event_db/follower.rs @@ -0,0 +1,151 @@ +//! Follower Queries + +use async_trait::async_trait; +use cardano_chain_follower::Network; +use chrono::TimeZone; + +use crate::event_db::{Error, EventDB}; + +/// Block time +pub type BlockTime = i64; +/// Slot +pub type SlotNumber = i64; +/// Epoch +pub type EpochNumber = i64; +/// Block hash +pub type BlockHash = String; +/// Unique follower id +pub type MachineId = String; +/// Time when a follower last indexed +pub type LastUpdate = chrono::DateTime; + +#[async_trait] +#[allow(clippy::module_name_repetitions)] +/// Follower Queries Trait +pub(crate) trait FollowerQueries: Sync + Send + 'static { + async fn index_follower_data( + &self, slot_no: SlotNumber, network: Network, epoch_no: EpochNumber, block_time: BlockTime, + block_hash: BlockHash, + ) -> Result<(), Error>; + + async fn last_updated_metadata( + &self, network: String, + ) -> Result<(SlotNumber, BlockHash, LastUpdate), Error>; + + async fn refresh_last_updated( + &self, last_updated: LastUpdate, slot_no: SlotNumber, block_hash: BlockHash, + network: Network, machine_id: &MachineId, + ) -> Result<(), Error>; +} + +impl EventDB { + /// Update db with follower data + const INDEX_FOLLOWER_QUERY: &'static str = + "INSERT INTO cardano_slot_index(slot_no, network, epoch_no, block_time, block_hash) VALUES($1, $2, $3, $4, $5)"; + /// If no last updated metadata, init with metadata. If present update metadata. + const LAST_UPDATED_QUERY: &'static str = + "INSERT INTO cardano_update_state(id, started, ended, updater_id ,slot_no, network, block_hash, update) VALUES($1, $2, $3 , $4, $5, $6, $7, $8) ON CONFLICT(id) DO UPDATE SET ended = $2, slot_no = $5, block_hash = $7;"; + /// Start follower from where previous follower left off. + const START_FROM_QUERY: &'static str = + "SELECT network, slot_no, block_hash, ended FROM cardano_update_state WHERE network = $1;"; +} + +#[async_trait] +impl FollowerQueries for EventDB { + /// Index follower block stream + async fn index_follower_data( + &self, slot_no: SlotNumber, network: Network, epoch_no: EpochNumber, block_time: BlockTime, + block_hash: BlockHash, + ) -> Result<(), Error> { + let conn = self.pool.get().await?; + + let timestamp: chrono::DateTime = chrono::Utc.timestamp_nanos(block_time); + + let network = match network { + Network::Mainnet => "mainnet".to_string(), + Network::Preview => "preview".to_string(), + Network::Preprod => "preprod".to_string(), + Network::Testnet => "testnet".to_string(), + }; + + let _rows = conn + .query(Self::INDEX_FOLLOWER_QUERY, &[ + &slot_no, + &network, + &epoch_no, + ×tamp, + &hex::decode(block_hash).map_err(|e| Error::DecodeHex(e.to_string()))?, + ]) + .await?; + + Ok(()) + } + + /// Check when last update occurred + async fn last_updated_metadata( + &self, network: String, + ) -> Result<(SlotNumber, BlockHash, LastUpdate), Error> { + let conn = self.pool.get().await?; + + let rows = conn.query(Self::START_FROM_QUERY, &[&network]).await?; + if rows.is_empty() { + return Err(Error::NoLastUpdateMetadata("No metadata".to_string())); + } + + let Some(row) = rows.first() else { + return Err(Error::NoLastUpdateMetadata("No metadata".to_string())); + }; + + let slot_no: SlotNumber = match row.try_get("slot_no") { + Ok(slot) => slot, + Err(e) => return Err(Error::NoLastUpdateMetadata(e.to_string())), + }; + + let block_hash: BlockHash = match row.try_get("block_hash") { + Ok(block_hash) => block_hash, + Err(e) => return Err(Error::NoLastUpdateMetadata(e.to_string())), + }; + let last_updated: LastUpdate = match row.try_get("ended") { + Ok(last_updated) => last_updated, + Err(e) => return Err(Error::NoLastUpdateMetadata(e.to_string())), + }; + + Ok((slot_no, block_hash, last_updated)) + } + + /// Mark point in time where the last follower finished indexing in order for future + /// followers to pick up from this point + async fn refresh_last_updated( + &self, last_updated: LastUpdate, slot_no: SlotNumber, block_hash: BlockHash, + network: Network, machine_id: &MachineId, + ) -> Result<(), Error> { + let conn = self.pool.get().await?; + + // Rollback or update + let update = true; + + let (id, network) = match network { + Network::Mainnet => (1, "mainnet".to_string()), + Network::Preview => (2, "preview".to_string()), + Network::Preprod => (3, "preprod".to_string()), + Network::Testnet => (4, "testnet".to_string()), + }; + + // An insert only happens once when there is no update metadata available + // All future additions are just updates on ended, slot_no and block_hash + let _rows = conn + .query(Self::LAST_UPDATED_QUERY, &[ + &i64::from(id), + &last_updated, + &last_updated, + &machine_id, + &slot_no, + &network, + &block_hash, + &update, + ]) + .await?; + + Ok(()) + } +} diff --git a/catalyst-gateway/bin/src/event_db/mod.rs b/catalyst-gateway/bin/src/event_db/mod.rs index 6c4a09391f..216fc8341a 100644 --- a/catalyst-gateway/bin/src/event_db/mod.rs +++ b/catalyst-gateway/bin/src/event_db/mod.rs @@ -7,8 +7,10 @@ use dotenvy::dotenv; use error::Error; use tokio_postgres::NoTls; +pub(crate) mod config; mod config_table; pub(crate) mod error; +pub(crate) mod follower; pub(crate) mod legacy; pub(crate) mod schema_check; diff --git a/catalyst-gateway/bin/src/follower.rs b/catalyst-gateway/bin/src/follower.rs new file mode 100644 index 0000000000..ef9605952f --- /dev/null +++ b/catalyst-gateway/bin/src/follower.rs @@ -0,0 +1,335 @@ +//! Logic for orchestrating followers +use std::{error::Error, path::PathBuf, str::FromStr, sync::Arc}; + +/// Handler for follower tasks, allows for control over spawned follower threads +pub type ManageTasks = JoinHandle<()>; + +use async_recursion::async_recursion; +use cardano_chain_follower::{ + network_genesis_values, ChainUpdate, Follower, FollowerConfigBuilder, Network, Point, +}; +use tokio::{task::JoinHandle, time}; +use tracing::{error, info}; + +use crate::event_db::{ + config::{ConfigQueries, FollowerMeta, NetworkMeta}, + follower::{BlockHash, FollowerQueries, LastUpdate, MachineId, SlotNumber}, + EventDB, +}; + +/// Arbritrary value which is only used in the case where there is no +/// previous followers making the question of data staleness irrelevant. +const DATA_NOT_STALE: i64 = 1; + +#[async_recursion] +/// Start followers as per defined in the config +pub(crate) async fn start_followers( + configs: (Vec, FollowerMeta), db: Arc, data_refresh_tick: u64, + check_config_tick: u64, machine_id: String, +) -> Result<(), Box> { + // spawn followers and obtain thread handlers for control and future cancellation + let follower_tasks = spawn_followers( + configs.clone(), + db.clone(), + data_refresh_tick, + machine_id.clone(), + ) + .await?; + + // Followers should continue indexing until config has changed + let mut interval = time::interval(time::Duration::from_secs(check_config_tick)); + let config = loop { + interval.tick().await; + match db.get_config().await { + Ok(config) => { + if configs != config { + info!("Config has changed! restarting"); + break Some(config); + } + }, + Err(err) => { + error!("No config {:?}", err); + break None; + }, + } + }; + + // Config has changed, terminate all followers and restart with new config. + info!("Terminating followers"); + for task in follower_tasks { + task.abort(); + } + + match config { + Some(config) => { + info!("Restarting followers with new config"); + start_followers( + config, + db, + data_refresh_tick, + check_config_tick, + machine_id.clone(), + ) + .await?; + }, + None => return Err("Config has been deleted...".into()), + } + + Ok(()) +} + +/// Spawn follower threads and return associated handlers +async fn spawn_followers( + configs: (Vec, FollowerMeta), db: Arc, data_refresh_tick: u64, + machine_id: String, +) -> Result, Box> { + let snapshot_path = configs.1.mithril_snapshot_path; + + let mut follower_tasks = Vec::new(); + + for config in &configs.0 { + info!("starting follower for {:?}", config.network); + + let network = Network::from_str(&config.network)?; + + // Tick until data is stale then start followers + let mut interval = time::interval(time::Duration::from_secs(data_refresh_tick)); + let task_handler = loop { + interval.tick().await; + + // Check if previous follower has indexed, if so, return last update point in order to + // continue indexing from that point. If there was no previous follower, we + // start from genesis point. + let (slot_no, block_hash, last_updated) = + find_last_update_point(db.clone(), &config.network).await?; + + // Data is marked as stale after N seconds with no updates. + let threshold = if let Some(last_update) = last_updated { + last_update.timestamp() + } else { + info!( + "No previous followers, staleness not relevant. Start follower from genesis." + ); + DATA_NOT_STALE + }; + + // Threshold which defines if data is stale and ready to update or not + if chrono::offset::Utc::now().timestamp() - threshold > configs.1.timing_pattern.into() + { + info!( + "Last update is stale for network {} - ready to update, starting follower now.", + config.network + ); + let follower_handler = init_follower( + network, + &config.relay, + (slot_no, block_hash), + db.clone(), + machine_id.clone(), + &snapshot_path, + ) + .await?; + break follower_handler; + } + info!( + "Data is still fresh for network {}, tick until data is stale", + config.network + ); + }; + + follower_tasks.push(task_handler); + } + + Ok(follower_tasks) +} + +/// Establish point at which the last follower stopped updating in order to pick up where +/// it left off. If there was no previous follower, start indexing from genesis point. +async fn find_last_update_point( + db: Arc, network: &String, +) -> Result<(Option, Option, Option), Box> { + let (slot_no, block_hash, last_updated) = + match db.last_updated_metadata(network.to_string()).await { + Ok((slot_no, block_hash, last_updated)) => { + info!( + "Previous follower stopped updating at Slot_no: {} block_hash:{} last_updated: {}", + slot_no, block_hash, last_updated + ); + (Some(slot_no), Some(block_hash), Some(last_updated)) + }, + Err(err) => { + info!("No previous followers, start from genesis. Db msg: {}", err); + (None, None, None) + }, + }; + + Ok((slot_no, block_hash, last_updated)) +} + +/// Initiate single follower and returns associated task handler +/// which facilitates future control over spawned threads. +async fn init_follower( + network: Network, relay: &str, start_from: (Option, Option), + db: Arc, machine_id: MachineId, snapshot: &str, +) -> Result> { + let mut follower = follower_connection(start_from, snapshot, network, relay).await?; + + let genesis_values = + network_genesis_values(&network).ok_or("Obtaining genesis values failed")?; + + let task = tokio::spawn(async move { + loop { + let chain_update = match follower.next().await { + Ok(chain_update) => chain_update, + Err(err) => { + error!( + "Unable receive next update from follower {:?} - skip..", + err + ); + continue; + }, + }; + + match chain_update { + ChainUpdate::Block(data) => { + let block = match data.decode() { + Ok(block) => block, + Err(err) => { + error!("Unable to decode block {:?} - skip..", err); + continue; + }, + }; + + // Parse block + + let epoch = match block.epoch(&genesis_values).0.try_into() { + Ok(epoch) => epoch, + Err(err) => { + error!("Cannot parse epoch from block {:?} - skip..", err); + continue; + }, + }; + + let wallclock = match block.wallclock(&genesis_values).try_into() { + Ok(time) => time, + Err(err) => { + error!("Cannot parse wall time from block {:?} - skip..", err); + continue; + }, + }; + + let slot = match block.slot().try_into() { + Ok(slot) => slot, + Err(err) => { + error!("Cannot parse slot from block {:?} - skip..", err); + continue; + }, + }; + + match db + .index_follower_data( + slot, + network, + epoch, + wallclock, + hex::encode(block.hash()), + ) + .await + { + Ok(()) => (), + Err(err) => { + error!("unable to index follower data {:?} - skip..", err); + continue; + }, + } + + // Index the following: + + // UTXO stuff + + // Registration stuff + + // Rewards stuff + + // Last updated + + // Refresh update metadata for future followers + match db + .refresh_last_updated( + chrono::offset::Utc::now(), + slot, + hex::encode(block.hash()), + network, + &machine_id, + ) + .await + { + Ok(()) => (), + Err(err) => { + error!("unable to mark last update point {:?} - skip..", err); + continue; + }, + }; + }, + ChainUpdate::Rollback(data) => { + let block = match data.decode() { + Ok(block) => block, + Err(err) => { + error!("unable to decode block {:?} - skip..", err); + continue; + }, + }; + + info!( + "Rollback block NUMBER={} SLOT={} HASH={}", + block.number(), + block.slot(), + hex::encode(block.hash()), + ); + }, + } + } + }); + + Ok(task) +} + +/// In the context of setting up the follower connection. +/// If there is metadata present which allows us to bootstrap from a point in time +/// We start from there, if not; we start from genesis. +async fn follower_connection( + start_from: (Option, Option), snapshot: &str, network: Network, + relay: &str, +) -> Result> { + let mut follower_cfg = if start_from.0.is_none() || start_from.1.is_none() { + // start from genesis, no previous followers, hence no starting points. + FollowerConfigBuilder::default() + .mithril_snapshot_path(PathBuf::from(snapshot)) + .build() + } else { + // start from given point + FollowerConfigBuilder::default() + .follow_from(Point::new( + start_from.0.ok_or("Slot number not present")?.try_into()?, + hex::decode(start_from.1.ok_or("Block Hash not present")?)?, + )) + .mithril_snapshot_path(PathBuf::from(snapshot)) + .build() + }; + + let follower = match Follower::connect(relay, network, follower_cfg.clone()).await { + Ok(follower) => follower, + Err(err) => { + error!( + "Unable to bootstrap via mithril snapshot {}. Trying network..", + err + ); + + // We know bootstrapping from the snapshot fails, remove path and try from network + follower_cfg.mithril_snapshot_path = None; + Follower::connect(relay, network, follower_cfg).await? + }, + }; + + Ok(follower) +} diff --git a/catalyst-gateway/bin/src/main.rs b/catalyst-gateway/bin/src/main.rs index 675d55c859..1e1e2664ec 100644 --- a/catalyst-gateway/bin/src/main.rs +++ b/catalyst-gateway/bin/src/main.rs @@ -3,6 +3,7 @@ use clap::Parser; mod cli; mod event_db; +mod follower; mod logger; mod service; mod settings; diff --git a/catalyst-gateway/bin/src/service/utilities/catch_panic.rs b/catalyst-gateway/bin/src/service/utilities/catch_panic.rs index 618824822b..06001c7522 100644 --- a/catalyst-gateway/bin/src/service/utilities/catch_panic.rs +++ b/catalyst-gateway/bin/src/service/utilities/catch_panic.rs @@ -20,8 +20,8 @@ pub(crate) struct ServicePanicHandler; // Customized Panic handler - data storage. // Allows us to catch the backtrace so we can include it in logs. thread_local! { - static BACKTRACE: RefCell> = RefCell::new(None); - static LOCATION: RefCell> = RefCell::new(None); + static BACKTRACE: RefCell> = const { RefCell::new(None) }; + static LOCATION: RefCell> = const { RefCell::new(None) }; } /// Sets a custom panic hook to capture the Backtrace and Panic Location for logging diff --git a/catalyst-gateway/bin/src/settings.rs b/catalyst-gateway/bin/src/settings.rs index 3b366d052e..e5ea178bc8 100644 --- a/catalyst-gateway/bin/src/settings.rs +++ b/catalyst-gateway/bin/src/settings.rs @@ -35,6 +35,15 @@ const API_HOST_NAMES_DEFAULT: &str = "https://api.prod.projectcatalyst.io"; /// Default `API_URL_PREFIX` used in development. const API_URL_PREFIX_DEFAULT: &str = "/api"; +/// Default `CHECK_CONFIG_TICK` used in development. +const CHECK_CONFIG_TICK_DEFAULT: &str = "5"; + +/// Default `DATA_REFRESH_TICK` used in development +const DATA_REFRESH_TICK_DEFAULT: &str = "5"; + +/// Default `MACHINE_UID` used in development +const MACHINE_UID_DEFAULT: &str = "UID"; + /// Settings for the application. /// /// This struct represents the configuration settings for the application. @@ -54,6 +63,10 @@ pub(crate) struct ServiceSettings { /// Docs settings. #[clap(flatten)] pub(crate) docs_settings: DocsSettings, + + /// Follower settings. + #[clap(flatten)] + pub(crate) follower_settings: FollowerSettings, } /// Settings specifies `OpenAPI` docs generation. @@ -79,6 +92,22 @@ pub(crate) struct DocsSettings { pub(crate) server_name: Option, } +/// Settings for follower mechanics. +#[derive(Args, Clone)] +pub(crate) struct FollowerSettings { + /// Check config tick + #[clap(long, default_value = CHECK_CONFIG_TICK_DEFAULT, env = "CHECK_CONFIG_TICK")] + pub(crate) check_config_tick: String, + + /// Data Refresh tick + #[clap(long, default_value = DATA_REFRESH_TICK_DEFAULT, env = "DATA_REFRESH_TICK")] + pub(crate) data_refresh_tick: String, + + /// Machine UID + #[clap(long, default_value = MACHINE_UID_DEFAULT, env = "MACHINE_UID")] + pub(crate) machine_uid: String, +} + /// An environment variable read as a string. pub(crate) struct StringEnvVar(String); @@ -146,6 +175,9 @@ lazy_static! { /// The base path the API is served at. pub(crate) static ref API_URL_PREFIX: StringEnvVar = StringEnvVar::new("API_URL_PREFIX", API_URL_PREFIX_DEFAULT); + /// Tick every N seconds until config exists in db + pub(crate) static ref CHECK_CONFIG_TICK: StringEnvVar = StringEnvVar::new("CHECK_CONFIG_TICK", CHECK_CONFIG_TICK_DEFAULT); + } diff --git a/catalyst-gateway/deny.toml b/catalyst-gateway/deny.toml index 886341af4f..80eedc9a6e 100644 --- a/catalyst-gateway/deny.toml +++ b/catalyst-gateway/deny.toml @@ -269,9 +269,7 @@ unknown-git = "deny" allow-registry = ["https://github.com/rust-lang/crates.io-index"] # List of URLs for allowed Git repositories allow-git = [ - # Remove this once upstream changes are merged. - # issue: https://github.com/input-output-hk/hermes/issues/63 - "https://github.com/input-output-hk/catalyst-pallas" + "https://github.com/input-output-hk/hermes.git" ] [sources.allow-org] diff --git a/catalyst-gateway/event-db/Earthfile b/catalyst-gateway/event-db/Earthfile index df0643c25d..8d37ba1bb6 100644 --- a/catalyst-gateway/event-db/Earthfile +++ b/catalyst-gateway/event-db/Earthfile @@ -9,7 +9,7 @@ VERSION 0.7 # Internal: builder is our Event db builder target. Prepares all necessary artifacts. # CI target : dependency builder: - DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.7.0+BUILDER \ + DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.9.3+BUILDER \ --sqlfluff_cfg=./../../+repo-config/repo/.sqlfluff COPY ./../../+repo-config-2/repo/.sqlfluff . @@ -21,7 +21,7 @@ builder: check: FROM +builder - DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.7.0+CHECK + DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.9.3+CHECK # format all SQL files in the current project. Local developers tool. @@ -29,22 +29,22 @@ check: format: LOCALLY - DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.7.0+FORMAT --src=$(echo ${PWD}/../../) + DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.9.2+FORMAT --src=$(echo ${PWD}/../../) # build - an event db docker image. # CI target : true build: FROM +builder - DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.7.0+BUILD --image_name=event-db - DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.7.0+DOCS --image_name=event-db + DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.9.2+BUILD --image_name=event-db + DO github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.9.2+DOCS --image_name=event-db # test the event db database schema # CI target : true #test: -# FROM github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.7.0+postgres-base +# FROM github.com/input-output-hk/catalyst-ci/earthly/postgresql:v2.9.2+postgres-base -# COPY github.com/input-output-hk/catalyst-ci/earthly/utils:v2.7.0+shell-assert/assert.sh . +# COPY github.com/input-output-hk/catalyst-ci/earthly/utils:v2.9.2+shell-assert/assert.sh . # COPY ./docker-compose.yml . # WITH DOCKER \ diff --git a/catalyst-gateway/event-db/migrations/V1__config_tables.sql b/catalyst-gateway/event-db/migrations/V1__config_tables.sql index fc22306e2a..ae46e46c6c 100644 --- a/catalyst-gateway/event-db/migrations/V1__config_tables.sql +++ b/catalyst-gateway/event-db/migrations/V1__config_tables.sql @@ -74,17 +74,17 @@ Must match the `name` component of the $id URI inside the schema.'; -- This table is looked up with three keys, `id`, `id2` and `id3` CREATE TABLE config ( row_id SERIAL PRIMARY KEY, - id VARCHAR NOT NULL, - id2 VARCHAR NOT NULL, - id3 VARCHAR NOT NULL, + cardano VARCHAR NOT NULL, + follower VARCHAR NOT NULL, + preview VARCHAR NOT NULL, value JSONB NULL, value_schema UUID, FOREIGN KEY (value_schema) REFERENCES json_schema_type (id) ON DELETE CASCADE ); --- id+id2+id3 must be unique, they are a combined key. -CREATE UNIQUE INDEX config_idx ON config (id, id2, id3); +-- cardano+follower+preview must be unique, they are a combined key. +CREATE UNIQUE INDEX config_idx ON config (cardano, follower, preview); COMMENT ON TABLE config IS 'General JSON Configuration and Data Values. @@ -94,18 +94,18 @@ Defined Data Formats: COMMENT ON COLUMN config.row_id IS 'Synthetic unique key. -Always lookup using `id.id2.id3`'; -COMMENT ON COLUMN config.id IS +Always lookup using `cardano.follower.preview`'; +COMMENT ON COLUMN config.cardano IS 'The name/id of the general config value/variable'; -COMMENT ON COLUMN config.id2 IS +COMMENT ON COLUMN config.follower IS '2nd ID of the general config value. Must be defined, use "" if not required.'; -COMMENT ON COLUMN config.id3 IS +COMMENT ON COLUMN config.preview IS '3rd ID of the general config value. Must be defined, use "" if not required.'; COMMENT ON COLUMN config.value IS -'The JSON value of the system variable `id.id2.id3`'; +'The JSON value of the system variable `cardano.follower.preview`'; COMMENT ON COLUMN config.value_schema IS 'The Schema the Config Value conforms to. The `value` field must conform to this schema.'; @@ -115,6 +115,16 @@ COMMENT ON INDEX config_idx IS at the app level to allow for querying groups of data.'; +INSERT INTO config (cardano, follower, preview) +VALUES +( + '{"network": "mainnet", "relay": "relays-new.cardano-mainnet.iohk.io:3001"}', + '{ "mithril_snapshot_path": "/tmp/immutable","timing_pattern": 25 }', '{ "network": "preview", "relay": + "preview-node.play.dev.cardano.org:3001"}' +); + + + -- ------------------------------------------------------------------------------------------------- -- * Temporary. diff --git a/catalyst-gateway/event-db/migrations/V6__registration.sql b/catalyst-gateway/event-db/migrations/V6__registration.sql index 34816c92a7..e77e5c89cc 100644 --- a/catalyst-gateway/event-db/migrations/V6__registration.sql +++ b/catalyst-gateway/event-db/migrations/V6__registration.sql @@ -13,7 +13,7 @@ CREATE TABLE cardano_slot_index ( slot_no BIGINT NOT NULL, network TEXT NOT NULL, epoch_no BIGINT NOT NULL, - block_time TIMESTAMP NOT NULL, + block_time TIMESTAMP WITH TIME ZONE NOT NULL, block_hash BYTEA NOT NULL CHECK (LENGTH(block_hash) = 32), PRIMARY KEY (slot_no, network) @@ -45,6 +45,7 @@ COMMENT ON COLUMN cardano_slot_index.block_time IS COMMENT ON COLUMN cardano_slot_index.block_hash IS 'The hash of the block.'; + -- ------------------------------------------------------------------------------------------------- -- Transaction Index Table @@ -88,21 +89,23 @@ CREATE TABLE cardano_update_state ( id BIGSERIAL PRIMARY KEY, - started TIMESTAMP NOT NULL, - ended TIMESTAMP NOT NULL, + started TIMESTAMP WITH TIME ZONE NOT NULL, + ended TIMESTAMP WITH TIME ZONE NOT NULL, updater_id TEXT NOT NULL, slot_no BIGINT NOT NULL, network TEXT NOT NULL, + block_hash TEXT NOT NULL, - update BOOLEAN NOT NULL, - rollback BOOLEAN NOT NULL, + update BOOLEAN, + rollback BOOLEAN, - stats JSONB NOT NULL, + stats JSONB, FOREIGN KEY (slot_no, network) REFERENCES cardano_slot_index (slot_no, network) ); + CREATE INDEX cardano_update_state_idx ON cardano_update_state (id, network); COMMENT ON INDEX cardano_update_state_idx IS @@ -166,6 +169,7 @@ COMMENT ON COLUMN cardano_update_state.stats IS Must conform to Schema: `catalyst_schema://0f917b13-afac-40d2-8263-b17ca8219914/registration/update_stats`.'; + -- ------------------------------------------------------------------------------------------------- -- UTXO Table -- Unspent + Staked TX Outputs diff --git a/catalyst-gateway/tests/schema-mismatch/Earthfile b/catalyst-gateway/tests/schema-mismatch/Earthfile index 5b3712a53d..3c70ff7f65 100644 --- a/catalyst-gateway/tests/schema-mismatch/Earthfile +++ b/catalyst-gateway/tests/schema-mismatch/Earthfile @@ -1,10 +1,10 @@ VERSION --global-cache 0.7 builder: - FROM github.com/input-output-hk/catalyst-ci/earthly/python:v2.7.0+python-base + FROM github.com/input-output-hk/catalyst-ci/earthly/python:v2.9.2+python-base COPY --dir ./schema_mismatch README.md . - DO github.com/input-output-hk/catalyst-ci/earthly/python:v2.7.0+BUILDER + DO github.com/input-output-hk/catalyst-ci/earthly/python:v2.9.2+BUILDER package-tester: FROM +builder diff --git a/catalyst-gateway/tests/schema-mismatch/docker-compose.yml b/catalyst-gateway/tests/schema-mismatch/docker-compose.yml index d06aa36dd3..b45cccb5ec 100644 --- a/catalyst-gateway/tests/schema-mismatch/docker-compose.yml +++ b/catalyst-gateway/tests/schema-mismatch/docker-compose.yml @@ -27,6 +27,10 @@ services: cat-gateway: image: cat-gateway:latest + environment: + - DATA_REFRESH_TICK=5 + - CHECK_CONFIG_TICK=5 + - MACHINE_ID="UID" hostname: gateway ports: - 3030:3030 diff --git a/catalyst-gateway/tests/schemathesis-docker-compose.yml b/catalyst-gateway/tests/schemathesis-docker-compose.yml index 796c7f4702..06b1ddcb1f 100644 --- a/catalyst-gateway/tests/schemathesis-docker-compose.yml +++ b/catalyst-gateway/tests/schemathesis-docker-compose.yml @@ -27,6 +27,10 @@ services: cat-gateway: image: cat-gateway:latest + environment: + - DATA_REFRESH_TICK=5 + - CHECK_CONFIG_TICK=5 + - MACHINE_ID="UID" container_name: cat-gateway network_mode: "host" depends_on: diff --git a/docs/src/architecture/08_concepts/gateway/concrete.md b/docs/src/architecture/08_concepts/gateway/concrete.md deleted file mode 100644 index 6508b915fb..0000000000 --- a/docs/src/architecture/08_concepts/gateway/concrete.md +++ /dev/null @@ -1,126 +0,0 @@ ---- -icon: material/hub ---- - -# Pseudo code - -Building blocks in the form of *pseudo code*; -Intended to make the conceptual design more concrete; not setting rules. - -## Node - -Restart node with new config - -```rust -fn restart_node(config: Config) -> Result<(), Err>{ - // graceful restart -} -``` - -## Config - -Check if config exists; all orchestration is coordinated via the DB, more specifically the config. - -```rust -fn config_exists(db: DBHandler) -> Option { - // lock db - // if config exists { Some(config) } - // else { None } - // Resource acquisition is initialization: drop trait -> unlock db -} -``` - -Node polls for config until it exists in database - -```rust -fn poll_config(db: DBHandler) -> Option { - loop { - if let Some(r) = config_exists(db) { - return Some(r) - } - } -} -``` - -Check if config has been updated - -```rust -fn config_updated(db: DBHandler) -> Option { - // lock db - // if config updated { Some(config) } - // else { None } - // Resource acquisition is initialization: drop trait -> unlock db -} -``` - -## Updates - -Continually race to update database - -```rust -fn index_follower_data(db: DBHandler, stream: FollowerIo)-> Result<(), Err> { - loop { - if database_ready_to_update(db) { - update_database(db, stream) - } - } -} -``` - -Check most recent update on cardano update table -If it falls within the threshold boundary, node should update db with latest data - -```rust -fn database_ready_to_update(db: DBHandler) -> bool { - // lock db - // let last_updated = CardanoUpdateTable() - // return update_threshold(last_updated) - // Resource acquisition is initialization: drop trait -> unlock db -} -``` - -Update database with follower data - -```rust -fn update_database(db: DBHandler, stream: FollowerIo) -> Result<(), Err> { - // lock db - while let Some(block) = stream.next().await { - let metadata = parse(block); - db.insert(metadata); - } - // Resource acquisition is initialization: drop trait -> unlock db -} -``` - -Parse block - -```rust -fn parse(block: Block) -> Result { - // extract era, unspent transaction output, spent Transactions and registration metadata -} -``` - -Calculate if threshold conditional has been met - -```rust -fn update_threshold(last_updated: ThresholdMetric) -> bool { - // threshold calculation - // define conditional -} -``` - -## Follower - -* Start follower with specified networks - -* Stream blocks from given (slot,epoch) - -## Syncing - -Nodes race to update - -## Contention - -## Multiple nodes - -## Roll backs