From 5765b1c97f5f7592a3845aaea2b0b37e88e2973c Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Mon, 4 Mar 2024 14:15:59 +0200 Subject: [PATCH 1/8] Support nearcore 1.37 (#194) * Support nearcore 1.37 * fmt * runtime config * protocol config * delete unused deps * requests methods * rpc methods 1.37 * add near rpc client with supports nearcore 1.37 * rebase from main * rebase from main * rebase from main --- Cargo.lock | 2848 +++++------------ Cargo.toml | 13 - configuration/Cargo.toml | 8 +- database/Cargo.toml | 23 +- database/src/base/rpc_server.rs | 6 - database/src/base/state_indexer.rs | 8 - .../down.sql | 10 + .../up.sql | 1 + database/src/postgres/models.rs | 55 +- database/src/postgres/rpc_server.rs | 51 +- database/src/postgres/schema.rs | 11 - database/src/postgres/state_indexer.rs | 33 +- database/src/postgres/tx_indexer.rs | 49 +- database/src/scylladb/mod.rs | 7 +- database/src/scylladb/rpc_server.rs | 37 +- database/src/scylladb/state_indexer.rs | 64 +- database/src/scylladb/tx_indexer.rs | 35 +- docs/RPC_METHODS.md | 61 +- epoch-indexer/Cargo.toml | 13 +- epoch-indexer/src/config.rs | 8 - epoch-indexer/src/lib.rs | 77 +- perf-testing/Cargo.toml | 10 +- perf-testing/src/transactions.rs | 4 +- readnode-primitives/Cargo.toml | 7 +- readnode-primitives/src/lib.rs | 18 +- rpc-server/Cargo.toml | 36 +- rpc-server/Dockerfile | 2 +- rpc-server/src/config.rs | 6 +- rpc-server/src/errors.rs | 8 +- rpc-server/src/main.rs | 53 +- rpc-server/src/modules/blocks/mod.rs | 5 - rpc-server/src/modules/network/methods.rs | 64 +- rpc-server/src/modules/network/mod.rs | 40 - rpc-server/src/modules/queries/methods.rs | 10 +- rpc-server/src/modules/queries/mod.rs | 101 +- rpc-server/src/modules/queries/utils.rs | 50 +- .../src/modules/transactions/methods.rs | 50 +- rpc-server/src/modules/transactions/mod.rs | 18 +- rpc-server/src/utils.rs | 17 +- rust-toolchain | 2 +- state-indexer/Cargo.toml | 16 +- state-indexer/Dockerfile | 2 +- state-indexer/src/configs.rs | 8 - state-indexer/src/main.rs | 29 +- tx-indexer/Cargo.toml | 14 +- tx-indexer/Dockerfile | 2 +- tx-indexer/src/config.rs | 8 - 47 files changed, 1339 insertions(+), 2659 deletions(-) create mode 100644 database/src/postgres/migrations/2024-02-14-125531_delete_protocol_configs/down.sql create mode 100644 database/src/postgres/migrations/2024-02-14-125531_delete_protocol_configs/up.sql diff --git a/Cargo.lock b/Cargo.lock index a29ab5d1..f5b619fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,31 @@ dependencies = [ "regex", ] +[[package]] +name = "actix" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb72882332b6d6282f428b77ba0358cb2687e61a6f6df6a6d3871e8a177c2d4f" +dependencies = [ + "actix-macros", + "actix-rt", + "actix_derive", + "bitflags 2.4.2", + "bytes", + "crossbeam-channel", + "futures-core", + "futures-sink", + "futures-task", + "futures-util", + "log", + "once_cell", + "parking_lot", + "pin-project-lite", + "smallvec", + "tokio", + "tokio-util 0.7.10", +] + [[package]] name = "actix-codec" version = "0.5.2" @@ -25,15 +50,15 @@ dependencies = [ "memchr", "pin-project-lite", "tokio", - "tokio-util", + "tokio-util 0.7.10", "tracing", ] [[package]] name = "actix-cors" -version = "0.6.5" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0346d8c1f762b41b458ed3145eea914966bb9ad20b9be0d6d463b20d45586370" +checksum = "f9e772b3bcafe335042b5db010ab7c09013dad6eac4915c91d8d50902769f331" dependencies = [ "actix-utils", "actix-web", @@ -54,8 +79,8 @@ dependencies = [ "actix-rt", "actix-service", "actix-utils", - "ahash 0.8.7", - "base64", + "ahash", + "base64 0.21.7", "bitflags 2.4.2", "brotli", "bytes", @@ -78,7 +103,7 @@ dependencies = [ "sha1", "smallvec", "tokio", - "tokio-util", + "tokio-util 0.7.10", "tracing", "zstd", ] @@ -90,7 +115,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -128,7 +153,7 @@ dependencies = [ "futures-core", "futures-util", "mio", - "socket2 0.5.5", + "socket2", "tokio", "tracing", ] @@ -169,10 +194,10 @@ dependencies = [ "actix-service", "actix-utils", "actix-web-codegen", - "ahash 0.8.7", + "ahash", "bytes", "bytestring", - "cfg-if 1.0.0", + "cfg-if", "cookie", "derive_more", "encoding_rs", @@ -189,7 +214,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2 0.5.5", + "socket2", "time", "url", ] @@ -203,16 +228,18 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] -name = "addr2line" -version = "0.19.0" +name = "actix_derive" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ - "gimli 0.27.3", + "proc-macro2", + "quote", + "syn 2.0.49", ] [[package]] @@ -221,7 +248,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.1", + "gimli", ] [[package]] @@ -232,22 +259,11 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" -dependencies = [ - "getrandom 0.2.12", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "getrandom 0.2.12", "once_cell", "version_check", @@ -301,9 +317,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" dependencies = [ "anstyle", "anstyle-parse", @@ -315,9 +331,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -349,9 +365,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "arbitrary" @@ -368,18 +384,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" -[[package]] -name = "arrayref" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - [[package]] name = "assert-json-diff" version = "2.0.2" @@ -390,6 +394,12 @@ dependencies = [ "serde_json", ] +[[package]] +name = "assert_matches" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" + [[package]] name = "async-channel" version = "1.9.0" @@ -420,7 +430,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -431,18 +441,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", + "syn 2.0.49", ] [[package]] @@ -453,9 +452,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "aws-config" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b30c39ebe61f75d1b3785362b1586b41991873c9ab3e317a9181c246fb71d82" +checksum = "7af266887e24cd5f6d2ea7433cacd25dcd4773b7f70e488701968a7cdf51df57" dependencies = [ "aws-credential-types", "aws-runtime", @@ -483,9 +482,9 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33cc49dcdd31c8b6e79850a179af4c367669150c7ac0135f176c61bec81a70f7" +checksum = "2d56f287a9e65e4914bfedb5b22c056b65e4c232fca512d5509a9df36386759f" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -493,20 +492,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "aws-http" -version = "0.60.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13ccfc04c9add2ee02a300cdc240d7c3e4477f100fb2380dc15fd75ca86d31da" -dependencies = [ - "aws-runtime", -] - [[package]] name = "aws-runtime" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb031bff99877c26c28895766f7bb8484a05e24547e370768d6cc9db514662aa" +checksum = "2d6a29eca8ea8982028a4df81883e7001e250a21d323b86418884b5345950a4b" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -528,12 +518,11 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "0.39.1" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29223b1074621f1d011bac836d995c002936663052b1e7ad02927551b17d6625" +checksum = "c977e92277652aefb9a76a0fca652b26757d6845dce0d7bf4426da80f13d85b0" dependencies = [ "aws-credential-types", - "aws-http", "aws-runtime", "aws-sigv4", "aws-smithy-async", @@ -551,16 +540,16 @@ dependencies = [ "http-body", "once_cell", "percent-encoding", - "regex", + "regex-lite", "tracing", "url", ] [[package]] name = "aws-sdk-sso" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f486420a66caad72635bc2ce0ff6581646e0d32df02aa39dc983bfe794955a5b" +checksum = "e2d7f527c7b28af1a641f7d89f9e6a4863e8ec00f39d2b731b056fc5ec5ce829" dependencies = [ "aws-credential-types", "aws-runtime", @@ -580,9 +569,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ddccf01d82fce9b4a15c8ae8608211ee7db8ed13a70b514bbfe41df3d24841" +checksum = "0d0be3224cd574ee8ab5fd7c32087876f25c134c27ac603fcb38669ed8d346b0" dependencies = [ "aws-credential-types", "aws-runtime", @@ -602,9 +591,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a591f8c7e6a621a501b2b5d2e88e1697fcb6274264523a6ad4d5959889a41ce" +checksum = "5b3167c60d82a13bbaef569da06041644ff41e85c6377e5dad53fa2526ccfe9d" dependencies = [ "aws-credential-types", "aws-runtime", @@ -625,9 +614,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c371c6b0ac54d4605eb6f016624fb5c7c2925d315fdf600ac1bf21b19d5f1742" +checksum = "54b1cbe0eee57a213039088dbdeca7be9352f24e0d72332d961e8a1cb388f82d" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -645,7 +634,7 @@ dependencies = [ "p256", "percent-encoding", "ring", - "sha2 0.10.8", + "sha2", "subtle", "time", "tracing", @@ -654,9 +643,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ee2d09cce0ef3ae526679b522835d63e75fb427aca5413cd371e490d52dcc6" +checksum = "8ec441341e019c441aa78472ed6d206cfe198026c495277a95ac5bebda520742" dependencies = [ "futures-util", "pin-project-lite", @@ -665,9 +654,9 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.4" +version = "0.60.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2acd1b9c6ae5859999250ed5a62423aedc5cf69045b844432de15fa2f31f2b" +checksum = "6ee554133eca2611b66d23548e48f9b44713befdb025ab76bc00185b878397a1" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -680,7 +669,7 @@ dependencies = [ "md-5", "pin-project-lite", "sha1", - "sha2 0.10.8", + "sha2", "tracing", ] @@ -697,9 +686,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.4" +version = "0.60.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab56aea3cd9e1101a0a999447fb346afb680ab1406cebc44b32346e25b4117d" +checksum = "85d6a0619f7b67183067fa3b558f94f90753da2df8c04aeb7336d673f804b0b8" dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", @@ -718,18 +707,18 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.60.4" +version = "0.60.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3898ca6518f9215f62678870064398f00031912390efd03f1f6ef56d83aa8e" +checksum = "a1c1b5186b6f5c579bf0de1bcca9dd3d946d6d51361ea1d18131f6a0b64e13ae" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-query" -version = "0.60.4" +version = "0.60.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda4b1dfc9810e35fba8a620e900522cd1bd4f9578c446e82f49d1ce41d2e9f9" +checksum = "1c0a2ce65882e788d2cf83ff28b9b16918de0460c47bf66c5da4f6c17b4c9694" dependencies = [ "aws-smithy-types", "urlencoding", @@ -737,9 +726,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fafdab38f40ad7816e7da5dec279400dd505160780083759f01441af1bbb10ea" +checksum = "3b36f1f98c8d7b6256b86d4a3c8c4abb120670267baa9712a485ba477eaac9e9" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -762,14 +751,15 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c18276dd28852f34b3bf501f4f3719781f4999a51c7bff1a5c6dc8c4529adc29" +checksum = "180898ed701a773fb3fadbd94b9e9559125cf88eeb1815ab99e35d4f5f34f7fb" dependencies = [ "aws-smithy-async", "aws-smithy-types", "bytes", "http 0.2.11", + "http 1.0.0", "pin-project-lite", "tokio", "tracing", @@ -778,9 +768,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.1.4" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb3e134004170d3303718baa2a4eb4ca64ee0a1c0a7041dca31b38be0fb414f3" +checksum = "897f1db4020ad91f2c2421945ec49b7e3eb81cc3fea99e8b5dd5be721e697fed" dependencies = [ "base64-simd", "bytes", @@ -796,30 +786,30 @@ dependencies = [ "serde", "time", "tokio", - "tokio-util", + "tokio-util 0.7.10", ] [[package]] name = "aws-smithy-xml" -version = "0.60.4" +version = "0.60.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8604a11b25e9ecaf32f9aa56b9fe253c5e2f606a3477f0071e96d3155a5ed218" +checksum = "d16f94c9673412b7a72e3c3efec8de89081c320bf59ea12eed34c417a62ad600" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "789bbe008e65636fe1b6dbbb374c40c8960d1232b96af5ff4aec349f9c4accf4" +checksum = "0ff7e122ee50ca962e9de91f5850cc37e2184b1219611eef6d44aa85929b54f6" dependencies = [ "aws-credential-types", "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", "http 0.2.11", - "rustc_version 0.4.0", + "rustc_version", "tracing", ] @@ -829,12 +819,12 @@ version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ - "addr2line 0.21.0", + "addr2line", "cc", - "cfg-if 1.0.0", + "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object", "rustc-demangle", ] @@ -844,6 +834,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + [[package]] name = "base64" version = "0.21.7" @@ -866,17 +862,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "bigdecimal" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1e50562e37200edf7c6c43e54a08e64a5553bfb59d9c297d5572512aa517256" -dependencies = [ - "num-bigint 0.3.3", - "num-integer", - "num-traits", -] - [[package]] name = "bigdecimal" version = "0.4.2" @@ -890,15 +875,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -911,18 +887,6 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" -[[package]] -name = "bitvec" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - [[package]] name = "blake2" version = "0.9.2" @@ -934,127 +898,37 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "blake3" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" -dependencies = [ - "arrayref", - "arrayvec", - "cc", - "cfg-if 0.1.10", - "constant_time_eq", - "crypto-mac", - "digest 0.9.0", -] - -[[package]] -name = "block-buffer" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" -dependencies = [ - "generic-array 0.14.7", -] - [[package]] name = "block-buffer" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "borsh" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" -dependencies = [ - "borsh-derive 0.9.3", - "hashbrown 0.11.2", + "generic-array", ] [[package]] name = "borsh" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" -dependencies = [ - "borsh-derive 0.10.3", - "hashbrown 0.13.2", -] - -[[package]] -name = "borsh-derive" -version = "0.9.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" dependencies = [ - "borsh-derive-internal 0.9.3", - "borsh-schema-derive-internal 0.9.3", - "proc-macro-crate 0.1.5", - "proc-macro2", - "syn 1.0.109", + "borsh-derive", + "cfg_aliases", ] [[package]] name = "borsh-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" -dependencies = [ - "borsh-derive-internal 0.10.3", - "borsh-schema-derive-internal 0.10.3", - "proc-macro-crate 0.1.5", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.3" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" dependencies = [ + "once_cell", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.49", + "syn_derive", ] [[package]] @@ -1086,31 +960,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bumpalo" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" - -[[package]] -name = "bytecheck" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.12" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] +checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" [[package]] name = "byteorder" @@ -1180,21 +1032,21 @@ dependencies = [ [[package]] name = "cfg-if" -version = "0.1.10" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "cfg-if" -version = "1.0.0" +name = "cfg_aliases" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1211,96 +1063,48 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "clap" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" -dependencies = [ - "atty", - "bitflags 1.3.2", - "clap_derive 3.2.25", - "clap_lex 0.2.4", - "indexmap 1.9.3", - "once_cell", - "strsim", - "termcolor", - "textwrap", + "generic-array", ] [[package]] name = "clap" -version = "4.4.18" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", - "clap_derive 4.4.7", + "clap_derive", ] [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", - "clap_lex 0.6.0", - "strsim", -] - -[[package]] -name = "clap_derive" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" -dependencies = [ - "heck 0.4.1", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", + "clap_lex", + "strsim 0.11.0", ] [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.48", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", + "syn 2.0.49", ] [[package]] name = "clap_lex" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" - -[[package]] -name = "cloudabi" -version = "0.0.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "colorchoice" @@ -1328,15 +1132,15 @@ dependencies = [ "dotenv", "lazy_static", "near-lake-framework", - "opentelemetry", + "opentelemetry 0.19.0", "opentelemetry-jaeger", "regex", "serde", "serde_derive", "serde_json", - "toml 0.8.9", + "toml 0.8.10", "tracing", - "tracing-opentelemetry", + "tracing-opentelemetry 0.19.0", "tracing-stackdriver", "tracing-subscriber", ] @@ -1347,12 +1151,6 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "convert_case" version = "0.4.0" @@ -1386,15 +1184,6 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" -[[package]] -name = "cpp_demangle" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" -dependencies = [ - "cfg-if 1.0.0", -] - [[package]] name = "cpufeatures" version = "0.2.12" @@ -1405,129 +1194,21 @@ dependencies = [ ] [[package]] -name = "cranelift-bforest" -version = "0.96.4" +name = "crc32c" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "182b82f78049f54d3aee5a19870d356ef754226665a695ce2fcdd5d55379718e" +checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" dependencies = [ - "cranelift-entity", + "rustc_version", ] [[package]] -name = "cranelift-codegen" -version = "0.96.4" +name = "crc32fast" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c027bf04ecae5b048d3554deb888061bc26f426afff47bf06d6ac933dce0a6" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ - "bumpalo", - "cranelift-bforest", - "cranelift-codegen-meta", - "cranelift-codegen-shared", - "cranelift-control", - "cranelift-entity", - "cranelift-isle", - "gimli 0.27.3", - "hashbrown 0.13.2", - "log", - "regalloc2", - "smallvec", - "target-lexicon 0.12.13", -] - -[[package]] -name = "cranelift-codegen-meta" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "649f70038235e4c81dba5680d7e5ae83e1081f567232425ab98b55b03afd9904" -dependencies = [ - "cranelift-codegen-shared", -] - -[[package]] -name = "cranelift-codegen-shared" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a1d1c5ee2611c6a0bdc8d42d5d3dc5ce8bf53a8040561e26e88b9b21f966417" - -[[package]] -name = "cranelift-control" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da66a68b1f48da863d1d53209b8ddb1a6236411d2d72a280ffa8c2f734f7219e" -dependencies = [ - "arbitrary", -] - -[[package]] -name = "cranelift-entity" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bd897422dbb66621fa558f4d9209875530c53e3c8f4b13b2849fbb667c431a6" -dependencies = [ - "serde", -] - -[[package]] -name = "cranelift-frontend" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05db883114c98cfcd6959f72278d2fec42e01ea6a6982cfe4f20e88eebe86653" -dependencies = [ - "cranelift-codegen", - "log", - "smallvec", - "target-lexicon 0.12.13", -] - -[[package]] -name = "cranelift-isle" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84559de86e2564152c87e299c8b2559f9107e9c6d274b24ebeb04fb0a5f4abf8" - -[[package]] -name = "cranelift-native" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f40b57f187f0fe1ffaf281df4adba2b4bc623a0f6651954da9f3c184be72761" -dependencies = [ - "cranelift-codegen", - "libc", - "target-lexicon 0.12.13", -] - -[[package]] -name = "cranelift-wasm" -version = "0.96.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3eab6084cc789b9dd0b1316241efeb2968199fee709f4bb4fe0fb0923bb468b" -dependencies = [ - "cranelift-codegen", - "cranelift-entity", - "cranelift-frontend", - "itertools 0.10.5", - "log", - "smallvec", - "wasmparser 0.103.0", - "wasmtime-types", -] - -[[package]] -name = "crc32c" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f48d60e5b4d2c53d5c2b1d8a58c849a70ae5e5509b08a48d047e3b65714a74" -dependencies = [ - "rustc_version 0.4.0", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1576,7 +1257,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ - "generic-array 0.14.7", + "generic-array", "rand_core 0.6.4", "subtle", "zeroize", @@ -1598,7 +1279,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.7", + "generic-array", "typenum", ] @@ -1608,7 +1289,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.7", + "generic-array", "subtle", ] @@ -1635,24 +1316,24 @@ dependencies = [ [[package]] name = "curl" -version = "0.4.44" +version = "0.4.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" +checksum = "1e2161dd6eba090ff1594084e95fd67aeccf04382ffea77999ea94ed42ec67b6" dependencies = [ "curl-sys", "libc", "openssl-probe", "openssl-sys", "schannel", - "socket2 0.4.10", - "winapi", + "socket2", + "windows-sys 0.52.0", ] [[package]] name = "curl-sys" -version = "0.4.71+curl-8.6.0" +version = "0.4.72+curl-8.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7b12a7ab780395666cb576203dc3ed6e01513754939a600b85196ccf5356bc5" +checksum = "29cbdc8314c447d11e8fd156dcdd031d9e02a7a976163e396b548c03153bc9ea" dependencies = [ "cc", "libc", @@ -1660,22 +1341,38 @@ dependencies = [ "openssl-sys", "pkg-config", "vcpkg", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "curve25519-dalek" -version = "3.2.0" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rand_core 0.6.4", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.49", +] + [[package]] name = "darling" version = "0.14.4" @@ -1688,12 +1385,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.5" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8" +checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" dependencies = [ - "darling_core 0.20.5", - "darling_macro 0.20.5", + "darling_core 0.20.6", + "darling_macro 0.20.6", ] [[package]] @@ -1706,22 +1403,22 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.10.0", "syn 1.0.109", ] [[package]] name = "darling_core" -version = "0.20.5" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3" +checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", - "strsim", - "syn 2.0.48", + "strsim 0.10.0", + "syn 2.0.49", ] [[package]] @@ -1737,13 +1434,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.5" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77" +checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" dependencies = [ - "darling_core 0.20.5", + "darling_core 0.20.6", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1752,11 +1449,11 @@ version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "hashbrown 0.14.3", - "lock_api 0.4.11", + "lock_api", "once_cell", - "parking_lot_core 0.9.9", + "parking_lot_core", ] [[package]] @@ -1765,8 +1462,8 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "bigdecimal 0.4.2", - "borsh 0.10.3", + "bigdecimal", + "borsh", "bytes", "configuration", "diesel", @@ -1778,11 +1475,12 @@ dependencies = [ "near-crypto", "near-indexer-primitives", "near-primitives", - "num-bigint 0.3.3", + "num-bigint 0.4.4", "num-traits", "prettytable-rs", "readnode-primitives", "scylla", + "scylla-cql", "serde", "serde_json", "tokio", @@ -1809,15 +1507,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63dfa964fe2a66f3fde91fc70b267fe193d822c7e603e2a675a49a7f46ad3f49" -[[package]] -name = "debugid" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" -dependencies = [ - "uuid", -] - [[package]] name = "der" version = "0.6.1" @@ -1846,23 +1535,23 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] name = "derive_builder" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "660047478bc508c0fde22c868991eec0c40a63e48d610befef466d48e2bee574" +checksum = "8f59169f400d8087f238c5c0c7db6a28af18681717f3b623227d92f397e938c7" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b217e6dd1011a54d12f3b920a411b5abd44b1716ecfe94f5f2f2f7b52e08ab7" +checksum = "a4ec317cc3e7ef0928b0ca6e4a634a4d6c001672ae210438cf114a83e56b018d" dependencies = [ "darling 0.14.4", "proc-macro2", @@ -1872,9 +1561,9 @@ dependencies = [ [[package]] name = "derive_builder_macro" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5f77d7e20ac9153428f7ca14a88aba652adfc7a0ef0a06d654386310ef663b" +checksum = "870368c3fb35b8031abb378861d4460f573b92238ec2152c927a21f77e3e0127" dependencies = [ "derive_builder_core", "syn 1.0.109", @@ -1889,7 +1578,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version 0.4.0", + "rustc_version", "syn 1.0.109", ] @@ -1899,7 +1588,7 @@ version = "2.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62c6fcf842f17f8c78ecf7c81d75c5ce84436b41ee07e03f490fbb5f5a8731d8" dependencies = [ - "bigdecimal 0.4.2", + "bigdecimal", "bitflags 2.4.2", "byteorder", "diesel_derives", @@ -1935,7 +1624,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1955,16 +1644,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.48", -] - -[[package]] -name = "digest" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" -dependencies = [ - "generic-array 0.12.4", + "syn 2.0.49", ] [[package]] @@ -1973,7 +1653,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -1982,7 +1662,7 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", "crypto-common", "subtle", ] @@ -1993,7 +1673,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -2008,71 +1688,12 @@ dependencies = [ "winapi", ] -[[package]] -name = "dissimilar" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" - [[package]] name = "dotenv" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" -[[package]] -name = "dynasm" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "lazy_static", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "dynasm" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33dc03612f42465a8ed7f5e354bc2b79ba54cedefa81d5bd3a064f1835adaba8" -dependencies = [ - "bitflags 1.3.2", - "byteorder", - "lazy_static", - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "dynasmrt" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" -dependencies = [ - "byteorder", - "dynasm 1.2.3", - "memmap2", -] - -[[package]] -name = "dynasmrt" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7dccc31a678058996aef614f6bd418ced384da70f284e83e2b7bf29b27b6a28" -dependencies = [ - "byteorder", - "dynasm 2.0.0", - "fnv", - "memmap2", -] - [[package]] name = "easy-ext" version = "0.2.9" @@ -2088,37 +1709,36 @@ dependencies = [ "der", "elliptic-curve", "rfc6979", - "signature", + "signature 1.6.4", ] [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "signature", + "signature 2.2.0", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", - "rand 0.7.3", - "serde", - "sha2 0.9.9", - "zeroize", + "rand_core 0.6.4", + "sha2", + "subtle", ] [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "elliptic-curve" @@ -2131,7 +1751,7 @@ dependencies = [ "der", "digest 0.10.7", "ff", - "generic-array 0.14.7", + "generic-array", "group", "pkcs8", "rand_core 0.6.4", @@ -2152,7 +1772,7 @@ version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -2172,28 +1792,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", -] - -[[package]] -name = "enumset" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" -dependencies = [ - "enumset_derive", -] - -[[package]] -name = "enumset_derive" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" -dependencies = [ - "darling 0.20.5", - "proc-macro2", - "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2201,13 +1800,12 @@ name = "epoch-indexer" version = "0.1.0" dependencies = [ "anyhow", - "clap 3.2.25", + "clap", "configuration", "database", - "futures", "near-chain-configs", "near-indexer-primitives", - "near-jsonrpc-client", + "near-jsonrpc-client 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "near-lake-framework", "readnode-primitives", "tokio", @@ -2222,24 +1820,13 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.3.31" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c138974f9d5e7fe373eb04df7cae98833802ae4b11c24ac7039a21d5af4b26c" +checksum = "388979d208a049ffdfb22fa33b9c81942215b940910bccfe258caeb25d125cb3" dependencies = [ "serde", ] -[[package]] -name = "errno" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" -dependencies = [ - "errno-dragonfly", - "libc", - "winapi", -] - [[package]] name = "errno" version = "0.3.8" @@ -2250,16 +1837,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "event-listener" version = "2.5.3" @@ -2307,20 +1884,10 @@ dependencies = [ ] [[package]] -name = "finite-wasm" -version = "0.5.0" +name = "fiat-crypto" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d81b511929c2669eaf64e36471cf27c2508133e62ade9d49e608e8d675e7854" -dependencies = [ - "bitvec", - "dissimilar", - "num-traits", - "prefix-sum-vec", - "thiserror", - "wasm-encoder", - "wasmparser 0.105.0", - "wasmprinter", -] +checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" [[package]] name = "finl_unicode" @@ -2337,6 +1904,12 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "flate2" version = "1.0.28" @@ -2387,12 +1960,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - [[package]] name = "futures" version = "0.3.30" @@ -2475,7 +2042,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2517,28 +2084,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "fxprof-processed-profile" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" -dependencies = [ - "bitflags 2.4.2", - "debugid", - "fxhash", - "serde", - "serde_json", -] - -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -2555,7 +2100,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -2566,22 +2111,11 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" -dependencies = [ - "fallible-iterator", - "indexmap 1.9.3", - "stable_deref_trait", -] - [[package]] name = "gimli" version = "0.28.1" @@ -2611,39 +2145,18 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.11", - "indexmap 2.2.2", + "indexmap 2.2.3", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.10", "tracing", ] -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash 0.7.7", -] - [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.7", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.7", -] [[package]] name = "hashbrown" @@ -2651,7 +2164,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash 0.8.7", + "ahash", "allocator-api2", ] @@ -2672,18 +2185,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -2709,6 +2213,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" version = "0.2.11" @@ -2777,7 +2290,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.5", + "socket2", "tokio", "tower-service", "tracing", @@ -2800,6 +2313,18 @@ dependencies = [ "tokio-rustls", ] +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -2865,9 +2390,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown 0.14.3", @@ -2880,7 +2405,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -2889,17 +2414,6 @@ version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.4", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "ipnet" version = "2.9.0" @@ -2908,12 +2422,12 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.4", - "rustix 0.38.31", + "hermit-abi", + "libc", "windows-sys 0.52.0", ] @@ -2968,18 +2482,18 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -2993,7 +2507,7 @@ checksum = "9dbbfed4e59ba9750e15ba154fdfd9329cee16ff3df539c2666b70f58cc32105" [[package]] name = "jsonrpc-v2" version = "0.11.0" -source = "git+https://github.com/kobayurii/jsonrpc-v2?rev=95e7b1d2567ae841163af212a3f25abb6862becb#95e7b1d2567ae841163af212a3f25abb6862becb" +source = "git+https://github.com/kobayurii/jsonrpc-v2?branch=master#ee01c71bcd2e131d787988728b7288734c2371df" dependencies = [ "actix-service", "actix-web", @@ -3030,12 +2544,6 @@ dependencies = [ "spin 0.5.2", ] -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - [[package]] name = "libc" version = "0.2.153" @@ -3056,7 +2564,7 @@ checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ "bitflags 2.4.2", "libc", - "redox_syscall 0.4.1", + "redox_syscall", ] [[package]] @@ -3071,12 +2579,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.13" @@ -3100,15 +2602,6 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - [[package]] name = "lock_api" version = "0.4.11" @@ -3125,40 +2618,11 @@ version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -[[package]] -name = "loupe" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6a72dfa44fe15b5e76b94307eeb2ff995a8c5b283b55008940c02e0c5b634d" -dependencies = [ - "loupe-derive", - "rustversion", -] - -[[package]] -name = "loupe-derive" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fbfc88337168279f2e9ae06e157cfed4efd3316e14dc96ed074d4f2e6c5952" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "lru" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" -dependencies = [ - "hashbrown 0.12.3", -] - [[package]] name = "lru" -version = "0.11.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a83fb7698b3643a0e34f9ae6f2e8f0178c0fd42f8b59d493aa271ff3a5bf21" +checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22" dependencies = [ "hashbrown 0.14.3", ] @@ -3172,15 +2636,6 @@ dependencies = [ "twox-hash", ] -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - [[package]] name = "matchers" version = "0.1.0" @@ -3196,7 +2651,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "digest 0.10.7", ] @@ -3206,43 +2661,6 @@ version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" -[[package]] -name = "memfd" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" -dependencies = [ - "rustix 0.38.31", -] - -[[package]] -name = "memmap" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.8.0" @@ -3301,10 +2719,16 @@ dependencies = [ ] [[package]] -name = "more-asserts" -version = "0.2.2" +name = "multimap" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" + +[[package]] +name = "mutually_exclusive_features" +version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" +checksum = "6d02c0b00610773bb7fc61d85e13d86c7858cbdf00e1a120bfc41bc055dbaa0e" [[package]] name = "native-tls" @@ -3326,45 +2750,42 @@ dependencies = [ [[package]] name = "near-account-id" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35cbb989542587b47205e608324ddd391f0cee1c22b4b64ae49f458334b95907" dependencies = [ - "borsh 0.10.3", + "borsh", "serde", ] -[[package]] -name = "near-cache" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" -dependencies = [ - "lru 0.7.8", -] - [[package]] name = "near-chain-configs" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e5a8ace81c09d7eb165dffc1742358a021b2fa761f2160943305f83216003" dependencies = [ "anyhow", + "bytesize", "chrono", "derive_more", "near-config-utils", "near-crypto", + "near-parameters", "near-primitives", "num-rational", "once_cell", "serde", "serde_json", - "sha2 0.10.8", + "sha2", "smart-default", "tracing", ] [[package]] name = "near-config-utils" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ae1eaab1d545a9be7a55b6ef09f365c2017f93a03063547591d12c0c6d27e58" dependencies = [ "anyhow", "json_comments", @@ -3374,11 +2795,12 @@ dependencies = [ [[package]] name = "near-crypto" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2991d2912218a80ec0733ac87f84fa803accea105611eea209d4419271957667" dependencies = [ "blake2", - "borsh 0.10.3", + "borsh", "bs58", "c2-chacha", "curve25519-dalek", @@ -3400,16 +2822,18 @@ dependencies = [ [[package]] name = "near-fmt" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7d998dfc1e04001608899b2498ad5a782c7d036b73769d510de21964db99286" dependencies = [ "near-primitives-core", ] [[package]] name = "near-indexer-primitives" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "362042db6d020aba9ac03dadf32088f848cc2156c9a7976d45a2a9cf6b18548e" dependencies = [ "near-primitives", "serde", @@ -3418,10 +2842,29 @@ dependencies = [ [[package]] name = "near-jsonrpc-client" -version = "0.7.0" -source = "git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.7.0#55396b286cfb1f5d7c8e6d7caa9db73d087c821c" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18ad81e015f7aced8925d5b9ba3f369b36da9575c15812cfd0786bc1213284ca" +dependencies = [ + "borsh", + "lazy_static", + "log", + "near-chain-configs", + "near-crypto", + "near-jsonrpc-primitives", + "near-primitives", + "reqwest", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "near-jsonrpc-client" +version = "0.8.0" +source = "git+https://github.com/near/near-jsonrpc-client-rs.git?branch=telezhnaya/wait_until#a4f27a4a6155b5572876dd46950ec8d3a680f12e" dependencies = [ - "borsh 0.10.3", + "borsh", "lazy_static", "log", "near-chain-configs", @@ -3436,8 +2879,9 @@ dependencies = [ [[package]] name = "near-jsonrpc-primitives" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0ce745e954ae776eef05957602e638ee9581106a3675946fb43c2fe7e38ef03" dependencies = [ "arbitrary", "near-chain-configs", @@ -3451,8 +2895,9 @@ dependencies = [ [[package]] name = "near-lake-framework" -version = "0.7.9" -source = "git+https://github.com/kobayurii/near-lake-framework-rs.git?branch=0.7.9#8b76ca8c1e335e3c888fa3efe523e16daf9ff2db" +version = "0.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e58822a397bad3a8d189aad5aa2366c1109090fb7bab04289c78ab1f31c7ba4c" dependencies = [ "anyhow", "async-stream", @@ -3473,15 +2918,64 @@ dependencies = [ "tracing", ] +[[package]] +name = "near-o11y" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d20762631bc8253030013bbae9b5f0542691edc1aa6722f1e8141cc9b928ae5b" +dependencies = [ + "actix", + "base64 0.21.7", + "clap", + "near-crypto", + "near-fmt", + "near-primitives-core", + "once_cell", + "opentelemetry 0.17.0", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions 0.9.0", + "prometheus", + "serde", + "serde_json", + "strum 0.24.1", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-opentelemetry 0.17.4", + "tracing-subscriber", +] + +[[package]] +name = "near-parameters" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9f16a59b6c3e69b0585be951af6fe42a0ba86c0e207cb8c63badd19efd16680" +dependencies = [ + "assert_matches", + "borsh", + "enum-map", + "near-account-id", + "near-primitives-core", + "num-rational", + "serde", + "serde_repr", + "serde_yaml", + "strum 0.24.1", + "thiserror", +] + [[package]] name = "near-primitives" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0462b067732132babcc89d5577db3bfcb0a1bcfbaaed3f2db4c11cd033666314" dependencies = [ "arbitrary", - "borsh 0.10.3", + "base64 0.21.7", + "borsh", "bytesize", - "cfg-if 1.0.0", + "cfg-if", "chrono", "derive_more", "easy-ext", @@ -3489,6 +2983,8 @@ dependencies = [ "hex", "near-crypto", "near-fmt", + "near-o11y", + "near-parameters", "near-primitives-core", "near-rpc-error-macro", "near-stdx", @@ -3497,11 +2993,13 @@ dependencies = [ "once_cell", "primitive-types", "rand 0.8.5", + "rand_chacha 0.3.1", "reed-solomon-erasure", "serde", "serde_json", "serde_with", "serde_yaml", + "sha3", "smart-default", "strum 0.24.1", "thiserror", @@ -3511,12 +3009,13 @@ dependencies = [ [[package]] name = "near-primitives-core" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8443eb718606f572c438be6321a097a8ebd69f8e48d953885b4f16601af88225" dependencies = [ "arbitrary", - "base64", - "borsh 0.10.3", + "base64 0.21.7", + "borsh", "bs58", "derive_more", "enum-map", @@ -3525,192 +3024,70 @@ dependencies = [ "serde", "serde_repr", "serde_with", - "sha2 0.10.8", + "sha2", "strum 0.24.1", "thiserror", ] [[package]] name = "near-rpc-error-core" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80fca203c51edd9595ec14db1d13359fb9ede32314990bf296b6c5c4502f6ab7" dependencies = [ "quote", "serde", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] name = "near-rpc-error-macro" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897a445de2102f6732c8a185d922f5e3bf7fd0a41243ce40854df2197237f799" dependencies = [ "fs2", "near-rpc-error-core", "serde", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] name = "near-stdx" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" - -[[package]] -name = "near-vm-compiler" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" -dependencies = [ - "enumset", - "finite-wasm", - "near-vm-types", - "near-vm-vm", - "rkyv", - "smallvec", - "target-lexicon 0.12.13", - "thiserror", - "tracing", - "wasmparser 0.99.0", -] - -[[package]] -name = "near-vm-compiler-singlepass" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" -dependencies = [ - "dynasm 2.0.0", - "dynasmrt 2.0.0", - "enumset", - "finite-wasm", - "lazy_static", - "memoffset 0.8.0", - "more-asserts", - "near-vm-compiler", - "near-vm-types", - "near-vm-vm", - "rayon", - "smallvec", - "strum 0.24.1", - "tracing", -] - -[[package]] -name = "near-vm-engine" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" -dependencies = [ - "backtrace", - "cfg-if 1.0.0", - "enumset", - "finite-wasm", - "lazy_static", - "memmap2", - "more-asserts", - "near-vm-compiler", - "near-vm-types", - "near-vm-vm", - "region", - "rkyv", - "rustc-demangle", - "target-lexicon 0.12.13", - "thiserror", - "tracing", -] +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "855fd5540e3b4ff6fedf12aba2db1ee4b371b36f465da1363a6d022b27cb43b8" [[package]] name = "near-vm-runner" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56c80bdb1954808f59bd36a9112377197b38d424991383bf05f52d0fe2e0da5" dependencies = [ - "anyhow", - "base64", - "borsh 0.10.3", + "base64 0.21.7", + "borsh", "ed25519-dalek", - "finite-wasm", - "loupe", - "memoffset 0.8.0", - "near-cache", + "enum-map", + "memoffset", "near-crypto", + "near-parameters", "near-primitives-core", "near-stdx", - "near-vm-compiler", - "near-vm-compiler-singlepass", - "near-vm-engine", - "near-vm-types", - "near-vm-vm", + "num-rational", "once_cell", - "parity-wasm 0.41.0", - "parity-wasm 0.42.2", "prefix-sum-vec", - "pwasm-utils", "ripemd", "serde", + "serde_repr", "serde_with", - "sha2 0.10.8", + "sha2", "sha3", "strum 0.24.1", "thiserror", "tracing", - "wasm-encoder", - "wasmer-compiler-near", - "wasmer-compiler-singlepass-near", - "wasmer-engine-near", - "wasmer-engine-universal-near", - "wasmer-runtime-core-near", - "wasmer-runtime-near", - "wasmer-types-near", - "wasmer-vm-near", - "wasmparser 0.78.2", - "wasmtime", "zeropool-bn", ] -[[package]] -name = "near-vm-types" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" -dependencies = [ - "indexmap 1.9.3", - "num-traits", - "rkyv", - "thiserror", -] - -[[package]] -name = "near-vm-vm" -version = "1.36.0" -source = "git+https://github.com/near/nearcore.git?branch=1.36.0#b0c5d14557b0e24ee8f4ffcc293963b8ccf633a6" -dependencies = [ - "backtrace", - "cc", - "cfg-if 1.0.0", - "finite-wasm", - "indexmap 1.9.3", - "libc", - "memoffset 0.8.0", - "more-asserts", - "near-vm-types", - "region", - "rkyv", - "thiserror", - "tracing", - "wasmparser 0.99.0", - "winapi", -] - -[[package]] -name = "nix" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" -dependencies = [ - "bitflags 1.3.2", - "cc", - "cfg-if 0.1.10", - "libc", - "void", -] - [[package]] name = "ntapi" version = "0.4.1" @@ -3760,11 +3137,10 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] @@ -3783,9 +3159,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -3796,7 +3172,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.4", + "hermit-abi", "libc", ] @@ -3818,19 +3194,7 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.48", -] - -[[package]] -name = "object" -version = "0.30.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" -dependencies = [ - "crc32fast", - "hashbrown 0.13.2", - "indexmap 1.9.3", - "memchr", + "syn 2.0.49", ] [[package]] @@ -3861,7 +3225,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ "bitflags 2.4.2", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", "libc", "once_cell", @@ -3877,7 +3241,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -3900,15 +3264,36 @@ dependencies = [ [[package]] name = "opentelemetry" -version = "0.19.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4b8347cc26099d3aeee044065ecc3ae11469796b4d65d065a23a584ed92a6f" +checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" dependencies = [ - "opentelemetry_api", - "opentelemetry_sdk", -] - -[[package]] + "async-trait", + "crossbeam-channel", + "futures-channel", + "futures-executor", + "futures-util", + "js-sys", + "lazy_static", + "percent-encoding", + "pin-project", + "rand 0.8.5", + "thiserror", + "tokio", + "tokio-stream", +] + +[[package]] +name = "opentelemetry" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4b8347cc26099d3aeee044065ecc3ae11469796b4d65d065a23a584ed92a6f" +dependencies = [ + "opentelemetry_api", + "opentelemetry_sdk", +] + +[[package]] name = "opentelemetry-http" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3933,21 +3318,48 @@ dependencies = [ "http 0.2.11", "isahc", "once_cell", - "opentelemetry", + "opentelemetry 0.19.0", "opentelemetry-http", - "opentelemetry-semantic-conventions", + "opentelemetry-semantic-conventions 0.11.0", "thiserror", "thrift", "tokio", ] +[[package]] +name = "opentelemetry-otlp" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1a6ca9de4c8b00aa7f1a153bd76cb263287155cec642680d79d98706f3d28a" +dependencies = [ + "async-trait", + "futures", + "futures-util", + "http 0.2.11", + "opentelemetry 0.17.0", + "prost", + "thiserror", + "tokio", + "tonic", + "tonic-build", +] + +[[package]] +name = "opentelemetry-semantic-conventions" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985cc35d832d412224b2cffe2f9194b1b89b6aa5d0bef76d080dce09d90e62bd" +dependencies = [ + "opentelemetry 0.17.0", +] + [[package]] name = "opentelemetry-semantic-conventions" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24e33428e6bf08c6f7fcea4ddb8e358fab0fe48ab877a87c70c6ebe20f673ce5" dependencies = [ - "opentelemetry", + "opentelemetry 0.19.0", ] [[package]] @@ -3997,12 +3409,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "outref" version = "0.5.1" @@ -4023,69 +3429,23 @@ checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" dependencies = [ "ecdsa", "elliptic-curve", - "sha2 0.10.8", + "sha2", ] -[[package]] -name = "page_size" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "parity-wasm" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" - -[[package]] -name = "parity-wasm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" - [[package]] name = "parking" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" -[[package]] -name = "parking_lot" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.3", -] - [[package]] name = "parking_lot" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "lock_api 0.4.11", - "parking_lot_core 0.9.9", -] - -[[package]] -name = "parking_lot_core" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b93f386bb233083c799e6e642a9d73db98c24a5deeb95ffc85bf281255dffc98" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi", - "libc", - "redox_syscall 0.1.57", - "smallvec", - "winapi", + "lock_api", + "parking_lot_core", ] [[package]] @@ -4094,9 +3454,9 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall", "smallvec", "windows-targets 0.48.5", ] @@ -4119,11 +3479,11 @@ version = "0.1.0" dependencies = [ "anyhow", "chrono", - "clap 4.4.18", + "clap", "dotenv", "futures", - "http 0.2.11", - "near-jsonrpc-client", + "http 1.0.0", + "near-jsonrpc-client 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "near-jsonrpc-primitives", "near-primitives", "rand 0.8.5", @@ -4132,6 +3492,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "petgraph" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +dependencies = [ + "fixedbitset", + "indexmap 2.2.3", +] + [[package]] name = "phf" version = "0.11.2" @@ -4167,7 +3537,7 @@ checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -4194,9 +3564,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" + +[[package]] +name = "platforms" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "polling" @@ -4206,7 +3582,7 @@ checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if 1.0.0", + "cfg-if", "concurrent-queue", "libc", "log", @@ -4220,7 +3596,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49b6c5ef183cd3ab4ba005f1ca64c21e8bd97ce4699cfea9e8d9a2c4958ca520" dependencies = [ - "base64", + "base64 0.21.7", "byteorder", "bytes", "fallible-iterator", @@ -4228,7 +3604,7 @@ dependencies = [ "md-5", "memchr", "rand 0.8.5", - "sha2 0.10.8", + "sha2", "stringprep", ] @@ -4296,21 +3672,21 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "0.1.5" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ - "toml 0.5.11", + "once_cell", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "toml_edit 0.21.1", ] [[package]] @@ -4322,7 +3698,6 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", "version_check", ] @@ -4352,61 +3727,74 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fnv", "lazy_static", "memchr", - "parking_lot 0.12.1", + "parking_lot", "protobuf", "thiserror", ] [[package]] -name = "protobuf" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" - -[[package]] -name = "psm" -version = "0.1.21" +name = "prost" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ - "cc", + "bytes", + "prost-derive", ] [[package]] -name = "ptr_meta" -version = "0.1.4" +name = "prost-build" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" dependencies = [ - "ptr_meta_derive", + "bytes", + "heck 0.3.3", + "itertools 0.10.5", + "lazy_static", + "log", + "multimap", + "petgraph", + "prost", + "prost-types", + "regex", + "tempfile", + "which", ] [[package]] -name = "ptr_meta_derive" -version = "0.1.4" +name = "prost-derive" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" dependencies = [ + "anyhow", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", ] [[package]] -name = "pwasm-utils" -version = "0.12.0" +name = "prost-types" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7a12f176deee919f4ba55326ee17491c8b707d0987aed822682c821b660192" +checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ - "byteorder", - "log", - "parity-wasm 0.41.0", + "bytes", + "prost", ] +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + [[package]] name = "quote" version = "1.0.35" @@ -4416,12 +3804,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - [[package]] name = "rand" version = "0.7.3" @@ -4530,7 +3912,7 @@ dependencies = [ "actix-web", "anyhow", "assert-json-diff", - "borsh 0.10.3", + "borsh", "configuration", "database", "erased-serde", @@ -4539,13 +3921,14 @@ dependencies = [ "hex", "jsonrpc-v2", "lazy_static", - "lru 0.11.1", + "lru", "near-chain-configs", "near-crypto", "near-indexer-primitives", - "near-jsonrpc-client", + "near-jsonrpc-client 0.8.0 (git+https://github.com/near/near-jsonrpc-client-rs.git?branch=telezhnaya/wait_until)", "near-jsonrpc-primitives", "near-lake-framework", + "near-parameters", "near-primitives", "near-vm-runner", "paste", @@ -4566,21 +3949,14 @@ name = "readnode-primitives" version = "0.1.0" dependencies = [ "anyhow", - "borsh 0.10.3", + "borsh", "near-chain-configs", "near-indexer-primitives", - "num-bigint 0.3.3", "num-traits", "serde", "serde_json", ] -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - [[package]] name = "redox_syscall" version = "0.4.1" @@ -4610,19 +3986,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "regalloc2" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4a52e724646c6c0800fc456ec43b4165d2f91fba88ceaca06d9e0b400023478" -dependencies = [ - "hashbrown 0.13.2", - "log", - "rustc-hash", - "slice-group-by", - "smallvec", -] - [[package]] name = "regex" version = "1.10.3" @@ -4673,34 +4036,13 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" -[[package]] -name = "region" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" -dependencies = [ - "bitflags 1.3.2", - "libc", - "mach", - "winapi", -] - -[[package]] -name = "rend" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" -dependencies = [ - "bytecheck", -] - [[package]] name = "reqwest" version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -4753,16 +4095,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom 0.2.12", "libc", "spin 0.9.8", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4774,83 +4117,25 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "rkyv" -version = "0.7.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" -dependencies = [ - "bitvec", - "bytecheck", - "bytes", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "rustc-demangle" version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-hex" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.21", -] - -[[package]] -name = "rustix" -version = "0.37.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" -dependencies = [ - "bitflags 1.3.2", - "errno 0.3.8", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", + "semver", ] [[package]] @@ -4860,9 +4145,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", - "errno 0.3.8", + "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys", "windows-sys 0.52.0", ] @@ -4896,7 +4181,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64", + "base64 0.21.7", ] [[package]] @@ -4917,9 +4202,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "schannel" @@ -4936,7 +4221,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1473e24c637950c9bd38763220bea91ec3e095a89f672bbd7a10d03e77ba467" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-utils", ] @@ -4958,13 +4243,12 @@ dependencies = [ [[package]] name = "scylla" -version = "0.9.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8338911f1c2a7bf8ba4036997196e49e9eda8d4414af10548e9420e23a5dbd6f" +checksum = "03d2db76aa23f55d2ece5354e1a3778633098a3d1ea76153f494d71e92cd02d8" dependencies = [ "arc-swap", "async-trait", - "bigdecimal 0.2.2", "byteorder", "bytes", "chrono", @@ -4973,7 +4257,6 @@ dependencies = [ "histogram", "itertools 0.11.0", "lz4_flex", - "num-bigint 0.3.3", "num_enum", "rand 0.8.5", "rand_pcg", @@ -4981,7 +4264,7 @@ dependencies = [ "scylla-macros", "smallvec", "snap", - "socket2 0.5.5", + "socket2", "strum 0.23.0", "strum_macros 0.23.1", "thiserror", @@ -4992,42 +4275,40 @@ dependencies = [ [[package]] name = "scylla-cql" -version = "0.0.8" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048bdf0be96308ec0f5aeed2847bb2270f53355425b3afd67e64efc99d70b3e3" +checksum = "345626c0dd5d9624c413daaba854685bba6a65cff4eb5ea0fb0366df16901f67" dependencies = [ "async-trait", - "bigdecimal 0.2.2", + "bigdecimal", "byteorder", "bytes", "chrono", "lz4_flex", "num-bigint 0.3.3", + "num-bigint 0.4.4", "num_enum", "scylla-macros", + "secrecy", "snap", "thiserror", + "time", "tokio", "uuid", ] [[package]] name = "scylla-macros" -version = "0.2.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66bbac3874ee838894b5a82c5833c2b0b29d39ca5ad486d982ee434177b2cc57" +checksum = "eb6085ff9c3fd7e5163826901d39164ab86f11bdca16b2f766a00c528ff9cef9" dependencies = [ + "darling 0.20.6", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - [[package]] name = "sec1" version = "0.3.0" @@ -5036,7 +4317,7 @@ checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ "base16ct", "der", - "generic-array 0.14.7", + "generic-array", "pkcs8", "subtle", "zeroize", @@ -5061,6 +4342,15 @@ dependencies = [ "cc", ] +[[package]] +name = "secrecy" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0673d6a6449f5e7d12a1caf424fd9363e2af3a4953023ed455e3c4beef4597c0" +dependencies = [ + "zeroize", +] + [[package]] name = "security-framework" version = "2.9.2" @@ -5086,24 +4376,9 @@ dependencies = [ [[package]] name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" - -[[package]] -name = "semver-parser" -version = "0.7.0" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" @@ -5114,25 +4389,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-bench" -version = "0.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d733da87e79faaac25616e33d26299a41143fd4cd42746cbb0e91d8feea243fd" -dependencies = [ - "byteorder", - "serde", -] - -[[package]] -name = "serde_bytes" -version = "0.11.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" -dependencies = [ - "serde", -] - [[package]] name = "serde_derive" version = "1.0.196" @@ -5141,7 +4397,7 @@ checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -5163,7 +4419,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -5189,16 +4445,17 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b0ed1662c5a68664f45b76d18deb0e234aff37207086803165c961eb695e981" +checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" dependencies = [ - "base64", + "base64 0.21.7", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.2", + "indexmap 2.2.3", "serde", + "serde_derive", "serde_json", "serde_with_macros", "time", @@ -5206,23 +4463,23 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568577ff0ef47b879f736cd66740e022f3672788cdf002a05a4e609ea5a6fb15" +checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" dependencies = [ - "darling 0.20.5", + "darling 0.20.6", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] name = "serde_yaml" -version = "0.9.31" +version = "0.9.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf8a49373e98a4c5f0ceb5d05aa7c648d75f63774981ed95b7c7443bbd50c6e" +checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.3", "itoa", "ryu", "serde", @@ -5235,37 +4492,24 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", "digest 0.10.7", ] [[package]] name = "sha2" -version = "0.9.9" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "block-buffer 0.9.0", - "cfg-if 1.0.0", + "cfg-if", "cpufeatures", - "digest 0.9.0", - "opaque-debug", + "digest 0.10.7", ] [[package]] -name = "sha2" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" +name = "sha3" version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" @@ -5303,10 +4547,10 @@ dependencies = [ ] [[package]] -name = "simdutf8" -version = "0.1.4" +name = "signature" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" [[package]] name = "siphasher" @@ -5323,12 +4567,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slice-group-by" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" - [[package]] name = "sluice" version = "0.5.5" @@ -5363,16 +4601,6 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -5405,20 +4633,14 @@ dependencies = [ "der", ] -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "state-indexer" version = "0.1.0" dependencies = [ "actix-web", "anyhow", - "borsh 0.10.3", - "clap 3.2.25", + "borsh", + "clap", "configuration", "database", "epoch-indexer", @@ -5427,7 +4649,7 @@ dependencies = [ "humantime", "lazy_static", "near-indexer-primitives", - "near-jsonrpc-client", + "near-jsonrpc-client 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "near-lake-framework", "near-primitives", "openssl-probe", @@ -5460,6 +4682,12 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +[[package]] +name = "strsim" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" + [[package]] name = "strum" version = "0.23.0" @@ -5520,15 +4748,27 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" 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.49", +] + [[package]] name = "sync_wrapper" version = "0.1.2" @@ -5537,17 +4777,17 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sysinfo" -version = "0.29.11" +version = "0.30.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd727fc423c2060f6c92d9534cef765c65a6ed3f428a03d7def74a8c4348e666" +checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "core-foundation-sys", "libc", "ntapi", "once_cell", "rayon", - "winapi", + "windows", ] [[package]] @@ -5571,34 +4811,15 @@ dependencies = [ "libc", ] -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "target-lexicon" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" - -[[package]] -name = "target-lexicon" -version = "0.12.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" - [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand 2.0.1", - "redox_syscall 0.4.1", - "rustix 0.38.31", + "rustix", "windows-sys 0.52.0", ] @@ -5613,39 +4834,24 @@ dependencies = [ "winapi", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -5654,7 +4860,7 @@ version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -5737,15 +4943,25 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "tracing", "windows-sys 0.48.0", ] +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-macros" version = "2.2.0" @@ -5754,7 +4970,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -5780,16 +4996,16 @@ dependencies = [ "futures-channel", "futures-util", "log", - "parking_lot 0.12.1", + "parking_lot", "percent-encoding", "phf", "pin-project-lite", "postgres-protocol", "postgres-types", "rand 0.8.5", - "socket2 0.5.5", + "socket2", "tokio", - "tokio-util", + "tokio-util 0.7.10", "whoami", ] @@ -5816,25 +5032,30 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ "bytes", "futures-core", "futures-sink", + "log", "pin-project-lite", "tokio", - "tracing", ] [[package]] -name = "toml" -version = "0.5.11" +name = "tokio-util" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ - "serde", + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", ] [[package]] @@ -5851,14 +5072,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.1", + "toml_edit 0.22.6", ] [[package]] @@ -5876,11 +5097,11 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.3", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -5889,13 +5110,93 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.2", + "indexmap 2.2.3", + "toml_datetime", + "winnow 0.5.40", +] + +[[package]] +name = "toml_edit" +version = "0.22.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +dependencies = [ + "indexmap 2.2.3", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.1", ] +[[package]] +name = "tonic" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" +dependencies = [ + "async-stream", + "async-trait", + "base64 0.13.1", + "bytes", + "futures-core", + "futures-util", + "h2", + "http 0.2.11", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "prost-derive", + "tokio", + "tokio-stream", + "tokio-util 0.6.10", + "tower", + "tower-layer", + "tower-service", + "tracing", + "tracing-futures", +] + +[[package]] +name = "tonic-build" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" +dependencies = [ + "proc-macro2", + "prost-build", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util 0.7.10", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -5916,16 +5217,29 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.6.2" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d725b8fa6ef307b3f4856913523337de45c47cc79271bafd7acfb39559e3a2da" +checksum = "1fe0d5feac3f4ca21ba33496bcb1ccab58cca6412b1405ae80f0581541e0ca78" dependencies = [ "actix-web", + "mutually_exclusive_features", "pin-project", "tracing", "uuid", ] +[[package]] +name = "tracing-appender" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" +dependencies = [ + "crossbeam-channel", + "thiserror", + "time", + "tracing-subscriber", +] + [[package]] name = "tracing-attributes" version = "0.1.27" @@ -5934,7 +5248,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -5979,6 +5293,20 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-opentelemetry" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" +dependencies = [ + "once_cell", + "opentelemetry 0.17.0", + "tracing", + "tracing-core", + "tracing-log 0.1.4", + "tracing-subscriber", +] + [[package]] name = "tracing-opentelemetry" version = "0.19.0" @@ -5986,7 +5314,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00a39dcf9bfc1742fa4d6215253b33a6e474be78275884c216fc2a06267b3600" dependencies = [ "once_cell", - "opentelemetry", + "opentelemetry 0.19.0", "tracing", "tracing-core", "tracing-log 0.1.4", @@ -6051,7 +5379,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "static_assertions", ] @@ -6061,7 +5389,7 @@ version = "0.1.0" dependencies = [ "actix-web", "anyhow", - "clap 3.2.25", + "clap", "configuration", "database", "futures", @@ -6069,7 +5397,7 @@ dependencies = [ "humantime", "lazy_static", "near-indexer-primitives", - "near-jsonrpc-client", + "near-jsonrpc-client 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "near-lake-framework", "prometheus", "readnode-primitives", @@ -6119,9 +5447,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" @@ -6191,12 +5519,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" -[[package]] -name = "void" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" - [[package]] name = "vsimd" version = "0.8.0" @@ -6232,36 +5554,36 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -6269,9 +5591,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6279,435 +5601,43 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" - -[[package]] -name = "wasm-encoder" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77053dc709db790691d3732cfc458adc5acc881dec524965c608effdcd9c581" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasmer-compiler-near" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fdae7245128f284476e6db9653ef0a15b011975091bcd7f9d7303132409662" -dependencies = [ - "enumset", - "rkyv", - "smallvec", - "target-lexicon 0.12.13", - "thiserror", - "wasmer-types-near", - "wasmer-vm-near", - "wasmparser 0.78.2", -] - -[[package]] -name = "wasmer-compiler-singlepass-near" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac4af0e438015585eb27b2c6f6869c58c540bfe27408b686b1778470bf301050" -dependencies = [ - "byteorder", - "dynasm 1.2.3", - "dynasmrt 1.2.3", - "lazy_static", - "memoffset 0.6.5", - "more-asserts", - "rayon", - "smallvec", - "wasmer-compiler-near", - "wasmer-types-near", - "wasmer-vm-near", -] - -[[package]] -name = "wasmer-engine-near" -version = "2.4.1" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4048411cabb2c94c7d8d11d9d0282cc6b15308b61ebc1e122c40e89865ebb5c5" -dependencies = [ - "backtrace", - "enumset", - "lazy_static", - "memmap2", - "more-asserts", - "rustc-demangle", - "target-lexicon 0.12.13", - "thiserror", - "wasmer-compiler-near", - "wasmer-types-near", - "wasmer-vm-near", -] +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] -name = "wasmer-engine-universal-near" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f31c3d2850ac7957406d3c9581d9435ea8126a26478709fa7e931b6f562b4d" -dependencies = [ - "cfg-if 1.0.0", - "enumset", - "leb128", - "region", - "rkyv", - "thiserror", - "wasmer-compiler-near", - "wasmer-engine-near", - "wasmer-types-near", - "wasmer-vm-near", - "winapi", -] - -[[package]] -name = "wasmer-runtime-core-near" -version = "0.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3fac37da3c625e98708c5dd92d3f642aaf700fd077168d3d0fff277ec6a165" -dependencies = [ - "bincode", - "blake3", - "borsh 0.9.3", - "cc", - "digest 0.8.1", - "errno 0.2.8", - "hex", - "indexmap 1.9.3", - "lazy_static", - "libc", - "nix", - "page_size", - "parking_lot 0.10.2", - "rustc_version 0.2.3", - "serde", - "serde-bench", - "serde_bytes", - "serde_derive", - "smallvec", - "target-lexicon 0.10.0", - "wasmparser 0.51.4", - "winapi", -] - -[[package]] -name = "wasmer-runtime-near" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "158e6fff11e5e1ef805af50637374d5bd43d92017beafa18992cdf7f3f7ae3e4" -dependencies = [ - "lazy_static", - "memmap", - "serde", - "serde_derive", - "wasmer-runtime-core-near", - "wasmer-singlepass-backend-near", -] - -[[package]] -name = "wasmer-singlepass-backend-near" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6edd0ba6c0bcf9b279186d4dbe81649dda3e5ef38f586865943de4dcd653f8" -dependencies = [ - "bincode", - "borsh 0.9.3", - "byteorder", - "dynasm 1.2.3", - "dynasmrt 1.2.3", - "lazy_static", - "libc", - "nix", - "serde", - "serde_derive", - "smallvec", - "wasmer-runtime-core-near", -] - -[[package]] -name = "wasmer-types-near" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ba154adffb0fbd33f5dabd3788a1744d846b43e6e090d44269c7ee8fa5743e4" -dependencies = [ - "indexmap 1.9.3", - "rkyv", - "thiserror", -] - -[[package]] -name = "wasmer-vm-near" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a5585596f6e9915d606de944aece51626736fb1191aefb5b2ef108c6f7604a" -dependencies = [ - "backtrace", - "cc", - "cfg-if 1.0.0", - "indexmap 1.9.3", - "libc", - "memoffset 0.6.5", - "more-asserts", - "region", - "rkyv", - "thiserror", - "wasmer-types-near", - "winapi", -] - -[[package]] -name = "wasmparser" -version = "0.51.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb1956b19469d1c5e63e459d29e7b5aa0f558d9f16fcef09736f8a265e6c10a" - -[[package]] -name = "wasmparser" -version = "0.78.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52144d4c78e5cf8b055ceab8e5fa22814ce4315d6002ad32cfd914f37c12fd65" - -[[package]] -name = "wasmparser" -version = "0.99.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef3b717afc67f848f412d4f02c127dd3e35a0eecd58c684580414df4fde01d3" -dependencies = [ - "indexmap 1.9.3", - "url", -] - -[[package]] -name = "wasmparser" -version = "0.103.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c437373cac5ea84f1113d648d51f71751ffbe3d90c00ae67618cf20d0b5ee7b" -dependencies = [ - "indexmap 1.9.3", - "url", -] - -[[package]] -name = "wasmparser" -version = "0.105.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83be9e0b3f9570dc1979a33ae7b89d032c73211564232b99976553e5c155ec32" -dependencies = [ - "indexmap 1.9.3", - "url", -] - -[[package]] -name = "wasmprinter" -version = "0.2.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b0e5ed7a74a065637f0d7798ce5f29cadb064980d24b0c82af5200122fa0d8" -dependencies = [ - "anyhow", - "wasmparser 0.105.0", -] - -[[package]] -name = "wasmtime" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634357e8668774b24c80b210552f3f194e2342a065d6d83845ba22c5817d0770" -dependencies = [ - "anyhow", - "bincode", - "bumpalo", - "cfg-if 1.0.0", - "fxprof-processed-profile", - "indexmap 1.9.3", - "libc", - "log", - "object 0.30.4", - "once_cell", - "paste", - "psm", - "serde", - "serde_json", - "target-lexicon 0.12.13", - "wasmparser 0.103.0", - "wasmtime-cranelift", - "wasmtime-environ", - "wasmtime-jit", - "wasmtime-runtime", - "windows-sys 0.48.0", -] - -[[package]] -name = "wasmtime-asm-macros" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d33c73c24ce79b0483a3b091a9acf88871f4490b88998e8974b22236264d304c" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "wasmtime-cranelift" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5800616a28ed6bd5e8b99ea45646c956d798ae030494ac0689bc3e45d3b689c1" -dependencies = [ - "anyhow", - "cranelift-codegen", - "cranelift-control", - "cranelift-entity", - "cranelift-frontend", - "cranelift-native", - "cranelift-wasm", - "gimli 0.27.3", - "log", - "object 0.30.4", - "target-lexicon 0.12.13", - "thiserror", - "wasmparser 0.103.0", - "wasmtime-cranelift-shared", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-cranelift-shared" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27e4030b959ac5c5d6ee500078977e813f8768fa2b92fc12be01856cd0c76c55" -dependencies = [ - "anyhow", - "cranelift-codegen", - "cranelift-control", - "cranelift-native", - "gimli 0.27.3", - "object 0.30.4", - "target-lexicon 0.12.13", - "wasmtime-environ", -] - -[[package]] -name = "wasmtime-environ" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ec815d01a8d38aceb7ed4678f9ba551ae6b8a568a63810ac3ad9293b0fd01c8" -dependencies = [ - "anyhow", - "cranelift-entity", - "gimli 0.27.3", - "indexmap 1.9.3", - "log", - "object 0.30.4", - "serde", - "target-lexicon 0.12.13", - "thiserror", - "wasmparser 0.103.0", - "wasmtime-types", -] - -[[package]] -name = "wasmtime-jit" -version = "9.0.4" +name = "web-sys" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2712eafe829778b426cad0e1769fef944898923dd29f0039e34e0d53ba72b234" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ - "addr2line 0.19.0", - "anyhow", - "bincode", - "cfg-if 1.0.0", - "cpp_demangle", - "gimli 0.27.3", - "log", - "object 0.30.4", - "rustc-demangle", - "serde", - "target-lexicon 0.12.13", - "wasmtime-environ", - "wasmtime-jit-icache-coherence", - "wasmtime-runtime", - "windows-sys 0.48.0", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "wasmtime-jit-debug" -version = "9.0.4" +name = "which" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fb78eacf4a6e47260d8ef8cc81ea8ddb91397b2e848b3fb01567adebfe89b5" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ + "either", + "home", "once_cell", -] - -[[package]] -name = "wasmtime-jit-icache-coherence" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1364900b05f7d6008516121e8e62767ddb3e176bdf4c84dfa85da1734aeab79" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "wasmtime-runtime" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a16ffe4de9ac9669175c0ea5c6c51ffc596dfb49320aaa6f6c57eff58cef069" -dependencies = [ - "anyhow", - "cc", - "cfg-if 1.0.0", - "indexmap 1.9.3", - "libc", - "log", - "mach", - "memfd", - "memoffset 0.8.0", - "paste", - "rand 0.8.5", - "rustix 0.37.27", - "wasmtime-asm-macros", - "wasmtime-environ", - "wasmtime-jit-debug", - "windows-sys 0.48.0", -] - -[[package]] -name = "wasmtime-types" -version = "9.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19961c9a3b04d5e766875a5c467f6f5d693f508b3e81f8dc4a1444aa94f041c9" -dependencies = [ - "cranelift-entity", - "serde", - "thiserror", - "wasmparser 0.103.0", -] - -[[package]] -name = "web-sys" -version = "0.3.67" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" -dependencies = [ - "js-sys", - "wasm-bindgen", + "rustix", ] [[package]] @@ -6736,21 +5666,22 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core", + "windows-targets 0.52.0", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -6894,30 +5825,30 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.37" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] [[package]] -name = "winreg" -version = "0.50.0" +name = "winnow" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "d90f4e0f530c4c69f62b80d839e9ef3855edc9cba471a160c4d692deed62b401" dependencies = [ - "cfg-if 1.0.0", - "windows-sys 0.48.0", + "memchr", ] [[package]] -name = "wyz" -version = "0.5.1" +name = "winreg" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "tap", + "cfg-if", + "windows-sys 0.48.0", ] [[package]] @@ -6943,7 +5874,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -6951,20 +5882,6 @@ name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] [[package]] name = "zeropool-bn" @@ -6972,7 +5889,6 @@ version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" dependencies = [ - "borsh 0.9.3", "byteorder", "crunchy", "lazy_static", diff --git a/Cargo.toml b/Cargo.toml index ca4be70a..6b82624c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,16 +18,3 @@ members = [ "state-indexer", "tx-indexer", ] - -[patch.crates-io] -near-chain-configs = { git = 'https://github.com/near/nearcore.git', branch = '1.36.0' } -near-crypto = { git = 'https://github.com/near/nearcore.git', branch = '1.36.0' } -near-jsonrpc-primitives = { git = 'https://github.com/near/nearcore.git', branch = '1.36.0' } -near-indexer-primitives = { git = 'https://github.com/near/nearcore.git', branch = '1.36.0' } -near-primitives = { git = 'https://github.com/near/nearcore.git', branch = '1.36.0' } -near-vm-runner = { git = 'https://github.com/near/nearcore.git', branch = '1.36.0' } - -# TODO: We use forks to resolve nearcore dependency conflicts. -# After updating the dependencies, we should use the published versions of the crates. -near-jsonrpc-client = { git = 'https://github.com/kobayurii/near-jsonrpc-client-rs.git', branch = '0.7.0' } -near-lake-framework = { git = 'https://github.com/kobayurii/near-lake-framework-rs.git', branch = '0.7.9' } diff --git a/configuration/Cargo.toml b/configuration/Cargo.toml index a88ce207..e1a59b7a 100644 --- a/configuration/Cargo.toml +++ b/configuration/Cargo.toml @@ -9,9 +9,9 @@ license.workspace = true [dependencies] anyhow = "1.0.70" -aws-credential-types = "1.0.0" -aws-sdk-s3 = { version = "0.39.1", features = ["behavior-version-latest"] } -aws-types = "1.0.0" +aws-credential-types = "1.1.4" +aws-sdk-s3 = { version = "1.14.0", features = ["behavior-version-latest"] } +aws-types = "1.1.4" dotenv = "0.15.0" lazy_static = "1.4.0" regex = "1.10.2" @@ -35,7 +35,7 @@ tracing-subscriber = { version = "0.3.15", features = [ tracing-opentelemetry = { version = "0.19", optional = true } tracing-stackdriver = "0.7.2" # GCP logs -near-lake-framework = "0.7.9" +near-lake-framework = "0.7.7" [features] tracing-instrumentation = ["dep:opentelemetry-jaeger", "dep:tracing-opentelemetry"] diff --git a/database/Cargo.toml b/database/Cargo.toml index 9013ea6f..06049e51 100644 --- a/database/Cargo.toml +++ b/database/Cargo.toml @@ -11,39 +11,40 @@ license.workspace = true anyhow = "1.0.70" async-trait = "0.1.66" bigdecimal = { version = "0.4.2", optional = true } -borsh = "0.10.2" -bytes = "1.0.1" +borsh = "1.3.1" +bytes = "1.5.0" diesel = { version = "2.1.3", features = ["postgres", "numeric", "serde_json"], optional = true } diesel-async = { version = "0.4.1", features = ["postgres", "deadpool"], optional = true } diesel_migrations = { version = "2.1.0", optional = true } futures = "0.3.5" hex = "0.4.3" prettytable-rs = { version = "0.10", optional = true } -num-bigint = { version = "0.3", optional = true } +num-bigint = { version = "0.4.4", optional = true } num-traits = { version = "0.2.15", optional = true } -scylla = { version = "0.9.0", optional = true } +scylla = { version = "0.12.0", features = ["full-serialization"], optional = true } +scylla-cql = { version = "0.1.0", optional = true } serde = { version = "1.0.145", features = ["derive"]} serde_json = "1.0.85" -tokio = { version = "1.19.2", features = [ +tokio = { version = "1.36.0", features = [ "sync", "time", "macros", "rt-multi-thread", ] } tracing = "0.1.34" -uuid = { version = "1.3.0", optional = true } +uuid = { version = "1.7.0", optional = true } configuration = { path = "../configuration" } readnode-primitives = { path = "../readnode-primitives" } -near-chain-configs = "1.36.0" -near-primitives = "1.36.0" -near-crypto = "1.36.0" -near-indexer-primitives = "1.36.0" +near-chain-configs = "0.20.0" +near-primitives = "0.20.0" +near-crypto = "0.20.0" +near-indexer-primitives = "0.20.0" [features] default = ["scylla_db"] postgres_db = ["dep:diesel", "dep:diesel-async", "dep:diesel_migrations", "dep:bigdecimal"] -scylla_db = ["dep:scylla", "dep:num-bigint", "dep:num-traits"] +scylla_db = ["dep:scylla", "dep:scylla-cql", "dep:num-bigint", "dep:num-traits"] scylla_db_tracing = ["dep:prettytable-rs", "dep:uuid", "scylla_db"] account_access_keys = [] diff --git a/database/src/base/rpc_server.rs b/database/src/base/rpc_server.rs index 5bda1a67..a4f40997 100644 --- a/database/src/base/rpc_server.rs +++ b/database/src/base/rpc_server.rs @@ -112,10 +112,4 @@ pub trait ReaderDbManager { &self, block_height: near_primitives::types::BlockHeight, ) -> anyhow::Result; - - /// Return protocol config by the given epoch id - async fn get_protocol_config_by_epoch_id( - &self, - epoch_id: near_primitives::hash::CryptoHash, - ) -> anyhow::Result; } diff --git a/database/src/base/state_indexer.rs b/database/src/base/state_indexer.rs index 844d38a5..00699975 100644 --- a/database/src/base/state_indexer.rs +++ b/database/src/base/state_indexer.rs @@ -119,14 +119,6 @@ pub trait StateIndexerDbManager { validators_info: &near_primitives::views::EpochValidatorInfo, ) -> anyhow::Result<()>; - async fn add_protocol_config( - &self, - epoch_id: near_indexer_primitives::CryptoHash, - epoch_height: u64, - epoch_start_height: u64, - protocol_config: &near_chain_configs::ProtocolConfigView, - ) -> anyhow::Result<()>; - async fn update_epoch_end_height( &self, epoch_id: near_indexer_primitives::CryptoHash, diff --git a/database/src/postgres/migrations/2024-02-14-125531_delete_protocol_configs/down.sql b/database/src/postgres/migrations/2024-02-14-125531_delete_protocol_configs/down.sql new file mode 100644 index 00000000..ba404b22 --- /dev/null +++ b/database/src/postgres/migrations/2024-02-14-125531_delete_protocol_configs/down.sql @@ -0,0 +1,10 @@ +CREATE TABLE IF NOT EXISTS protocol_configs ( + epoch_id text NOT NULL, + epoch_height numeric(20,0) NOT NULL, + epoch_start_height numeric(20,0) NOT NULL, + epoch_end_height numeric(20,0) NULL, + protocol_config jsonb NOT NULL +); + +ALTER TABLE ONLY protocol_configs + ADD CONSTRAINT protocol_config_pk PRIMARY KEY (epoch_id); diff --git a/database/src/postgres/migrations/2024-02-14-125531_delete_protocol_configs/up.sql b/database/src/postgres/migrations/2024-02-14-125531_delete_protocol_configs/up.sql new file mode 100644 index 00000000..f3bfe3a2 --- /dev/null +++ b/database/src/postgres/migrations/2024-02-14-125531_delete_protocol_configs/up.sql @@ -0,0 +1 @@ +DROP TABLE IF EXISTS protocol_configs; diff --git a/database/src/postgres/models.rs b/database/src/postgres/models.rs index cb6219ea..4f15ee26 100644 --- a/database/src/postgres/models.rs +++ b/database/src/postgres/models.rs @@ -1,5 +1,4 @@ use crate::schema::*; -use borsh::{BorshDeserialize, BorshSerialize}; use diesel::prelude::*; use diesel_async::RunQueryDsl; @@ -362,7 +361,7 @@ impl AccountState { page_token: crate::PageToken, ) -> anyhow::Result<(Vec, crate::PageToken)> { let page_state = if let Some(page_state_token) = page_token { - PageState::try_from_slice(&hex::decode(page_state_token)?)? + borsh::from_slice::(&hex::decode(page_state_token)?)? } else { PageState::new(1000) }; @@ -384,7 +383,7 @@ impl AccountState { } else { Ok(( state_keys, - Some(hex::encode(page_state.next_page().try_to_vec()?)), + Some(hex::encode(borsh::to_vec(&page_state.next_page())?)), )) } } @@ -735,53 +734,3 @@ impl Validators { Ok(response) } } - -#[derive(Insertable, Queryable, Selectable)] -#[diesel(table_name = protocol_configs)] -pub struct ProtocolConfig { - pub epoch_id: String, - pub epoch_height: bigdecimal::BigDecimal, - pub epoch_start_height: bigdecimal::BigDecimal, - pub epoch_end_height: Option, - pub protocol_config: serde_json::Value, -} - -impl ProtocolConfig { - pub async fn insert_or_ignore( - &self, - mut conn: crate::postgres::PgAsyncConn, - ) -> anyhow::Result<()> { - diesel::insert_into(protocol_configs::table) - .values(self) - .on_conflict_do_nothing() - .execute(&mut conn) - .await?; - Ok(()) - } - - pub async fn update_epoch_end_height( - mut conn: crate::postgres::PgAsyncConn, - epoch_id: near_indexer_primitives::CryptoHash, - epoch_end_height: bigdecimal::BigDecimal, - ) -> anyhow::Result<()> { - diesel::update(protocol_configs::table) - .filter(protocol_configs::epoch_id.eq(epoch_id.to_string())) - .set(protocol_configs::epoch_end_height.eq(epoch_end_height)) - .execute(&mut conn) - .await?; - Ok(()) - } - - pub async fn get_protocol_config( - mut conn: crate::postgres::PgAsyncConn, - epoch_id: near_indexer_primitives::CryptoHash, - ) -> anyhow::Result { - let response = protocol_configs::table - .filter(protocol_configs::epoch_id.eq(epoch_id.to_string())) - .select(Self::as_select()) - .first(&mut conn) - .await?; - - Ok(response) - } -} diff --git a/database/src/postgres/rpc_server.rs b/database/src/postgres/rpc_server.rs index 652d0acc..fc294ea6 100644 --- a/database/src/postgres/rpc_server.rs +++ b/database/src/postgres/rpc_server.rs @@ -2,7 +2,6 @@ use std::str::FromStr; use crate::postgres::PostgresStorageManager; use bigdecimal::ToPrimitive; -use borsh::{BorshDeserialize, BorshSerialize}; pub struct PostgresDBManager { pg_pool: crate::postgres::PgAsyncPool, @@ -67,7 +66,7 @@ impl crate::ReaderDbManager for PostgresDBManager { ) -> anyhow::Result> { let result = crate::models::AccountState::get_state_keys_all( Self::get_connection(&self.pg_pool).await?, - account_id, + account_id.as_str(), ) .await? .into_iter() @@ -83,7 +82,7 @@ impl crate::ReaderDbManager for PostgresDBManager { let hex_str_prefix = hex::encode(prefix); let result = crate::models::AccountState::get_state_keys_by_prefix( Self::get_connection(&self.pg_pool).await?, - account_id, + account_id.as_str(), hex_str_prefix, ) .await? @@ -99,7 +98,7 @@ impl crate::ReaderDbManager for PostgresDBManager { ) -> anyhow::Result<(Vec, crate::PageToken)> { let (state_keys, next_page_token) = crate::models::AccountState::get_state_keys_by_page( Self::get_connection(&self.pg_pool).await?, - account_id, + account_id.as_str(), page_token, ) .await?; @@ -126,7 +125,7 @@ impl crate::ReaderDbManager for PostgresDBManager { }; let result = if let Ok(result) = crate::models::StateChangesData::get_state_key_value( connection, - account_id, + account_id.as_str(), block_height, hex::encode(key_data.clone()), ) @@ -146,7 +145,7 @@ impl crate::ReaderDbManager for PostgresDBManager { ) -> anyhow::Result> { let account_data = crate::models::StateChangesAccount::get_account( Self::get_connection(&self.pg_pool).await?, - account_id, + account_id.as_str(), request_block_height, ) .await?; @@ -176,7 +175,7 @@ impl crate::ReaderDbManager for PostgresDBManager { ) -> anyhow::Result>> { let contract_data = crate::models::StateChangesContract::get_contract( Self::get_connection(&self.pg_pool).await?, - account_id, + account_id.as_str(), request_block_height, ) .await?; @@ -205,10 +204,10 @@ impl crate::ReaderDbManager for PostgresDBManager { request_block_height: near_primitives::types::BlockHeight, public_key: near_crypto::PublicKey, ) -> anyhow::Result> { - let key_data = public_key.try_to_vec()?; + let key_data = borsh::to_vec(&public_key)?; let access_key_data = crate::models::StateChangesAccessKey::get_access_key( Self::get_connection(&self.pg_pool).await?, - account_id, + account_id.as_str(), request_block_height, hex::encode(key_data), ) @@ -241,7 +240,7 @@ impl crate::ReaderDbManager for PostgresDBManager { ) -> anyhow::Result>> { let active_access_keys = crate::models::StateChangesAccessKeys::get_active_access_keys( Self::get_connection(&self.pg_pool).await?, - &account_id, + account_id.as_str(), block_height, ) .await?; @@ -293,9 +292,7 @@ impl crate::ReaderDbManager for PostgresDBManager { transaction_hash, ) .await?; - Ok(readnode_primitives::TransactionDetails::try_from_slice( - &transaction_data, - )?) + Ok(borsh::from_slice::(&transaction_data)?) } async fn get_indexing_transaction_by_hash( @@ -308,7 +305,7 @@ impl crate::ReaderDbManager for PostgresDBManager { ) .await?; let mut transaction_details = - readnode_primitives::CollectingTransactionDetails::try_from_slice(&data_value)?; + borsh::from_slice::(&data_value)?; let result = crate::models::ReceiptOutcome::get_receipt_outcome( Self::get_connection(&self.pg_pool).await?, @@ -318,13 +315,10 @@ impl crate::ReaderDbManager for PostgresDBManager { .await?; for receipt_outcome in result { let receipt = - near_primitives::views::ReceiptView::try_from_slice(&receipt_outcome.receipt) - .expect("Failed to deserialize receipt"); - let execution_outcome = - near_primitives::views::ExecutionOutcomeWithIdView::try_from_slice( - &receipt_outcome.outcome, - ) - .expect("Failed to deserialize execution outcome"); + borsh::from_slice::(&receipt_outcome.receipt)?; + let execution_outcome = borsh::from_slice::< + near_primitives::views::ExecutionOutcomeWithIdView, + >(&receipt_outcome.outcome)?; transaction_details.receipts.push(receipt); transaction_details .execution_outcomes @@ -414,19 +408,4 @@ impl crate::ReaderDbManager for PostgresDBManager { validators_info, }) } - - async fn get_protocol_config_by_epoch_id( - &self, - epoch_id: near_indexer_primitives::CryptoHash, - ) -> anyhow::Result { - let protocol_config = crate::models::ProtocolConfig::get_protocol_config( - Self::get_connection(&self.pg_pool).await?, - epoch_id, - ) - .await?; - let (protocol_config,) = serde_json::from_value::<(near_chain_configs::ProtocolConfigView,)>( - protocol_config.protocol_config, - )?; - Ok(protocol_config) - } } diff --git a/database/src/postgres/schema.rs b/database/src/postgres/schema.rs index 2d7f1f2b..9ad3ba40 100644 --- a/database/src/postgres/schema.rs +++ b/database/src/postgres/schema.rs @@ -30,16 +30,6 @@ diesel::table! { } } -diesel::table! { - protocol_configs (epoch_id) { - epoch_id -> Text, - epoch_height -> Numeric, - epoch_start_height -> Numeric, - epoch_end_height -> Nullable, - protocol_config -> Jsonb, - } -} - diesel::table! { receipt_map (receipt_id) { receipt_id -> Text, @@ -138,7 +128,6 @@ diesel::allow_tables_to_appear_in_same_query!( block, chunk, meta, - protocol_configs, receipt_map, receipt_outcome, state_changes_access_key, diff --git a/database/src/postgres/state_indexer.rs b/database/src/postgres/state_indexer.rs index 3c122c77..a8fc14f4 100644 --- a/database/src/postgres/state_indexer.rs +++ b/database/src/postgres/state_indexer.rs @@ -112,7 +112,7 @@ impl crate::StateIndexerDbManager for PostgresDBManager { ) -> anyhow::Result>> { let active_access_keys = crate::models::StateChangesAccessKeys::get_active_access_keys( Self::get_connection(&self.pg_pool).await?, - &account_id, + account_id.as_str(), block_height, ) .await?; @@ -325,43 +325,18 @@ impl crate::StateIndexerDbManager for PostgresDBManager { Ok(()) } - async fn add_protocol_config( - &self, - epoch_id: near_indexer_primitives::CryptoHash, - epoch_height: u64, - epoch_start_height: u64, - protocol_config: &near_chain_configs::ProtocolConfigView, - ) -> anyhow::Result<()> { - crate::models::ProtocolConfig { - epoch_id: epoch_id.to_string(), - epoch_height: bigdecimal::BigDecimal::from(epoch_height), - epoch_start_height: bigdecimal::BigDecimal::from(epoch_start_height), - epoch_end_height: None, - protocol_config: serde_json::to_value(protocol_config)?, - } - .insert_or_ignore(Self::get_connection(&self.pg_pool).await?) - .await?; - Ok(()) - } - async fn update_epoch_end_height( &self, epoch_id: near_indexer_primitives::CryptoHash, epoch_end_block_hash: near_indexer_primitives::CryptoHash, ) -> anyhow::Result<()> { let epoch_end_height = self.get_block_by_hash(epoch_end_block_hash).await?; - - let validators_future = crate::models::Validators::update_epoch_end_height( + crate::models::Validators::update_epoch_end_height( Self::get_connection(&self.pg_pool).await?, epoch_id, bigdecimal::BigDecimal::from(epoch_end_height), - ); - let protocol_config_future = crate::models::ProtocolConfig::update_epoch_end_height( - Self::get_connection(&self.pg_pool).await?, - epoch_id, - bigdecimal::BigDecimal::from(epoch_end_height), - ); - futures::future::try_join(validators_future, protocol_config_future).await?; + ) + .await?; Ok(()) } } diff --git a/database/src/postgres/tx_indexer.rs b/database/src/postgres/tx_indexer.rs index f1fdea29..10b81620 100644 --- a/database/src/postgres/tx_indexer.rs +++ b/database/src/postgres/tx_indexer.rs @@ -1,6 +1,5 @@ use crate::postgres::PostgresStorageManager; use bigdecimal::ToPrimitive; -use borsh::{BorshDeserialize, BorshSerialize}; pub struct PostgresDBManager { pg_pool: crate::postgres::PgAsyncPool, @@ -30,14 +29,11 @@ impl crate::TxIndexerDbManager for PostgresDBManager { transaction: readnode_primitives::TransactionDetails, block_height: u64, ) -> anyhow::Result<()> { - let transaction_details = transaction - .try_to_vec() - .expect("Failed to borsh-serialize the Transaction"); crate::models::TransactionDetail { transaction_hash: transaction.transaction.hash.to_string(), block_height: bigdecimal::BigDecimal::from(block_height), account_id: transaction.transaction.signer_id.to_string(), - transaction_details, + transaction_details: borsh::to_vec(&transaction)?, } .insert_or_ignore(Self::get_connection(&self.pg_pool).await?) .await @@ -75,7 +71,7 @@ impl crate::TxIndexerDbManager for PostgresDBManager { ) -> anyhow::Result<()> { let transaction_hash = transaction_details.transaction.hash.clone().to_string(); let block_height = transaction_details.block_height; - let transaction_details = transaction_details.try_to_vec().map_err(|err| { + let transaction_details = borsh::to_vec(&transaction_details).map_err(|err| { tracing::error!(target: "tx_indexer", "Failed to serialize transaction details: {:?}", err); err})?; crate::models::TransactionCache { @@ -100,12 +96,8 @@ impl crate::TxIndexerDbManager for PostgresDBManager { .receipt .receipt_id .to_string(), - receipt: indexer_execution_outcome_with_receipt - .receipt - .try_to_vec()?, - outcome: indexer_execution_outcome_with_receipt - .execution_outcome - .try_to_vec()?, + receipt: borsh::to_vec(&indexer_execution_outcome_with_receipt.receipt)?, + outcome: borsh::to_vec(&indexer_execution_outcome_with_receipt.execution_outcome)?, } .insert_or_ignore(Self::get_connection(&self.pg_pool).await?) .await @@ -131,11 +123,10 @@ impl crate::TxIndexerDbManager for PostgresDBManager { Ok(transactions .into_iter() .map(|tx| { - let transaction_details = - readnode_primitives::CollectingTransactionDetails::try_from_slice( - &tx.transaction_details, - ) - .expect("Failed to deserialize transaction details"); + let transaction_details = borsh::from_slice::< + readnode_primitives::CollectingTransactionDetails, + >(&tx.transaction_details) + .expect("Failed to deserialize transaction details"); (transaction_details.transaction_key(), transaction_details) }) .collect()) @@ -156,11 +147,9 @@ impl crate::TxIndexerDbManager for PostgresDBManager { &transaction_hash, ) .await?; - Ok( - readnode_primitives::CollectingTransactionDetails::try_from_slice( - &transaction_details, - )?, - ) + Ok(borsh::from_slice::< + readnode_primitives::CollectingTransactionDetails, + >(&transaction_details)?) } async fn get_receipts_in_cache( @@ -176,14 +165,14 @@ impl crate::TxIndexerDbManager for PostgresDBManager { Ok(result .into_iter() .map(|receipt_outcome| { - let receipt = - near_primitives::views::ReceiptView::try_from_slice(&receipt_outcome.receipt) - .expect("Failed to deserialize receipt"); - let execution_outcome = - near_primitives::views::ExecutionOutcomeWithIdView::try_from_slice( - &receipt_outcome.outcome, - ) - .expect("Failed to deserialize execution outcome"); + let receipt = borsh::from_slice::( + &receipt_outcome.receipt, + ) + .expect("Failed to deserialize receipt"); + let execution_outcome = borsh::from_slice::< + near_primitives::views::ExecutionOutcomeWithIdView, + >(&receipt_outcome.outcome) + .expect("Failed to deserialize execution outcome"); near_indexer_primitives::IndexerExecutionOutcomeWithReceipt { receipt, execution_outcome, diff --git a/database/src/scylladb/mod.rs b/database/src/scylladb/mod.rs index c9e76912..a555c2bc 100644 --- a/database/src/scylladb/mod.rs +++ b/database/src/scylladb/mod.rs @@ -5,6 +5,7 @@ pub mod tx_indexer; use scylla::prepared_statement::PreparedStatement; use scylla::retry_policy::{QueryInfo, RetryDecision}; use scylla::transport::errors::QueryError; +use scylla_cql::types::serialize::row::SerializeRow; #[derive(Debug)] pub struct CustomDBRetryPolicy { @@ -81,7 +82,7 @@ impl Default for CustomRetrySession { impl scylla::retry_policy::RetrySession for CustomRetrySession { /// Called after the query failed - decide what to do next fn decide_should_retry(&mut self, query_info: QueryInfo) -> RetryDecision { - if let scylla::frame::types::LegacyConsistency::Serial(_) = query_info.consistency { + if query_info.consistency.is_serial() { return RetryDecision::DontRetry; }; tracing::warn!("ScyllaDB QueryError: {:?}", query_info.error); @@ -338,7 +339,7 @@ pub trait ScyllaStorageManager { async fn execute_prepared_query( scylla_session: &scylla::Session, query: &PreparedStatement, - values: impl scylla::frame::value::ValueList + std::marker::Send, + values: impl SerializeRow + Send, ) -> anyhow::Result { let result = scylla_session.execute(query, values).await?; @@ -391,7 +392,7 @@ pub trait ScyllaStorageManager { } if let Some(start_at) = tracing_info.started_at { - tracing_info_table.add_row(prettytable::row!["Started at", start_at]); + tracing_info_table.add_row(prettytable::row!["Started at", start_at.0]); } let mut events_table = diff --git a/database/src/scylladb/rpc_server.rs b/database/src/scylladb/rpc_server.rs index a81d82d4..5babc969 100644 --- a/database/src/scylladb/rpc_server.rs +++ b/database/src/scylladb/rpc_server.rs @@ -1,7 +1,6 @@ use std::convert::TryFrom; use std::str::FromStr; -use borsh::{BorshDeserialize, BorshSerialize}; use futures::StreamExt; use num_traits::ToPrimitive; use scylla::{prepared_statement::PreparedStatement, IntoTypedRows}; @@ -27,7 +26,6 @@ pub struct ScyllaDBManager { get_stored_at_block_height_and_shard_id_by_block_height: PreparedStatement, get_validators_by_epoch_id: PreparedStatement, get_validators_by_end_block_height: PreparedStatement, - get_protocol_config_by_epoch_id: PreparedStatement, } #[async_trait::async_trait] @@ -147,10 +145,6 @@ impl ScyllaStorageManager for ScyllaDBManager { &scylla_db_session, "SELECT epoch_id, epoch_height, validators_info FROM state_indexer.validators WHERE epoch_end_height = ?", ).await?, - get_protocol_config_by_epoch_id: Self::prepare_read_query( - &scylla_db_session, - "SELECT protocol_config FROM state_indexer.protocol_configs WHERE epoch_id = ?", - ).await?, })) } } @@ -377,7 +371,7 @@ impl crate::ReaderDbManager for ScyllaDBManager { request_block_height: near_primitives::types::BlockHeight, public_key: near_crypto::PublicKey, ) -> anyhow::Result> { - let key_data = public_key.try_to_vec()?; + let key_data = borsh::to_vec(&public_key)?; let (block_height, block_hash, data_blob) = Self::execute_prepared_query( &self.scylla_session, &self.get_access_key, @@ -465,9 +459,7 @@ impl crate::ReaderDbManager for ScyllaDBManager { .single_row()? .into_typed::<(Vec,)>()?; - Ok(readnode_primitives::TransactionDetails::try_from_slice( - &data_value, - )?) + Ok(borsh::from_slice::(&data_value)?) } /// Returns the readnode_primitives::TransactionDetails @@ -485,7 +477,7 @@ impl crate::ReaderDbManager for ScyllaDBManager { .single_row()? .into_typed::<(Vec,)>()?; let mut transaction_details = - readnode_primitives::CollectingTransactionDetails::try_from_slice(&data_value)?; + borsh::from_slice::(&data_value)?; let mut rows_stream = self .scylla_session @@ -500,9 +492,9 @@ impl crate::ReaderDbManager for ScyllaDBManager { .into_typed::<(Vec, Vec)>(); while let Some(next_row_res) = rows_stream.next().await { let (receipt, outcome) = next_row_res?; - let receipt = near_primitives::views::ReceiptView::try_from_slice(&receipt)?; + let receipt = borsh::from_slice::(&receipt)?; let execution_outcome = - near_primitives::views::ExecutionOutcomeWithIdView::try_from_slice(&outcome)?; + borsh::from_slice::(&outcome)?; transaction_details.receipts.push(receipt); transaction_details .execution_outcomes @@ -596,23 +588,4 @@ impl crate::ReaderDbManager for ScyllaDBManager { validators_info, }) } - - async fn get_protocol_config_by_epoch_id( - &self, - epoch_id: near_primitives::hash::CryptoHash, - ) -> anyhow::Result { - let (protocol_config,) = Self::execute_prepared_query( - &self.scylla_session, - &self.get_protocol_config_by_epoch_id, - (epoch_id.to_string(),), - ) - .await? - .single_row()? - .into_typed::<(String,)>()?; - - let protocol_config: near_chain_configs::ProtocolConfigView = - serde_json::from_str(&protocol_config)?; - - Ok(protocol_config) - } } diff --git a/database/src/scylladb/state_indexer.rs b/database/src/scylladb/state_indexer.rs index 272aac5f..0a2d7271 100644 --- a/database/src/scylladb/state_indexer.rs +++ b/database/src/scylladb/state_indexer.rs @@ -27,9 +27,7 @@ pub struct ScyllaDBManager { add_chunk: PreparedStatement, add_validators: PreparedStatement, - add_protocol_config: PreparedStatement, update_validators_epoch_end_height: PreparedStatement, - update_protocol_config_epoch_end_height: PreparedStatement, add_account_state: PreparedStatement, @@ -178,19 +176,7 @@ impl ScyllaStorageManager for ScyllaDBManager { .await?; scylla_db_session - .query( - " - CREATE TABLE IF NOT EXISTS protocol_configs ( - epoch_id varchar, - epoch_height varint, - epoch_start_height varint, - epoch_end_height varint, - protocol_config text, - PRIMARY KEY (epoch_id) - ) - ", - &[], - ) + .query("DROP TABLE IF EXISTS protocol_configs", &[]) .await?; scylla_db_session @@ -375,23 +361,11 @@ impl ScyllaStorageManager for ScyllaDBManager { VALUES (?, ?, ?, NULL, ?)", ) .await?, - add_protocol_config: Self::prepare_write_query( - &scylla_db_session, - "INSERT INTO state_indexer.protocol_configs - (epoch_id, epoch_height, epoch_start_height, epoch_end_height, protocol_config) - VALUES (?, ?, ?, NULL, ?)", - ) - .await?, update_validators_epoch_end_height: Self::prepare_write_query( &scylla_db_session, "UPDATE state_indexer.validators SET epoch_end_height = ? WHERE epoch_id = ?", ) .await?, - update_protocol_config_epoch_end_height: Self::prepare_write_query( - &scylla_db_session, - "UPDATE state_indexer.protocol_configs SET epoch_end_height = ? WHERE epoch_id = ?", - ) - .await?, add_account_state: Self::prepare_write_query( &scylla_db_session, "INSERT INTO state_indexer.account_state @@ -766,51 +740,21 @@ impl crate::StateIndexerDbManager for ScyllaDBManager { Ok(()) } - async fn add_protocol_config( - &self, - epoch_id: near_indexer_primitives::CryptoHash, - epoch_height: u64, - epoch_start_height: u64, - protocol_config: &near_chain_configs::ProtocolConfigView, - ) -> anyhow::Result<()> { - Self::execute_prepared_query( - &self.scylla_session, - &self.add_protocol_config, - ( - epoch_id.to_string(), - num_bigint::BigInt::from(epoch_height), - num_bigint::BigInt::from(epoch_start_height), - serde_json::to_string(protocol_config)?, - ), - ) - .await?; - Ok(()) - } - async fn update_epoch_end_height( &self, epoch_id: near_indexer_primitives::CryptoHash, epoch_end_block_hash: near_indexer_primitives::CryptoHash, ) -> anyhow::Result<()> { let epoch_end_height = self.get_block_by_hash(epoch_end_block_hash).await?; - - let validators_future = Self::execute_prepared_query( + Self::execute_prepared_query( &self.scylla_session, &self.update_validators_epoch_end_height, ( num_bigint::BigInt::from(epoch_end_height), epoch_id.to_string(), ), - ); - let protocol_config_future = Self::execute_prepared_query( - &self.scylla_session, - &self.update_protocol_config_epoch_end_height, - ( - num_bigint::BigInt::from(epoch_end_height), - epoch_id.to_string(), - ), - ); - futures::future::try_join(validators_future, protocol_config_future).await?; + ) + .await?; Ok(()) } } diff --git a/database/src/scylladb/tx_indexer.rs b/database/src/scylladb/tx_indexer.rs index 08a37bd2..91cc7f87 100644 --- a/database/src/scylladb/tx_indexer.rs +++ b/database/src/scylladb/tx_indexer.rs @@ -1,5 +1,4 @@ use crate::scylladb::ScyllaStorageManager; -use borsh::{BorshDeserialize, BorshSerialize}; use futures::StreamExt; use num_traits::ToPrimitive; use scylla::prepared_statement::PreparedStatement; @@ -54,10 +53,9 @@ impl ScyllaDBManager { .into_typed::<(Vec,)>(); while let Some(next_row_res) = rows_stream.next().await { let (transaction_details,) = next_row_res?; - let transaction_details = - readnode_primitives::CollectingTransactionDetails::try_from_slice( - &transaction_details, - )?; + let transaction_details = borsh::from_slice::< + readnode_primitives::CollectingTransactionDetails, + >(&transaction_details)?; result.push(transaction_details); } Ok(result) @@ -248,9 +246,6 @@ impl crate::TxIndexerDbManager for ScyllaDBManager { transaction: readnode_primitives::TransactionDetails, block_height: u64, ) -> anyhow::Result<()> { - let transaction_details = transaction - .try_to_vec() - .expect("Failed to borsh-serialize the Transaction"); Self::execute_prepared_query( &self.scylla_session, &self.add_transaction, @@ -258,7 +253,7 @@ impl crate::TxIndexerDbManager for ScyllaDBManager { transaction.transaction.hash.to_string(), num_bigint::BigInt::from(block_height), transaction.transaction.signer_id.to_string(), - &transaction_details, + &borsh::to_vec(&transaction)?, ), ) .await?; @@ -302,7 +297,7 @@ impl crate::TxIndexerDbManager for ScyllaDBManager { ) -> anyhow::Result<()> { let transaction_hash = transaction_details.transaction.hash.clone().to_string(); let block_height = transaction_details.block_height; - let transaction_details = transaction_details.try_to_vec().map_err(|err| { + let transaction_details = borsh::to_vec(&transaction_details).map_err(|err| { tracing::error!(target: "tx_indexer", "Failed to serialize transaction details: {:?}", err); err})?; Self::execute_prepared_query( @@ -337,12 +332,8 @@ impl crate::TxIndexerDbManager for ScyllaDBManager { .receipt .receipt_id .to_string(), - indexer_execution_outcome_with_receipt - .receipt - .try_to_vec()?, - indexer_execution_outcome_with_receipt - .execution_outcome - .try_to_vec()?, + borsh::to_vec(&indexer_execution_outcome_with_receipt.receipt)?, + borsh::to_vec(&indexer_execution_outcome_with_receipt.execution_outcome)?, ), ) .await?; @@ -433,11 +424,9 @@ impl crate::TxIndexerDbManager for ScyllaDBManager { .single_row()? .into_typed::<(Vec,)>()?; - Ok( - readnode_primitives::CollectingTransactionDetails::try_from_slice( - &transaction_details, - )?, - ) + Ok(borsh::from_slice::< + readnode_primitives::CollectingTransactionDetails, + >(&transaction_details)?) } async fn get_receipts_in_cache( @@ -458,9 +447,9 @@ impl crate::TxIndexerDbManager for ScyllaDBManager { .into_typed::<(Vec, Vec)>(); while let Some(next_row_res) = rows_stream.next().await { let (receipt, outcome) = next_row_res?; - let receipt = near_primitives::views::ReceiptView::try_from_slice(&receipt)?; + let receipt = borsh::from_slice::(&receipt)?; let execution_outcome = - near_primitives::views::ExecutionOutcomeWithIdView::try_from_slice(&outcome)?; + borsh::from_slice::(&outcome)?; result.push( near_indexer_primitives::IndexerExecutionOutcomeWithReceipt { receipt, diff --git a/docs/RPC_METHODS.md b/docs/RPC_METHODS.md index 48f2bfe4..7d45dae3 100644 --- a/docs/RPC_METHODS.md +++ b/docs/RPC_METHODS.md @@ -1,28 +1,33 @@ -| **Method** | **status** | **Note** | -|---------------------------------|------------|-----------------------------------------------------------------------------| -| block | Included | | -| chunk | Included | | -| query.view_account | Included | | -| query.view_state | Included | | -| view_state_paginated | Included | Custom method. See details [here](../docs/CUSTOM_RPC_METHODS.md) | -| query.view_code | Included | | -| query.view_access_key | Included | | -| query.call_function | Included | | -| query.view_access_key_list | Proxy | Planned. It will be implemented in the future. | -| gas_price | Included | | -| tx | Included | | -| EXPERIMENTAL_tx_status | Included | | -| broadcast_tx_commit | Proxy | PROXY_ONLY. Immediately proxy to a real RPC. | -| broadcast_tx_async | Proxy | PROXY_ONLY. Immediately proxy to a real RPC. | -| EXPETIMENTAL_receipt | Included | | -| EXPERIMENTAL_changes | Included | | -| EXPERIMENTAL_changes_in_block | Included | | -| network_info | Proxy | PROXY_ONLY. Immediately proxy to a real RPC. | -| status | Included | | -| health | Included | Health includes the info about the syncing state of the node of rpc-server. | -| light_client_proof | Proxy | | -| next_light_client_block | Proxy | | -| validators | Included | | -| EXPERIMENTAL_validators_ordered | Proxy | | -| EXPERIMENTAL_genesis_config | Included | Cache it on the start. | -| EXPERIMENTAL_protocol_config | Included | | \ No newline at end of file +| **Method** | **status** | **Note** | +|----------------------------------|---------------|-----------------------------------------------------------------------------| +| view_state_paginated | Included | Custom method. See details [here](../docs/CUSTOM_RPC_METHODS.md) | +| query.view_account | Included | | +| query.view_code | Included | | +| query.view_state | Included | | +| query.call_function | Included | | +| query.view_access_key | Included | | +| query.view_access_key_list | Proxy | Planned. It will be implemented in the future. | +| block | Included | | +| broadcast_tx_async | Proxy | PROXY_ONLY. Immediately proxy to a real RPC. | +| broadcast_tx_commit | Proxy | PROXY_ONLY. Immediately proxy to a real RPC. | +| chunk | Included | | +| gas_price | Included | | +| health | Included | Health includes the info about the syncing state of the node of rpc-server. | +| light_client_proof | Proxy | | +| next_light_client_block | Proxy | | +| network_info | Proxy | PROXY_ONLY. Immediately proxy to a real RPC. | +| status | Included | | +| send_tx | Proxy | PROXY_ONLY. Immediately proxy to a real RPC. | +| tx | Included | | +| validators | Included | | +| client_config | Unimplemented | | +| EXPERIMENTAL_changes | Included | | +| EXPERIMENTAL_changes_in_block | Included | | +| EXPERIMENTAL_genesis_config | Included | Cache it on the start. | +| EXPERIMENTAL_light_client_proof | Proxy | | +| EXPERIMENTAL_protocol_config | Included | | +| EXPETIMENTAL_receipt | Included | | +| EXPERIMENTAL_tx_status | Included | | +| EXPERIMENTAL_validators_ordered | Proxy | | +| EXPERIMENTAL_maintenance_windows | Unimplemented | | +| EXPERIMENTAL_split_storage_info | Unimplemented | | diff --git a/epoch-indexer/Cargo.toml b/epoch-indexer/Cargo.toml index 41a9f7a9..0e47fb8e 100644 --- a/epoch-indexer/Cargo.toml +++ b/epoch-indexer/Cargo.toml @@ -9,9 +9,8 @@ license.workspace = true [dependencies] anyhow = "1.0.70" -clap = { version = "3.1.6", features = ["color", "derive", "env"] } -futures = "0.3.5" -tokio = { version = "1.28.2", features = [ +clap = "4.4.18" +tokio = { version = "1.36.0", features = [ "sync", "time", "macros", @@ -23,10 +22,10 @@ configuration = { path = "../configuration" } database = { path = "../database" } readnode-primitives = { path = "../readnode-primitives" } -near-jsonrpc-client = "0.7.0" -near-chain-configs = "1.36.0" -near-indexer-primitives = "1.36.0" -near-lake-framework = "0.7.9" +near-jsonrpc-client = "0.8.0" +near-chain-configs = "0.20.0" +near-indexer-primitives = "0.20.0" +near-lake-framework = "0.7.7" [features] default = ["scylla_db"] diff --git a/epoch-indexer/src/config.rs b/epoch-indexer/src/config.rs index b6d1e569..d05baf83 100644 --- a/epoch-indexer/src/config.rs +++ b/epoch-indexer/src/config.rs @@ -1,14 +1,6 @@ use clap::{Parser, Subcommand}; #[derive(Parser, Debug)] -#[clap( - version, - author, - about, - setting(clap::AppSettings::DisableHelpSubcommand), - setting(clap::AppSettings::PropagateVersion), - setting(clap::AppSettings::NextLineHelp) -)] pub struct Opts { #[clap(subcommand)] pub start_options: StartOptions, diff --git a/epoch-indexer/src/lib.rs b/epoch-indexer/src/lib.rs index b1c570f8..041b2715 100644 --- a/epoch-indexer/src/lib.rs +++ b/epoch-indexer/src/lib.rs @@ -29,72 +29,18 @@ pub async fn get_epoch_validators( } } -/// util to fetch protocol config by epoch_start_height -/// try_another_blocks - special flag to try another blocks if we have error -/// in case of error we try to fetch protocol config for next block -pub async fn get_protocol_config( - epoch_start_height: u64, - client: &near_jsonrpc_client::JsonRpcClient, - try_another_blocks: bool, -) -> anyhow::Result { - let mut attempt_counter = 0; - let mut block_height = epoch_start_height; - loop { - let params = - near_jsonrpc_client::methods::EXPERIMENTAL_protocol_config::RpcProtocolConfigRequest { - block_reference: near_primitives::types::BlockReference::BlockId( - near_indexer_primitives::types::BlockId::Height(block_height), - ), - }; - match client.call(params).await { - Ok(response) => return Ok(response), - Err(e) => { - attempt_counter += 1; - if try_another_blocks { - block_height += 1; - } - tracing::debug!( - "Attempt: {}. Epoch_start_height {}. Error fetching protocol config: {:?}", - attempt_counter, - block_height, - e - ); - if attempt_counter > 20 { - anyhow::bail!( - "Failed to fetch epoch protocol config for epoch_start_height: {}", - epoch_start_height - ) - } - } - } - } -} - pub async fn get_epoch_info_by_id( epoch_id: CryptoHash, rpc_client: &near_jsonrpc_client::JsonRpcClient, ) -> anyhow::Result { let validators_info = get_epoch_validators(epoch_id, rpc_client).await?; - let protocol_config = - match get_protocol_config(validators_info.epoch_start_height, rpc_client, false).await { - Ok(protocol_config) => protocol_config, - Err(e) => { - tracing::warn!( - "Error fetching protocol config: {:?}. Try with another blocks", - e - ); - get_protocol_config(validators_info.epoch_start_height, rpc_client, true).await? - } - }; - Ok(readnode_primitives::IndexedEpochInfo { epoch_id, epoch_height: validators_info.epoch_height, epoch_start_height: validators_info.epoch_start_height, epoch_end_height: None, validators_info, - protocol_config, }) } @@ -219,21 +165,14 @@ pub async fn save_epoch_info( epoch.epoch_height }; - let save_validators_feature = db_manager.add_validators( - epoch.epoch_id, - epoch_height, - epoch.epoch_start_height, - &epoch.validators_info, - ); - - let save_protocol_config_feature = db_manager.add_protocol_config( - epoch.epoch_id, - epoch_height, - epoch.epoch_start_height, - &epoch.protocol_config, - ); - - futures::try_join!(save_validators_feature, save_protocol_config_feature)?; + db_manager + .add_validators( + epoch.epoch_id, + epoch_height, + epoch.epoch_start_height, + &epoch.validators_info, + ) + .await?; tracing::info!( "Save epoch info: epoch_id: {:?}, epoch_height: {:?}, epoch_start_height: {}", epoch.epoch_id, diff --git a/perf-testing/Cargo.toml b/perf-testing/Cargo.toml index a941abdc..f4f9e5b6 100644 --- a/perf-testing/Cargo.toml +++ b/perf-testing/Cargo.toml @@ -10,15 +10,15 @@ license.workspace = true [dependencies] anyhow = "1.0.70" chrono = "0.4.26" -clap = { version = "4.3.21", features = ["color", "derive", "env"] } +clap = { version = "4.4.18", features = ["color", "derive", "env"] } dotenv = "0.15" futures = "0.3.28" -http = "0.2.8" +http = "1.0.0" rand = "0.8" serde_json = "1.0" tokio = { version = "1.28.2", features = ["full", "tracing"] } tracing = "0.1.34" -near-jsonrpc-client = "0.7.0" -near-jsonrpc-primitives = "1.36.0" -near-primitives = "1.36.0" +near-jsonrpc-client = "0.8.0" +near-jsonrpc-primitives = "0.20.0" +near-primitives = "0.20.0" diff --git a/perf-testing/src/transactions.rs b/perf-testing/src/transactions.rs index 75a215b2..52965a17 100644 --- a/perf-testing/src/transactions.rs +++ b/perf-testing/src/transactions.rs @@ -10,8 +10,8 @@ async fn get_random_transaction(tx: &TxInfo, client: &JsonRpcClient) -> anyhow:: let _ = client .call(methods::tx::RpcTransactionStatusRequest { transaction_info: TransactionInfo::TransactionId { - hash: tx.hash, - account_id: tx.sender_id.clone(), + tx_hash: tx.hash, + sender_account_id: tx.sender_id.clone(), }, }) .await?; diff --git a/readnode-primitives/Cargo.toml b/readnode-primitives/Cargo.toml index 0c278267..a3cd7012 100644 --- a/readnode-primitives/Cargo.toml +++ b/readnode-primitives/Cargo.toml @@ -9,11 +9,10 @@ license.workspace = true [dependencies] anyhow = "1.0.70" -borsh = "0.10.2" -num-bigint = "0.3" +borsh = "1.3.1" num-traits = "0.2.15" serde = { version = "1.0.145", features = ["derive"] } serde_json = "1.0.85" -near-chain-configs = "1.36.0" -near-indexer-primitives = "1.36.0" +near-chain-configs = "0.20.0" +near-indexer-primitives = "0.20.0" diff --git a/readnode-primitives/src/lib.rs b/readnode-primitives/src/lib.rs index 96f1e999..c1602c90 100644 --- a/readnode-primitives/src/lib.rs +++ b/readnode-primitives/src/lib.rs @@ -1,7 +1,6 @@ use std::convert::TryFrom; use std::str::FromStr; -use borsh::{BorshDeserialize, BorshSerialize}; use near_indexer_primitives::{views, CryptoHash, IndexerTransactionWithOutcome}; use num_traits::ToPrimitive; use serde::{Deserialize, Serialize}; @@ -21,7 +20,7 @@ impl TransactionKey { } } -#[derive(BorshSerialize, BorshDeserialize, Serialize, Deserialize, Debug, Clone)] +#[derive(borsh::BorshSerialize, borsh::BorshDeserialize, Serialize, Deserialize, Debug, Clone)] pub struct CollectingTransactionDetails { pub transaction: views::SignedTransactionView, pub receipts: Vec, @@ -117,7 +116,7 @@ impl From for TransactionDetails { } } -#[derive(BorshSerialize, BorshDeserialize, Serialize, Deserialize, Debug, Clone)] +#[derive(borsh::BorshSerialize, borsh::BorshDeserialize, Serialize, Deserialize, Debug, Clone)] pub struct TransactionDetails { pub receipts: Vec, pub receipts_outcome: Vec, @@ -169,7 +168,7 @@ impl TransactionDetails { pub type StateKey = Vec; pub type StateValue = Vec; pub struct BlockHeightShardId(pub u64, pub u64); -pub struct QueryData { +pub struct QueryData { pub data: T, // block_height and block_hash we return here represents the moment // when the data was last updated in the database @@ -198,14 +197,6 @@ pub struct EpochValidatorsInfo { pub validators_info: views::EpochValidatorInfo, } -#[derive(Debug)] -pub struct ProtocolConfig { - pub epoch_id: CryptoHash, - pub epoch_height: u64, - pub epoch_start_height: u64, - pub protocol_config: near_chain_configs::ProtocolConfigView, -} - #[derive(Debug)] pub struct IndexedEpochInfo { pub epoch_id: CryptoHash, @@ -213,7 +204,6 @@ pub struct IndexedEpochInfo { pub epoch_start_height: u64, pub epoch_end_height: Option, pub validators_info: views::EpochValidatorInfo, - pub protocol_config: near_chain_configs::ProtocolConfigView, } #[derive(Debug)] @@ -253,7 +243,7 @@ impl CryptoHash, )> for QueryData where - T: BorshDeserialize, + T: borsh::BorshDeserialize, { type Error = anyhow::Error; diff --git a/rpc-server/Cargo.toml b/rpc-server/Cargo.toml index 4133ea2b..84e41bed 100644 --- a/rpc-server/Cargo.toml +++ b/rpc-server/Cargo.toml @@ -8,42 +8,44 @@ repository.workspace = true license.workspace = true [dependencies] -actix-web = "4.2.1" -actix-cors = "0.6.5" +actix-web = "4.5.1" +actix-cors = "0.7.0" anyhow = "1.0.70" assert-json-diff = { version = "2.0.2", optional = true } -borsh = "0.10.2" -erased-serde = "0.3.23" +borsh = "1.3.1" +erased-serde = "0.4.2" futures = "0.3.24" futures-locks = "0.7.1" hex = "0.4.3" -jsonrpc-v2 = { git = "https://github.com/kobayurii/jsonrpc-v2", rev = "95e7b1d2567ae841163af212a3f25abb6862becb" } +jsonrpc-v2 = { git = "https://github.com/kobayurii/jsonrpc-v2", branch = "master" } lazy_static = "1.4.0" -lru = "0.11.1" +lru = "0.12.2" paste = "1.0.14" prometheus = "0.13.1" serde = { version = "1.0.145", features = ["derive"] } serde_json = "1.0.85" thiserror = "1.0.40" -tokio = { version = "1.28.2", features = ["full", "tracing"] } +tokio = { version = "1.36.0", features = ["full", "tracing"] } tokio-stream = { version = "0.1.12" } tracing = { version = "0.1.36", features = ["std"] } -tracing-actix-web = "0.6.1" -sysinfo = "0.29.10" +tracing-actix-web = "0.7.9" +sysinfo = "0.30.5" configuration = { path = "../configuration" } database = { path = "../database" } readnode-primitives = { path = "../readnode-primitives" } -near-chain-configs = "1.36.0" -near-crypto = "1.36.0" -near-jsonrpc-client = "0.7.0" -near-jsonrpc-primitives = "1.36.0" -near-indexer-primitives = "1.36.0" -near-lake-framework = "0.7.9" -near-primitives = "1.36.0" -near-vm-runner = "1.36.0" +near-chain-configs = "0.20.0" +near-crypto = "0.20.0" +#near-jsonrpc-client = "0.8.0" Supports of nearcore 1.37 will be released in the next version +near-jsonrpc-client = {git = "https://github.com/near/near-jsonrpc-client-rs.git", branch = "telezhnaya/wait_until"} +near-jsonrpc-primitives = "0.20.0" +near-indexer-primitives = "0.20.0" +near-lake-framework = "0.7.7" +near-primitives = "0.20.0" +near-parameters = "0.20.0" +near-vm-runner = "0.20.0" [features] default = ["send_tx_methods", "scylla_db"] diff --git a/rpc-server/Dockerfile b/rpc-server/Dockerfile index d77fea83..a0c4147b 100644 --- a/rpc-server/Dockerfile +++ b/rpc-server/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.73 AS builder +FROM rust:1.75 AS builder ARG features="default" WORKDIR /tmp/ diff --git a/rpc-server/src/config.rs b/rpc-server/src/config.rs index 37d841da..fc6a1b38 100644 --- a/rpc-server/src/config.rs +++ b/rpc-server/src/config.rs @@ -4,9 +4,9 @@ use std::string::ToString; // TODO: Improve versioning in future. // For now, it's hardcoded and should be updated manually at each release.. -static NEARD_VERSION: &str = "1.36.0"; -static NEARD_BUILD: &str = "1.36.0"; -static RUSTC_VERSION: &str = "1.73.0"; +static NEARD_VERSION: &str = "1.37.0"; +static NEARD_BUILD: &str = "1.37.0"; +static RUSTC_VERSION: &str = "1.75.0"; // Struct to store genesis_config and genesis_block in the server context // Fetch once genesis info on start of the server and put it in the context diff --git a/rpc-server/src/errors.rs b/rpc-server/src/errors.rs index e0922b4f..c052c869 100644 --- a/rpc-server/src/errors.rs +++ b/rpc-server/src/errors.rs @@ -9,10 +9,14 @@ type BoxedSerialize = Box; pub struct RPCError(pub(crate) near_jsonrpc_primitives::errors::RpcError); impl RPCError { - pub(crate) fn unimplemented_error(msg: &str) -> Self { + pub(crate) fn unimplemented_error(method_name: &str) -> Self { Self::from(near_jsonrpc_primitives::errors::RpcError::new( -32601, - String::from(msg), + format!( + "Method `{}` is not implemented on this type of node. \ + Please send a request to NEAR JSON RPC instead.", + method_name + ), None, )) } diff --git a/rpc-server/src/main.rs b/rpc-server/src/main.rs index 3a30e7b2..c5689a38 100644 --- a/rpc-server/src/main.rs +++ b/rpc-server/src/main.rs @@ -52,36 +52,25 @@ async fn main() -> anyhow::Result<()> { let rpc = Server::new() .with_data(Data::new(server_context.clone())) - .with_method("query", modules::queries::methods::query) + // custom requests methods .with_method( "view_state_paginated", modules::state::methods::view_state_paginated, ) + // requests methods + .with_method("query", modules::queries::methods::query) + // basic requests methods .with_method("block", modules::blocks::methods::block) - .with_method( - "EXPERIMENTAL_changes", - modules::blocks::methods::changes_in_block_by_type, - ) - .with_method( - "EXPERIMENTAL_changes_in_block", - modules::blocks::methods::changes_in_block, - ) - .with_method("chunk", modules::blocks::methods::chunk) - .with_method("tx", modules::transactions::methods::tx) - .with_method( - "EXPERIMENTAL_tx_status", - modules::transactions::methods::tx_status, - ) .with_method( "broadcast_tx_async", - modules::transactions::methods::send_tx_async, + modules::transactions::methods::broadcast_tx_async, ) .with_method( "broadcast_tx_commit", - modules::transactions::methods::send_tx_commit, + modules::transactions::methods::broadcast_tx_commit, ) + .with_method("chunk", modules::blocks::methods::chunk) .with_method("gas_price", modules::gas::methods::gas_price) - .with_method("status", modules::network::methods::status) .with_method("health", modules::network::methods::health) .with_method( "light_client_proof", @@ -92,10 +81,18 @@ async fn main() -> anyhow::Result<()> { modules::clients::methods::next_light_client_block, ) .with_method("network_info", modules::network::methods::network_info) + .with_method("send_tx", modules::transactions::methods::send_tx) + .with_method("status", modules::network::methods::status) + .with_method("tx", modules::transactions::methods::tx) .with_method("validators", modules::network::methods::validators) + .with_method("client_config", modules::network::methods::client_config) .with_method( - "EXPERIMENTAL_validators_ordered", - modules::network::methods::validators_ordered, + "EXPERIMENTAL_changes", + modules::blocks::methods::changes_in_block_by_type, + ) + .with_method( + "EXPERIMENTAL_changes_in_block", + modules::blocks::methods::changes_in_block, ) .with_method( "EXPERIMENTAL_genesis_config", @@ -110,6 +107,22 @@ async fn main() -> anyhow::Result<()> { modules::network::methods::protocol_config, ) .with_method("EXPERIMENTAL_receipt", modules::receipts::methods::receipt) + .with_method( + "EXPERIMENTAL_tx_status", + modules::transactions::methods::tx_status, + ) + .with_method( + "EXPERIMENTAL_validators_ordered", + modules::network::methods::validators_ordered, + ) + .with_method( + "EXPERIMENTAL_maintenance_windows", + modules::network::methods::maintenance_windows, + ) + .with_method( + "EXPERIMENTAL_split_storage_info", + modules::network::methods::split_storage_info, + ) .finish(); actix_web::HttpServer::new(move || { diff --git a/rpc-server/src/modules/blocks/mod.rs b/rpc-server/src/modules/blocks/mod.rs index d1589293..48aeb894 100644 --- a/rpc-server/src/modules/blocks/mod.rs +++ b/rpc-server/src/modules/blocks/mod.rs @@ -31,7 +31,6 @@ impl From for CacheBlock { #[derive(Debug)] pub struct FinalBlockInfo { pub final_block_cache: CacheBlock, - pub current_protocol_config: near_chain_configs::ProtocolConfigView, pub current_validators: near_primitives::views::EpochValidatorInfo, } @@ -45,9 +44,6 @@ impl FinalBlockInfo { let final_block = crate::utils::get_final_cache_block(near_rpc_client) .await .expect("Error to get final block"); - let protocol_config = crate::utils::get_current_protocol_config(near_rpc_client) - .await - .expect("Error to get protocol_config"); let validators = crate::utils::get_current_validators(near_rpc_client) .await @@ -60,7 +56,6 @@ impl FinalBlockInfo { Self { final_block_cache: final_block, - current_protocol_config: protocol_config, current_validators: validators, } } diff --git a/rpc-server/src/modules/network/methods.rs b/rpc-server/src/modules/network/methods.rs index 58f023be..0a472040 100644 --- a/rpc-server/src/modules/network/methods.rs +++ b/rpc-server/src/modules/network/methods.rs @@ -5,7 +5,28 @@ use near_primitives::utils::from_timestamp; use crate::config::ServerContext; use crate::errors::RPCError; use crate::modules::blocks::utils::fetch_block_from_cache_or_get; -use crate::modules::network::{clone_protocol_config, parse_validator_request}; +use crate::modules::network::parse_validator_request; + +pub async fn client_config( + _data: Data, + Params(_params): Params, +) -> Result<(), RPCError> { + Err(RPCError::unimplemented_error("client_config")) +} + +pub async fn maintenance_windows( + _data: Data, + Params(_params): Params, +) -> Result<(), RPCError> { + Err(RPCError::unimplemented_error("maintenance_windows")) +} + +pub async fn split_storage_info( + _data: Data, + Params(_params): Params, +) -> Result<(), RPCError> { + Err(RPCError::unimplemented_error("split_storage_info")) +} pub async fn status( data: Data, @@ -70,11 +91,13 @@ pub async fn health( } pub async fn network_info( + data: Data, Params(_params): Params, ) -> Result { - Err(RPCError::unimplemented_error( - "Method is not implemented on this type of node. Please send a request to NEAR JSON RPC instead.", - )) + Ok(data + .near_rpc_client + .call(near_jsonrpc_client::methods::network_info::RpcNetworkInfoRequest) + .await?) } pub async fn validators( @@ -235,25 +258,18 @@ async fn protocol_config_call( error_message: err.to_string(), } })?; - let protocol_config = if data - .final_block_info - .read() - .await - .final_block_cache - .epoch_id - == block.epoch_id - { - let protocol_config = &data.final_block_info.read().await.current_protocol_config; - clone_protocol_config(protocol_config) - } else { - data.db_manager - .get_protocol_config_by_epoch_id(block.epoch_id) - .await - .map_err(|err| { - near_jsonrpc_primitives::types::config::RpcProtocolConfigError::InternalError { - error_message: err.to_string(), - } - })? + + let store = near_parameters::RuntimeConfigStore::for_chain_id( + &data.genesis_info.genesis_config.chain_id, + ); + let runtime_config = store.get_config(block.latest_protocol_version); + let protocol_config = near_chain_configs::ProtocolConfig { + genesis_config: data.genesis_info.genesis_config.clone(), + runtime_config: near_parameters::RuntimeConfig { + fees: runtime_config.fees.clone(), + wasm_config: runtime_config.wasm_config.clone(), + account_creation_config: runtime_config.account_creation_config.clone(), + }, }; - Ok(protocol_config) + Ok(protocol_config.into()) } diff --git a/rpc-server/src/modules/network/mod.rs b/rpc-server/src/modules/network/mod.rs index f424168b..c2a2e208 100644 --- a/rpc-server/src/modules/network/mod.rs +++ b/rpc-server/src/modules/network/mod.rs @@ -20,43 +20,3 @@ async fn parse_validator_request( }; Ok(request) } - -/// cannot move out of dereference of `futures_locks::RwLockReadGuard` -/// move occurs because value `current_protocol_config` has type `ProtocolConfigView`, -/// which does not implement the `Copy` trait -pub fn clone_protocol_config( - protocol_config: &near_chain_configs::ProtocolConfigView, -) -> near_chain_configs::ProtocolConfigView { - near_chain_configs::ProtocolConfigView { - protocol_version: protocol_config.protocol_version, - genesis_time: protocol_config.genesis_time, - chain_id: protocol_config.chain_id.clone(), - genesis_height: protocol_config.genesis_height, - num_block_producer_seats: protocol_config.num_block_producer_seats, - num_block_producer_seats_per_shard: protocol_config - .num_block_producer_seats_per_shard - .clone(), - avg_hidden_validator_seats_per_shard: protocol_config - .avg_hidden_validator_seats_per_shard - .clone(), - dynamic_resharding: protocol_config.dynamic_resharding, - protocol_upgrade_stake_threshold: protocol_config.protocol_upgrade_stake_threshold, - epoch_length: protocol_config.epoch_length, - gas_limit: protocol_config.gas_limit, - min_gas_price: protocol_config.min_gas_price, - max_gas_price: protocol_config.max_gas_price, - block_producer_kickout_threshold: protocol_config.block_producer_kickout_threshold, - chunk_producer_kickout_threshold: protocol_config.chunk_producer_kickout_threshold, - online_min_threshold: protocol_config.online_min_threshold, - online_max_threshold: protocol_config.online_max_threshold, - gas_price_adjustment_rate: protocol_config.gas_price_adjustment_rate, - runtime_config: protocol_config.runtime_config.clone(), - transaction_validity_period: protocol_config.transaction_validity_period, - protocol_reward_rate: protocol_config.protocol_reward_rate, - max_inflation_rate: protocol_config.max_inflation_rate, - num_blocks_per_year: protocol_config.num_blocks_per_year, - protocol_treasury_account: protocol_config.protocol_treasury_account.clone(), - fishermen_threshold: protocol_config.fishermen_threshold, - minimum_stake_divisor: protocol_config.minimum_stake_divisor, - } -} diff --git a/rpc-server/src/modules/queries/methods.rs b/rpc-server/src/modules/queries/methods.rs index 11f7a5c6..f9976ccf 100644 --- a/rpc-server/src/modules/queries/methods.rs +++ b/rpc-server/src/modules/queries/methods.rs @@ -301,12 +301,10 @@ async fn view_code( )?; Ok(near_jsonrpc_primitives::types::query::RpcQueryResponse { kind: near_jsonrpc_primitives::types::query::QueryResponseKind::ViewCode( - near_primitives::views::ContractCodeView::from( - near_primitives::contract::ContractCode::new( - contract_code.data, - Some(contract.data.code_hash()), - ), - ), + near_primitives::views::ContractCodeView { + code: contract_code.data, + hash: contract.data.code_hash(), + }, ), block_height: block.block_height, block_hash: block.block_hash, diff --git a/rpc-server/src/modules/queries/mod.rs b/rpc-server/src/modules/queries/mod.rs index 3b192147..a57d0430 100644 --- a/rpc-server/src/modules/queries/mod.rs +++ b/rpc-server/src/modules/queries/mod.rs @@ -122,8 +122,8 @@ impl near_vm_runner::logic::External for CodeStorage { } #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(self)))] - fn get_trie_nodes_count(&self) -> near_primitives::types::TrieNodesCount { - near_primitives::types::TrieNodesCount { + fn get_trie_nodes_count(&self) -> near_vm_runner::logic::TrieNodesCount { + near_vm_runner::logic::TrieNodesCount { db_reads: 0, mem_reads: 0, } @@ -141,4 +141,101 @@ impl near_vm_runner::logic::External for CodeStorage { fn validator_total_stake(&self) -> Result { Ok(self.validators.values().sum()) } + + fn create_receipt( + &mut self, + _receipt_indices: Vec, + _receiver_id: near_primitives::types::AccountId, + ) -> Result { + Err(near_vm_runner::logic::VMLogicError::HostError( + near_vm_runner::logic::HostError::ProhibitedInView { + method_name: String::from("create_receipt"), + }, + )) + } + + fn append_action_create_account( + &mut self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + ) -> Result<()> { + Ok(()) + } + + fn append_action_deploy_contract( + &mut self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + _code: Vec, + ) -> Result<()> { + Ok(()) + } + + fn append_action_function_call_weight( + &mut self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + _method_name: Vec, + _args: Vec, + _attached_deposit: near_primitives::types::Balance, + _prepaid_gas: near_primitives::types::Gas, + _gas_weight: near_primitives::types::GasWeight, + ) -> Result<()> { + Ok(()) + } + + fn append_action_transfer( + &mut self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + _deposit: near_primitives::types::Balance, + ) -> Result<()> { + Ok(()) + } + + fn append_action_stake( + &mut self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + _stake: near_primitives::types::Balance, + _public_key: near_crypto::PublicKey, + ) { + } + + fn append_action_add_key_with_full_access( + &mut self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + _public_key: near_crypto::PublicKey, + _nonce: near_primitives::types::Nonce, + ) { + } + + fn append_action_add_key_with_function_call( + &mut self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + _public_key: near_crypto::PublicKey, + _nonce: near_primitives::types::Nonce, + _allowance: Option, + _receiver_id: near_primitives::types::AccountId, + _method_names: Vec>, + ) -> Result<()> { + Ok(()) + } + + fn append_action_delete_key( + &mut self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + _public_key: near_crypto::PublicKey, + ) { + } + + fn append_action_delete_account( + &mut self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + _beneficiary_id: near_primitives::types::AccountId, + ) -> Result<()> { + Ok(()) + } + + fn get_receipt_receiver( + &self, + _receipt_index: near_vm_runner::logic::types::ReceiptIndex, + ) -> &near_primitives::types::AccountId { + panic!("Prohibited in view. `get_receipt_receiver`"); + } } diff --git a/rpc-server/src/modules/queries/utils.rs b/rpc-server/src/modules/queries/utils.rs index 04e974ec..53b7bfc0 100644 --- a/rpc-server/src/modules/queries/utils.rs +++ b/rpc-server/src/modules/queries/utils.rs @@ -1,13 +1,7 @@ use std::collections::HashMap; use std::ops::Deref; -#[cfg(feature = "account_access_keys")] -use borsh::BorshDeserialize; -use borsh::BorshSerialize; use futures::StreamExt; -use near_crypto::{KeyType, PublicKey}; -use near_primitives::utils::create_random_seed; -use tokio::task; use crate::config::CompiledCodeCache; use crate::errors::FunctionCallError; @@ -91,12 +85,12 @@ pub async fn fetch_list_access_keys_from_db( .into_iter() .map( |(public_key_hex, access_key)| near_primitives::views::AccessKeyInfoView { - public_key: near_crypto::PublicKey::try_from_slice( + public_key: borsh::from_slice::( &hex::decode(public_key_hex).unwrap(), ) .unwrap(), access_key: near_primitives::views::AccessKeyView::from( - near_primitives::account::AccessKey::try_from_slice(&access_key).unwrap(), + borsh::from_slice::(&access_key).unwrap(), ), }, ) @@ -144,26 +138,32 @@ pub async fn fetch_state_from_db( tracing::instrument(skip(context, code_storage, contract_code, compiled_contract_code_cache)) )] async fn run_code_in_vm_runner( - contract_code: near_primitives::contract::ContractCode, + contract_code: near_vm_runner::ContractCode, method_name: &str, context: near_vm_runner::logic::VMContext, mut code_storage: CodeStorage, - latest_protocol_version: near_primitives::types::ProtocolVersion, + protocol_version: near_primitives::types::ProtocolVersion, compiled_contract_code_cache: &std::sync::Arc, ) -> Result { let contract_method_name = String::from(method_name); let code_cache = std::sync::Arc::clone(compiled_contract_code_cache); - let results = task::spawn_blocking(move || { + let store = near_parameters::RuntimeConfigStore::free(); + let config = store.get_config(protocol_version).wasm_config.clone(); + let mut vm_config = near_parameters::vm::Config { + vm_kind: config.vm_kind.replace_with_wasmtime_if_unsupported(), + ..config + }; + vm_config.make_free(); + let results = tokio::task::spawn_blocking(move || { near_vm_runner::run( &contract_code, &contract_method_name, &mut code_storage, context, - &near_vm_runner::logic::VMConfig::free(), - &near_primitives::runtime::fees::RuntimeFeesConfig::free(), + &vm_config, + &near_parameters::RuntimeFeesConfig::free(), &[], - latest_protocol_version, Some(code_cache.deref()), ) }) @@ -247,9 +247,7 @@ pub async fn run_contract( .cloned(); let contract_code = match code { - Some(code) => { - near_primitives::contract::ContractCode::new(code, Some(contract.data.code_hash())) - } + Some(code) => near_vm_runner::ContractCode::new(code, Some(contract.data.code_hash())), None => { let code = db_manager .get_contract_code(&account_id, block.block_height) @@ -261,7 +259,7 @@ pub async fn run_contract( .write() .await .put(contract.data.code_hash(), code.data.clone()); - near_primitives::contract::ContractCode::new(code.data, Some(contract.data.code_hash())) + near_vm_runner::ContractCode::new(code.data, Some(contract.data.code_hash())) } }; @@ -282,17 +280,17 @@ pub async fn run_contract( ) }; - let public_key = PublicKey::empty(KeyType::ED25519); - let random_seed = create_random_seed( + let public_key = near_crypto::PublicKey::empty(near_crypto::KeyType::ED25519); + let random_seed = near_primitives::utils::create_random_seed( block.latest_protocol_version, near_primitives::hash::CryptoHash::default(), block.state_root, ); let context = near_vm_runner::logic::VMContext { - current_account_id: account_id.parse().unwrap(), - signer_account_id: account_id.parse().unwrap(), - signer_account_pk: public_key.try_to_vec().expect("Failed to serialize"), - predecessor_account_id: account_id.parse().unwrap(), + current_account_id: account_id.clone(), + signer_account_id: account_id.clone(), + signer_account_pk: borsh::to_vec(&public_key).expect("Failed to serialize"), + predecessor_account_id: account_id.clone(), input: args.into(), block_height: block.block_height, block_timestamp: block.block_timestamp, @@ -303,13 +301,13 @@ pub async fn run_contract( attached_deposit: 0, prepaid_gas: max_gas_burnt, random_seed, - view_config: Some(near_vm_runner::logic::ViewConfig { max_gas_burnt }), + view_config: Some(near_primitives::config::ViewConfig { max_gas_burnt }), output_data_receivers: vec![], }; let code_storage = CodeStorage::init( db_manager.clone(), - account_id.clone(), + account_id, block.block_height, epoch_validators .iter() diff --git a/rpc-server/src/modules/transactions/methods.rs b/rpc-server/src/modules/transactions/methods.rs index 6962a9c4..dbadbb97 100644 --- a/rpc-server/src/modules/transactions/methods.rs +++ b/rpc-server/src/modules/transactions/methods.rs @@ -9,6 +9,13 @@ use near_primitives::views::FinalExecutionOutcomeViewEnum::{ }; use serde_json::Value; +pub async fn send_tx( + data: Data, + Params(params): Params, +) -> Result { + Ok(data.near_rpc_client.call(params).await?) +} + /// Queries status of a transaction by hash and returns the final transaction result. #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] pub async fn tx( @@ -32,8 +39,10 @@ pub async fn tx( // Note there is a difference in the implementation of the `tx` method in the `near_jsonrpc_client` // The method is `near_jsonrpc_client::methods::tx::RpcTransactionStatusRequest` in the client // so we can't just pass `params` there, instead we need to craft a request manually + // tx_status_request, near_jsonrpc_client::methods::tx::RpcTransactionStatusRequest { transaction_info: tx_status_request.transaction_info, + wait_until: tx_status_request.wait_until, }, "TX", ) @@ -71,6 +80,7 @@ pub async fn tx_status( // so we can't just pass `params` there, instead we need to craft a request manually near_jsonrpc_client::methods::EXPERIMENTAL_tx_status::RpcTransactionStatusRequest { transaction_info: tx_status_request.transaction_info, + wait_until: tx_status_request.wait_until, }, "EXPERIMENTAL_TX_STATUS", ) @@ -84,11 +94,11 @@ pub async fn tx_status( } #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] -pub async fn send_tx_async( +pub async fn broadcast_tx_async( data: Data, Params(params): Params, ) -> Result { - tracing::debug!("`send_tx_async` call. Params: {:?}", params); + tracing::debug!("`broadcast_tx_async` call. Params: {:?}", params); if cfg!(feature = "send_tx_methods") { let signed_transaction = match parse_signed_transaction(params).await { Ok(signed_transaction) => signed_transaction, @@ -110,11 +120,11 @@ pub async fn send_tx_async( } #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] -pub async fn send_tx_commit( +pub async fn broadcast_tx_commit( data: Data, Params(params): Params, ) -> Result { - tracing::debug!("`send_tx_commit` call. Params: {:?}", params); + tracing::debug!("`broadcast_tx_commit` call. Params: {:?}", params); if cfg!(feature = "send_tx_methods") { let signed_transaction = match parse_signed_transaction(params).await { Ok(signed_transaction) => signed_transaction, @@ -127,7 +137,11 @@ pub async fn send_tx_commit( match data.near_rpc_client.call(proxy_params).await { Ok(resp) => Ok( near_jsonrpc_primitives::types::transactions::RpcTransactionResponse { - final_execution_outcome: FinalExecutionOutcome(resp), + final_execution_outcome: Some(FinalExecutionOutcome(resp)), + // With the fact that we don't support non-finalised data yet, + // final_execution_status field can be always filled with FINAL. + // This logic will be more complicated when we add support of optimistic blocks. + final_execution_status: near_primitives::views::TxExecutionStatus::Final, }, ), Err(err) => Err(RPCError::from(err)), @@ -153,13 +167,13 @@ async fn tx_status_common( > { tracing::debug!("`tx_status_common` call."); let tx_hash = match &transaction_info { - near_jsonrpc_primitives::types::transactions::TransactionInfo::Transaction(tx) => { - tx.get_hash() - } + near_jsonrpc_primitives::types::transactions::TransactionInfo::Transaction( + near_jsonrpc_primitives::types::transactions::SignedTransaction::SignedTransaction(tx), + ) => tx.get_hash(), near_jsonrpc_primitives::types::transactions::TransactionInfo::TransactionId { - hash, + tx_hash, .. - } => *hash, + } => *tx_hash, }; let transaction_details = data @@ -175,17 +189,25 @@ async fn tx_status_common( if fetch_receipt { Ok( near_jsonrpc_primitives::types::transactions::RpcTransactionResponse { - final_execution_outcome: FinalExecutionOutcomeWithReceipt( + final_execution_outcome: Some(FinalExecutionOutcomeWithReceipt( transaction_details.to_final_execution_outcome_with_receipts(), - ), + )), + // With the fact that we don't support non-finalised data yet, + // final_execution_status field can be always filled with FINAL. + // This logic will be more complicated when we add support of optimistic blocks. + final_execution_status: near_primitives::views::TxExecutionStatus::Final, }, ) } else { Ok( near_jsonrpc_primitives::types::transactions::RpcTransactionResponse { - final_execution_outcome: FinalExecutionOutcome( + final_execution_outcome: Some(FinalExecutionOutcome( transaction_details.to_final_execution_outcome(), - ), + )), + // With the fact that we don't support non-finalised data yet, + // final_execution_status field can be always filled with FINAL. + // This logic will be more complicated when we add support of optimistic blocks. + final_execution_status: near_primitives::views::TxExecutionStatus::Final, }, ) } diff --git a/rpc-server/src/modules/transactions/mod.rs b/rpc-server/src/modules/transactions/mod.rs index cfec468f..8faff763 100644 --- a/rpc-server/src/modules/transactions/mod.rs +++ b/rpc-server/src/modules/transactions/mod.rs @@ -6,23 +6,24 @@ use serde_json::Value; pub async fn parse_transaction_status_common_request( value: Value, ) -> Result< - near_jsonrpc_primitives::types::transactions::RpcTransactionStatusCommonRequest, + near_jsonrpc_primitives::types::transactions::RpcTransactionStatusRequest, near_jsonrpc_primitives::errors::RpcError, > { tracing::debug!("`parse_transaction_status_common_request` call."); - if let Ok((hash, account_id)) = serde_json::from_value::<( + if let Ok((tx_hash, sender_account_id)) = serde_json::from_value::<( near_primitives::hash::CryptoHash, near_primitives::types::AccountId, )>(value.clone()) { let transaction_info = near_jsonrpc_primitives::types::transactions::TransactionInfo::TransactionId { - hash, - account_id, + tx_hash, + sender_account_id, }; Ok( - near_jsonrpc_primitives::types::transactions::RpcTransactionStatusCommonRequest { + near_jsonrpc_primitives::types::transactions::RpcTransactionStatusRequest { transaction_info, + wait_until: near_primitives::views::TxExecutionStatus::Final, }, ) } else { @@ -32,11 +33,14 @@ pub async fn parse_transaction_status_common_request( let transaction_info = near_jsonrpc_primitives::types::transactions::TransactionInfo::Transaction( - signed_transaction, + near_jsonrpc_primitives::types::transactions::SignedTransaction::SignedTransaction( + signed_transaction, + ), ); Ok( - near_jsonrpc_primitives::types::transactions::RpcTransactionStatusCommonRequest { + near_jsonrpc_primitives::types::transactions::RpcTransactionStatusRequest { transaction_info, + wait_until: near_primitives::views::TxExecutionStatus::Final, }, ) } diff --git a/rpc-server/src/utils.rs b/rpc-server/src/utils.rs index 72887ecc..49ce9e35 100644 --- a/rpc-server/src/utils.rs +++ b/rpc-server/src/utils.rs @@ -2,7 +2,6 @@ use crate::modules::blocks::{CacheBlock, FinalBlockInfo}; #[cfg(feature = "shadow_data_consistency")] use assert_json_diff::{assert_json_matches_no_panic, CompareMode, Config, NumericMode}; use futures::StreamExt; -use sysinfo::{System, SystemExt}; #[cfg(feature = "shadow_data_consistency")] const DEFAULT_RETRY_COUNT: u8 = 3; @@ -121,18 +120,6 @@ pub async fn get_final_cache_block(near_rpc_client: &JsonRpcClient) -> Option anyhow::Result { - let params = - near_jsonrpc_client::methods::EXPERIMENTAL_protocol_config::RpcProtocolConfigRequest { - block_reference: near_primitives::types::BlockReference::Finality( - near_primitives::types::Finality::Final, - ), - }; - Ok(near_rpc_client.call(params).await?) -} - pub async fn get_current_validators( near_rpc_client: &JsonRpcClient, ) -> anyhow::Result { @@ -154,8 +141,6 @@ async fn handle_streamer_message( if final_block_info.read().await.final_block_cache.epoch_id != block.epoch_id { tracing::info!("New epoch started: {:?}", block.epoch_id); - final_block_info.write().await.current_protocol_config = - get_current_protocol_config(near_rpc_client).await?; final_block_info.write().await.current_validators = get_current_validators(near_rpc_client).await?; } @@ -214,7 +199,7 @@ pub(crate) async fn calculate_contract_code_cache_sizes( block_cache_size: usize, limit_memory_cache: Option, ) -> usize { - let sys = System::new_all(); + let sys = sysinfo::System::new_all(); let total_memory = sys.total_memory() as usize; // Total memory in bytes let used_memory = sys.used_memory() as usize; // Used memory in bytes let available_memory = total_memory - used_memory - reserved_memory; // Available memory in bytes diff --git a/rust-toolchain b/rust-toolchain index 5e3a4256..7c7053aa 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.73.0 +1.75.0 diff --git a/state-indexer/Cargo.toml b/state-indexer/Cargo.toml index 9edf1bbd..db8297f3 100644 --- a/state-indexer/Cargo.toml +++ b/state-indexer/Cargo.toml @@ -10,30 +10,30 @@ license.workspace = true [dependencies] actix-web = "4.2.1" anyhow = "1.0.70" -borsh = "0.10.2" -clap = { version = "3.1.6", features = ["color", "derive"] } +borsh = "1.3.1" +clap = "4.4.18" futures = "0.3.5" hex = "0.4.3" humantime = "2.1.0" lazy_static = "1.4.0" openssl-probe = "0.1.5" prometheus = "0.13.1" -tokio = { version = "1.28.2", features = [ +tokio = { version = "1.36.0", features = [ "sync", "time", "macros", "rt-multi-thread", ] } -tokio-stream = { version = "0.1" } +tokio-stream = "0.1" tracing = "0.1.34" configuration = { path = "../configuration" } database = { path = "../database" } epoch-indexer = { path = "../epoch-indexer" } -near-primitives = "1.36.0" -near-indexer-primitives = "1.36.0" -near-jsonrpc-client = "0.7.0" -near-lake-framework = "0.7.9" +near-primitives = "0.20.0" +near-indexer-primitives = "0.20.0" +near-jsonrpc-client = "0.8.0" +near-lake-framework = "0.7.7" [features] default = ["scylla_db"] diff --git a/state-indexer/Dockerfile b/state-indexer/Dockerfile index 3394977c..52973170 100644 --- a/state-indexer/Dockerfile +++ b/state-indexer/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.73 AS builder +FROM rust:1.75 AS builder ARG features="default" WORKDIR /tmp/ diff --git a/state-indexer/src/configs.rs b/state-indexer/src/configs.rs index 6fc720f5..f73524b0 100644 --- a/state-indexer/src/configs.rs +++ b/state-indexer/src/configs.rs @@ -5,14 +5,6 @@ use near_lake_framework::near_indexer_primitives::types::{BlockReference, Finali /// NEAR Indexer for Explorer /// Watches for stream of blocks from the chain #[derive(Parser, Debug)] -#[clap( - version, - author, - about, - setting(clap::AppSettings::DisableHelpSubcommand), - setting(clap::AppSettings::PropagateVersion), - setting(clap::AppSettings::NextLineHelp) -)] pub(crate) struct Opts { #[clap(subcommand)] pub start_options: StartOptions, diff --git a/state-indexer/src/main.rs b/state-indexer/src/main.rs index 4b5050f0..608eaad4 100644 --- a/state-indexer/src/main.rs +++ b/state-indexer/src/main.rs @@ -1,4 +1,3 @@ -use borsh::BorshSerialize; use clap::Parser; use futures::StreamExt; @@ -168,7 +167,7 @@ async fn handle_state_changes( // returning a hex-encoded key to ensure we store data changes to the key // (if there is more than one change to the same key) let key: &[u8] = key.as_ref(); - format!("{}_data_{}", account_id.as_ref(), hex::encode(key)) + format!("{}_data_{}", account_id.as_str(), hex::encode(key)) } StateChangeValueView::AccessKeyUpdate { account_id, public_key, .. @@ -176,16 +175,14 @@ async fn handle_state_changes( | StateChangeValueView::AccessKeyDeletion { account_id, public_key } => { // returning a hex-encoded key to ensure we store data changes to the key // (if there is more than one change to the same key) - let data_key = public_key - .try_to_vec() - .expect("Failed to borsh-serialize the PublicKey"); - format!("{}_access_key_{}", account_id.as_ref(), hex::encode(data_key)) + let data_key = borsh::to_vec(&public_key)?; + format!("{}_access_key_{}", account_id.as_str(), hex::encode(data_key)) } // ContractCode and Account changes is not separate-able by any key, we can omit the suffix StateChangeValueView::ContractCodeUpdate { account_id, .. } - | StateChangeValueView::ContractCodeDeletion { account_id } => format!("{}_contract", account_id.as_ref()), + | StateChangeValueView::ContractCodeDeletion { account_id } => format!("{}_contract", account_id.as_str()), StateChangeValueView::AccountUpdate { account_id, .. } - | StateChangeValueView::AccountDeletion { account_id } => format!("{}_account", account_id.as_ref()), + | StateChangeValueView::AccountDeletion { account_id } => format!("{}_account", account_id.as_str()), }; // This will override the previous record for this account_id + state change kind + suffix state_changes_to_store.insert(key, state_change); @@ -225,12 +222,8 @@ async fn store_state_change( public_key, access_key, } => { - let data_key = public_key - .try_to_vec() - .expect("Failed to borsh-serialize the PublicKey"); - let data_value = access_key - .try_to_vec() - .expect("Failed to borsh-serialize the AccessKey"); + let data_key = borsh::to_vec(&public_key)?; + let data_value = borsh::to_vec(&access_key)?; let add_access_key_future = db_manager.add_access_key(account_id.clone(), block_height, block_hash, &data_key, &data_value); @@ -244,9 +237,7 @@ async fn store_state_change( add_access_key_future.await?; } StateChangeValueView::AccessKeyDeletion { account_id, public_key } => { - let data_key = public_key - .try_to_vec() - .expect("Failed to borsh-serialize the PublicKey"); + let data_key = borsh::to_vec(&public_key)?; let delete_access_key_future = db_manager.delete_access_key(account_id.clone(), block_height, block_hash, &data_key); @@ -270,9 +261,7 @@ async fn store_state_change( .await? } StateChangeValueView::AccountUpdate { account_id, account } => { - let value = Account::from(account) - .try_to_vec() - .expect("Failed to borsh-serialize the Account"); + let value = borsh::to_vec(&Account::from(account))?; db_manager .add_account(account_id, block_height, block_hash, value) .await? diff --git a/tx-indexer/Cargo.toml b/tx-indexer/Cargo.toml index 84177c8b..1657834d 100644 --- a/tx-indexer/Cargo.toml +++ b/tx-indexer/Cargo.toml @@ -8,30 +8,30 @@ repository.workspace = true license.workspace = true [dependencies] -actix-web = "4.2.1" +actix-web = "4.5.1" anyhow = "1.0.70" -clap = { version = "3.2.22", features = ["color", "derive", "env"] } +clap = "4.4.18" futures = "0.3.5" futures-locks = "0.7.1" humantime = "2.1.0" lazy_static = "1.4.0" prometheus = "0.13.1" -tokio = { version = "1.28.2", features = [ +tokio = { version = "1.36.0", features = [ "sync", "time", "macros", "rt-multi-thread", ] } -tokio-stream = { version = "0.1.12" } +tokio-stream = "0.1.12" tracing = "0.1.34" configuration = { path = "../configuration" } database = { path = "../database" } readnode-primitives = { path = "../readnode-primitives" } -near-indexer-primitives = "1.36.0" -near-jsonrpc-client = "0.7.0" -near-lake-framework = "0.7.9" +near-indexer-primitives = "0.20.0" +near-jsonrpc-client = "0.8.0" +near-lake-framework = "0.7.7" [features] default = ["scylla_db"] diff --git a/tx-indexer/Dockerfile b/tx-indexer/Dockerfile index e126acd1..a3460751 100644 --- a/tx-indexer/Dockerfile +++ b/tx-indexer/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.73 AS builder +FROM rust:1.75 AS builder ARG features="default" WORKDIR /tmp/ diff --git a/tx-indexer/src/config.rs b/tx-indexer/src/config.rs index cdf13039..372d0ff3 100644 --- a/tx-indexer/src/config.rs +++ b/tx-indexer/src/config.rs @@ -5,14 +5,6 @@ use near_jsonrpc_client::{methods, JsonRpcClient}; /// NEAR Indexer for Explorer /// Watches for stream of blocks from the chain #[derive(Parser, Debug)] -#[clap( - version, - author, - about, - setting(clap::AppSettings::DisableHelpSubcommand), - setting(clap::AppSettings::PropagateVersion), - setting(clap::AppSettings::NextLineHelp) -)] pub(crate) struct Opts { #[clap(subcommand)] pub start_options: StartOptions, From dc5779be19a2a1fad4fdb723c9602ca11916604d Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Thu, 7 Mar 2024 15:48:11 +0200 Subject: [PATCH 2/8] Enhance state-indexer compatibility with NEAR Lake and NEAR Indexer Framework (#196) * add near-state-indexer * solve compilation problem * improvements * add readme --- Cargo.lock | 4284 ++++++++++++++++++--- Cargo.toml | 22 + README.md | 4 + config.toml | 4 + configuration/Cargo.toml | 2 +- configuration/README.md | 1 + configuration/example.config.toml | 11 + configuration/src/configs/general.rs | 72 +- configuration/src/configs/lake.rs | 43 +- configuration/src/configs/mod.rs | 41 +- configuration/src/lib.rs | 3 +- database/Cargo.toml | 12 +- database/src/base/state_indexer.rs | 117 + epoch-indexer/Cargo.toml | 14 +- near-state-indexer/Cargo.toml | 44 + near-state-indexer/README.md | 54 + near-state-indexer/src/configs.rs | 80 + near-state-indexer/src/main.rs | 312 ++ near-state-indexer/src/metrics.rs | 125 + near-state-indexer/src/utils.rs | 77 + perf-testing/src/main.rs | 2 +- readnode-primitives/Cargo.toml | 4 +- rpc-server/Cargo.toml | 27 +- rpc-server/Dockerfile | 4 +- rpc-server/src/config.rs | 2 +- rpc-server/src/modules/network/methods.rs | 20 +- rpc-server/src/modules/queries/mod.rs | 30 +- rust-toolchain | 2 +- state-indexer/Cargo.toml | 15 +- state-indexer/Dockerfile | 4 +- state-indexer/src/main.rs | 101 +- tx-indexer/Cargo.toml | 12 +- tx-indexer/Dockerfile | 4 +- 33 files changed, 4880 insertions(+), 669 deletions(-) create mode 100644 near-state-indexer/Cargo.toml create mode 100644 near-state-indexer/README.md create mode 100644 near-state-indexer/src/configs.rs create mode 100644 near-state-indexer/src/main.rs create mode 100644 near-state-indexer/src/metrics.rs create mode 100644 near-state-indexer/src/utils.rs diff --git a/Cargo.lock b/Cargo.lock index f5b619fc..d31e6bdc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,7 +30,7 @@ dependencies = [ "futures-util", "log", "once_cell", - "parking_lot", + "parking_lot 0.12.1", "pin-project-lite", "smallvec", "tokio", @@ -54,6 +54,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "actix-cors" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0346d8c1f762b41b458ed3145eea914966bb9ad20b9be0d6d463b20d45586370" +dependencies = [ + "actix-utils", + "actix-web", + "derive_more", + "futures-util", + "log", + "once_cell", + "smallvec", +] + [[package]] name = "actix-cors" version = "0.7.0" @@ -79,7 +94,7 @@ dependencies = [ "actix-rt", "actix-service", "actix-utils", - "ahash", + "ahash 0.8.11", "base64 0.21.7", "bitflags 2.4.2", "brotli", @@ -90,7 +105,7 @@ dependencies = [ "flate2", "futures-core", "h2", - "http 0.2.11", + "http 0.2.12", "httparse", "httpdate", "itoa", @@ -115,7 +130,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e01ed3140b2f8d422c68afa1ed2e85d996ea619c988ac834d255db32138655cb" dependencies = [ "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -125,7 +140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d22475596539443685426b6bdadb926ad0ecaefdfc5fb05e5e3441f15463c511" dependencies = [ "bytestring", - "http 0.2.11", + "http 0.2.12", "regex", "serde", "tracing", @@ -137,6 +152,7 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28f32d40287d3f402ae0028a9d54bef51af15c8769492826a69d28f81893151d" dependencies = [ + "actix-macros", "futures-core", "tokio", ] @@ -169,6 +185,27 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "actix-tls" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4cce60a2f2b477bc72e5cde0af1812a6e82d8fd85b5570a5dcf2a5bf2c5be5f" +dependencies = [ + "actix-rt", + "actix-service", + "actix-utils", + "futures-core", + "http 0.2.12", + "http 1.1.0", + "impl-more", + "openssl", + "pin-project-lite", + "tokio", + "tokio-openssl", + "tokio-util 0.7.10", + "tracing", +] + [[package]] name = "actix-utils" version = "3.0.1" @@ -194,10 +231,10 @@ dependencies = [ "actix-service", "actix-utils", "actix-web-codegen", - "ahash", + "ahash 0.8.11", "bytes", "bytestring", - "cfg-if", + "cfg-if 1.0.0", "cookie", "derive_more", "encoding_rs", @@ -228,7 +265,7 @@ dependencies = [ "actix-router", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -239,7 +276,7 @@ checksum = "7c7db3d5a9718568e4cf4a537cfd7070e6e6ff7481510d0237fb529ac850f6d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -259,11 +296,22 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.8" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" +dependencies = [ + "getrandom 0.2.12", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "getrandom 0.2.12", "once_cell", "version_check", @@ -317,9 +365,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -380,9 +428,21 @@ dependencies = [ [[package]] name = "arc-swap" -version = "1.6.0" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b3d0060af21e8d11a926981cc00c6c1541aa91dd64b9f881985c3da1094425f" + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "assert-json-diff" @@ -411,6 +471,17 @@ dependencies = [ "futures-core", ] +[[package]] +name = "async-recursion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "async-stream" version = "0.3.5" @@ -430,7 +501,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -441,7 +512,23 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", +] + +[[package]] +name = "attohttpc" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "262c3f7f5d61249d8c00e5546e2685cd15ebeeb1bc0f3cc5449350a1cb07319e" +dependencies = [ + "http 0.2.12", + "log", + "native-tls", + "openssl", + "serde", + "serde_json", + "url", + "wildmatch", ] [[package]] @@ -450,11 +537,45 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "awc" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68c09cc97310b926f01621faee652f3d1b0962545a3cec6c9ac07def9ea36c2c" +dependencies = [ + "actix-codec", + "actix-http", + "actix-rt", + "actix-service", + "actix-tls", + "actix-utils", + "base64 0.21.7", + "bytes", + "cfg-if 1.0.0", + "cookie", + "derive_more", + "futures-core", + "futures-util", + "h2", + "http 0.2.12", + "itoa", + "log", + "mime", + "openssl", + "percent-encoding", + "pin-project-lite", + "rand 0.8.5", + "serde", + "serde_json", + "serde_urlencoded", + "tokio", +] + [[package]] name = "aws-config" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7af266887e24cd5f6d2ea7433cacd25dcd4773b7f70e488701968a7cdf51df57" +checksum = "0b96342ea8948ab9bef3e6234ea97fc32e2d8a88d8fb6a084e52267317f94b6b" dependencies = [ "aws-credential-types", "aws-runtime", @@ -471,9 +592,9 @@ dependencies = [ "bytes", "fastrand 2.0.1", "hex", - "http 0.2.11", + "http 0.2.12", "hyper", - "ring", + "ring 0.17.8", "time", "tokio", "tracing", @@ -482,9 +603,9 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d56f287a9e65e4914bfedb5b22c056b65e4c232fca512d5509a9df36386759f" +checksum = "273fa47dafc9ef14c2c074ddddbea4561ff01b7f68d5091c0e9737ced605c01d" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -492,11 +613,36 @@ dependencies = [ "zeroize", ] +[[package]] +name = "aws-creds" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aeeee1a5defa63cba39097a510dfe63ef53658fc8995202a610f6a8a4d03639" +dependencies = [ + "attohttpc", + "dirs", + "rust-ini", + "serde", + "serde-xml-rs", + "thiserror", + "time", + "url", +] + +[[package]] +name = "aws-region" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42fed2b9fca70f2908268d057a607f2a906f47edbf856ea8587de9038d264e22" +dependencies = [ + "thiserror", +] + [[package]] name = "aws-runtime" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d6a29eca8ea8982028a4df81883e7001e250a21d323b86418884b5345950a4b" +checksum = "6e38bab716c8bf07da24be07ecc02e0f5656ce8f30a891322ecdcb202f943b85" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -508,7 +654,7 @@ dependencies = [ "aws-types", "bytes", "fastrand 2.0.1", - "http 0.2.11", + "http 0.2.12", "http-body", "percent-encoding", "pin-project-lite", @@ -518,9 +664,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c977e92277652aefb9a76a0fca652b26757d6845dce0d7bf4426da80f13d85b0" +checksum = "93d35d39379445970fc3e4ddf7559fff2c32935ce0b279f9cb27080d6b7c6d94" dependencies = [ "aws-credential-types", "aws-runtime", @@ -536,7 +682,7 @@ dependencies = [ "aws-smithy-xml", "aws-types", "bytes", - "http 0.2.11", + "http 0.2.12", "http-body", "once_cell", "percent-encoding", @@ -547,9 +693,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d7f527c7b28af1a641f7d89f9e6a4863e8ec00f39d2b731b056fc5ec5ce829" +checksum = "d84bd3925a17c9adbf6ec65d52104a44a09629d8f70290542beeee69a95aee7f" dependencies = [ "aws-credential-types", "aws-runtime", @@ -561,7 +707,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "http 0.2.11", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -569,9 +715,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0be3224cd574ee8ab5fd7c32087876f25c134c27ac603fcb38669ed8d346b0" +checksum = "2c2dae39e997f58bc4d6292e6244b26ba630c01ab671b6f9f44309de3eb80ab8" dependencies = [ "aws-credential-types", "aws-runtime", @@ -583,7 +729,7 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", - "http 0.2.11", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -591,9 +737,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b3167c60d82a13bbaef569da06041644ff41e85c6377e5dad53fa2526ccfe9d" +checksum = "17fd9a53869fee17cea77e352084e1aa71e2c5e323d974c13a9c2bcfd9544c7f" dependencies = [ "aws-credential-types", "aws-runtime", @@ -606,7 +752,7 @@ dependencies = [ "aws-smithy-types", "aws-smithy-xml", "aws-types", - "http 0.2.11", + "http 0.2.12", "once_cell", "regex-lite", "tracing", @@ -614,9 +760,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b1cbe0eee57a213039088dbdeca7be9352f24e0d72332d961e8a1cb388f82d" +checksum = "8ada00a4645d7d89f296fe0ddbc3fe3554f03035937c849a05d37ddffc1f29a1" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -628,12 +774,12 @@ dependencies = [ "form_urlencoded", "hex", "hmac", - "http 0.2.11", - "http 1.0.0", + "http 0.2.12", + "http 1.1.0", "once_cell", "p256", "percent-encoding", - "ring", + "ring 0.17.8", "sha2", "subtle", "time", @@ -643,9 +789,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ec441341e019c441aa78472ed6d206cfe198026c495277a95ac5bebda520742" +checksum = "fcf7f09a27286d84315dfb9346208abb3b0973a692454ae6d0bc8d803fcce3b4" dependencies = [ "futures-util", "pin-project-lite", @@ -654,9 +800,9 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.5" +version = "0.60.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee554133eca2611b66d23548e48f9b44713befdb025ab76bc00185b878397a1" +checksum = "0fd4b66f2a8e7c84d7e97bda2666273d41d2a2e25302605bcf906b7b2661ae5e" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -664,7 +810,7 @@ dependencies = [ "crc32c", "crc32fast", "hex", - "http 0.2.11", + "http 0.2.12", "http-body", "md-5", "pin-project-lite", @@ -686,9 +832,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.5" +version = "0.60.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85d6a0619f7b67183067fa3b558f94f90753da2df8c04aeb7336d673f804b0b8" +checksum = "b6ca214a6a26f1b7ebd63aa8d4f5e2194095643023f9608edf99a58247b9d80d" dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", @@ -696,7 +842,7 @@ dependencies = [ "bytes", "bytes-utils", "futures-core", - "http 0.2.11", + "http 0.2.12", "http-body", "once_cell", "percent-encoding", @@ -707,18 +853,18 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.60.5" +version = "0.60.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1c1b5186b6f5c579bf0de1bcca9dd3d946d6d51361ea1d18131f6a0b64e13ae" +checksum = "1af80ecf3057fb25fe38d1687e94c4601a7817c6a1e87c1b0635f7ecb644ace5" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-query" -version = "0.60.5" +version = "0.60.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c0a2ce65882e788d2cf83ff28b9b16918de0460c47bf66c5da4f6c17b4c9694" +checksum = "eb27084f72ea5fc20033efe180618677ff4a2f474b53d84695cfe310a6526cbc" dependencies = [ "aws-smithy-types", "urlencoding", @@ -726,9 +872,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b36f1f98c8d7b6256b86d4a3c8c4abb120670267baa9712a485ba477eaac9e9" +checksum = "fbb5fca54a532a36ff927fbd7407a7c8eb9c3b4faf72792ba2965ea2cad8ed55" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -737,7 +883,7 @@ dependencies = [ "bytes", "fastrand 2.0.1", "h2", - "http 0.2.11", + "http 0.2.12", "http-body", "hyper", "hyper-rustls", @@ -751,15 +897,15 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180898ed701a773fb3fadbd94b9e9559125cf88eeb1815ab99e35d4f5f34f7fb" +checksum = "22389cb6f7cac64f266fb9f137745a9349ced7b47e0d2ba503e9e40ede4f7060" dependencies = [ "aws-smithy-async", "aws-smithy-types", "bytes", - "http 0.2.11", - "http 1.0.0", + "http 0.2.12", + "http 1.1.0", "pin-project-lite", "tokio", "tracing", @@ -768,15 +914,15 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897f1db4020ad91f2c2421945ec49b7e3eb81cc3fea99e8b5dd5be721e697fed" +checksum = "f081da5481210523d44ffd83d9f0740320050054006c719eae0232d411f024d3" dependencies = [ "base64-simd", "bytes", "bytes-utils", "futures-core", - "http 0.2.11", + "http 0.2.12", "http-body", "itoa", "num-integer", @@ -791,25 +937,25 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.60.5" +version = "0.60.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d16f94c9673412b7a72e3c3efec8de89081c320bf59ea12eed34c417a62ad600" +checksum = "0fccd8f595d0ca839f9f2548e66b99514a85f92feb4c01cf2868d93eb4888a42" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "1.1.5" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ff7e122ee50ca962e9de91f5850cc37e2184b1219611eef6d44aa85929b54f6" +checksum = "d07c63521aa1ea9a9f92a701f1a08ce3fd20b46c6efc0d5c8947c1fd879e3df1" dependencies = [ "aws-credential-types", "aws-smithy-async", "aws-smithy-runtime-api", "aws-smithy-types", - "http 0.2.11", - "rustc_version", + "http 0.2.12", + "rustc_version 0.4.0", "tracing", ] @@ -821,7 +967,7 @@ checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", @@ -834,6 +980,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + [[package]] name = "base64" version = "0.13.1" @@ -864,9 +1016,9 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bigdecimal" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06619be423ea5bb86c95f087d5707942791a08a85530df0db2209a3ecfb8bc9" +checksum = "9324c8014cd04590682b34f1e9448d38f0674d0f7b2dc553331016ef0e4e9ebc" dependencies = [ "autocfg", "libm", @@ -875,6 +1027,36 @@ dependencies = [ "num-traits", ] +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.65.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.52", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -887,6 +1069,27 @@ version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + [[package]] name = "blake2" version = "0.9.2" @@ -898,13 +1101,48 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "blake3" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b64485778c4f16a6a5a9d335e80d449ac6c70cdd6a06d2af18a6f6f775a125b3" +dependencies = [ + "arrayref", + "arrayvec", + "cc", + "cfg-if 0.1.10", + "constant_time_eq", + "crypto-mac", + "digest 0.9.0", +] + [[package]] name = "block-buffer" version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array", + "generic-array 0.14.7", +] + +[[package]] +name = "block_on_proc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b872f3528eeeb4370ee73b51194dc1cd93680c2d0eb6c7a223889038d2c1a167" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" +dependencies = [ + "borsh-derive 0.9.3", + "hashbrown 0.11.2", ] [[package]] @@ -913,10 +1151,23 @@ version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" dependencies = [ - "borsh-derive", + "borsh-derive 1.3.1", "cfg_aliases", ] +[[package]] +name = "borsh-derive" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + [[package]] name = "borsh-derive" version = "1.3.1" @@ -927,10 +1178,32 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", "syn_derive", ] +[[package]] +name = "borsh-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "brotli" version = "3.4.0" @@ -960,9 +1233,31 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bumpalo" -version = "3.15.0" +version = "3.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" + +[[package]] +name = "bytecheck" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23cdc57ce23ac53c931e88a43d06d070a6fd142f2617be5855eb75efc9beb1c2" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" +checksum = "3db406d29fbcd95542e92559bed4d8ad92636d1ca8b3b72ede10b4bcc010e659" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "byteorder" @@ -1004,6 +1299,17 @@ dependencies = [ "bytes", ] +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + [[package]] name = "c2-chacha" version = "0.3.3" @@ -1022,14 +1328,29 @@ checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" [[package]] name = "cc" -version = "1.0.83" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "a0ba8f7aaa012f30d5b2861462f6708eccd49c3c39863fe083a308035f63d723" dependencies = [ "jobserver", "libc", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" @@ -1044,9 +1365,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1054,7 +1375,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -1063,16 +1384,27 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] -name = "clap" -version = "4.5.1" +name = "clang-sys" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ - "clap_builder", + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "4.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +dependencies = [ + "clap_builder", "clap_derive", ] @@ -1097,7 +1429,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1106,6 +1438,38 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +[[package]] +name = "cloud-storage" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7602ac4363f68ac757d6b87dd5d850549a14d37489902ae639c06ecec06ad275" +dependencies = [ + "async-trait", + "base64 0.13.1", + "bytes", + "chrono", + "dotenv", + "futures-util", + "hex", + "jsonwebtoken", + "lazy_static", + "openssl", + "percent-encoding", + "reqwest", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "colorchoice" version = "1.0.0" @@ -1145,12 +1509,31 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode 0.3.6", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + [[package]] name = "const-oid" version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "convert_case" version = "0.4.0" @@ -1184,6 +1567,15 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "cpp_demangle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eeaa953eaad386a53111e47172c2fedba671e5684c8dd601a5f474f4f118710f" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "cpufeatures" version = "0.2.12" @@ -1193,13 +1585,137 @@ dependencies = [ "libc", ] +[[package]] +name = "cranelift-bforest" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b5bb9245ec7dcc04d03110e538d31f0969d301c9d673145f4b4d5c3478539a3" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebb18d10e5ddac43ba4ca8fd4e310938569c3e484cc01b6372b27dc5bb4dfd28" +dependencies = [ + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli", + "hashbrown 0.14.3", + "log", + "regalloc2", + "smallvec", + "target-lexicon 0.12.14", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a3ce6d22982c1b9b6b012654258bab1a13947bb12703518bef06b1a4867c3d6" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47220fd4f9a0ce23541652b6f16f83868d282602c600d14934b2a4c166b4bd80" + +[[package]] +name = "cranelift-control" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5a4c42672aea9b6e820046b52e47a1c05d3394a6cdf4cb3c3c4b702f954bd2" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b4e9a3296fc827f9d35135dc2c0c8dd8d8359eb1ef904bae2d55d5bcb0c9f94" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-frontend" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ec537d0f0b8e084517f3e7bfa1d89af343d7c7df455573fca9f272d4e01267" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon 0.12.14", +] + +[[package]] +name = "cranelift-isle" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bab6d69919d210a50331d35cc6ce111567bc040aebac63a8ae130d0400a075" + +[[package]] +name = "cranelift-native" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f32e81605f352cf37af5463f11cd7deec7b6572741931a8d372f7fdd4a744f5d" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon 0.12.14", +] + +[[package]] +name = "cranelift-wasm" +version = "0.101.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0edaa4cbec1bc787395c074233df2652dd62f3e29d3ee60329514a0a51e6b045" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools 0.10.5", + "log", + "smallvec", + "wasmparser 0.115.0", + "wasmtime-types", +] + +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32c" version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89254598aa9b9fa608de44b3ae54c810f0f06d755e24c50177f1f8f31ff50ce2" dependencies = [ - "rustc_version", + "rustc_version 0.4.0", ] [[package]] @@ -1208,14 +1724,27 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", ] [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils", ] @@ -1239,6 +1768,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.19" @@ -1257,7 +1795,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ - "generic-array", + "generic-array 0.14.7", "rand_core 0.6.4", "subtle", "zeroize", @@ -1279,7 +1817,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array", + "generic-array 0.14.7", "typenum", ] @@ -1289,7 +1827,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array", + "generic-array 0.14.7", "subtle", ] @@ -1350,14 +1888,14 @@ version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", "platforms", "rand_core 0.6.4", - "rustc_version", + "rustc_version 0.4.0", "subtle", "zeroize", ] @@ -1370,7 +1908,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1385,12 +1923,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955" +checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ - "darling_core 0.20.6", - "darling_macro 0.20.6", + "darling_core 0.20.8", + "darling_macro 0.20.8", ] [[package]] @@ -1409,16 +1947,16 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855" +checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim 0.10.0", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1434,13 +1972,13 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.6" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be" +checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ - "darling_core 0.20.6", + "darling_core 0.20.8", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1449,11 +1987,11 @@ version = "5.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "hashbrown 0.14.3", - "lock_api", + "lock_api 0.4.11", "once_cell", - "parking_lot_core", + "parking_lot_core 0.9.9", ] [[package]] @@ -1463,7 +2001,7 @@ dependencies = [ "anyhow", "async-trait", "bigdecimal", - "borsh", + "borsh 1.3.1", "bytes", "configuration", "diesel", @@ -1471,10 +2009,10 @@ dependencies = [ "diesel_migrations", "futures", "hex", - "near-chain-configs", - "near-crypto", + "near-chain-configs 0.0.0", + "near-crypto 0.0.0", "near-indexer-primitives", - "near-primitives", + "near-primitives 0.0.0", "num-bigint 0.4.4", "num-traits", "prettytable-rs", @@ -1507,6 +2045,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63dfa964fe2a66f3fde91fc70b267fe193d822c7e603e2a675a49a7f46ad3f49" +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "uuid", +] + [[package]] name = "der" version = "0.6.1" @@ -1535,7 +2082,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1578,7 +2125,7 @@ dependencies = [ "convert_case", "proc-macro2", "quote", - "rustc_version", + "rustc_version 0.4.0", "syn 1.0.109", ] @@ -1624,7 +2171,7 @@ dependencies = [ "diesel_table_macro_syntax", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -1644,7 +2191,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc5557efc453706fed5e4fa85006fe9817c224c3f480a34c7e5959fd700921c5" dependencies = [ - "syn 2.0.49", + "syn 2.0.52", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", ] [[package]] @@ -1653,7 +2209,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array", + "generic-array 0.14.7", ] [[package]] @@ -1667,16 +2223,36 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + [[package]] name = "dirs-next" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dirs-sys-next" version = "0.1.2" @@ -1688,12 +2264,77 @@ dependencies = [ "winapi", ] +[[package]] +name = "dissimilar" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86e3bdc80eee6e16b2b6b0f87fbc98c04bee3455e35174c0de1a125d0688c632" + +[[package]] +name = "dlv-list" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0688c2a7f92e427f44895cd63841bff7b29f8d7a1648b9e7e07a4a365b2e1257" + [[package]] name = "dotenv" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +[[package]] +name = "dynasm" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add9a102807b524ec050363f09e06f1504214b0e1c7797f64261c891022dce8b" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "lazy_static", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dynasm" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33dc03612f42465a8ed7f5e354bc2b79ba54cedefa81d5bd3a064f1835adaba8" +dependencies = [ + "bitflags 1.3.2", + "byteorder", + "lazy_static", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "dynasmrt" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64fba5a42bd76a17cad4bfa00de168ee1cbfa06a5e8ce992ae880218c05641a9" +dependencies = [ + "byteorder", + "dynasm 1.2.3", + "memmap2", +] + +[[package]] +name = "dynasmrt" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7dccc31a678058996aef614f6bd418ced384da70f284e83e2b7bf29b27b6a28" +dependencies = [ + "byteorder", + "dynasm 2.0.0", + "fnv", + "memmap2", +] + [[package]] name = "easy-ext" version = "0.2.9" @@ -1740,6 +2381,15 @@ version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +[[package]] +name = "elastic-array" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d63720ea2bc2e1b79f7aa044d9dc0b825f9ccb6930b32120f8fb9e873aa84bc" +dependencies = [ + "heapsize", +] + [[package]] name = "elliptic-curve" version = "0.12.3" @@ -1751,7 +2401,7 @@ dependencies = [ "der", "digest 0.10.7", "ff", - "generic-array", + "generic-array 0.14.7", "group", "pkcs8", "rand_core 0.6.4", @@ -1760,6 +2410,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "encode_unicode" version = "1.0.0" @@ -1772,7 +2428,7 @@ version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -1792,7 +2448,28 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", +] + +[[package]] +name = "enumset" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" +dependencies = [ + "enumset_derive", +] + +[[package]] +name = "enumset_derive" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" +dependencies = [ + "darling 0.20.8", + "proc-macro2", + "quote", + "syn 2.0.52", ] [[package]] @@ -1803,9 +2480,9 @@ dependencies = [ "clap", "configuration", "database", - "near-chain-configs", + "near-chain-configs 0.0.0", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1)", "near-lake-framework", "readnode-primitives", "tokio", @@ -1827,6 +2504,17 @@ dependencies = [ "serde", ] +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + [[package]] name = "errno" version = "0.3.8" @@ -1838,11 +2526,21 @@ dependencies = [ ] [[package]] -name = "event-listener" -version = "2.5.3" +name = "errno-dragonfly" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" + [[package]] name = "extensions" version = "0.2.0" @@ -1858,6 +2556,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" version = "1.9.0" @@ -1889,6 +2593,22 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1676f435fc1dadde4d03e43f5d62b259e1ce5f40bd4ffb21db2b42ebe59c1382" +[[package]] +name = "finite-wasm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d81b511929c2669eaf64e36471cf27c2508133e62ade9d49e608e8d675e7854" +dependencies = [ + "bitvec", + "dissimilar", + "num-traits", + "prefix-sum-vec", + "thiserror", + "wasm-encoder 0.27.0", + "wasmparser 0.105.0", + "wasmprinter", +] + [[package]] name = "finl_unicode" version = "1.2.0" @@ -1960,6 +2680,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + [[package]] name = "futures" version = "0.3.30" @@ -2042,7 +2768,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -2084,6 +2810,28 @@ dependencies = [ "byteorder", ] +[[package]] +name = "fxprof-processed-profile" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" +dependencies = [ + "bitflags 2.4.2", + "debugid", + "fxhash", + "serde", + "serde_json", +] + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -2100,7 +2848,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -2111,7 +2859,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -2121,6 +2869,17 @@ name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator 0.3.0", + "indexmap 2.2.5", + "stable_deref_trait", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "group" @@ -2144,19 +2903,40 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http 0.2.11", - "indexmap 2.2.3", + "http 0.2.12", + "indexmap 2.2.5", "slab", "tokio", "tokio-util 0.7.10", "tracing", ] +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.8", +] + [[package]] name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.8", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.11", +] [[package]] name = "hashbrown" @@ -2164,10 +2944,19 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ - "ahash", + "ahash 0.8.11", "allocator-api2", ] +[[package]] +name = "heapsize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1679e6ea370dee694f91f1dc469bf94cf8f52051d147aec3e1f9497c6fc22461" +dependencies = [ + "winapi", +] + [[package]] name = "heck" version = "0.3.3" @@ -2185,9 +2974,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -2224,9 +3013,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -2235,9 +3024,9 @@ dependencies = [ [[package]] name = "http" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -2251,7 +3040,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http 0.2.11", + "http 0.2.12", "pin-project-lite", ] @@ -2284,7 +3073,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.11", + "http 0.2.12", "http-body", "httparse", "httpdate", @@ -2304,7 +3093,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http 0.2.11", + "http 0.2.12", "hyper", "log", "rustls", @@ -2377,6 +3166,26 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "im" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" +dependencies = [ + "bitmaps", + "rand_core 0.6.4", + "rand_xoshiro", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "impl-more" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d" + [[package]] name = "indexmap" version = "1.9.3" @@ -2390,22 +3199,35 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown 0.14.3", "serde", ] +[[package]] +name = "indicatif" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7baab56125e25686df467fe470785512329883aab42696d661247aca2a2896e4" +dependencies = [ + "console", + "lazy_static", + "number_prefix", + "rayon", + "regex", +] + [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -2444,7 +3266,7 @@ dependencies = [ "curl-sys", "event-listener", "futures-lite", - "http 0.2.11", + "http 0.2.12", "log", "once_cell", "polling", @@ -2491,9 +3313,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -2520,6 +3342,20 @@ dependencies = [ "serde_json", ] +[[package]] +name = "jsonwebtoken" +version = "7.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afabcc15e437a6484fc4f12d0fd63068fe457bf93f1c148d3d9649c60b103f32" +dependencies = [ + "base64 0.12.3", + "pem", + "ring 0.16.20", + "serde", + "serde_json", + "simple_asn1", +] + [[package]] name = "keccak" version = "0.1.5" @@ -2544,12 +3380,34 @@ dependencies = [ "spin 0.5.2", ] +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + [[package]] name = "libc" version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +[[package]] +name = "libloading" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +dependencies = [ + "cfg-if 1.0.0", + "windows-targets 0.52.4", +] + [[package]] name = "libm" version = "0.2.8" @@ -2564,7 +3422,24 @@ checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ "bitflags 2.4.2", "libc", - "redox_syscall", + "redox_syscall 0.4.1", +] + +[[package]] +name = "librocksdb-sys" +version = "0.11.0+8.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3386f101bcb4bd252d8e9d2fb41ec3b0862a15a62b478c355b2982efa469e3e" +dependencies = [ + "bindgen", + "bzip2-sys", + "cc", + "glob", + "libc", + "libz-sys", + "lz4-sys", + "tikv-jemalloc-sys", + "zstd-sys", ] [[package]] @@ -2602,6 +3477,15 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d873d7c67ce09b42110d801813efbc9364414e356be9935700d368351657487" +[[package]] +name = "lock_api" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +dependencies = [ + "scopeguard", +] + [[package]] name = "lock_api" version = "0.4.11" @@ -2614,19 +3498,38 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" + +[[package]] +name = "lru" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "e999beba7b6e8345721bd280141ed958096a2e4abdf74f67ff4ce49b4b54e47a" +dependencies = [ + "hashbrown 0.12.3", +] [[package]] name = "lru" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2c024b41519440580066ba82aab04092b333e09066a5eb86c7c4890df31f22" +checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" dependencies = [ "hashbrown 0.14.3", ] +[[package]] +name = "lz4-sys" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "lz4_flex" version = "0.11.2" @@ -2636,6 +3539,26 @@ dependencies = [ "twox-hash", ] +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "mach" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +dependencies = [ + "libc", +] + [[package]] name = "matchers" version = "0.1.0" @@ -2645,22 +3568,76 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "maybe-async" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "md-5" version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "digest 0.10.7", ] +[[package]] +name = "md5" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" + [[package]] name = "memchr" version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix", +] + +[[package]] +name = "memmap" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.8.0" @@ -2670,6 +3647,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "migrations_internals" version = "2.1.0" @@ -2697,6 +3683,31 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + +[[package]] +name = "minidom" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f45614075738ce1b77a1768912a60c0227525971b03e09122a05b8a34a2a6278" +dependencies = [ + "rxml", +] + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.7.2" @@ -2708,9 +3719,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -2718,6 +3729,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "more-asserts" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7843ec2de400bcbc6a6328c958dc38e5359da6e93e72e37bc5246bf1ae776389" + [[package]] name = "multimap" version = "0.8.3" @@ -2754,31 +3771,282 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35cbb989542587b47205e608324ddd391f0cee1c22b4b64ae49f458334b95907" dependencies = [ - "borsh", + "borsh 1.3.1", "serde", ] [[package]] -name = "near-chain-configs" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e5a8ace81c09d7eb165dffc1742358a021b2fa761f2160943305f83216003" +name = "near-async" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" dependencies = [ - "anyhow", - "bytesize", - "chrono", + "actix", "derive_more", - "near-config-utils", - "near-crypto", - "near-parameters", - "near-primitives", - "num-rational", + "futures", + "near-async-derive", + "near-o11y 0.0.0", + "near-performance-metrics", "once_cell", "serde", "serde_json", - "sha2", - "smart-default", - "tracing", + "time", + "tokio", +] + +[[package]] +name = "near-async-derive" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + +[[package]] +name = "near-cache" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "lru 0.7.8", +] + +[[package]] +name = "near-chain" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "assert_matches", + "borsh 1.3.1", + "bytesize", + "chrono", + "crossbeam-channel", + "easy-ext", + "enum-map", + "itertools 0.10.5", + "itoa", + "lru 0.7.8", + "near-async", + "near-cache", + "near-chain-configs 0.0.0", + "near-chain-primitives", + "near-client-primitives", + "near-crypto 0.0.0", + "near-epoch-manager", + "near-mainnet-res", + "near-network", + "near-o11y 0.0.0", + "near-parameters 0.0.0", + "near-performance-metrics", + "near-performance-metrics-macros", + "near-pool", + "near-primitives 0.0.0", + "near-store", + "near-vm-runner 0.0.0", + "node-runtime", + "num-rational", + "once_cell", + "rand 0.8.5", + "rand_chacha 0.3.1", + "rayon", + "strum 0.24.1", + "tempfile", + "thiserror", + "tracing", + "yansi", +] + +[[package]] +name = "near-chain-configs" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "anyhow", + "bytesize", + "chrono", + "derive_more", + "near-async", + "near-config-utils 0.0.0", + "near-crypto 0.0.0", + "near-o11y 0.0.0", + "near-parameters 0.0.0", + "near-primitives 0.0.0", + "num-rational", + "once_cell", + "serde", + "serde_json", + "sha2", + "smart-default", + "time", + "tracing", +] + +[[package]] +name = "near-chain-configs" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e5a8ace81c09d7eb165dffc1742358a021b2fa761f2160943305f83216003" +dependencies = [ + "anyhow", + "bytesize", + "chrono", + "derive_more", + "near-config-utils 0.20.1", + "near-crypto 0.20.1", + "near-parameters 0.20.1", + "near-primitives 0.20.1", + "num-rational", + "once_cell", + "serde", + "serde_json", + "sha2", + "smart-default", + "tracing", +] + +[[package]] +name = "near-chain-primitives" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "near-async", + "near-crypto 0.0.0", + "near-primitives 0.0.0", + "thiserror", + "time", + "tracing", +] + +[[package]] +name = "near-chunks" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "borsh 1.3.1", + "chrono", + "derive_more", + "futures", + "itertools 0.10.5", + "lru 0.7.8", + "near-async", + "near-chain", + "near-chain-configs 0.0.0", + "near-chunks-primitives", + "near-crypto 0.0.0", + "near-epoch-manager", + "near-network", + "near-o11y 0.0.0", + "near-performance-metrics", + "near-performance-metrics-macros", + "near-pool", + "near-primitives 0.0.0", + "near-store", + "once_cell", + "rand 0.8.5", + "reed-solomon-erasure", + "strum 0.24.1", + "time", + "tracing", +] + +[[package]] +name = "near-chunks-primitives" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "near-chain-primitives", + "near-primitives 0.0.0", +] + +[[package]] +name = "near-client" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "actix-rt", + "anyhow", + "async-trait", + "borsh 1.3.1", + "bytesize", + "chrono", + "cloud-storage", + "derive_more", + "futures", + "itertools 0.10.5", + "lru 0.7.8", + "near-async", + "near-cache", + "near-chain", + "near-chain-configs 0.0.0", + "near-chain-primitives", + "near-chunks", + "near-client-primitives", + "near-crypto 0.0.0", + "near-dyn-configs", + "near-epoch-manager", + "near-network", + "near-o11y 0.0.0", + "near-parameters 0.0.0", + "near-performance-metrics", + "near-performance-metrics-macros", + "near-pool", + "near-primitives 0.0.0", + "near-store", + "near-telemetry", + "num-rational", + "once_cell", + "percent-encoding", + "rand 0.8.5", + "rayon", + "reed-solomon-erasure", + "regex", + "reqwest", + "rust-s3", + "serde", + "serde_json", + "strum 0.24.1", + "sysinfo 0.24.7", + "tempfile", + "thiserror", + "tokio", + "tracing", + "yansi", +] + +[[package]] +name = "near-client-primitives" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "chrono", + "near-async", + "near-chain-configs 0.0.0", + "near-chain-primitives", + "near-chunks-primitives", + "near-crypto 0.0.0", + "near-primitives 0.0.0", + "serde", + "serde_json", + "strum 0.24.1", + "thiserror", + "time", + "tracing", + "yansi", +] + +[[package]] +name = "near-config-utils" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "anyhow", + "json_comments", + "thiserror", + "tracing", ] [[package]] @@ -2793,6 +4061,30 @@ dependencies = [ "tracing", ] +[[package]] +name = "near-crypto" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "blake2", + "borsh 1.3.1", + "bs58", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "hex", + "near-account-id", + "near-config-utils 0.0.0", + "near-stdx 0.0.0", + "once_cell", + "primitive-types", + "secp256k1", + "serde", + "serde_json", + "subtle", + "thiserror", +] + [[package]] name = "near-crypto" version = "0.20.1" @@ -2800,7 +4092,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2991d2912218a80ec0733ac87f84fa803accea105611eea209d4419271957667" dependencies = [ "blake2", - "borsh", + "borsh 1.3.1", "bs58", "c2-chacha", "curve25519-dalek", @@ -2808,8 +4100,8 @@ dependencies = [ "ed25519-dalek", "hex", "near-account-id", - "near-config-utils", - "near-stdx", + "near-config-utils 0.20.1", + "near-stdx 0.20.1", "once_cell", "primitive-types", "rand 0.7.3", @@ -2820,22 +4112,145 @@ dependencies = [ "thiserror", ] +[[package]] +name = "near-dyn-configs" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "anyhow", + "near-async", + "near-chain-configs 0.0.0", + "near-o11y 0.0.0", + "near-primitives 0.0.0", + "once_cell", + "prometheus", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "near-epoch-manager" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "borsh 1.3.1", + "itertools 0.10.5", + "near-cache", + "near-chain-configs 0.0.0", + "near-chain-primitives", + "near-crypto 0.0.0", + "near-o11y 0.0.0", + "near-primitives 0.0.0", + "near-store", + "num-rational", + "primitive-types", + "rand 0.8.5", + "rand_hc 0.3.2", + "serde_json", + "smart-default", + "tracing", +] + +[[package]] +name = "near-fmt" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "near-primitives-core 0.0.0", +] + [[package]] name = "near-fmt" version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7d998dfc1e04001608899b2498ad5a782c7d036b73769d510de21964db99286" dependencies = [ - "near-primitives-core", + "near-primitives-core 0.20.1", +] + +[[package]] +name = "near-indexer" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "anyhow", + "async-recursion", + "futures", + "near-chain-configs 0.0.0", + "near-client", + "near-crypto 0.0.0", + "near-dyn-configs", + "near-indexer-primitives", + "near-o11y 0.0.0", + "near-parameters 0.0.0", + "near-primitives 0.0.0", + "near-store", + "nearcore", + "node-runtime", + "once_cell", + "rocksdb", + "serde", + "serde_json", + "tokio", + "tracing", ] [[package]] name = "near-indexer-primitives" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "362042db6d020aba9ac03dadf32088f848cc2156c9a7976d45a2a9cf6b18548e" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "near-primitives 0.0.0", + "serde", + "serde_json", +] + +[[package]] +name = "near-jsonrpc" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "actix-cors 0.6.5", + "actix-web", + "bs58", + "derive_more", + "easy-ext", + "futures", + "hex", + "near-async", + "near-chain-configs 0.0.0", + "near-client", + "near-client-primitives", + "near-jsonrpc-client 0.0.0", + "near-jsonrpc-primitives 0.0.0", + "near-network", + "near-o11y 0.0.0", + "near-primitives 0.0.0", + "near-rpc-error-macro 0.0.0", + "once_cell", + "serde", + "serde_json", + "serde_with", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "near-jsonrpc-client" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" dependencies = [ - "near-primitives", + "actix-http", + "awc", + "futures", + "near-jsonrpc-primitives 0.0.0", + "near-primitives 0.0.0", "serde", "serde_json", ] @@ -2846,13 +4261,13 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18ad81e015f7aced8925d5b9ba3f369b36da9575c15812cfd0786bc1213284ca" dependencies = [ - "borsh", + "borsh 1.3.1", "lazy_static", "log", - "near-chain-configs", - "near-crypto", - "near-jsonrpc-primitives", - "near-primitives", + "near-chain-configs 0.20.1", + "near-crypto 0.20.1", + "near-jsonrpc-primitives 0.20.1", + "near-primitives 0.20.1", "reqwest", "serde", "serde_json", @@ -2862,21 +4277,38 @@ dependencies = [ [[package]] name = "near-jsonrpc-client" version = "0.8.0" -source = "git+https://github.com/near/near-jsonrpc-client-rs.git?branch=telezhnaya/wait_until#a4f27a4a6155b5572876dd46950ec8d3a680f12e" +source = "git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1#f6c6c41b48c764508365a8de717fda4364ed539c" dependencies = [ - "borsh", + "borsh 1.3.1", "lazy_static", "log", - "near-chain-configs", - "near-crypto", - "near-jsonrpc-primitives", - "near-primitives", + "near-chain-configs 0.0.0", + "near-crypto 0.0.0", + "near-jsonrpc-primitives 0.0.0", + "near-primitives 0.0.0", "reqwest", "serde", "serde_json", "thiserror", ] +[[package]] +name = "near-jsonrpc-primitives" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "arbitrary", + "near-chain-configs 0.0.0", + "near-client-primitives", + "near-crypto 0.0.0", + "near-primitives 0.0.0", + "near-rpc-error-macro 0.0.0", + "serde", + "serde_json", + "thiserror", + "time", +] + [[package]] name = "near-jsonrpc-primitives" version = "0.20.1" @@ -2884,10 +4316,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0ce745e954ae776eef05957602e638ee9581106a3675946fb43c2fe7e38ef03" dependencies = [ "arbitrary", - "near-chain-configs", - "near-crypto", - "near-primitives", - "near-rpc-error-macro", + "near-chain-configs 0.20.1", + "near-crypto 0.20.1", + "near-primitives 0.20.1", + "near-rpc-error-macro 0.20.1", "serde", "serde_json", "thiserror", @@ -2895,9 +4327,8 @@ dependencies = [ [[package]] name = "near-lake-framework" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e58822a397bad3a8d189aad5aa2366c1109090fb7bab04289c78ab1f31c7ba4c" +version = "0.0.0" +source = "git+https://github.com/kobayurii/near-lake-framework-rs.git?branch=0.7.8#433197168b2bcd73b83e053e26fd367008c6721b" dependencies = [ "anyhow", "async-stream", @@ -2919,18 +4350,103 @@ dependencies = [ ] [[package]] -name = "near-o11y" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20762631bc8253030013bbae9b5f0542691edc1aa6722f1e8141cc9b928ae5b" +name = "near-mainnet-res" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "near-account-id", + "near-chain-configs 0.0.0", + "near-primitives 0.0.0", + "serde_json", +] + +[[package]] +name = "near-network" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" dependencies = [ "actix", - "base64 0.21.7", - "clap", - "near-crypto", - "near-fmt", - "near-primitives-core", - "once_cell", + "anyhow", + "arc-swap", + "async-trait", + "borsh 1.3.1", + "bytes", + "bytesize", + "chrono", + "crossbeam-channel", + "derive_more", + "futures", + "futures-util", + "im", + "itertools 0.10.5", + "lru 0.7.8", + "near-async", + "near-crypto 0.0.0", + "near-fmt 0.0.0", + "near-o11y 0.0.0", + "near-performance-metrics", + "near-performance-metrics-macros", + "near-primitives 0.0.0", + "near-store", + "once_cell", + "opentelemetry 0.17.0", + "parking_lot 0.12.1", + "pin-project", + "protobuf 3.4.0", + "protobuf-codegen", + "rand 0.8.5", + "rayon", + "serde", + "sha2", + "smart-default", + "strum 0.24.1", + "stun", + "thiserror", + "time", + "tokio", + "tokio-stream", + "tokio-util 0.7.10", + "tracing", +] + +[[package]] +name = "near-o11y" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "base64 0.21.7", + "clap", + "near-crypto 0.0.0", + "near-primitives-core 0.0.0", + "once_cell", + "opentelemetry 0.17.0", + "opentelemetry-otlp", + "opentelemetry-semantic-conventions 0.9.0", + "prometheus", + "serde", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-opentelemetry 0.17.4", + "tracing-subscriber", +] + +[[package]] +name = "near-o11y" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d20762631bc8253030013bbae9b5f0542691edc1aa6722f1e8141cc9b928ae5b" +dependencies = [ + "actix", + "base64 0.21.7", + "clap", + "near-crypto 0.20.1", + "near-fmt 0.20.1", + "near-primitives-core 0.20.1", + "once_cell", "opentelemetry 0.17.0", "opentelemetry-otlp", "opentelemetry-semantic-conventions 0.9.0", @@ -2946,6 +4462,23 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "near-parameters" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "borsh 1.3.1", + "enum-map", + "near-account-id", + "near-primitives-core 0.0.0", + "num-rational", + "serde", + "serde_repr", + "serde_yaml", + "strum 0.24.1", + "thiserror", +] + [[package]] name = "near-parameters" version = "0.20.1" @@ -2953,10 +4486,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9f16a59b6c3e69b0585be951af6fe42a0ba86c0e207cb8c63badd19efd16680" dependencies = [ "assert_matches", - "borsh", + "borsh 1.3.1", "enum-map", "near-account-id", - "near-primitives-core", + "near-primitives-core 0.20.1", "num-rational", "serde", "serde_repr", @@ -2965,6 +4498,85 @@ dependencies = [ "thiserror", ] +[[package]] +name = "near-performance-metrics" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "bitflags 1.3.2", + "bytes", + "futures", + "libc", + "once_cell", + "tokio", + "tokio-util 0.7.10", + "tracing", +] + +[[package]] +name = "near-performance-metrics-macros" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "quote", + "syn 2.0.52", +] + +[[package]] +name = "near-pool" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "borsh 1.3.1", + "near-crypto 0.0.0", + "near-o11y 0.0.0", + "near-primitives 0.0.0", + "once_cell", + "rand 0.8.5", +] + +[[package]] +name = "near-primitives" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "arbitrary", + "base64 0.21.7", + "borsh 1.3.1", + "bytesize", + "cfg-if 1.0.0", + "chrono", + "derive_more", + "easy-ext", + "enum-map", + "hex", + "itertools 0.10.5", + "near-async", + "near-crypto 0.0.0", + "near-fmt 0.0.0", + "near-parameters 0.0.0", + "near-primitives-core 0.0.0", + "near-rpc-error-macro 0.0.0", + "near-stdx 0.0.0", + "near-vm-runner 0.0.0", + "num-rational", + "once_cell", + "primitive-types", + "rand 0.8.5", + "rand_chacha 0.3.1", + "reed-solomon-erasure", + "serde", + "serde_json", + "serde_with", + "serde_yaml", + "sha3", + "smart-default", + "strum 0.24.1", + "thiserror", + "tracing", +] + [[package]] name = "near-primitives" version = "0.20.1" @@ -2973,22 +4585,22 @@ checksum = "0462b067732132babcc89d5577db3bfcb0a1bcfbaaed3f2db4c11cd033666314" dependencies = [ "arbitrary", "base64 0.21.7", - "borsh", + "borsh 1.3.1", "bytesize", - "cfg-if", + "cfg-if 1.0.0", "chrono", "derive_more", "easy-ext", "enum-map", "hex", - "near-crypto", - "near-fmt", - "near-o11y", - "near-parameters", - "near-primitives-core", - "near-rpc-error-macro", - "near-stdx", - "near-vm-runner", + "near-crypto 0.20.1", + "near-fmt 0.20.1", + "near-o11y 0.20.1", + "near-parameters 0.20.1", + "near-primitives-core 0.20.1", + "near-rpc-error-macro 0.20.1", + "near-stdx 0.20.1", + "near-vm-runner 0.20.1", "num-rational", "once_cell", "primitive-types", @@ -3007,6 +4619,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "near-primitives-core" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "arbitrary", + "base64 0.21.7", + "borsh 1.3.1", + "bs58", + "derive_more", + "enum-map", + "near-account-id", + "num-rational", + "serde", + "serde_repr", + "sha2", + "thiserror", +] + [[package]] name = "near-primitives-core" version = "0.20.1" @@ -3015,7 +4646,7 @@ checksum = "8443eb718606f572c438be6321a097a8ebd69f8e48d953885b4f16601af88225" dependencies = [ "arbitrary", "base64 0.21.7", - "borsh", + "borsh 1.3.1", "bs58", "derive_more", "enum-map", @@ -3029,6 +4660,47 @@ dependencies = [ "thiserror", ] +[[package]] +name = "near-rosetta-rpc" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "actix-cors 0.6.5", + "actix-http", + "actix-web", + "awc", + "derive_more", + "futures", + "hex", + "near-account-id", + "near-chain-configs 0.0.0", + "near-client", + "near-client-primitives", + "near-crypto 0.0.0", + "near-network", + "near-o11y 0.0.0", + "near-parameters 0.0.0", + "near-primitives 0.0.0", + "node-runtime", + "paperclip", + "serde", + "serde_json", + "strum 0.24.1", + "thiserror", + "tokio", +] + +[[package]] +name = "near-rpc-error-core" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "quote", + "serde", + "syn 2.0.52", +] + [[package]] name = "near-rpc-error-core" version = "0.20.1" @@ -3037,7 +4709,17 @@ checksum = "80fca203c51edd9595ec14db1d13359fb9ede32314990bf296b6c5c4502f6ab7" dependencies = [ "quote", "serde", - "syn 2.0.49", + "syn 2.0.52", +] + +[[package]] +name = "near-rpc-error-macro" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "near-rpc-error-core 0.0.0", + "serde", + "syn 2.0.52", ] [[package]] @@ -3047,17 +4729,218 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897a445de2102f6732c8a185d922f5e3bf7fd0a41243ce40854df2197237f799" dependencies = [ "fs2", - "near-rpc-error-core", + "near-rpc-error-core 0.20.1", "serde", - "syn 2.0.49", + "syn 2.0.52", +] + +[[package]] +name = "near-state-indexer" +version = "0.1.0" +dependencies = [ + "actix", + "actix-web", + "anyhow", + "borsh 1.3.1", + "clap", + "configuration", + "database", + "futures", + "hex", + "humantime", + "lazy_static", + "near-client", + "near-indexer", + "near-o11y 0.0.0", + "openssl-probe", + "prometheus", + "tokio", + "tokio-stream", + "tracing", ] +[[package]] +name = "near-stdx" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" + [[package]] name = "near-stdx" version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "855fd5540e3b4ff6fedf12aba2db1ee4b371b36f465da1363a6d022b27cb43b8" +[[package]] +name = "near-store" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "actix-rt", + "anyhow", + "borsh 1.3.1", + "bytesize", + "crossbeam", + "derive_more", + "elastic-array", + "enum-map", + "hex", + "itertools 0.10.5", + "itoa", + "lru 0.7.8", + "near-async", + "near-chain-configs 0.0.0", + "near-crypto 0.0.0", + "near-fmt 0.0.0", + "near-o11y 0.0.0", + "near-parameters 0.0.0", + "near-primitives 0.0.0", + "near-stdx 0.0.0", + "near-vm-runner 0.0.0", + "num_cpus", + "once_cell", + "rand 0.8.5", + "rayon", + "rlimit", + "rocksdb", + "serde", + "serde_json", + "strum 0.24.1", + "tempfile", + "thiserror", + "tokio", + "tracing", +] + +[[package]] +name = "near-telemetry" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "awc", + "futures", + "near-async", + "near-o11y 0.0.0", + "near-performance-metrics", + "near-performance-metrics-macros", + "once_cell", + "openssl", + "serde", + "serde_json", + "tracing", +] + +[[package]] +name = "near-vm-compiler" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "enumset", + "finite-wasm", + "near-vm-types", + "near-vm-vm", + "rkyv", + "target-lexicon 0.12.14", + "thiserror", + "tracing", + "wasmparser 0.99.0", +] + +[[package]] +name = "near-vm-compiler-singlepass" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "dynasm 2.0.0", + "dynasmrt 2.0.0", + "enumset", + "finite-wasm", + "lazy_static", + "memoffset 0.8.0", + "more-asserts", + "near-vm-compiler", + "near-vm-types", + "near-vm-vm", + "rayon", + "smallvec", + "strum 0.24.1", + "tracing", +] + +[[package]] +name = "near-vm-engine" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "backtrace", + "cfg-if 1.0.0", + "crossbeam-queue", + "enumset", + "finite-wasm", + "lazy_static", + "more-asserts", + "near-vm-compiler", + "near-vm-types", + "near-vm-vm", + "region", + "rkyv", + "rustc-demangle", + "rustix", + "target-lexicon 0.12.14", + "thiserror", + "tracing", +] + +[[package]] +name = "near-vm-runner" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "anyhow", + "base64 0.21.7", + "borsh 1.3.1", + "ed25519-dalek", + "enum-map", + "finite-wasm", + "memoffset 0.8.0", + "near-crypto 0.0.0", + "near-parameters 0.0.0", + "near-primitives-core 0.0.0", + "near-stdx 0.0.0", + "near-vm-compiler", + "near-vm-compiler-singlepass", + "near-vm-engine", + "near-vm-types", + "near-vm-vm", + "num-rational", + "once_cell", + "parity-wasm 0.41.0", + "parity-wasm 0.42.2", + "prefix-sum-vec", + "pwasm-utils", + "ripemd", + "serde", + "serde_repr", + "sha2", + "sha3", + "strum 0.24.1", + "thiserror", + "tracing", + "wasm-encoder 0.27.0", + "wasmer-compiler-near", + "wasmer-compiler-singlepass-near", + "wasmer-engine-near", + "wasmer-engine-universal-near", + "wasmer-runtime-core-near", + "wasmer-runtime-near", + "wasmer-types-near", + "wasmer-vm-near", + "wasmparser 0.78.2", + "wasmtime", + "zeropool-bn", +] + [[package]] name = "near-vm-runner" version = "0.20.1" @@ -3065,27 +4948,205 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c56c80bdb1954808f59bd36a9112377197b38d424991383bf05f52d0fe2e0da5" dependencies = [ "base64 0.21.7", - "borsh", + "borsh 1.3.1", "ed25519-dalek", "enum-map", - "memoffset", - "near-crypto", - "near-parameters", - "near-primitives-core", - "near-stdx", + "memoffset 0.8.0", + "near-crypto 0.20.1", + "near-parameters 0.20.1", + "near-primitives-core 0.20.1", + "near-stdx 0.20.1", "num-rational", "once_cell", "prefix-sum-vec", "ripemd", "serde", - "serde_repr", - "serde_with", + "serde_repr", + "serde_with", + "sha2", + "sha3", + "strum 0.24.1", + "thiserror", + "tracing", + "zeropool-bn", +] + +[[package]] +name = "near-vm-types" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "indexmap 1.9.3", + "num-traits", + "rkyv", + "thiserror", +] + +[[package]] +name = "near-vm-vm" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "backtrace", + "cc", + "cfg-if 1.0.0", + "finite-wasm", + "indexmap 1.9.3", + "libc", + "memoffset 0.8.0", + "more-asserts", + "near-vm-types", + "region", + "rkyv", + "thiserror", + "tracing", + "winapi", +] + +[[package]] +name = "near-wallet-contract" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "anyhow", + "near-vm-runner 0.0.0", +] + +[[package]] +name = "nearcore" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "actix", + "actix-rt", + "actix-web", + "anyhow", + "awc", + "borsh 1.3.1", + "chrono", + "cloud-storage", + "dirs", + "easy-ext", + "futures", + "hex", + "hyper", + "hyper-tls", + "indicatif", + "near-async", + "near-chain", + "near-chain-configs 0.0.0", + "near-chunks", + "near-client", + "near-client-primitives", + "near-config-utils 0.0.0", + "near-crypto 0.0.0", + "near-dyn-configs", + "near-epoch-manager", + "near-jsonrpc", + "near-jsonrpc-primitives 0.0.0", + "near-mainnet-res", + "near-network", + "near-o11y 0.0.0", + "near-parameters 0.0.0", + "near-performance-metrics", + "near-pool", + "near-primitives 0.0.0", + "near-rosetta-rpc", + "near-store", + "near-telemetry", + "near-vm-runner 0.0.0", + "node-runtime", + "num-rational", + "once_cell", + "rand 0.8.5", + "rayon", + "regex", + "reqwest", + "rlimit", + "rust-s3", + "serde", + "serde_ignored", + "serde_json", + "smart-default", + "strum 0.24.1", + "tempfile", + "thiserror", + "tokio", + "tracing", + "xz2", +] + +[[package]] +name = "nix" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e0b4f3320ed72aaedb9a5ac838690a8047c7b275da22711fddff4f8a14229" +dependencies = [ + "bitflags 1.3.2", + "cc", + "cfg-if 0.1.10", + "libc", + "void", +] + +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if 1.0.0", + "libc", + "memoffset 0.6.5", +] + +[[package]] +name = "node-runtime" +version = "0.0.0" +source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +dependencies = [ + "borsh 1.3.1", + "hex", + "near-chain-configs 0.0.0", + "near-crypto 0.0.0", + "near-o11y 0.0.0", + "near-parameters 0.0.0", + "near-primitives 0.0.0", + "near-primitives-core 0.0.0", + "near-store", + "near-vm-runner 0.0.0", + "near-wallet-contract", + "num-bigint 0.3.3", + "num-rational", + "num-traits", + "once_cell", + "rand 0.8.5", + "rayon", + "serde", + "serde_json", "sha2", - "sha3", - "strum 0.24.1", "thiserror", "tracing", - "zeropool-bn", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "ntapi" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" +dependencies = [ + "winapi", ] [[package]] @@ -3107,6 +5168,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-bigint" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "090c7f9998ee0ff65aa5b723e4009f7b217707f1fb5ea551329cc4d6231fb304" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.3.3" @@ -3194,15 +5266,24 @@ dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] +[[package]] +name = "number_prefix" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17b02fc0ff9a9e4b35b3342880f48e896ebf69f2967921fe8646bf5b7125956a" + [[package]] name = "object" version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ + "crc32fast", + "hashbrown 0.14.3", + "indexmap 2.2.5", "memchr", ] @@ -3214,18 +5295,18 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.4.2", - "cfg-if", + "cfg-if 1.0.0", "foreign-types", "libc", "once_cell", @@ -3241,7 +5322,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -3250,14 +5331,24 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.2.3+3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cff92b6f71555b61bb9315f7c64da3ca43d87531622120fea0195fc761b4843" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] @@ -3301,7 +5392,7 @@ checksum = "a819b71d6530c4297b49b3cae2939ab3a8cc1b9f382826a1bc29dd0ca3864906" dependencies = [ "async-trait", "bytes", - "http 0.2.11", + "http 0.2.12", "isahc", "opentelemetry_api", ] @@ -3315,7 +5406,7 @@ dependencies = [ "async-trait", "futures", "futures-executor", - "http 0.2.11", + "http 0.2.12", "isahc", "once_cell", "opentelemetry 0.19.0", @@ -3335,7 +5426,7 @@ dependencies = [ "async-trait", "futures", "futures-util", - "http 0.2.11", + "http 0.2.12", "opentelemetry 0.17.0", "prost", "thiserror", @@ -3409,6 +5500,16 @@ dependencies = [ "num-traits", ] +[[package]] +name = "ordered-multimap" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccd746e37177e1711c20dd619a1620f34f5c8b569c53590a72dedd5344d8924a" +dependencies = [ + "dlv-list", + "hashbrown 0.12.3", +] + [[package]] name = "outref" version = "0.5.1" @@ -3432,20 +5533,139 @@ dependencies = [ "sha2", ] +[[package]] +name = "page_size" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eebde548fbbf1ea81a99b128872779c437752fb99f217c45245e1a61dcd9edcd" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "paperclip" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2509afd8f138efe07cd367832289f5cc61d1eb1ec7f1eb75172abca6f7b9b66d" +dependencies = [ + "anyhow", + "itertools 0.10.5", + "once_cell", + "paperclip-actix", + "paperclip-core", + "paperclip-macros", + "semver 1.0.22", + "serde", + "serde_derive", + "serde_json", + "serde_yaml", + "thiserror", + "url", +] + +[[package]] +name = "paperclip-actix" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4adf797da91baee514bc03b020fdd6673d2f8c1af8a859e50d6d803a4b3dddd2" +dependencies = [ + "actix-service", + "actix-web", + "futures", + "mime_guess", + "once_cell", + "paperclip-core", + "paperclip-macros", + "serde_json", +] + +[[package]] +name = "paperclip-core" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8db363c823fa71c00da73ff8cee3d6902e1ad66b770cc224a74dc7cf54de3aad" +dependencies = [ + "actix-web", + "mime", + "once_cell", + "paperclip-macros", + "pin-project-lite", + "regex", + "serde", + "serde_json", + "serde_yaml", + "thiserror", +] + +[[package]] +name = "paperclip-macros" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6e25ce2c5362c8d48dc89e0f9ca076d507f7c1eabd04f0d593cdf5addff90c" +dependencies = [ + "heck 0.4.1", + "http 0.2.12", + "lazy_static", + "mime", + "proc-macro-error", + "proc-macro2", + "quote", + "strum 0.24.1", + "strum_macros 0.24.3", + "syn 1.0.109", +] + +[[package]] +name = "parity-wasm" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc878dac00da22f8f61e7af3157988424567ab01d9920b962ef7dcbd7cd865" + +[[package]] +name = "parity-wasm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" + [[package]] name = "parking" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +[[package]] +name = "parking_lot" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +dependencies = [ + "lock_api 0.3.4", + "parking_lot_core 0.7.3", +] + [[package]] name = "parking_lot" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "lock_api", - "parking_lot_core", + "lock_api 0.4.11", + "parking_lot_core 0.9.9", +] + +[[package]] +name = "parking_lot_core" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93f386bb233083c799e6e642a9d73db98c24a5deeb95ffc85bf281255dffc98" +dependencies = [ + "cfg-if 0.1.10", + "cloudabi", + "libc", + "redox_syscall 0.1.57", + "smallvec", + "winapi", ] [[package]] @@ -3454,9 +5674,9 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "smallvec", "windows-targets 0.48.5", ] @@ -3467,6 +5687,23 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pem" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" +dependencies = [ + "base64 0.13.1", + "once_cell", + "regex", +] + [[package]] name = "percent-encoding" version = "2.3.1" @@ -3482,10 +5719,10 @@ dependencies = [ "clap", "dotenv", "futures", - "http 1.0.0", + "http 1.1.0", "near-jsonrpc-client 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", - "near-jsonrpc-primitives", - "near-primitives", + "near-jsonrpc-primitives 0.20.1", + "near-primitives 0.20.1", "rand 0.8.5", "serde_json", "tokio", @@ -3499,7 +5736,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.3", + "indexmap 2.2.5", ] [[package]] @@ -3522,22 +5759,22 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -3582,7 +5819,7 @@ checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "libc", "log", @@ -3599,7 +5836,7 @@ dependencies = [ "base64 0.21.7", "byteorder", "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "hmac", "md-5", "memchr", @@ -3615,7 +5852,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d2234cdee9408b523530a9b6d2d6b373d1db34f6a8e51dc03ded1828d7fb67c" dependencies = [ "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "postgres-protocol", ] @@ -3646,6 +5883,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa06bd51638b6e76ac9ba9b6afb4164fa647bd2916d722f2623fbb6d1ed8bdba" +[[package]] +name = "prettyplease" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +dependencies = [ + "proc-macro2", + "syn 2.0.52", +] + [[package]] name = "prettytable-rs" version = "0.10.0" @@ -3653,7 +5900,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eea25e07510aa6ab6547308ebe3c036016d162b8da920dbb079e3ba8acf3d95a" dependencies = [ "csv", - "encode_unicode", + "encode_unicode 1.0.0", "is-terminal", "lazy_static", "term", @@ -3670,6 +5917,15 @@ dependencies = [ "uint", ] +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml 0.5.11", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -3698,6 +5954,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", + "syn 1.0.109", "version_check", ] @@ -3727,12 +5984,12 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fnv", "lazy_static", "memchr", - "parking_lot", - "protobuf", + "parking_lot 0.12.1", + "protobuf 2.28.0", "thiserror", ] @@ -3795,6 +6052,97 @@ version = "2.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" +[[package]] +name = "protobuf" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58678a64de2fced2bdec6bca052a6716a0efe692d6e3f53d1bda6a1def64cfc0" +dependencies = [ + "once_cell", + "protobuf-support", + "thiserror", +] + +[[package]] +name = "protobuf-codegen" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32777b0b3f6538d9d2e012b3fad85c7e4b9244b5958d04a6415f4333782b7a77" +dependencies = [ + "anyhow", + "once_cell", + "protobuf 3.4.0", + "protobuf-parse", + "regex", + "tempfile", + "thiserror", +] + +[[package]] +name = "protobuf-parse" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96cb37955261126624a25b5e6bda40ae34cf3989d52a783087ca6091b29b5642" +dependencies = [ + "anyhow", + "indexmap 1.9.3", + "log", + "protobuf 3.4.0", + "protobuf-support", + "tempfile", + "thiserror", + "which", +] + +[[package]] +name = "protobuf-support" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1ed294a835b0f30810e13616b1cd34943c6d1e84a8f3b0dcfe466d256c3e7e7" +dependencies = [ + "thiserror", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "pwasm-utils" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f7a12f176deee919f4ba55326ee17491c8b707d0987aed822682c821b660192" +dependencies = [ + "byteorder", + "log", + "parity-wasm 0.41.0", +] + [[package]] name = "quote" version = "1.0.35" @@ -3804,6 +6152,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + [[package]] name = "rand" version = "0.7.3" @@ -3814,7 +6168,7 @@ dependencies = [ "libc", "rand_chacha 0.2.2", "rand_core 0.5.1", - "rand_hc", + "rand_hc 0.2.0", ] [[package]] @@ -3876,19 +6230,37 @@ dependencies = [ ] [[package]] -name = "rand_pcg" -version = "0.3.1" +name = "rand_hc" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b363d4f6370f88d62bf586c80405657bde0f0e1b8945d47d2ad59b906cb4f54" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rand_pcg" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cad018caf63deb318e5a4586d99a24424a364f40f1e5778c29aca23f4fc73e" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" dependencies = [ "rand_core 0.6.4", ] [[package]] name = "rayon" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" dependencies = [ "either", "rayon-core", @@ -3908,11 +6280,12 @@ dependencies = [ name = "read-rpc-server" version = "0.1.0" dependencies = [ - "actix-cors", + "actix-cors 0.7.0", "actix-web", "anyhow", "assert-json-diff", - "borsh", + "borsh 1.3.1", + "chrono", "configuration", "database", "erased-serde", @@ -3921,23 +6294,24 @@ dependencies = [ "hex", "jsonrpc-v2", "lazy_static", - "lru", - "near-chain-configs", - "near-crypto", + "lru 0.12.3", + "near-chain-configs 0.0.0", + "near-crypto 0.0.0", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (git+https://github.com/near/near-jsonrpc-client-rs.git?branch=telezhnaya/wait_until)", - "near-jsonrpc-primitives", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1)", + "near-jsonrpc-primitives 0.0.0", "near-lake-framework", - "near-parameters", - "near-primitives", - "near-vm-runner", + "near-parameters 0.0.0", + "near-primitives 0.0.0", + "near-vm-runner 0.0.0", "paste", "prometheus", "readnode-primitives", "serde", "serde_json", - "sysinfo", + "sysinfo 0.30.6", "thiserror", + "time", "tokio", "tokio-stream", "tracing", @@ -3949,14 +6323,20 @@ name = "readnode-primitives" version = "0.1.0" dependencies = [ "anyhow", - "borsh", - "near-chain-configs", + "borsh 1.3.1", + "near-chain-configs 0.0.0", "near-indexer-primitives", "num-traits", "serde", "serde_json", ] +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" + [[package]] name = "redox_syscall" version = "0.4.1" @@ -3986,6 +6366,19 @@ dependencies = [ "smallvec", ] +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" version = "1.10.3" @@ -3994,7 +6387,7 @@ checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.5", + "regex-automata 0.4.6", "regex-syntax 0.8.2", ] @@ -4009,9 +6402,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -4036,6 +6429,27 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +[[package]] +name = "region" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76e189c2369884dce920945e2ddf79b3dff49e071a167dd1817fa9c4c00d512e" +dependencies = [ + "bitflags 1.3.2", + "libc", + "mach", + "winapi", +] + +[[package]] +name = "rend" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71fe3824f5629716b1589be05dacd749f6aa084c87e00e016714a8cdfccc997c" +dependencies = [ + "bytecheck", +] + [[package]] name = "reqwest" version = "0.11.24" @@ -4048,7 +6462,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.11", + "http 0.2.12", "http-body", "hyper", "hyper-tls", @@ -4068,10 +6482,12 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", + "tokio-util 0.7.10", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "winreg", ] @@ -4093,6 +6509,21 @@ dependencies = [ "zeroize", ] +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", +] + [[package]] name = "ring" version = "0.17.8" @@ -4100,11 +6531,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", - "cfg-if", + "cfg-if 1.0.0", "getrandom 0.2.12", "libc", "spin 0.9.8", - "untrusted", + "untrusted 0.9.0", "windows-sys 0.52.0", ] @@ -4117,25 +6548,130 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "rkyv" +version = "0.7.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cba464629b3394fc4dbc6f940ff8f5b4ff5c7aef40f29166fd4ad12acbc99c0" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7dddfff8de25e6f62b9d64e6e432bf1c6736c57d20323e15ee10435fbda7c65" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rlimit" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "347703a5ae47adf1e693144157be231dde38c72bd485925cae7407ad3e52480b" +dependencies = [ + "libc", +] + +[[package]] +name = "rocksdb" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb6f170a4041d50a0ce04b0d2e14916d6ca863ea2e422689a5b694395d299ffe" +dependencies = [ + "libc", + "librocksdb-sys", +] + +[[package]] +name = "rust-ini" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6d5f2436026b4f6e79dc829837d467cc7e9a55ee40e750d716713540715a2df" +dependencies = [ + "cfg-if 1.0.0", + "ordered-multimap", +] + +[[package]] +name = "rust-s3" +version = "0.32.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6009d9d4cf910505534d62d380a0aa305805a2af0b5c3ad59a3024a0715b847" +dependencies = [ + "async-trait", + "aws-creds", + "aws-region", + "base64 0.13.1", + "block_on_proc", + "cfg-if 1.0.0", + "hex", + "hmac", + "http 0.2.12", + "log", + "maybe-async", + "md5", + "minidom", + "percent-encoding", + "reqwest", + "serde", + "serde-xml-rs", + "serde_derive", + "sha2", + "thiserror", + "time", + "tokio", + "tokio-stream", + "url", +] + [[package]] name = "rustc-demangle" version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc-hex" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +[[package]] +name = "rustc_version" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" +dependencies = [ + "semver 0.9.0", +] + [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver", + "semver 1.0.22", ] [[package]] @@ -4145,7 +6681,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ "bitflags 2.4.2", - "errno", + "errno 0.3.8", "libc", "linux-raw-sys", "windows-sys 0.52.0", @@ -4158,7 +6694,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring", + "ring 0.17.8", "rustls-webpki", "sct", ] @@ -4190,8 +6726,8 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -4200,6 +6736,23 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +[[package]] +name = "rxml" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a98f186c7a2f3abbffb802984b7f1dfd65dac8be1aafdaabbca4137f53f0dff7" +dependencies = [ + "bytes", + "rxml_validation", + "smartstring", +] + +[[package]] +name = "rxml_validation" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22a197350ece202f19a166d1ad6d9d6de145e1d2a8ef47db299abe164dbd7530" + [[package]] name = "ryu" version = "1.0.17" @@ -4221,7 +6774,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1473e24c637950c9bd38763220bea91ec3e095a89f672bbd7a10d03e77ba467" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "pin-utils", ] @@ -4237,8 +6790,8 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.8", + "untrusted 0.9.0", ] [[package]] @@ -4303,12 +6856,18 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb6085ff9c3fd7e5163826901d39164ab86f11bdca16b2f766a00c528ff9cef9" dependencies = [ - "darling 0.20.6", + "darling 0.20.8", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + [[package]] name = "sec1" version = "0.3.0" @@ -4317,7 +6876,7 @@ checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ "base16ct", "der", - "generic-array", + "generic-array 0.14.7", "pkcs8", "subtle", "zeroize", @@ -4374,37 +6933,92 @@ dependencies = [ "libc", ] +[[package]] +name = "semver" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" +dependencies = [ + "semver-parser", +] + [[package]] name = "semver" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +[[package]] +name = "semver-parser" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" + [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-bench" +version = "0.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d733da87e79faaac25616e33d26299a41143fd4cd42746cbb0e91d8feea243fd" +dependencies = [ + "byteorder", + "serde", +] + +[[package]] +name = "serde-xml-rs" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65162e9059be2f6a3421ebbb4fef3e74b7d9e7c60c50a0e292c6239f19f1edfa" +dependencies = [ + "log", + "serde", + "thiserror", + "xml-rs", +] + +[[package]] +name = "serde_bytes" +version = "0.11.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", +] + +[[package]] +name = "serde_ignored" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8e319a36d1b52126a0d608f24e93b2d81297091818cd70625fcf50a15d84ddf" +dependencies = [ + "serde", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -4419,7 +7033,7 @@ checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -4453,7 +7067,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_derive", "serde_json", @@ -4467,10 +7081,10 @@ version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" dependencies = [ - "darling 0.20.6", + "darling 0.20.8", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -4479,7 +7093,7 @@ version = "0.9.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fd075d994154d4a774f95b51fb96bdc2832b0ea48425c92546073816cda1f2f" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "itoa", "ryu", "serde", @@ -4492,7 +7106,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest 0.10.7", ] @@ -4503,7 +7117,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest 0.10.7", ] @@ -4527,6 +7141,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -4552,12 +7172,39 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "simple_asn1" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "692ca13de57ce0613a363c8c2f1de925adebc81b04c923ac60c5488bb44abe4b" +dependencies = [ + "chrono", + "num-bigint 0.2.6", + "num-traits", +] + [[package]] name = "siphasher" version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + [[package]] name = "slab" version = "0.4.9" @@ -4567,6 +7214,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "sluice" version = "0.5.5" @@ -4595,6 +7248,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "smartstring" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" +dependencies = [ + "autocfg", + "static_assertions", + "version_check", +] + [[package]] name = "snap" version = "1.1.1" @@ -4603,12 +7267,12 @@ checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4633,13 +7297,25 @@ dependencies = [ "der", ] +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "state-indexer" version = "0.1.0" dependencies = [ "actix-web", "anyhow", - "borsh", + "borsh 1.3.1", "clap", "configuration", "database", @@ -4649,9 +7325,9 @@ dependencies = [ "humantime", "lazy_static", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1)", "near-lake-framework", - "near-primitives", + "near-primitives 0.0.0", "openssl-probe", "prometheus", "tokio", @@ -4729,6 +7405,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "stun" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7e94b1ec00bad60e6410e058b52f1c66de3dc5fe4d62d09b3e52bb7d3b73e25" +dependencies = [ + "base64 0.13.1", + "crc", + "lazy_static", + "md-5", + "rand 0.8.5", + "ring 0.16.20", + "subtle", + "thiserror", + "tokio", + "url", + "webrtc-util", +] + [[package]] name = "subtle" version = "2.5.0" @@ -4748,9 +7443,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.49" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -4766,7 +7461,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -4777,14 +7472,29 @@ checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "sysinfo" -version = "0.30.5" +version = "0.24.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54cb4ebf3d49308b99e6e9dc95e989e2fdbdc210e4f67c39db0bb89ba927001c" +dependencies = [ + "cfg-if 1.0.0", + "core-foundation-sys", + "libc", + "ntapi 0.3.7", + "once_cell", + "rayon", + "winapi", +] + +[[package]] +name = "sysinfo" +version = "0.30.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb4f3438c8f6389c864e61221cbc97e9bca98b4daf39a5beb7bea660f528bb2" +checksum = "6746919caf9f2a85bff759535664c060109f21975c5ac2e8652e60102bd4d196" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "core-foundation-sys", "libc", - "ntapi", + "ntapi 0.4.1", "once_cell", "rayon", "windows", @@ -4805,19 +7515,37 @@ dependencies = [ name = "system-configuration-sys" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" -dependencies = [ - "core-foundation-sys", - "libc", -] +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab0e7238dcc7b40a7be719a25365910f6807bd864f4cce6b2e6b873658e2b19d" + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand 2.0.1", "rustix", "windows-sys 0.52.0", @@ -4851,16 +7579,16 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "once_cell", ] @@ -4886,6 +7614,16 @@ dependencies = [ "threadpool", ] +[[package]] +name = "tikv-jemalloc-sys" +version = "0.5.4+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9402443cb8fd499b6f327e40565234ff34dbda27460c5b47db0db77443dd85d1" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "time" version = "0.3.34" @@ -4943,7 +7681,7 @@ dependencies = [ "libc", "mio", "num_cpus", - "parking_lot", + "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", "socket2", @@ -4970,7 +7708,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -4983,6 +7721,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-openssl" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ffab79df67727f6acf57f1ff743091873c24c579b1e2ce4d8f53e47ded4d63d" +dependencies = [ + "futures-util", + "openssl", + "openssl-sys", + "tokio", +] + [[package]] name = "tokio-postgres" version = "0.7.10" @@ -4992,11 +7742,11 @@ dependencies = [ "async-trait", "byteorder", "bytes", - "fallible-iterator", + "fallible-iterator 0.2.0", "futures-channel", "futures-util", "log", - "parking_lot", + "parking_lot 0.12.1", "percent-encoding", "phf", "pin-project-lite", @@ -5058,6 +7808,15 @@ dependencies = [ "tracing", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.7.8" @@ -5097,7 +7856,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", @@ -5110,7 +7869,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "toml_datetime", "winnow 0.5.40", ] @@ -5121,11 +7880,11 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ - "indexmap 2.2.3", + "indexmap 2.2.5", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.1", + "winnow 0.6.5", ] [[package]] @@ -5141,7 +7900,7 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http 0.2.11", + "http 0.2.12", "http-body", "hyper", "hyper-timeout", @@ -5248,7 +8007,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] @@ -5379,7 +8138,7 @@ version = "1.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "static_assertions", ] @@ -5397,7 +8156,7 @@ dependencies = [ "humantime", "lazy_static", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1)", "near-lake-framework", "prometheus", "readnode-primitives", @@ -5424,210 +8183,714 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "unicode-segmentation" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" + +[[package]] +name = "unicode-width" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" + +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + +[[package]] +name = "uuid" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +dependencies = [ + "getrandom 0.2.12", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" + +[[package]] +name = "vsimd" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" + +[[package]] +name = "waker-fn" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasite" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.52", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + +[[package]] +name = "wasm-encoder" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e77053dc709db790691d3732cfc458adc5acc881dec524965c608effdcd9c581" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-encoder" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ca90ba1b5b0a70d3d49473c5579951f3bddc78d47b59256d2f9d4922b150aca" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-streams" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "wasmer-compiler-near" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fdae7245128f284476e6db9653ef0a15b011975091bcd7f9d7303132409662" +dependencies = [ + "enumset", + "rkyv", + "smallvec", + "target-lexicon 0.12.14", + "thiserror", + "wasmer-types-near", + "wasmer-vm-near", + "wasmparser 0.78.2", +] + +[[package]] +name = "wasmer-compiler-singlepass-near" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac4af0e438015585eb27b2c6f6869c58c540bfe27408b686b1778470bf301050" +dependencies = [ + "byteorder", + "dynasm 1.2.3", + "dynasmrt 1.2.3", + "lazy_static", + "memoffset 0.6.5", + "more-asserts", + "rayon", + "smallvec", + "wasmer-compiler-near", + "wasmer-types-near", + "wasmer-vm-near", +] [[package]] -name = "unicode-ident" -version = "1.0.12" +name = "wasmer-engine-near" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "4048411cabb2c94c7d8d11d9d0282cc6b15308b61ebc1e122c40e89865ebb5c5" +dependencies = [ + "backtrace", + "enumset", + "lazy_static", + "memmap2", + "more-asserts", + "rustc-demangle", + "target-lexicon 0.12.14", + "thiserror", + "wasmer-compiler-near", + "wasmer-types-near", + "wasmer-vm-near", +] [[package]] -name = "unicode-normalization" -version = "0.1.22" +name = "wasmer-engine-universal-near" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "c5f31c3d2850ac7957406d3c9581d9435ea8126a26478709fa7e931b6f562b4d" dependencies = [ - "tinyvec", + "cfg-if 1.0.0", + "enumset", + "leb128", + "region", + "rkyv", + "thiserror", + "wasmer-compiler-near", + "wasmer-engine-near", + "wasmer-types-near", + "wasmer-vm-near", + "winapi", ] [[package]] -name = "unicode-segmentation" -version = "1.11.0" +name = "wasmer-runtime-core-near" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +checksum = "5a3fac37da3c625e98708c5dd92d3f642aaf700fd077168d3d0fff277ec6a165" +dependencies = [ + "bincode", + "blake3", + "borsh 0.9.3", + "cc", + "digest 0.8.1", + "errno 0.2.8", + "hex", + "indexmap 1.9.3", + "lazy_static", + "libc", + "nix 0.15.0", + "page_size", + "parking_lot 0.10.2", + "rustc_version 0.2.3", + "serde", + "serde-bench", + "serde_bytes", + "serde_derive", + "smallvec", + "target-lexicon 0.10.0", + "wasmparser 0.51.4", + "winapi", +] [[package]] -name = "unicode-width" -version = "0.1.11" +name = "wasmer-runtime-near" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "158e6fff11e5e1ef805af50637374d5bd43d92017beafa18992cdf7f3f7ae3e4" +dependencies = [ + "lazy_static", + "memmap", + "serde", + "serde_derive", + "wasmer-runtime-core-near", + "wasmer-singlepass-backend-near", +] [[package]] -name = "unsafe-libyaml" -version = "0.2.10" +name = "wasmer-singlepass-backend-near" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" +checksum = "5f6edd0ba6c0bcf9b279186d4dbe81649dda3e5ef38f586865943de4dcd653f8" +dependencies = [ + "bincode", + "borsh 0.9.3", + "byteorder", + "dynasm 1.2.3", + "dynasmrt 1.2.3", + "lazy_static", + "libc", + "nix 0.15.0", + "serde", + "serde_derive", + "smallvec", + "wasmer-runtime-core-near", +] [[package]] -name = "untrusted" -version = "0.9.0" +name = "wasmer-types-near" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +checksum = "1ba154adffb0fbd33f5dabd3788a1744d846b43e6e090d44269c7ee8fa5743e4" +dependencies = [ + "indexmap 1.9.3", + "rkyv", + "thiserror", +] [[package]] -name = "url" -version = "2.5.0" +name = "wasmer-vm-near" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "70a5585596f6e9915d606de944aece51626736fb1191aefb5b2ef108c6f7604a" dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", + "backtrace", + "cc", + "cfg-if 1.0.0", + "indexmap 1.9.3", + "libc", + "memoffset 0.6.5", + "more-asserts", + "region", + "rkyv", + "thiserror", + "wasmer-types-near", + "winapi", ] [[package]] -name = "urlencoding" -version = "2.1.3" +name = "wasmparser" +version = "0.51.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" +checksum = "aeb1956b19469d1c5e63e459d29e7b5aa0f558d9f16fcef09736f8a265e6c10a" [[package]] -name = "utf8parse" -version = "0.2.1" +name = "wasmparser" +version = "0.78.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "52144d4c78e5cf8b055ceab8e5fa22814ce4315d6002ad32cfd914f37c12fd65" [[package]] -name = "uuid" -version = "1.7.0" +name = "wasmparser" +version = "0.99.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" +checksum = "9ef3b717afc67f848f412d4f02c127dd3e35a0eecd58c684580414df4fde01d3" dependencies = [ - "getrandom 0.2.12", + "indexmap 1.9.3", + "url", ] [[package]] -name = "valuable" -version = "0.1.0" +name = "wasmparser" +version = "0.105.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "83be9e0b3f9570dc1979a33ae7b89d032c73211564232b99976553e5c155ec32" +dependencies = [ + "indexmap 1.9.3", + "url", +] [[package]] -name = "vcpkg" -version = "0.2.15" +name = "wasmparser" +version = "0.115.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "e06c0641a4add879ba71ccb3a1e4278fd546f76f1eafb21d8f7b07733b547cd5" +dependencies = [ + "indexmap 2.2.5", + "semver 1.0.22", +] [[package]] -name = "version_check" -version = "0.9.4" +name = "wasmprinter" +version = "0.2.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "50b0e5ed7a74a065637f0d7798ce5f29cadb064980d24b0c82af5200122fa0d8" +dependencies = [ + "anyhow", + "wasmparser 0.105.0", +] [[package]] -name = "vsimd" -version = "0.8.0" +name = "wasmtime" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" +checksum = "ca54f6090ce46973f33a79f265924b204f248f91aec09229bce53d19d567c1a6" +dependencies = [ + "anyhow", + "bincode", + "bumpalo", + "cfg-if 1.0.0", + "fxprof-processed-profile", + "indexmap 2.2.5", + "libc", + "log", + "object", + "once_cell", + "paste", + "psm", + "serde", + "serde_derive", + "serde_json", + "target-lexicon 0.12.14", + "wasm-encoder 0.35.0", + "wasmparser 0.115.0", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-jit", + "wasmtime-runtime", + "windows-sys 0.48.0", +] [[package]] -name = "waker-fn" -version = "1.1.1" +name = "wasmtime-asm-macros" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "54984bc0b5689da87a43d7c181d23092b4d5cfcbb7ae3eb6b917dd55865d95e6" +dependencies = [ + "cfg-if 1.0.0", +] [[package]] -name = "want" -version = "0.3.1" +name = "wasmtime-cranelift" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +checksum = "1cf3cee8be02f5006d21b773ffd6802f96a0b7d661ff2ad8a01fb93df458b1aa" dependencies = [ - "try-lock", + "anyhow", + "cfg-if 1.0.0", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli", + "log", + "object", + "target-lexicon 0.12.14", + "thiserror", + "wasmparser 0.115.0", + "wasmtime-cranelift-shared", + "wasmtime-environ", + "wasmtime-versioned-export-macros", ] [[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +name = "wasmtime-cranelift-shared" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +checksum = "420fd2a69bc162957f4c94f21c7fa08ecf60d916f4e87b56332507c555da381d" +dependencies = [ + "anyhow", + "cranelift-codegen", + "cranelift-control", + "cranelift-native", + "gimli", + "object", + "target-lexicon 0.12.14", + "wasmtime-environ", +] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "wasmtime-environ" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "fb6a445ce2b2810127caee6c1b79b8da4ae57712b05556a674592c18b7500a14" +dependencies = [ + "anyhow", + "cranelift-entity", + "gimli", + "indexmap 2.2.5", + "log", + "object", + "serde", + "serde_derive", + "target-lexicon 0.12.14", + "thiserror", + "wasmparser 0.115.0", + "wasmtime-types", +] [[package]] -name = "wasm-bindgen" -version = "0.2.91" +name = "wasmtime-jit" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "1f0f6586c61125fbfc13c3108c3dd565d21f314dd5bac823b9a5b7ab576d21f1" dependencies = [ - "cfg-if", - "wasm-bindgen-macro", + "addr2line", + "anyhow", + "bincode", + "cfg-if 1.0.0", + "cpp_demangle", + "gimli", + "log", + "object", + "rustc-demangle", + "rustix", + "serde", + "serde_derive", + "target-lexicon 0.12.14", + "wasmtime-environ", + "wasmtime-jit-icache-coherence", + "wasmtime-runtime", + "windows-sys 0.48.0", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.91" +name = "wasmtime-jit-debug" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "109a9e46afe33580b952b14a4207354355f19bcdf0b47485b397b68409eaf553" dependencies = [ - "bumpalo", - "log", "once_cell", - "proc-macro2", - "quote", - "syn 2.0.49", - "wasm-bindgen-shared", + "wasmtime-versioned-export-macros", ] [[package]] -name = "wasm-bindgen-futures" -version = "0.4.41" +name = "wasmtime-jit-icache-coherence" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "f67e6be36375c39cff57ed3b137ab691afbf2d9ba8ee1c01f77888413f218749" dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", + "cfg-if 1.0.0", + "libc", + "windows-sys 0.48.0", ] [[package]] -name = "wasm-bindgen-macro" -version = "0.2.91" +name = "wasmtime-runtime" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "1d07986b2327b5e7f535ed638fbde25990fc8f85400194fda0d26db71c7b685e" dependencies = [ - "quote", - "wasm-bindgen-macro-support", + "anyhow", + "cc", + "cfg-if 1.0.0", + "indexmap 2.2.5", + "libc", + "log", + "mach", + "memfd", + "memoffset 0.9.0", + "paste", + "rand 0.8.5", + "rustix", + "sptr", + "wasm-encoder 0.35.0", + "wasmtime-asm-macros", + "wasmtime-environ", + "wasmtime-jit-debug", + "wasmtime-versioned-export-macros", + "wasmtime-wmemcheck", + "windows-sys 0.48.0", ] [[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.91" +name = "wasmtime-types" +version = "14.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e810a0d2e869abd1cb42bd232990f6bd211672b3d202d2ae7e70ffb97ed70ea3" +dependencies = [ + "cranelift-entity", + "serde", + "serde_derive", + "thiserror", + "wasmparser 0.115.0", +] + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "09b5575a75e711ca6c36bb9ad647c93541cdc8e34218031acba5da3f35919dd3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", - "wasm-bindgen-backend", - "wasm-bindgen-shared", + "syn 2.0.52", ] [[package]] -name = "wasm-bindgen-shared" -version = "0.2.91" +name = "wasmtime-wmemcheck" +version = "14.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "9dafab2db172a53e23940e0fa3078c202f567ee5f13f4b42f66b694fab43c658" [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", ] +[[package]] +name = "webrtc-util" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93f1db1727772c05cf7a2cfece52c3aca8045ca1e176cd517d323489aa3c6d87" +dependencies = [ + "async-trait", + "bitflags 1.3.2", + "bytes", + "cc", + "ipnet", + "lazy_static", + "libc", + "log", + "nix 0.24.3", + "rand 0.8.5", + "thiserror", + "tokio", + "winapi", +] + [[package]] name = "which" version = "4.4.2" @@ -5642,14 +8905,21 @@ dependencies = [ [[package]] name = "whoami" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" +checksum = "0fec781d48b41f8163426ed18e8fc2864c12937df9ce54c88ede7bd47270893e" dependencies = [ - "wasm-bindgen", + "redox_syscall 0.4.1", + "wasite", "web-sys", ] +[[package]] +name = "wildmatch" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "495ec47bf3c1345005f40724f0269362c8556cbc43aed0526ed44cae1d35fceb" + [[package]] name = "winapi" version = "0.3.9" @@ -5679,7 +8949,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -5688,7 +8958,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -5706,7 +8976,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] @@ -5726,17 +8996,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -5747,9 +9017,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -5759,9 +9029,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -5771,9 +9041,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -5783,9 +9053,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -5795,9 +9065,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -5807,9 +9077,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -5819,9 +9089,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" @@ -5834,9 +9104,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.1" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d90f4e0f530c4c69f62b80d839e9ef3855edc9cba471a160c4d692deed62b401" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] @@ -5847,16 +9117,46 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xml-rs" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" + [[package]] name = "xmlparser" version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "yansi" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" + [[package]] name = "zerocopy" version = "0.7.32" @@ -5874,7 +9174,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.52", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 6b82624c..0e94a92b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,9 +12,31 @@ members = [ "configuration", "database", "epoch-indexer", + "near-state-indexer", "perf-testing", "readnode-primitives", "rpc-server", "state-indexer", "tx-indexer", ] + +[workspace.dependencies] + +configuration = { path = "configuration" } +database = { path = "database" } +readnode-primitives = { path = "readnode-primitives" } +epoch-indexer = { path = "epoch-indexer" } + +near-indexer = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-client = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-o11y = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-indexer-primitives = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-primitives = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-chain-configs = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-crypto = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-jsonrpc-primitives = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-parameters = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-vm-runner = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } + +near-lake-framework = { git = 'https://github.com/kobayurii/near-lake-framework-rs.git', branch = '0.7.8' } +near-jsonrpc-client = { git = 'https://github.com/kobayurii/near-jsonrpc-client-rs.git', branch = '0.8.1'} diff --git a/README.md b/README.md index 10e52b17..1183224c 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,10 @@ The JSON RPC server implementation that repeats all the APIs current real NEAR J The indexer built on top of Lake Framework that watches the network and stores the `StateChanges` into the Storage (ScyllaDB) using the designed data schemas. +### [near-state-indexer](near-state-indexer/README.md) + +The indexer built on [NEAR Indexer Framework](https://github.com/nearprotocol/nearcore/tree/master/chain/indexer) + ### [tx-indexer](tx-indexer/README.md) The indexer built on top of Lake Framework that watches the network and stores the `Transactions` along with all the related entities (`Receipts`, `ExecutionOutcomes`) into the Storage (ScyllaDB) using the specifically defined `TransactionDetails` structure in a dumped way (using the simplest key-value schema) diff --git a/config.toml b/config.toml index d9414bf4..f143081c 100644 --- a/config.toml +++ b/config.toml @@ -25,6 +25,10 @@ indexer_id = "${STATE_INDEXER_ID}" metrics_server_port = "${STATE_SERVER_PORT}" concurrency = "${CONCURRENCY}" +[general.near_state_indexer] +metrics_server_port = "${NEAR_STATE_SERVER_PORT}" +concurrency = "${NEAR_STATE_CONCURRENCY}" + [general.epoch_indexer] indexer_id = "${EPOCH_INDEXER_ID}" diff --git a/configuration/Cargo.toml b/configuration/Cargo.toml index e1a59b7a..7d8ff12e 100644 --- a/configuration/Cargo.toml +++ b/configuration/Cargo.toml @@ -35,7 +35,7 @@ tracing-subscriber = { version = "0.3.15", features = [ tracing-opentelemetry = { version = "0.19", optional = true } tracing-stackdriver = "0.7.2" # GCP logs -near-lake-framework = "0.7.7" +near-lake-framework.workspace = true [features] tracing-instrumentation = ["dep:opentelemetry-jaeger", "dep:tracing-opentelemetry"] diff --git a/configuration/README.md b/configuration/README.md index bda68b95..583f92bd 100644 --- a/configuration/README.md +++ b/configuration/README.md @@ -26,6 +26,7 @@ The configuration settings are stored in a TOML file. The settings include: - RPC server settings like the server port and max gas burnt for contract function call. - Transaction indexer settings like the indexer ID and port for the metrics server. - State indexer settings like the indexer ID and port for the metrics server. +- Near State indexer settings like the port for the metrics server. - Epoch indexer settings like the indexer ID. - Rightsizing settings like the accounts and state changes to track. - Lake framework settings like the AWS access key ID and secret access key. diff --git a/configuration/example.config.toml b/configuration/example.config.toml index e708681c..a5c8b0cd 100644 --- a/configuration/example.config.toml +++ b/configuration/example.config.toml @@ -88,6 +88,17 @@ near_rpc_url = "https://beta.rpc.mainnet.near.org" ## Default value is 1 #concurrency = 1 +### Near state indexer general configuration +[general.near_state_indexer] + +## Port for metrics server +## By default it 8082 +#metrics_server_port = 8082 + +## Concurrency for state-indexer +## Default value is 1 +#concurrency = 1 + ## Epoch indexer general configuration [general.epoch_indexer] diff --git a/configuration/src/configs/general.rs b/configuration/src/configs/general.rs index 47fb5d7b..54947ea5 100644 --- a/configuration/src/configs/general.rs +++ b/configuration/src/configs/general.rs @@ -2,7 +2,9 @@ use std::str::FromStr; use serde_derive::Deserialize; -use crate::configs::{deserialize_data_or_env, deserialize_optional_data_or_env}; +use crate::configs::{ + deserialize_data_or_env, deserialize_optional_data_or_env, required_value_or_panic, +}; #[derive(Debug, Clone)] pub struct GeneralRpcServerConfig { @@ -38,6 +40,13 @@ pub struct GeneralStateIndexerConfig { pub concurrency: usize, } +#[derive(Debug, Clone)] +pub struct GeneralNearStateIndexerConfig { + pub chain_id: ChainId, + pub metrics_server_port: u16, + pub concurrency: usize, +} + #[derive(Debug, Clone)] pub struct GeneralEpochIndexerConfig { pub chain_id: ChainId, @@ -50,8 +59,8 @@ pub struct GeneralEpochIndexerConfig { pub struct CommonGeneralConfig { #[serde(deserialize_with = "deserialize_data_or_env")] pub chain_id: ChainId, - #[serde(deserialize_with = "deserialize_data_or_env")] - pub near_rpc_url: String, + #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] + pub near_rpc_url: Option, #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] pub near_archival_rpc_url: Option, #[serde(default)] @@ -61,6 +70,8 @@ pub struct CommonGeneralConfig { #[serde(default)] pub state_indexer: CommonGeneralStateIndexerConfig, #[serde(default)] + pub near_state_indexer: CommonGeneralNearStateIndexerConfig, + #[serde(default)] pub epoch_indexer: CommonGeneralEpochIndexerConfig, } @@ -70,6 +81,8 @@ pub enum ChainId { #[default] Mainnet, Testnet, + Betanet, + Localnet, } impl FromStr for ChainId { @@ -79,6 +92,8 @@ impl FromStr for ChainId { match s { "mainnet" => Ok(ChainId::Mainnet), "testnet" => Ok(ChainId::Testnet), + "localnet" => Ok(ChainId::Localnet), + "betanet" => Ok(ChainId::Betanet), _ => Err(anyhow::anyhow!("Invalid chain id")), } } @@ -210,6 +225,33 @@ impl Default for CommonGeneralStateIndexerConfig { } } +#[derive(Deserialize, Debug, Clone)] +pub struct CommonGeneralNearStateIndexerConfig { + #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] + pub metrics_server_port: Option, + #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] + pub concurrency: Option, +} + +impl CommonGeneralNearStateIndexerConfig { + pub fn default_metrics_server_port() -> u16 { + 8082 + } + + pub fn default_concurrency() -> usize { + 1 + } +} + +impl Default for CommonGeneralNearStateIndexerConfig { + fn default() -> Self { + Self { + metrics_server_port: Some(Self::default_metrics_server_port()), + concurrency: Some(Self::default_concurrency()), + } + } +} + #[derive(Deserialize, Debug, Clone)] pub struct CommonGeneralEpochIndexerConfig { #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] @@ -234,7 +276,7 @@ impl From for GeneralRpcServerConfig { fn from(common_config: CommonGeneralConfig) -> Self { Self { chain_id: common_config.chain_id, - near_rpc_url: common_config.near_rpc_url, + near_rpc_url: required_value_or_panic("near_rpc_url", common_config.near_rpc_url), near_archival_rpc_url: common_config.near_archival_rpc_url, referer_header_value: common_config .rpc_server @@ -269,7 +311,7 @@ impl From for GeneralTxIndexerConfig { fn from(common_config: CommonGeneralConfig) -> Self { Self { chain_id: common_config.chain_id, - near_rpc_url: common_config.near_rpc_url, + near_rpc_url: required_value_or_panic("near_rpc_url", common_config.near_rpc_url), near_archival_rpc_url: common_config.near_archival_rpc_url, indexer_id: common_config .tx_indexer @@ -291,7 +333,7 @@ impl From for GeneralStateIndexerConfig { fn from(common_config: CommonGeneralConfig) -> Self { Self { chain_id: common_config.chain_id, - near_rpc_url: common_config.near_rpc_url, + near_rpc_url: required_value_or_panic("near_rpc_url", common_config.near_rpc_url), near_archival_rpc_url: common_config.near_archival_rpc_url, indexer_id: common_config .state_indexer @@ -309,11 +351,27 @@ impl From for GeneralStateIndexerConfig { } } +impl From for GeneralNearStateIndexerConfig { + fn from(common_config: CommonGeneralConfig) -> Self { + Self { + chain_id: common_config.chain_id, + metrics_server_port: common_config + .near_state_indexer + .metrics_server_port + .unwrap_or_else(CommonGeneralNearStateIndexerConfig::default_metrics_server_port), + concurrency: common_config + .near_state_indexer + .concurrency + .unwrap_or_else(CommonGeneralNearStateIndexerConfig::default_concurrency), + } + } +} + impl From for GeneralEpochIndexerConfig { fn from(common_config: CommonGeneralConfig) -> Self { Self { chain_id: common_config.chain_id, - near_rpc_url: common_config.near_rpc_url, + near_rpc_url: required_value_or_panic("near_rpc_url", common_config.near_rpc_url), near_archival_rpc_url: common_config.near_archival_rpc_url, indexer_id: common_config .epoch_indexer diff --git a/configuration/src/configs/lake.rs b/configuration/src/configs/lake.rs index 15b1d351..1f781c63 100644 --- a/configuration/src/configs/lake.rs +++ b/configuration/src/configs/lake.rs @@ -1,17 +1,13 @@ use near_lake_framework::near_indexer_primitives::near_primitives; use serde_derive::Deserialize; -use crate::configs::deserialize_data_or_env; +use crate::configs::{deserialize_optional_data_or_env, required_value_or_panic}; -#[derive(Deserialize, Debug, Clone, Default)] +#[derive(Debug, Clone)] pub struct LakeConfig { - #[serde(deserialize_with = "deserialize_data_or_env")] pub aws_access_key_id: String, - #[serde(deserialize_with = "deserialize_data_or_env")] pub aws_secret_access_key: String, - #[serde(deserialize_with = "deserialize_data_or_env")] pub aws_default_region: String, - #[serde(deserialize_with = "deserialize_data_or_env")] pub aws_bucket_name: String, } @@ -53,3 +49,38 @@ impl LakeConfig { )) } } + +#[derive(Deserialize, Debug, Clone, Default)] +pub struct CommonLakeConfig { + #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] + pub aws_access_key_id: Option, + #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] + pub aws_secret_access_key: Option, + #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] + pub aws_default_region: Option, + #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] + pub aws_bucket_name: Option, +} + +impl From for LakeConfig { + fn from(common_config: CommonLakeConfig) -> Self { + Self { + aws_access_key_id: required_value_or_panic( + "aws_access_key_id", + common_config.aws_access_key_id, + ), + aws_secret_access_key: required_value_or_panic( + "aws_secret_access_key", + common_config.aws_secret_access_key, + ), + aws_default_region: required_value_or_panic( + "aws_default_region", + common_config.aws_default_region, + ), + aws_bucket_name: required_value_or_panic( + "aws_bucket_name", + common_config.aws_bucket_name, + ), + } + } +} diff --git a/configuration/src/configs/mod.rs b/configuration/src/configs/mod.rs index 841cb735..1c54dc5b 100644 --- a/configuration/src/configs/mod.rs +++ b/configuration/src/configs/mod.rs @@ -14,6 +14,14 @@ lazy_static::lazy_static! { static ref RE_NAME_ENV: regex::Regex = regex::Regex::new(r"\$\{(?\w+)}").unwrap(); } +fn required_value_or_panic(config_name: &str, value: Option) -> T { + if let Some(value) = value { + value + } else { + panic!("Config `{}` is required!", config_name) + } +} + fn get_env_var(env_var_name: &str) -> anyhow::Result where T: FromStr, @@ -70,7 +78,7 @@ pub struct CommonConfig { pub general: general::CommonGeneralConfig, #[serde(default)] pub rightsizing: rightsizing::CommonRightsizingConfig, - pub lake_config: lake::LakeConfig, + pub lake_config: lake::CommonLakeConfig, pub database: database::CommonDatabaseConfig, } @@ -89,7 +97,7 @@ impl Config for RpcServerConfig { fn from_common_config(common_config: CommonConfig) -> Self { Self { general: common_config.general.into(), - lake_config: common_config.lake_config, + lake_config: common_config.lake_config.into(), database: database::DatabaseRpcServerConfig::from(common_config.database).into(), } } @@ -117,7 +125,7 @@ impl Config for TxIndexerConfig { Self { general: common_config.general.into(), rightsizing: common_config.rightsizing.into(), - lake_config: common_config.lake_config, + lake_config: common_config.lake_config.into(), database: database::DatabaseTxIndexerConfig::from(common_config.database).into(), } } @@ -142,7 +150,30 @@ impl Config for StateIndexerConfig { Self { general: common_config.general.into(), rightsizing: common_config.rightsizing.into(), - lake_config: common_config.lake_config, + lake_config: common_config.lake_config.into(), + database: database::DatabaseStateIndexerConfig::from(common_config.database).into(), + } + } +} + +#[derive(Debug, Clone)] +pub struct NearStateIndexerConfig { + pub general: general::GeneralNearStateIndexerConfig, + pub rightsizing: rightsizing::RightsizingConfig, + pub database: database::DatabaseConfig, +} + +impl NearStateIndexerConfig { + pub fn state_should_be_indexed(&self, state_change_value: &StateChangeValueView) -> bool { + self.rightsizing.state_should_be_indexed(state_change_value) + } +} + +impl Config for NearStateIndexerConfig { + fn from_common_config(common_config: CommonConfig) -> Self { + Self { + general: common_config.general.into(), + rightsizing: common_config.rightsizing.into(), database: database::DatabaseStateIndexerConfig::from(common_config.database).into(), } } @@ -159,7 +190,7 @@ impl Config for EpochIndexerConfig { fn from_common_config(common_config: CommonConfig) -> Self { Self { general: common_config.general.into(), - lake_config: common_config.lake_config, + lake_config: common_config.lake_config.into(), database: database::DatabaseStateIndexerConfig::from(common_config.database).into(), } } diff --git a/configuration/src/lib.rs b/configuration/src/lib.rs index 6081c859..c368b764 100644 --- a/configuration/src/lib.rs +++ b/configuration/src/lib.rs @@ -7,7 +7,8 @@ mod configs; pub use crate::configs::database::DatabaseConfig; pub use crate::configs::general::ChainId; pub use crate::configs::{ - EpochIndexerConfig, RpcServerConfig, StateIndexerConfig, TxIndexerConfig, + EpochIndexerConfig, NearStateIndexerConfig, RpcServerConfig, StateIndexerConfig, + TxIndexerConfig, }; pub async fn read_configuration() -> anyhow::Result diff --git a/database/Cargo.toml b/database/Cargo.toml index 06049e51..4a7fa50e 100644 --- a/database/Cargo.toml +++ b/database/Cargo.toml @@ -34,13 +34,13 @@ tokio = { version = "1.36.0", features = [ tracing = "0.1.34" uuid = { version = "1.7.0", optional = true } -configuration = { path = "../configuration" } -readnode-primitives = { path = "../readnode-primitives" } +configuration.workspace = true +readnode-primitives.workspace = true -near-chain-configs = "0.20.0" -near-primitives = "0.20.0" -near-crypto = "0.20.0" -near-indexer-primitives = "0.20.0" +near-chain-configs.workspace = true +near-primitives.workspace = true +near-crypto.workspace = true +near-indexer-primitives.workspace = true [features] default = ["scylla_db"] diff --git a/database/src/base/state_indexer.rs b/database/src/base/state_indexer.rs index 00699975..343e5b09 100644 --- a/database/src/base/state_indexer.rs +++ b/database/src/base/state_indexer.rs @@ -124,4 +124,121 @@ pub trait StateIndexerDbManager { epoch_id: near_indexer_primitives::CryptoHash, epoch_end_block_hash: near_indexer_primitives::CryptoHash, ) -> anyhow::Result<()>; + + async fn save_block( + &self, + block_height: u64, + block_hash: near_indexer_primitives::CryptoHash, + chunks: Vec<( + crate::primitives::ChunkHash, + crate::primitives::ShardId, + crate::primitives::HeightIncluded, + )>, + ) -> anyhow::Result<()> { + let add_block_future = self.add_block(block_height, block_hash); + let add_chunks_future = self.add_chunks(block_height, chunks); + + futures::try_join!(add_block_future, add_chunks_future)?; + Ok(()) + } + + async fn save_state_change( + &self, + state_change: near_primitives::views::StateChangeWithCauseView, + block_height: u64, + block_hash: near_indexer_primitives::CryptoHash, + ) -> anyhow::Result<()> { + match state_change.value { + near_primitives::views::StateChangeValueView::DataUpdate { + account_id, + key, + value, + } => { + self.add_state_changes( + account_id, + block_height, + block_hash, + key.as_ref(), + value.as_ref(), + ) + .await? + } + near_primitives::views::StateChangeValueView::DataDeletion { account_id, key } => { + self.delete_state_changes(account_id, block_height, block_hash, key.as_ref()) + .await? + } + near_primitives::views::StateChangeValueView::AccessKeyUpdate { + account_id, + public_key, + access_key, + } => { + let data_key = borsh::to_vec(&public_key)?; + let data_value = borsh::to_vec(&access_key)?; + let add_access_key_future = self.add_access_key( + account_id.clone(), + block_height, + block_hash, + &data_key, + &data_value, + ); + + #[cfg(feature = "account_access_keys")] + { + let add_account_access_keys_future = self.add_account_access_keys( + account_id, + block_height, + &data_key, + Some(&data_value), + ); + futures::try_join!(add_access_key_future, add_account_access_keys_future)?; + } + #[cfg(not(feature = "account_access_keys"))] + add_access_key_future.await?; + } + near_primitives::views::StateChangeValueView::AccessKeyDeletion { + account_id, + public_key, + } => { + let data_key = borsh::to_vec(&public_key)?; + let delete_access_key_future = + self.delete_access_key(account_id.clone(), block_height, block_hash, &data_key); + + #[cfg(feature = "account_access_keys")] + { + let delete_account_access_keys_future = + self.add_account_access_keys(account_id, block_height, &data_key, None); + futures::try_join!( + delete_access_key_future, + delete_account_access_keys_future + )?; + } + #[cfg(not(feature = "account_access_keys"))] + delete_access_key_future.await?; + } + near_primitives::views::StateChangeValueView::ContractCodeUpdate { + account_id, + code, + } => { + self.add_contract_code(account_id, block_height, block_hash, code.as_ref()) + .await? + } + near_primitives::views::StateChangeValueView::ContractCodeDeletion { account_id } => { + self.delete_contract_code(account_id, block_height, block_hash) + .await? + } + near_primitives::views::StateChangeValueView::AccountUpdate { + account_id, + account, + } => { + let value = borsh::to_vec(&near_primitives::account::Account::from(account))?; + self.add_account(account_id, block_height, block_hash, value) + .await? + } + near_primitives::views::StateChangeValueView::AccountDeletion { account_id } => { + self.delete_account(account_id, block_height, block_hash) + .await? + } + } + Ok(()) + } } diff --git a/epoch-indexer/Cargo.toml b/epoch-indexer/Cargo.toml index 0e47fb8e..25eee3bc 100644 --- a/epoch-indexer/Cargo.toml +++ b/epoch-indexer/Cargo.toml @@ -18,14 +18,14 @@ tokio = { version = "1.36.0", features = [ ] } tracing = "0.1.34" -configuration = { path = "../configuration" } -database = { path = "../database" } -readnode-primitives = { path = "../readnode-primitives" } +configuration.workspace = true +database.workspace = true +readnode-primitives.workspace = true -near-jsonrpc-client = "0.8.0" -near-chain-configs = "0.20.0" -near-indexer-primitives = "0.20.0" -near-lake-framework = "0.7.7" +near-jsonrpc-client.workspace = true +near-chain-configs.workspace = true +near-indexer-primitives.workspace = true +near-lake-framework.workspace = true [features] default = ["scylla_db"] diff --git a/near-state-indexer/Cargo.toml b/near-state-indexer/Cargo.toml new file mode 100644 index 00000000..e4b53245 --- /dev/null +++ b/near-state-indexer/Cargo.toml @@ -0,0 +1,44 @@ +[package] +name = "near-state-indexer" +version.workspace = true +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +repository.workspace = true +license.workspace = true + +[dependencies] +actix = "0.13.3" +actix-web = "4.2.1" +anyhow = "1.0.70" +borsh = "1.3.1" +clap = "4.4.18" +futures = "0.3.5" +hex = "0.4.3" +humantime = "2.1.0" +lazy_static = "1.4.0" +openssl-probe = "0.1.5" +prometheus = "0.13.1" +tokio = { version = "1.36.0", features = [ + "sync", + "time", + "macros", + "rt-multi-thread", +] } +tokio-stream = "0.1" +tracing = "0.1.34" + +configuration.workspace = true +database.workspace = true + +near-o11y.workspace = true +near-client.workspace = true +near-indexer.workspace = true + +[features] +default = ["scylla_db"] +tracing-instrumentation = ["configuration/tracing-instrumentation"] +postgres_db = ["database/postgres_db"] +scylla_db = ["database/scylla_db"] +scylla_db_tracing = ["database/scylla_db_tracing", "scylla_db"] +account_access_keys = ["database/account_access_keys"] diff --git a/near-state-indexer/README.md b/near-state-indexer/README.md new file mode 100644 index 00000000..1b7e963b --- /dev/null +++ b/near-state-indexer/README.md @@ -0,0 +1,54 @@ +NEAR State Indexer +================== + +Near State Indexer based on [NEAR Indexer Framework](https://github.com/nearprotocol/nearcore/tree/master/chain/indexer) +Near State Indexer is only designed to track the end of the network. +It is not designed to index historical data. +It is assumed that in a bet with near_state_indexer the [state-indexer](../state-indexer/README.md) will always be running. + +## How to set up and test NEAR State Indexer + +### localnet + +To run the NEAR Indexer connected to a network we need to have configs and keys prepopulated. To generate configs for localnet do the following + +```bash +$ cargo run --release -- --home ~/.near/localnet init +``` +The above commands should initialize necessary configs and keys to run localnet in `~/.near/localnet`. + +```bash +$ cargo run --release -- --home ~/.near/localnet/ run +``` +After the node is started, you should see logs of every block produced in your localnet. + +### testnet / betanet + +To run the NEAR Indexer connected to testnet or betanet we need to have configs and keys prepopulated, you can get them with the NEAR Indexer Example like above with a little change. Follow the instructions below to run non-validating node (leaving account ID empty). + +```bash +$ cargo run --release -- --home-dir ~/.near/testnet init --chain-id testnet --download +``` + +The above code will download the official genesis config and generate necessary configs. You can replace `testnet` in the command above to different network ID `betanet`. + +**NB!** According to changes in `nearcore` config generation we don't fill all the necessary fields in the config file. While this issue is open you need to download config you want and replace the generated one manually. +- [testnet config.json](https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/testnet/config.json) +- [betanet config.json](https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/betanet/config.json) +- [mainnet config.json](https://s3-us-west-1.amazonaws.com/build.nearprotocol.com/nearcore-deploy/mainnet/config.json) + +Replace `config.json` in your `--home` (e.g. `~/.near/testnet/config.json`) with downloaded one. + +Configs for the specified network are in the `--home` provided folder. We need to ensure that NEAR Indexer follows all the necessary shards, so `"tracked_shards"` parameters in `~/.near/testnet/config.json` needs to be configured properly. For example, with a single shared network, you just add the shard #0 to the list: + +```text +... +"tracked_shards": [0], +... +``` + +After that we can run NEAR Indexer. + +```bash +$ cargo run --release -- --home-dir ~/.near/testnet run +``` diff --git a/near-state-indexer/src/configs.rs b/near-state-indexer/src/configs.rs new file mode 100644 index 00000000..8d2de11c --- /dev/null +++ b/near-state-indexer/src/configs.rs @@ -0,0 +1,80 @@ +/// Watches for stream of blocks from the chain +#[derive(clap::Parser, Debug)] +pub(crate) struct Opts { + /// Sets a custom config dir. Defaults to ~/.near/ + #[clap(short, long)] + pub home: Option, + #[clap(subcommand)] + pub subcmd: SubCommand, +} + +#[derive(clap::Parser, Debug)] +#[allow(clippy::large_enum_variant)] +pub(crate) enum SubCommand { + /// Run NEAR Indexer Example. Start observe the network + Run, + /// Initialize necessary configs + Init(InitConfigArgs), +} + +#[derive(clap::Parser, Debug)] +pub(crate) struct InitConfigArgs { + /// chain/network id (localnet, testnet, devnet, betanet) + #[clap(short, long)] + pub chain_id: Option, + /// Account ID for the validator key + #[clap(long)] + pub account_id: Option, + /// Specify private key generated from seed (TESTING ONLY) + #[clap(long)] + pub test_seed: Option, + /// Number of shards to initialize the chain with + #[clap(short, long, default_value = "1")] + pub num_shards: u64, + /// Makes block production fast (TESTING ONLY) + #[clap(short, long)] + pub fast: bool, + /// Genesis file to use when initialize testnet (including downloading) + #[clap(short, long)] + pub genesis: Option, + #[clap(long)] + /// Download the verified NEAR genesis file automatically. + pub download_genesis: bool, + /// Specify a custom download URL for the genesis-file. + #[clap(long)] + pub download_genesis_url: Option, + /// Specify a custom download URL for the records-file. + #[clap(long)] + pub download_records_url: Option, + #[clap(long)] + /// Download the verified NEAR config file automatically. + pub download_config: bool, + /// Specify a custom download URL for the config file. + #[clap(long)] + pub download_config_url: Option, + /// Specify the boot nodes to bootstrap the network + pub boot_nodes: Option, + /// Specify a custom max_gas_burnt_view limit. + #[clap(long)] + pub max_gas_burnt_view: Option, +} + +impl From for near_indexer::InitConfigArgs { + fn from(config_args: InitConfigArgs) -> Self { + Self { + chain_id: config_args.chain_id, + account_id: config_args.account_id, + test_seed: config_args.test_seed, + num_shards: config_args.num_shards, + fast: config_args.fast, + genesis: config_args.genesis, + download_genesis: config_args.download_genesis, + download_genesis_url: config_args.download_genesis_url, + download_records_url: config_args.download_records_url, + download_config: config_args.download_config, + download_config_url: config_args.download_config_url, + boot_nodes: config_args.boot_nodes, + max_gas_burnt_view: config_args.max_gas_burnt_view, + } + } +} diff --git a/near-state-indexer/src/main.rs b/near-state-indexer/src/main.rs new file mode 100644 index 00000000..cbf0d670 --- /dev/null +++ b/near-state-indexer/src/main.rs @@ -0,0 +1,312 @@ +use clap::Parser; +use futures::StreamExt; + +use crate::configs::Opts; +use near_indexer::near_primitives::hash::CryptoHash; +use near_indexer::near_primitives::views::{StateChangeValueView, StateChangeWithCauseView}; + +mod configs; +mod metrics; +mod utils; + +#[macro_use] +extern crate lazy_static; + +// Categories for logging +pub(crate) const INDEXER: &str = "near_state_indexer"; + +#[cfg_attr( + feature = "tracing-instrumentation", + tracing::instrument(skip(streamer_message, db_manager)) +)] +async fn handle_streamer_message( + streamer_message: near_indexer::StreamerMessage, + db_manager: &(impl database::StateIndexerDbManager + Sync + Send + 'static), + client: &actix::Addr, + indexer_config: configuration::NearStateIndexerConfig, + stats: std::sync::Arc>, +) -> anyhow::Result<()> { + let block_height = streamer_message.block.header.height; + let block_hash = streamer_message.block.header.hash; + + let current_epoch_id = streamer_message.block.header.epoch_id; + let next_epoch_id = streamer_message.block.header.next_epoch_id; + + tracing::debug!(target: INDEXER, "Block height {}", block_height,); + + stats + .write() + .await + .block_heights_processing + .insert(block_height); + + let handle_epoch_future = handle_epoch( + stats.read().await.current_epoch_id, + stats.read().await.current_epoch_height, + current_epoch_id, + next_epoch_id, + db_manager, + client, + ); + let handle_block_future = db_manager.save_block( + block_height, + block_hash, + streamer_message + .block + .chunks + .iter() + .map(|chunk| { + ( + chunk.chunk_hash.to_string(), + chunk.shard_id, + chunk.height_included, + ) + }) + .collect(), + ); + let handle_state_change_future = handle_state_changes( + streamer_message, + db_manager, + block_height, + block_hash, + &indexer_config, + ); + + futures::try_join!( + handle_epoch_future, + handle_block_future, + handle_state_change_future, + )?; + + metrics::BLOCK_PROCESSED_TOTAL.inc(); + // Prometheus Gauge Metric type do not support u64 + // https://github.com/tikv/rust-prometheus/issues/470 + metrics::LATEST_BLOCK_HEIGHT.set(i64::try_from(block_height)?); + + let mut stats_lock = stats.write().await; + stats_lock.block_heights_processing.remove(&block_height); + stats_lock.blocks_processed_count += 1; + stats_lock.last_processed_block_height = block_height; + if let Some(stats_epoch_id) = stats_lock.current_epoch_id { + if current_epoch_id != stats_epoch_id { + stats_lock.current_epoch_id = Some(current_epoch_id); + if stats_epoch_id == CryptoHash::default() { + stats_lock.current_epoch_height = 1; + } else { + stats_lock.current_epoch_height += 1; + } + } + } else { + // handle first indexing epoch + let epoch_info = utils::fetch_epoch_validators_info(current_epoch_id, client).await?; + stats_lock.current_epoch_id = Some(current_epoch_id); + stats_lock.current_epoch_height = epoch_info.epoch_height; + } + Ok(()) +} + +#[cfg_attr( + feature = "tracing-instrumentation", + tracing::instrument(skip(db_manager)) +)] +async fn handle_epoch( + stats_current_epoch_id: Option, + stats_current_epoch_height: u64, + current_epoch_id: CryptoHash, + next_epoch_id: CryptoHash, + db_manager: &(impl database::StateIndexerDbManager + Sync + Send + 'static), + client: &actix::Addr, +) -> anyhow::Result<()> { + if let Some(stats_epoch_id) = stats_current_epoch_id { + if stats_epoch_id == current_epoch_id { + // If epoch didn't change, we don't need handle it + Ok(()) + } else { + // If epoch changed, we need to save epoch info and update epoch_end_height + let validators_info = + utils::fetch_epoch_validators_info(stats_epoch_id, client).await?; + + db_manager + .add_validators( + stats_epoch_id, + stats_current_epoch_height, + validators_info.epoch_start_height, + &validators_info, + ) + .await?; + + db_manager + .update_epoch_end_height(stats_epoch_id, next_epoch_id) + .await?; + Ok(()) + } + } else { + // If stats_current_epoch_id is None, we don't need handle it + Ok(()) + } +} + +/// This function will iterate over all StateChangesWithCauseViews in order to collect +/// a single StateChangesWithCauseView for a unique account and unique change kind, and unique key. +/// The reasoning behind this is that in a single Block (StreamerMessage) there might be a bunch of +/// changes to the same change kind to the same account to the same key (state key or public key) and +/// we want to ensure we store the very last of them. +/// It's impossible to achieve it with handling all of them one by one asynchronously (they might be handled +/// in any order) so it's easier for us to skip all the changes except the latest one. +#[cfg_attr( + feature = "tracing-instrumentation", + tracing::instrument(skip(streamer_message, db_manager)) +)] +async fn handle_state_changes( + streamer_message: near_indexer::StreamerMessage, + db_manager: &(impl database::StateIndexerDbManager + Sync + Send + 'static), + block_height: u64, + block_hash: CryptoHash, + indexer_config: &configuration::NearStateIndexerConfig, +) -> anyhow::Result> { + let mut state_changes_to_store = + std::collections::HashMap::::new(); + + let initial_state_changes = streamer_message + .shards + .into_iter() + .flat_map(|shard| shard.state_changes.into_iter()); + + // Collecting a unique list of StateChangeWithCauseView for account_id + change kind + suffix + // by overwriting the records in the HashMap + for state_change in initial_state_changes { + if !indexer_config.state_should_be_indexed(&state_change.value) { + continue; + }; + let key = match &state_change.value { + StateChangeValueView::DataUpdate { + account_id, key, .. + } + | StateChangeValueView::DataDeletion { account_id, key } => { + // returning a hex-encoded key to ensure we store data changes to the key + // (if there is more than one change to the same key) + let key: &[u8] = key.as_ref(); + format!("{}_data_{}", account_id.as_str(), hex::encode(key)) + } + StateChangeValueView::AccessKeyUpdate { + account_id, + public_key, + .. + } + | StateChangeValueView::AccessKeyDeletion { + account_id, + public_key, + } => { + // returning a hex-encoded key to ensure we store data changes to the key + // (if there is more than one change to the same key) + let data_key = borsh::to_vec(&public_key)?; + format!( + "{}_access_key_{}", + account_id.as_str(), + hex::encode(data_key) + ) + } + // ContractCode and Account changes is not separate-able by any key, we can omit the suffix + StateChangeValueView::ContractCodeUpdate { account_id, .. } + | StateChangeValueView::ContractCodeDeletion { account_id } => { + format!("{}_contract", account_id.as_str()) + } + StateChangeValueView::AccountUpdate { account_id, .. } + | StateChangeValueView::AccountDeletion { account_id } => { + format!("{}_account", account_id.as_str()) + } + }; + // This will override the previous record for this account_id + state change kind + suffix + state_changes_to_store.insert(key, state_change); + } + + // Asynchronous storing of StateChangeWithCauseView into the storage. + let futures = state_changes_to_store + .into_values() + .map(|state_change_with_cause| { + db_manager.save_state_change(state_change_with_cause, block_height, block_hash) + }); + + futures::future::try_join_all(futures).await +} + +#[actix_web::main] +async fn main() -> anyhow::Result<()> { + configuration::init_tracing(INDEXER).await?; + // We use it to automatically search the for root certificates to perform HTTPS calls + // (sending telemetry and downloading genesis) + openssl_probe::init_ssl_cert_env_vars(); + let opts: Opts = Opts::parse(); + let home_dir = opts.home.unwrap_or_else(near_indexer::get_default_home); + + match opts.subcmd { + configs::SubCommand::Run => run(home_dir).await?, + configs::SubCommand::Init(init_config) => { + near_indexer::indexer_init_configs(&home_dir, init_config.into())? + } + }; + Ok(()) +} + +async fn run(home_dir: std::path::PathBuf) -> anyhow::Result<()> { + let state_indexer_config = + configuration::read_configuration::().await?; + + #[cfg(feature = "scylla_db")] + let db_manager = database::prepare_db_manager::< + database::scylladb::state_indexer::ScyllaDBManager, + >(&state_indexer_config.database) + .await?; + + #[cfg(all(feature = "postgres_db", not(feature = "scylla_db")))] + let db_manager = database::prepare_db_manager::< + database::postgres::state_indexer::PostgresDBManager, + >(&state_indexer_config.database) + .await?; + + // Initiate metrics http server + tokio::spawn( + metrics::init_server(state_indexer_config.general.metrics_server_port) + .expect("Failed to start metrics server"), + ); + + let indexer_config = near_indexer::IndexerConfig { + home_dir, + sync_mode: near_indexer::SyncModeEnum::LatestSynced, + await_for_node_synced: near_indexer::AwaitForNodeSyncedEnum::StreamWhileSyncing, + validate_genesis: true, + }; + let indexer = near_indexer::Indexer::new(indexer_config)?; + + // Regular indexer process starts here + let stream = indexer.streamer(); + let (view_client, _) = indexer.client_actors(); + + let stats = std::sync::Arc::new(tokio::sync::RwLock::new(metrics::Stats::new())); + tokio::spawn(metrics::state_logger( + std::sync::Arc::clone(&stats), + view_client.clone(), + )); + tokio::spawn(utils::optimistic_stream(view_client.clone())); + + let mut handlers = tokio_stream::wrappers::ReceiverStream::new(stream) + .map(|streamer_message| { + handle_streamer_message( + streamer_message, + &db_manager, + &view_client, + state_indexer_config.clone(), + std::sync::Arc::clone(&stats), + ) + }) + .buffer_unordered(state_indexer_config.general.concurrency); + + while let Some(_handle_message) = handlers.next().await { + if let Err(err) = _handle_message { + tracing::warn!(target: INDEXER, "{:?}", err); + } + } + drop(handlers); // close the channel so the sender will stop + + Ok(()) +} diff --git a/near-state-indexer/src/metrics.rs b/near-state-indexer/src/metrics.rs new file mode 100644 index 00000000..73b6eb4b --- /dev/null +++ b/near-state-indexer/src/metrics.rs @@ -0,0 +1,125 @@ +use actix_web::{get, App, HttpServer, Responder}; +use prometheus::{Encoder, IntCounter, IntGauge, Opts}; + +type Result = std::result::Result; + +fn try_create_int_counter(name: &str, help: &str) -> Result { + let opts = Opts::new(name, help); + let counter = IntCounter::with_opts(opts)?; + prometheus::register(Box::new(counter.clone()))?; + Ok(counter) +} + +fn try_create_int_gauge(name: &str, help: &str) -> Result { + let opts = Opts::new(name, help); + let gauge = IntGauge::with_opts(opts)?; + prometheus::register(Box::new(gauge.clone()))?; + Ok(gauge) +} + +lazy_static! { + pub(crate) static ref BLOCK_PROCESSED_TOTAL: IntCounter = try_create_int_counter( + "total_blocks_processed", + "Total number of blocks processed by indexer regardless of restarts. Used to calculate Block Processing Rate(BPS)" + ) + .unwrap(); + pub(crate) static ref LATEST_BLOCK_HEIGHT: IntGauge = try_create_int_gauge( + "latest_block_height", + "Last seen block height by indexer" + ) + .unwrap(); +} + +#[get("/metrics")] +async fn get_metrics() -> impl Responder { + let encoder = prometheus::TextEncoder::new(); + + let mut buffer = Vec::new(); + if let Err(e) = encoder.encode(&prometheus::gather(), &mut buffer) { + tracing::error!(target: crate::INDEXER, "could not encode metrics: {}", e); + }; + + match String::from_utf8(buffer.clone()) { + Ok(v) => v, + Err(e) => { + tracing::error!(target: crate::INDEXER, "custom metrics could not be from_utf8'd: {}", e); + String::default() + } + } +} + +pub(crate) fn init_server(port: u16) -> anyhow::Result { + tracing::info!(target: crate::INDEXER, "Starting metrics server on http://0.0.0.0:{port}/metrics"); + + Ok(HttpServer::new(|| App::new().service(get_metrics)) + .bind(("0.0.0.0", port))? + .disable_signals() + .run()) +} + +#[derive(Debug, Clone)] +pub struct Stats { + pub block_heights_processing: std::collections::BTreeSet, + pub blocks_processed_count: u64, + pub last_processed_block_height: u64, + pub current_epoch_id: Option, + pub current_epoch_height: u64, +} + +impl Stats { + pub fn new() -> Self { + Self { + block_heights_processing: std::collections::BTreeSet::new(), + blocks_processed_count: 0, + last_processed_block_height: 0, + current_epoch_id: None, + current_epoch_height: 0, + } + } +} + +pub async fn state_logger( + stats: std::sync::Arc>, + view_client: actix::Addr, +) { + let interval_secs = 10; + let mut prev_blocks_processed_count: u64 = 0; + + loop { + tokio::time::sleep(std::time::Duration::from_secs(interval_secs)).await; + let stats_lock = stats.read().await; + + let block_processing_speed: f64 = ((stats_lock.blocks_processed_count + - prev_blocks_processed_count) as f64) + / (interval_secs as f64); + + let time_to_catch_the_tip_duration = if block_processing_speed > 0.0 { + if let Ok(block_height) = crate::utils::fetch_latest_block(&view_client).await { + Some(std::time::Duration::from_millis( + (((block_height - stats_lock.last_processed_block_height) as f64 + / block_processing_speed) + * 1000f64) as u64, + )) + } else { + None + } + } else { + None + }; + + tracing::info!( + target: crate::INDEXER, + "# {} | Blocks processing: {}| Blocks done: {}. Bps {:.2} b/s {}", + stats_lock.last_processed_block_height, + stats_lock.block_heights_processing.len(), + stats_lock.blocks_processed_count, + block_processing_speed, + if let Some(duration) = time_to_catch_the_tip_duration { + format!(" | {} to catch up the tip", humantime::format_duration(duration)) + } else { + "".to_string() + } + ); + prev_blocks_processed_count = stats_lock.blocks_processed_count; + } +} diff --git a/near-state-indexer/src/utils.rs b/near-state-indexer/src/utils.rs new file mode 100644 index 00000000..a54fe32b --- /dev/null +++ b/near-state-indexer/src/utils.rs @@ -0,0 +1,77 @@ +use near_o11y::WithSpanContextExt; + +pub(crate) async fn fetch_epoch_validators_info( + epoch_id: near_indexer::near_primitives::hash::CryptoHash, + client: &actix::Addr, +) -> anyhow::Result { + Ok(client + .send( + near_client::GetValidatorInfo { + epoch_reference: near_indexer::near_primitives::types::EpochReference::EpochId( + near_indexer::near_primitives::types::EpochId(epoch_id), + ), + } + .with_span_context(), + ) + .await??) +} + +const INTERVAL: std::time::Duration = std::time::Duration::from_millis(500); + +/// Fetches the status to retrieve `latest_block_height` to determine if we need to fetch +/// entire block or we already fetched this block. +pub(crate) async fn fetch_latest_block( + client: &actix::Addr, +) -> anyhow::Result { + let block = client + .send( + near_client::GetBlock( + near_indexer::near_primitives::types::BlockReference::Finality( + near_indexer::near_primitives::types::Finality::Final, + ), + ) + .with_span_context(), + ) + .await??; + Ok(block.header.height) +} + +pub(crate) async fn fetch_optimistic_block( + client: &actix::Addr, +) -> anyhow::Result { + Ok(client + .send(near_client::GetBlock::latest().with_span_context()) + .await??) +} + +pub async fn optimistic_stream(view_client: actix::Addr) { + tracing::info!(target: crate::INDEXER, "Starting Optimistic Streamer..."); + let mut optimistic_block_height: Option = None; + loop { + tokio::time::sleep(INTERVAL).await; + if let Ok(block) = fetch_optimistic_block(&view_client).await { + let height = block.header.height; + if let Some(block_height) = optimistic_block_height { + if height <= block_height { + continue; + } else { + optimistic_block_height = Some(height); + } + }; + let response = near_indexer::build_streamer_message(&view_client, block).await; + match response { + Ok(streamer_message) => { + // TODO: implement handling of streamer message for optimistic block + tracing::info!(target: crate::INDEXER, "Optimistic block {:#?}", &streamer_message.block.header.height); + } + Err(err) => { + tracing::error!( + target: crate::INDEXER, + "Missing data, skipping block #{}...", height + ); + tracing::error!(target: crate::INDEXER, "{:#?}", err); + } + } + }; + } +} diff --git a/perf-testing/src/main.rs b/perf-testing/src/main.rs index c45a88c5..2440dce3 100644 --- a/perf-testing/src/main.rs +++ b/perf-testing/src/main.rs @@ -71,7 +71,7 @@ async fn test(rpc_url: &http::Uri, name: &str, queries_count: usize) -> Vec Cargo.toml.new && mv Cargo.toml.new Cargo.toml +RUN sed '/perf-testing/d; /state-indexer/d; /tx-indexer/d; /epoch-indexer/d; /near-state-indexer/d' Cargo.toml > Cargo.toml.new && mv Cargo.toml.new Cargo.toml COPY rpc-server/Cargo.toml rpc-server/Cargo.toml COPY configuration configuration COPY database database diff --git a/rpc-server/src/config.rs b/rpc-server/src/config.rs index fc6a1b38..ebd899c6 100644 --- a/rpc-server/src/config.rs +++ b/rpc-server/src/config.rs @@ -156,7 +156,7 @@ impl ServerContext { max_gas_burnt: rpc_server_config.general.max_gas_burnt, shadow_data_consistency_rate: rpc_server_config.general.shadow_data_consistency_rate, server_port: rpc_server_config.general.server_port, - boot_time_seconds: near_primitives::static_clock::StaticClock::utc().timestamp(), + boot_time_seconds: chrono::Utc::now().timestamp(), version: near_primitives::version::Version { version: NEARD_VERSION.to_string(), build: NEARD_BUILD.to_string(), diff --git a/rpc-server/src/modules/network/methods.rs b/rpc-server/src/modules/network/methods.rs index 0a472040..87086e56 100644 --- a/rpc-server/src/modules/network/methods.rs +++ b/rpc-server/src/modules/network/methods.rs @@ -1,7 +1,6 @@ +use actix_web::cookie::time; use jsonrpc_v2::{Data, Params}; -use near_primitives::utils::from_timestamp; - use crate::config::ServerContext; use crate::errors::RPCError; use crate::modules::blocks::utils::fetch_block_from_cache_or_get; @@ -55,14 +54,20 @@ pub async fn status( latest_block_hash: final_block_info.final_block_cache.block_hash, latest_block_height: final_block_info.final_block_cache.block_height, latest_state_root: final_block_info.final_block_cache.state_root, - latest_block_time: from_timestamp(final_block_info.final_block_cache.block_timestamp), + latest_block_time: time::OffsetDateTime::from_unix_timestamp_nanos( + final_block_info.final_block_cache.block_timestamp as i128, + ) + .expect("Failed to parse timestamp"), // Always false because read_node is not need to sync syncing: false, earliest_block_hash: Some(data.genesis_info.genesis_block_cache.block_hash), earliest_block_height: Some(data.genesis_info.genesis_block_cache.block_height), - earliest_block_time: Some(from_timestamp( - data.genesis_info.genesis_block_cache.block_timestamp, - )), + earliest_block_time: Some( + time::OffsetDateTime::from_unix_timestamp_nanos( + data.genesis_info.genesis_block_cache.block_timestamp as i128, + ) + .expect("Failed to parse timestamp"), + ), epoch_id: Some(near_primitives::types::EpochId( final_block_info.final_block_cache.epoch_id, )), @@ -74,8 +79,7 @@ pub async fn status( node_public_key: near_crypto::PublicKey::empty(near_crypto::KeyType::ED25519), node_key: None, // return uptime current read_node - uptime_sec: near_primitives::static_clock::StaticClock::utc().timestamp() - - data.boot_time_seconds, + uptime_sec: chrono::Utc::now().timestamp() - data.boot_time_seconds, // Not using for status method detailed_debug_status: None, }) diff --git a/rpc-server/src/modules/queries/mod.rs b/rpc-server/src/modules/queries/mod.rs index a57d0430..4decf005 100644 --- a/rpc-server/src/modules/queries/mod.rs +++ b/rpc-server/src/modules/queries/mod.rs @@ -142,14 +142,40 @@ impl near_vm_runner::logic::External for CodeStorage { Ok(self.validators.values().sum()) } - fn create_receipt( + fn create_action_receipt( &mut self, _receipt_indices: Vec, _receiver_id: near_primitives::types::AccountId, ) -> Result { Err(near_vm_runner::logic::VMLogicError::HostError( near_vm_runner::logic::HostError::ProhibitedInView { - method_name: String::from("create_receipt"), + method_name: String::from("create_action_receipt"), + }, + )) + } + + fn create_promise_yield_receipt( + &mut self, + _receiver_id: near_primitives::types::AccountId, + ) -> Result<( + near_vm_runner::logic::types::ReceiptIndex, + near_indexer_primitives::CryptoHash, + )> { + Err(near_vm_runner::logic::VMLogicError::HostError( + near_vm_runner::logic::HostError::ProhibitedInView { + method_name: String::from("create_promise_yield_receipt"), + }, + )) + } + + fn submit_promise_resume_data( + &mut self, + _data_id: near_indexer_primitives::CryptoHash, + _data: Vec, + ) -> Result { + Err(near_vm_runner::logic::VMLogicError::HostError( + near_vm_runner::logic::HostError::ProhibitedInView { + method_name: String::from("submit_promise_resume_data"), }, )) } diff --git a/rust-toolchain b/rust-toolchain index 7c7053aa..32a6ce3c 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.75.0 +1.76.0 diff --git a/state-indexer/Cargo.toml b/state-indexer/Cargo.toml index db8297f3..6aa108b7 100644 --- a/state-indexer/Cargo.toml +++ b/state-indexer/Cargo.toml @@ -26,14 +26,15 @@ tokio = { version = "1.36.0", features = [ ] } tokio-stream = "0.1" tracing = "0.1.34" -configuration = { path = "../configuration" } -database = { path = "../database" } -epoch-indexer = { path = "../epoch-indexer" } -near-primitives = "0.20.0" -near-indexer-primitives = "0.20.0" -near-jsonrpc-client = "0.8.0" -near-lake-framework = "0.7.7" +configuration.workspace = true +database.workspace = true +epoch-indexer.workspace = true + +near-primitives.workspace = true +near-indexer-primitives.workspace = true +near-jsonrpc-client.workspace = true +near-lake-framework.workspace = true [features] default = ["scylla_db"] diff --git a/state-indexer/Dockerfile b/state-indexer/Dockerfile index 52973170..74ef9fef 100644 --- a/state-indexer/Dockerfile +++ b/state-indexer/Dockerfile @@ -1,11 +1,11 @@ -FROM rust:1.75 AS builder +FROM rust:1.76 AS builder ARG features="default" WORKDIR /tmp/ COPY Cargo.lock ./ COPY Cargo.toml ./ COPY config.toml ./ -RUN sed '/perf-testing/d; /rpc-server/d; /tx-indexer/d' Cargo.toml > Cargo.toml.new && mv Cargo.toml.new Cargo.toml +RUN sed '/perf-testing/d; /rpc-server/d; /tx-indexer/d; /near-state-indexer/d' Cargo.toml > Cargo.toml.new && mv Cargo.toml.new Cargo.toml COPY state-indexer/Cargo.toml state-indexer/Cargo.toml COPY configuration configuration COPY database database diff --git a/state-indexer/src/main.rs b/state-indexer/src/main.rs index 608eaad4..48e38c15 100644 --- a/state-indexer/src/main.rs +++ b/state-indexer/src/main.rs @@ -4,7 +4,6 @@ use futures::StreamExt; use crate::configs::Opts; use near_indexer_primitives::views::StateChangeValueView; use near_indexer_primitives::CryptoHash; -use near_primitives::account::Account; mod configs; mod metrics; @@ -44,7 +43,7 @@ async fn handle_streamer_message( rpc_client, db_manager, ); - let handle_block_future = handle_block( + let handle_block_future = db_manager.save_block( block_height, block_hash, streamer_message @@ -53,7 +52,6 @@ async fn handle_streamer_message( .iter() .map(|chunk| (chunk.chunk_hash.to_string(), chunk.shard_id, chunk.height_included)) .collect(), - db_manager, ); let handle_state_change_future = handle_state_changes(streamer_message, db_manager, block_height, block_hash, &indexer_config); @@ -89,20 +87,6 @@ async fn handle_streamer_message( Ok(()) } -#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(db_manager)))] -async fn handle_block( - block_height: u64, - block_hash: CryptoHash, - chunks: Vec<(database::primitives::ChunkHash, database::primitives::ShardId, database::primitives::HeightIncluded)>, - db_manager: &(impl database::StateIndexerDbManager + Sync + Send + 'static), -) -> anyhow::Result<()> { - let add_block_future = db_manager.add_block(block_height, block_hash); - let add_chunks_future = db_manager.add_chunks(block_height, chunks); - - futures::try_join!(add_block_future, add_chunks_future)?; - Ok(()) -} - #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(db_manager)))] async fn handle_epoch( stats_current_epoch_id: Option, @@ -189,90 +173,13 @@ async fn handle_state_changes( } // Asynchronous storing of StateChangeWithCauseView into the storage. - let futures = state_changes_to_store.into_values().map(|state_change_with_cause| { - store_state_change(state_change_with_cause, db_manager, block_height, block_hash) - }); + let futures = state_changes_to_store + .into_values() + .map(|state_change_with_cause| db_manager.save_state_change(state_change_with_cause, block_height, block_hash)); futures::future::try_join_all(futures).await } -#[cfg_attr( - feature = "tracing-instrumentation", - tracing::instrument(skip(state_change, db_manager)) -)] -async fn store_state_change( - state_change: near_indexer_primitives::views::StateChangeWithCauseView, - db_manager: &(impl database::StateIndexerDbManager + Sync + Send + 'static), - block_height: u64, - block_hash: CryptoHash, -) -> anyhow::Result<()> { - match state_change.value { - StateChangeValueView::DataUpdate { account_id, key, value } => { - db_manager - .add_state_changes(account_id, block_height, block_hash, key.as_ref(), value.as_ref()) - .await? - } - StateChangeValueView::DataDeletion { account_id, key } => { - db_manager - .delete_state_changes(account_id, block_height, block_hash, key.as_ref()) - .await? - } - StateChangeValueView::AccessKeyUpdate { - account_id, - public_key, - access_key, - } => { - let data_key = borsh::to_vec(&public_key)?; - let data_value = borsh::to_vec(&access_key)?; - let add_access_key_future = - db_manager.add_access_key(account_id.clone(), block_height, block_hash, &data_key, &data_value); - - #[cfg(feature = "account_access_keys")] - { - let add_account_access_keys_future = - db_manager.add_account_access_keys(account_id, block_height, &data_key, Some(&data_value)); - futures::try_join!(add_access_key_future, add_account_access_keys_future)?; - } - #[cfg(not(feature = "account_access_keys"))] - add_access_key_future.await?; - } - StateChangeValueView::AccessKeyDeletion { account_id, public_key } => { - let data_key = borsh::to_vec(&public_key)?; - let delete_access_key_future = - db_manager.delete_access_key(account_id.clone(), block_height, block_hash, &data_key); - - #[cfg(feature = "account_access_keys")] - { - let delete_account_access_keys_future = - db_manager.add_account_access_keys(account_id, block_height, &data_key, None); - futures::try_join!(delete_access_key_future, delete_account_access_keys_future)?; - } - #[cfg(not(feature = "account_access_keys"))] - delete_access_key_future.await?; - } - StateChangeValueView::ContractCodeUpdate { account_id, code } => { - db_manager - .add_contract_code(account_id, block_height, block_hash, code.as_ref()) - .await? - } - StateChangeValueView::ContractCodeDeletion { account_id } => { - db_manager - .delete_contract_code(account_id, block_height, block_hash) - .await? - } - StateChangeValueView::AccountUpdate { account_id, account } => { - let value = borsh::to_vec(&Account::from(account))?; - db_manager - .add_account(account_id, block_height, block_hash, value) - .await? - } - StateChangeValueView::AccountDeletion { account_id } => { - db_manager.delete_account(account_id, block_height, block_hash).await? - } - } - Ok(()) -} - #[tokio::main] async fn main() -> anyhow::Result<()> { // We use it to automatically search the for root certificates to perform HTTPS calls diff --git a/tx-indexer/Cargo.toml b/tx-indexer/Cargo.toml index 1657834d..7753329f 100644 --- a/tx-indexer/Cargo.toml +++ b/tx-indexer/Cargo.toml @@ -25,13 +25,13 @@ tokio = { version = "1.36.0", features = [ tokio-stream = "0.1.12" tracing = "0.1.34" -configuration = { path = "../configuration" } -database = { path = "../database" } -readnode-primitives = { path = "../readnode-primitives" } +configuration.workspace = true +database.workspace = true +readnode-primitives.workspace = true -near-indexer-primitives = "0.20.0" -near-jsonrpc-client = "0.8.0" -near-lake-framework = "0.7.7" +near-indexer-primitives.workspace = true +near-jsonrpc-client.workspace = true +near-lake-framework.workspace = true [features] default = ["scylla_db"] diff --git a/tx-indexer/Dockerfile b/tx-indexer/Dockerfile index a3460751..f495f4f3 100644 --- a/tx-indexer/Dockerfile +++ b/tx-indexer/Dockerfile @@ -1,11 +1,11 @@ -FROM rust:1.75 AS builder +FROM rust:1.76 AS builder ARG features="default" WORKDIR /tmp/ COPY Cargo.lock ./ COPY Cargo.toml ./ COPY config.toml ./ -RUN sed '/perf-testing/d; /rpc-server/d; /state-indexer/d; /epoch-indexer/d' Cargo.toml > Cargo.toml.new && mv Cargo.toml.new Cargo.toml +RUN sed '/perf-testing/d; /rpc-server/d; /state-indexer/d; /epoch-indexer/d; /near-state-indexer/d' Cargo.toml > Cargo.toml.new && mv Cargo.toml.new Cargo.toml COPY tx-indexer/Cargo.toml tx-indexer/Cargo.toml COPY configuration configuration COPY database database From 4ac79d848af7d2ca189197a82c7e6644e653def9 Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Tue, 12 Mar 2024 11:51:11 +0200 Subject: [PATCH 3/8] Implement support for optimistic block finality (#197) * add optimistic handler * handle optimistic block * update nearcore * optimistiv block handle * add redis client clone * reffactoring * run with optimistic improvement * naming improvement --- Cargo.lock | 231 +++++++---- Cargo.toml | 24 +- config.toml | 1 + configuration/example.config.toml | 5 + configuration/src/configs/general.rs | 10 + database/src/base/state_indexer.rs | 33 +- near-state-indexer/Cargo.toml | 2 + near-state-indexer/src/main.rs | 27 +- near-state-indexer/src/utils.rs | 36 +- rpc-server/Cargo.toml | 2 + rpc-server/src/config.rs | 22 +- rpc-server/src/health.rs | 5 +- rpc-server/src/main.rs | 30 +- rpc-server/src/modules/blocks/methods.rs | 173 +++++--- rpc-server/src/modules/blocks/mod.rs | 285 ++++++++++++- rpc-server/src/modules/blocks/utils.rs | 40 +- rpc-server/src/modules/network/methods.rs | 34 +- rpc-server/src/modules/queries/methods.rs | 471 ++++++++++++++++++---- rpc-server/src/modules/queries/mod.rs | 77 +++- rpc-server/src/modules/queries/utils.rs | 85 ++-- rpc-server/src/utils.rs | 160 ++++++-- state-indexer/src/main.rs | 10 +- 22 files changed, 1355 insertions(+), 408 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d31e6bdc..fffeac43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -169,7 +169,7 @@ dependencies = [ "futures-core", "futures-util", "mio", - "socket2", + "socket2 0.5.6", "tokio", "tracing", ] @@ -251,7 +251,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "smallvec", - "socket2", + "socket2 0.5.6", "time", "url", ] @@ -1233,9 +1233,9 @@ checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "bytecheck" @@ -1328,9 +1328,9 @@ checksum = "a2698f953def977c68f935bb0dfa959375ad4638570e969e2f1e9f433cbf1af6" [[package]] name = "cc" -version = "1.0.89" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ba8f7aaa012f30d5b2861462f6708eccd49c3c39863fe083a308035f63d723" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ "jobserver", "libc", @@ -1400,9 +1400,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" dependencies = [ "clap_builder", "clap_derive", @@ -1410,9 +1410,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -1476,6 +1476,20 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +dependencies = [ + "bytes", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "tokio-util 0.7.10", +] + [[package]] name = "concurrent-queue" version = "2.4.0" @@ -1863,7 +1877,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "socket2", + "socket2 0.5.6", "windows-sys 0.52.0", ] @@ -2482,7 +2496,7 @@ dependencies = [ "database", "near-chain-configs 0.0.0", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3)", "near-lake-framework", "readnode-primitives", "tokio", @@ -2497,9 +2511,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "erased-serde" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388979d208a049ffdfb22fa33b9c81942215b940910bccfe258caeb25d125cb3" +checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" dependencies = [ "serde", ] @@ -3079,7 +3093,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.6", "tokio", "tower-service", "tracing", @@ -3778,7 +3792,7 @@ dependencies = [ [[package]] name = "near-async" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "derive_more", @@ -3796,7 +3810,7 @@ dependencies = [ [[package]] name = "near-async-derive" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "proc-macro2", "quote", @@ -3806,7 +3820,7 @@ dependencies = [ [[package]] name = "near-cache" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "lru 0.7.8", ] @@ -3814,7 +3828,7 @@ dependencies = [ [[package]] name = "near-chain" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "assert_matches", @@ -3860,7 +3874,7 @@ dependencies = [ [[package]] name = "near-chain-configs" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "anyhow", "bytesize", @@ -3908,7 +3922,7 @@ dependencies = [ [[package]] name = "near-chain-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "near-async", "near-crypto 0.0.0", @@ -3921,7 +3935,7 @@ dependencies = [ [[package]] name = "near-chunks" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "borsh 1.3.1", @@ -3954,7 +3968,7 @@ dependencies = [ [[package]] name = "near-chunks-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "near-chain-primitives", "near-primitives 0.0.0", @@ -3963,7 +3977,7 @@ dependencies = [ [[package]] name = "near-client" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "actix-rt", @@ -4019,7 +4033,7 @@ dependencies = [ [[package]] name = "near-client-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "chrono", @@ -4041,7 +4055,7 @@ dependencies = [ [[package]] name = "near-config-utils" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "anyhow", "json_comments", @@ -4064,7 +4078,7 @@ dependencies = [ [[package]] name = "near-crypto" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "blake2", "borsh 1.3.1", @@ -4115,7 +4129,7 @@ dependencies = [ [[package]] name = "near-dyn-configs" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "anyhow", "near-async", @@ -4134,7 +4148,7 @@ dependencies = [ [[package]] name = "near-epoch-manager" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "borsh 1.3.1", "itertools 0.10.5", @@ -4157,7 +4171,7 @@ dependencies = [ [[package]] name = "near-fmt" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "near-primitives-core 0.0.0", ] @@ -4174,7 +4188,7 @@ dependencies = [ [[package]] name = "near-indexer" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "anyhow", @@ -4202,7 +4216,7 @@ dependencies = [ [[package]] name = "near-indexer-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "near-primitives 0.0.0", "serde", @@ -4212,7 +4226,7 @@ dependencies = [ [[package]] name = "near-jsonrpc" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "actix-cors 0.6.5", @@ -4244,7 +4258,7 @@ dependencies = [ [[package]] name = "near-jsonrpc-client" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix-http", "awc", @@ -4277,7 +4291,7 @@ dependencies = [ [[package]] name = "near-jsonrpc-client" version = "0.8.0" -source = "git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1#f6c6c41b48c764508365a8de717fda4364ed539c" +source = "git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3#8f0c9ce3ad0f701a270a852cddccf016c78adfd4" dependencies = [ "borsh 1.3.1", "lazy_static", @@ -4295,7 +4309,7 @@ dependencies = [ [[package]] name = "near-jsonrpc-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "arbitrary", "near-chain-configs 0.0.0", @@ -4328,7 +4342,7 @@ dependencies = [ [[package]] name = "near-lake-framework" version = "0.0.0" -source = "git+https://github.com/kobayurii/near-lake-framework-rs.git?branch=0.7.8#433197168b2bcd73b83e053e26fd367008c6721b" +source = "git+https://github.com/kobayurii/near-lake-framework-rs.git?branch=0.7.10#642f3021dcb9757827eef376b1680835efa7f8ce" dependencies = [ "anyhow", "async-stream", @@ -4352,7 +4366,7 @@ dependencies = [ [[package]] name = "near-mainnet-res" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "near-account-id", "near-chain-configs 0.0.0", @@ -4363,7 +4377,7 @@ dependencies = [ [[package]] name = "near-network" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "anyhow", @@ -4412,7 +4426,7 @@ dependencies = [ [[package]] name = "near-o11y" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "base64 0.21.7", @@ -4465,7 +4479,7 @@ dependencies = [ [[package]] name = "near-parameters" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "borsh 1.3.1", "enum-map", @@ -4501,7 +4515,7 @@ dependencies = [ [[package]] name = "near-performance-metrics" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "bitflags 1.3.2", @@ -4517,7 +4531,7 @@ dependencies = [ [[package]] name = "near-performance-metrics-macros" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "quote", "syn 2.0.52", @@ -4526,7 +4540,7 @@ dependencies = [ [[package]] name = "near-pool" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "borsh 1.3.1", "near-crypto 0.0.0", @@ -4539,7 +4553,7 @@ dependencies = [ [[package]] name = "near-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "arbitrary", "base64 0.21.7", @@ -4622,7 +4636,7 @@ dependencies = [ [[package]] name = "near-primitives-core" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "arbitrary", "base64 0.21.7", @@ -4663,7 +4677,7 @@ dependencies = [ [[package]] name = "near-rosetta-rpc" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "actix-cors 0.6.5", @@ -4694,7 +4708,7 @@ dependencies = [ [[package]] name = "near-rpc-error-core" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "quote", "serde", @@ -4715,7 +4729,7 @@ dependencies = [ [[package]] name = "near-rpc-error-macro" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "near-rpc-error-core 0.0.0", "serde", @@ -4754,6 +4768,8 @@ dependencies = [ "near-o11y 0.0.0", "openssl-probe", "prometheus", + "redis", + "serde_json", "tokio", "tokio-stream", "tracing", @@ -4762,7 +4778,7 @@ dependencies = [ [[package]] name = "near-stdx" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" [[package]] name = "near-stdx" @@ -4773,7 +4789,7 @@ checksum = "855fd5540e3b4ff6fedf12aba2db1ee4b371b36f465da1363a6d022b27cb43b8" [[package]] name = "near-store" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "actix-rt", @@ -4815,7 +4831,7 @@ dependencies = [ [[package]] name = "near-telemetry" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "awc", @@ -4834,7 +4850,7 @@ dependencies = [ [[package]] name = "near-vm-compiler" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "enumset", "finite-wasm", @@ -4850,7 +4866,7 @@ dependencies = [ [[package]] name = "near-vm-compiler-singlepass" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "dynasm 2.0.0", "dynasmrt 2.0.0", @@ -4871,11 +4887,10 @@ dependencies = [ [[package]] name = "near-vm-engine" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "backtrace", "cfg-if 1.0.0", - "crossbeam-queue", "enumset", "finite-wasm", "lazy_static", @@ -4895,7 +4910,7 @@ dependencies = [ [[package]] name = "near-vm-runner" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "anyhow", "base64 0.21.7", @@ -4974,7 +4989,7 @@ dependencies = [ [[package]] name = "near-vm-types" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "indexmap 1.9.3", "num-traits", @@ -4985,7 +5000,7 @@ dependencies = [ [[package]] name = "near-vm-vm" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "backtrace", "cc", @@ -5006,7 +5021,7 @@ dependencies = [ [[package]] name = "near-wallet-contract" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "anyhow", "near-vm-runner 0.0.0", @@ -5015,7 +5030,7 @@ dependencies = [ [[package]] name = "nearcore" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "actix", "actix-rt", @@ -5104,7 +5119,7 @@ dependencies = [ [[package]] name = "node-runtime" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=6216a118cc3833d916723b9724b9d747c3c4c563#6216a118cc3833d916723b9724b9d747c3c4c563" +source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" dependencies = [ "borsh 1.3.1", "hex", @@ -6298,7 +6313,7 @@ dependencies = [ "near-chain-configs 0.0.0", "near-crypto 0.0.0", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3)", "near-jsonrpc-primitives 0.0.0", "near-lake-framework", "near-parameters 0.0.0", @@ -6307,9 +6322,10 @@ dependencies = [ "paste", "prometheus", "readnode-primitives", + "redis", "serde", "serde_json", - "sysinfo 0.30.6", + "sysinfo 0.30.7", "thiserror", "time", "tokio", @@ -6331,6 +6347,30 @@ dependencies = [ "serde_json", ] +[[package]] +name = "redis" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c580d9cbbe1d1b479e8d67cf9daf6a62c957e6846048408b80b43ac3f6af84cd" +dependencies = [ + "arc-swap", + "async-trait", + "bytes", + "combine", + "futures", + "futures-util", + "itoa", + "percent-encoding", + "pin-project-lite", + "ryu", + "sha1_smol", + "socket2 0.4.10", + "tokio", + "tokio-retry", + "tokio-util 0.7.10", + "url", +] + [[package]] name = "redox_syscall" version = "0.1.57" @@ -6452,9 +6492,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" dependencies = [ "base64 0.21.7", "bytes", @@ -6817,7 +6857,7 @@ dependencies = [ "scylla-macros", "smallvec", "snap", - "socket2", + "socket2 0.5.6", "strum 0.23.0", "strum_macros 0.23.1", "thiserror", @@ -7111,6 +7151,12 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + [[package]] name = "sha2" version = "0.10.8" @@ -7265,6 +7311,16 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b6b67fb9a61334225b5b790716f609cd58395f895b3fe8b328786812a40bc3b" +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "socket2" version = "0.5.6" @@ -7325,7 +7381,7 @@ dependencies = [ "humantime", "lazy_static", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3)", "near-lake-framework", "near-primitives 0.0.0", "openssl-probe", @@ -7487,9 +7543,9 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.30.6" +version = "0.30.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6746919caf9f2a85bff759535664c060109f21975c5ac2e8652e60102bd4d196" +checksum = "0c385888ef380a852a16209afc8cfad22795dd8873d69c9a14d2e2088f118d18" dependencies = [ "cfg-if 1.0.0", "core-foundation-sys", @@ -7502,20 +7558,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" dependencies = [ "core-foundation-sys", "libc", @@ -7684,7 +7740,7 @@ dependencies = [ "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.6", "tokio-macros", "tracing", "windows-sys 0.48.0", @@ -7753,12 +7809,23 @@ dependencies = [ "postgres-protocol", "postgres-types", "rand 0.8.5", - "socket2", + "socket2 0.5.6", "tokio", "tokio-util 0.7.10", "whoami", ] +[[package]] +name = "tokio-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand 0.8.5", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.24.1" @@ -7976,9 +8043,9 @@ dependencies = [ [[package]] name = "tracing-actix-web" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe0d5feac3f4ca21ba33496bcb1ccab58cca6412b1405ae80f0581541e0ca78" +checksum = "fa069bd1503dd526ee793bb3fce408895136c95fc86d2edb2acf1c646d7f0684" dependencies = [ "actix-web", "mutually_exclusive_features", @@ -8156,7 +8223,7 @@ dependencies = [ "humantime", "lazy_static", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.1)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3)", "near-lake-framework", "prometheus", "readnode-primitives", @@ -8905,9 +8972,9 @@ dependencies = [ [[package]] name = "whoami" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fec781d48b41f8163426ed18e8fc2864c12937df9ce54c88ede7bd47270893e" +checksum = "a44ab49fad634e88f55bf8f9bb3abd2f27d7204172a112c7c9987e01c1c94ea9" dependencies = [ "redox_syscall 0.4.1", "wasite", diff --git a/Cargo.toml b/Cargo.toml index 0e94a92b..8190ea54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,16 +27,16 @@ database = { path = "database" } readnode-primitives = { path = "readnode-primitives" } epoch-indexer = { path = "epoch-indexer" } -near-indexer = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } -near-client = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } -near-o11y = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } -near-indexer-primitives = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } -near-primitives = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } -near-chain-configs = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } -near-crypto = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } -near-jsonrpc-primitives = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } -near-parameters = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } -near-vm-runner = { git = 'https://github.com/near/nearcore.git', rev = '6216a118cc3833d916723b9724b9d747c3c4c563' } +near-indexer = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +near-client = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +near-o11y = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +near-indexer-primitives = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +near-primitives = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +near-chain-configs = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +near-crypto = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +near-jsonrpc-primitives = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +near-parameters = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +near-vm-runner = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-lake-framework = { git = 'https://github.com/kobayurii/near-lake-framework-rs.git', branch = '0.7.8' } -near-jsonrpc-client = { git = 'https://github.com/kobayurii/near-jsonrpc-client-rs.git', branch = '0.8.1'} +near-lake-framework = { git = 'https://github.com/kobayurii/near-lake-framework-rs.git', branch = '0.7.10' } +near-jsonrpc-client = { git = 'https://github.com/kobayurii/near-jsonrpc-client-rs.git', branch = '0.8.3'} diff --git a/config.toml b/config.toml index f143081c..d0d4dfb7 100644 --- a/config.toml +++ b/config.toml @@ -5,6 +5,7 @@ chain_id = "${CHAIN_ID}" near_rpc_url = "${NEAR_RPC_URL}" near_archival_rpc_url = "${ARCHIVAL_NEAR_RPC_URL}" +redis_url = "${REDIS_URL}" [general.rpc_server] referer_header_value = "${REFERER_HEADER_VALUE}" diff --git a/configuration/example.config.toml b/configuration/example.config.toml index a5c8b0cd..f15f9958 100644 --- a/configuration/example.config.toml +++ b/configuration/example.config.toml @@ -15,6 +15,11 @@ near_rpc_url = "https://beta.rpc.mainnet.near.org" ## default value is None #near_archival_rpc_url = "https://beta.rpc.mainnet.near.org" +## redis url using for pub/sub optimistic_block and finale_block +## from near_state_indexer to rpc_server +## Default value is redis://127.0.0.1/ +#redis_url = "redis://127.0.0.1/" + ### Rpc server general configuration [general.rpc_server] diff --git a/configuration/src/configs/general.rs b/configuration/src/configs/general.rs index 54947ea5..43a6f6eb 100644 --- a/configuration/src/configs/general.rs +++ b/configuration/src/configs/general.rs @@ -11,6 +11,7 @@ pub struct GeneralRpcServerConfig { pub chain_id: ChainId, pub near_rpc_url: String, pub near_archival_rpc_url: Option, + pub redis_url: String, pub referer_header_value: String, pub server_port: u16, pub max_gas_burnt: u64, @@ -43,6 +44,7 @@ pub struct GeneralStateIndexerConfig { #[derive(Debug, Clone)] pub struct GeneralNearStateIndexerConfig { pub chain_id: ChainId, + pub redis_url: String, pub metrics_server_port: u16, pub concurrency: usize, } @@ -63,6 +65,8 @@ pub struct CommonGeneralConfig { pub near_rpc_url: Option, #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] pub near_archival_rpc_url: Option, + #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] + pub redis_url: Option, #[serde(default)] pub rpc_server: CommonGeneralRpcServerConfig, #[serde(default)] @@ -278,6 +282,9 @@ impl From for GeneralRpcServerConfig { chain_id: common_config.chain_id, near_rpc_url: required_value_or_panic("near_rpc_url", common_config.near_rpc_url), near_archival_rpc_url: common_config.near_archival_rpc_url, + redis_url: common_config + .redis_url + .unwrap_or("redis://127.0.0.1/".to_string()), referer_header_value: common_config .rpc_server .referer_header_value @@ -355,6 +362,9 @@ impl From for GeneralNearStateIndexerConfig { fn from(common_config: CommonGeneralConfig) -> Self { Self { chain_id: common_config.chain_id, + redis_url: common_config + .redis_url + .unwrap_or("redis://127.0.0.1/".to_string()), metrics_server_port: common_config .near_state_indexer .metrics_server_port diff --git a/database/src/base/state_indexer.rs b/database/src/base/state_indexer.rs index 343e5b09..b355040b 100644 --- a/database/src/base/state_indexer.rs +++ b/database/src/base/state_indexer.rs @@ -144,18 +144,18 @@ pub trait StateIndexerDbManager { async fn save_state_change( &self, - state_change: near_primitives::views::StateChangeWithCauseView, + state_change: &near_primitives::views::StateChangeWithCauseView, block_height: u64, block_hash: near_indexer_primitives::CryptoHash, ) -> anyhow::Result<()> { - match state_change.value { + match &state_change.value { near_primitives::views::StateChangeValueView::DataUpdate { account_id, key, value, } => { self.add_state_changes( - account_id, + account_id.clone(), block_height, block_hash, key.as_ref(), @@ -164,8 +164,13 @@ pub trait StateIndexerDbManager { .await? } near_primitives::views::StateChangeValueView::DataDeletion { account_id, key } => { - self.delete_state_changes(account_id, block_height, block_hash, key.as_ref()) - .await? + self.delete_state_changes( + account_id.clone(), + block_height, + block_hash, + key.as_ref(), + ) + .await? } near_primitives::views::StateChangeValueView::AccessKeyUpdate { account_id, @@ -185,7 +190,7 @@ pub trait StateIndexerDbManager { #[cfg(feature = "account_access_keys")] { let add_account_access_keys_future = self.add_account_access_keys( - account_id, + account_id.clone(), block_height, &data_key, Some(&data_value), @@ -205,8 +210,12 @@ pub trait StateIndexerDbManager { #[cfg(feature = "account_access_keys")] { - let delete_account_access_keys_future = - self.add_account_access_keys(account_id, block_height, &data_key, None); + let delete_account_access_keys_future = self.add_account_access_keys( + account_id.clone(), + block_height, + &data_key, + None, + ); futures::try_join!( delete_access_key_future, delete_account_access_keys_future @@ -219,11 +228,11 @@ pub trait StateIndexerDbManager { account_id, code, } => { - self.add_contract_code(account_id, block_height, block_hash, code.as_ref()) + self.add_contract_code(account_id.clone(), block_height, block_hash, code.as_ref()) .await? } near_primitives::views::StateChangeValueView::ContractCodeDeletion { account_id } => { - self.delete_contract_code(account_id, block_height, block_hash) + self.delete_contract_code(account_id.clone(), block_height, block_hash) .await? } near_primitives::views::StateChangeValueView::AccountUpdate { @@ -231,11 +240,11 @@ pub trait StateIndexerDbManager { account, } => { let value = borsh::to_vec(&near_primitives::account::Account::from(account))?; - self.add_account(account_id, block_height, block_hash, value) + self.add_account(account_id.clone(), block_height, block_hash, value) .await? } near_primitives::views::StateChangeValueView::AccountDeletion { account_id } => { - self.delete_account(account_id, block_height, block_hash) + self.delete_account(account_id.clone(), block_height, block_hash) .await? } } diff --git a/near-state-indexer/Cargo.toml b/near-state-indexer/Cargo.toml index e4b53245..60770620 100644 --- a/near-state-indexer/Cargo.toml +++ b/near-state-indexer/Cargo.toml @@ -19,6 +19,8 @@ humantime = "2.1.0" lazy_static = "1.4.0" openssl-probe = "0.1.5" prometheus = "0.13.1" +redis = { version = "0.24.0", features = ["tokio-comp", "connection-manager"] } +serde_json = "1.0.64" tokio = { version = "1.36.0", features = [ "sync", "time", diff --git a/near-state-indexer/src/main.rs b/near-state-indexer/src/main.rs index cbf0d670..c2c802bf 100644 --- a/near-state-indexer/src/main.rs +++ b/near-state-indexer/src/main.rs @@ -17,11 +17,12 @@ pub(crate) const INDEXER: &str = "near_state_indexer"; #[cfg_attr( feature = "tracing-instrumentation", - tracing::instrument(skip(streamer_message, db_manager)) + tracing::instrument(skip(streamer_message, db_manager, redis_client)) )] async fn handle_streamer_message( streamer_message: near_indexer::StreamerMessage, db_manager: &(impl database::StateIndexerDbManager + Sync + Send + 'static), + redis_client: redis::aio::ConnectionManager, client: &actix::Addr, indexer_config: configuration::NearStateIndexerConfig, stats: std::sync::Arc>, @@ -65,17 +66,21 @@ async fn handle_streamer_message( .collect(), ); let handle_state_change_future = handle_state_changes( - streamer_message, + &streamer_message, db_manager, block_height, block_hash, &indexer_config, ); + let published_streamer_message_feature = + utils::publish_streamer_message("final_block", &streamer_message, redis_client); + futures::try_join!( handle_epoch_future, handle_block_future, handle_state_change_future, + published_streamer_message_feature, )?; metrics::BLOCK_PROCESSED_TOTAL.inc(); @@ -158,19 +163,19 @@ async fn handle_epoch( tracing::instrument(skip(streamer_message, db_manager)) )] async fn handle_state_changes( - streamer_message: near_indexer::StreamerMessage, + streamer_message: &near_indexer::StreamerMessage, db_manager: &(impl database::StateIndexerDbManager + Sync + Send + 'static), block_height: u64, block_hash: CryptoHash, indexer_config: &configuration::NearStateIndexerConfig, ) -> anyhow::Result> { let mut state_changes_to_store = - std::collections::HashMap::::new(); + std::collections::HashMap::::new(); let initial_state_changes = streamer_message .shards - .into_iter() - .flat_map(|shard| shard.state_changes.into_iter()); + .iter() + .flat_map(|shard| shard.state_changes.iter()); // Collecting a unique list of StateChangeWithCauseView for account_id + change kind + suffix // by overwriting the records in the HashMap @@ -264,6 +269,10 @@ async fn run(home_dir: std::path::PathBuf) -> anyhow::Result<()> { >(&state_indexer_config.database) .await?; + let redis_client = redis::Client::open(state_indexer_config.general.redis_url.clone())? + .get_connection_manager() + .await?; + // Initiate metrics http server tokio::spawn( metrics::init_server(state_indexer_config.general.metrics_server_port) @@ -287,13 +296,17 @@ async fn run(home_dir: std::path::PathBuf) -> anyhow::Result<()> { std::sync::Arc::clone(&stats), view_client.clone(), )); - tokio::spawn(utils::optimistic_stream(view_client.clone())); + tokio::spawn(utils::optimistic_stream( + view_client.clone(), + redis_client.clone(), + )); let mut handlers = tokio_stream::wrappers::ReceiverStream::new(stream) .map(|streamer_message| { handle_streamer_message( streamer_message, &db_manager, + redis_client.clone(), &view_client, state_indexer_config.clone(), std::sync::Arc::clone(&stats), diff --git a/near-state-indexer/src/utils.rs b/near-state-indexer/src/utils.rs index a54fe32b..047d35fc 100644 --- a/near-state-indexer/src/utils.rs +++ b/near-state-indexer/src/utils.rs @@ -44,7 +44,24 @@ pub(crate) async fn fetch_optimistic_block( .await??) } -pub async fn optimistic_stream(view_client: actix::Addr) { +pub(crate) async fn publish_streamer_message( + topic: &str, + streamer_message: &near_indexer::StreamerMessage, + redis_client: redis::aio::ConnectionManager, +) -> anyhow::Result<()> { + let json_streamer_message = serde_json::to_string(streamer_message)?; + redis::cmd("publish") + .arg(topic) + .arg(json_streamer_message) + .query_async::(&mut redis_client.clone()) + .await?; + Ok(()) +} + +pub async fn optimistic_stream( + view_client: actix::Addr, + redis_client: redis::aio::ConnectionManager, +) { tracing::info!(target: crate::INDEXER, "Starting Optimistic Streamer..."); let mut optimistic_block_height: Option = None; loop { @@ -57,12 +74,25 @@ pub async fn optimistic_stream(view_client: actix::Addr { - // TODO: implement handling of streamer message for optimistic block - tracing::info!(target: crate::INDEXER, "Optimistic block {:#?}", &streamer_message.block.header.height); + tracing::info!(target: crate::INDEXER, "Optimistic block {:?}", &optimistic_block_height); + if let Err(err) = publish_streamer_message( + "optimistic_block", + &streamer_message, + redis_client.clone(), + ) + .await + { + tracing::error!( + target: crate::INDEXER, + "Failed to publish optimistic block streamer message: {:#?}", err + ); + }; } Err(err) => { tracing::error!( diff --git a/rpc-server/Cargo.toml b/rpc-server/Cargo.toml index fec6b310..bb9398a1 100644 --- a/rpc-server/Cargo.toml +++ b/rpc-server/Cargo.toml @@ -23,6 +23,7 @@ lazy_static = "1.4.0" lru = "0.12.2" paste = "1.0.14" prometheus = "0.13.1" +redis = { version = "0.24.0", features = ["tokio-comp", "connection-manager"] } serde = { version = "1.0.145", features = ["derive"] } serde_json = "1.0.85" thiserror = "1.0.40" @@ -51,6 +52,7 @@ near-vm-runner.workspace = true [features] default = ["send_tx_methods", "scylla_db"] send_tx_methods = [] +near_state_indexer_disabled = [] # Use this feature if you don't run near-state-indexer tracing-instrumentation = ["configuration/tracing-instrumentation"] postgres_db = ["database/postgres_db"] scylla_db = ["database/scylla_db"] diff --git a/rpc-server/src/config.rs b/rpc-server/src/config.rs index ebd899c6..c9c9bc5b 100644 --- a/rpc-server/src/config.rs +++ b/rpc-server/src/config.rs @@ -1,12 +1,14 @@ -use crate::modules::blocks::{CacheBlock, FinalBlockInfo}; -use futures::executor::block_on; use std::string::ToString; +use futures::executor::block_on; + +use crate::modules::blocks::{BlocksInfoByFinality, CacheBlock}; + // TODO: Improve versioning in future. // For now, it's hardcoded and should be updated manually at each release.. -static NEARD_VERSION: &str = "1.37.0"; -static NEARD_BUILD: &str = "1.37.0"; -static RUSTC_VERSION: &str = "1.75.0"; +static NEARD_VERSION: &str = "1.37.1"; +static NEARD_BUILD: &str = "1.37.1"; +static RUSTC_VERSION: &str = "1.76.0"; // Struct to store genesis_config and genesis_block in the server context // Fetch once genesis info on start of the server and put it in the context @@ -40,7 +42,7 @@ impl GenesisInfo { Self { genesis_config, - genesis_block_cache: genesis_block.into(), + genesis_block_cache: CacheBlock::from(&genesis_block), } } } @@ -61,7 +63,7 @@ pub struct ServerContext { pub blocks_cache: std::sync::Arc>>, /// Final block info include final_block_cache and current_validators_info - pub final_block_info: std::sync::Arc>, + pub blocks_info_by_finality: std::sync::Arc>, /// Cache to store compiled contract codes pub compiled_contract_code_cache: std::sync::Arc, /// Cache to store contract codes @@ -118,8 +120,8 @@ impl ServerContext { )), }); - let final_block_info = std::sync::Arc::new(futures_locks::RwLock::new( - FinalBlockInfo::new(&near_rpc_client, &blocks_cache).await, + let blocks_info_by_finality = std::sync::Arc::new(futures_locks::RwLock::new( + BlocksInfoByFinality::new(&near_rpc_client, &blocks_cache).await, )); let s3_client = rpc_server_config.lake_config.lake_s3_client().await; @@ -150,7 +152,7 @@ impl ServerContext { near_rpc_client, s3_bucket_name: rpc_server_config.lake_config.aws_bucket_name.clone(), blocks_cache, - final_block_info, + blocks_info_by_finality, compiled_contract_code_cache, contract_code_cache, max_gas_burnt: rpc_server_config.general.max_gas_burnt, diff --git a/rpc-server/src/health.rs b/rpc-server/src/health.rs index eddbbf4f..e7728aaa 100644 --- a/rpc-server/src/health.rs +++ b/rpc-server/src/health.rs @@ -50,10 +50,11 @@ impl RPCHealthStatusResponse { ), final_block_height: server_context - .final_block_info + .blocks_info_by_finality .read() .await - .final_block_cache + .final_block + .block_cache .block_height, } } diff --git a/rpc-server/src/main.rs b/rpc-server/src/main.rs index c5689a38..045d088b 100644 --- a/rpc-server/src/main.rs +++ b/rpc-server/src/main.rs @@ -1,8 +1,6 @@ use actix_web::dev::Service; use jsonrpc_v2::{Data, Server}; -use crate::utils::update_final_block_height_regularly; - #[macro_use] extern crate lazy_static; @@ -39,17 +37,39 @@ async fn main() -> anyhow::Result<()> { config::ServerContext::init(rpc_server_config.clone(), near_rpc_client.clone()).await?; let blocks_cache = std::sync::Arc::clone(&server_context.blocks_cache); - let final_block_info = std::sync::Arc::clone(&server_context.final_block_info); + let blocks_info_by_finality = std::sync::Arc::clone(&server_context.blocks_info_by_finality); + + #[cfg(feature = "near_state_indexer_disabled")] tokio::spawn(async move { - update_final_block_height_regularly( + utils::update_final_block_regularly( blocks_cache, - final_block_info, + blocks_info_by_finality, rpc_server_config, near_rpc_client, ) .await }); + #[cfg(not(feature = "near_state_indexer_disabled"))] + { + let redis_client = redis::Client::open(rpc_server_config.general.redis_url.clone())?; + let redis_client_clone = redis_client.clone(); + tokio::spawn(async move { + utils::update_final_block_regularly( + blocks_cache, + blocks_info_by_finality, + redis_client_clone, + near_rpc_client, + ) + .await + }); + let blocks_info_by_finality = + std::sync::Arc::clone(&server_context.blocks_info_by_finality); + tokio::spawn(async move { + utils::update_optimistic_block_regularly(blocks_info_by_finality, redis_client).await + }); + } + let rpc = Server::new() .with_data(Data::new(server_context.clone())) // custom requests methods diff --git a/rpc-server/src/modules/blocks/methods.rs b/rpc-server/src/modules/blocks/methods.rs index 10c45584..59204dda 100644 --- a/rpc-server/src/modules/blocks/methods.rs +++ b/rpc-server/src/modules/blocks/methods.rs @@ -17,6 +17,7 @@ pub async fn block( data: Data, Params(mut params): Params, ) -> Result { + #[cfg(feature = "near_state_indexer_disabled")] if let near_primitives::types::BlockReference::Finality(finality) = ¶ms.block_reference { if finality != &near_primitives::types::Finality::Final { // Increase the OPTIMISTIC_REQUESTS_TOTAL metric if the request has @@ -68,6 +69,7 @@ pub async fn changes_in_block_by_type( near_jsonrpc_primitives::types::changes::RpcStateChangesInBlockByTypeRequest, >, ) -> Result { + #[cfg(feature = "near_state_indexer_disabled")] if let near_primitives::types::BlockReference::Finality(finality) = ¶ms.block_reference { if finality != &near_primitives::types::Finality::Final { // Increase the OPTIMISTIC_REQUESTS_TOTAL metric if the request has @@ -93,6 +95,7 @@ pub async fn changes_in_block( >, ) -> Result { + #[cfg(feature = "near_state_indexer_disabled")] if let near_primitives::types::BlockReference::Finality(finality) = ¶ms.block_reference { if finality != &near_primitives::types::Finality::Final { // Increase the OPTIMISTIC_REQUESTS_TOTAL metric if the request has @@ -154,15 +157,15 @@ async fn changes_in_block_call( ) -> Result { crate::metrics::CHNGES_IN_BLOCK_REQUESTS_TOTAL.inc(); - let block = fetch_block_from_cache_or_get(&data, params.block_reference.clone()) + let cache_block = fetch_block_from_cache_or_get(&data, params.block_reference.clone()) .await .map_err(near_jsonrpc_primitives::errors::RpcError::from)?; - let result = fetch_changes_in_block(&data, block).await; + let result = fetch_changes_in_block(&data, cache_block, ¶ms.block_reference).await; #[cfg(feature = "shadow_data_consistency")] { if let near_primitives::types::BlockReference::Finality(_) = params.block_reference { params.block_reference = near_primitives::types::BlockReference::from( - near_primitives::types::BlockId::Height(block.block_height), + near_primitives::types::BlockId::Height(cache_block.block_height), ) } if let Some(err_code) = crate::utils::shadow_compare_results_handler( @@ -192,16 +195,22 @@ async fn changes_in_block_by_type_call( >, ) -> Result { crate::metrics::CHNGES_IN_BLOCK_BY_TYPE_REQUESTS_TOTAL.inc(); - let block = fetch_block_from_cache_or_get(&data, params.block_reference.clone()) + let cache_block = fetch_block_from_cache_or_get(&data, params.block_reference.clone()) .await .map_err(near_jsonrpc_primitives::errors::RpcError::from)?; - let result = fetch_changes_in_block_by_type(&data, block, ¶ms.state_changes_request).await; + let result = fetch_changes_in_block_by_type( + &data, + cache_block, + ¶ms.state_changes_request, + ¶ms.block_reference, + ) + .await; #[cfg(feature = "shadow_data_consistency")] { if let near_primitives::types::BlockReference::Finality(_) = params.block_reference { params.block_reference = near_primitives::types::BlockReference::from( - near_primitives::types::BlockId::Height(block.block_height), + near_primitives::types::BlockId::Height(cache_block.block_height), ) } if let Some(err_code) = crate::utils::shadow_compare_results_handler( @@ -244,19 +253,40 @@ pub async fn fetch_block( } } }, - near_primitives::types::BlockReference::Finality(finality) => match finality { - near_primitives::types::Finality::Final => Ok(data - .final_block_info - .read() - .await - .final_block_cache - .block_height), - _ => Err( - near_jsonrpc_primitives::types::blocks::RpcBlockError::InternalError { - error_message: "Finality other than final is not supported".to_string(), - }, - ), - }, + near_primitives::types::BlockReference::Finality(finality) => { + return match finality { + near_primitives::types::Finality::Final + | near_primitives::types::Finality::DoomSlug => { + let block_view = data + .blocks_info_by_finality + .read() + .await + .final_block + .block_view() + .await; + Ok(near_jsonrpc_primitives::types::blocks::RpcBlockResponse { block_view }) + } + near_primitives::types::Finality::None => { + if cfg!(feature = "near_state_indexer_disabled") { + Err( + near_jsonrpc_primitives::types::blocks::RpcBlockError::UnknownBlock { + error_message: "Finality::None is not supported by read-rpc" + .to_string(), + }, + ) + } else { + let block_view = data + .blocks_info_by_finality + .read() + .await + .optimistic_block + .block_view() + .await; + Ok(near_jsonrpc_primitives::types::blocks::RpcBlockResponse { block_view }) + } + } + } + } // for archive node both SyncCheckpoint(Genesis and EarliestAvailable) // are returning the genesis block height near_primitives::types::BlockReference::SyncCheckpoint(_) => { @@ -338,16 +368,19 @@ pub async fn fetch_chunk( #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] async fn fetch_changes_in_block( data: &Data, - block: crate::modules::blocks::CacheBlock, + cache_block: crate::modules::blocks::CacheBlock, + block_reference: &near_primitives::types::BlockReference, ) -> Result< near_jsonrpc_primitives::types::changes::RpcStateChangesInBlockByTypeResponse, near_jsonrpc_primitives::types::changes::RpcStateChangesError, > { - let shards = fetch_shards(data, block).await.map_err(|err| { - near_jsonrpc_primitives::types::changes::RpcStateChangesError::UnknownBlock { - error_message: err.to_string(), - } - })?; + let shards = fetch_shards(data, cache_block, block_reference) + .await + .map_err(|err| { + near_jsonrpc_primitives::types::changes::RpcStateChangesError::UnknownBlock { + error_message: err.to_string(), + } + })?; let trie_keys = shards .into_iter() @@ -416,7 +449,7 @@ async fn fetch_changes_in_block( Ok( near_jsonrpc_primitives::types::changes::RpcStateChangesInBlockByTypeResponse { - block_hash: block.block_hash, + block_hash: cache_block.block_hash, changes, }, ) @@ -425,17 +458,20 @@ async fn fetch_changes_in_block( #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] async fn fetch_changes_in_block_by_type( data: &Data, - block: crate::modules::blocks::CacheBlock, + cache_block: crate::modules::blocks::CacheBlock, state_changes_request: &near_primitives::views::StateChangesRequestView, + block_reference: &near_primitives::types::BlockReference, ) -> Result< near_jsonrpc_primitives::types::changes::RpcStateChangesInBlockResponse, near_jsonrpc_primitives::types::changes::RpcStateChangesError, > { - let shards = fetch_shards(data, block).await.map_err(|err| { - near_jsonrpc_primitives::types::changes::RpcStateChangesError::UnknownBlock { - error_message: err.to_string(), - } - })?; + let shards = fetch_shards(data, cache_block, block_reference) + .await + .map_err(|err| { + near_jsonrpc_primitives::types::changes::RpcStateChangesError::UnknownBlock { + error_message: err.to_string(), + } + })?; let changes = shards .into_iter() .flat_map(|shard| shard.state_changes) @@ -443,7 +479,7 @@ async fn fetch_changes_in_block_by_type( .collect(); Ok( near_jsonrpc_primitives::types::changes::RpcStateChangesInBlockResponse { - block_hash: block.block_hash, + block_hash: cache_block.block_hash, changes, }, ) @@ -452,26 +488,55 @@ async fn fetch_changes_in_block_by_type( #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] async fn fetch_shards( data: &Data, - block: crate::modules::blocks::CacheBlock, + cache_block: crate::modules::blocks::CacheBlock, + block_reference: &near_primitives::types::BlockReference, ) -> anyhow::Result> { - let fetch_shards_futures = (0..block.chunks_included) - .collect::>() - .into_iter() - .map(|shard_id| { - near_lake_framework::s3_fetchers::fetch_shard( - &data.s3_client, - &data.s3_bucket_name, - block.block_height, - shard_id, - ) - }); - futures::future::try_join_all(fetch_shards_futures) - .await - .map_err(|err| { - anyhow::anyhow!( - "Failed to fetch shards for block {} with error: {}", - block.block_height, - err - ) - }) + if let near_primitives::types::BlockReference::Finality(finality) = block_reference { + match finality { + near_primitives::types::Finality::None => { + if cfg!(feature = "near_state_indexer_disabled") { + Err(anyhow::anyhow!( + "Failed to fetch shards! Finality::None is not supported by rpc_server", + )) + } else { + Ok(data + .blocks_info_by_finality + .read() + .await + .optimistic_block + .shards() + .await) + } + } + near_primitives::types::Finality::DoomSlug + | near_primitives::types::Finality::Final => Ok(data + .blocks_info_by_finality + .read() + .await + .final_block + .shards() + .await), + } + } else { + let fetch_shards_futures = (0..cache_block.chunks_included) + .collect::>() + .into_iter() + .map(|shard_id| { + near_lake_framework::s3_fetchers::fetch_shard( + &data.s3_client, + &data.s3_bucket_name, + cache_block.block_height, + shard_id, + ) + }); + futures::future::try_join_all(fetch_shards_futures) + .await + .map_err(|err| { + anyhow::anyhow!( + "Failed to fetch shards for block {} with error: {}", + cache_block.block_height, + err + ) + }) + } } diff --git a/rpc-server/src/modules/blocks/mod.rs b/rpc-server/src/modules/blocks/mod.rs index 48aeb894..1a8335e3 100644 --- a/rpc-server/src/modules/blocks/mod.rs +++ b/rpc-server/src/modules/blocks/mod.rs @@ -1,3 +1,5 @@ +use near_primitives::views::StateChangeValueView; + pub mod methods; pub mod utils; @@ -13,8 +15,8 @@ pub struct CacheBlock { pub epoch_id: near_primitives::hash::CryptoHash, } -impl From for CacheBlock { - fn from(block: near_primitives::views::BlockView) -> Self { +impl From<&near_primitives::views::BlockView> for CacheBlock { + fn from(block: &near_primitives::views::BlockView) -> Self { Self { block_hash: block.header.hash, block_height: block.header.height, @@ -29,33 +31,288 @@ impl From for CacheBlock { } #[derive(Debug)] -pub struct FinalBlockInfo { - pub final_block_cache: CacheBlock, +pub struct BlockInfo { + pub block_cache: CacheBlock, + pub stream_message: near_indexer_primitives::StreamerMessage, +} + +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), + stream_message: near_indexer_primitives::StreamerMessage { + block: block_view, + shards: vec![], // We left shards empty because block_view doesn't contain shards. + }, + } + } + + // Create new BlockInfo from StreamerMessage. + // This is using to update final and optimistic blocks regularly. + pub async fn new_from_streamer_message( + stream_message: near_indexer_primitives::StreamerMessage, + ) -> Self { + Self { + block_cache: CacheBlock::from(&stream_message.block), + stream_message, + } + } + + pub async fn block_view(&self) -> near_primitives::views::BlockView { + self.stream_message.block.clone() + } + + pub async fn shards(&self) -> Vec { + self.stream_message.shards.clone() + } + + // This method using for optimistic blocks info. + // We fetch the account changes in the block by specific AccountId. + // For optimistic block s we don't have information about account changes in the database, + // so we need to fetch it from the optimistic block streamer_message and merge it with data from database. + pub async fn account_changes_in_block( + &self, + target_account_id: &near_primitives::types::AccountId, + ) -> anyhow::Result> { + let mut result = None; + let mut is_account_updated = false; + let initial_state_changes = self + .shards() + .await + .into_iter() + .flat_map(|shard| shard.state_changes.into_iter()) + .filter(|state_change| { + matches!( + state_change.value, + StateChangeValueView::AccountUpdate { .. } + | StateChangeValueView::AccountDeletion { .. } + ) + }); + + for state_change in initial_state_changes { + match state_change.value { + StateChangeValueView::AccountUpdate { + account_id, + account, + } => { + if &account_id == target_account_id { + result = Some(account); + is_account_updated = true; + } + } + StateChangeValueView::AccountDeletion { account_id } => { + if &account_id == target_account_id { + result = None; + is_account_updated = true; + } + } + _ => anyhow::bail!("Invalid state change value"), + }; + } + if !is_account_updated { + anyhow::bail!("Account not updated in this block"); + } + Ok(result) + } + + // This method using for optimistic blocks info. + // We fetch the contract code changes in the block by specific AccountId. + // For optimistic block we don't have information about code changes in the database, + // so we need to fetch it from the optimistic block streamer_message and merge it with data from database. + pub async fn code_changes_in_block( + &self, + target_account_id: &near_primitives::types::AccountId, + ) -> anyhow::Result>> { + let mut result = None; + let mut is_code_updated = false; + let initial_state_changes = self + .shards() + .await + .into_iter() + .flat_map(|shard| shard.state_changes.into_iter()) + .filter(|state_change| { + matches!( + state_change.value, + StateChangeValueView::ContractCodeUpdate { .. } + | StateChangeValueView::ContractCodeDeletion { .. } + ) + }); + + for state_change in initial_state_changes { + match state_change.value { + StateChangeValueView::ContractCodeUpdate { account_id, code } => { + if &account_id == target_account_id { + result = Some(code); + is_code_updated = true; + } + } + StateChangeValueView::ContractCodeDeletion { account_id } => { + if &account_id == target_account_id { + result = None; + is_code_updated = true; + } + } + _ => anyhow::bail!("Invalid state change value"), + }; + } + if !is_code_updated { + anyhow::bail!("Contract code not updated in this block"); + } + Ok(result) + } + + // This method using for optimistic blocks info. + // We fetch the access_key changes in the block by specific AccountId and PublicKey. + // For optimistic block we don't have information about AccessKey changes in the database, + // so we need to fetch it from the optimistic block streamer_message and merge it with data from database. + pub async fn access_key_changes_in_block( + &self, + target_account_id: &near_primitives::types::AccountId, + target_public_key: &near_crypto::PublicKey, + ) -> anyhow::Result> { + let mut result = None; + let mut is_access_key_updated = false; + let initial_state_changes = self + .shards() + .await + .into_iter() + .flat_map(|shard| shard.state_changes.into_iter()) + .filter(|state_change| { + matches!( + state_change.value, + StateChangeValueView::AccessKeyUpdate { .. } + | StateChangeValueView::AccessKeyDeletion { .. } + ) + }); + + for state_change in initial_state_changes { + match state_change.value { + StateChangeValueView::AccessKeyUpdate { + account_id, + public_key, + access_key, + } => { + if &account_id == target_account_id && &public_key == target_public_key { + result = Some(access_key); + is_access_key_updated = true; + } + } + StateChangeValueView::AccessKeyDeletion { + account_id, + public_key, + } => { + if &account_id == target_account_id && &public_key == target_public_key { + result = None; + is_access_key_updated = true; + } + } + _ => anyhow::bail!("Invalid state change value"), + }; + } + if !is_access_key_updated { + anyhow::bail!("Access key not updated in this block"); + } + Ok(result) + } + + // This method using for optimistic blocks info. + // We fetch the state changes in the block by specific AccountId and key_prefix. + // if prefix is empty, we fetch all state changes by specific AccountId. + // For optimistic block we don't have information about state changes in the database, + // so we need to fetch it from the optimistic block streamer_message and merge it with data from database. + pub async fn state_changes_in_block( + &self, + target_account_id: &near_primitives::types::AccountId, + prefix: &[u8], + ) -> std::collections::HashMap< + readnode_primitives::StateKey, + Option, + > { + let mut block_state_changes = std::collections::HashMap::< + readnode_primitives::StateKey, + Option, + >::new(); + let hex_str_prefix = hex::encode(prefix); + + let initial_state_changes = self + .shards() + .await + .into_iter() + .flat_map(|shard| shard.state_changes.into_iter()) + .filter(|state_change| { + matches!( + state_change.value, + StateChangeValueView::DataUpdate { .. } + | StateChangeValueView::DataDeletion { .. } + ) + }); + + for state_change in initial_state_changes { + match state_change.value { + StateChangeValueView::DataUpdate { + account_id, + key, + value, + } => { + if &account_id == target_account_id { + let key: &[u8] = key.as_ref(); + if hex::encode(key).starts_with(&hex_str_prefix) { + block_state_changes.insert(key.to_vec(), Some(value.to_vec())); + } + } + } + StateChangeValueView::DataDeletion { account_id, key } => { + if &account_id == target_account_id { + let key: &[u8] = key.as_ref(); + if hex::encode(key).starts_with(&hex_str_prefix) { + block_state_changes.insert(key.to_vec(), None); + } + } + } + _ => {} + } + } + block_state_changes + } +} + +#[derive(Debug)] +pub struct BlocksInfoByFinality { + pub final_block: BlockInfo, + pub optimistic_block: BlockInfo, pub current_validators: near_primitives::views::EpochValidatorInfo, } -impl FinalBlockInfo { +impl BlocksInfoByFinality { pub async fn new( near_rpc_client: &crate::utils::JsonRpcClient, blocks_cache: &std::sync::Arc< futures_locks::RwLock>, >, ) -> Self { - let final_block = crate::utils::get_final_cache_block(near_rpc_client) - .await - .expect("Error to get final block"); - - let validators = crate::utils::get_current_validators(near_rpc_client) - .await - .expect("Error to get protocol_config"); + 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 (final_block, optimistic_block, validators) = tokio::try_join!( + final_block_future, + optimistic_block_future, + validators_future, + ) + .map_err(|err| { + tracing::error!("Error to fetch final block info: {:?}", err); + err + }) + .expect("Error to get final block info"); blocks_cache .write() .await - .put(final_block.block_height, final_block); + .put(final_block.header.height, CacheBlock::from(&final_block)); Self { - final_block_cache: final_block, + final_block: BlockInfo::new_from_block_view(final_block).await, + optimistic_block: BlockInfo::new_from_block_view(optimistic_block).await, current_validators: validators, } } diff --git a/rpc-server/src/modules/blocks/utils.rs b/rpc-server/src/modules/blocks/utils.rs index 365adb37..abd07886 100644 --- a/rpc-server/src/modules/blocks/utils.rs +++ b/rpc-server/src/modules/blocks/utils.rs @@ -96,9 +96,41 @@ pub async fn fetch_block_from_cache_or_get( }; data.blocks_cache.write().await.get(&block_height).cloned() } - near_primitives::types::BlockReference::Finality(_) => { - // Returns the final_block_height for all the finalities. - Some(data.final_block_info.read().await.final_block_cache) + near_primitives::types::BlockReference::Finality(finality) => { + match finality { + near_primitives::types::Finality::None => { + if cfg!(feature = "near_state_indexer_disabled") { + // Returns the final_block for None. + Some( + data.blocks_info_by_finality + .read() + .await + .final_block + .block_cache, + ) + } else { + // Returns the optimistic_block for None. + Some( + data.blocks_info_by_finality + .read() + .await + .optimistic_block + .block_cache, + ) + } + } + near_primitives::types::Finality::DoomSlug + | near_primitives::types::Finality::Final => { + // Returns the final_block for DoomSlug and Final. + Some( + data.blocks_info_by_finality + .read() + .await + .final_block + .block_cache, + ) + } + } } near_primitives::types::BlockReference::SyncCheckpoint(_) => { // Return genesis_block_cache for all SyncCheckpoint @@ -111,7 +143,7 @@ pub async fn fetch_block_from_cache_or_get( Some(block) => Ok(block), None => { let block_from_s3 = fetch_block(data, block_reference).await?; - let block: CacheBlock = block_from_s3.block_view.into(); + let block = CacheBlock::from(&block_from_s3.block_view); data.blocks_cache .write() diff --git a/rpc-server/src/modules/network/methods.rs b/rpc-server/src/modules/network/methods.rs index 87086e56..f21b06ff 100644 --- a/rpc-server/src/modules/network/methods.rs +++ b/rpc-server/src/modules/network/methods.rs @@ -31,8 +31,8 @@ pub async fn status( data: Data, Params(_params): Params, ) -> Result { - let final_block_info = data.final_block_info.read().await; - let validators = final_block_info + let blocks_info_by_finality = data.blocks_info_by_finality.read().await; + let validators = blocks_info_by_finality .current_validators .current_validators .iter() @@ -46,16 +46,22 @@ pub async fn status( version: data.version.clone(), chain_id: data.genesis_info.genesis_config.chain_id.clone(), protocol_version: near_primitives::version::PROTOCOL_VERSION, - latest_protocol_version: final_block_info.final_block_cache.latest_protocol_version, + latest_protocol_version: blocks_info_by_finality + .final_block + .block_cache + .latest_protocol_version, // Address for current read_node RPC server. rpc_addr: Some(format!("0.0.0.0:{}", data.server_port)), validators, sync_info: near_primitives::views::StatusSyncInfo { - latest_block_hash: final_block_info.final_block_cache.block_hash, - latest_block_height: final_block_info.final_block_cache.block_height, - latest_state_root: final_block_info.final_block_cache.state_root, + latest_block_hash: blocks_info_by_finality.final_block.block_cache.block_hash, + latest_block_height: blocks_info_by_finality.final_block.block_cache.block_height, + latest_state_root: blocks_info_by_finality.final_block.block_cache.state_root, latest_block_time: time::OffsetDateTime::from_unix_timestamp_nanos( - final_block_info.final_block_cache.block_timestamp as i128, + blocks_info_by_finality + .final_block + .block_cache + .block_timestamp as i128, ) .expect("Failed to parse timestamp"), // Always false because read_node is not need to sync @@ -69,9 +75,13 @@ pub async fn status( .expect("Failed to parse timestamp"), ), epoch_id: Some(near_primitives::types::EpochId( - final_block_info.final_block_cache.epoch_id, + blocks_info_by_finality.final_block.block_cache.epoch_id, )), - epoch_start_height: Some(final_block_info.current_validators.epoch_start_height), + epoch_start_height: Some( + blocks_info_by_finality + .current_validators + .epoch_start_height, + ), }, validator_account_id: None, validator_public_key: None, @@ -124,10 +134,11 @@ pub async fn validators( // Current epoch validators fetches from the Near RPC node if let near_primitives::types::EpochReference::EpochId(epoch_id) = &request.epoch_reference { if data - .final_block_info + .blocks_info_by_finality .read() .await - .final_block_cache + .final_block + .block_cache .epoch_id == epoch_id.0 { @@ -273,6 +284,7 @@ async fn protocol_config_call( fees: runtime_config.fees.clone(), wasm_config: runtime_config.wasm_config.clone(), account_creation_config: runtime_config.account_creation_config.clone(), + storage_proof_size_soft_limit: runtime_config.storage_proof_size_soft_limit, }, }; Ok(protocol_config.into()) diff --git a/rpc-server/src/modules/queries/methods.rs b/rpc-server/src/modules/queries/methods.rs index f9976ccf..7ae5571a 100644 --- a/rpc-server/src/modules/queries/methods.rs +++ b/rpc-server/src/modules/queries/methods.rs @@ -4,29 +4,33 @@ use crate::modules::blocks::utils::fetch_block_from_cache_or_get; use crate::modules::blocks::CacheBlock; #[cfg(feature = "account_access_keys")] use crate::modules::queries::utils::fetch_list_access_keys_from_db; -use crate::modules::queries::utils::{fetch_state_from_db, run_contract}; +use crate::modules::queries::utils::{get_state_keys_from_db, run_contract, RunContractResponse}; use jsonrpc_v2::{Data, Params}; /// `query` rpc method implementation /// calls proxy_rpc_call to get `query` from near-rpc if request parameters not supported by read-rpc -/// as example: BlockReference for Finality::None is not supported by read-rpc +/// as example: BlockReference for Finality::None is not supported by read-rpc when near_state_indexer is not running /// another way to get `query` from read-rpc using `query_call` -#[allow(unused_mut)] #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] pub async fn query( data: Data, - Params(mut params): Params, + Params(params): Params, ) -> Result { if let near_primitives::types::BlockReference::Finality(finality) = ¶ms.block_reference { - if finality != &near_primitives::types::Finality::Final { - // Increase the OPTIMISTIC_REQUESTS_TOTAL metric if the request has - // optimistic finality or doom_slug finality - // and proxy to near-rpc - crate::metrics::OPTIMISTIC_REQUESTS_TOTAL.inc(); - return Ok(data.near_rpc_client.call(params).await?); + if finality == &near_primitives::types::Finality::None { + return if cfg!(feature = "near_state_indexer_disabled") { + // Increase the OPTIMISTIC_REQUESTS_TOTAL metric if the request has + // optimistic finality + // and proxy to near-rpc + crate::metrics::OPTIMISTIC_REQUESTS_TOTAL.inc(); + Ok(data.near_rpc_client.call(params).await?) + } else { + // query_call with optimistic block + query_call(data, Params(params), true).await + }; } }; - query_call(data, Params(params)).await + query_call(data, Params(params), false).await } /// fetch query result from read-rpc @@ -35,6 +39,7 @@ pub async fn query( async fn query_call( data: Data, Params(mut params): Params, + is_optimistic: bool, ) -> Result { tracing::debug!("`query` call. Params: {:?}", params,); @@ -44,18 +49,18 @@ async fn query_call( let result = match params.request.clone() { near_primitives::views::QueryRequest::ViewAccount { account_id } => { crate::metrics::QUERY_VIEW_ACCOUNT_REQUESTS_TOTAL.inc(); - view_account(&data, block, &account_id).await + view_account(&data, block, &account_id, is_optimistic).await } near_primitives::views::QueryRequest::ViewCode { account_id } => { crate::metrics::QUERY_VIEW_CODE_REQUESTS_TOTAL.inc(); - view_code(&data, block, &account_id).await + view_code(&data, block, &account_id, is_optimistic).await } near_primitives::views::QueryRequest::ViewAccessKey { account_id, public_key, } => { crate::metrics::QUERY_VIEW_ACCESS_KEY_REQUESTS_TOTAL.inc(); - view_access_key(&data, block, &account_id, public_key).await + view_access_key(&data, block, &account_id, public_key, is_optimistic).await } near_primitives::views::QueryRequest::ViewState { account_id, @@ -65,13 +70,13 @@ async fn query_call( crate::metrics::QUERY_VIEW_STATE_REQUESTS_TOTAL.inc(); if include_proof { // TODO: We can calculate the proof for state only on regular or archival nodes. - let final_block_info = data.final_block_info.read().await; + let blocks_info_by_finality = data.blocks_info_by_finality.read().await; // `expected_earliest_available_block` calculated by formula: // `final_block_height` - `node_epoch_count` * `epoch_length` // Now near store 5 epochs, it can be changed in the future // epoch_length = 43200 blocks let expected_earliest_available_block = - final_block_info.final_block_cache.block_height + blocks_info_by_finality.final_block.block_cache.block_height - 5 * data.genesis_info.genesis_config.epoch_length; return if block.block_height > expected_earliest_available_block { // Proxy to regular rpc if the block is available @@ -83,7 +88,7 @@ async fn query_call( Ok(data.near_rpc_client.archival_call(params).await?) }; } else { - view_state(&data, block, &account_id, prefix.as_ref()).await + view_state(&data, block, &account_id, prefix.as_ref(), is_optimistic).await } } near_primitives::views::QueryRequest::CallFunction { @@ -92,7 +97,15 @@ async fn query_call( args, } => { crate::metrics::QUERY_FUNCTION_CALL_REQUESTS_TOTAL.inc(); - function_call(&data, block, account_id, &method_name, args.clone()).await + function_call( + &data, + block, + account_id, + &method_name, + args.clone(), + is_optimistic, + ) + .await } #[allow(unused_variables)] // `account_id` is used in the `#[cfg(feature = "account_access_keys")]` branch. @@ -232,16 +245,67 @@ async fn view_account( data: &Data, block: CacheBlock, account_id: &near_primitives::types::AccountId, + is_optimistic: bool, ) -> Result< near_jsonrpc_primitives::types::query::RpcQueryResponse, near_jsonrpc_primitives::types::query::RpcQueryError, > { tracing::debug!( - "`view_account` call. AccountID {}, Block {}", + "`view_account` call. AccountID {}, Block {}, optimistic {}", account_id, - block.block_height + block.block_height, + is_optimistic ); + let account_view = if is_optimistic { + optimistic_view_account(data, block, account_id).await? + } else { + database_view_account(data, block, account_id).await? + }; + Ok(near_jsonrpc_primitives::types::query::RpcQueryResponse { + kind: near_jsonrpc_primitives::types::query::QueryResponseKind::ViewAccount(account_view), + block_height: block.block_height, + block_hash: block.block_hash, + }) +} +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn optimistic_view_account( + data: &Data, + block: CacheBlock, + account_id: &near_primitives::types::AccountId, +) -> Result +{ + if let Ok(result) = data + .blocks_info_by_finality + .read() + .await + .optimistic_block + .account_changes_in_block(account_id) + .await + { + if let Some(account_view) = result { + Ok(account_view) + } else { + Err( + near_jsonrpc_primitives::types::query::RpcQueryError::UnknownAccount { + requested_account_id: account_id.clone(), + block_height: block.block_height, + block_hash: block.block_hash, + }, + ) + } + } else { + database_view_account(data, block, account_id).await + } +} + +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn database_view_account( + data: &Data, + block: CacheBlock, + account_id: &near_primitives::types::AccountId, +) -> Result +{ let account = data .db_manager .get_account(account_id, block.block_height) @@ -252,15 +316,9 @@ async fn view_account( block_height: block.block_height, block_hash: block.block_hash, }, - )?; - - Ok(near_jsonrpc_primitives::types::query::RpcQueryResponse { - kind: near_jsonrpc_primitives::types::query::QueryResponseKind::ViewAccount( - near_primitives::views::AccountView::from(account.data), - ), - block_height: block.block_height, - block_hash: block.block_hash, - }) + )? + .data; + Ok(near_primitives::views::AccountView::from(account)) } #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] @@ -268,27 +326,79 @@ async fn view_code( data: &Data, block: CacheBlock, account_id: &near_primitives::types::AccountId, + is_optimistic: bool, ) -> Result< near_jsonrpc_primitives::types::query::RpcQueryResponse, near_jsonrpc_primitives::types::query::RpcQueryError, > { tracing::debug!( - "`view_code` call. AccountID {}, Block {}", + "`view_code` call. AccountID {}, Block {}, optimistic {}", account_id, - block.block_height + block.block_height, + is_optimistic ); - let contract = data - .db_manager - .get_account(account_id, block.block_height) - .await - .map_err( - |_err| near_jsonrpc_primitives::types::query::RpcQueryError::UnknownAccount { - requested_account_id: account_id.clone(), - block_height: block.block_height, - block_hash: block.block_hash, + let (code, account) = if is_optimistic { + tokio::try_join!( + optimistic_view_code(data, block, account_id), + optimistic_view_account(data, block, account_id), + )? + } else { + tokio::try_join!( + database_view_code(data, block, account_id), + database_view_account(data, block, account_id), + )? + }; + + Ok(near_jsonrpc_primitives::types::query::RpcQueryResponse { + kind: near_jsonrpc_primitives::types::query::QueryResponseKind::ViewCode( + near_primitives::views::ContractCodeView { + code, + hash: account.code_hash, }, - )?; - let contract_code = data + ), + block_height: block.block_height, + block_hash: block.block_hash, + }) +} + +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn optimistic_view_code( + data: &Data, + block: CacheBlock, + account_id: &near_primitives::types::AccountId, +) -> Result, near_jsonrpc_primitives::types::query::RpcQueryError> { + let contract_code = if let Ok(result) = data + .blocks_info_by_finality + .read() + .await + .optimistic_block + .code_changes_in_block(account_id) + .await + { + if let Some(code) = result { + code + } else { + return Err( + near_jsonrpc_primitives::types::query::RpcQueryError::NoContractCode { + contract_account_id: account_id.clone(), + block_height: block.block_height, + block_hash: block.block_hash, + }, + ); + } + } else { + database_view_code(data, block, account_id).await? + }; + Ok(contract_code) +} + +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn database_view_code( + data: &Data, + block: CacheBlock, + account_id: &near_primitives::types::AccountId, +) -> Result, near_jsonrpc_primitives::types::query::RpcQueryError> { + Ok(data .db_manager .get_contract_code(account_id, block.block_height) .await @@ -298,17 +408,8 @@ async fn view_code( block_height: block.block_height, block_hash: block.block_hash, }, - )?; - Ok(near_jsonrpc_primitives::types::query::RpcQueryResponse { - kind: near_jsonrpc_primitives::types::query::QueryResponseKind::ViewCode( - near_primitives::views::ContractCodeView { - code: contract_code.data, - hash: contract.data.code_hash(), - }, - ), - block_height: block.block_height, - block_hash: block.block_hash, - }) + )? + .data) } #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] @@ -318,31 +419,27 @@ async fn function_call( account_id: near_primitives::types::AccountId, method_name: &str, args: near_primitives::types::FunctionArgs, + is_optimistic: bool, ) -> Result< near_jsonrpc_primitives::types::query::RpcQueryResponse, near_jsonrpc_primitives::types::query::RpcQueryError, > { tracing::debug!( - "`function_call` call. AccountID {}, block {}, method_name {}, args {:?}", + "`function_call` call. AccountID {}, block {}, method_name {}, args {:?}, optimistic {}", account_id, block.block_height, method_name, args, + is_optimistic, ); - let call_results = run_contract( - account_id, - method_name, - args, - data.db_manager.clone(), - &data.compiled_contract_code_cache, - &data.contract_code_cache, - &data.final_block_info, - block, - data.max_gas_burnt, - ) - .await - .map_err(|err| err.to_rpc_query_error(block.block_height, block.block_hash))?; + let call_results = if is_optimistic { + optimistic_function_call(data, block, account_id, method_name, args).await + } else { + database_function_call(data, block, account_id, method_name, args).await + }; + let call_results = + call_results.map_err(|err| err.to_rpc_query_error(block.block_height, block.block_hash))?; Ok(near_jsonrpc_primitives::types::query::RpcQueryResponse { kind: near_jsonrpc_primitives::types::query::QueryResponseKind::CallResult( near_primitives::views::CallResult { @@ -355,58 +452,260 @@ async fn function_call( }) } +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn optimistic_function_call( + data: &Data, + block: CacheBlock, + account_id: near_primitives::types::AccountId, + method_name: &str, + args: near_primitives::types::FunctionArgs, +) -> Result { + let optimistic_data = data + .blocks_info_by_finality + .read() + .await + .optimistic_block + .state_changes_in_block(&account_id, &[]) + .await; + run_contract( + account_id, + method_name, + args, + data.db_manager.clone(), + &data.compiled_contract_code_cache, + &data.contract_code_cache, + &data.blocks_info_by_finality, + block, + data.max_gas_burnt, + optimistic_data, // run contract with optimistic data + ) + .await +} + +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn database_function_call( + data: &Data, + block: CacheBlock, + account_id: near_primitives::types::AccountId, + method_name: &str, + args: near_primitives::types::FunctionArgs, +) -> Result { + run_contract( + account_id, + method_name, + args, + data.db_manager.clone(), + &data.compiled_contract_code_cache, + &data.contract_code_cache, + &data.blocks_info_by_finality, + block, + data.max_gas_burnt, + Default::default(), // run contract with empty optimistic data + ) + .await +} + #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] async fn view_state( data: &Data, block: CacheBlock, account_id: &near_primitives::types::AccountId, prefix: &[u8], + is_optimistic: bool, ) -> Result< near_jsonrpc_primitives::types::query::RpcQueryResponse, near_jsonrpc_primitives::types::query::RpcQueryError, > { tracing::debug!( - "`view_state` call. AccountID {}, block {}, prefix {:?}", + "`view_state` call. AccountID {}, block {}, prefix {:?}, optimistic {}", account_id, block.block_height, prefix, + is_optimistic, ); - let contract_state = - fetch_state_from_db(&data.db_manager, account_id, block.block_height, prefix) - .await - .map_err(|_err| { - near_jsonrpc_primitives::types::query::RpcQueryError::UnknownAccount { - requested_account_id: account_id.clone(), - block_height: block.block_height, - block_hash: block.block_hash, - } - })?; + let state_item = if is_optimistic { + optimistic_view_state(data, block, account_id, prefix).await? + } else { + database_view_state(data, block, account_id, prefix).await? + }; Ok(near_jsonrpc_primitives::types::query::RpcQueryResponse { - kind: near_jsonrpc_primitives::types::query::QueryResponseKind::ViewState(contract_state), + kind: near_jsonrpc_primitives::types::query::QueryResponseKind::ViewState( + near_primitives::views::ViewStateResult { + values: state_item, + proof: vec![], // TODO: this is hardcoded empty value since we don't support proofs yet + }, + ), block_height: block.block_height, block_hash: block.block_hash, }) } +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn optimistic_view_state( + data: &Data, + block: CacheBlock, + account_id: &near_primitives::types::AccountId, + prefix: &[u8], +) -> Result< + Vec, + near_jsonrpc_primitives::types::query::RpcQueryError, +> { + let mut optimistic_data = data + .blocks_info_by_finality + .read() + .await + .optimistic_block + .state_changes_in_block(account_id, prefix) + .await; + let state_from_db = + get_state_keys_from_db(&data.db_manager, account_id, block.block_height, prefix).await; + if state_from_db.is_empty() && optimistic_data.is_empty() { + Err( + near_jsonrpc_primitives::types::query::RpcQueryError::UnknownAccount { + requested_account_id: account_id.clone(), + block_height: block.block_height, + block_hash: block.block_hash, + }, + ) + } else { + let mut values: Vec = state_from_db + .into_iter() + .filter_map(|(key, value)| { + let value = if let Some(value) = optimistic_data.remove(&key) { + value.clone() + } else { + Some(value) + }; + value.map(|value| near_primitives::views::StateItem { + key: key.into(), + value: value.into(), + }) + }) + .collect(); + let optimistic_items: Vec = optimistic_data + .iter() + .filter_map(|(key, value)| { + value + .clone() + .map(|value| near_primitives::views::StateItem { + key: key.clone().into(), + value: value.clone().into(), + }) + }) + .collect(); + values.extend(optimistic_items); + Ok(values) + } +} + +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn database_view_state( + data: &Data, + block: CacheBlock, + account_id: &near_primitives::types::AccountId, + prefix: &[u8], +) -> Result< + Vec, + near_jsonrpc_primitives::types::query::RpcQueryError, +> { + let state_from_db = + get_state_keys_from_db(&data.db_manager, account_id, block.block_height, prefix).await; + if state_from_db.is_empty() { + Err( + near_jsonrpc_primitives::types::query::RpcQueryError::UnknownAccount { + requested_account_id: account_id.clone(), + block_height: block.block_height, + block_hash: block.block_hash, + }, + ) + } else { + let values: Vec = state_from_db + .into_iter() + .map(|(key, value)| near_primitives::views::StateItem { + key: key.into(), + value: value.into(), + }) + .collect(); + Ok(values) + } +} + #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] async fn view_access_key( data: &Data, block: CacheBlock, account_id: &near_primitives::types::AccountId, public_key: near_crypto::PublicKey, + is_optimistic: bool, ) -> Result< near_jsonrpc_primitives::types::query::RpcQueryResponse, near_jsonrpc_primitives::types::query::RpcQueryError, > { tracing::debug!( - "`view_access_key` call. AccountID {}, block {}, key_data {:?}", + "`view_access_key` call. AccountID {}, block {}, key_data {:?}, optimistic {}", account_id, block.block_height, public_key.to_string(), + is_optimistic, ); + let access_key_view = if is_optimistic { + optimistic_view_access_key(data, block, account_id, public_key).await? + } else { + database_view_access_key(data, block, account_id, public_key).await? + }; + Ok(near_jsonrpc_primitives::types::query::RpcQueryResponse { + kind: near_jsonrpc_primitives::types::query::QueryResponseKind::AccessKey(access_key_view), + block_height: block.block_height, + block_hash: block.block_hash, + }) +} + +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn optimistic_view_access_key( + data: &Data, + block: CacheBlock, + account_id: &near_primitives::types::AccountId, + public_key: near_crypto::PublicKey, +) -> Result< + near_primitives::views::AccessKeyView, + near_jsonrpc_primitives::types::query::RpcQueryError, +> { + if let Ok(result) = data + .blocks_info_by_finality + .read() + .await + .optimistic_block + .access_key_changes_in_block(account_id, &public_key) + .await + { + if let Some(access_key) = result { + Ok(access_key) + } else { + Err( + near_jsonrpc_primitives::types::query::RpcQueryError::UnknownAccessKey { + public_key, + block_height: block.block_height, + block_hash: block.block_hash, + }, + ) + } + } else { + database_view_access_key(data, block, account_id, public_key).await + } +} +#[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(data)))] +async fn database_view_access_key( + data: &Data, + block: CacheBlock, + account_id: &near_primitives::types::AccountId, + public_key: near_crypto::PublicKey, +) -> Result< + near_primitives::views::AccessKeyView, + near_jsonrpc_primitives::types::query::RpcQueryError, +> { let access_key = data .db_manager .get_access_key(account_id, block.block_height, public_key.clone()) @@ -417,15 +716,9 @@ async fn view_access_key( block_height: block.block_height, block_hash: block.block_hash, }, - )?; - - Ok(near_jsonrpc_primitives::types::query::RpcQueryResponse { - kind: near_jsonrpc_primitives::types::query::QueryResponseKind::AccessKey( - near_primitives::views::AccessKeyView::from(access_key.data), - ), - block_height: block.block_height, - block_hash: block.block_hash, - }) + )? + .data; + Ok(near_primitives::views::AccessKeyView::from(access_key)) } #[cfg(feature = "account_access_keys")] diff --git a/rpc-server/src/modules/queries/mod.rs b/rpc-server/src/modules/queries/mod.rs index 4decf005..b4874fb3 100644 --- a/rpc-server/src/modules/queries/mod.rs +++ b/rpc-server/src/modules/queries/mod.rs @@ -14,6 +14,9 @@ pub struct CodeStorage { block_height: near_primitives::types::BlockHeight, validators: HashMap, data_count: u64, + is_optimistic: bool, + optimistic_data: + HashMap>, } pub struct StorageValuePtr { @@ -36,6 +39,10 @@ impl CodeStorage { account_id: near_primitives::types::AccountId, block_height: near_primitives::types::BlockHeight, validators: HashMap, + optimistic_data: HashMap< + readnode_primitives::StateKey, + Option, + >, ) -> Self { Self { db_manager, @@ -43,8 +50,56 @@ impl CodeStorage { block_height, validators, data_count: Default::default(), // TODO: Using for generate_data_id + is_optimistic: !optimistic_data.is_empty(), + optimistic_data, } } + + fn optimistic_storage_get( + &self, + key: &[u8], + ) -> Result>> { + if let Some(value) = self.optimistic_data.get(key) { + Ok(value.as_ref().map(|data| { + Box::new(StorageValuePtr { + value: data.clone(), + }) as Box<_> + })) + } else { + self.database_storage_get(key) + } + } + + fn database_storage_get( + &self, + key: &[u8], + ) -> Result>> { + let get_db_data = + self.db_manager + .get_state_key_value(&self.account_id, self.block_height, key.to_vec()); + let (_, data) = block_on(get_db_data); + Ok(if !data.is_empty() { + Some(Box::new(StorageValuePtr { value: data }) as Box<_>) + } else { + None + }) + } + + fn optimistic_storage_has_key(&mut self, key: &[u8]) -> Result { + if let Some(value) = self.optimistic_data.get(key) { + Ok(value.is_some()) + } else { + self.database_storage_has_key(key) + } + } + + fn database_storage_has_key(&mut self, key: &[u8]) -> Result { + let get_db_state_keys = + self.db_manager + .get_state_key_value(&self.account_id, self.block_height, key.to_vec()); + let (_, data) = block_on(get_db_state_keys); + Ok(!data.is_empty()) + } } impl near_vm_runner::logic::External for CodeStorage { @@ -66,15 +121,11 @@ impl near_vm_runner::logic::External for CodeStorage { key: &[u8], _mode: near_vm_runner::logic::StorageGetMode, ) -> Result>> { - let get_db_data = - self.db_manager - .get_state_key_value(&self.account_id, self.block_height, key.to_vec()); - let (_, data) = block_on(get_db_data); - Ok(if !data.is_empty() { - Some(Box::new(StorageValuePtr { value: data }) as Box<_>) + if self.is_optimistic { + self.optimistic_storage_get(key) } else { - None - }) + self.database_storage_get(key) + } } #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(self)))] @@ -104,11 +155,11 @@ impl near_vm_runner::logic::External for CodeStorage { key: &[u8], _mode: near_vm_runner::logic::StorageGetMode, ) -> Result { - let get_db_state_keys = - self.db_manager - .get_state_key_value(&self.account_id, self.block_height, key.to_vec()); - let (_, data) = block_on(get_db_state_keys); - Ok(!data.is_empty()) + if self.is_optimistic { + self.optimistic_storage_has_key(key) + } else { + self.database_storage_has_key(key) + } } #[cfg_attr(feature = "tracing-instrumentation", tracing::instrument(skip(self)))] diff --git a/rpc-server/src/modules/queries/utils.rs b/rpc-server/src/modules/queries/utils.rs index 53b7bfc0..e3fdedaa 100644 --- a/rpc-server/src/modules/queries/utils.rs +++ b/rpc-server/src/modules/queries/utils.rs @@ -5,7 +5,7 @@ use futures::StreamExt; use crate::config::CompiledCodeCache; use crate::errors::FunctionCallError; -use crate::modules::blocks::FinalBlockInfo; +use crate::modules::blocks::BlocksInfoByFinality; use crate::modules::queries::CodeStorage; pub struct RunContractResponse { @@ -98,40 +98,6 @@ pub async fn fetch_list_access_keys_from_db( Ok(account_keys_view) } -#[cfg_attr( - feature = "tracing-instrumentation", - tracing::instrument(skip(db_manager)) -)] -pub async fn fetch_state_from_db( - db_manager: &std::sync::Arc>, - account_id: &near_primitives::types::AccountId, - block_height: near_primitives::types::BlockHeight, - prefix: &[u8], -) -> anyhow::Result { - tracing::debug!( - "`fetch_state_from_db` call. AccountID {}, block {}, prefix {:?}", - account_id, - block_height, - prefix, - ); - let state_from_db = get_state_keys_from_db(db_manager, account_id, block_height, prefix).await; - if state_from_db.is_empty() { - anyhow::bail!("Data not found in db") - } else { - let values = state_from_db - .into_iter() - .map(|(key, value)| near_primitives::views::StateItem { - key: key.into(), - value: value.into(), - }) - .collect(); - Ok(near_primitives::views::ViewStateResult { - values, - proof: vec![], // TODO: this is hardcoded empty value since we don't support proofs yet - }) - } -} - #[allow(clippy::too_many_arguments)] #[cfg_attr( feature = "tracing-instrumentation", @@ -229,9 +195,13 @@ pub async fn run_contract( crate::cache::LruMemoryCache>, >, >, - final_block_info: &std::sync::Arc>, + blocks_info_by_finality: &std::sync::Arc>, block: crate::modules::blocks::CacheBlock, max_gas_burnt: near_primitives::types::Gas, + optimistic_data: HashMap< + readnode_primitives::StateKey, + Option, + >, ) -> Result { let contract = db_manager .get_account(&account_id, block.block_height) @@ -263,22 +233,32 @@ pub async fn run_contract( } }; - let (epoch_height, epoch_validators) = - if final_block_info.read().await.final_block_cache.epoch_id == block.epoch_id { - let validators = final_block_info.read().await.current_validators.clone(); - (validators.epoch_height, validators.current_validators) - } else { - let validators = db_manager - .get_validators_by_epoch_id(block.epoch_id) - .await - .map_err(|_| FunctionCallError::InternalError { - error_message: "Failed to get epoch info".to_string(), - })?; - ( - validators.epoch_height, - validators.validators_info.current_validators, - ) - }; + let (epoch_height, epoch_validators) = if blocks_info_by_finality + .read() + .await + .final_block + .block_cache + .epoch_id + == block.epoch_id + { + let validators = blocks_info_by_finality + .read() + .await + .current_validators + .clone(); + (validators.epoch_height, validators.current_validators) + } else { + let validators = db_manager + .get_validators_by_epoch_id(block.epoch_id) + .await + .map_err(|_| FunctionCallError::InternalError { + error_message: "Failed to get epoch info".to_string(), + })?; + ( + validators.epoch_height, + validators.validators_info.current_validators, + ) + }; let public_key = near_crypto::PublicKey::empty(near_crypto::KeyType::ED25519); let random_seed = near_primitives::utils::create_random_seed( @@ -313,6 +293,7 @@ pub async fn run_contract( .iter() .map(|validator| (validator.account_id.clone(), validator.stake)) .collect(), + optimistic_data, ); let result = run_code_in_vm_runner( diff --git a/rpc-server/src/utils.rs b/rpc-server/src/utils.rs index 49ce9e35..5c78c418 100644 --- a/rpc-server/src/utils.rs +++ b/rpc-server/src/utils.rs @@ -1,4 +1,4 @@ -use crate::modules::blocks::{CacheBlock, FinalBlockInfo}; +use crate::modules::blocks::{BlockInfo, BlocksInfoByFinality, CacheBlock}; #[cfg(feature = "shadow_data_consistency")] use assert_json_diff::{assert_json_matches_no_panic, CompareMode, Config, NumericMode}; use futures::StreamExt; @@ -96,28 +96,26 @@ impl JsonRpcClient { } } -pub async fn get_final_cache_block(near_rpc_client: &JsonRpcClient) -> Option { +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( - near_primitives::types::Finality::Final, - ), + block_reference: near_primitives::types::BlockReference::Finality(if optimistic { + near_primitives::types::Finality::None + } else { + near_primitives::types::Finality::Final + }), }; - match near_rpc_client.call(block_request_method).await { - Ok(block_view) => { - // 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 - crate::metrics::FINAL_BLOCK_HEIGHT - .set(i64::try_from(block_view.header.height).unwrap()); - - Some(block_view.into()) - } - Err(err) => { - tracing::warn!("Error to get final block: {:?}", err); - None - } + let block_view = near_rpc_client.call(block_request_method).await?; + if !optimistic { + // 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 + crate::metrics::FINAL_BLOCK_HEIGHT.set(i64::try_from(block_view.header.height)?); } + Ok(block_view) } pub async fn get_current_validators( @@ -134,34 +132,53 @@ async fn handle_streamer_message( blocks_cache: std::sync::Arc< futures_locks::RwLock>, >, - final_block_info: std::sync::Arc>, + blocks_info_by_finality: std::sync::Arc>, near_rpc_client: &JsonRpcClient, ) -> anyhow::Result<()> { - let block: CacheBlock = streamer_message.block.into(); - - if final_block_info.read().await.final_block_cache.epoch_id != block.epoch_id { - tracing::info!("New epoch started: {:?}", block.epoch_id); - final_block_info.write().await.current_validators = + let block = BlockInfo::new_from_streamer_message(streamer_message).await; + + if blocks_info_by_finality + .read() + .await + .final_block + .block_cache + .epoch_id + != block.block_cache.epoch_id + { + tracing::info!("New epoch started: {:?}", block.block_cache.epoch_id); + blocks_info_by_finality.write().await.current_validators = get_current_validators(near_rpc_client).await?; } - final_block_info.write().await.final_block_cache = block; - blocks_cache.write().await.put(block.block_height, block); - crate::metrics::FINAL_BLOCK_HEIGHT.set(i64::try_from(block.block_height)?); + let block_cache = block.block_cache; + blocks_info_by_finality.write().await.final_block = block; + blocks_cache + .write() + .await + .put(block_cache.block_height, block_cache); + crate::metrics::FINAL_BLOCK_HEIGHT.set(i64::try_from(block_cache.block_height)?); Ok(()) } -pub async fn update_final_block_height_regularly( +#[cfg(feature = "near_state_indexer_disabled")] +pub async fn update_final_block_regularly( blocks_cache: std::sync::Arc< futures_locks::RwLock>, >, - final_block_info: std::sync::Arc>, + blocks_info_by_finality: std::sync::Arc>, rpc_server_config: configuration::RpcServerConfig, near_rpc_client: JsonRpcClient, ) -> anyhow::Result<()> { tracing::info!("Task to get and store final block in the cache started"); let lake_config = rpc_server_config .lake_config - .lake_config(final_block_info.read().await.final_block_cache.block_height) + .lake_config( + blocks_info_by_finality + .read() + .await + .final_block + .block_cache + .block_height, + ) .await?; let (sender, stream) = near_lake_framework::streamer(lake_config); let mut handlers = tokio_stream::wrappers::ReceiverStream::new(stream) @@ -169,7 +186,7 @@ pub async fn update_final_block_height_regularly( handle_streamer_message( streamer_message, std::sync::Arc::clone(&blocks_cache), - std::sync::Arc::clone(&final_block_info), + std::sync::Arc::clone(&blocks_info_by_finality), &near_rpc_client, ) }) @@ -190,6 +207,83 @@ pub async fn update_final_block_height_regularly( } } +// Task to get and store final block in the cache +// Subscribe to the redis channel and update the finale block in the cache +#[cfg(not(feature = "near_state_indexer_disabled"))] +pub async fn update_final_block_regularly( + blocks_cache: std::sync::Arc< + futures_locks::RwLock>, + >, + blocks_info_by_finality: std::sync::Arc>, + redis_client: redis::Client, + near_rpc_client: JsonRpcClient, +) -> anyhow::Result<()> { + tracing::info!("Task to get and store final block in the cache started"); + let mut subscriber = redis_client.get_async_connection().await?.into_pubsub(); + subscriber.subscribe("final_block").await?; + let mut streamer = subscriber.on_message(); + while let Some(message) = streamer.next().await { + match message.get_payload::() { + Ok(payload) => match serde_json::from_str(&payload) { + Ok(streamer_message) => { + 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 to handle_streamer_message: {:?}", err); + } + } + Err(err) => { + tracing::error!("Error parse payload: {:?}", err); + } + }, + Err(err) => { + tracing::error!("Error reading message: {:?}", err); + } + } + } + Ok(()) +} + +#[cfg(not(feature = "near_state_indexer_disabled"))] +// Task to get and store optimistic block in the cache +// Subscribe to the redis channel and update the optimistic block in the cache +pub async fn update_optimistic_block_regularly( + blocks_info_by_finality: std::sync::Arc>, + redis_client: redis::Client, +) -> anyhow::Result<()> { + tracing::info!("Task to get and store optimistic block in the cache started"); + let mut subscriber = redis_client.get_async_connection().await?.into_pubsub(); + subscriber.subscribe("optimistic_block").await?; + let mut streamer = subscriber.on_message(); + while let Some(message) = streamer.next().await { + match message.get_payload::() { + Ok(payload) => match serde_json::from_str(&payload) { + Ok(streamer_message) => { + let optimistic_block = + BlockInfo::new_from_streamer_message(streamer_message).await; + tracing::debug!( + "Received optimistic block: {:?}", + optimistic_block.block_cache + ); + blocks_info_by_finality.write().await.optimistic_block = optimistic_block; + } + Err(err) => { + tracing::error!("Error parse payload: {:?}", err); + } + }, + Err(err) => { + tracing::error!("Error reading message: {:?}", err); + } + } + } + Ok(()) +} + /// Calculate the cache size based on the available memory. /// For caching we use the limit or if it is not set then all available memory. /// We divide the memory equally between the 3 caches: blocks, compiled_contracts, contract_code. diff --git a/state-indexer/src/main.rs b/state-indexer/src/main.rs index 48e38c15..66523a48 100644 --- a/state-indexer/src/main.rs +++ b/state-indexer/src/main.rs @@ -54,7 +54,7 @@ async fn handle_streamer_message( .collect(), ); let handle_state_change_future = - handle_state_changes(streamer_message, db_manager, block_height, block_hash, &indexer_config); + handle_state_changes(&streamer_message, db_manager, block_height, block_hash, &indexer_config); let update_meta_future = db_manager.update_meta(&indexer_config.general.indexer_id, block_height); @@ -125,19 +125,19 @@ async fn handle_epoch( tracing::instrument(skip(streamer_message, db_manager)) )] async fn handle_state_changes( - streamer_message: near_indexer_primitives::StreamerMessage, + streamer_message: &near_indexer_primitives::StreamerMessage, db_manager: &(impl database::StateIndexerDbManager + Sync + Send + 'static), block_height: u64, block_hash: CryptoHash, indexer_config: &configuration::StateIndexerConfig, ) -> anyhow::Result> { let mut state_changes_to_store = - std::collections::HashMap::::new(); + std::collections::HashMap::::new(); let initial_state_changes = streamer_message .shards - .into_iter() - .flat_map(|shard| shard.state_changes.into_iter()); + .iter() + .flat_map(|shard| shard.state_changes.iter()); // Collecting a unique list of StateChangeWithCauseView for account_id + change kind + suffix // by overwriting the records in the HashMap From b948a941ebe0dfe9798fb45e438d065b43f6f749 Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Tue, 12 Mar 2024 11:57:13 +0200 Subject: [PATCH 4/8] update changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 640b8b17..d45dccd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,14 +6,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased](https://github.com/near/read-rpc/compare/v0.1.0...HEAD) +### Supported Nearcore Version +- nearcore v1.37.1 +- rust v1.76.0 ### Added - Added support for `SyncCheckpoint` in the `block` method for better block handling and synchronization. +- Added support for `OptimisticBlock` in the `block` method for better block handling and synchronization. - Added `ARCHIVAL_PROXY_QUERY_VIEW_STATE_WITH_INCLUDE_PROOFS` metric to track the number of archival proxy requests for view state with include proofs. - Added `TOTAL_REQUESTS_COUNTER` metric to counting total rpc requests. - Added `GET /health` for the healthcheck of rpc-server. - Implemented the `status` method to accommodate `near_primitives::views::StatusResponse`. - Implemented the `health` method. Health includes the info about the syncing state of the node of `rpc-server`. +- Implemented near-state-indexer to index the state of the nearcore node. ### Changed - Enhanced the tx method to show in-progress transaction status, avoiding `UNKNOWN_TRANSACTION` responses and providing more accurate feedback. From 5287e60cab980336f810c6056861eba581922c8d Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Tue, 12 Mar 2024 15:02:03 +0200 Subject: [PATCH 5/8] Create GitHub Action to build a binary for `near-state-indexer` (#201) --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..1bb9e5fe --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release NearStateIndexer Workflow + +on: + release: + types: [created, published] + +jobs: + build-and-release: + permissions: + contents: write + runs-on: ubuntu-22.04 + if: > + (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || + (github.event_name == 'release' && github.event.action == 'created') + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Install Rust toolchain + run: | + rustup update stable + rustup default stable + + - name: Build release binary + run: | + cargo build --release --package near-state-indexer --verbose + strip target/release/near-state-indexer + cp target/release/near-state-indexer near-state-indexer + + - name: Determine UPLOAD_URL + run: | + if [[ "${{ github.event_name }}" == "push" ]]; then + TAG_NAME=${GITHUB_REF#refs/tags/} + RELEASE_RESPONSE=$(curl -s -X GET -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG_NAME") + UPLOAD_URL=$(echo "$RELEASE_RESPONSE" | jq -r .upload_url) + echo "UPLOAD_URL=$UPLOAD_URL" >> $GITHUB_ENV + else + echo "UPLOAD_URL=${{ github.event.release.upload_url }}" >> $GITHUB_ENV + fi + + - name: Upload release asset + uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ env.UPLOAD_URL }} + asset_path: ./near-state-indexer/near-state-indexer + asset_name: near-state-indexer + asset_content_type: application/octet-stream + From e91e25f322ec74982fa2eaed91f708c321f59251 Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Thu, 14 Mar 2024 17:30:05 +0200 Subject: [PATCH 6/8] Improvements for near-state-indexer and rpc-server (#202) * 1. Improvement builds for near-state-indexer and rpc-server 2. Umprovement metrics for near-state-indexer * update nearcore to 1.38.0-rc.2 (#203) --- .cargo/config.toml | 2 + Cargo.lock | 237 ++++++++++++++------------- Cargo.toml | 25 +-- configuration/src/configs/general.rs | 12 -- near-state-indexer/Cargo.toml | 7 +- near-state-indexer/build.rs | 20 +++ near-state-indexer/src/main.rs | 29 ++-- near-state-indexer/src/metrics.rs | 74 +++------ rpc-server/Cargo.toml | 4 + rpc-server/Dockerfile | 2 + rpc-server/build.rs | 20 +++ rpc-server/src/config.rs | 8 +- 12 files changed, 224 insertions(+), 216 deletions(-) create mode 100644 .cargo/config.toml create mode 100644 near-state-indexer/build.rs create mode 100644 rpc-server/build.rs diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..794c4046 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[env] +NEARCORE_VERSION = "1.38.0-rc.2" diff --git a/Cargo.lock b/Cargo.lock index fffeac43..c0578bea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -413,9 +413,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "arbitrary" @@ -573,9 +573,9 @@ dependencies = [ [[package]] name = "aws-config" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b96342ea8948ab9bef3e6234ea97fc32e2d8a88d8fb6a084e52267317f94b6b" +checksum = "4f4084d18094aec9f79d509f4cb6ccf6b613c5037e32f32e74312e52b836e366" dependencies = [ "aws-credential-types", "aws-runtime", @@ -603,9 +603,9 @@ dependencies = [ [[package]] name = "aws-credential-types" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "273fa47dafc9ef14c2c074ddddbea4561ff01b7f68d5091c0e9737ced605c01d" +checksum = "fa8587ae17c8e967e4b05a62d495be2fb7701bec52a97f7acfe8a29f938384c8" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -640,9 +640,9 @@ dependencies = [ [[package]] name = "aws-runtime" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e38bab716c8bf07da24be07ecc02e0f5656ce8f30a891322ecdcb202f943b85" +checksum = "b13dc54b4b49f8288532334bba8f87386a40571c47c37b1304979b556dc613c8" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -664,10 +664,11 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d35d39379445970fc3e4ddf7559fff2c32935ce0b279f9cb27080d6b7c6d94" +checksum = "be7167516f69aff3acca64e47c993336105e62f008067d2695324dfa5cbfdba6" dependencies = [ + "ahash 0.8.11", "aws-credential-types", "aws-runtime", "aws-sigv4", @@ -682,20 +683,25 @@ dependencies = [ "aws-smithy-xml", "aws-types", "bytes", + "fastrand 2.0.1", + "hex", + "hmac", "http 0.2.12", "http-body", + "lru 0.12.3", "once_cell", "percent-encoding", "regex-lite", + "sha2", "tracing", "url", ] [[package]] name = "aws-sdk-sso" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84bd3925a17c9adbf6ec65d52104a44a09629d8f70290542beeee69a95aee7f" +checksum = "6729c96a2bc5acdbc0d6f406415678c24de30a9999f33084a34e64fc415cc365" dependencies = [ "aws-credential-types", "aws-runtime", @@ -715,9 +721,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c2dae39e997f58bc4d6292e6244b26ba630c01ab671b6f9f44309de3eb80ab8" +checksum = "9ccdd38f35f089c16fe0641cda34f2d06e3ab7b99a884407bce350a9fa70b1a9" dependencies = [ "aws-credential-types", "aws-runtime", @@ -737,9 +743,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fd9a53869fee17cea77e352084e1aa71e2c5e323d974c13a9c2bcfd9544c7f" +checksum = "396e8064892a3c08b25b60fe3abda7ff5afa74efee500572cae65122ba5afd0d" dependencies = [ "aws-credential-types", "aws-runtime", @@ -760,9 +766,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.1.7" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ada00a4645d7d89f296fe0ddbc3fe3554f03035937c849a05d37ddffc1f29a1" +checksum = "11d6f29688a4be9895c0ba8bef861ad0c0dac5c15e9618b9b7a6c233990fc263" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -789,9 +795,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf7f09a27286d84315dfb9346208abb3b0973a692454ae6d0bc8d803fcce3b4" +checksum = "d26ea8fa03025b2face2b3038a63525a10891e3d8829901d502e5384a0d8cd46" dependencies = [ "futures-util", "pin-project-lite", @@ -800,9 +806,9 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.6" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fd4b66f2a8e7c84d7e97bda2666273d41d2a2e25302605bcf906b7b2661ae5e" +checksum = "83fa43bc04a6b2441968faeab56e68da3812f978a670a5db32accbdcafddd12f" dependencies = [ "aws-smithy-http", "aws-smithy-types", @@ -832,9 +838,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.6" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6ca214a6a26f1b7ebd63aa8d4f5e2194095643023f9608edf99a58247b9d80d" +checksum = "3f10fa66956f01540051b0aa7ad54574640f748f9839e843442d99b970d3aff9" dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", @@ -853,18 +859,18 @@ dependencies = [ [[package]] name = "aws-smithy-json" -version = "0.60.6" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1af80ecf3057fb25fe38d1687e94c4601a7817c6a1e87c1b0635f7ecb644ace5" +checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-query" -version = "0.60.6" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb27084f72ea5fc20033efe180618677ff4a2f474b53d84695cfe310a6526cbc" +checksum = "f2fbd61ceb3fe8a1cb7352e42689cec5335833cd9f94103a61e98f9bb61c64bb" dependencies = [ "aws-smithy-types", "urlencoding", @@ -872,9 +878,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbb5fca54a532a36ff927fbd7407a7c8eb9c3b4faf72792ba2965ea2cad8ed55" +checksum = "ec81002d883e5a7fd2bb063d6fb51c4999eb55d404f4fff3dd878bf4733b9f01" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -897,9 +903,9 @@ dependencies = [ [[package]] name = "aws-smithy-runtime-api" -version = "1.1.7" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22389cb6f7cac64f266fb9f137745a9349ced7b47e0d2ba503e9e40ede4f7060" +checksum = "9acb931e0adaf5132de878f1398d83f8677f90ba70f01f65ff87f6d7244be1c5" dependencies = [ "aws-smithy-async", "aws-smithy-types", @@ -914,9 +920,9 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f081da5481210523d44ffd83d9f0740320050054006c719eae0232d411f024d3" +checksum = "abe14dceea1e70101d38fbf2a99e6a34159477c0fb95e68e05c66bd7ae4c3729" dependencies = [ "base64-simd", "bytes", @@ -937,18 +943,18 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.60.6" +version = "0.60.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fccd8f595d0ca839f9f2548e66b99514a85f92feb4c01cf2868d93eb4888a42" +checksum = "872c68cf019c0e4afc5de7753c4f7288ce4b71663212771bf5e4542eb9346ca9" dependencies = [ "xmlparser", ] [[package]] name = "aws-types" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07c63521aa1ea9a9f92a701f1a08ce3fd20b46c6efc0d5c8947c1fd879e3df1" +checksum = "0dbf2f3da841a8930f159163175cf6a3d16ddde517c1b0fba7aa776822800f40" dependencies = [ "aws-credential-types", "aws-smithy-async", @@ -1516,7 +1522,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "toml 0.8.10", + "toml 0.8.11", "tracing", "tracing-opentelemetry 0.19.0", "tracing-stackdriver", @@ -2496,7 +2502,7 @@ dependencies = [ "database", "near-chain-configs 0.0.0", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.2)", "near-lake-framework", "readnode-primitives", "tokio", @@ -3792,7 +3798,7 @@ dependencies = [ [[package]] name = "near-async" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "derive_more", @@ -3810,7 +3816,7 @@ dependencies = [ [[package]] name = "near-async-derive" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "proc-macro2", "quote", @@ -3820,7 +3826,7 @@ dependencies = [ [[package]] name = "near-cache" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "lru 0.7.8", ] @@ -3828,7 +3834,7 @@ dependencies = [ [[package]] name = "near-chain" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "assert_matches", @@ -3874,7 +3880,7 @@ dependencies = [ [[package]] name = "near-chain-configs" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "anyhow", "bytesize", @@ -3922,7 +3928,7 @@ dependencies = [ [[package]] name = "near-chain-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "near-async", "near-crypto 0.0.0", @@ -3935,7 +3941,7 @@ dependencies = [ [[package]] name = "near-chunks" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "borsh 1.3.1", @@ -3968,7 +3974,7 @@ dependencies = [ [[package]] name = "near-chunks-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "near-chain-primitives", "near-primitives 0.0.0", @@ -3977,7 +3983,7 @@ dependencies = [ [[package]] name = "near-client" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "actix-rt", @@ -4033,7 +4039,7 @@ dependencies = [ [[package]] name = "near-client-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "chrono", @@ -4055,7 +4061,7 @@ dependencies = [ [[package]] name = "near-config-utils" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "anyhow", "json_comments", @@ -4078,7 +4084,7 @@ dependencies = [ [[package]] name = "near-crypto" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "blake2", "borsh 1.3.1", @@ -4129,7 +4135,7 @@ dependencies = [ [[package]] name = "near-dyn-configs" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "anyhow", "near-async", @@ -4148,7 +4154,7 @@ dependencies = [ [[package]] name = "near-epoch-manager" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "borsh 1.3.1", "itertools 0.10.5", @@ -4171,7 +4177,7 @@ dependencies = [ [[package]] name = "near-fmt" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "near-primitives-core 0.0.0", ] @@ -4188,7 +4194,7 @@ dependencies = [ [[package]] name = "near-indexer" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "anyhow", @@ -4216,7 +4222,7 @@ dependencies = [ [[package]] name = "near-indexer-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "near-primitives 0.0.0", "serde", @@ -4226,7 +4232,7 @@ dependencies = [ [[package]] name = "near-jsonrpc" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "actix-cors 0.6.5", @@ -4258,7 +4264,7 @@ dependencies = [ [[package]] name = "near-jsonrpc-client" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix-http", "awc", @@ -4291,7 +4297,7 @@ dependencies = [ [[package]] name = "near-jsonrpc-client" version = "0.8.0" -source = "git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3#8f0c9ce3ad0f701a270a852cddccf016c78adfd4" +source = "git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.2#a73423f1e348210466da7c82bd610b02f8aad80e" dependencies = [ "borsh 1.3.1", "lazy_static", @@ -4309,7 +4315,7 @@ dependencies = [ [[package]] name = "near-jsonrpc-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "arbitrary", "near-chain-configs 0.0.0", @@ -4342,7 +4348,7 @@ dependencies = [ [[package]] name = "near-lake-framework" version = "0.0.0" -source = "git+https://github.com/kobayurii/near-lake-framework-rs.git?branch=0.7.10#642f3021dcb9757827eef376b1680835efa7f8ce" +source = "git+https://github.com/kobayurii/near-lake-framework-rs.git?branch=0.7.8#84cf76a39669914bd46a01d8463761efd576c230" dependencies = [ "anyhow", "async-stream", @@ -4366,7 +4372,7 @@ dependencies = [ [[package]] name = "near-mainnet-res" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "near-account-id", "near-chain-configs 0.0.0", @@ -4377,7 +4383,7 @@ dependencies = [ [[package]] name = "near-network" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "anyhow", @@ -4426,7 +4432,7 @@ dependencies = [ [[package]] name = "near-o11y" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "base64 0.21.7", @@ -4479,7 +4485,7 @@ dependencies = [ [[package]] name = "near-parameters" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "borsh 1.3.1", "enum-map", @@ -4515,7 +4521,7 @@ dependencies = [ [[package]] name = "near-performance-metrics" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "bitflags 1.3.2", @@ -4531,7 +4537,7 @@ dependencies = [ [[package]] name = "near-performance-metrics-macros" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "quote", "syn 2.0.52", @@ -4540,7 +4546,7 @@ dependencies = [ [[package]] name = "near-pool" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "borsh 1.3.1", "near-crypto 0.0.0", @@ -4553,7 +4559,7 @@ dependencies = [ [[package]] name = "near-primitives" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "arbitrary", "base64 0.21.7", @@ -4636,7 +4642,7 @@ dependencies = [ [[package]] name = "near-primitives-core" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "arbitrary", "base64 0.21.7", @@ -4677,7 +4683,7 @@ dependencies = [ [[package]] name = "near-rosetta-rpc" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "actix-cors 0.6.5", @@ -4708,7 +4714,7 @@ dependencies = [ [[package]] name = "near-rpc-error-core" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "quote", "serde", @@ -4729,7 +4735,7 @@ dependencies = [ [[package]] name = "near-rpc-error-macro" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "near-rpc-error-core 0.0.0", "serde", @@ -4762,13 +4768,13 @@ dependencies = [ "futures", "hex", "humantime", - "lazy_static", "near-client", "near-indexer", "near-o11y 0.0.0", + "once_cell", "openssl-probe", - "prometheus", "redis", + "rustc_version 0.4.0", "serde_json", "tokio", "tokio-stream", @@ -4778,7 +4784,7 @@ dependencies = [ [[package]] name = "near-stdx" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" [[package]] name = "near-stdx" @@ -4789,7 +4795,7 @@ checksum = "855fd5540e3b4ff6fedf12aba2db1ee4b371b36f465da1363a6d022b27cb43b8" [[package]] name = "near-store" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "actix-rt", @@ -4831,7 +4837,7 @@ dependencies = [ [[package]] name = "near-telemetry" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "awc", @@ -4850,7 +4856,7 @@ dependencies = [ [[package]] name = "near-vm-compiler" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "enumset", "finite-wasm", @@ -4866,7 +4872,7 @@ dependencies = [ [[package]] name = "near-vm-compiler-singlepass" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "dynasm 2.0.0", "dynasmrt 2.0.0", @@ -4887,7 +4893,7 @@ dependencies = [ [[package]] name = "near-vm-engine" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "backtrace", "cfg-if 1.0.0", @@ -4910,7 +4916,7 @@ dependencies = [ [[package]] name = "near-vm-runner" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "anyhow", "base64 0.21.7", @@ -4989,7 +4995,7 @@ dependencies = [ [[package]] name = "near-vm-types" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "indexmap 1.9.3", "num-traits", @@ -5000,7 +5006,7 @@ dependencies = [ [[package]] name = "near-vm-vm" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "backtrace", "cc", @@ -5021,7 +5027,7 @@ dependencies = [ [[package]] name = "near-wallet-contract" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "anyhow", "near-vm-runner 0.0.0", @@ -5030,7 +5036,7 @@ dependencies = [ [[package]] name = "nearcore" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "actix", "actix-rt", @@ -5119,7 +5125,7 @@ dependencies = [ [[package]] name = "node-runtime" version = "0.0.0" -source = "git+https://github.com/near/nearcore.git?rev=4429cc8682eb3c00901af5d96233fef04768bf5a#4429cc8682eb3c00901af5d96233fef04768bf5a" +source = "git+https://github.com/near/nearcore.git?rev=836dbb7971a8d183e02f95d81d8a9ae18e731b37#836dbb7971a8d183e02f95d81d8a9ae18e731b37" dependencies = [ "borsh 1.3.1", "hex", @@ -5986,9 +5992,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -6313,7 +6319,7 @@ dependencies = [ "near-chain-configs 0.0.0", "near-crypto 0.0.0", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.2)", "near-jsonrpc-primitives 0.0.0", "near-lake-framework", "near-parameters 0.0.0", @@ -6323,6 +6329,7 @@ dependencies = [ "prometheus", "readnode-primitives", "redis", + "rustc_version 0.4.0", "serde", "serde_json", "sysinfo 0.30.7", @@ -6492,9 +6499,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.25" +version = "0.11.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" +checksum = "78bf93c4af7a8bb7d879d51cebe797356ff10ae8516ace542b5182d9dcac10b2" dependencies = [ "base64 0.21.7", "bytes", @@ -7099,9 +7106,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.6.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d167997bd841ec232f5b2b8e0e26606df2e7caa4c31b95ea9ca52b200bd270" +checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" dependencies = [ "base64 0.21.7", "chrono", @@ -7117,9 +7124,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.6.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865f9743393e638991566a8b7a479043c2c8da94a33e0a31f18214c9cae0a64d" +checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" dependencies = [ "darling 0.20.8", "proc-macro2", @@ -7381,7 +7388,7 @@ dependencies = [ "humantime", "lazy_static", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.2)", "near-lake-framework", "near-primitives 0.0.0", "openssl-probe", @@ -7558,20 +7565,20 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ - "bitflags 2.4.2", + "bitflags 1.3.2", "core-foundation", "system-configuration-sys", ] [[package]] name = "system-configuration-sys" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" dependencies = [ "core-foundation-sys", "libc", @@ -7620,18 +7627,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", @@ -7898,14 +7905,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.6", + "toml_edit 0.22.7", ] [[package]] @@ -7943,9 +7950,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.6" +version = "0.22.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992" dependencies = [ "indexmap 2.2.5", "serde", @@ -8223,7 +8230,7 @@ dependencies = [ "humantime", "lazy_static", "near-indexer-primitives", - "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.3)", + "near-jsonrpc-client 0.8.0 (git+https://github.com/kobayurii/near-jsonrpc-client-rs.git?branch=0.8.2)", "near-lake-framework", "prometheus", "readnode-primitives", @@ -8983,9 +8990,9 @@ dependencies = [ [[package]] name = "wildmatch" -version = "2.3.0" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495ec47bf3c1345005f40724f0269362c8556cbc43aed0526ed44cae1d35fceb" +checksum = "d9d63b4687b0737f3b9e0f3a299ffd65824623859303a8e148443c3611c5c445" [[package]] name = "winapi" diff --git a/Cargo.toml b/Cargo.toml index 8190ea54..f9af9f04 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,16 +27,17 @@ database = { path = "database" } readnode-primitives = { path = "readnode-primitives" } epoch-indexer = { path = "epoch-indexer" } -near-indexer = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-client = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-o11y = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-indexer-primitives = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-primitives = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-chain-configs = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-crypto = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-jsonrpc-primitives = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-parameters = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } -near-vm-runner = { git = 'https://github.com/near/nearcore.git', rev = '4429cc8682eb3c00901af5d96233fef04768bf5a' } +# Please, update the supported nearcore version in .cargo/config.toml file +near-indexer = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } +near-client = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } +near-o11y = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } +near-indexer-primitives = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } +near-primitives = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } +near-chain-configs = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } +near-crypto = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } +near-jsonrpc-primitives = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } +near-parameters = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } +near-vm-runner = { git = 'https://github.com/near/nearcore.git', rev = '836dbb7971a8d183e02f95d81d8a9ae18e731b37' } -near-lake-framework = { git = 'https://github.com/kobayurii/near-lake-framework-rs.git', branch = '0.7.10' } -near-jsonrpc-client = { git = 'https://github.com/kobayurii/near-jsonrpc-client-rs.git', branch = '0.8.3'} +near-lake-framework = { git = 'https://github.com/kobayurii/near-lake-framework-rs.git', branch = '0.7.8' } +near-jsonrpc-client = { git = 'https://github.com/kobayurii/near-jsonrpc-client-rs.git', branch = '0.8.2'} diff --git a/configuration/src/configs/general.rs b/configuration/src/configs/general.rs index 43a6f6eb..73875eb8 100644 --- a/configuration/src/configs/general.rs +++ b/configuration/src/configs/general.rs @@ -45,7 +45,6 @@ pub struct GeneralStateIndexerConfig { pub struct GeneralNearStateIndexerConfig { pub chain_id: ChainId, pub redis_url: String, - pub metrics_server_port: u16, pub concurrency: usize, } @@ -231,17 +230,11 @@ impl Default for CommonGeneralStateIndexerConfig { #[derive(Deserialize, Debug, Clone)] pub struct CommonGeneralNearStateIndexerConfig { - #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] - pub metrics_server_port: Option, #[serde(deserialize_with = "deserialize_optional_data_or_env", default)] pub concurrency: Option, } impl CommonGeneralNearStateIndexerConfig { - pub fn default_metrics_server_port() -> u16 { - 8082 - } - pub fn default_concurrency() -> usize { 1 } @@ -250,7 +243,6 @@ impl CommonGeneralNearStateIndexerConfig { impl Default for CommonGeneralNearStateIndexerConfig { fn default() -> Self { Self { - metrics_server_port: Some(Self::default_metrics_server_port()), concurrency: Some(Self::default_concurrency()), } } @@ -365,10 +357,6 @@ impl From for GeneralNearStateIndexerConfig { redis_url: common_config .redis_url .unwrap_or("redis://127.0.0.1/".to_string()), - metrics_server_port: common_config - .near_state_indexer - .metrics_server_port - .unwrap_or_else(CommonGeneralNearStateIndexerConfig::default_metrics_server_port), concurrency: common_config .near_state_indexer .concurrency diff --git a/near-state-indexer/Cargo.toml b/near-state-indexer/Cargo.toml index 60770620..a308cef2 100644 --- a/near-state-indexer/Cargo.toml +++ b/near-state-indexer/Cargo.toml @@ -7,6 +7,10 @@ rust-version.workspace = true repository.workspace = true license.workspace = true +[build-dependencies] +anyhow = "1.0.51" +rustc_version = "0.4" + [dependencies] actix = "0.13.3" actix-web = "4.2.1" @@ -16,9 +20,8 @@ clap = "4.4.18" futures = "0.3.5" hex = "0.4.3" humantime = "2.1.0" -lazy_static = "1.4.0" openssl-probe = "0.1.5" -prometheus = "0.13.1" +once_cell = "1.19.0" redis = { version = "0.24.0", features = ["tokio-comp", "connection-manager"] } serde_json = "1.0.64" tokio = { version = "1.36.0", features = [ diff --git a/near-state-indexer/build.rs b/near-state-indexer/build.rs new file mode 100644 index 00000000..777e594b --- /dev/null +++ b/near-state-indexer/build.rs @@ -0,0 +1,20 @@ +/// This build.rs script is used to generate build-time information and set environment variables for the build process. +/// It retrieves the Rust compiler version and sets it as the `RUSTC_VERSION` environment variable. +/// It also sets the `BUILD_VERSION` environment variable to the value of `NEARCORE_VERSION` defined in the project. +/// Additionally, it prints messages to indicate which files should trigger a rebuild when changed. +fn get_rustc_version() -> anyhow::Result { + let version = rustc_version::version()?; + Ok(version.to_string()) +} + +fn main() -> anyhow::Result<()> { + println!("cargo:rerun-if-changed=.git/HEAD"); + println!("cargo:rerun-if-changed=.git/index"); + + println!("cargo:rustc-env=BUILD_VERSION={}", env!("NEARCORE_VERSION")); + + let rustc_version = get_rustc_version()?; + println!("cargo:rustc-env=RUSTC_VERSION={}", rustc_version); + + Ok(()) +} diff --git a/near-state-indexer/src/main.rs b/near-state-indexer/src/main.rs index c2c802bf..a1a8d64a 100644 --- a/near-state-indexer/src/main.rs +++ b/near-state-indexer/src/main.rs @@ -9,9 +9,6 @@ mod configs; mod metrics; mod utils; -#[macro_use] -extern crate lazy_static; - // Categories for logging pub(crate) const INDEXER: &str = "near_state_indexer"; @@ -83,14 +80,10 @@ async fn handle_streamer_message( published_streamer_message_feature, )?; - metrics::BLOCK_PROCESSED_TOTAL.inc(); - // Prometheus Gauge Metric type do not support u64 - // https://github.com/tikv/rust-prometheus/issues/470 - metrics::LATEST_BLOCK_HEIGHT.set(i64::try_from(block_height)?); - let mut stats_lock = stats.write().await; stats_lock.block_heights_processing.remove(&block_height); stats_lock.blocks_processed_count += 1; + metrics::BLOCKS_DONE.inc(); stats_lock.last_processed_block_height = block_height; if let Some(stats_epoch_id) = stats_lock.current_epoch_id { if current_epoch_id != stats_epoch_id { @@ -245,7 +238,19 @@ async fn main() -> anyhow::Result<()> { let home_dir = opts.home.unwrap_or_else(near_indexer::get_default_home); match opts.subcmd { - configs::SubCommand::Run => run(home_dir).await?, + configs::SubCommand::Run => { + // This will set the near_lake_build_info metric + // e.g. near_lake_build_info{build="1.37.1",release="0.1.29",rustc_version="1.76.0"} + metrics::NODE_BUILD_INFO.reset(); + metrics::NODE_BUILD_INFO + .with_label_values(&[ + env!("CARGO_PKG_VERSION"), + env!("BUILD_VERSION"), + env!("RUSTC_VERSION"), + ]) + .inc(); + run(home_dir).await? + } configs::SubCommand::Init(init_config) => { near_indexer::indexer_init_configs(&home_dir, init_config.into())? } @@ -273,12 +278,6 @@ async fn run(home_dir: std::path::PathBuf) -> anyhow::Result<()> { .get_connection_manager() .await?; - // Initiate metrics http server - tokio::spawn( - metrics::init_server(state_indexer_config.general.metrics_server_port) - .expect("Failed to start metrics server"), - ); - let indexer_config = near_indexer::IndexerConfig { home_dir, sync_mode: near_indexer::SyncModeEnum::LatestSynced, diff --git a/near-state-indexer/src/metrics.rs b/near-state-indexer/src/metrics.rs index 73b6eb4b..6b198109 100644 --- a/near-state-indexer/src/metrics.rs +++ b/near-state-indexer/src/metrics.rs @@ -1,61 +1,25 @@ -use actix_web::{get, App, HttpServer, Responder}; -use prometheus::{Encoder, IntCounter, IntGauge, Opts}; +use near_o11y::metrics::*; +use once_cell::sync::Lazy; -type Result = std::result::Result; - -fn try_create_int_counter(name: &str, help: &str) -> Result { - let opts = Opts::new(name, help); - let counter = IntCounter::with_opts(opts)?; - prometheus::register(Box::new(counter.clone()))?; - Ok(counter) -} - -fn try_create_int_gauge(name: &str, help: &str) -> Result { - let opts = Opts::new(name, help); - let gauge = IntGauge::with_opts(opts)?; - prometheus::register(Box::new(gauge.clone()))?; - Ok(gauge) -} - -lazy_static! { - pub(crate) static ref BLOCK_PROCESSED_TOTAL: IntCounter = try_create_int_counter( - "total_blocks_processed", - "Total number of blocks processed by indexer regardless of restarts. Used to calculate Block Processing Rate(BPS)" +pub static BLOCKS_DONE: Lazy = Lazy::new(|| { + try_create_int_counter( + "near_lake_block_done_total", + "Total number of indexed blocks", ) - .unwrap(); - pub(crate) static ref LATEST_BLOCK_HEIGHT: IntGauge = try_create_int_gauge( - "latest_block_height", - "Last seen block height by indexer" + .unwrap() +}); + +// This metric is present in the near_o11y crate but it's not public +// so we can't use it directly. We have to redefine it here. +pub static NODE_BUILD_INFO: Lazy = Lazy::new(|| { + try_create_int_counter_vec( + "near_lake_build_info", + "Metric whose labels indicate node’s version; see \ + .", + &["release", "build", "rustc_version"], ) - .unwrap(); -} - -#[get("/metrics")] -async fn get_metrics() -> impl Responder { - let encoder = prometheus::TextEncoder::new(); - - let mut buffer = Vec::new(); - if let Err(e) = encoder.encode(&prometheus::gather(), &mut buffer) { - tracing::error!(target: crate::INDEXER, "could not encode metrics: {}", e); - }; - - match String::from_utf8(buffer.clone()) { - Ok(v) => v, - Err(e) => { - tracing::error!(target: crate::INDEXER, "custom metrics could not be from_utf8'd: {}", e); - String::default() - } - } -} - -pub(crate) fn init_server(port: u16) -> anyhow::Result { - tracing::info!(target: crate::INDEXER, "Starting metrics server on http://0.0.0.0:{port}/metrics"); - - Ok(HttpServer::new(|| App::new().service(get_metrics)) - .bind(("0.0.0.0", port))? - .disable_signals() - .run()) -} + .unwrap() +}); #[derive(Debug, Clone)] pub struct Stats { diff --git a/rpc-server/Cargo.toml b/rpc-server/Cargo.toml index bb9398a1..95401036 100644 --- a/rpc-server/Cargo.toml +++ b/rpc-server/Cargo.toml @@ -7,6 +7,10 @@ rust-version.workspace = true repository.workspace = true license.workspace = true +[build-dependencies] +anyhow = "1.0.51" +rustc_version = "0.4" + [dependencies] actix-web = "4.5.1" actix-cors = "0.7.0" diff --git a/rpc-server/Dockerfile b/rpc-server/Dockerfile index 72ab2543..61ff3c4e 100644 --- a/rpc-server/Dockerfile +++ b/rpc-server/Dockerfile @@ -2,6 +2,7 @@ FROM rust:1.76 AS builder ARG features="default" WORKDIR /tmp/ +COPY .cargo .cargo COPY Cargo.lock ./ COPY Cargo.toml ./ COPY config.toml ./ @@ -13,6 +14,7 @@ COPY readnode-primitives readnode-primitives RUN mkdir rpc-server/src && echo 'fn main() {}' > rpc-server/src/main.rs cargo build --release && rm -r rpc-server/src # copy your source tree +COPY rpc-server/build.rs rpc-server/build.rs COPY rpc-server/src ./rpc-server/src # build for release diff --git a/rpc-server/build.rs b/rpc-server/build.rs new file mode 100644 index 00000000..777e594b --- /dev/null +++ b/rpc-server/build.rs @@ -0,0 +1,20 @@ +/// This build.rs script is used to generate build-time information and set environment variables for the build process. +/// It retrieves the Rust compiler version and sets it as the `RUSTC_VERSION` environment variable. +/// It also sets the `BUILD_VERSION` environment variable to the value of `NEARCORE_VERSION` defined in the project. +/// Additionally, it prints messages to indicate which files should trigger a rebuild when changed. +fn get_rustc_version() -> anyhow::Result { + let version = rustc_version::version()?; + Ok(version.to_string()) +} + +fn main() -> anyhow::Result<()> { + println!("cargo:rerun-if-changed=.git/HEAD"); + println!("cargo:rerun-if-changed=.git/index"); + + println!("cargo:rustc-env=BUILD_VERSION={}", env!("NEARCORE_VERSION")); + + let rustc_version = get_rustc_version()?; + println!("cargo:rustc-env=RUSTC_VERSION={}", rustc_version); + + Ok(()) +} diff --git a/rpc-server/src/config.rs b/rpc-server/src/config.rs index c9c9bc5b..6df8ea42 100644 --- a/rpc-server/src/config.rs +++ b/rpc-server/src/config.rs @@ -4,11 +4,9 @@ use futures::executor::block_on; use crate::modules::blocks::{BlocksInfoByFinality, CacheBlock}; -// TODO: Improve versioning in future. -// For now, it's hardcoded and should be updated manually at each release.. -static NEARD_VERSION: &str = "1.37.1"; -static NEARD_BUILD: &str = "1.37.1"; -static RUSTC_VERSION: &str = "1.76.0"; +static NEARD_VERSION: &str = env!("CARGO_PKG_VERSION"); +static NEARD_BUILD: &str = env!("BUILD_VERSION"); +static RUSTC_VERSION: &str = env!("RUSTC_VERSION"); // Struct to store genesis_config and genesis_block in the server context // Fetch once genesis info on start of the server and put it in the context From f86e8bba34b49210919c6569889aadf058bf561c Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Thu, 14 Mar 2024 17:34:18 +0200 Subject: [PATCH 7/8] chore: release v0.2.0-rc.1 --- CHANGELOG.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d45dccd0..34dcf0fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,9 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased](https://github.com/near/read-rpc/compare/v0.1.0...HEAD) +## [Unreleased](https://github.com/near/read-rpc/compare/0.2.0-rc.1...HEAD) + +## [0.2.0-rc.1](https://github.com/near/read-rpc/releases/tag/0.2.0-rc.1) + ### Supported Nearcore Version -- nearcore v1.37.1 +- nearcore v.38.0-rc.2 - rust v1.76.0 ### Added From 82f37b55b2751ced70393ce581830efd5716fa79 Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Fri, 15 Mar 2024 14:43:53 +0200 Subject: [PATCH 8/8] set feature near_state_indexer_disabled as a default (#204) --- rpc-server/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rpc-server/Cargo.toml b/rpc-server/Cargo.toml index 95401036..daa35435 100644 --- a/rpc-server/Cargo.toml +++ b/rpc-server/Cargo.toml @@ -54,7 +54,7 @@ near-parameters.workspace = true near-vm-runner.workspace = true [features] -default = ["send_tx_methods", "scylla_db"] +default = ["send_tx_methods", "scylla_db", "near_state_indexer_disabled"] send_tx_methods = [] near_state_indexer_disabled = [] # Use this feature if you don't run near-state-indexer tracing-instrumentation = ["configuration/tracing-instrumentation"]