diff --git a/Cargo.lock b/Cargo.lock index 32d20654..3a253379 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -294,11 +294,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.31.0", + "gimli 0.31.1", ] [[package]] @@ -591,9 +591,9 @@ dependencies = [ [[package]] name = "aws-config" -version = "1.5.7" +version = "1.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8191fb3091fa0561d1379ef80333c3c7191c6f0435d986e85821bcf7acbd1126" +checksum = "7198e6f03240fdceba36656d8be440297b6b82270325908c7381f37d826a74f6" dependencies = [ "aws-credential-types", "aws-runtime", @@ -684,9 +684,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.52.0" +version = "1.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f571deb0a80c20d21d9f3e8418c1712af9ff4bf399d057e5549a934eca4844e2" +checksum = "e2f2a62020f3e06f9b352b2a23547f6e1d110b6bf1e18a6b588ae36114eaf6e2" dependencies = [ "ahash 0.8.11", "aws-credential-types", @@ -708,7 +708,7 @@ dependencies = [ "hmac", "http 0.2.12", "http-body 0.4.6", - "lru 0.12.4", + "lru 0.12.5", "once_cell", "percent-encoding", "regex-lite", @@ -719,9 +719,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.44.0" +version = "1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b90cfe6504115e13c41d3ea90286ede5aa14da294f3fe077027a6e83850843c" +checksum = "e33ae899566f3d395cbf42858e433930682cc9c1889fa89318896082fef45efb" dependencies = [ "aws-credential-types", "aws-runtime", @@ -741,9 +741,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.45.0" +version = "1.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167c0fad1f212952084137308359e8e4c4724d1c643038ce163f06de9662c1d0" +checksum = "f39c09e199ebd96b9f860b0fce4b6625f211e064ad7c8693b72ecf7ef03881e0" dependencies = [ "aws-credential-types", "aws-runtime", @@ -763,9 +763,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.44.0" +version = "1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb5f98188ec1435b68097daa2a37d74b9d17c9caa799466338a8d1544e71b9d" +checksum = "3d95f93a98130389eb6233b9d615249e543f6c24a68ca1f109af9ca5164a8765" dependencies = [ "aws-credential-types", "aws-runtime", @@ -898,9 +898,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1ce695746394772e7000b39fe073095db6d45a862d0767dd5ad0ac0d7f8eb87" +checksum = "a065c0fe6fdbdf9f11817eb68582b2ab4aff9e9c39e986ae48f7ec576c6322db" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -1040,11 +1040,11 @@ version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ - "addr2line 0.24.1", + "addr2line 0.24.2", "cfg-if 1.0.0", "libc", "miniz_oxide", - "object 0.36.4", + "object 0.36.5", "rustc-demangle", "windows-targets 0.52.6", ] @@ -1444,9 +1444,9 @@ checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" [[package]] name = "cc" -version = "1.1.24" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ "jobserver", "libc", @@ -1517,9 +1517,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -1527,9 +1527,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -2640,6 +2640,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" @@ -2682,9 +2688,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", @@ -2697,9 +2703,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", @@ -2707,15 +2713,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", @@ -2735,9 +2741,9 @@ 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" @@ -2767,9 +2773,9 @@ 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", @@ -2778,21 +2784,21 @@ dependencies = [ [[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-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", @@ -2884,9 +2890,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -3060,6 +3066,11 @@ name = "hashbrown" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] [[package]] name = "hashlink" @@ -3280,7 +3291,7 @@ dependencies = [ "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "tokio", "tokio-rustls 0.26.0", @@ -3458,9 +3469,9 @@ checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_terminal_polyfill" @@ -3537,9 +3548,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "0cb94a0ffd3f3ee755c20f7d8752f45cac88605a4dcf808abcff72873296ec7b" dependencies = [ "wasm-bindgen", ] @@ -3782,11 +3793,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.0", ] [[package]] @@ -4073,7 +4084,7 @@ name = "near-cache" version = "2.2.1" source = "git+https://github.com/kobayurii/nearcore.git?branch=2.2.1-fork1#3a97591c46c1b62082de8a48a7da48bb0778a1bb" dependencies = [ - "lru 0.12.4", + "lru 0.12.5", ] [[package]] @@ -4091,7 +4102,7 @@ dependencies = [ "enum-map", "itertools 0.10.5", "itoa", - "lru 0.12.4", + "lru 0.12.5", "near-async", "near-cache", "near-chain-configs 2.2.1", @@ -4195,7 +4206,7 @@ dependencies = [ "derive_more", "futures", "itertools 0.10.5", - "lru 0.12.4", + "lru 0.12.5", "near-async", "near-chain", "near-chain-configs 2.2.1", @@ -4242,7 +4253,7 @@ dependencies = [ "derive_more", "futures", "itertools 0.10.5", - "lru 0.12.4", + "lru 0.12.5", "near-async", "near-cache", "near-chain", @@ -4599,7 +4610,7 @@ dependencies = [ [[package]] name = "near-lake-framework" version = "0.0.0" -source = "git+https://github.com/kobayurii/near-lake-framework-rs.git?branch=fork/0.7.11#bb52d6d37945aa3cf6e022a43a4d8ea9dd676145" +source = "git+https://github.com/kobayurii/near-lake-framework-rs.git?branch=fork/0.7.11#e72d9600b471debd6c627cd149aa0fc6a1b76ea7" dependencies = [ "anyhow", "async-stream", @@ -4652,7 +4663,7 @@ dependencies = [ "futures-util", "im", "itertools 0.10.5", - "lru 0.12.4", + "lru 0.12.5", "near-async", "near-chain-configs 2.2.1", "near-crypto 2.2.1", @@ -5067,7 +5078,7 @@ dependencies = [ "hex", "itertools 0.10.5", "itoa", - "lru 0.12.4", + "lru 0.12.5", "near-chain-configs 2.2.1", "near-crypto 2.2.1", "near-fmt 2.2.1", @@ -5246,7 +5257,7 @@ dependencies = [ "ed25519-dalek", "enum-map", "finite-wasm", - "lru 0.12.4", + "lru 0.12.5", "memoffset 0.8.0", "near-crypto 2.2.1", "near-o11y 2.2.1", @@ -5604,21 +5615,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "opaque-debug" @@ -6198,18 +6206,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", @@ -6281,12 +6289,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "powerfmt" version = "0.2.0" @@ -6372,9 +6374,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -6712,7 +6714,7 @@ dependencies = [ "futures-locks", "hex", "lazy_static", - "lru 0.12.4", + "lru 0.12.5", "mimalloc", "near-async", "near-chain-configs 2.2.1", @@ -7240,9 +7242,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", "rustls-pki-types", @@ -7339,9 +7341,9 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -7551,9 +7553,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9720086b3357bcb44fce40117d769a4d068c70ecfa190850a980a71755f66fcc" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", @@ -7569,9 +7571,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f1abbfe725f27678f4663bcacb75a83e829fd464c25d78dd038a3a29e307cec" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling 0.20.10", "proc-macro2", @@ -8461,7 +8463,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "tokio", ] @@ -8908,9 +8910,9 @@ dependencies = [ [[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" @@ -9096,9 +9098,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "ef073ced962d62984fb38a36e5fdc1a2b23c9e0e1fa0689bb97afa4202ef6887" dependencies = [ "cfg-if 1.0.0", "once_cell", @@ -9107,9 +9109,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "c4bfab14ef75323f4eb75fa52ee0a3fb59611977fd3240da19b2cf36ff85030e" dependencies = [ "bumpalo", "log", @@ -9122,9 +9124,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "65471f79c1022ffa5291d33520cbbb53b7687b01c2f8e83b57d102eed7ed479d" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -9134,9 +9136,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "a7bec9830f60924d9ceb3ef99d55c155be8afa76954edffbb5936ff4509474e7" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -9144,9 +9146,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "4c74f6e152a76a2ad448e223b0fc0b6b5747649c3d769cc6bf45737bf97d0ed6" dependencies = [ "proc-macro2", "quote", @@ -9157,9 +9159,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "a42f6c679374623f295a8623adfe63d9284091245c3504bde47c17a3ce2777d9" [[package]] name = "wasm-encoder" @@ -9619,9 +9621,9 @@ checksum = "9dafab2db172a53e23940e0fa3078c202f567ee5f13f4b42f66b694fab43c658" [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "44188d185b5bdcae1052d08bcbcf9091a5524038d4572cc4f4f2bb9d5554ddd9" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/configuration/src/configs/lake.rs b/configuration/src/configs/lake.rs index ea6c00aa..a4a74cb0 100644 --- a/configuration/src/configs/lake.rs +++ b/configuration/src/configs/lake.rs @@ -26,6 +26,18 @@ impl LakeConfig { .start_block_height(start_block_height) .build()?) } + + pub async fn lake_client( + &self, + chain_id: crate::ChainId, + ) -> anyhow::Result { + let fast_near_endpoint = match chain_id { + crate::ChainId::Mainnet => String::from("https://mainnet.neardata.xyz"), + // Testnet is the default chain for other chain_id + _ => String::from("https://testnet.neardata.xyz"), + }; + Ok(near_lake_framework::FastNearClient::new(fast_near_endpoint)) + } } #[derive(Deserialize, Debug, Clone, Default)] diff --git a/rpc-server/src/config.rs b/rpc-server/src/config.rs index 5999ee51..22656467 100644 --- a/rpc-server/src/config.rs +++ b/rpc-server/src/config.rs @@ -4,6 +4,7 @@ use futures::executor::block_on; use near_primitives::epoch_manager::{AllEpochConfig, EpochConfig}; use crate::modules::blocks::{BlocksInfoByFinality, CacheBlock}; +use crate::utils; static NEARD_VERSION: &str = env!("CARGO_PKG_VERSION"); static NEARD_BUILD: &str = env!("BUILD_VERSION"); @@ -20,7 +21,7 @@ pub struct GenesisInfo { impl GenesisInfo { pub async fn get( near_rpc_client: &crate::utils::JsonRpcClient, - fastnear_client: &near_lake_framework::fastnear_client::FastNearClient, + fastnear_client: &near_lake_framework::FastNearClient, ) -> Self { tracing::info!("Get genesis config..."); let genesis_config = near_rpc_client @@ -32,8 +33,7 @@ impl GenesisInfo { .expect("Error to get genesis config"); let genesis_block = - near_lake_framework::providers::fastnear::fetchers::fetch_first_block(fastnear_client) - .await; + near_lake_framework::fastnear::fetchers::fetch_first_block(fastnear_client).await; Self { genesis_config, @@ -45,7 +45,7 @@ impl GenesisInfo { #[derive(Clone)] pub struct ServerContext { /// Fastnear client - pub fastnear_client: near_lake_framework::fastnear_client::FastNearClient, + pub fastnear_client: near_lake_framework::FastNearClient, /// Database manager pub db_manager: std::sync::Arc>, /// TransactionDetails storage @@ -82,37 +82,36 @@ pub struct ServerContext { } impl ServerContext { - pub async fn init( - rpc_server_config: configuration::RpcServerConfig, - near_rpc_client: crate::utils::JsonRpcClient, - ) -> anyhow::Result { + pub async fn init(rpc_server_config: configuration::RpcServerConfig) -> anyhow::Result { let contract_code_cache_size_in_bytes = - crate::utils::gigabytes_to_bytes(rpc_server_config.general.contract_code_cache_size) - .await; + utils::gigabytes_to_bytes(rpc_server_config.general.contract_code_cache_size).await; let contract_code_cache = std::sync::Arc::new(crate::cache::RwLockLruMemoryCache::new( contract_code_cache_size_in_bytes, )); let block_cache_size_in_bytes = - crate::utils::gigabytes_to_bytes(rpc_server_config.general.block_cache_size).await; + utils::gigabytes_to_bytes(rpc_server_config.general.block_cache_size).await; let blocks_cache = std::sync::Arc::new(crate::cache::RwLockLruMemoryCache::new( block_cache_size_in_bytes, )); - - let blocks_info_by_finality = - std::sync::Arc::new(BlocksInfoByFinality::new(&near_rpc_client, &blocks_cache).await); + let near_rpc_client = utils::JsonRpcClient::new( + rpc_server_config.general.near_rpc_url.clone(), + rpc_server_config.general.near_archival_rpc_url.clone(), + ); + // We want to set a custom referer to let NEAR JSON RPC nodes know that we are a read-rpc instance + let near_rpc_client = near_rpc_client.header( + "Referer".to_string(), + rpc_server_config.general.referer_header_value.clone(), + )?; let fastnear_client = rpc_server_config .lake_config - .lake_config( - blocks_info_by_finality - .optimistic_cache_block() - .await - .block_height, - rpc_server_config.general.chain_id.clone(), - ) - .await? - .client(); + .lake_client(rpc_server_config.general.chain_id.clone()) + .await?; + + let blocks_info_by_finality = std::sync::Arc::new( + BlocksInfoByFinality::new(&near_rpc_client, &fastnear_client).await, + ); let tx_details_storage = tx_details_storage::TxDetailsStorage::new( rpc_server_config.tx_details_storage.storage_client().await, diff --git a/rpc-server/src/main.rs b/rpc-server/src/main.rs index 545484af..1e7249da 100644 --- a/rpc-server/src/main.rs +++ b/rpc-server/src/main.rs @@ -322,43 +322,16 @@ async fn main() -> anyhow::Result<()> { let rpc_server_config = configuration::read_configuration::().await?; - let near_rpc_client = utils::JsonRpcClient::new( - rpc_server_config.general.near_rpc_url.clone(), - rpc_server_config.general.near_archival_rpc_url.clone(), - ); - // We want to set a custom referer to let NEAR JSON RPC nodes know that we are a read-rpc instance - let near_rpc_client = near_rpc_client.header( - "Referer".to_string(), - rpc_server_config.general.referer_header_value.clone(), - )?; - - let server_port = rpc_server_config.general.server_port; - - let server_context = actix_web::web::Data::new( - config::ServerContext::init(rpc_server_config.clone(), near_rpc_client.clone()).await?, - ); - - // Update final block from fastnear - let blocks_cache_clone = std::sync::Arc::clone(&server_context.blocks_cache); - let blocks_info_by_finality_clone = - std::sync::Arc::clone(&server_context.blocks_info_by_finality); - let fastnear_client = server_context.fastnear_client.clone(); - tokio::spawn(async move { - utils::update_final_block_regularly( - blocks_cache_clone, - blocks_info_by_finality_clone, - fastnear_client, - near_rpc_client, - ) - .await - }); + let server_context = + actix_web::web::Data::new(config::ServerContext::init(rpc_server_config.clone()).await?); - // Update optimistic block from fastnear - let blocks_info_by_finality = std::sync::Arc::clone(&server_context.blocks_info_by_finality); - let fastnear_client = server_context.fastnear_client.clone(); - tokio::spawn(async move { - utils::update_optimistic_block_regularly(blocks_info_by_finality, fastnear_client).await - }); + utils::task_regularly_update_blocks_by_finality( + std::sync::Arc::clone(&server_context.blocks_info_by_finality), + std::sync::Arc::clone(&server_context.blocks_cache), + server_context.fastnear_client.clone(), + server_context.near_rpc_client.clone(), + ) + .await; actix_web::HttpServer::new(move || { let cors = actix_cors::Cors::permissive(); @@ -371,7 +344,10 @@ async fn main() -> anyhow::Result<()> { .service(metrics::get_metrics) .service(health::get_health_status) }) - .bind(format!("0.0.0.0:{:0>5}", server_port))? + .bind(format!( + "0.0.0.0:{:0>5}", + rpc_server_config.general.server_port + ))? .run() .await?; diff --git a/rpc-server/src/modules/blocks/methods.rs b/rpc-server/src/modules/blocks/methods.rs index 3dc5200a..ad27ea0a 100644 --- a/rpc-server/src/modules/blocks/methods.rs +++ b/rpc-server/src/modules/blocks/methods.rs @@ -360,7 +360,7 @@ pub async fn fetch_block( { data.blocks_info_by_finality.optimistic_block_view().await } else { - near_lake_framework::providers::fastnear::fetchers::fetch_block_or_retry( + near_lake_framework::fastnear::fetchers::fetch_block_or_retry( &data.fastnear_client, block_height, ) @@ -606,7 +606,7 @@ async fn fetch_shards_by_cache_block( data: &Data, cache_block: crate::modules::blocks::CacheBlock, ) -> anyhow::Result> { - match near_lake_framework::providers::fastnear::fetchers::fetch_streamer_message( + match near_lake_framework::fastnear::fetchers::fetch_streamer_message( &data.fastnear_client, cache_block.block_height, ) diff --git a/rpc-server/src/modules/blocks/mod.rs b/rpc-server/src/modules/blocks/mod.rs index c0c90acd..f5a54da5 100644 --- a/rpc-server/src/modules/blocks/mod.rs +++ b/rpc-server/src/modules/blocks/mod.rs @@ -74,15 +74,6 @@ pub struct BlockInfo { } impl BlockInfo { - // Create new BlockInfo from BlockView. this method is useful only for start rpc-server. - pub async fn new_from_block_view(block_view: near_primitives::views::BlockView) -> Self { - Self { - block_cache: CacheBlock::from(&block_view), - block_view, - changes: vec![], // We left changes empty because block_view doesn't contain state changes. - } - } - // Create new BlockInfo from StreamerMessage. // This is using to update final and optimistic blocks regularly. pub async fn new_from_streamer_message( @@ -294,35 +285,25 @@ pub struct BlocksInfoByFinality { impl BlocksInfoByFinality { pub async fn new( near_rpc_client: &crate::utils::JsonRpcClient, - blocks_cache: &std::sync::Arc>, + fast_near_client: &near_lake_framework::FastNearClient, ) -> Self { - let final_block_future = crate::utils::get_final_block(near_rpc_client, false); - let optimistic_block_future = crate::utils::get_final_block(near_rpc_client, true); - let validators_future = crate::utils::get_current_validators(near_rpc_client); - let protocol_version_future = crate::utils::get_current_protocol_version(near_rpc_client); - - let (final_block, optimistic_block, validators, protocol_version) = futures::try_join!( - final_block_future, - optimistic_block_future, - validators_future, - protocol_version_future - ) - .map_err(|err| { - tracing::error!("Error to fetch final block info: {:?}", err); - err - }) - .expect("Error to get final block info"); - - blocks_cache - .put(final_block.header.height, CacheBlock::from(&final_block)) - .await; + let final_block = + near_lake_framework::fastnear::fetchers::fetch_last_block(fast_near_client).await; + let optimistic_block = + near_lake_framework::fastnear::fetchers::fetch_optimistic_block(fast_near_client).await; + let validators = crate::utils::get_current_validators(near_rpc_client) + .await + .expect("Failed to get current validators"); + let protocol_version = crate::utils::get_current_protocol_version(near_rpc_client) + .await + .expect("Failed to get current protocol version"); Self { final_block: futures_locks::RwLock::new( - BlockInfo::new_from_block_view(final_block).await, + BlockInfo::new_from_streamer_message(final_block).await, ), optimistic_block: futures_locks::RwLock::new( - BlockInfo::new_from_block_view(optimistic_block).await, + BlockInfo::new_from_streamer_message(optimistic_block).await, ), optimistic_changes: futures_locks::RwLock::new(OptimisticChanges::new()), current_validators: futures_locks::RwLock::new(CurrentValidatorInfo { validators }), diff --git a/rpc-server/src/modules/blocks/utils.rs b/rpc-server/src/modules/blocks/utils.rs index b7e10e9c..48c5de39 100644 --- a/rpc-server/src/modules/blocks/utils.rs +++ b/rpc-server/src/modules/blocks/utils.rs @@ -46,7 +46,7 @@ pub async fn check_block_height( tracing::instrument(skip(fastnear_client)) )] pub async fn fetch_chunk_from_fastnear( - fastnear_client: &near_lake_framework::fastnear_client::FastNearClient, + fastnear_client: &near_lake_framework::FastNearClient, block_height: near_primitives::types::BlockHeight, shard_id: near_primitives::types::ShardId, ) -> Result @@ -56,7 +56,7 @@ pub async fn fetch_chunk_from_fastnear( block_height, shard_id ); - match near_lake_framework::providers::fastnear::fetchers::fetch_shard_or_retry( + match near_lake_framework::fastnear::fetchers::fetch_shard_or_retry( fastnear_client, block_height, shard_id, diff --git a/rpc-server/src/utils.rs b/rpc-server/src/utils.rs index 4b849efe..1a47688e 100644 --- a/rpc-server/src/utils.rs +++ b/rpc-server/src/utils.rs @@ -105,37 +105,6 @@ impl JsonRpcClient { } } -pub async fn get_final_block( - near_rpc_client: &JsonRpcClient, - optimistic: bool, -) -> anyhow::Result { - let block_request_method = near_jsonrpc_client::methods::block::RpcBlockRequest { - block_reference: near_primitives::types::BlockReference::Finality(if optimistic { - near_primitives::types::Finality::None - } else { - near_primitives::types::Finality::Final - }), - }; - let block_view = near_rpc_client.call(block_request_method, None).await?; - - // Updating the metric to expose the block height considered as final by the server - // this metric can be used to calculate the lag between the server and the network - // Prometheus Gauge Metric type do not support u64 - // https://github.com/tikv/rust-prometheus/issues/470 - if optimistic { - // optimistic block height - crate::metrics::LATEST_BLOCK_HEIGHT_BY_FINALITIY - .with_label_values(&["optimistic"]) - .set(i64::try_from(block_view.header.height)?); - } else { - // final block height - crate::metrics::LATEST_BLOCK_HEIGHT_BY_FINALITIY - .with_label_values(&["final"]) - .set(i64::try_from(block_view.header.height)?); - } - Ok(block_view) -} - pub async fn get_current_validators( near_rpc_client: &JsonRpcClient, ) -> anyhow::Result { @@ -187,63 +156,87 @@ async fn handle_streamer_message( } // Task to get and store final block in the cache -pub async fn update_final_block_regularly( +async fn task_update_final_block_regularly( blocks_cache: std::sync::Arc>, blocks_info_by_finality: std::sync::Arc, - fastnear_client: near_lake_framework::fastnear_client::FastNearClient, + fastnear_client: near_lake_framework::FastNearClient, near_rpc_client: JsonRpcClient, ) { tracing::info!("Task to get and store final block in the cache started"); - loop { - // Update final block from fastnear regularly - let streamer_message = - near_lake_framework::providers::fastnear::fetchers::fetch_last_block(&fastnear_client) - .await; - if let Err(err) = handle_streamer_message( - streamer_message, - std::sync::Arc::clone(&blocks_cache), - std::sync::Arc::clone(&blocks_info_by_finality), - &near_rpc_client, - ) + let mut final_block_height = blocks_info_by_finality + .final_cache_block() .await + .block_height; + loop { + final_block_height += 1; + if let Some(streamer_message) = + near_lake_framework::fastnear::fetchers::fetch_streamer_message( + &fastnear_client, + final_block_height, + ) + .await { - tracing::error!("Error in fn handle_streamer_message(): {:?}", err); - }; - // Sleep for 500ms before the next iteration - tokio::time::sleep(std::time::Duration::from_millis(500)).await; + if let Err(err) = handle_streamer_message( + streamer_message, + std::sync::Arc::clone(&blocks_cache), + std::sync::Arc::clone(&blocks_info_by_finality), + &near_rpc_client, + ) + .await + { + tracing::error!("Error in fn handle_streamer_message(): {:?}", err); + }; + } } } // Task to get and store optimistic block in the cache -pub async fn update_optimistic_block_regularly( +async fn task_update_optimistic_block_regularly( blocks_info_by_finality: std::sync::Arc, - fastnear_client: near_lake_framework::fastnear_client::FastNearClient, + fastnear_client: near_lake_framework::FastNearClient, ) { tracing::info!("Task to get and store optimistic block in the cache started"); + let mut optimistic_block_height = blocks_info_by_finality + .optimistic_cache_block() + .await + .block_height; loop { - let streamer_message = - near_lake_framework::providers::fastnear::fetchers::fetch_optimistic_block( + optimistic_block_height += 1; + if let Some(streamer_message) = + near_lake_framework::fastnear::fetchers::fetch_optimistic_block_by_height( &fastnear_client, + optimistic_block_height, ) - .await; - if streamer_message.block.header.height as i64 - > crate::metrics::LATEST_BLOCK_HEIGHT_BY_FINALITIY - .with_label_values(&["optimistic"]) - .get() + .await { - let optimistic_block = BlockInfo::new_from_streamer_message(streamer_message).await; - let optimistic_block_cache = optimistic_block.block_cache; - blocks_info_by_finality - .update_optimistic_block(optimistic_block) - .await; - crate::metrics::LATEST_BLOCK_HEIGHT_BY_FINALITIY - .with_label_values(&["optimistic"]) - .set( - i64::try_from(optimistic_block_cache.block_height) - .expect("Invalid optimistic block height"), - ); + if streamer_message.block.header.height as i64 + > crate::metrics::LATEST_BLOCK_HEIGHT_BY_FINALITIY + .with_label_values(&["optimistic"]) + .get() + { + let optimistic_block = BlockInfo::new_from_streamer_message(streamer_message).await; + let optimistic_block_cache = optimistic_block.block_cache; + blocks_info_by_finality + .update_optimistic_block(optimistic_block) + .await; + crate::metrics::LATEST_BLOCK_HEIGHT_BY_FINALITIY + .with_label_values(&["optimistic"]) + .set( + i64::try_from(optimistic_block_cache.block_height) + .expect("Invalid optimistic block height"), + ); + } } + } +} +// Task to check optimistic block status +async fn task_optimistic_block_status() { + tracing::info!("Task to check optimistic block status started"); + loop { + // check every 2 seconds + tokio::time::sleep(std::time::Duration::from_secs(2)).await; + // When an optimistic block is not updated, or it is lower than the final block // we need to mark that optimistic updating is not working if crate::metrics::LATEST_BLOCK_HEIGHT_BY_FINALITIY @@ -272,12 +265,39 @@ pub async fn update_optimistic_block_regularly( { crate::metrics::OPTIMISTIC_UPDATING.set_working(); tracing::info!("Optimistic block updating is resumed."); - }; - // Sleep for 500ms before the next iteration - tokio::time::sleep(std::time::Duration::from_millis(500)).await; + } } } +pub async fn task_regularly_update_blocks_by_finality( + blocks_info_by_finality: std::sync::Arc, + blocks_cache: std::sync::Arc>, + fastnear_client: near_lake_framework::FastNearClient, + near_rpc_client: JsonRpcClient, +) { + // Task update final block regularly + let blocks_info_by_finality_clone = std::sync::Arc::clone(&blocks_info_by_finality); + let fastnear_client_clone = fastnear_client.clone(); + + tokio::spawn(async move { + task_update_final_block_regularly( + blocks_cache, + blocks_info_by_finality_clone, + fastnear_client_clone, + near_rpc_client, + ) + .await + }); + + // Task update optimistic block regularly + tokio::spawn(async move { + task_update_optimistic_block_regularly(blocks_info_by_finality, fastnear_client).await + }); + + // Task to check the optimistic block status + tokio::spawn(async move { task_optimistic_block_status().await }); +} + /// Convert gigabytes to bytes pub(crate) async fn gigabytes_to_bytes(gigabytes: f64) -> usize { (gigabytes * 1024.0 * 1024.0 * 1024.0) as usize