diff --git a/Cargo.lock b/Cargo.lock index 5d276d6d36..a45f1d8475 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -684,7 +684,7 @@ dependencies = [ "async-ws", "futures", "futures-rustls", - "gloo-net", + "gloo-net 0.2.6", "http 1.1.0", "js-sys", "lazy_static 1.5.0", @@ -805,12 +805,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core", - "base64 0.21.7", + "axum-core 0.3.4", "bitflags 1.3.2", "bytes", "futures-util", - "headers", "http 0.2.12", "http-body 0.4.6", "hyper 0.14.28", @@ -825,10 +823,44 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", + "sync_wrapper 0.1.2", + "tokio", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +dependencies = [ + "async-trait", + "axum-core 0.4.3", + "base64 0.21.7", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde 1.0.203", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", "sha1", - "sync_wrapper", + "sync_wrapper 1.0.1", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite 0.21.0", "tower", "tower-layer", "tower-service", @@ -851,6 +883,26 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum-core" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 0.1.2", + "tower-layer", + "tower-service", +] + [[package]] name = "axum-server" version = "0.5.1" @@ -871,6 +923,29 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum-server" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ad46c3ec4e12f4a4b6835e173ba21c25e484c9d02b49770bf006ce5367c036" +dependencies = [ + "arc-swap", + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "pin-project-lite", + "rustls 0.21.12", + "rustls-pemfile 2.1.2", + "tokio", + "tokio-rustls 0.24.1", + "tower", + "tower-service", +] + [[package]] name = "backon" version = "0.4.4" @@ -1134,7 +1209,7 @@ name = "bitcoin-move" version = "0.5.7" dependencies = [ "anyhow", - "axum", + "axum 0.7.5", "bcs", "better_any", "bitcoin 0.31.2", @@ -1754,6 +1829,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cexpr" version = "0.6.0" @@ -4523,11 +4604,26 @@ name = "gloo-net" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9902a044653b26b99f7e3693a42f171312d9be8b26b5697bd1e43ad1f8a35e10" +dependencies = [ + "gloo-utils 0.1.7", + "js-sys", + "thiserror", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "gloo-net" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" dependencies = [ "futures-channel", "futures-core", "futures-sink", - "gloo-utils", + "gloo-utils 0.2.0", + "http 0.2.12", "js-sys", "pin-project", "serde 1.0.203", @@ -4555,6 +4651,17 @@ name = "gloo-utils" version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "037fcb07216cb3a30f7292bd0176b050b7b9a052ba830ef7d5d65f6dc64ba58e" +dependencies = [ + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-utils" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" dependencies = [ "js-sys", "serde 1.0.203", @@ -4686,30 +4793,6 @@ dependencies = [ "num-traits 0.2.19", ] -[[package]] -name = "headers" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" -dependencies = [ - "base64 0.21.7", - "bytes", - "headers-core", - "http 0.2.12", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http 0.2.12", -] - [[package]] name = "heck" version = "0.3.3" @@ -4871,6 +4954,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" +[[package]] +name = "http-range-header" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" + [[package]] name = "httparse" version = "1.8.0" @@ -4935,6 +5024,7 @@ dependencies = [ "http 1.1.0", "http-body 1.0.0", "httparse", + "httpdate", "itoa", "pin-project-lite", "smallvec 1.13.2", @@ -4953,10 +5043,9 @@ dependencies = [ "hyper 0.14.28", "log", "rustls 0.21.12", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", - "webpki-roots 0.25.4", ] [[package]] @@ -4976,6 +5065,24 @@ dependencies = [ "tower-service", ] +[[package]] +name = "hyper-rustls" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.3.1", + "hyper-util", + "log", + "rustls 0.23.10", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.0", + "tower-service", +] + [[package]] name = "hyper-timeout" version = "0.4.1" @@ -5378,6 +5485,26 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + +[[package]] +name = "jni-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" + [[package]] name = "jobserver" version = "0.1.31" @@ -5432,23 +5559,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "jsonrpsee" -version = "0.16.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367a292944c07385839818bb71c8d76611138e2dedb0677d035b8da21d29c78b" -dependencies = [ - "jsonrpsee-client-transport 0.16.3", - "jsonrpsee-core 0.16.3", - "jsonrpsee-http-client 0.16.3", - "jsonrpsee-proc-macros 0.16.3", - "jsonrpsee-server", - "jsonrpsee-types 0.16.3", - "jsonrpsee-wasm-client", - "jsonrpsee-ws-client 0.16.3", - "tracing", -] - [[package]] name = "jsonrpsee" version = "0.20.3" @@ -5463,46 +5573,64 @@ dependencies = [ "tracing", ] +[[package]] +name = "jsonrpsee" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b089779ad7f80768693755a031cc14a7766aba707cbe886674e3f79e9b7e47" +dependencies = [ + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-http-client 0.23.2", + "jsonrpsee-proc-macros 0.23.2", + "jsonrpsee-server", + "jsonrpsee-types 0.23.2", + "jsonrpsee-wasm-client", + "jsonrpsee-ws-client 0.23.2", + "tokio", + "tracing", +] + [[package]] name = "jsonrpsee-client-transport" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8b3815d9f5d5de348e5f162b316dc9cdf4548305ebb15b4eb9328e66cf27d7a" +checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" dependencies = [ - "anyhow", - "futures-channel", - "futures-timer", "futures-util", - "gloo-net", "http 0.2.12", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", + "jsonrpsee-core 0.20.3", "pin-project", - "rustls-native-certs", - "soketto", + "rustls-native-certs 0.6.3", + "soketto 0.7.1", "thiserror", "tokio", "tokio-rustls 0.24.1", "tokio-util", "tracing", - "webpki-roots 0.25.4", + "url", ] [[package]] name = "jsonrpsee-client-transport" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" +checksum = "08163edd8bcc466c33d79e10f695cdc98c00d1e6ddfb95cec41b6b0279dd5432" dependencies = [ + "base64 0.22.1", + "futures-channel", "futures-util", - "http 0.2.12", - "jsonrpsee-core 0.20.3", + "gloo-net 0.5.0", + "http 1.1.0", + "jsonrpsee-core 0.23.2", "pin-project", - "rustls-native-certs", - "soketto", + "rustls 0.23.10", + "rustls-pki-types", + "rustls-platform-verifier", + "soketto 0.8.0", "thiserror", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls 0.26.0", "tokio-util", "tracing", "url", @@ -5510,85 +5638,91 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5dde66c53d6dcdc8caea1874a45632ec0fcf5b437789f1e45766a1512ce803" +checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" dependencies = [ "anyhow", - "arrayvec 0.7.4", "async-lock", "async-trait", "beef", - "futures-channel", "futures-timer", "futures-util", - "globset", "hyper 0.14.28", - "jsonrpsee-types 0.16.3", - "parking_lot 0.12.3", - "rand 0.8.5", + "jsonrpsee-types 0.20.3", "rustc-hash", "serde 1.0.203", "serde_json", - "soketto", "thiserror", "tokio", "tracing", - "wasm-bindgen-futures", ] [[package]] name = "jsonrpsee-core" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" +checksum = "79712302e737d23ca0daa178e752c9334846b08321d439fd89af9a384f8c830b" dependencies = [ "anyhow", - "async-lock", "async-trait", "beef", + "bytes", "futures-timer", "futures-util", - "hyper 0.14.28", - "jsonrpsee-types 0.20.3", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "jsonrpsee-types 0.23.2", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", "rustc-hash", "serde 1.0.203", "serde_json", "thiserror", "tokio", + "tokio-stream", "tracing", + "wasm-bindgen-futures", ] [[package]] name = "jsonrpsee-http-client" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5f9fabdd5d79344728521bb65e3106b49ec405a78b66fbff073b72b389fa43" +checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" dependencies = [ "async-trait", "hyper 0.14.28", "hyper-rustls 0.24.2", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", - "rustc-hash", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", "serde 1.0.203", "serde_json", "thiserror", "tokio", + "tower", "tracing", + "url", ] [[package]] name = "jsonrpsee-http-client" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" +checksum = "2d90064e04fb9d7282b1c71044ea94d0bbc6eff5621c66f1a0bce9e9de7cf3ac" dependencies = [ "async-trait", - "hyper 0.14.28", - "hyper-rustls 0.24.2", - "jsonrpsee-core 0.20.3", - "jsonrpsee-types 0.20.3", + "base64 0.22.1", + "http-body 1.0.0", + "hyper 1.3.1", + "hyper-rustls 0.27.2", + "hyper-util", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", + "rustls 0.23.10", + "rustls-platform-verifier", "serde 1.0.203", "serde_json", "thiserror", @@ -5600,9 +5734,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44e8ab85614a08792b9bff6c8feee23be78c98d0182d4c622c05256ab553892a" +checksum = "29110019693a4fa2dbda04876499d098fa16d70eba06b1e6e2b3f1b251419515" dependencies = [ "heck 0.4.1", "proc-macro-crate 1.3.1", @@ -5613,32 +5747,38 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29110019693a4fa2dbda04876499d098fa16d70eba06b1e6e2b3f1b251419515" +checksum = "7895f186d5921065d96e16bd795e5ca89ac8356ec423fafc6e3d7cf8ec11aee4" dependencies = [ - "heck 0.4.1", - "proc-macro-crate 1.3.1", + "heck 0.5.0", + "proc-macro-crate 3.1.0", "proc-macro2 1.0.86", "quote 1.0.36", - "syn 1.0.109", + "syn 2.0.65", ] [[package]] name = "jsonrpsee-server" -version = "0.16.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4d945a6008c9b03db3354fb3c83ee02d2faa9f2e755ec1dfb69c3551b8f4ba" +checksum = "654afab2e92e5d88ebd8a39d6074483f3f2bfdf91c5ac57fe285e7127cdd4f51" dependencies = [ - "futures-channel", + "anyhow", "futures-util", - "http 0.2.12", - "hyper 0.14.28", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.3.1", + "hyper-util", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", + "pin-project", + "route-recognizer", "serde 1.0.203", "serde_json", - "soketto", + "soketto 0.8.0", + "thiserror", "tokio", "tokio-stream", "tokio-util", @@ -5648,9 +5788,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245ba8e5aa633dd1c1e4fae72bce06e71f42d34c14a2767c6b4d173b57bee5e5" +checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" dependencies = [ "anyhow", "beef", @@ -5662,51 +5802,51 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +checksum = "d9c465fbe385238e861fdc4d1c85e04ada6c1fd246161d26385c1b311724d2af" dependencies = [ - "anyhow", "beef", + "http 1.1.0", "serde 1.0.203", "serde_json", "thiserror", - "tracing", ] [[package]] name = "jsonrpsee-wasm-client" -version = "0.16.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e5df77c8f625d36e4cfb583c5a674eccebe32403fcfe42f7ceff7fac9324dd" +checksum = "4727ac037f834c6f04c0912cada7532dbddb54e92fbc64e33d6cb8c24af313c9" dependencies = [ - "jsonrpsee-client-transport 0.16.3", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", ] [[package]] name = "jsonrpsee-ws-client" -version = "0.16.3" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1b3975ed5d73f456478681a417128597acd6a2487855fdb7b4a3d4d195bf5e" +checksum = "bca9cb3933ccae417eb6b08c3448eb1cb46e39834e5b503e395e5e5bd08546c0" dependencies = [ "http 0.2.12", - "jsonrpsee-client-transport 0.16.3", - "jsonrpsee-core 0.16.3", - "jsonrpsee-types 0.16.3", + "jsonrpsee-client-transport 0.20.3", + "jsonrpsee-core 0.20.3", + "jsonrpsee-types 0.20.3", + "url", ] [[package]] name = "jsonrpsee-ws-client" -version = "0.20.3" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca9cb3933ccae417eb6b08c3448eb1cb46e39834e5b503e395e5e5bd08546c0" +checksum = "1c28759775f5cb2f1ea9667672d3fe2b0e701d1f4b7b67954e60afe7fd058b5e" dependencies = [ - "http 0.2.12", - "jsonrpsee-client-transport 0.20.3", - "jsonrpsee-core 0.20.3", - "jsonrpsee-types 0.20.3", + "http 1.1.0", + "jsonrpsee-client-transport 0.23.2", + "jsonrpsee-core 0.23.2", + "jsonrpsee-types 0.23.2", "url", ] @@ -7734,8 +7874,8 @@ checksum = "b0a6938622f394e8d803e58b3a14e9dba0494e12a84acdb704ee9ecc333e6f3f" dependencies = [ "anyhow", "async-trait", - "axum", - "axum-server", + "axum 0.6.20", + "axum-server 0.5.1", "base64 0.22.1", "bech32 0.11.0", "bip39", @@ -7783,7 +7923,7 @@ dependencies = [ "tokio", "tokio-stream", "tokio-util", - "tower-http", + "tower-http 0.4.4", "urlencoding", ] @@ -9335,7 +9475,7 @@ dependencies = [ "serde 1.0.203", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -9386,7 +9526,7 @@ dependencies = [ "serde 1.0.203", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -9722,7 +9862,7 @@ dependencies = [ "toml 0.8.14", "tonic", "tower", - "tower-http", + "tower-http 0.5.2", "tracing", "tracing-subscriber", ] @@ -9736,7 +9876,7 @@ dependencies = [ "coerce", "dirs", "dirs-next", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "moveos-config", "once_cell", "proptest", @@ -9813,7 +9953,7 @@ dependencies = [ "derive_builder 0.20.0", "futures", "itertools 0.13.0", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "move-binary-format", "move-core-types", @@ -9847,7 +9987,8 @@ version = "0.5.7" dependencies = [ "anyhow", "async-trait", - "axum", + "axum 0.7.5", + "axum-server 0.6.0", "clap 4.5.8", "eyre", "futures", @@ -9869,7 +10010,7 @@ dependencies = [ "thiserror", "tokio", "tower", - "tower-http", + "tower-http 0.5.2", "tracing", "tracing-subscriber", ] @@ -10222,7 +10363,7 @@ dependencies = [ "coerce", "derive_builder 0.20.0", "futures", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "move-core-types", "move-resource-viewer", @@ -10260,7 +10401,7 @@ dependencies = [ "coerce", "derive_builder 0.20.0", "futures", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "move-core-types", "move-resource-viewer", @@ -10298,7 +10439,7 @@ dependencies = [ "fastcrypto", "futures", "hex", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "move-core-types", "move-resource-viewer", "moveos", @@ -10346,7 +10487,7 @@ dependencies = [ "fixed-hash 0.8.0", "futures", "hex", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "move-binary-format", "move-bytecode-utils", "move-core-types", @@ -10380,7 +10521,7 @@ dependencies = [ "ethers", "fastcrypto", "futures", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "move-command-line-common", "move-core-types", @@ -10406,6 +10547,7 @@ dependencies = [ "accumulator", "anyhow", "async-trait", + "axum 0.7.5", "bcs", "chrono", "clap 4.5.8", @@ -10415,8 +10557,7 @@ dependencies = [ "fastcrypto", "futures", "hex", - "hyper 0.14.28", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "lazy_static 1.5.0", "log", "move-binary-format", @@ -10454,7 +10595,7 @@ dependencies = [ "tokio", "tonic", "tower", - "tower-http", + "tower-http 0.5.2", "tracing", "tracing-subscriber", ] @@ -10473,7 +10614,7 @@ dependencies = [ "derive_builder 0.20.0", "fastcrypto", "futures", - "jsonrpsee 0.16.3", + "jsonrpsee 0.23.2", "log", "move-core-types", "move-resource-viewer", @@ -10607,6 +10748,12 @@ dependencies = [ "thiserror", ] +[[package]] +name = "route-recognizer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" + [[package]] name = "rpassword" version = "7.3.1" @@ -10850,6 +10997,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "rustls" +version = "0.23.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +dependencies = [ + "log", + "once_cell", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.4", + "subtle", + "zeroize", +] + [[package]] name = "rustls-acme" version = "0.8.1" @@ -10859,7 +11021,7 @@ dependencies = [ "async-io", "async-trait", "async-web-client", - "axum-server", + "axum-server 0.5.1", "base64 0.13.1", "blocking", "chrono", @@ -10891,6 +11053,19 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -10916,6 +11091,33 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +[[package]] +name = "rustls-platform-verifier" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e3beb939bcd33c269f4bf946cc829fcd336370267c4a927ac0399c84a3151a1" +dependencies = [ + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls 0.23.10", + "rustls-native-certs 0.7.0", + "rustls-platform-verifier-android", + "rustls-webpki 0.102.4", + "security-framework", + "security-framework-sys", + "webpki-roots 0.26.1", + "winapi", +] + +[[package]] +name = "rustls-platform-verifier-android" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84e217e7fdc8466b5b35d30f8c0a30febd29173df4a3a0c2115d306b9c4117ad" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -11212,6 +11414,7 @@ dependencies = [ "core-foundation", "core-foundation-sys", "libc", + "num-bigint", "security-framework-sys", ] @@ -11937,13 +12140,28 @@ dependencies = [ "base64 0.13.1", "bytes", "futures", - "http 0.2.12", "httparse", "log", "rand 0.8.5", "sha-1", ] +[[package]] +name = "soketto" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures", + "http 1.1.0", + "httparse", + "log", + "rand 0.8.5", + "sha1", +] + [[package]] name = "solang-parser" version = "0.3.3" @@ -12193,6 +12411,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + [[package]] name = "synstructure" version = "0.12.6" @@ -12692,6 +12916,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.10", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-socks" version = "0.5.1" @@ -12713,6 +12948,7 @@ dependencies = [ "futures-core", "pin-project-lite", "tokio", + "tokio-util", ] [[package]] @@ -12862,7 +13098,7 @@ checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.6.20", "base64 0.13.1", "bytes", "flate2", @@ -12922,7 +13158,31 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "http-range-header", + "http-range-header 0.3.1", + "mime", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-http" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" +dependencies = [ + "async-compression", + "base64 0.21.7", + "bitflags 2.5.0", + "bytes", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "http-range-header 0.4.1", "httpdate", "iri-string", "mime", diff --git a/Cargo.toml b/Cargo.toml index 2db60f4261..9066fdcc77 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -159,7 +159,7 @@ futures = "0.3.28" hex = "0.4.3" rustc-hex = "2.1" itertools = "0.13.0" -jsonrpsee = { version = "0.16.3", features = ["full"] } +jsonrpsee = { version = "0.23.2", features = ["full"] } jpst = "0.1.1" lazy_static = "1.5.0" linked-hash-map = "0.5.6" @@ -226,8 +226,8 @@ nostr = "0.22" serde-reflection = "0.3.6" serde-generate = "0.25.1" bcs-ext = { path = "moveos/moveos-commons/bcs_ext" } -tower = { version = "0.4.12", features = ["full", "util", "timeout", "load-shed", "limit"] } -tower-http = { version = "0.4.4", features = ["cors", "full", "trace", "set-header", "propagate-header"] } +tower = { version = "0.4.13", features = ["full", "util", "timeout", "load-shed", "limit"] } +tower-http = { version = "0.5.2", features = ["cors", "full", "trace", "set-header", "propagate-header"] } mirai-annotations = "1.12.0" lru = "0.11.0" bs58 = "0.5.1" @@ -251,8 +251,7 @@ diesel = { version = "2.2.1", features = [ ] } diesel-derive-enum = { version = "2.1.0", features = ["sqlite"] } diesel_migrations = { version = "2.2.0" } -axum = { version = "0.6.6", default-features = false, features = [ - "headers", +axum = { version = "0.7.5", default-features = false, features = [ "tokio", "http1", "http2", @@ -263,8 +262,8 @@ axum = { version = "0.6.6", default-features = false, features = [ "query", "ws", ] } -axum-extra = "0.4.2" -axum-server = { version = "0.5.1", default-features = false, features = [ +axum-extra = "0.9.3" +axum-server = { version = "0.6.0", default-features = false, features = [ "tls-rustls", ] } serenity = { version = "0.12.2", default-features = false, features = [ diff --git a/crates/rooch-faucet/Cargo.toml b/crates/rooch-faucet/Cargo.toml index e939241dc9..4218d5b105 100644 --- a/crates/rooch-faucet/Cargo.toml +++ b/crates/rooch-faucet/Cargo.toml @@ -20,6 +20,7 @@ serenity = { features = [ "model", ], workspace = true } axum = { workspace = true } +axum-server = { workspace = true } tracing = { workspace = true} tower = { workspace = true } tower-http = { workspace = true } diff --git a/crates/rooch-faucet/src/web.rs b/crates/rooch-faucet/src/web.rs index 07ffb99ffe..14bca223c0 100644 --- a/crates/rooch-faucet/src/web.rs +++ b/crates/rooch-faucet/src/web.rs @@ -90,7 +90,7 @@ pub async fn serve(app: App, web_config: WebConfig) -> Result<(), anyhow::Error> let addr = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)), web_config.port); - axum::Server::bind(&addr) + axum_server::bind(addr) .serve(router.into_make_service()) .await?; diff --git a/crates/rooch-rpc-api/src/api/btc_api.rs b/crates/rooch-rpc-api/src/api/btc_api.rs index 67ad8f4225..da4cdabf25 100644 --- a/crates/rooch-rpc-api/src/api/btc_api.rs +++ b/crates/rooch-rpc-api/src/api/btc_api.rs @@ -4,7 +4,7 @@ use crate::jsonrpc_types::btc::ord::InscriptionFilterView; use crate::jsonrpc_types::btc::utxo::UTXOFilterView; use crate::jsonrpc_types::{InscriptionPageView, StrView, UTXOPageView}; -use jsonrpsee::core::RpcResult; +use crate::RpcResult; use jsonrpsee::proc_macros::rpc; use rooch_open_rpc_macros::open_rpc; use rooch_types::indexer::state::IndexerStateID; diff --git a/crates/rooch-rpc-api/src/api/rooch_api.rs b/crates/rooch-rpc-api/src/api/rooch_api.rs index 9db8876188..d402a5bad4 100644 --- a/crates/rooch-rpc-api/src/api/rooch_api.rs +++ b/crates/rooch-rpc-api/src/api/rooch_api.rs @@ -12,7 +12,7 @@ use crate::jsonrpc_types::{ ObjectIDView, ObjectStateFilterView, ObjectStateView, QueryOptions, StateOptions, StatePageView, StateView, StrView, StructTagView, TransactionWithInfoPageView, TxOptions, }; -use jsonrpsee::core::RpcResult; +use crate::RpcResult; use jsonrpsee::proc_macros::rpc; use moveos_types::{access_path::AccessPath, state::KeyState}; use rooch_open_rpc_macros::open_rpc; diff --git a/crates/rooch-rpc-api/src/lib.rs b/crates/rooch-rpc-api/src/lib.rs index 9376e363f3..49721b27ac 100644 --- a/crates/rooch-rpc-api/src/lib.rs +++ b/crates/rooch-rpc-api/src/lib.rs @@ -5,3 +5,34 @@ pub mod api; pub mod jsonrpc_types; + +pub type RpcResult = Result; +use jsonrpsee::types::{ErrorObject, ErrorObjectOwned}; +use rooch_types::error::RoochError; +use thiserror::Error; + +#[derive(Debug, Error)] +pub enum RpcError { + #[error(transparent)] + RoochError(#[from] RoochError), + + #[error(transparent)] + InternalError(#[from] anyhow::Error), + + #[error("Deserialization error: {0}")] + BcsError(#[from] bcs::Error), + + #[error("Unexpected error: {0}")] + UnexpectedError(String), +} + +impl From for ErrorObjectOwned { + fn from(err: RpcError) -> Self { + match err { + RpcError::RoochError(err) => ErrorObject::owned(1, err.to_string(), None::<()>), + RpcError::InternalError(err) => ErrorObject::owned(2, err.to_string(), None::<()>), + RpcError::BcsError(err) => ErrorObject::owned(3, err.to_string(), None::<()>), + RpcError::UnexpectedError(err) => ErrorObject::owned(4, err.to_string(), None::<()>), + } + } +} diff --git a/crates/rooch-rpc-client/src/client_config.rs b/crates/rooch-rpc-client/src/client_config.rs index 82121e2ff5..39b60a39ba 100644 --- a/crates/rooch-rpc-client/src/client_config.rs +++ b/crates/rooch-rpc-client/src/client_config.rs @@ -14,8 +14,8 @@ use std::fmt::{Display, Formatter, Write}; use std::path::PathBuf; pub const DEFAULT_EXPIRATION_SECS: u64 = 30; -pub const ROOCH_DEV_NET_URL: &str = "https://dev-seed.rooch.network:443/"; -pub const ROOCH_TEST_NET_URL: &str = "https://test-seed.rooch.network:443/"; +pub const ROOCH_DEV_NET_URL: &str = "https://dev-seed.rooch.network"; +pub const ROOCH_TEST_NET_URL: &str = "https://test-seed.rooch.network"; #[derive(Serialize, Deserialize, Debug)] pub struct ClientConfig { @@ -77,7 +77,6 @@ impl Env { pub async fn create_rpc_client( &self, request_timeout: std::time::Duration, - max_concurrent_requests: Option, ) -> Result { let mut builder = ClientBuilder::default(); builder = builder.request_timeout(request_timeout); @@ -85,10 +84,6 @@ impl Env { builder = builder.ws_url(ws_url); } - if let Some(max_concurrent_requests) = max_concurrent_requests { - builder = builder.max_concurrent_requests(max_concurrent_requests as usize); - } - builder.build(&self.rpc).await } diff --git a/crates/rooch-rpc-client/src/lib.rs b/crates/rooch-rpc-client/src/lib.rs index 8e0929faff..0e0bfd30e0 100644 --- a/crates/rooch-rpc-client/src/lib.rs +++ b/crates/rooch-rpc-client/src/lib.rs @@ -25,7 +25,6 @@ pub mod wallet_context; pub struct ClientBuilder { request_timeout: Duration, - max_concurrent_requests: usize, ws_url: Option, } @@ -35,11 +34,6 @@ impl ClientBuilder { self } - pub fn max_concurrent_requests(mut self, max_concurrent_requests: usize) -> Self { - self.max_concurrent_requests = max_concurrent_requests; - self - } - pub fn ws_url(mut self, url: impl AsRef) -> Self { self.ws_url = Some(url.as_ref().to_string()); self @@ -50,8 +44,7 @@ impl ClientBuilder { let http_client = Arc::new( HttpClientBuilder::default() - .max_request_body_size(2 << 30) - .max_concurrent_requests(self.max_concurrent_requests) + .max_request_size(2 << 30) .request_timeout(self.request_timeout) .build(http)?, ); @@ -67,7 +60,6 @@ impl Default for ClientBuilder { fn default() -> Self { Self { request_timeout: Duration::from_secs(60), - max_concurrent_requests: 256, ws_url: None, } } diff --git a/crates/rooch-rpc-client/src/wallet_context.rs b/crates/rooch-rpc-client/src/wallet_context.rs index 14e4376f8d..e6d4c469f5 100644 --- a/crates/rooch-rpc-client/src/wallet_context.rs +++ b/crates/rooch-rpc-client/src/wallet_context.rs @@ -118,7 +118,7 @@ impl WalletContext { let client = self .client_config .get_active_env()? - .create_rpc_client(Duration::from_secs(DEFAULT_EXPIRATION_SECS), None) + .create_rpc_client(Duration::from_secs(DEFAULT_EXPIRATION_SECS)) .await?; self.client.write().await.insert(client).clone() diff --git a/crates/rooch-rpc-server/Cargo.toml b/crates/rooch-rpc-server/Cargo.toml index cacd85b196..3a6f81fee7 100644 --- a/crates/rooch-rpc-server/Cargo.toml +++ b/crates/rooch-rpc-server/Cargo.toml @@ -38,7 +38,7 @@ schemars = { workspace = true } serde_with = { workspace = true } rand = { workspace = true } fastcrypto = { workspace = true, features = ["copy_key"] } -hyper = { workspace = true } +axum = { workspace = true } log = { workspace = true } lazy_static = { workspace = true } rpassword = { workspace = true } @@ -68,4 +68,4 @@ rooch-indexer = { workspace = true } rooch-da = { workspace = true } rooch-framework = { workspace = true } rooch-genesis = { workspace = true } -rooch-db = { workspace = true } \ No newline at end of file +rooch-db = { workspace = true } diff --git a/crates/rooch-rpc-server/src/lib.rs b/crates/rooch-rpc-server/src/lib.rs index 398ab20bea..8cd82038ad 100644 --- a/crates/rooch-rpc-server/src/lib.rs +++ b/crates/rooch-rpc-server/src/lib.rs @@ -7,10 +7,10 @@ use crate::service::aggregate_service::AggregateService; use crate::service::rpc_logger::RpcLogger; use crate::service::rpc_service::RpcService; use anyhow::{ensure, Error, Result}; +use axum::http::{HeaderValue, Method}; use coerce::actor::scheduler::timer::Timer; use coerce::actor::{system::ActorSystem, IntoActor}; -use hyper::header::HeaderValue; -use hyper::Method; +use jsonrpsee::server::middleware::rpc::RpcServiceBuilder; use jsonrpsee::server::ServerBuilder; use jsonrpsee::RpcModule; use raw_store::errors::RawStoreError; @@ -34,6 +34,7 @@ use rooch_proposer::proxy::ProposerProxy; use rooch_relayer::actor::messages::RelayTick; use rooch_relayer::actor::relayer::RelayerActor; use rooch_rpc_api::api::RoochRpcModule; +use rooch_rpc_api::RpcError; use rooch_sequencer::actor::sequencer::SequencerActor; use rooch_sequencer::proxy::SequencerProxy; use rooch_types::address::RoochAddress; @@ -327,7 +328,7 @@ pub async fn run_start_server(opt: RoochOpt, server_opt: ServerOpt) -> Result Result Result>(); - let handle = server.start(rpc_module_builder.module)?; + let handle = server.start(rpc_module_builder.module); info!("JSON-RPC HTTP Server start listening {:?}", addr); info!("Available JSON-RPC methods : {:?}", methods_names); @@ -369,8 +372,8 @@ fn _build_rpc_api(mut rpc_module: RpcModule) -> Rpc available_methods.sort(); rpc_module - .register_method("rpc_methods", move |_, _| { - Ok(json!({ + .register_method("rpc_methods", move |_, _, _| { + Ok::(json!({ "methods": available_methods, })) }) diff --git a/crates/rooch-rpc-server/src/server/btc_server.rs b/crates/rooch-rpc-server/src/server/btc_server.rs index 25adb6af16..71d4d57d15 100644 --- a/crates/rooch-rpc-server/src/server/btc_server.rs +++ b/crates/rooch-rpc-server/src/server/btc_server.rs @@ -3,16 +3,14 @@ use crate::service::{aggregate_service::AggregateService, rpc_service::RpcService}; use anyhow::Result; -use jsonrpsee::{ - core::{async_trait, RpcResult}, - RpcModule, -}; +use jsonrpsee::{core::async_trait, RpcModule}; use move_core_types::account_address::AccountAddress; use rooch_rpc_api::api::btc_api::BtcAPIServer; use rooch_rpc_api::api::{RoochRpcModule, DEFAULT_RESULT_LIMIT_USIZE, MAX_RESULT_LIMIT_USIZE}; use rooch_rpc_api::jsonrpc_types::btc::ord::{InscriptionFilterView, InscriptionStateView}; use rooch_rpc_api::jsonrpc_types::btc::utxo::{UTXOFilterView, UTXOStateView}; use rooch_rpc_api::jsonrpc_types::{InscriptionPageView, StrView, UTXOPageView}; +use rooch_rpc_api::RpcResult; use rooch_types::indexer::state::IndexerStateID; use std::cmp::min; diff --git a/crates/rooch-rpc-server/src/server/rooch_server.rs b/crates/rooch-rpc-server/src/server/rooch_server.rs index e9b0fbd83b..301b20c97c 100644 --- a/crates/rooch-rpc-server/src/server/rooch_server.rs +++ b/crates/rooch-rpc-server/src/server/rooch_server.rs @@ -4,10 +4,7 @@ use crate::service::aggregate_service::AggregateService; use crate::service::rpc_service::RpcService; use anyhow::Result; -use jsonrpsee::{ - core::{async_trait, RpcResult}, - RpcModule, -}; +use jsonrpsee::{core::async_trait, RpcModule}; use moveos_types::{ access_path::AccessPath, h256::H256, @@ -33,6 +30,8 @@ use rooch_rpc_api::jsonrpc_types::{ ExecuteTransactionResponseView, FunctionCallView, H256View, StatePageView, StateView, StrView, StructTagView, TransactionWithInfoPageView, }; +use rooch_rpc_api::RpcError; +use rooch_rpc_api::RpcResult; use rooch_rpc_api::{api::rooch_api::RoochAPIServer, api::DEFAULT_RESULT_LIMIT}; use rooch_rpc_api::{ api::{RoochRpcModule, DEFAULT_RESULT_LIMIT_USIZE}, @@ -160,8 +159,7 @@ impl RoochAPIServer for RoochServer { async fn send_raw_transaction(&self, payload: BytesView) -> RpcResult { info!("send_raw_transaction payload: {:?}", payload); - let mut tx = - bcs::from_bytes::(&payload.0).map_err(anyhow::Error::from)?; + let mut tx = bcs::from_bytes::(&payload.0)?; info!("send_raw_transaction tx: {:?}", tx); let hash = tx.tx_hash(); @@ -175,7 +173,7 @@ impl RoochAPIServer for RoochServer { tx_options: Option, ) -> RpcResult { let tx_options = tx_options.unwrap_or_default(); - let tx = bcs::from_bytes::(&payload.0).map_err(anyhow::Error::from)?; + let tx = bcs::from_bytes::(&payload.0)?; let tx_response = self.rpc_service.execute_tx(tx).await?; let result = if tx_options.with_output { @@ -553,12 +551,11 @@ impl RoochAPIServer for RoochServer { (end..start).rev().collect::>() } else { let start = cursor.unwrap_or(0); - let start_plus = - start - .checked_add(limit_of + 1) - .ok_or(jsonrpsee::core::Error::Custom( - "cursor value is overflow".to_string(), - ))?; + let start_plus = start + .checked_add(limit_of + 1) + .ok_or(RpcError::UnexpectedError( + "cursor value is overflow".to_string(), + ))?; let end = min(start_plus, last_sequencer_order + 1); (start..end).collect::>() diff --git a/crates/rooch-rpc-server/src/service/rpc_logger.rs b/crates/rooch-rpc-server/src/service/rpc_logger.rs index e043bae0e1..330b1334d0 100644 --- a/crates/rooch-rpc-server/src/service/rpc_logger.rs +++ b/crates/rooch-rpc-server/src/service/rpc_logger.rs @@ -1,80 +1,31 @@ // Copyright (c) RoochNetwork // SPDX-License-Identifier: Apache-2.0 -use jsonrpsee::server::logger::Logger; -use tracing::Level; +use jsonrpsee::server::middleware::rpc::RpcServiceT; +use jsonrpsee::types::Request; -#[derive(Debug, Clone)] -pub struct RpcLogger; +#[derive(Clone)] +pub struct RpcLogger(pub S); -impl Logger for RpcLogger { - type Instant = std::time::Instant; +impl<'a, S> RpcServiceT<'a> for RpcLogger +where + S: RpcServiceT<'a> + Send + Sync, +{ + type Future = S::Future; - fn on_connect( - &self, - _remote_addr: std::net::SocketAddr, - _request: &jsonrpsee::server::logger::HttpRequest, - _t: jsonrpsee::server::logger::TransportProtocol, - ) { - } - - fn on_request( - &self, - _transport: jsonrpsee::server::logger::TransportProtocol, - ) -> Self::Instant { - std::time::Instant::now() - } - - fn on_call( - &self, - method_name: &str, - params: jsonrpsee::types::Params, - _kind: jsonrpsee::server::logger::MethodKind, - transport: jsonrpsee::server::logger::TransportProtocol, - ) { - //TODO remove param parse when server stable. - let params_str = match params.parse::() { + fn call(&self, req: Request<'a>) -> Self::Future { + let params_str = match req.params().parse::() { Ok(json) => json.to_string(), Err(e) => e.to_string(), }; + tracing::event!( - Level::INFO, + tracing::Level::INFO, event = "on_call", - transport = transport.to_string(), - method_name = method_name, + method_name = req.method_name(), params = params_str, ); - } - - fn on_result( - &self, - method_name: &str, - success: bool, - started_at: Self::Instant, - _transport: jsonrpsee::server::logger::TransportProtocol, - ) { - let elapsed_millis = started_at.elapsed().as_millis(); - tracing::event!( - Level::INFO, - event = "on_result", - method_name = method_name, - success = success, - elapsed_millis = elapsed_millis - ); - } - - fn on_response( - &self, - _result: &str, - _started_at: Self::Instant, - _transport: jsonrpsee::server::logger::TransportProtocol, - ) { - } - fn on_disconnect( - &self, - _remote_addr: std::net::SocketAddr, - _transport: jsonrpsee::server::logger::TransportProtocol, - ) { + self.0.call(req) } } diff --git a/crates/rooch/src/commands/env/commands/add.rs b/crates/rooch/src/commands/env/commands/add.rs index 6096a3aae0..fc8447b647 100644 --- a/crates/rooch/src/commands/env/commands/add.rs +++ b/crates/rooch/src/commands/env/commands/add.rs @@ -31,7 +31,7 @@ impl AddCommand { }; // TODO: is this request timeout okay? - env.create_rpc_client(Duration::from_secs(5), None).await?; + env.create_rpc_client(Duration::from_secs(5)).await?; context.client_config.add_env(env); context.client_config.save()?; diff --git a/frameworks/bitcoin-move/src/natives/ord/inscription.rs b/frameworks/bitcoin-move/src/natives/ord/inscription.rs index f35ee74487..6bc14197a2 100644 --- a/frameworks/bitcoin-move/src/natives/ord/inscription.rs +++ b/frameworks/bitcoin-move/src/natives/ord/inscription.rs @@ -12,7 +12,7 @@ use { super::envelope, super::inscription_id::InscriptionId, super::media::Media, - axum::http::header::HeaderValue, + axum::http::HeaderValue, bitcoin::{ blockdata::{ opcodes,