From fb72520d826bbe5055f92cccd1aea8ad0a289fec Mon Sep 17 00:00:00 2001 From: Morgan Mccauley Date: Fri, 29 Sep 2023 13:55:05 +1300 Subject: [PATCH 1/6] refactor: Move common deps to `workspace.dependencies` --- Cargo.toml | 8 ++++++++ circulating-supply/Cargo.toml | 6 +++--- database/Cargo.toml | 8 ++++---- indexer/Cargo.toml | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 49e40e57..b46db784 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,3 +4,11 @@ members = [ "database", "circulating-supply" ] + +[workspace.dependencies] +near-jsonrpc-client = "0.5.0" +near-primitives = "0.16.0" +near-crypto = "0.16.0" +near-chain-configs = "0.16.0" +near-indexer-primitives = "0.16.0" +near-jsonrpc-primitives = "0.16.0" diff --git a/circulating-supply/Cargo.toml b/circulating-supply/Cargo.toml index ca4fd329..a685b6e7 100644 --- a/circulating-supply/Cargo.toml +++ b/circulating-supply/Cargo.toml @@ -21,8 +21,8 @@ tracing-stackdriver = "0.7.2" # GCP logs tracing-subscriber = "0.3.15" uint = { version = "0.8.3", default-features = false } -near-indexer-primitives = "0.16.0" -near-jsonrpc-client = "0.5.0" -near-jsonrpc-primitives = "0.16.0" +near-indexer-primitives = { workspace = true } +near-jsonrpc-client = { workspace = true } +near-jsonrpc-primitives = { workspace = true } explorer-database = { path = '../database' } diff --git a/database/Cargo.toml b/database/Cargo.toml index ed4100e1..d4e7585c 100644 --- a/database/Cargo.toml +++ b/database/Cargo.toml @@ -24,10 +24,10 @@ tracing = "0.1.13" tokio = { version = "1.1", features = ["sync", "time"] } actix-diesel = { git = "https://github.com/frol/actix-diesel", rev = "3a001986c89dfabfc3c448d8bae28525101b4992" } -near-indexer-primitives = "0.16.0" -near-primitives = "0.16.0" -near-crypto = "0.16.0" -near-chain-configs = "0.16.0" +near-indexer-primitives = { workspace = true } +near-primitives = { workspace = true } +near-crypto = { workspace = true } +near-chain-configs = { workspace = true } [features] default = [] diff --git a/indexer/Cargo.toml b/indexer/Cargo.toml index 7530ac6c..e7adafa0 100644 --- a/indexer/Cargo.toml +++ b/indexer/Cargo.toml @@ -33,7 +33,7 @@ tracing-stackdriver = "0.7.2" # GCP logs tracing-subscriber = "0.3.15" uint = { version = "0.8.3", default-features = false } -near-jsonrpc-client = "0.5.0" +near-jsonrpc-client = { workspace = true } near-lake-framework = "0.7.1" explorer-database = { path = "../database" } From 90ae72748a6e32d00c189974e646ad5c0e29e540 Mon Sep 17 00:00:00 2001 From: Morgan Mccauley Date: Fri, 29 Sep 2023 13:55:47 +1300 Subject: [PATCH 2/6] chore: Bump `near` deps --- Cargo.lock | 545 +++++++++++++++++++++++++++++++++++++++++------------ Cargo.toml | 12 +- 2 files changed, 428 insertions(+), 129 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e6894bf..9b112c87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -213,7 +213,7 @@ dependencies = [ "serde_urlencoded", "smallvec", "socket2", - "time 0.3.21", + "time", "url", ] @@ -287,6 +287,69 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anstream" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6cd65a4b849ace0b7f6daeebcc1a1d111282227ca745458c61dbf670e52a597" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" + +[[package]] +name = "anstyle-parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0238ca56c96dfa37bdf7c373c8886dd591322500aceeeccdb2216fe06dc2f796" +dependencies = [ + "anstyle", + "windows-sys 0.48.0", +] + [[package]] name = "anyhow" version = "1.0.69" @@ -393,7 +456,7 @@ dependencies = [ "http", "hyper", "ring", - "time 0.3.21", + "time", "tokio", "tower", "tracing", @@ -661,7 +724,7 @@ dependencies = [ "percent-encoding", "regex", "sha2 0.10.2", - "time 0.3.21", + "time", "tracing", ] @@ -682,7 +745,7 @@ dependencies = [ "percent-encoding", "regex", "sha2 0.10.2", - "time 0.3.21", + "time", "tracing", ] @@ -953,7 +1016,7 @@ dependencies = [ "itoa", "num-integer", "ryu", - "time 0.3.21", + "time", ] [[package]] @@ -966,7 +1029,7 @@ dependencies = [ "itoa", "num-integer", "ryu", - "time 0.3.21", + "time", ] [[package]] @@ -1130,12 +1193,12 @@ dependencies = [ [[package]] name = "borsh" -version = "0.9.3" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" dependencies = [ - "borsh-derive 0.9.3", - "hashbrown 0.11.2", + "borsh-derive 0.10.3", + "hashbrown 0.12.3", ] [[package]] @@ -1165,12 +1228,12 @@ dependencies = [ [[package]] name = "borsh-derive" -version = "0.9.3" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" dependencies = [ - "borsh-derive-internal 0.9.3", - "borsh-schema-derive-internal 0.9.3", + "borsh-derive-internal 0.10.3", + "borsh-schema-derive-internal 0.10.3", "proc-macro-crate", "proc-macro2", "syn 1.0.109", @@ -1200,9 +1263,9 @@ dependencies = [ [[package]] name = "borsh-derive-internal" -version = "0.9.3" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" dependencies = [ "proc-macro2", "quote", @@ -1233,9 +1296,9 @@ dependencies = [ [[package]] name = "borsh-schema-derive-internal" -version = "0.9.3" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" dependencies = [ "proc-macro2", "quote", @@ -1360,11 +1423,12 @@ checksum = "3a4f925191b4367301851c6d99b09890311d74b0d43f274c0b34c86d308a3663" [[package]] name = "cc" -version = "1.0.73" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -1381,16 +1445,17 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ - "libc", - "num-integer", + "android-tzdata", + "iana-time-zone", + "js-sys", "num-traits", "serde", - "time 0.1.44", - "winapi", + "wasm-bindgen", + "windows-targets", ] [[package]] @@ -1432,15 +1497,37 @@ checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" dependencies = [ "atty", "bitflags", - "clap_derive", - "clap_lex", - "indexmap", + "clap_derive 3.1.18", + "clap_lex 0.2.0", + "indexmap 1.9.2", "lazy_static", "strsim", "termcolor", "textwrap", ] +[[package]] +name = "clap" +version = "4.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +dependencies = [ + "clap_builder", + "clap_derive 4.4.2", +] + +[[package]] +name = "clap_builder" +version = "4.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +dependencies = [ + "anstream", + "anstyle", + "clap_lex 0.5.1", + "strsim", +] + [[package]] name = "clap_derive" version = "3.1.18" @@ -1454,6 +1541,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "clap_derive" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +dependencies = [ + "heck 0.4.0", + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "clap_lex" version = "0.2.0" @@ -1463,6 +1562,18 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clap_lex" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" + +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "console" version = "0.15.5" @@ -1489,7 +1600,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "344adc371239ef32293cb1c4fe519592fcf21206c79c02854320afcdf3ab4917" dependencies = [ "percent-encoding", - "time 0.3.21", + "time", "version_check", ] @@ -1625,6 +1736,16 @@ dependencies = [ "darling_macro 0.14.1", ] +[[package]] +name = "darling" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core 0.20.3", + "darling_macro 0.20.3", +] + [[package]] name = "darling_core" version = "0.13.4" @@ -1653,6 +1774,20 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.18", +] + [[package]] name = "darling_macro" version = "0.13.4" @@ -1675,6 +1810,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core 0.20.3", + "quote", + "syn 2.0.18", +] + [[package]] name = "derive_arbitrary" version = "1.2.3" @@ -1872,6 +2018,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "event-listener" version = "2.5.2" @@ -2123,7 +2275,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.2", "slab", "tokio", "tokio-util 0.7.2", @@ -2141,18 +2293,18 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash 0.7.6", ] [[package]] name = "hashbrown" -version = "0.12.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" [[package]] name = "heck" @@ -2294,6 +2446,29 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -2322,7 +2497,7 @@ dependencies = [ "borsh 0.7.2", "cached", "chrono", - "clap", + "clap 3.1.18", "dotenv", "explorer-database", "futures", @@ -2352,6 +2527,18 @@ checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", + "serde", ] [[package]] @@ -2440,9 +2627,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.125" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "local-channel" @@ -2528,14 +2715,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.3" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.36.1", + "windows-sys 0.48.0", ] [[package]] @@ -2564,20 +2751,19 @@ dependencies = [ [[package]] name = "near-account-id" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d622858e0e2717ad1f32a19edaa9f9db7c8e8ce83993bd2a97717800c2f311e3" +checksum = "dc0cb40869cab7f5232f934f45db35bffe0f2d2a7cb0cd0346202fbe4ebf2dd7" dependencies = [ - "arbitrary", - "borsh 0.9.3", + "borsh 0.10.3", "serde", ] [[package]] name = "near-chain-configs" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1129d5755234986fd402a3fd8c16b0c2fbf0e2d662d20c68b0ed2103507586" +checksum = "c4f9a1c805846237d56f99b328ba6ab77e5d43ef59aaaf8d2a41d42fdc708a7b" dependencies = [ "anyhow", "chrono", @@ -2597,21 +2783,24 @@ dependencies = [ [[package]] name = "near-config-utils" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "983f97adc4ff870436005d8af9b8fde2c3dc575abe7b6043cc8504c9add3fe30" +checksum = "5523e7dce493c45bc3241eb3100d943ec471852f9b1f84b46a34789eadf17031" dependencies = [ + "anyhow", "json_comments", + "thiserror", + "tracing", ] [[package]] name = "near-crypto" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755c64f602298a79046804f2047f317f3ae629e37c506eec2fa619b60682f677" +checksum = "ff6b382b626e7e0cd372d027c6672ac97b4b6ee6114288c9e58d8180b935d315" dependencies = [ "blake2", - "borsh 0.9.3", + "borsh 0.10.3", "bs58", "c2-chacha", "curve25519-dalek", @@ -2631,11 +2820,20 @@ dependencies = [ "thiserror", ] +[[package]] +name = "near-fmt" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44c842c6cfcd9b8c387cccd4cd0619a5f21920cde5d5c292af3cc5d40510672" +dependencies = [ + "near-primitives-core 0.17.0", +] + [[package]] name = "near-indexer-primitives" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5060b26efd8a25d575dd3c06af1f347b0d8171e67be209078c90d74224ffb2b" +checksum = "b76c87827dcae78979748c3864d209d5906163958a01551afc2092a8ad56fa39" dependencies = [ "near-primitives", "serde", @@ -2644,11 +2842,11 @@ dependencies = [ [[package]] name = "near-jsonrpc-client" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d24877edc9cda92f76903b4ba40714733314438ed0462ba9c3b11324b50c7fa" +checksum = "118f44c02ad211db805c1370ad3ff26576af6ff554093c9fece1b835d29d233a" dependencies = [ - "borsh 0.9.3", + "borsh 0.10.3", "lazy_static", "log", "near-chain-configs", @@ -2663,15 +2861,15 @@ dependencies = [ [[package]] name = "near-jsonrpc-primitives" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510900763eb45e52037c9e1ff6c00b1bcd48bdab5ec4cd43726c087f45dc5a09" +checksum = "97b2934b5ab243e25e951c984525ba0aff0e719ed915c988c5195405aa0f6987" dependencies = [ "arbitrary", "near-chain-configs", "near-crypto", "near-primitives", - "near-rpc-error-macro 0.16.0", + "near-rpc-error-macro 0.17.0", "serde", "serde_json", "thiserror", @@ -2679,9 +2877,9 @@ dependencies = [ [[package]] name = "near-lake-framework" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31b733c11d21cb97f66721ebea525c1fd4fb6fdd4aeab5c7c9562363230f071e" +checksum = "5fbfc3d7c294aa144c3a1817452931e91ce045ee1cf2e34b7b439d4695073634" dependencies = [ "anyhow", "async-stream", @@ -2703,15 +2901,15 @@ dependencies = [ [[package]] name = "near-o11y" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7cf8061a5752132480327a7b8ecc6154068143f21054fea8ae8baa81705eea" +checksum = "af7d35397b02b131c188c72f3885e97daeccab134ec2fc8cc0073a94cf1cfe19" dependencies = [ "actix", "atty", - "clap", + "clap 4.4.6", "near-crypto", - "near-primitives-core 0.16.0", + "near-primitives-core 0.17.0", "once_cell", "opentelemetry", "opentelemetry-otlp", @@ -2729,12 +2927,12 @@ dependencies = [ [[package]] name = "near-primitives" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffe400b364ead6c942bfa6a0e0e5079cada75b9813218dfe6bf358f037865c1" +checksum = "05f7051aaf199adc4d068620fca6d5f70f906a1540d03a8bb3701271f8881835" dependencies = [ "arbitrary", - "borsh 0.9.3", + "borsh 0.10.3", "bytesize", "cfg-if 1.0.0", "chrono", @@ -2743,11 +2941,11 @@ dependencies = [ "enum-map", "hex", "near-crypto", - "near-o11y", - "near-primitives-core 0.16.0", - "near-rpc-error-macro 0.16.0", + "near-fmt", + "near-primitives-core 0.17.0", + "near-rpc-error-macro 0.17.0", "near-stdx", - "near-vm-errors 0.16.0", + "near-vm-errors 0.17.0", "num-rational", "once_cell", "primitive-types", @@ -2755,10 +2953,12 @@ dependencies = [ "reed-solomon-erasure", "serde", "serde_json", + "serde_with", "serde_yaml", "smart-default", "strum", "thiserror", + "time", "tracing", ] @@ -2782,13 +2982,13 @@ dependencies = [ [[package]] name = "near-primitives-core" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a07b4055d890a96efd2bf47739a1351b229facc461f77687020950388514c36a" +checksum = "775fec19ef51a341abdbf792a9dda5b4cb89f488f681b2fd689b9321d24db47b" dependencies = [ "arbitrary", - "base64 0.13.0", - "borsh 0.9.3", + "base64 0.21.0", + "borsh 0.10.3", "bs58", "derive_more", "enum-map", @@ -2796,6 +2996,7 @@ dependencies = [ "num-rational", "serde", "serde_repr", + "serde_with", "sha2 0.10.2", "strum", "thiserror", @@ -2816,13 +3017,13 @@ dependencies = [ [[package]] name = "near-rpc-error-core" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c867980c023741a39509a58fffe3f700f18de7600b08be54299c2fc4abc52c" +checksum = "84c1eda300e2e78f4f945ae58117d49e806899f4a51ee2faa09eda5ebc2e6571" dependencies = [ "quote", "serde", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] @@ -2841,14 +3042,14 @@ dependencies = [ [[package]] name = "near-rpc-error-macro" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7120da984232a9b8cbda7ddf48ba28c66f045ffb369fed85c0b9ce147398bb" +checksum = "31d2dadd765101c77e664029dd6fbec090e696877d4ae903c620d02ceda4969a" dependencies = [ "fs2", - "near-rpc-error-core 0.16.0", + "near-rpc-error-core 0.17.0", "serde", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] @@ -2891,9 +3092,9 @@ dependencies = [ [[package]] name = "near-stdx" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c05ded9a90c087aaebfafdf01f2801f5d31817f9a3514ce09aed270001d650e" +checksum = "6540152fba5e96fe5d575b79e8cd244cf2add747bb01362426bdc069bc3a23bc" [[package]] name = "near-sys" @@ -2902,13 +3103,13 @@ source = "git+https://github.com/near/near-sdk-rs?rev=03487c184d37b0382dd9bd41c5 [[package]] name = "near-vm-errors" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a29e5ae456dbd4f1f7078a9cf438de523ef0825e548ad1fe073d4f7a22b902" +checksum = "ec545d1bede0579e7c15dd2dce9b998dc975c52f2165702ff40bec7ff69728bb" dependencies = [ - "borsh 0.9.3", + "borsh 0.10.3", "near-account-id", - "near-rpc-error-macro 0.16.0", + "near-rpc-error-macro 0.17.0", "serde", "strum", "thiserror", @@ -3204,7 +3405,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.2", ] [[package]] @@ -3708,9 +3909,9 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.24.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b1629c9c557ef9b293568b338dddfc8208c98a18c59d722a9d53f859d9c9b62" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ "rand 0.8.5", "secp256k1-sys", @@ -3718,9 +3919,9 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.6.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83080e2c2fc1006e625be82e5d1eb6a43b7fd9578b617fcc55814daf286bba4b" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" dependencies = [ "cc", ] @@ -3780,7 +3981,7 @@ version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ - "indexmap", + "indexmap 1.9.2", "itoa", "ryu", "serde", @@ -3809,13 +4010,42 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_with" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca3b16a3d82c4088f343b7480a93550b3eabe1a358569c2dfe38bbcead07237" +dependencies = [ + "base64 0.21.0", + "chrono", + "hex", + "indexmap 1.9.2", + "indexmap 2.0.1", + "serde", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e6be15c453eb305019bfa438b1593c731f36a289a7853f7707ee29e870b3b3c" +dependencies = [ + "darling 0.20.3", + "proc-macro2", + "quote", + "syn 2.0.18", +] + [[package]] name = "serde_yaml" version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fb06d4b6cdaef0e0c51fa881acb721bed3c924cfaa71d9c94a3b771dfdf6567" dependencies = [ - "indexmap", + "indexmap 1.9.2", "itoa", "ryu", "serde", @@ -3927,9 +4157,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -4073,17 +4303,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "time" version = "0.3.21" @@ -4128,22 +4347,21 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.19.2" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ + "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", - "once_cell", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -4158,13 +4376,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] @@ -4287,7 +4505,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap", + "indexmap 1.9.2", "pin-project", "pin-project-lite", "rand 0.8.5", @@ -4331,7 +4549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" dependencies = [ "crossbeam-channel", - "time 0.3.21", + "time", "tracing-subscriber", ] @@ -4411,7 +4629,7 @@ dependencies = [ "serde", "serde_json", "thiserror", - "time 0.3.21", + "time", "tracing-core", "tracing-subscriber", ] @@ -4541,6 +4759,12 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68b90931029ab9b034b300b797048cf23723400aa757e8a2bfb9d748102f9821" +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "valuable" version = "0.1.0" @@ -4746,6 +4970,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.36.1" @@ -4765,21 +4998,51 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", + "windows_aarch64_gnullvm 0.42.2", "windows_aarch64_msvc 0.42.2", "windows_i686_gnu 0.42.2", "windows_i686_msvc 0.42.2", "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm", + "windows_x86_64_gnullvm 0.42.2", "windows_x86_64_msvc 0.42.2", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + [[package]] name = "windows_aarch64_msvc" version = "0.36.1" @@ -4792,6 +5055,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + [[package]] name = "windows_i686_gnu" version = "0.36.1" @@ -4804,6 +5073,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + [[package]] name = "windows_i686_msvc" version = "0.36.1" @@ -4816,6 +5091,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + [[package]] name = "windows_x86_64_gnu" version = "0.36.1" @@ -4828,12 +5109,24 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -4846,6 +5139,12 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + [[package]] name = "winreg" version = "0.10.1" diff --git a/Cargo.toml b/Cargo.toml index b46db784..c4a1cf91 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,9 +6,9 @@ members = [ ] [workspace.dependencies] -near-jsonrpc-client = "0.5.0" -near-primitives = "0.16.0" -near-crypto = "0.16.0" -near-chain-configs = "0.16.0" -near-indexer-primitives = "0.16.0" -near-jsonrpc-primitives = "0.16.0" +near-jsonrpc-client = "0.6.0" +near-primitives = "0.17.0" +near-crypto = "0.17.0" +near-chain-configs = "0.17.0" +near-indexer-primitives = "0.17.0" +near-jsonrpc-primitives = "0.17.0" From d327130697df1e68e44ad23a056f08e16a1aea2e Mon Sep 17 00:00:00 2001 From: Morgan Mccauley Date: Fri, 29 Sep 2023 13:56:11 +1300 Subject: [PATCH 3/6] build: Bump rust version to `1.70.0` --- circulating-supply/Dockerfile | 2 +- indexer/Dockerfile | 2 +- rust-toolchain | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/circulating-supply/Dockerfile b/circulating-supply/Dockerfile index 2db1e9bf..c7b31998 100644 --- a/circulating-supply/Dockerfile +++ b/circulating-supply/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.67.1 AS builder +FROM rust:1.70.0 AS builder WORKDIR /tmp/ COPY Cargo.toml Cargo.lock ./ COPY database database diff --git a/indexer/Dockerfile b/indexer/Dockerfile index fa711114..fec86ec0 100644 --- a/indexer/Dockerfile +++ b/indexer/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.67.1 AS builder +FROM rust:1.70.0 AS builder WORKDIR /tmp/ COPY Cargo.toml Cargo.lock ./ COPY database database diff --git a/rust-toolchain b/rust-toolchain index 737e2ba5..832e9afb 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.67.1 +1.70.0 From ac97d2d1aa4b63a5944c461cd4559b16f79827e6 Mon Sep 17 00:00:00 2001 From: Morgan Mccauley Date: Fri, 29 Sep 2023 13:56:54 +1300 Subject: [PATCH 4/6] fix: Propagate `Genesis` construction error --- database/src/adapters/genesis.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/src/adapters/genesis.rs b/database/src/adapters/genesis.rs index 30d407b2..63dea396 100644 --- a/database/src/adapters/genesis.rs +++ b/database/src/adapters/genesis.rs @@ -52,7 +52,7 @@ pub async fn store_genesis_records( let genesis = Genesis::new_with_path( GenesisConfig::from_file(genesis_file_path.clone())?, genesis_file_path, - ); + )?; let genesis_height = genesis.config.genesis_height; // Remember the current actix runtime thread in order to be able to From 1356f709aefb7c2d452ab7ef263480e414103e88 Mon Sep 17 00:00:00 2001 From: Morgan Mccauley Date: Fri, 29 Sep 2023 14:09:25 +1300 Subject: [PATCH 5/6] fix: Dont encode already encoded base64 --- database/src/models/serializers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/src/models/serializers.rs b/database/src/models/serializers.rs index 84b3d715..04a8f151 100644 --- a/database/src/models/serializers.rs +++ b/database/src/models/serializers.rs @@ -78,7 +78,7 @@ pub(crate) fn extract_action_type_and_value_from_action_view( } => { let mut arguments = json!({ "method_name": method_name.escape_default().to_string(), - "args_base64": base64::encode(&args), + "args_base64": &args, "gas": gas, "deposit": deposit.to_string(), }); From b039e873118e1713f6027ee1b7ac3a0a0252cdbd Mon Sep 17 00:00:00 2001 From: Morgan Mccauley Date: Fri, 29 Sep 2023 15:00:54 +1300 Subject: [PATCH 6/6] chore: Cargo format --- circulating-supply/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/circulating-supply/src/main.rs b/circulating-supply/src/main.rs index 9502e560..eaa6c9bf 100644 --- a/circulating-supply/src/main.rs +++ b/circulating-supply/src/main.rs @@ -243,11 +243,11 @@ async fn wait_for_loading_needed_blocks(rpc_client: &JsonRpcClient, day_to_compu return; } warn!( - target: crate::CIRCULATING_SUPPLY, - "Blocks are not loaded to calculate circulating supply for {}. Wait for {} hours", - NaiveDateTime::from_timestamp(day_to_compute.as_secs() as i64, 0).date(), - crate::RETRY_DURATION.as_secs() / 60 / 60, - ); + target: crate::CIRCULATING_SUPPLY, + "Blocks are not loaded to calculate circulating supply for {}. Wait for {} hours", + NaiveDateTime::from_timestamp(day_to_compute.as_secs() as i64, 0).date(), + crate::RETRY_DURATION.as_secs() / 60 / 60, + ); } Err(err) => { error!(