From 805cc1872d9db8d5cb68241d0babb8a60411c712 Mon Sep 17 00:00:00 2001 From: alenmestrov Date: Tue, 26 Nov 2024 17:17:18 +0100 Subject: [PATCH] feat: Context and Proxy Starknet contract integration into Calimero (#981) --- Cargo.lock | 2081 ++++++++--------- Cargo.toml | 3 + contracts/context-config/src/mutate.rs | 12 + crates/context/config/Cargo.toml | 1 + .../context/config/src/client/env/config.rs | 2 +- .../config/src/client/env/config/mutate.rs | 80 +- .../client/env/config/query/application.rs | 49 +- .../env/config/query/application_revision.rs | 26 +- .../src/client/env/config/query/has_member.rs | 37 +- .../src/client/env/config/query/members.rs | 58 +- .../env/config/query/members_revision.rs | 31 +- .../src/client/env/config/query/privileges.rs | 62 +- .../client/env/config/query/proxy_contract.rs | 25 +- .../config/src/client/env/config/types.rs | 1 + .../src/client/env/config/types/starknet.rs | 598 +++++ crates/context/config/src/client/env/proxy.rs | 3 +- .../config/src/client/env/proxy/mutate.rs | 73 +- .../env/proxy/query/active_proposals.rs | 24 +- .../src/client/env/proxy/query/proposal.rs | 58 +- .../env/proxy/query/proposal_approvals.rs | 48 +- .../env/proxy/query/proposal_approvers.rs | 45 +- .../src/client/env/proxy/query/proposals.rs | 50 +- .../config/src/client/env/proxy/types.rs | 1 + .../src/client/env/proxy/types/starknet.rs | 390 +++ .../config/src/client/protocol/starknet.rs | 156 +- crates/context/config/src/types.rs | 1 + crates/merod/src/cli/init.rs | 2 +- crates/server/src/admin/handlers/proposals.rs | 5 +- 28 files changed, 2775 insertions(+), 1147 deletions(-) create mode 100644 crates/context/config/src/client/env/config/types.rs create mode 100644 crates/context/config/src/client/env/config/types/starknet.rs create mode 100644 crates/context/config/src/client/env/proxy/types.rs create mode 100644 crates/context/config/src/client/env/proxy/types/starknet.rs diff --git a/Cargo.lock b/Cargo.lock index d4aa212de..5cf06ebd5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,6 +27,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "aead" version = "0.5.2" @@ -102,9 +108,9 @@ checksum = "250f629c0161ad8107cf89319e990051fae62832fd343083bea452d93e2205fd" [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "android-tzdata" @@ -123,9 +129,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -138,49 +144,49 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arbitrary" -version = "1.3.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" dependencies = [ "derive_arbitrary", ] @@ -193,9 +199,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayref" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d151e35f61089500b617991b791fc8bfd237ae50cd5950803758a179b41e67a" +checksum = "76a2e8124351fda1ef8aaaa3bbd7ebbcb486bbcd4225aca0aa0d84bb2db8fecb" [[package]] name = "arrayvec" @@ -205,9 +211,9 @@ checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "asn1-rs" @@ -221,7 +227,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -237,7 +243,7 @@ dependencies = [ "nom", "num-traits", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -261,7 +267,7 @@ checksum = "965c2d33e53cb6b267e148a4cb0760bc01f4904c1cd4bb4002a085bb016d1490" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", "synstructure 0.13.1", ] @@ -284,7 +290,7 @@ checksum = "7b18050c2cd6fe86c3a76584ef5e0baf286d038cda203eb6223df2cc413565f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -299,9 +305,9 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ "async-lock", "cfg-if 1.0.0", @@ -313,7 +319,7 @@ dependencies = [ "rustix", "slab", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -329,9 +335,9 @@ dependencies = [ [[package]] name = "async-stream" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" dependencies = [ "async-stream-impl", "futures-core", @@ -340,24 +346,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -411,30 +417,30 @@ checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "axum" -version = "0.7.5" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" dependencies = [ "async-trait", "axum-core", - "base64 0.21.7", + "base64 0.22.1", "bytes", "futures-util", "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.1", "hyper-util", "itoa", "matchit", @@ -450,8 +456,8 @@ dependencies = [ "sha1", "sync_wrapper 1.0.1", "tokio", - "tokio-tungstenite 0.21.0", - "tower", + "tokio-tungstenite", + "tower 0.5.1", "tower-layer", "tower-service", "tracing", @@ -459,9 +465,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a15c63fd72d41492dc4f497196f5da1fb04fb7529e631d73630d1b491e47a2e3" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" dependencies = [ "async-trait", "bytes", @@ -472,7 +478,7 @@ dependencies = [ "mime", "pin-project-lite", "rustversion", - "sync_wrapper 0.1.2", + "sync_wrapper 1.0.1", "tower-layer", "tower-service", "tracing", @@ -490,14 +496,14 @@ dependencies = [ "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.1", "hyper-util", "pin-project-lite", "rustls 0.21.12", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "tokio", "tokio-rustls 0.24.1", - "tower", + "tower 0.4.13", "tower-service", ] @@ -529,7 +535,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -590,9 +596,9 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.69.4" +version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ "bitflags 2.6.0", "cexpr", @@ -605,7 +611,7 @@ dependencies = [ "regex", "rustc-hash 1.1.0", "shlex", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -696,9 +702,9 @@ dependencies = [ [[package]] name = "borsh" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6362ed55def622cddc70a4746a68554d7b687713770de539e59a739b249f8ed" +checksum = "2506947f73ad44e344215ccd6403ac2ae18cd8e046e581a441bf8d199f257f03" dependencies = [ "borsh-derive", "cfg_aliases", @@ -706,16 +712,15 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ef8005764f53cd4dca619f5bf64cafd4664dada50ece25e4d81de54c80cc0b" +checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" dependencies = [ "once_cell", "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.72", - "syn_derive", + "syn 2.0.87", ] [[package]] @@ -775,12 +780,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" -dependencies = [ - "serde", -] +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "bytesize" @@ -824,7 +826,7 @@ dependencies = [ "futures-util", "serde", "sha2", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-util", ] @@ -859,7 +861,7 @@ dependencies = [ "eyre", "futures-util", "rand 0.8.5", - "reqwest 0.12.5", + "reqwest 0.12.9", "serde", "tokio", "tokio-util", @@ -875,17 +877,18 @@ dependencies = [ "ed25519-dalek", "either", "eyre", - "near-crypto 0.27.0", + "hex", + "near-crypto", "near-jsonrpc-client", "near-jsonrpc-primitives", - "near-primitives 0.27.0", - "reqwest 0.12.5", + "near-primitives", + "reqwest 0.12.9", "serde", "serde_json", "starknet", - "starknet-crypto", + "starknet-crypto 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "starknet-types-core", - "thiserror", + "thiserror 1.0.69", "url", ] @@ -896,7 +899,7 @@ dependencies = [ "calimero-context-config", "ed25519-dalek", "eyre", - "near-crypto 0.27.0", + "near-crypto", "near-sdk", "near-workspaces", "rand 0.8.5", @@ -929,7 +932,7 @@ dependencies = [ "multiaddr", "owo-colors", "serde", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-test", "tokio-util", @@ -971,7 +974,7 @@ dependencies = [ "calimero-primitives", "calimero-runtime", "serde", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -987,7 +990,7 @@ dependencies = [ "serde", "serde_json", "sha2", - "thiserror", + "thiserror 1.0.69", "url", ] @@ -1016,7 +1019,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "ureq", "wasmer", "wasmer-types", @@ -1039,11 +1042,11 @@ dependencies = [ name = "calimero-sdk-macros" version = "0.1.0" dependencies = [ - "prettyplease 0.2.20", + "prettyplease 0.2.25", "proc-macro2", "quote", - "syn 2.0.72", - "thiserror", + "syn 2.0.87", + "thiserror 1.0.69", ] [[package]] @@ -1056,7 +1059,7 @@ dependencies = [ "serde", "serde_json", "serde_with", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1090,16 +1093,16 @@ dependencies = [ "multiaddr", "rand 0.8.5", "rcgen 0.13.1", - "reqwest 0.12.5", + "reqwest 0.12.9", "rust-embed", "serde", "serde_json", "sha2", "starknet", - "starknet-crypto", - "thiserror", + "starknet-crypto 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.69", "tokio", - "tower", + "tower 0.4.13", "tower-http", "tower-sessions", "tracing", @@ -1118,7 +1121,7 @@ dependencies = [ "eyre", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "url", ] @@ -1137,7 +1140,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2", - "thiserror", + "thiserror 1.0.69", "velcro", ] @@ -1149,7 +1152,7 @@ dependencies = [ "calimero-sdk", "calimero-storage", "quote", - "syn 2.0.72", + "syn 2.0.87", "trybuild", ] @@ -1167,15 +1170,15 @@ dependencies = [ "serde_json", "strum 0.26.3", "tempdir", - "thiserror", + "thiserror 1.0.69", "thunderdome", ] [[package]] name = "camino" -version = "1.1.7" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -1200,7 +1203,7 @@ dependencies = [ "serde", "serde_bytes", "stacker", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -1212,17 +1215,18 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] name = "cc" -version = "1.1.7" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -1324,9 +1328,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.13" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -1334,33 +1338,33 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.13" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.1", + "strsim", ] [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "color-eyre" @@ -1391,9 +1395,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "concurrent-queue" @@ -1412,18 +1416,18 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const_format" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" +checksum = "50c655d81ff1114fb0dcdea9225ea9f0cc712a6f8d189378e82bdf62a473a64b" dependencies = [ "const_format_proc_macros", ] [[package]] name = "const_format_proc_macros" -version = "0.2.32" +version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" +checksum = "eff1a44b93f47b1bac19a27932f5c591e43d1ba357ee4f61526c8a25603f0eb1" dependencies = [ "proc-macro2", "quote", @@ -1471,9 +1475,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core2" @@ -1499,9 +1503,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" dependencies = [ "libc", ] @@ -1521,7 +1525,7 @@ version = "0.91.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98b022ed2a5913a38839dfbafe6cf135342661293b08049843362df4301261dc" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bumpalo", "cranelift-bforest", "cranelift-codegen-meta", @@ -1702,17 +1706,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", -] - -[[package]] -name = "darling" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" -dependencies = [ - "darling_core 0.14.4", - "darling_macro 0.14.4", + "syn 2.0.87", ] [[package]] @@ -1721,22 +1715,8 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", -] - -[[package]] -name = "darling_core" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn 1.0.109", + "darling_core", + "darling_macro", ] [[package]] @@ -1749,19 +1729,8 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim 0.11.1", - "syn 2.0.72", -] - -[[package]] -name = "darling_macro" -version = "0.14.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" -dependencies = [ - "darling_core 0.14.4", - "quote", - "syn 1.0.109", + "strsim", + "syn 2.0.87", ] [[package]] @@ -1770,18 +1739,19 @@ version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core 0.20.10", + "darling_core", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] name = "dashmap" -version = "5.5.3" +version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf" dependencies = [ "cfg-if 1.0.0", + "crossbeam-utils", "hashbrown 0.14.5", "lock_api", "once_cell", @@ -1875,44 +1845,13 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.72", -] - -[[package]] -name = "derive_builder" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" -dependencies = [ - "derive_builder_macro", -] - -[[package]] -name = "derive_builder_core" -version = "0.12.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" dependencies = [ - "darling 0.14.4", "proc-macro2", "quote", - "syn 1.0.109", -] - -[[package]] -name = "derive_builder_macro" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" -dependencies = [ - "derive_builder_core", - "syn 1.0.109", + "syn 2.0.87", ] [[package]] @@ -1925,7 +1864,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -1998,16 +1937,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", -] - -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", + "syn 2.0.87", ] [[package]] @@ -2077,23 +2007,23 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if 1.0.0", ] [[package]] name = "enum-as-inner" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -2133,7 +2063,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -2151,10 +2081,10 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59c3b24c345d8c314966bdc1832f6c2635bfcce8e7cf363bd115987bba2ee242" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -2191,7 +2121,7 @@ dependencies = [ "serde_json", "sha2", "sha3", - "thiserror", + "thiserror 1.0.69", "uuid 0.8.2", ] @@ -2208,7 +2138,7 @@ dependencies = [ "serde", "serde_json", "sha3", - "thiserror", + "thiserror 1.0.69", "uint", ] @@ -2278,9 +2208,9 @@ checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "ff" @@ -2300,14 +2230,14 @@ checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] @@ -2333,21 +2263,21 @@ dependencies = [ [[package]] name = "fixedstr" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e049f021908beff8f8c430a99f5c136d3be69f1667346e581f446b173bc012" +checksum = "60aba7afd9b1b9e1950c2b7e8bcac3cc44a273c62a02717dedca2d0a1aee694d" dependencies = [ "serde", ] [[package]] name = "flate2" -version = "1.0.31" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -2365,6 +2295,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -2428,9 +2364,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -2453,9 +2389,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -2463,15 +2399,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -2481,15 +2417,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ "futures-core", "pin-project-lite", @@ -2497,13 +2433,13 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -2523,21 +2459,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f2f12607f92c69b12ed746fabf9ca4f5c482cba46679c1a75b874ed7c26adb" dependencies = [ "futures-io", - "rustls 0.23.12", + "rustls 0.23.17", "rustls-pki-types", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-ticker" @@ -2558,9 +2494,9 @@ checksum = "f288b0a4f20f9a56b5d1da57e2227c661b7b16168e2f72365f57b63326e29b24" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -2689,9 +2625,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", @@ -2733,9 +2669,14 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "headers" @@ -2818,7 +2759,7 @@ dependencies = [ "once_cell", "rand 0.8.5", "socket2", - "thiserror", + "thiserror 1.0.69", "tinyvec", "tokio", "tracing", @@ -2841,7 +2782,7 @@ dependencies = [ "rand 0.8.5", "resolv-conf", "smallvec", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -2948,9 +2889,9 @@ checksum = "08a397c49fec283e3d6211adbe480be95aae5f304cfb923e9970e08956d5168a" [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2960,9 +2901,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "hyper" -version = "0.14.30" +version = "0.14.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" +checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" dependencies = [ "bytes", "futures-channel", @@ -2984,14 +2925,14 @@ dependencies = [ [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", + "h2 0.4.7", "http 1.1.0", "http-body 1.0.1", "httparse", @@ -3011,7 +2952,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -3019,15 +2960,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.4.1", + "hyper 1.5.1", "hyper-util", - "rustls 0.23.12", + "rustls 0.23.17", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -3041,7 +2982,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.30", + "hyper 0.14.31", "native-tls", "tokio", "tokio-native-tls", @@ -3055,7 +2996,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.4.1", + "hyper 1.5.1", "hyper-util", "native-tls", "tokio", @@ -3065,36 +3006,35 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", "futures-util", "http 1.1.0", "http-body 1.0.1", - "hyper 1.4.1", + "hyper 1.5.1", "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core", + "windows-core 0.52.0", ] [[package]] @@ -3122,7 +3062,7 @@ dependencies = [ "serde_bytes", "serde_cbor", "sha2", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3149,7 +3089,7 @@ dependencies = [ "quote", "serde", "serde_tokenstream", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -3233,7 +3173,125 @@ dependencies = [ "data-encoding", "serde", "sha2", - "thiserror", + "thiserror 1.0.69", +] + +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] @@ -3254,12 +3312,23 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", ] [[package]] @@ -3274,9 +3343,9 @@ dependencies = [ [[package]] name = "if-watch" -version = "3.2.0" +version = "3.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" +checksum = "cdf9d64cfcf380606e64f9a0bcf493616b65331199f984151a6fa11a7b3cde38" dependencies = [ "async-io", "core-foundation", @@ -3285,8 +3354,12 @@ dependencies = [ "if-addrs", "ipnet", "log", + "netlink-packet-core", + "netlink-packet-route", + "netlink-proto", + "netlink-sys", "rtnetlink", - "system-configuration", + "system-configuration 0.6.1", "tokio", "windows", ] @@ -3302,7 +3375,7 @@ dependencies = [ "bytes", "futures", "http 0.2.12", - "hyper 0.14.30", + "hyper 0.14.31", "log", "rand 0.8.5", "tokio", @@ -3372,7 +3445,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.1", "serde", ] @@ -3423,14 +3496,14 @@ dependencies = [ "socket2", "widestring", "windows-sys 0.48.0", - "winreg 0.50.0", + "winreg", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_executable" @@ -3467,9 +3540,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "7a73e9fe3c49d7afb2ace819fa181a287ce54a0983eda4e0eb05c22f82ffe534" [[package]] name = "jobserver" @@ -3482,9 +3555,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -3498,7 +3571,7 @@ dependencies = [ "jsonptr", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3630,9 +3703,9 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "libloading" @@ -3680,7 +3753,7 @@ dependencies = [ "multiaddr", "pin-project", "rw-stream-sink", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -3728,7 +3801,7 @@ dependencies = [ "rand 0.8.5", "rw-stream-sink", "smallvec", - "thiserror", + "thiserror 1.0.69", "tracing", "unsigned-varint 0.8.0", "void", @@ -3753,7 +3826,7 @@ dependencies = [ "lru 0.11.1", "quick-protobuf", "quick-protobuf-codec 0.2.0", - "thiserror", + "thiserror 1.0.69", "tracing", "void", ] @@ -3819,11 +3892,11 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "lru 0.12.4", + "lru 0.12.5", "quick-protobuf", "quick-protobuf-codec 0.3.1", "smallvec", - "thiserror", + "thiserror 1.0.69", "tracing", "void", ] @@ -3842,7 +3915,7 @@ dependencies = [ "rand 0.8.5", "serde", "sha2", - "thiserror", + "thiserror 1.0.69", "tracing", "zeroize", ] @@ -3853,7 +3926,7 @@ version = "0.45.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cc5767727d062c4eac74dd812c998f0e488008e82cce9c33b463d38423f9ad2" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "asynchronous-codec 0.7.0", "bytes", "either", @@ -3870,7 +3943,7 @@ dependencies = [ "rand 0.8.5", "sha2", "smallvec", - "thiserror", + "thiserror 1.0.69", "tracing", "uint", "void", @@ -3938,7 +4011,7 @@ dependencies = [ "sha2", "snow", "static_assertions", - "thiserror", + "thiserror 1.0.69", "tracing", "x25519-dalek", "zeroize", @@ -3979,9 +4052,9 @@ dependencies = [ "quinn", "rand 0.8.5", "ring 0.17.8", - "rustls 0.23.12", + "rustls 0.23.17", "socket2", - "thiserror", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -4005,7 +4078,7 @@ dependencies = [ "quick-protobuf-codec 0.3.1", "rand 0.8.5", "static_assertions", - "thiserror", + "thiserror 1.0.69", "tracing", "void", "web-time", @@ -4030,7 +4103,7 @@ dependencies = [ "quick-protobuf", "quick-protobuf-codec 0.2.0", "rand 0.8.5", - "thiserror", + "thiserror 1.0.69", "tracing", "void", ] @@ -4084,7 +4157,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm-derive", - "lru 0.12.4", + "lru 0.12.5", "multistream-select", "once_cell", "rand 0.8.5", @@ -4103,7 +4176,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -4137,7 +4210,7 @@ dependencies = [ "ring 0.16.20", "rustls 0.21.12", "rustls-webpki 0.101.7", - "thiserror", + "thiserror 1.0.69", "x509-parser 0.15.1", "yasna", ] @@ -4154,9 +4227,9 @@ dependencies = [ "libp2p-identity", "rcgen 0.11.3", "ring 0.17.8", - "rustls 0.23.12", + "rustls 0.23.17", "rustls-webpki 0.101.7", - "thiserror", + "thiserror 1.0.69", "x509-parser 0.16.0", "yasna", ] @@ -4186,10 +4259,10 @@ dependencies = [ "either", "futures", "libp2p-core", - "thiserror", + "thiserror 1.0.69", "tracing", "yamux 0.12.1", - "yamux 0.13.3", + "yamux 0.13.4", ] [[package]] @@ -4200,6 +4273,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", + "redox_syscall", ] [[package]] @@ -4220,9 +4294,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.18" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" +checksum = "d2d16453e800a8cf6dd2fc3eb4bc99b786a9b90c663b8559a5b1a041bf89e472" dependencies = [ "cc", "pkg-config", @@ -4242,21 +4316,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] -name = "litrs" -version = "0.4.1" +name = "litemap" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" [[package]] name = "local-ip-address" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136ef34e18462b17bf39a7826f8f3bbc223341f8e83822beb8b77db9a3d49696" +checksum = "3669cf5561f8d27e8fc84cc15e58350e70f557d4d65f70e3154e54cd2f8e1782" dependencies = [ "libc", "neli", - "thiserror", - "windows-sys 0.48.0", + "thiserror 1.0.69", + "windows-sys 0.59.0", ] [[package]] @@ -4287,11 +4361,11 @@ dependencies = [ [[package]] name = "lru" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.14.5", + "hashbrown 0.15.1", ] [[package]] @@ -4305,9 +4379,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.10.0" +version = "1.11.1+lz4-1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "109de74d5d2353660401699a4174a4ff23fcc649caf553df71933c7fb45ad868" +checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" dependencies = [ "cc", "libc", @@ -4349,15 +4423,6 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - [[package]] name = "memmap2" version = "0.6.2" @@ -4401,12 +4466,12 @@ dependencies = [ "futures-util", "libp2p", "notify", - "reqwest 0.12.5", + "reqwest 0.12.9", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "tokio", - "tokio-tungstenite 0.24.0", + "tokio-tungstenite", "url", ] @@ -4433,10 +4498,10 @@ dependencies = [ "hex", "libp2p", "multiaddr", - "near-crypto 0.27.0", + "near-crypto", "starknet", "tokio", - "toml_edit 0.22.20", + "toml_edit", "tracing", "tracing-subscriber", "url", @@ -4473,6 +4538,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "0.8.11" @@ -4487,9 +4561,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi 0.3.9", "libc", @@ -4505,9 +4579,9 @@ checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" [[package]] name = "multiaddr" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b852bc02a2da5feed68cd14fa50d0774b92790a5bdbfa932a813926c8472070" +checksum = "fe6351f60b488e04c1d21bc69e56b89cb3f5e8f5d22557d6e8031bdfd79b6961" dependencies = [ "arrayref", "byteorder", @@ -4518,7 +4592,7 @@ dependencies = [ "percent-encoding", "serde", "static_assertions", - "unsigned-varint 0.7.2", + "unsigned-varint 0.8.0", "url", ] @@ -4535,12 +4609,12 @@ dependencies = [ [[package]] name = "multihash" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076d548d76a0e2a0d4ab471d0b1c36c577786dfc4471242035d97a12a735c492" +checksum = "cc41f430805af9d1cf4adae4ed2149c759b877b01d909a1f40256188d09345d2" dependencies = [ "core2", - "unsigned-varint 0.7.2", + "unsigned-varint 0.8.0", ] [[package]] @@ -4646,11 +4720,11 @@ dependencies = [ "bytesize", "chrono", "derive_more", - "near-config-utils 0.27.0", - "near-crypto 0.27.0", - "near-parameters 0.27.0", - "near-primitives 0.27.0", - "near-time 0.27.0", + "near-config-utils", + "near-crypto", + "near-parameters", + "near-primitives", + "near-time", "num-rational", "serde", "serde_json", @@ -4660,18 +4734,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "near-config-utils" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96c1682d13e9a8a62ea696395bf17afc4ed4b60535223251168217098c27a50" -dependencies = [ - "anyhow", - "json_comments", - "thiserror", - "tracing", -] - [[package]] name = "near-config-utils" version = "0.27.0" @@ -4680,39 +4742,13 @@ checksum = "4e7b41110a20f1d82bb06f06e4800068c5ade6d8ff844787f8753bc2ce7b16f7" dependencies = [ "anyhow", "json_comments", - "thiserror", + "thiserror 1.0.69", "tracing", ] [[package]] name = "near-crypto" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907fdcefa3a42976cd6a8bf626fe2a87eb0d3b3ff144adc67cf32d53c9494b32" -dependencies = [ - "blake2", - "borsh", - "bs58 0.4.0", - "curve25519-dalek", - "derive_more", - "ed25519-dalek", - "hex", - "near-account-id", - "near-config-utils 0.26.0", - "near-stdx 0.26.0", - "once_cell", - "primitive-types 0.10.1", - "rand 0.8.5", - "secp256k1", - "serde", - "serde_json", - "subtle", - "thiserror", -] - -[[package]] -name = "near-crypto" -version = "0.27.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b17944c8d0f274c684227d79fcd46d583b1e36064b597c53a9ebec187a86f3" dependencies = [ @@ -4724,25 +4760,16 @@ dependencies = [ "ed25519-dalek", "hex", "near-account-id", - "near-config-utils 0.27.0", + "near-config-utils", "near-schema-checker-lib", - "near-stdx 0.27.0", + "near-stdx", "primitive-types 0.10.1", "rand 0.8.5", "secp256k1", "serde", "serde_json", "subtle", - "thiserror", -] - -[[package]] -name = "near-fmt" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a36518bfcf2177096d4298d9158ba698ffd6944cb035ecc0938b098337b933c" -dependencies = [ - "near-primitives-core 0.26.0", + "thiserror 1.0.69", ] [[package]] @@ -4751,7 +4778,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1eff0731995774d1498f017c968a3ebbfdadad84f556afea4b83679f6706ac9" dependencies = [ - "near-primitives-core 0.27.0", + "near-primitives-core", ] [[package]] @@ -4775,13 +4802,13 @@ dependencies = [ "lazy_static", "log", "near-chain-configs", - "near-crypto 0.27.0", + "near-crypto", "near-jsonrpc-primitives", - "near-primitives 0.27.0", - "reqwest 0.12.5", + "near-primitives", + "reqwest 0.12.9", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -4792,33 +4819,15 @@ checksum = "0c89197294a74af70fd5d06b4876dc2a400ffbdff6131e640e75fcb4fd194649" dependencies = [ "arbitrary", "near-chain-configs", - "near-crypto 0.27.0", - "near-primitives 0.27.0", + "near-crypto", + "near-primitives", "near-schema-checker-lib", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "time", ] -[[package]] -name = "near-parameters" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e41afea5c5e84763586bafc5f5e1b63d90ef4e5454e18406cab8df120178db8d" -dependencies = [ - "borsh", - "enum-map", - "near-account-id", - "near-primitives-core 0.26.0", - "num-rational", - "serde", - "serde_repr", - "serde_yaml", - "strum 0.24.1", - "thiserror", -] - [[package]] name = "near-parameters" version = "0.27.0" @@ -4828,57 +4837,14 @@ dependencies = [ "borsh", "enum-map", "near-account-id", - "near-primitives-core 0.27.0", + "near-primitives-core", "near-schema-checker-lib", "num-rational", "serde", "serde_repr", "serde_yaml", "strum 0.24.1", - "thiserror", -] - -[[package]] -name = "near-primitives" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "165c2dc0fc20d839cfd7948d930ef5e8a4ed2b095abe83e0076ef5d4a5df58ed" -dependencies = [ - "arbitrary", - "base64 0.21.7", - "borsh", - "bytes", - "bytesize", - "cfg-if 1.0.0", - "chrono", - "derive_more", - "easy-ext", - "enum-map", - "hex", - "itertools 0.10.5", - "near-crypto 0.26.0", - "near-fmt 0.26.0", - "near-parameters 0.26.0", - "near-primitives-core 0.26.0", - "near-rpc-error-macro", - "near-stdx 0.26.0", - "near-structs-checker-lib", - "near-time 0.26.0", - "num-rational", - "once_cell", - "ordered-float", - "primitive-types 0.10.1", - "rand 0.8.5", - "rand_chacha", - "serde", - "serde_json", - "serde_with", - "sha3", - "smart-default", - "strum 0.24.1", - "thiserror", - "tracing", - "zstd 0.13.2", + "thiserror 1.0.69", ] [[package]] @@ -4900,13 +4866,13 @@ dependencies = [ "enum-map", "hex", "itertools 0.10.5", - "near-crypto 0.27.0", - "near-fmt 0.27.0", - "near-parameters 0.27.0", - "near-primitives-core 0.27.0", + "near-crypto", + "near-fmt", + "near-parameters", + "near-primitives-core", "near-schema-checker-lib", - "near-stdx 0.27.0", - "near-time 0.27.0", + "near-stdx", + "near-time", "num-rational", "ordered-float", "primitive-types 0.10.1", @@ -4918,32 +4884,11 @@ dependencies = [ "sha3", "smart-default", "strum 0.24.1", - "thiserror", + "thiserror 1.0.69", "tracing", "zstd 0.13.2", ] -[[package]] -name = "near-primitives-core" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51fd53f992168589c52022dd220c84a7f2ede92251631a06a3817e4b22af5836" -dependencies = [ - "arbitrary", - "base64 0.21.7", - "borsh", - "bs58 0.4.0", - "derive_more", - "enum-map", - "near-account-id", - "near-structs-checker-lib", - "num-rational", - "serde", - "serde_repr", - "sha2", - "thiserror", -] - [[package]] name = "near-primitives-core" version = "0.27.0" @@ -4962,29 +4907,7 @@ dependencies = [ "serde", "serde_repr", "sha2", - "thiserror", -] - -[[package]] -name = "near-rpc-error-core" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df598b0785a3e36d7e4fb73afcdf20536988b13d07cead71dfa777db4783e552" -dependencies = [ - "quote", - "serde", - "syn 2.0.72", -] - -[[package]] -name = "near-rpc-error-macro" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "647ef261df99ad877c08c97af2f10368c8b8cde0968250d3482a5a249e9f3926" -dependencies = [ - "near-rpc-error-core", - "serde", - "syn 2.0.72", + "thiserror 1.0.69", ] [[package]] @@ -5024,19 +4947,19 @@ checksum = "a1bca8c93ff0ad17138c147323a07f036d11c9e1602e3bc2ac9d29c3cf78b89d" [[package]] name = "near-sdk" -version = "5.5.0" +version = "5.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e296b02c85539c16659e171242d6c6bbea87eec7c9ef860d8dfd3fb3168a18a" +checksum = "581c7e6b1962fca1637bf668c18b498328100f8974aa798ed44702ba77c3bdac" dependencies = [ "base64 0.22.1", "borsh", "bs58 0.5.1", "near-account-id", - "near-crypto 0.26.0", + "near-crypto", "near-gas", - "near-parameters 0.26.0", - "near-primitives 0.26.0", - "near-primitives-core 0.26.0", + "near-parameters", + "near-primitives", + "near-primitives-core", "near-sdk-macros", "near-sys", "near-token", @@ -5049,73 +4972,33 @@ dependencies = [ [[package]] name = "near-sdk-macros" -version = "5.5.0" +version = "5.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0adc79466aa556f56a995c0db34a933b32597ab92bbb0e526597118899c8bcaf" +checksum = "0818798144d69a248d76e22b04d1b89b84b80575c96c4af0f7f0332b22487a08" dependencies = [ "Inflector", - "darling 0.20.10", + "darling", "proc-macro2", "quote", "serde", "serde_json", "strum 0.26.3", "strum_macros 0.26.4", - "syn 2.0.72", + "syn 2.0.87", ] -[[package]] -name = "near-stdx" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d5c43f6181873287ddaa25edcc2943d0f2d5da9588231516f2ed0549db1fbac" - [[package]] name = "near-stdx" version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "427b4e4af5e32f682064772da8b1a7558b3f090e6151c8804cff24ee6c5c4966" -[[package]] -name = "near-structs-checker-core" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e53379bee876286de4ad31dc7f9fde8db12527c39d401d94f4d42cd021b8fce" - -[[package]] -name = "near-structs-checker-lib" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f984805f225c9b19681a124af7783078459e87ea63dde751b62e7cb404b1d6a" -dependencies = [ - "near-structs-checker-core", - "near-structs-checker-macro", -] - -[[package]] -name = "near-structs-checker-macro" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66319954983ae164fd0b714ae9d8b09edc26c74d9b3a1f51e564bb14720adb8e" - [[package]] name = "near-sys" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbf4ca5c805cb78700e10e43484902d8da05f25788db277999d209568aaf4c8e" -[[package]] -name = "near-time" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d37b864f04d9aebbc3b88ac63ba989d94f221de694bcc8af639cc284a89f64" -dependencies = [ - "once_cell", - "serde", - "time", - "tokio", -] - [[package]] name = "near-time" version = "0.27.0" @@ -5138,22 +5021,23 @@ dependencies = [ [[package]] name = "near-vm-runner" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a2fecdbec69a1748bd80aa0d73e4de0064d2d8097f429677d3e37a6bde3b2d" +checksum = "7f31fac542ba77915f4f63ec1ba79edc559dd03ba471bf1feb08fcb434e5187f" dependencies = [ "blst", "borsh", "bytesize", "ed25519-dalek", "enum-map", - "lru 0.12.4", - "near-crypto 0.26.0", - "near-parameters 0.26.0", - "near-primitives-core 0.26.0", - "near-stdx 0.26.0", + "lru 0.12.5", + "near-crypto", + "near-parameters", + "near-primitives-core", + "near-schema-checker-lib", + "near-stdx", "num-rational", - "once_cell", + "rayon", "ripemd", "rustix", "serde", @@ -5162,7 +5046,7 @@ dependencies = [ "sha3", "strum 0.24.1", "tempfile", - "thiserror", + "thiserror 1.0.69", "tracing", "zeropool-bn", ] @@ -5182,20 +5066,20 @@ dependencies = [ "libc", "near-abi-client", "near-account-id", - "near-crypto 0.27.0", + "near-crypto", "near-gas", "near-jsonrpc-client", "near-jsonrpc-primitives", - "near-primitives 0.27.0", + "near-primitives", "near-sandbox-utils", "near-token", "rand 0.8.5", - "reqwest 0.12.5", + "reqwest 0.12.9", "serde", "serde_json", "sha2", "tempfile", - "thiserror", + "thiserror 1.0.69", "tokio", "tokio-retry", "tracing", @@ -5256,21 +5140,20 @@ dependencies = [ [[package]] name = "netlink-packet-core" -version = "0.4.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345b8ab5bd4e71a2986663e88c56856699d060e78e152e6e9d7966fcd5491297" +checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" dependencies = [ "anyhow", "byteorder", - "libc", "netlink-packet-utils", ] [[package]] name = "netlink-packet-route" -version = "0.12.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ea4302b9759a7a88242299225ea3688e63c85ea136371bb6cf94fd674efaab" +checksum = "053998cea5a306971f88580d0829e90f270f940befd7cf928da179d4187a5a66" dependencies = [ "anyhow", "bitflags 1.3.2", @@ -5289,21 +5172,21 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "netlink-proto" -version = "0.10.0" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65b4b14489ab424703c092062176d52ba55485a89c076b4f9db05092b7223aa6" +checksum = "86b33524dc0968bfad349684447bfce6db937a9ac3332a1fe60c0c5a5ce63f21" dependencies = [ "bytes", "futures", "log", "netlink-packet-core", "netlink-sys", - "thiserror", + "thiserror 1.0.69", "tokio", ] @@ -5322,9 +5205,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.3" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", "cfg-if 1.0.0", @@ -5477,18 +5360,18 @@ dependencies = [ [[package]] name = "oid-registry" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c958dd45046245b9c3c2547369bb634eb461670b2e7e0de552905801a648d1d" +checksum = "a8d8034d9489cdaf79228eb9f6a3b8d7bb32ba00d6645ebd48eef4077ceb5bd9" dependencies = [ "asn1-rs 0.6.2", ] [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "only-peers" @@ -5506,9 +5389,9 @@ checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if 1.0.0", @@ -5527,7 +5410,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -5538,9 +5421,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -5556,9 +5439,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "ordered-float" -version = "4.2.2" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a91171844676f8c7990ce64959210cd2eaef32c2612c50f9fae9f8aaa6065a6" +checksum = "c65ee1f9701bf938026630b455d5315f490640234259037edb259798b3bcf85e" dependencies = [ "borsh", "num-traits", @@ -5588,7 +5471,7 @@ dependencies = [ "proc-macro2", "proc-macro2-diagnostics", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -5614,35 +5497,36 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.6.12" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306800abfa29c7f16596b5970a588435e3d5b3149683d00c12b699cc19f895ee" +checksum = "8be4817d39f3272f69c59fe05d0535ae6456c2dc2fa1ba02910296c7e0a5c590" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", + "rustversion", "serde", ] [[package]] name = "parity-scale-codec-derive" -version = "3.6.12" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" +checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.87", ] [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -5662,7 +5546,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if 1.0.0", "libc", - "redox_syscall 0.5.3", + "redox_syscall", "smallvec", "windows-targets 0.52.6", ] @@ -5714,29 +5598,29 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -5756,15 +5640,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "polling" -version = "3.7.2" +version = "3.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" +checksum = "a604568c3202727d1507653cb121dbd627a58684eb09a820fd746bee38b4442f" dependencies = [ "cfg-if 1.0.0", "concurrent-queue", @@ -5772,7 +5656,7 @@ dependencies = [ "pin-project-lite", "rustix", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5836,12 +5720,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "64d1ec885c64d0457d564db4ec299b2dae3f9c02808b8ad9c3a089c591b18033" dependencies = [ "proc-macro2", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -5869,11 +5753,11 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit 0.21.1", + "toml_edit", ] [[package]] @@ -5917,7 +5801,7 @@ checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", "version_check", "yansi", ] @@ -5942,7 +5826,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -5953,7 +5837,7 @@ dependencies = [ "calimero-context-config-near", "ed25519-dalek", "eyre", - "near-crypto 0.27.0", + "near-crypto", "near-sdk", "near-workspaces", "rand 0.8.5", @@ -5964,9 +5848,9 @@ dependencies = [ [[package]] name = "psm" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" dependencies = [ "cc", ] @@ -6015,7 +5899,7 @@ dependencies = [ "asynchronous-codec 0.6.2", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.69", "unsigned-varint 0.7.2", ] @@ -6028,15 +5912,15 @@ dependencies = [ "asynchronous-codec 0.7.0", "bytes", "quick-protobuf", - "thiserror", + "thiserror 1.0.69", "unsigned-varint 0.8.0", ] [[package]] name = "quinn" -version = "0.11.3" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "futures-io", @@ -6044,41 +5928,45 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash 2.0.0", - "rustls 0.23.12", + "rustls 0.23.17", "socket2", - "thiserror", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.6" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand 0.8.5", "ring 0.17.8", "rustc-hash 2.0.0", - "rustls 0.23.12", + "rustls 0.23.17", + "rustls-pki-types", "slab", - "thiserror", + "thiserror 2.0.3", "tinyvec", "tracing", + "web-time", ] [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6212,31 +6100,22 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.5.3" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.69", ] [[package]] @@ -6253,14 +6132,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.7", - "regex-syntax 0.8.4", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] @@ -6274,13 +6153,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.4", + "regex-syntax 0.8.5", ] [[package]] @@ -6291,9 +6170,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "region" @@ -6339,7 +6218,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.30", + "hyper 0.14.31", "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", @@ -6356,7 +6235,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper 0.1.2", - "system-configuration", + "system-configuration 0.5.1", "tokio", "tokio-native-tls", "tokio-rustls 0.24.1", @@ -6366,26 +6245,26 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "webpki-roots 0.25.4", - "winreg 0.50.0", + "winreg", ] [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "base64 0.22.1", "bytes", "encoding_rs", "futures-core", "futures-util", - "h2 0.4.5", + "h2 0.4.7", "http 1.1.0", "http-body 1.0.1", "http-body-util", - "hyper 1.4.1", - "hyper-rustls 0.27.2", + "hyper 1.5.1", + "hyper-rustls 0.27.3", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -6396,12 +6275,12 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile 2.1.3", + "rustls-pemfile 2.2.0", "serde", "serde_json", "serde_urlencoded", "sync_wrapper 1.0.1", - "system-configuration", + "system-configuration 0.6.1", "tokio", "tokio-native-tls", "tokio-util", @@ -6411,7 +6290,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -6475,9 +6354,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +checksum = "9008cd6385b9e161d8229e1f6549dd23c3d022f132a2ea37ac3a10ac4935779b" dependencies = [ "bitvec", "bytecheck", @@ -6489,14 +6368,14 @@ dependencies = [ "rkyv_derive", "seahash", "tinyvec", - "uuid 1.10.0", + "uuid 1.11.0", ] [[package]] name = "rkyv_derive" -version = "0.7.44" +version = "0.7.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +checksum = "503d1d27590a2b0a3a4ca4c94755aa2875657196ecbf401a42eff41d7de532c0" dependencies = [ "proc-macro2", "quote", @@ -6525,16 +6404,19 @@ dependencies = [ [[package]] name = "rtnetlink" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322c53fd76a18698f1c27381d58091de3a043d356aa5bd0d510608b565f469a0" +checksum = "7a552eb82d19f38c3beed3f786bd23aa434ceb9ac43ab44419ca6d67a7e186c0" dependencies = [ "futures", "log", + "netlink-packet-core", "netlink-packet-route", + "netlink-packet-utils", "netlink-proto", - "nix 0.24.3", - "thiserror", + "netlink-sys", + "nix 0.26.4", + "thiserror 1.0.69", "tokio", ] @@ -6558,7 +6440,7 @@ dependencies = [ "proc-macro2", "quote", "rust-embed-utils", - "syn 2.0.72", + "syn 2.0.87", "walkdir", ] @@ -6599,9 +6481,9 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] @@ -6617,9 +6499,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno", @@ -6642,15 +6524,15 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ "log", "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki 0.102.8", "subtle", "zeroize", ] @@ -6666,19 +6548,21 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64 0.22.1", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -6692,9 +6576,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -6703,9 +6587,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "rw-stream-sink" @@ -6744,11 +6628,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -6761,7 +6645,6 @@ dependencies = [ "schemars_derive", "serde", "serde_json", - "url", ] [[package]] @@ -6773,7 +6656,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -6844,9 +6727,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", @@ -6863,15 +6746,12 @@ name = "semver" version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" -dependencies = [ - "serde", -] [[package]] name = "serde" -version = "1.0.204" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -6908,13 +6788,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -6925,14 +6805,14 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.122" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -6969,14 +6849,14 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -6990,7 +6870,7 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -7007,9 +6887,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", @@ -7025,14 +6905,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.9.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ - "darling 0.20.10", + "darling", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -7109,7 +6989,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6c99835bad52957e7aa241d3975ed17c1e5f8c92026377d117a606f36b84b16" dependencies = [ "bytes", - "memmap2 0.6.2", + "memmap2", ] [[package]] @@ -7138,9 +7018,9 @@ dependencies = [ [[package]] name = "simdutf8" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "simple_asn1" @@ -7150,7 +7030,7 @@ checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" dependencies = [ "num-bigint 0.4.6", "num-traits", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -7264,27 +7144,27 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "stacker" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c886bd4480155fd3ef527d45e9ac8dd7118a898a46530b7b94c3e21866259fce" +checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b" dependencies = [ "cc", "cfg-if 1.0.0", "libc", "psm", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "starknet" version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0c9ac3809cc7630784e8c8565fa3013af819d83c97aa2720d566016d439011" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" dependencies = [ "starknet-accounts", "starknet-contract", "starknet-core", - "starknet-crypto", + "starknet-core-derive", + "starknet-crypto 0.7.3 (git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6)", "starknet-macros", "starknet-providers", "starknet-signers", @@ -7293,23 +7173,21 @@ dependencies = [ [[package]] name = "starknet-accounts" version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee27ded58ade61da410fccafd57ed5429b0e79a9d62a4ae8b65818cb9d6f400" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" dependencies = [ "async-trait", "auto_impl", "starknet-core", - "starknet-crypto", + "starknet-crypto 0.7.3 (git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6)", "starknet-providers", "starknet-signers", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "starknet-contract" version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6ee5762d24c4f06ab7e9406550925df406712e73719bd2de905c879c674a87" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" dependencies = [ "serde", "serde_json", @@ -7317,33 +7195,62 @@ dependencies = [ "starknet-accounts", "starknet-core", "starknet-providers", - "thiserror", + "thiserror 1.0.69", ] [[package]] name = "starknet-core" version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538240cbe6663c673fe77465f294da707080f39678dd7066761554899e46100" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" dependencies = [ "base64 0.21.7", "crypto-bigint", "flate2", "hex", + "num-traits", "serde", "serde_json", "serde_json_pythonic", "serde_with", "sha3", - "starknet-crypto", + "starknet-core-derive", + "starknet-crypto 0.7.3 (git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6)", "starknet-types-core", ] +[[package]] +name = "starknet-core-derive" +version = "0.1.0" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "starknet-crypto" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a5064173a8e8d2675e67744fd07f310de44573924b6b7af225a6bdd8102913" +checksum = "ded22ccf4cb9e572ce3f77de6066af53560cd2520d508876c83bb1e6b29d5cbc" +dependencies = [ + "crypto-bigint", + "hex", + "hmac", + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "rfc6979", + "sha2", + "starknet-curve 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "starknet-types-core", + "zeroize", +] + +[[package]] +name = "starknet-crypto" +version = "0.7.3" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" dependencies = [ "crypto-bigint", "hex", @@ -7353,7 +7260,7 @@ dependencies = [ "num-traits", "rfc6979", "sha2", - "starknet-curve", + "starknet-curve 0.5.1 (git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6)", "starknet-types-core", "zeroize", ] @@ -7367,21 +7274,27 @@ dependencies = [ "starknet-types-core", ] +[[package]] +name = "starknet-curve" +version = "0.5.1" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" +dependencies = [ + "starknet-types-core", +] + [[package]] name = "starknet-macros" version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8986a940af916fc0a034f4e42c6ba76d94f1e97216d75447693dfd7aefaf3ef2" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" dependencies = [ "starknet-core", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] name = "starknet-providers" version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60e8e69ba7a36dea2d28333be82b4011f8784333d3ae5618482b6587c1ffb66c" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" dependencies = [ "async-trait", "auto_impl", @@ -7394,15 +7307,14 @@ dependencies = [ "serde_json", "serde_with", "starknet-core", - "thiserror", + "thiserror 1.0.69", "url", ] [[package]] name = "starknet-signers" version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70b9e01b61ae51d722e2b100d6ef913c5a2e70d1ea672733d385f7296d6055ef" +source = "git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6#5c676a64031901b5a203168fd8ef8d6b40a5862f" dependencies = [ "async-trait", "auto_impl", @@ -7411,8 +7323,8 @@ dependencies = [ "getrandom", "rand 0.8.5", "starknet-core", - "starknet-crypto", - "thiserror", + "starknet-crypto 0.7.3 (git+https://github.com/xJonathanLEI/starknet-rs?rev=5c676a6)", + "thiserror 1.0.69", ] [[package]] @@ -7435,12 +7347,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "strsim" version = "0.11.1" @@ -7488,7 +7394,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -7510,27 +7416,15 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.72" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" 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.72", -] - [[package]] name = "sync_wrapper" version = "0.1.2" @@ -7542,6 +7436,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "synstructure" @@ -7563,7 +7460,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -7574,7 +7471,18 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] @@ -7587,6 +7495,16 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tap" version = "1.0.1" @@ -7595,9 +7513,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tar" -version = "0.4.41" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" +checksum = "c65998313f8e17d0d553d28f91a0df93e4dbbbf770279c7bc21ca0f09ea1a1f6" dependencies = [ "filetime", "libc", @@ -7610,6 +7528,12 @@ version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +[[package]] +name = "target-triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a4d50cdb458045afc8131fd91b64904da29548bcb63c7236e0844936c13078" + [[package]] name = "tempdir" version = "0.3.7" @@ -7622,9 +7546,9 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.12.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if 1.0.0", "fastrand", @@ -7654,22 +7578,42 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +dependencies = [ + "thiserror-impl 2.0.3", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ - "thiserror-impl", + "proc-macro2", + "quote", + "syn 2.0.87", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -7737,6 +7681,16 @@ dependencies = [ "crunchy", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -7754,14 +7708,14 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.2" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", "libc", - "mio 1.0.1", + "mio 1.0.2", "parking_lot", "pin-project-lite", "signal-hook-registry", @@ -7778,7 +7732,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -7818,16 +7772,16 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls 0.23.17", "rustls-pki-types", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -7847,18 +7801,6 @@ dependencies = [ "tokio-stream", ] -[[package]] -name = "tokio-tungstenite" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite 0.21.0", -] - [[package]] name = "tokio-tungstenite" version = "0.24.0" @@ -7868,14 +7810,14 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite 0.24.0", + "tungstenite", ] [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -7894,7 +7836,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.20", + "toml_edit", ] [[package]] @@ -7908,26 +7850,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.1" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap 2.6.0", - "toml_datetime", - "winnow 0.5.40", -] - -[[package]] -name = "toml_edit" -version = "0.22.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.18", + "winnow", ] [[package]] @@ -7940,6 +7871,21 @@ dependencies = [ "futures-util", "pin-project", "pin-project-lite", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2873938d487c3cfb9aed7546dc9f2711d867c9f90c46b889989a2cb84eba6b4f" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 0.1.2", "tokio", "tower-layer", "tower-service", @@ -7990,21 +7936,21 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tower-sessions" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2d9b6f0c4938eed0eefd9cce19319b4bdad10e11ca9d8c3be373ce734bbfd63" +checksum = "50571505955aaa8b73f2f40489953d92b4d7ff9eb9b2a8b4e11fee0dcdb2760e" dependencies = [ "async-trait", "http 1.1.0", @@ -8020,9 +7966,9 @@ dependencies = [ [[package]] name = "tower-sessions-core" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38767064990c327ec1d92bba2576dce0944750e9c9ae021f12ebc72de77ac406" +checksum = "6293bf33f1977d5ef422c2e02f909eb2c3d7bf921d93557c40d4f1b130b84aa4" dependencies = [ "async-trait", "axum-core", @@ -8033,7 +7979,7 @@ dependencies = [ "rand 0.8.5", "serde", "serde_json", - "thiserror", + "thiserror 1.0.69", "time", "tokio", "tracing", @@ -8041,9 +7987,9 @@ dependencies = [ [[package]] name = "tower-sessions-memory-store" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b09bbe2c138a9b0ebf307dc6e6a4f7723c59545e0f4fe5e329a89868164ae3" +checksum = "cec5f88eeef0f036e6900217034efbce733cbdf0528a85204eaaed90bc34c354" dependencies = [ "async-trait", "time", @@ -8071,7 +8017,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -8131,37 +8077,19 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "trybuild" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "207aa50d36c4be8d8c6ea829478be44a372c6a77669937bb39c698e52f1491e8" +checksum = "8dcd332a5496c026f1e14b7f3d2b7bd98e509660c04239c58b0ba38a12daded4" dependencies = [ "glob", "serde", "serde_derive", "serde_json", + "target-triple", "termcolor", "toml", ] -[[package]] -name = "tungstenite" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 1.1.0", - "httparse", - "log", - "rand 0.8.5", - "sha1", - "thiserror", - "url", - "utf-8", -] - [[package]] name = "tungstenite" version = "0.24.0" @@ -8176,7 +8104,7 @@ dependencies = [ "log", "rand 0.8.5", "sha1", - "thiserror", + "thiserror 1.0.69", "utf-8", ] @@ -8206,45 +8134,42 @@ dependencies = [ [[package]] name = "unicase" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "7e51b68083f157f853b6379db119d1c1be0e6e4dec98101079dec41f6f5cf6df" [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "universal-hash" @@ -8292,18 +8217,18 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72139d247e5f97a3eff96229a7ae85ead5328a39efe76f8bf5a06313d505b6ea" +checksum = "b74fc6b57825be3373f7054754755f03ac3a8f5d70015ccad699ba2029956f4a" dependencies = [ "base64 0.22.1", "flate2", "log", "once_cell", - "rustls 0.23.12", + "rustls 0.23.17", "rustls-pki-types", "url", - "webpki-roots 0.26.3", + "webpki-roots 0.26.6", ] [[package]] @@ -8318,12 +8243,12 @@ dependencies = [ [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 1.0.3", "percent-encoding", "serde", ] @@ -8334,6 +8259,18 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.2" @@ -8352,9 +8289,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" [[package]] name = "valuable" @@ -8445,34 +8382,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if 1.0.0", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -8482,9 +8420,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -8492,22 +8430,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-encoder" @@ -8520,9 +8458,9 @@ dependencies = [ [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -8533,9 +8471,9 @@ dependencies = [ [[package]] name = "wasmer" -version = "4.3.5" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a6e0f73e5ae361fe64db607eaf4ab2381d88ad2c1b0bb8cf254cf35d894687" +checksum = "2d920d06243e9f456c336c428a34560357dedf59d9febaae14f1995ac120cff6" dependencies = [ "bytes", "cfg-if 1.0.0", @@ -8548,7 +8486,7 @@ dependencies = [ "serde-wasm-bindgen", "shared-buffer", "target-lexicon", - "thiserror", + "thiserror 1.0.69", "tracing", "wasm-bindgen", "wasmer-compiler", @@ -8557,14 +8495,14 @@ dependencies = [ "wasmer-types", "wasmer-vm", "wat", - "winapi", + "windows-sys 0.59.0", ] [[package]] name = "wasmer-compiler" -version = "4.3.5" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb1e7c79507f5d55f1afd99984717e8380440cd98e13d542e4d00661f986f2d4" +checksum = "0e01832173aa52345e480965f18c638a8a5a9e5e4d85a48675bdf1964147dc7f" dependencies = [ "backtrace", "bytes", @@ -8574,26 +8512,26 @@ dependencies = [ "lazy_static", "leb128", "libc", - "memmap2 0.5.10", + "memmap2", "more-asserts", "region", "rkyv", "self_cell", "shared-buffer", "smallvec", - "thiserror", + "thiserror 1.0.69", "wasmer-types", "wasmer-vm", "wasmparser", - "winapi", + "windows-sys 0.59.0", "xxhash-rust", ] [[package]] name = "wasmer-compiler-cranelift" -version = "4.3.5" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3352014573750327646a690d32774312b0e8b7920e7e8ba00c0449eac18390" +checksum = "1c1618f53b492cf6649beeb372930e376e0f52d9842c0c5eb5aa2b548251dab6" dependencies = [ "cranelift-codegen", "cranelift-entity", @@ -8608,33 +8546,11 @@ dependencies = [ "wasmer-types", ] -[[package]] -name = "wasmer-config" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b4a632496950fde9ad821e195ef1a301440076f7c7d80de55239a140359bcbd" -dependencies = [ - "anyhow", - "bytesize", - "derive_builder", - "hex", - "indexmap 2.6.0", - "schemars", - "semver", - "serde", - "serde_cbor", - "serde_json", - "serde_yaml", - "thiserror", - "toml", - "url", -] - [[package]] name = "wasmer-derive" -version = "4.3.5" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6b0b0580cfa1fc7ad58cca3626a742f2b2e5ccd51cfc5de43e8edb0d1daa4c" +checksum = "9c5875633aea92153b6a561cb07363785ca9e07792ca6cd7c1cc371761001d8f" dependencies = [ "proc-macro-error", "proc-macro2", @@ -8644,9 +8560,9 @@ dependencies = [ [[package]] name = "wasmer-types" -version = "4.3.5" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576442cc3d302ca215fd40aa7826a078571dca7eaa773d8cdedca14a2ec7c9a1" +checksum = "8fb32f0d231b591e4c8a65e81d4647fa3180496d71a123d4948dba8551bba9c2" dependencies = [ "bytecheck", "enum-iterator", @@ -8658,16 +8574,15 @@ dependencies = [ "rkyv", "sha2", "target-lexicon", - "thiserror", - "webc", + "thiserror 1.0.69", "xxhash-rust", ] [[package]] name = "wasmer-vm" -version = "4.3.5" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6483035d1df84a978cd6c6a35878e913dc8ec6311f8712548a922a75e87957ba" +checksum = "e38e9301f5bb9f18da9cda4002d74d2cb6ac1f36dcf919fd77f91fca321fb1e5" dependencies = [ "backtrace", "cc", @@ -8686,9 +8601,9 @@ dependencies = [ "more-asserts", "region", "scopeguard", - "thiserror", + "thiserror 1.0.69", "wasmer-types", - "winapi", + "windows-sys 0.59.0", ] [[package]] @@ -8725,9 +8640,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", @@ -8749,7 +8664,7 @@ version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5388522c899d1e1c96a4c307e3797e0f697ba7c77dd8e0e625ecba9dd0342937" dependencies = [ - "arrayvec 0.7.4", + "arrayvec 0.7.6", "base64 0.21.7", "bytes", "derive_more", @@ -8786,40 +8701,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f6d8d1636b2627fe63518d5a9b38a569405d9c9bc665c43c9c341de57227ebb" dependencies = [ "native-tls", - "thiserror", + "thiserror 1.0.69", "tokio", "url", ] -[[package]] -name = "webc" -version = "6.0.0-rc2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3e2ccb43d303c5bd48f31db7a129481a9aaa5343d623f92951751df190df81" -dependencies = [ - "anyhow", - "base64 0.22.1", - "bytes", - "cfg-if 1.0.0", - "document-features", - "flate2", - "indexmap 1.9.3", - "libc", - "once_cell", - "semver", - "serde", - "serde_cbor", - "serde_json", - "sha2", - "shared-buffer", - "tar", - "tempfile", - "thiserror", - "toml", - "url", - "wasmer-config", -] - [[package]] name = "webpki-roots" version = "0.25.4" @@ -8828,9 +8714,9 @@ checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] @@ -8886,21 +8772,70 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.51.1" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" dependencies = [ - "windows-core", - "windows-targets 0.48.5", + "windows-core 0.53.0", + "windows-targets 0.52.6", ] [[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 0.48.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" +dependencies = [ + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result 0.2.0", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", ] [[package]] @@ -9096,18 +9031,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.5.40" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - -[[package]] -name = "winnow" -version = "0.6.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -9123,14 +9049,16 @@ dependencies = [ ] [[package]] -name = "winreg" -version = "0.52.0" +name = "write16" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" -dependencies = [ - "cfg-if 1.0.0", - "windows-sys 0.48.0", -] +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "wyz" @@ -9166,7 +9094,7 @@ dependencies = [ "nom", "oid-registry 0.6.1", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -9181,9 +9109,9 @@ dependencies = [ "der-parser 9.0.0", "lazy_static", "nom", - "oid-registry 0.7.0", + "oid-registry 0.7.1", "rusticata-macros", - "thiserror", + "thiserror 1.0.69", "time", ] @@ -9200,9 +9128,9 @@ dependencies = [ [[package]] name = "xml-rs" -version = "0.8.21" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a77ee7c0de333dcc6da69b177380a0b81e0dacfa4f7344c465a36871ee601" +checksum = "af310deaae937e48a26602b730250b4949e125f468f11e6990be3e5304ddd96f" [[package]] name = "xmltree" @@ -9236,9 +9164,9 @@ dependencies = [ [[package]] name = "yamux" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31b5e376a8b012bee9c423acdbb835fc34d45001cfa3106236a624e4b738028" +checksum = "17610762a1207ee816c6fadc29220904753648aba0a9ed61c7b8336e80a559c4" dependencies = [ "futures", "log", @@ -9265,6 +9193,30 @@ dependencies = [ "time", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure 0.13.1", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -9283,7 +9235,28 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", +] + +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", + "synstructure 0.13.1", ] [[package]] @@ -9303,7 +9276,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.72", + "syn 2.0.87", ] [[package]] @@ -9319,6 +9292,28 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.87", +] + [[package]] name = "zip" version = "0.6.6" diff --git a/Cargo.toml b/Cargo.toml index b99c36678..cfc9a7d98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -304,3 +304,6 @@ multiple_crate_versions = "allow" # Cannot resolve all these missing_errors_doc = "allow" # TODO: Remove later once documentation has been added missing_panics_doc = "allow" # TODO: Remove later once documentation has been added future_not_send = "allow" # TODO: Remove later once Send is implemented + +[patch.crates-io] +starknet = { git = "https://github.com/xJonathanLEI/starknet-rs", rev = "5c676a6" } diff --git a/contracts/context-config/src/mutate.rs b/contracts/context-config/src/mutate.rs index cdc82fe75..b1e9bdc60 100644 --- a/contracts/context-config/src/mutate.rs +++ b/contracts/context-config/src/mutate.rs @@ -251,6 +251,12 @@ impl ContextConfigs { .expect("unable to update member list") .priviledges() .grant(identity), + Capability::Proxy => context + .proxy + .get(signer_id) + .expect("unable to update proxy") + .priviledges() + .grant(identity), }; env::log_str(&format!( @@ -289,6 +295,12 @@ impl ContextConfigs { .expect("unable to update member list") .priviledges() .revoke(&identity), + Capability::Proxy => context + .proxy + .get(signer_id) + .expect("unable to update proxy") + .priviledges() + .revoke(&identity), }; env::log_str(&format!( diff --git a/crates/context/config/Cargo.toml b/crates/context/config/Cargo.toml index c12185579..0ebcea8bb 100644 --- a/crates/context/config/Cargo.toml +++ b/crates/context/config/Cargo.toml @@ -12,6 +12,7 @@ borsh = { workspace = true, features = ["derive"] } ed25519-dalek.workspace = true either = { workspace = true, optional = true } eyre = { workspace = true, optional = true } +hex.workspace = true near-crypto = { workspace = true, optional = true } near-jsonrpc-client = { workspace = true, optional = true } near-jsonrpc-primitives = { workspace = true, optional = true } diff --git a/crates/context/config/src/client/env/config.rs b/crates/context/config/src/client/env/config.rs index 04c95f9e6..ae704f599 100644 --- a/crates/context/config/src/client/env/config.rs +++ b/crates/context/config/src/client/env/config.rs @@ -2,7 +2,7 @@ use crate::client::{CallClient, Environment}; mod mutate; mod query; - +mod types; use mutate::ContextConfigMutate; use query::ContextConfigQuery; diff --git a/crates/context/config/src/client/env/config/mutate.rs b/crates/context/config/src/client/env/config/mutate.rs index 8084261b0..d5c851bf3 100644 --- a/crates/context/config/src/client/env/config/mutate.rs +++ b/crates/context/config/src/client/env/config/mutate.rs @@ -1,14 +1,19 @@ +use std::fmt::Debug; + use ed25519_dalek::{Signer, SigningKey}; +use starknet::core::codec::Encode; +use starknet::signers::SigningKey as StarknetSigningKey; +use starknet_crypto::{poseidon_hash_many, Felt}; +use super::types::starknet::{Request as StarknetRequest, Signed as StarknetSigned}; use crate::client::env::{utils, Method}; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; use crate::client::transport::Transport; use crate::client::{CallClient, ClientError, Operation}; -use crate::repr::ReprTransmute; +use crate::repr::{Repr, ReprTransmute}; use crate::types::Signed; -use crate::{Request, RequestKind}; - +use crate::{ContextIdentity, Request, RequestKind}; pub mod methods; #[derive(Debug)] @@ -25,6 +30,7 @@ pub struct ContextConfigMutateRequest<'a, T> { #[derive(Debug)] struct Mutate<'a> { pub(crate) signing_key: [u8; 32], + pub(crate) nonce: u64, pub(crate) kind: RequestKind<'a>, } @@ -56,31 +62,77 @@ impl<'a> Method for Mutate<'a> { impl<'a> Method for Mutate<'a> { type Returns = (); - const METHOD: &'static str = "mutate"; fn encode(self) -> eyre::Result> { - // sign the params, encode it and return - // since you will have a `Vec` here, you can - // `Vec::with_capacity(32 * calldata.len())` and then - // extend the `Vec` with each `Felt::to_bytes_le()` - // when this `Vec` makes it to `StarknetTransport`, - // reconstruct the `Vec` from it - todo!() + // Derive ecdsa key from private key + let secret_scalar = Felt::from_bytes_be(&self.signing_key); + let signing_key = StarknetSigningKey::from_secret_scalar(secret_scalar); + let verifying_key = signing_key.verifying_key().scalar(); + let verifying_key_bytes = verifying_key.to_bytes_be(); + + // Derive ed25519 key from private key + let user_key = SigningKey::from_bytes(&self.signing_key).verifying_key(); + let user_key_bytes = user_key.to_bytes(); + + // Create Repr wrapped ContextIdentity instances + let signer_id = verifying_key_bytes + .rt::() + .map_err(|e| eyre::eyre!("Failed to convert verifying key: {}", e))?; + let signer_id = Repr::new(signer_id); + + let user_id = user_key_bytes + .rt::() + .map_err(|e| eyre::eyre!("Failed to convert user key: {}", e))?; + let user_id = Repr::new(user_id); + + // Create the Request structure using into() conversions + let request = StarknetRequest { + signer_id: signer_id.into(), + user_id: user_id.into(), + nonce: self.nonce, + kind: self.kind.into(), + }; + + // Serialize the request + let mut serialized_request = vec![]; + request.encode(&mut serialized_request)?; + + // Hash the serialized request + let hash = poseidon_hash_many(&serialized_request); + + // Sign the hash with the signing key + let signature = signing_key.sign(&hash)?; + + let signed_request = StarknetSigned { + payload: serialized_request, + signature_r: signature.r, + signature_s: signature.s, + }; + + let mut signed_request_serialized = vec![]; + signed_request.encode(&mut signed_request_serialized)?; + + let bytes: Vec = signed_request_serialized + .iter() + .flat_map(|felt| felt.to_bytes_be()) + .collect(); + + Ok(bytes) } fn decode(_response: Vec) -> eyre::Result { - todo!() + Ok(()) } } -impl<'a, T: Transport> ContextConfigMutateRequest<'a, T> { +impl<'a, T: Transport + Debug> ContextConfigMutateRequest<'a, T> { pub async fn send(self, signing_key: [u8; 32]) -> Result<(), ClientError> { let request = Mutate { signing_key, // todo! when nonces are implemented in context // todo! config contract, we fetch it here first - // nonce: _, + nonce: 0, kind: self.kind, }; diff --git a/crates/context/config/src/client/env/config/query/application.rs b/crates/context/config/src/client/env/config/query/application.rs index 51873f281..c91c51ee6 100644 --- a/crates/context/config/src/client/env/config/query/application.rs +++ b/crates/context/config/src/client/env/config/query/application.rs @@ -1,5 +1,10 @@ use serde::Serialize; +use starknet::core::codec::{Decode, Encode}; +use starknet_crypto::Felt; +use crate::client::env::config::types::starknet::{ + Application as StarknetApplication, CallData, FeltPair, +}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -41,10 +46,48 @@ impl Method for ApplicationRequest { const METHOD: &'static str = "application"; fn encode(self) -> eyre::Result> { - todo!() + let felt_pair: FeltPair = self.context_id.into(); + let mut call_data = CallData::default(); + felt_pair.encode(&mut call_data)?; + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.is_empty() { + return Err(eyre::eyre!("No application found")); + } + + if response.len() % 32 != 0 { + return Err(eyre::eyre!( + "Invalid response length: {} bytes is not a multiple of 32", + response.len() + )); + } + + // Convert bytes to Felts + let mut felts = Vec::new(); + let chunks = response.chunks_exact(32); + + // Verify no remainder + if !chunks.remainder().is_empty() { + return Err(eyre::eyre!("Response length is not a multiple of 32 bytes")); + } + + for chunk in chunks { + let chunk_array: [u8; 32] = chunk + .try_into() + .map_err(|e| eyre::eyre!("Failed to convert chunk to array: {}", e))?; + felts.push(Felt::from_bytes_be(&chunk_array)); + } + + if felts.is_empty() { + return Err(eyre::eyre!("No felts decoded from response")); + } + + // Skip version felt and decode the application + let application = StarknetApplication::decode(&felts[1..]) + .map_err(|e| eyre::eyre!("Failed to decode application: {:?}", e))?; + + Ok(application.into()) } } diff --git a/crates/context/config/src/client/env/config/query/application_revision.rs b/crates/context/config/src/client/env/config/query/application_revision.rs index 2312e0824..70f39162b 100644 --- a/crates/context/config/src/client/env/config/query/application_revision.rs +++ b/crates/context/config/src/client/env/config/query/application_revision.rs @@ -1,5 +1,7 @@ use serde::Serialize; +use starknet::core::codec::Encode; +use crate::client::env::config::types::starknet::{CallData, FeltPair}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -7,8 +9,8 @@ use crate::repr::Repr; use crate::types::{ContextId, Revision}; #[derive(Copy, Clone, Debug, Serialize)] -pub(super) struct ApplicationRevisionRequest { - pub(super) context_id: Repr, +pub struct ApplicationRevisionRequest { + pub context_id: Repr, } impl Method for ApplicationRevisionRequest { @@ -31,10 +33,24 @@ impl Method for ApplicationRevisionRequest { const METHOD: &'static str = "application_revision"; fn encode(self) -> eyre::Result> { - todo!() + let felt_pair: FeltPair = self.context_id.into(); + let mut call_data = CallData::default(); + felt_pair.encode(&mut call_data)?; + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.len() != 32 { + return Err(eyre::eyre!( + "Invalid response length: expected 32 bytes, got {}", + response.len() + )); + } + + // Response should be a single u64 in the last 8 bytes of a felt + let revision_bytes = &response[24..32]; // Take last 8 bytes + let revision = u64::from_be_bytes(revision_bytes.try_into()?); + + Ok(revision) } } diff --git a/crates/context/config/src/client/env/config/query/has_member.rs b/crates/context/config/src/client/env/config/query/has_member.rs index 2e9c91bad..beea351e6 100644 --- a/crates/context/config/src/client/env/config/query/has_member.rs +++ b/crates/context/config/src/client/env/config/query/has_member.rs @@ -1,5 +1,7 @@ use serde::Serialize; +use starknet::core::codec::Encode; +use crate::client::env::config::types::starknet::{CallData, FeltPair}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -32,10 +34,39 @@ impl Method for HasMemberRequest { const METHOD: &'static str = "has_member"; fn encode(self) -> eyre::Result> { - todo!() + let mut call_data = CallData::default(); + + // Encode context_id + let context_pair: FeltPair = self.context_id.into(); + context_pair.encode(&mut call_data)?; + + // Encode identity + let identity_pair: FeltPair = self.identity.into(); + identity_pair.encode(&mut call_data)?; + + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.len() != 32 { + return Err(eyre::eyre!( + "Invalid response length: expected 32 bytes, got {}", + response.len() + )); + } + + // Check if all bytes except the last one are zero + if !response[..31].iter().all(|&b| b == 0) { + return Err(eyre::eyre!( + "Invalid response format: non-zero bytes in prefix" + )); + } + + // Check the last byte is either 0 or 1 + match response[31] { + 0 => Ok(false), + 1 => Ok(true), + v => Err(eyre::eyre!("Invalid boolean value: {}", v)), + } } } diff --git a/crates/context/config/src/client/env/config/query/members.rs b/crates/context/config/src/client/env/config/query/members.rs index 6d18930f2..e688bece3 100644 --- a/crates/context/config/src/client/env/config/query/members.rs +++ b/crates/context/config/src/client/env/config/query/members.rs @@ -1,7 +1,12 @@ use core::mem; use serde::Serialize; +use starknet::core::codec::{Decode, Encode}; +use starknet_crypto::Felt; +use crate::client::env::config::types::starknet::{ + CallData, StarknetMembers, StarknetMembersRequest, +}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -9,10 +14,10 @@ use crate::repr::Repr; use crate::types::{ContextId, ContextIdentity}; #[derive(Copy, Clone, Debug, Serialize)] -pub(super) struct MembersRequest { - pub(super) context_id: Repr, - pub(super) offset: usize, - pub(super) length: usize, +pub(crate) struct MembersRequest { + pub(crate) context_id: Repr, + pub(crate) offset: usize, + pub(crate) length: usize, } impl Method for MembersRequest { @@ -45,10 +50,49 @@ impl Method for MembersRequest { const METHOD: &'static str = "members"; fn encode(self) -> eyre::Result> { - todo!() + let req: StarknetMembersRequest = self.into(); + let mut call_data = CallData::default(); + req.encode(&mut call_data)?; + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.is_empty() { + return Ok(Vec::new()); + } + + if response.len() % 32 != 0 { + return Err(eyre::eyre!( + "Invalid response length: {} bytes is not a multiple of 32", + response.len() + )); + } + + // Convert bytes to Felts + let mut felts = Vec::new(); + let chunks = response.chunks_exact(32); + + // Verify no remainder + if !chunks.remainder().is_empty() { + return Err(eyre::eyre!("Response length is not a multiple of 32 bytes")); + } + + for chunk in chunks { + let chunk_array: [u8; 32] = chunk + .try_into() + .map_err(|e| eyre::eyre!("Failed to convert chunk to array: {}", e))?; + felts.push(Felt::from_bytes_be(&chunk_array)); + } + + // Check if it's a None response (single zero Felt) + if felts.len() == 1 && felts[0] == Felt::ZERO { + return Ok(Vec::new()); + } + + // Decode directly from the felts slice - the Decode trait will handle the array structure + let members = StarknetMembers::decode(&felts) + .map_err(|e| eyre::eyre!("Failed to decode members: {:?}", e))?; + + Ok(members.into()) } } diff --git a/crates/context/config/src/client/env/config/query/members_revision.rs b/crates/context/config/src/client/env/config/query/members_revision.rs index df4191ad8..dd2738fef 100644 --- a/crates/context/config/src/client/env/config/query/members_revision.rs +++ b/crates/context/config/src/client/env/config/query/members_revision.rs @@ -1,5 +1,7 @@ use serde::Serialize; +use starknet::core::codec::Encode; +use crate::client::env::config::types::starknet::{CallData, ContextId as StarknetContextId}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -31,10 +33,33 @@ impl Method for MembersRevisionRequest { const METHOD: &'static str = "members_revision"; fn encode(self) -> eyre::Result> { - todo!() + // Dereference Repr and encode context_id + let context_id: StarknetContextId = (*self.context_id).into(); + + let mut call_data = CallData::default(); + context_id.encode(&mut call_data)?; + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.len() != 32 { + return Err(eyre::eyre!( + "Invalid response length: expected 32 bytes, got {}", + response.len() + )); + } + + // Response should be a single u64 in the last 8 bytes of a felt + // First 24 bytes should be zero + if !response[..24].iter().all(|&b| b == 0) { + return Err(eyre::eyre!( + "Invalid response format: non-zero bytes in prefix" + )); + } + + let revision_bytes = &response[24..32]; + let revision = u64::from_be_bytes(revision_bytes.try_into()?); + + Ok(revision) } } diff --git a/crates/context/config/src/client/env/config/query/privileges.rs b/crates/context/config/src/client/env/config/query/privileges.rs index 61e7b923b..496a97319 100644 --- a/crates/context/config/src/client/env/config/query/privileges.rs +++ b/crates/context/config/src/client/env/config/query/privileges.rs @@ -2,7 +2,13 @@ use core::{mem, ptr}; use std::collections::BTreeMap; use serde::Serialize; +use starknet::core::codec::{Decode, Encode, FeltWriter}; +use starknet_crypto::Felt; +use crate::client::env::config::types::starknet::{ + CallData, ContextId as StarknetContextId, ContextIdentity as StarknetContextIdentity, + StarknetPrivileges, +}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -63,10 +69,60 @@ impl<'a> Method for PrivilegesRequest<'a> { const METHOD: &'static str = "privileges"; fn encode(self) -> eyre::Result> { - todo!() + let mut call_data = CallData::default(); + + // Dereference Repr and encode context_id + let context_id: StarknetContextId = (*self.context_id).into(); + context_id.encode(&mut call_data)?; + + // Add array length + call_data.write(Felt::from(self.identities.len() as u64)); + + // Add each identity using StarknetIdentity + for identity in self.identities { + let starknet_id: StarknetContextIdentity = (*identity).into(); + starknet_id.encode(&mut call_data)?; + } + + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.is_empty() { + return Ok(BTreeMap::new()); + } + + if response.len() % 32 != 0 { + return Err(eyre::eyre!( + "Invalid response length: {} bytes is not a multiple of 32", + response.len() + )); + } + + // Convert bytes to Felts + let mut felts = Vec::new(); + let chunks = response.chunks_exact(32); + + // Verify no remainder + if !chunks.remainder().is_empty() { + return Err(eyre::eyre!("Response length is not a multiple of 32 bytes")); + } + + for chunk in chunks { + let chunk_array: [u8; 32] = chunk + .try_into() + .map_err(|e| eyre::eyre!("Failed to convert chunk to array: {}", e))?; + felts.push(Felt::from_bytes_be(&chunk_array)); + } + + // Check if it's a None response (single zero Felt) + if felts.len() == 1 && felts[0] == Felt::ZERO { + return Ok(BTreeMap::new()); + } + + let privileges = StarknetPrivileges::decode(&felts) + .map_err(|e| eyre::eyre!("Failed to decode privileges: {:?}", e))?; + + Ok(privileges.into()) } } diff --git a/crates/context/config/src/client/env/config/query/proxy_contract.rs b/crates/context/config/src/client/env/config/query/proxy_contract.rs index 2868767df..06fc9ed12 100644 --- a/crates/context/config/src/client/env/config/query/proxy_contract.rs +++ b/crates/context/config/src/client/env/config/query/proxy_contract.rs @@ -1,5 +1,8 @@ use serde::Serialize; +use starknet::core::codec::Encode; +use starknet_crypto::Felt; +use crate::client::env::config::types::starknet::{CallData, FeltPair}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -31,10 +34,26 @@ impl Method for ProxyContractRequest { type Returns = String; fn encode(self) -> eyre::Result> { - todo!() + let mut call_data = CallData::default(); + let felt_pair: FeltPair = self.context_id.into(); + felt_pair.encode(&mut call_data)?; + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.is_empty() { + return Err(eyre::eyre!("No proxy contract found")); + } + + // Check if it's a None response (single zero Felt) + if response.iter().all(|&x| x == 0) { + return Err(eyre::eyre!("No proxy contract found")); + } + + // Parse bytes as Felt + let felt = Felt::from_bytes_be_slice(&response); + + // Format felt as hex string with 0x prefix + Ok(format!("0x{:x}", felt)) } } diff --git a/crates/context/config/src/client/env/config/types.rs b/crates/context/config/src/client/env/config/types.rs new file mode 100644 index 000000000..a8dc8cd36 --- /dev/null +++ b/crates/context/config/src/client/env/config/types.rs @@ -0,0 +1 @@ +pub mod starknet; diff --git a/crates/context/config/src/client/env/config/types/starknet.rs b/crates/context/config/src/client/env/config/types/starknet.rs new file mode 100644 index 000000000..23224f989 --- /dev/null +++ b/crates/context/config/src/client/env/config/types/starknet.rs @@ -0,0 +1,598 @@ +use std::collections::BTreeMap; + +use hex; +use starknet::core::codec::{Decode, Encode, Error, FeltWriter}; +use starknet::core::types::Felt; + +use crate::repr::{Repr, ReprBytes, ReprTransmute}; +use crate::types::SignerId; + +// Base type for all Starknet Felt pairs +#[derive(Debug, Clone, Copy, Encode, Decode)] +pub struct FeltPair { + pub high: Felt, + pub low: Felt, +} + +// Newtype pattern following types.rs style +#[derive(Debug, Clone, Copy, Encode, Decode)] +pub struct ContextId(FeltPair); + +#[derive(Debug, Clone, Copy, Encode, Decode)] +pub struct ContextIdentity(FeltPair); + +#[derive(Debug, Clone, Copy, Encode, Decode)] +pub struct ApplicationId(FeltPair); + +#[derive(Debug, Clone, Copy, Encode, Decode)] +pub struct ApplicationBlob(FeltPair); + +// Single conversion trait +pub trait IntoFeltPair { + fn into_felt_pair(self) -> (Felt, Felt); +} + +impl From<(Felt, Felt)> for FeltPair { + fn from(value: (Felt, Felt)) -> Self { + FeltPair { + high: value.0, + low: value.1, + } + } +} + +#[derive(Default, Debug)] +pub struct CallData(pub Vec); + +impl FeltWriter for CallData { + fn write(&mut self, felt: Felt) { + self.0.extend(felt.to_bytes_be()) + } +} + +// Implement for our base types +impl IntoFeltPair for crate::types::ContextId { + fn into_felt_pair(self) -> (Felt, Felt) { + let bytes = self.as_bytes(); + let mid_point = bytes.len().checked_div(2).expect("Length should be even"); + let (high_bytes, low_bytes) = bytes.split_at(mid_point); + ( + Felt::from_bytes_be_slice(high_bytes), + Felt::from_bytes_be_slice(low_bytes), + ) + } +} + +impl IntoFeltPair for crate::types::ContextIdentity { + fn into_felt_pair(self) -> (Felt, Felt) { + let bytes = self.as_bytes(); + let mid_point = bytes.len().checked_div(2).expect("Length should be even"); + let (high_bytes, low_bytes) = bytes.split_at(mid_point); + ( + Felt::from_bytes_be_slice(high_bytes), + Felt::from_bytes_be_slice(low_bytes), + ) + } +} + +impl IntoFeltPair for crate::types::ApplicationId { + fn into_felt_pair(self) -> (Felt, Felt) { + let bytes = self.as_bytes(); + let mid_point = bytes.len().checked_div(2).expect("Length should be even"); + let (high_bytes, low_bytes) = bytes.split_at(mid_point); + ( + Felt::from_bytes_be_slice(high_bytes), + Felt::from_bytes_be_slice(low_bytes), + ) + } +} + +impl IntoFeltPair for crate::types::BlobId { + fn into_felt_pair(self) -> (Felt, Felt) { + let bytes = self.as_bytes(); + let mid_point = bytes.len().checked_div(2).expect("Length should be even"); + let (high_bytes, low_bytes) = bytes.split_at(mid_point); + ( + Felt::from_bytes_be_slice(high_bytes), + Felt::from_bytes_be_slice(low_bytes), + ) + } +} + +// Add IntoFeltPair implementation for SignerId +impl IntoFeltPair for SignerId { + fn into_felt_pair(self) -> (Felt, Felt) { + let bytes = self.as_bytes(); + let mid_point = bytes.len().checked_div(2).expect("Length should be even"); + let (high_bytes, low_bytes) = bytes.split_at(mid_point); + ( + Felt::from_bytes_be_slice(high_bytes), + Felt::from_bytes_be_slice(low_bytes), + ) + } +} + +// Add From implementations for FeltPair +impl From for FeltPair { + fn from(value: crate::types::ContextId) -> Self { + value.into_felt_pair().into() + } +} + +impl From for FeltPair { + fn from(value: crate::types::ContextIdentity) -> Self { + value.into_felt_pair().into() + } +} + +impl From for FeltPair { + fn from(value: crate::types::ApplicationId) -> Self { + value.into_felt_pair().into() + } +} + +impl From for FeltPair { + fn from(value: crate::types::BlobId) -> Self { + value.into_felt_pair().into() + } +} + +// Simplify the existing From implementations +impl From for ContextId { + fn from(value: crate::types::ContextId) -> Self { + Self(value.into()) + } +} + +impl From for ContextIdentity { + fn from(value: crate::types::ContextIdentity) -> Self { + Self(value.into()) + } +} + +impl From for ApplicationId { + fn from(value: crate::types::ApplicationId) -> Self { + Self(value.into()) + } +} + +impl From for ApplicationBlob { + fn from(value: crate::types::BlobId) -> Self { + Self(value.into()) + } +} + +// Add From for ContextIdentity +impl From for ContextIdentity { + fn from(value: SignerId) -> Self { + let (high, low) = value.into_felt_pair(); + Self(FeltPair { high, low }) + } +} + +// Add From> for ContextIdentity +impl From> for ContextIdentity { + fn from(value: Repr) -> Self { + let (high, low) = value.into_inner().into_felt_pair(); + Self(FeltPair { high, low }) + } +} + +#[derive(Debug, Encode)] +pub enum RequestKind { + Context(ContextRequest), +} + +impl From> for RequestKind { + fn from(value: crate::RequestKind<'_>) -> Self { + match value { + crate::RequestKind::Context(ctx_req) => RequestKind::Context(ctx_req.into()), + } + } +} + +#[derive(Debug, Encode)] +pub struct ContextRequest { + pub context_id: ContextId, + pub kind: ContextRequestKind, +} + +impl From> for ContextRequest { + fn from(value: crate::ContextRequest<'_>) -> Self { + ContextRequest { + context_id: (*value.context_id).into(), + kind: value.kind.into(), + } + } +} + +#[derive(Debug, Encode)] +pub struct Request { + pub kind: RequestKind, + pub signer_id: ContextIdentity, + pub user_id: ContextIdentity, + pub nonce: u64, +} + +#[derive(Debug, Encode, Decode, Copy, Clone)] +pub enum Capability { + ManageApplication, + ManageMembers, + ProxyCode, +} + +impl From<&crate::Capability> for Capability { + fn from(value: &crate::Capability) -> Self { + match value { + crate::Capability::ManageApplication => Capability::ManageApplication, + crate::Capability::ManageMembers => Capability::ManageMembers, + crate::Capability::Proxy => Capability::ProxyCode, + } + } +} + +#[derive(Debug, Encode)] +pub struct CapabilityAssignment { + pub member: ContextIdentity, + pub capability: Capability, +} + +#[derive(Debug, Encode)] +pub enum ContextRequestKind { + Add(ContextIdentity, Application), + UpdateApplication(Application), + AddMembers(Vec), + RemoveMembers(Vec), + Grant(Vec), + Revoke(Vec), + UpdateProxyContract, +} + +impl From> for ContextRequestKind { + fn from(value: crate::ContextRequestKind<'_>) -> Self { + match value { + crate::ContextRequestKind::Add { + author_id, + application, + } => ContextRequestKind::Add(author_id.into_inner().into(), application.into()), + crate::ContextRequestKind::UpdateApplication { application } => { + ContextRequestKind::UpdateApplication(application.into()) + } + crate::ContextRequestKind::AddMembers { members } => ContextRequestKind::AddMembers( + members.into_iter().map(|m| m.into_inner().into()).collect(), + ), + crate::ContextRequestKind::RemoveMembers { members } => { + ContextRequestKind::RemoveMembers( + members.into_iter().map(|m| m.into_inner().into()).collect(), + ) + } + crate::ContextRequestKind::Grant { capabilities } => ContextRequestKind::Grant( + capabilities + .into_iter() + .map(|(id, cap)| CapabilityAssignment { + member: id.into_inner().into(), + capability: cap.into(), + }) + .collect(), + ), + crate::ContextRequestKind::Revoke { capabilities } => ContextRequestKind::Revoke( + capabilities + .into_iter() + .map(|(id, cap)| CapabilityAssignment { + member: id.into_inner().into(), + capability: cap.into(), + }) + .collect(), + ), + crate::ContextRequestKind::UpdateProxyContract => { + ContextRequestKind::UpdateProxyContract + } + } + } +} + +#[derive(Debug, Clone, Encode, Decode)] +pub struct Application { + pub id: ApplicationId, + pub blob: ApplicationBlob, + pub size: u64, + pub source: EncodableString, + pub metadata: EncodableString, +} + +impl From> for Application { + fn from(value: crate::Application<'_>) -> Self { + Application { + id: (*value.id).into(), + blob: (*value.blob).into(), + size: value.size, + source: value.source.into(), + metadata: value.metadata.into(), + } + } +} + +impl<'a> From for crate::Application<'a> { + fn from(value: Application) -> Self { + crate::Application { + id: Repr::new(value.id.into()), + blob: Repr::new(value.blob.into()), + size: value.size, + source: value.source.into(), + metadata: value.metadata.into(), + } + } +} + +#[derive(Debug, Clone)] +pub struct EncodableString(pub String); + +impl From> for EncodableString { + fn from(value: crate::types::ApplicationSource<'_>) -> Self { + EncodableString(value.0.into_owned()) + } +} + +impl From> for EncodableString { + fn from(value: crate::types::ApplicationMetadata<'_>) -> Self { + EncodableString(String::from_utf8_lossy(&value.0.into_inner()).into_owned()) + } +} + +impl From<&str> for EncodableString { + fn from(value: &str) -> Self { + EncodableString(value.to_owned()) + } +} + +impl Encode for EncodableString { + fn encode(&self, writer: &mut W) -> Result<(), Error> { + const WORD_SIZE: usize = 31; + let bytes = self.0.as_bytes(); + + // Calculate full words and pending word + #[allow(clippy::integer_division, reason = "Not harmful here")] + let full_words_count = bytes.len() / WORD_SIZE; + let pending_len = bytes.len() % WORD_SIZE; + + // Write number of full words + writer.write(Felt::from(full_words_count)); + + // Write full words (31 chars each) + for i in 0..full_words_count { + let start = i * WORD_SIZE; + let word_bytes = &bytes[start..start + WORD_SIZE]; + let word_hex = hex::encode(word_bytes); + let felt = Felt::from_hex(&format!("0x{}", word_hex)) + .map_err(|e| Error::custom(&format!("Invalid word hex: {}", e)))?; + writer.write(felt); + } + + // Write pending word if exists + if pending_len > 0 { + let pending_bytes = &bytes[full_words_count * WORD_SIZE..]; + let pending_hex = hex::encode(pending_bytes); + let felt = Felt::from_hex(&format!("0x{}", pending_hex)) + .map_err(|e| Error::custom(&format!("Invalid pending hex: {}", e)))?; + writer.write(felt); + } else { + writer.write(Felt::ZERO); + } + + // Write pending word length + writer.write(Felt::from(pending_len)); + + Ok(()) + } +} + +impl<'a> Decode<'a> for EncodableString { + fn decode_iter(iter: &mut T) -> Result + where + T: Iterator, + { + const WORD_SIZE: usize = 31; + + // Get number of full words + let first_felt = iter.next().ok_or_else(Error::input_exhausted)?; + + let full_words_count = first_felt.to_bytes_be()[31] as usize; + + let mut bytes = Vec::new(); + + // Read full words + for _ in 0..full_words_count { + let word = iter.next().ok_or_else(Error::input_exhausted)?; + let word_bytes = word.to_bytes_be(); + bytes.extend_from_slice(&word_bytes[1..WORD_SIZE + 1]); + } + + // Read pending word + let pending_word = iter.next().ok_or_else(Error::input_exhausted)?; + let pending_bytes = pending_word.to_bytes_be(); + + // Read pending length + let pending_len = iter + .next() + .ok_or_else(Error::input_exhausted)? + .to_bytes_be()[31] as usize; + + // Handle pending bytes - find first non-zero byte and take all remaining bytes + if pending_len > 0 { + let start = pending_bytes.iter().position(|&x| x != 0).unwrap_or(1); + bytes.extend_from_slice(&pending_bytes[start..]); + } + + let string = String::from_utf8(bytes).map_err(|_| Error::custom("Invalid UTF-8"))?; + + Ok(EncodableString(string)) + } +} + +#[derive(Debug, Encode)] +pub struct StarknetMembersRequest { + pub context_id: ContextId, + pub offset: u32, + pub length: u32, +} + +impl From for StarknetMembersRequest { + fn from(value: crate::client::env::config::query::members::MembersRequest) -> Self { + StarknetMembersRequest { + context_id: (*value.context_id).into(), + offset: value.offset as u32, + length: value.length as u32, + } + } +} + +#[derive(Debug, Encode)] +pub struct StarknetApplicationRevisionRequest { + pub context_id: ContextId, +} + +impl From + for StarknetApplicationRevisionRequest +{ + fn from( + value: crate::client::env::config::query::application_revision::ApplicationRevisionRequest, + ) -> Self { + StarknetApplicationRevisionRequest { + context_id: (*value.context_id).into(), + } + } +} + +#[derive(Debug, Encode)] +pub struct Signed { + pub payload: Vec, + pub signature_r: Felt, + pub signature_s: Felt, +} + +// Add reverse conversions for IDs +impl From for crate::types::ApplicationId { + fn from(value: ApplicationId) -> Self { + let FeltPair { high, low } = value.0; + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&high.to_bytes_be()[16..]); + bytes[16..].copy_from_slice(&low.to_bytes_be()[16..]); + bytes.rt().expect("Infallible conversion") + } +} + +impl From for crate::types::ContextId { + fn from(value: ContextId) -> Self { + let FeltPair { high, low } = value.0; + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&high.to_bytes_be()[16..]); + bytes[16..].copy_from_slice(&low.to_bytes_be()[16..]); + bytes.rt().expect("Infallible conversion") + } +} + +impl From for crate::types::BlobId { + fn from(value: ApplicationBlob) -> Self { + let FeltPair { high, low } = value.0; + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&high.to_bytes_be()[16..]); + bytes[16..].copy_from_slice(&low.to_bytes_be()[16..]); + bytes.rt().expect("Infallible conversion") + } +} + +impl<'a> From for crate::types::ApplicationSource<'a> { + fn from(value: EncodableString) -> Self { + crate::types::ApplicationSource(std::borrow::Cow::Owned(value.0)) + } +} + +impl<'a> From for crate::types::ApplicationMetadata<'a> { + fn from(value: EncodableString) -> Self { + crate::types::ApplicationMetadata(Repr::new(std::borrow::Cow::Owned(value.0.into_bytes()))) + } +} + +#[derive(Debug, Decode)] +pub struct StarknetPrivilegeEntry { + pub identity: ContextIdentity, + pub capabilities: Vec, +} + +#[derive(Debug, Decode)] +pub struct StarknetPrivileges { + pub privileges: Vec, +} + +impl From for BTreeMap> { + fn from(value: StarknetPrivileges) -> Self { + value + .privileges + .into_iter() + .map(|entry| { + ( + entry.identity.into(), + entry.capabilities.into_iter().map(Into::into).collect(), + ) + }) + .collect() + } +} + +// Add conversion from Starknet Capability to domain Capability +impl From for crate::Capability { + fn from(value: Capability) -> Self { + match value { + Capability::ManageApplication => crate::Capability::ManageApplication, + Capability::ManageMembers => crate::Capability::ManageMembers, + Capability::ProxyCode => crate::Capability::Proxy, + } + } +} + +// Add conversion from Starknet ContextIdentity to SignerId +impl From for SignerId { + fn from(value: ContextIdentity) -> Self { + let FeltPair { high, low } = value.0; + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&high.to_bytes_be()[16..]); + bytes[16..].copy_from_slice(&low.to_bytes_be()[16..]); + bytes.rt().expect("Infallible conversion") + } +} + +#[derive(Debug, Decode)] +pub struct StarknetMembers { + pub members: Vec, +} + +impl From for Vec { + fn from(value: StarknetMembers) -> Self { + value.members.into_iter().map(|id| id.into()).collect() + } +} + +// Add conversion from Starknet ContextIdentity to domain ContextIdentity +impl From for crate::types::ContextIdentity { + fn from(value: ContextIdentity) -> Self { + let FeltPair { high, low } = value.0; + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&high.to_bytes_be()[16..]); + bytes[16..].copy_from_slice(&low.to_bytes_be()[16..]); + bytes.rt().expect("Infallible conversion") + } +} + +// Add From implementation for Repr +impl From> for FeltPair { + fn from(value: Repr) -> Self { + value.into_inner().into() + } +} + +// Add From implementation for Repr +impl From> for FeltPair { + fn from(value: Repr) -> Self { + value.into_inner().into() + } +} diff --git a/crates/context/config/src/client/env/proxy.rs b/crates/context/config/src/client/env/proxy.rs index 6845903a0..74226627e 100644 --- a/crates/context/config/src/client/env/proxy.rs +++ b/crates/context/config/src/client/env/proxy.rs @@ -2,9 +2,10 @@ use crate::client::{CallClient, Environment}; mod mutate; mod query; - +mod types; use mutate::ContextProxyMutate; use query::ContextProxyQuery; +pub use types::*; #[derive(Copy, Clone, Debug)] pub enum ContextProxy {} diff --git a/crates/context/config/src/client/env/proxy/mutate.rs b/crates/context/config/src/client/env/proxy/mutate.rs index b07059020..14afae533 100644 --- a/crates/context/config/src/client/env/proxy/mutate.rs +++ b/crates/context/config/src/client/env/proxy/mutate.rs @@ -1,12 +1,17 @@ use ed25519_dalek::{Signer, SigningKey}; +use starknet::core::codec::Encode; +use starknet::signers::SigningKey as StarknetSigningKey; +use starknet_crypto::{poseidon_hash_many, Felt}; +use super::types::starknet::{StarknetProxyMutateRequest, StarknetSignedRequest}; use crate::client::env::{utils, Method}; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; use crate::client::transport::Transport; use crate::client::{CallClient, ClientError, Operation}; +use crate::repr::ReprTransmute; use crate::types::Signed; -use crate::{ProposalWithApprovals, ProxyMutateRequest}; +use crate::{ProposalWithApprovals, ProxyMutateRequest, Repr}; pub mod methods; @@ -49,21 +54,67 @@ impl Method for Mutate { impl Method for Mutate { type Returns = Option; - const METHOD: &'static str = "mutate"; fn encode(self) -> eyre::Result> { - // sign the params, encode it and return - // since you will have a `Vec` here, you can - // `Vec::with_capacity(32 * calldata.len())` and then - // extend the `Vec` with each `Felt::to_bytes_le()` - // when this `Vec` makes it to `StarknetTransport`, - // reconstruct the `Vec` from it - todo!() + // Derive ECDSA key for signing + let secret_scalar = Felt::from_bytes_be(&self.signing_key); + let signing_key = StarknetSigningKey::from_secret_scalar(secret_scalar); + let verifying_key = signing_key.verifying_key().scalar(); + let verifying_key_bytes = verifying_key.to_bytes_be(); + + // Create signer_id from ECDSA verifying key for signature verification + let signer_id = verifying_key_bytes + .rt() + .map_err(|_| eyre::eyre!("Infallible conversion"))?; + + // Create request with signer_id (no Repr) + let request = StarknetProxyMutateRequest::from((signer_id, self.raw_request)); + + // Serialize -> Hash -> Sign with ECDSA + let mut serialized_request = vec![]; + request.encode(&mut serialized_request)?; + let hash = poseidon_hash_many(&serialized_request); + let signature = signing_key.sign(&hash)?; + + let signed_request = StarknetSignedRequest { + payload: serialized_request, + signature_r: signature.r, + signature_s: signature.s, + }; + + let mut signed_request_serialized = vec![]; + signed_request.encode(&mut signed_request_serialized)?; + + let bytes: Vec = signed_request_serialized + .iter() + .flat_map(|felt| felt.to_bytes_be()) + .collect(); + + Ok(bytes) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.is_empty() { + return Ok(None); + } + + // Skip first 32 bytes (array length) + let response = &response[32..]; + + // Get proposal_id from the next 64 bytes (32 for high, 32 for low) + let mut proposal_bytes = [0u8; 32]; + proposal_bytes[..16].copy_from_slice(&response[16..32]); // Last 16 bytes of high + proposal_bytes[16..].copy_from_slice(&response[48..64]); // Last 16 bytes of low + let proposal_id = Repr::new(proposal_bytes.rt()?); + + // Get num_approvals from the last 32 bytes + let num_approvals = u32::from_be_bytes(response[64..][28..32].try_into()?) as usize; + + Ok(Some(ProposalWithApprovals { + proposal_id, + num_approvals, + })) } } diff --git a/crates/context/config/src/client/env/proxy/query/active_proposals.rs b/crates/context/config/src/client/env/proxy/query/active_proposals.rs index 1fa90a900..5e087f715 100644 --- a/crates/context/config/src/client/env/proxy/query/active_proposals.rs +++ b/crates/context/config/src/client/env/proxy/query/active_proposals.rs @@ -27,10 +27,28 @@ impl Method for ActiveProposalRequest { type Returns = u16; fn encode(self) -> eyre::Result> { - todo!() + // No parameters needed for this call + Ok(Vec::new()) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.len() != 32 { + return Err(eyre::eyre!( + "Invalid response length: expected 32 bytes, got {}", + response.len() + )); + } + + // Verify that all bytes except the last two are zero + if !response[..30].iter().all(|&b| b == 0) { + return Err(eyre::eyre!( + "Invalid response format: non-zero bytes in prefix" + )); + } + + // Take the last two bytes for u16 + let value = u16::from_be_bytes([response[30], response[31]]); + + Ok(value) } } diff --git a/crates/context/config/src/client/env/proxy/query/proposal.rs b/crates/context/config/src/client/env/proxy/query/proposal.rs index 64e90d635..136bef02c 100644 --- a/crates/context/config/src/client/env/proxy/query/proposal.rs +++ b/crates/context/config/src/client/env/proxy/query/proposal.rs @@ -1,6 +1,10 @@ use serde::Serialize; +use starknet::core::codec::{Decode, Encode}; +use starknet_crypto::Felt; use super::ProposalId; +use crate::client::env::proxy::starknet::CallData; +use crate::client::env::proxy::types::starknet::{StarknetProposal, StarknetProposalId}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -27,15 +31,61 @@ impl Method for ProposalRequest { } impl Method for ProposalRequest { - const METHOD: &'static str = "proposals"; + const METHOD: &'static str = "proposal"; type Returns = Option; fn encode(self) -> eyre::Result> { - todo!() + let starknet_id: StarknetProposalId = self.proposal_id.into(); + + let mut call_data = CallData::default(); + starknet_id.encode(&mut call_data)?; + + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.is_empty() { + return Ok(None); + } + + if response.len() % 32 != 0 { + return Err(eyre::eyre!( + "Invalid response length: {} bytes is not a multiple of 32", + response.len() + )); + } + + // Convert bytes to Felts + let mut felts = Vec::new(); + let chunks = response.chunks_exact(32); + + // Verify no remainder + if !chunks.remainder().is_empty() { + return Err(eyre::eyre!("Response length is not a multiple of 32 bytes")); + } + + for chunk in chunks { + let chunk_array: [u8; 32] = chunk + .try_into() + .map_err(|e| eyre::eyre!("Failed to convert chunk to array: {}", e))?; + felts.push(Felt::from_bytes_be(&chunk_array)); + } + + if felts.is_empty() { + return Ok(None); + } + + // First felt should be 1 for Some, 0 for None + match felts[0].to_bytes_be()[31] { + 0 => Ok(None), + 1 => { + // Decode the proposal starting from index 1 + let proposal = StarknetProposal::decode(&felts[1..]) + .map_err(|e| eyre::eyre!("Failed to decode proposal: {:?}", e))?; + Ok(Some(proposal.into())) + } + v => Err(eyre::eyre!("Invalid option discriminant: {}", v)), + } } } diff --git a/crates/context/config/src/client/env/proxy/query/proposal_approvals.rs b/crates/context/config/src/client/env/proxy/query/proposal_approvals.rs index 898b19085..96c73c5ed 100644 --- a/crates/context/config/src/client/env/proxy/query/proposal_approvals.rs +++ b/crates/context/config/src/client/env/proxy/query/proposal_approvals.rs @@ -1,6 +1,12 @@ use serde::Serialize; +use starknet::core::codec::{Decode, Encode}; +use starknet::core::types::Felt; use super::ProposalId; +use crate::client::env::proxy::starknet::CallData; +use crate::client::env::proxy::types::starknet::{ + StarknetProposalId, StarknetProposalWithApprovals, +}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -32,10 +38,46 @@ impl Method for ProposalApprovalsRequest { type Returns = ProposalWithApprovals; fn encode(self) -> eyre::Result> { - todo!() + // Convert ProposalId to StarknetProposalId + let starknet_id: StarknetProposalId = self.proposal_id.into(); + + // Encode both high and low parts + let mut call_data = CallData::default(); + starknet_id.encode(&mut call_data)?; + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.is_empty() { + return Err(eyre::eyre!("Empty response")); + } + + if response.len() % 32 != 0 { + return Err(eyre::eyre!( + "Invalid response length: {} bytes is not a multiple of 32", + response.len() + )); + } + + // Convert bytes to Felts + let mut felts = Vec::new(); + let chunks = response.chunks_exact(32); + + // Verify no remainder + if !chunks.remainder().is_empty() { + return Err(eyre::eyre!("Response length is not a multiple of 32 bytes")); + } + + for chunk in chunks { + let chunk_array: [u8; 32] = chunk + .try_into() + .map_err(|e| eyre::eyre!("Failed to convert chunk to array: {}", e))?; + felts.push(Felt::from_bytes_be(&chunk_array)); + } + + let approvals = StarknetProposalWithApprovals::decode(&felts) + .map_err(|e| eyre::eyre!("Failed to decode approvals: {:?}", e))?; + + Ok(approvals.into()) } } diff --git a/crates/context/config/src/client/env/proxy/query/proposal_approvers.rs b/crates/context/config/src/client/env/proxy/query/proposal_approvers.rs index 5e3c01df3..03e07124b 100644 --- a/crates/context/config/src/client/env/proxy/query/proposal_approvers.rs +++ b/crates/context/config/src/client/env/proxy/query/proposal_approvers.rs @@ -1,8 +1,12 @@ use std::mem; use serde::Serialize; +use starknet::core::codec::{Decode, Encode}; +use starknet::core::types::Felt; use super::ProposalId; +use crate::client::env::proxy::starknet::CallData; +use crate::client::env::proxy::types::starknet::{StarknetApprovers, StarknetProposalId}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -44,10 +48,45 @@ impl Method for ProposalApproversRequest { type Returns = Vec; fn encode(self) -> eyre::Result> { - todo!() + let starknet_id: StarknetProposalId = self.proposal_id.into(); + + let mut call_data = CallData::default(); + starknet_id.encode(&mut call_data)?; + + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.is_empty() { + return Ok(Vec::new()); + } + + if response.len() % 32 != 0 { + return Err(eyre::eyre!( + "Invalid response length: {} bytes is not a multiple of 32", + response.len() + )); + } + + // Convert bytes to Felts + let mut felts = Vec::new(); + let chunks = response.chunks_exact(32); + + // Verify no remainder + if !chunks.remainder().is_empty() { + return Err(eyre::eyre!("Response length is not a multiple of 32 bytes")); + } + + for chunk in chunks { + let chunk_array: [u8; 32] = chunk + .try_into() + .map_err(|e| eyre::eyre!("Failed to convert chunk to array: {}", e))?; + felts.push(Felt::from_bytes_be(&chunk_array)); + } + + let approvers = StarknetApprovers::decode(&felts) + .map_err(|e| eyre::eyre!("Failed to decode approvers: {:?}", e))?; + + Ok(approvers.into()) } } diff --git a/crates/context/config/src/client/env/proxy/query/proposals.rs b/crates/context/config/src/client/env/proxy/query/proposals.rs index 9bbb4ea22..1b8ddba91 100644 --- a/crates/context/config/src/client/env/proxy/query/proposals.rs +++ b/crates/context/config/src/client/env/proxy/query/proposals.rs @@ -1,5 +1,8 @@ use serde::Serialize; +use starknet::core::codec::{Decode, Encode}; +use starknet_crypto::Felt; +use crate::client::env::proxy::starknet::{CallData, StarknetProposals, StarknetProposalsRequest}; use crate::client::env::Method; use crate::client::protocol::near::Near; use crate::client::protocol::starknet::Starknet; @@ -31,10 +34,51 @@ impl Method for ProposalsRequest { type Returns = Vec; fn encode(self) -> eyre::Result> { - todo!() + let req = StarknetProposalsRequest { + offset: Felt::from(self.offset as u64), + length: Felt::from(self.length as u64), + }; + let mut call_data = CallData::default(); + req.encode(&mut call_data)?; + Ok(call_data.0) } - fn decode(_response: Vec) -> eyre::Result { - todo!() + fn decode(response: Vec) -> eyre::Result { + if response.is_empty() { + return Ok(Vec::new()); + } + + if response.len() % 32 != 0 { + return Err(eyre::eyre!( + "Invalid response length: {} bytes is not a multiple of 32", + response.len() + )); + } + + // Convert bytes to Felts + let mut felts = Vec::new(); + let chunks = response.chunks_exact(32); + + // Verify no remainder + if !chunks.remainder().is_empty() { + return Err(eyre::eyre!("Response length is not a multiple of 32 bytes")); + } + + for chunk in chunks { + let chunk_array: [u8; 32] = chunk + .try_into() + .map_err(|e| eyre::eyre!("Failed to convert chunk to array: {}", e))?; + felts.push(Felt::from_bytes_be(&chunk_array)); + } + + if felts.is_empty() { + return Ok(Vec::new()); + } + + // Decode the array + let proposals = StarknetProposals::decode(&felts) + .map_err(|e| eyre::eyre!("Failed to decode proposals: {:?}", e))?; + + Ok(proposals.into()) } } diff --git a/crates/context/config/src/client/env/proxy/types.rs b/crates/context/config/src/client/env/proxy/types.rs new file mode 100644 index 000000000..a8dc8cd36 --- /dev/null +++ b/crates/context/config/src/client/env/proxy/types.rs @@ -0,0 +1 @@ +pub mod starknet; diff --git a/crates/context/config/src/client/env/proxy/types/starknet.rs b/crates/context/config/src/client/env/proxy/types/starknet.rs new file mode 100644 index 000000000..28672c1c7 --- /dev/null +++ b/crates/context/config/src/client/env/proxy/types/starknet.rs @@ -0,0 +1,390 @@ +use starknet::core::codec::{Decode, Encode, FeltWriter}; +use starknet::core::types::{Felt, U256}; + +use crate::repr::{Repr, ReprBytes, ReprTransmute}; +use crate::types::{ContextIdentity, ProposalId, SignerId}; +use crate::{ + Proposal, ProposalAction, ProposalApprovalWithSigner, ProposalWithApprovals, ProxyMutateRequest, +}; + +#[derive(Debug, Encode, Decode)] +pub struct FeltPair { + pub high: Felt, + pub low: Felt, +} + +#[derive(Debug, Encode, Decode)] +pub struct StarknetIdentity(pub FeltPair); + +#[derive(Debug, Encode, Decode)] +pub struct StarknetProposalId(pub FeltPair); + +#[derive(Debug, Encode, Decode)] +pub struct StarknetU256(pub FeltPair); + +#[derive(Debug, Encode, Decode)] +pub struct StarknetProposal { + pub proposal_id: StarknetProposalId, + pub author_id: StarknetIdentity, + pub actions: StarknetProposalActionWithArgs, +} + +#[derive(Debug, Encode, Decode)] +pub struct StarknetConfirmationRequest { + pub proposal_id: StarknetProposalId, + pub signer_id: StarknetIdentity, + pub added_timestamp: Felt, +} + +#[derive(Debug, Encode, Decode)] +pub struct StarknetProxyMutateRequest { + pub signer_id: StarknetIdentity, + pub kind: StarknetProxyMutateRequestKind, +} + +#[derive(Debug, Encode, Decode)] +pub enum StarknetProxyMutateRequestKind { + Propose(StarknetProposal), + Approve(StarknetConfirmationRequest), +} + +#[derive(Debug, Encode, Decode)] +pub enum StarknetProposalActionWithArgs { + ExternalFunctionCall(Felt, Felt, Vec), + Transfer(Felt, StarknetU256), + SetNumApprovals(Felt), + SetActiveProposalsLimit(Felt), + SetContextValue(Vec, Vec), +} + +#[derive(Debug, Encode, Decode)] +pub struct StarknetSignedRequest { + pub payload: Vec, + pub signature_r: Felt, + pub signature_s: Felt, +} + +#[derive(Debug, Decode)] +pub struct StarknetProposalWithApprovals { + pub proposal_id: StarknetProposalId, + pub num_approvals: Felt, +} + +#[derive(Debug, Decode)] +pub struct StarknetApprovers { + pub approvers: Vec, +} + +#[derive(Debug, Decode)] +pub struct StarknetProposals { + pub proposals: Vec, +} + +impl From for Vec { + fn from(value: StarknetProposals) -> Self { + value.proposals.into_iter().map(Into::into).collect() + } +} + +// Conversions for StarknetIdentity +impl From for FeltPair { + fn from(value: SignerId) -> Self { + let bytes = value.as_bytes(); + let mid_point = bytes.len().checked_div(2).expect("Length should be even"); + let (high_bytes, low_bytes) = bytes.split_at(mid_point); + FeltPair { + high: Felt::from_bytes_be_slice(high_bytes), + low: Felt::from_bytes_be_slice(low_bytes), + } + } +} + +impl From for SignerId { + fn from(value: FeltPair) -> Self { + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&value.high.to_bytes_be()[16..]); + bytes[16..].copy_from_slice(&value.low.to_bytes_be()[16..]); + bytes.rt().expect("Infallible conversion") + } +} + +impl From for StarknetIdentity { + fn from(value: SignerId) -> Self { + StarknetIdentity(value.into()) + } +} + +impl From for SignerId { + fn from(value: StarknetIdentity) -> Self { + value.0.into() + } +} + +// Conversions for ProposalId +impl From for FeltPair { + fn from(value: ProposalId) -> Self { + let bytes = value.as_bytes(); + let mid_point = bytes.len().checked_div(2).expect("Length should be even"); + let (high_bytes, low_bytes) = bytes.split_at(mid_point); + FeltPair { + high: Felt::from_bytes_be_slice(high_bytes), + low: Felt::from_bytes_be_slice(low_bytes), + } + } +} + +impl From for StarknetProposalId { + fn from(value: ProposalId) -> Self { + StarknetProposalId(value.into()) + } +} + +impl From> for StarknetProposalId { + fn from(value: Repr) -> Self { + StarknetProposalId((*value).into()) + } +} + +impl From> for StarknetIdentity { + fn from(value: Repr) -> Self { + StarknetIdentity((*value).into()) + } +} + +// Conversions for U256 +impl From for StarknetU256 { + fn from(value: U256) -> Self { + StarknetU256(FeltPair { + high: Felt::from(value.high()), + low: Felt::from(value.low()), + }) + } +} + +impl From for StarknetU256 { + fn from(value: u128) -> Self { + StarknetU256(FeltPair { + high: Felt::ZERO, + low: Felt::from(value), + }) + } +} + +// Conversions for ProxyMutateRequest +impl From<(SignerId, ProxyMutateRequest)> for StarknetProxyMutateRequest { + fn from((signer_id, request): (SignerId, ProxyMutateRequest)) -> Self { + StarknetProxyMutateRequest { + signer_id: signer_id.into(), + kind: request.into(), + } + } +} + +impl From for StarknetProxyMutateRequestKind { + fn from(request: ProxyMutateRequest) -> Self { + match request { + ProxyMutateRequest::Propose { proposal } => { + StarknetProxyMutateRequestKind::Propose(proposal.into()) + } + ProxyMutateRequest::Approve { approval } => { + StarknetProxyMutateRequestKind::Approve(approval.into()) + } + } + } +} + +// Conversions for Proposal +impl From for StarknetProposal { + fn from(proposal: Proposal) -> Self { + StarknetProposal { + proposal_id: proposal.id.into(), + author_id: proposal.author_id.into(), + actions: proposal.actions.into(), + } + } +} + +impl From for Proposal { + fn from(value: StarknetProposal) -> Self { + Proposal { + id: Repr::new(value.proposal_id.into()), + author_id: Repr::new(value.author_id.into()), + actions: vec![value.actions.into()], + } + } +} + +// Conversions for ProposalApproval +impl From for StarknetConfirmationRequest { + fn from(approval: ProposalApprovalWithSigner) -> Self { + StarknetConfirmationRequest { + proposal_id: approval.proposal_id.into(), + signer_id: approval.signer_id.into(), + added_timestamp: Felt::from(approval.added_timestamp), + } + } +} + +// Conversions for Actions +impl From> for StarknetProposalActionWithArgs { + fn from(actions: Vec) -> Self { + let action = actions + .into_iter() + .next() + .expect("At least one action required"); + match action { + ProposalAction::ExternalFunctionCall { + receiver_id, + method_name, + args, + .. + } => { + let args_vec: Vec = serde_json::from_str(&args).unwrap_or_default(); + let felt_args = args_vec + .iter() + .map(|arg| { + if arg.starts_with("0x") { + Felt::from_hex_unchecked(arg) + } else { + Felt::from_bytes_be_slice(arg.as_bytes()) + } + }) + .collect(); + + StarknetProposalActionWithArgs::ExternalFunctionCall( + Felt::from_bytes_be_slice(receiver_id.as_bytes()), + Felt::from_bytes_be_slice(method_name.as_bytes()), + felt_args, + ) + } + ProposalAction::Transfer { + receiver_id, + amount, + } => StarknetProposalActionWithArgs::Transfer( + Felt::from_bytes_be_slice(receiver_id.as_bytes()), + amount.into(), + ), + ProposalAction::SetNumApprovals { num_approvals } => { + StarknetProposalActionWithArgs::SetNumApprovals(Felt::from(num_approvals)) + } + ProposalAction::SetActiveProposalsLimit { + active_proposals_limit, + } => StarknetProposalActionWithArgs::SetActiveProposalsLimit(Felt::from( + active_proposals_limit, + )), + ProposalAction::SetContextValue { key, value } => { + StarknetProposalActionWithArgs::SetContextValue( + key.chunks(16).map(Felt::from_bytes_be_slice).collect(), + value.chunks(16).map(Felt::from_bytes_be_slice).collect(), + ) + } + } + } +} + +impl From for ProposalAction { + fn from(action: StarknetProposalActionWithArgs) -> Self { + match action { + StarknetProposalActionWithArgs::ExternalFunctionCall(contract, selector, calldata) => { + ProposalAction::ExternalFunctionCall { + receiver_id: format!("0x{}", hex::encode(contract.to_bytes_be())), + method_name: format!("0x{}", hex::encode(selector.to_bytes_be())), + args: calldata + .iter() + .map(|felt| format!("0x{}", hex::encode(felt.to_bytes_be()))) + .collect::>() + .join(","), + deposit: 0, + gas: 0, + } + } + StarknetProposalActionWithArgs::Transfer(receiver, amount) => { + let FeltPair { high, low } = amount.0; + ProposalAction::Transfer { + receiver_id: format!("0x{}", hex::encode(receiver.to_bytes_be())), + amount: u128::from_be_bytes(low.to_bytes_be()[16..32].try_into().unwrap()) + + (u128::from_be_bytes(high.to_bytes_be()[16..32].try_into().unwrap()) + << 64), + } + } + StarknetProposalActionWithArgs::SetNumApprovals(num) => { + ProposalAction::SetNumApprovals { + num_approvals: u32::from_be_bytes( + num.to_bytes_be()[28..32].try_into().unwrap(), + ), + } + } + StarknetProposalActionWithArgs::SetActiveProposalsLimit(limit) => { + ProposalAction::SetActiveProposalsLimit { + active_proposals_limit: u32::from_be_bytes( + limit.to_bytes_be()[28..32].try_into().unwrap(), + ), + } + } + StarknetProposalActionWithArgs::SetContextValue(key, value) => { + ProposalAction::SetContextValue { + key: key.iter().flat_map(|felt| felt.to_bytes_be()).collect(), + value: value.iter().flat_map(|felt| felt.to_bytes_be()).collect(), + } + } + } + } +} + +impl From for ProposalWithApprovals { + fn from(value: StarknetProposalWithApprovals) -> Self { + ProposalWithApprovals { + proposal_id: Repr::new(value.proposal_id.into()), + num_approvals: u32::from_be_bytes( + value.num_approvals.to_bytes_be()[28..32] + .try_into() + .unwrap(), + ) as usize, + } + } +} + +impl From for Vec { + fn from(value: StarknetApprovers) -> Self { + value + .approvers + .into_iter() + .map(|identity| { + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&identity.0.high.to_bytes_be()[16..]); + bytes[16..].copy_from_slice(&identity.0.low.to_bytes_be()[16..]); + bytes.rt().expect("Infallible conversion") + }) + .collect() + } +} + +#[derive(Default, Debug)] +pub struct CallData(pub Vec); + +impl FeltWriter for CallData { + fn write(&mut self, felt: Felt) { + self.0.extend(felt.to_bytes_be()) + } +} + +#[derive(Debug, Encode)] +pub struct StarknetProposalsRequest { + pub offset: Felt, + pub length: Felt, +} + +impl From for ProposalId { + fn from(value: FeltPair) -> Self { + let mut bytes = [0u8; 32]; + bytes[..16].copy_from_slice(&value.high.to_bytes_be()[16..]); + bytes[16..].copy_from_slice(&value.low.to_bytes_be()[16..]); + bytes.rt().expect("Infallible conversion") + } +} + +impl From for ProposalId { + fn from(value: StarknetProposalId) -> Self { + value.0.into() + } +} diff --git a/crates/context/config/src/client/protocol/starknet.rs b/crates/context/config/src/client/protocol/starknet.rs index c3a771088..9a940faea 100644 --- a/crates/context/config/src/client/protocol/starknet.rs +++ b/crates/context/config/src/client/protocol/starknet.rs @@ -2,10 +2,14 @@ use core::str::FromStr; use std::borrow::Cow; use std::collections::BTreeMap; use std::sync::Arc; +use std::time::{Duration, Instant}; use serde::{Deserialize, Serialize}; -use starknet::accounts::{Account, ExecutionEncoding, SingleOwnerAccount}; -use starknet::core::types::{BlockId, BlockTag, Call, Felt, FunctionCall}; +use starknet::accounts::{Account, ConnectedAccount, ExecutionEncoding, SingleOwnerAccount}; +use starknet::core::codec::Decode; +use starknet::core::types::{ + BlockId, BlockTag, Call, ExecutionResult, Felt, FunctionCall, TransactionFinalityStatus, +}; use starknet::core::utils::get_selector_from_name; use starknet::providers::jsonrpc::HttpTransport; use starknet::providers::{JsonRpcClient, Provider, Url}; @@ -13,6 +17,7 @@ use starknet::signers::{LocalWallet, SigningKey}; use thiserror::Error; use super::Protocol; +use crate::client::env::proxy::starknet::StarknetProposalWithApprovals; use crate::client::transport::{AssociatedTransport, Operation, Transport, TransportRequest}; #[derive(Copy, Clone, Debug)] @@ -219,13 +224,10 @@ impl Network { let calldata: Vec = if args.is_empty() { vec![] } else { - args.chunks(32) + args.chunks_exact(32) .map(|chunk| { - let mut padded_chunk = [0_u8; 32]; - for (i, byte) in chunk.iter().enumerate() { - padded_chunk[i] = *byte; - } - Felt::from_bytes_be(&padded_chunk) + let chunk_array: [u8; 32] = chunk.try_into().expect("chunk should be 32 bytes"); + Felt::from_bytes_be(&chunk_array) }) .collect() }; @@ -238,20 +240,19 @@ impl Network { let response = self .client - .call(&function_call, BlockId::Tag(BlockTag::Latest)) - .await; - - response.map_or( - Err(StarknetError::InvalidResponse { + .call(&function_call, BlockId::Tag(BlockTag::Pending)) + .await + .map_err(|e| StarknetError::Custom { operation: ErrorOperation::Query, - }), - |result| { - Ok(result - .into_iter() - .flat_map(|felt| felt.to_bytes_be().to_vec()) - .collect::>()) - }, - ) + reason: format!("Failed to query state: {}", e), + })?; + // Convert response to bytes + let response_bytes = response + .into_iter() + .flat_map(|felt| felt.to_bytes_be()) + .collect::>(); + + Ok(response_bytes) } async fn mutate( @@ -271,13 +272,10 @@ impl Network { let calldata: Vec = if args.is_empty() { vec![] } else { - args.chunks(32) + args.chunks_exact(32) .map(|chunk| { - let mut padded_chunk = [0_u8; 32]; - for (i, byte) in chunk.iter().enumerate() { - padded_chunk[i] = *byte; - } - Felt::from_bytes_be(&padded_chunk) + let chunk_array: [u8; 32] = chunk.try_into().expect("chunk should be 32 bytes"); + Felt::from_bytes_be(&chunk_array) }) .collect() }; @@ -312,9 +310,107 @@ impl Network { }]) .send() .await - .unwrap(); + .map_err(|e| StarknetError::Custom { + operation: ErrorOperation::Mutate, + reason: format!("Failed to send transaction: {}", e), + })?; + + let sent_at = Instant::now(); + let timeout = Duration::from_secs(60); + + let receipt = loop { + let result = account + .provider() + .get_transaction_receipt(response.transaction_hash) + .await; + + match result { + Ok(receipt) => { + if let starknet::core::types::TransactionReceipt::Invoke(invoke_receipt) = + &receipt.receipt + { + match ( + invoke_receipt.finality_status, + &invoke_receipt.execution_result, + ) { + ( + TransactionFinalityStatus::AcceptedOnL2, + ExecutionResult::Succeeded, + ) + | ( + TransactionFinalityStatus::AcceptedOnL1, + ExecutionResult::Succeeded, + ) => { + break receipt; + } + (_, ExecutionResult::Reverted { reason }) => { + return Err(StarknetError::Custom { + operation: ErrorOperation::Mutate, + reason: format!("Transaction reverted: {}", reason), + }); + } + } + } + } + Err(err) => { + if !err.to_string().contains("TransactionHashNotFound") { + return Err(StarknetError::Custom { + operation: ErrorOperation::Mutate, + reason: err.to_string(), + }); + } + } + } - let transaction_hash: Vec = vec![response.transaction_hash.to_bytes_be()[0]]; - Ok(transaction_hash) + if sent_at.elapsed() > timeout { + return Err(StarknetError::TransactionTimeout); + } + + std::thread::sleep(Duration::from_millis(1000)); + }; + // Process the receipt + match receipt.receipt { + starknet::core::types::TransactionReceipt::Invoke(invoke_receipt) => { + match invoke_receipt.execution_result { + ExecutionResult::Succeeded => { + // Process events and look for proposal creation event + for event in invoke_receipt.events.iter() { + // Check if this is a proposal creation event by its key + const PROPOSAL_CREATED_KEY: &str = "ProposalCreated"; + if !event.keys.is_empty() + && event.keys[0] + == get_selector_from_name(PROPOSAL_CREATED_KEY) + .expect("Failed to get selector for ProposalCreated") + { + if event.data.is_empty() { + return Ok(vec![]); + } + + let result = StarknetProposalWithApprovals::decode(&event.data) + .map_err(|e| StarknetError::Custom { + operation: ErrorOperation::Query, + reason: format!("Failed to decode event: {:?}", e), + })?; + let mut encoded = vec![0u8; 32]; + encoded.extend_from_slice(&result.proposal_id.0.high.to_bytes_be()); + encoded.extend_from_slice(&result.proposal_id.0.low.to_bytes_be()); + encoded.extend_from_slice(&result.num_approvals.to_bytes_be()); + return Ok(encoded); + } + } + // If we didn't find a proposal creation event, return empty vec + Ok(vec![]) + } + ExecutionResult::Reverted { reason } => Err(StarknetError::Custom { + operation: ErrorOperation::Mutate, + reason: format!("Transaction reverted: {}", reason), + }), + } + } + starknet::core::types::TransactionReceipt::L1Handler(_) + | starknet::core::types::TransactionReceipt::Declare(_) + | starknet::core::types::TransactionReceipt::Deploy(_) + | starknet::core::types::TransactionReceipt::DeployAccount(_) => Ok(vec![0]), + } } } diff --git a/crates/context/config/src/types.rs b/crates/context/config/src/types.rs index 7f2e957a2..a193e3547 100644 --- a/crates/context/config/src/types.rs +++ b/crates/context/config/src/types.rs @@ -307,6 +307,7 @@ impl ReprBytes for VerifyingKey { pub enum Capability { ManageApplication, ManageMembers, + Proxy, } #[derive(Eq, Debug, Clone, PartialEq, Serialize, Deserialize)] diff --git a/crates/merod/src/cli/init.rs b/crates/merod/src/cli/init.rs index 9ef4c6e96..751a32532 100644 --- a/crates/merod/src/cli/init.rs +++ b/crates/merod/src/cli/init.rs @@ -266,7 +266,7 @@ impl InitCommand { contract_id: match self.protocol { ConfigProtocol::Near => "calimero-context-config.testnet".parse()?, ConfigProtocol::Starknet => { - "0x1ee8182d5dd595be9797ccae1488bdf84b19a0f05a93ce6148b0efae04f4568" + "0x1b991ee006e2d1e372ab96d0a957401fa200358f317b681df2948f30e17c29c" .parse()? } }, diff --git a/crates/server/src/admin/handlers/proposals.rs b/crates/server/src/admin/handlers/proposals.rs index 70afddcdd..2b81080a1 100644 --- a/crates/server/src/admin/handlers/proposals.rs +++ b/crates/server/src/admin/handlers/proposals.rs @@ -1,10 +1,9 @@ use std::sync::Arc; -use std::vec; use axum::extract::Path; use axum::response::IntoResponse; use axum::{Extension, Json}; -use calimero_context_config::repr::{Repr, ReprBytes, ReprTransmute}; +use calimero_context_config::repr::{Repr, ReprTransmute}; use calimero_context_config::types::{ContextIdentity, ProposalId}; use calimero_context_config::{Proposal as ProposalConfig, ProposalWithApprovals}; use calimero_primitives::context::ContextId; @@ -16,7 +15,7 @@ use crate::AdminState; //todo split it up into separate files -#[derive(Debug, Deserialize, Serialize)] +#[derive(Debug, Deserialize, Serialize, Copy, Clone)] #[serde(rename_all = "camelCase")] pub enum ActionType { ExternalFunctionCall,