diff --git a/Cargo.lock b/Cargo.lock index bd2d4190..caa230e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1410,7 +1410,7 @@ dependencies = [ "anyhow", "borsh 1.5.1", "futures", - "near-indexer-primitives 2.0.0", + "near-indexer-primitives", "readnode-primitives", "redis", "serde_json", @@ -3732,7 +3732,7 @@ dependencies = [ "itertools 0.13.0", "lazy_static", "near-chain-configs 2.0.0", - "near-indexer-primitives 2.0.0", + "near-indexer-primitives", "near-jsonrpc-client 0.11.0", "near-primitives 2.0.0", "prometheus", @@ -3741,26 +3741,6 @@ dependencies = [ "tracing", ] -[[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" @@ -4039,7 +4019,7 @@ dependencies = [ "near-async-derive", "near-o11y 2.0.0", "near-performance-metrics", - "near-time 2.0.0", + "near-time", "once_cell", "serde", "serde_json", @@ -4058,15 +4038,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "near-cache" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b222afeb8daa3849626f0ce713806ce8be2b33e4aac54913dc7ef1db1fa83d7" -dependencies = [ - "lru 0.7.8", -] - [[package]] name = "near-cache" version = "2.0.0" @@ -4092,7 +4063,7 @@ dependencies = [ "itoa", "lru 0.7.8", "near-async", - "near-cache 2.0.0", + "near-cache", "near-chain-configs 2.0.0", "near-chain-primitives", "near-client-primitives", @@ -4243,7 +4214,7 @@ dependencies = [ "itertools 0.10.5", "lru 0.7.8", "near-async", - "near-cache 2.0.0", + "near-cache", "near-chain", "near-chain-configs 2.0.0", "near-chain-primitives", @@ -4317,42 +4288,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "near-config-utils" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1c9ff519efa8c778d341fa34971dee93e8adf4e8ae51feaefaa63bdf7e496a" -dependencies = [ - "anyhow", - "json_comments", - "thiserror", - "tracing", -] - -[[package]] -name = "near-config-utils" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a235b0e65fe978fd8e1579fb08acba1792bdc5932523e5e6092a5aebdb77f513" -dependencies = [ - "anyhow", - "json_comments", - "thiserror", - "tracing", -] - -[[package]] -name = "near-config-utils" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b3db4ac2d4340caef06b6363c3fd16c0be1f70267908dfa53e2e6241649b0c" -dependencies = [ - "anyhow", - "json_comments", - "thiserror", - "tracing", -] - [[package]] name = "near-config-utils" version = "2.0.0" @@ -4391,85 +4326,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "near-crypto" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d927e95742aea981b9fd60996fbeba3b61e90acafd54c2c3c2a4ed40065ff03" -dependencies = [ - "blake2 0.9.2", - "borsh 1.5.1", - "bs58", - "c2-chacha", - "curve25519-dalek", - "derive_more", - "ed25519-dalek", - "hex", - "near-account-id", - "near-config-utils 0.21.2", - "near-stdx 0.21.2", - "once_cell", - "primitive-types", - "rand 0.7.3", - "secp256k1", - "serde", - "serde_json", - "subtle", - "thiserror", -] - -[[package]] -name = "near-crypto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d914f93b5fcec0cf6d897e04cb98622a38653924b1ef06c0e69c3d24854dfb3" -dependencies = [ - "blake2 0.9.2", - "borsh 1.5.1", - "bs58", - "c2-chacha", - "curve25519-dalek", - "derive_more", - "ed25519-dalek", - "hex", - "near-account-id", - "near-config-utils 0.22.0", - "near-stdx 0.22.0", - "once_cell", - "primitive-types", - "rand 0.7.3", - "secp256k1", - "serde", - "serde_json", - "subtle", - "thiserror", -] - -[[package]] -name = "near-crypto" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9807fb257f7dda41383bb33e14cfd4a8840ffa7932cb972db9eabff19ce3bf4" -dependencies = [ - "blake2 0.10.6", - "borsh 1.5.1", - "bs58", - "curve25519-dalek", - "derive_more", - "ed25519-dalek", - "hex", - "near-account-id", - "near-config-utils 0.23.0", - "near-stdx 0.23.0", - "once_cell", - "primitive-types", - "secp256k1", - "serde", - "serde_json", - "subtle", - "thiserror", -] - [[package]] name = "near-crypto" version = "2.0.0" @@ -4521,7 +4377,7 @@ source = "git+https://github.com/kobayurii/nearcore.git?branch=2.0.0-fork1#dee62 dependencies = [ "borsh 1.5.1", "itertools 0.10.5", - "near-cache 2.0.0", + "near-cache", "near-chain-configs 2.0.0", "near-chain-primitives", "near-crypto 2.0.0", @@ -4547,33 +4403,6 @@ dependencies = [ "near-primitives-core 0.20.1", ] -[[package]] -name = "near-fmt" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aa862014eeedb79df494b1b8080c5b51cd014f978183e08a7918a50350558" -dependencies = [ - "near-primitives-core 0.21.2", -] - -[[package]] -name = "near-fmt" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "594b6636fb6f69469a01761132d7aba59410d451169427fdd141cddb3ff9eb3d" -dependencies = [ - "near-primitives-core 0.22.0", -] - -[[package]] -name = "near-fmt" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00ce363e4078b870775e2a5a5189feae22f0870ca673f6409b1974922dada0c4" -dependencies = [ - "near-primitives-core 0.23.0", -] - [[package]] name = "near-fmt" version = "2.0.0" @@ -4595,7 +4424,7 @@ dependencies = [ "near-client", "near-crypto 2.0.0", "near-dyn-configs", - "near-indexer-primitives 2.0.0", + "near-indexer-primitives", "near-o11y 2.0.0", "near-parameters 2.0.0", "near-primitives 2.0.0", @@ -4610,50 +4439,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "near-indexer-primitives" -version = "0.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "362042db6d020aba9ac03dadf32088f848cc2156c9a7976d45a2a9cf6b18548e" -dependencies = [ - "near-primitives 0.20.1", - "serde", - "serde_json", -] - -[[package]] -name = "near-indexer-primitives" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a584b253186387b648312d9510ebbece3ebb974335a71d52be6645521e4ec4e" -dependencies = [ - "near-primitives 0.21.2", - "serde", - "serde_json", -] - -[[package]] -name = "near-indexer-primitives" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0cf897dec2750324f4e2f9e4795a906f4802b3a57d17245a99aa9da2d7fa60" -dependencies = [ - "near-primitives 0.22.0", - "serde", - "serde_json", -] - -[[package]] -name = "near-indexer-primitives" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca85c74772338d1b8c8b8729ffa14dec44dacefa2ce367795f3de8846f2fdc06" -dependencies = [ - "near-primitives 0.23.0", - "serde", - "serde_json", -] - [[package]] name = "near-indexer-primitives" version = "2.0.0" @@ -4795,7 +4580,7 @@ dependencies = [ "aws-types", "derive_builder", "futures", - "near-indexer-primitives 2.0.0", + "near-indexer-primitives", "serde", "serde_json", "thiserror", @@ -4894,62 +4679,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "near-o11y" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b64d008979998e436ac5ad2e60326d1a7f2d30dcb5a22c1a4657159f7f284342" -dependencies = [ - "actix", - "base64 0.21.7", - "clap", - "near-crypto 0.21.2", - "near-fmt 0.21.2", - "near-primitives-core 0.21.2", - "once_cell", - "opentelemetry 0.17.0", - "opentelemetry-otlp 0.10.0", - "opentelemetry-semantic-conventions 0.9.0", - "prometheus", - "serde", - "serde_json", - "strum", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-opentelemetry 0.17.4", - "tracing-subscriber", -] - -[[package]] -name = "near-o11y" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba830de3e7f0c5ef9a9baa4d96012b6d2605263434c399fc4472c6b42f1a451c" -dependencies = [ - "actix", - "base64 0.21.7", - "clap", - "near-crypto 0.22.0", - "near-fmt 0.22.0", - "near-primitives-core 0.22.0", - "once_cell", - "opentelemetry 0.17.0", - "opentelemetry-otlp 0.10.0", - "opentelemetry-semantic-conventions 0.9.0", - "prometheus", - "serde", - "serde_json", - "strum", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-opentelemetry 0.17.4", - "tracing-subscriber", -] - [[package]] name = "near-o11y" version = "2.0.0" @@ -4997,15 +4726,13 @@ dependencies = [ [[package]] name = "near-parameters" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a996c8654020f7eb3c11039cb39123fd4cd78654fde4c9e7c3fd6d092c84f342" +version = "2.0.0" +source = "git+https://github.com/kobayurii/nearcore.git?branch=2.0.0-fork1#dee6256d011b1e2ed5cf83c7ad06308a128259da" dependencies = [ - "assert_matches", "borsh 1.5.1", "enum-map", "near-account-id", - "near-primitives-core 0.21.2", + "near-primitives-core 2.0.0", "num-rational", "serde", "serde_repr", @@ -5015,73 +4742,19 @@ dependencies = [ ] [[package]] -name = "near-parameters" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abd6c442a368c7cdd0cb323712f02e8024f23f189439c9056973dc3657b72ea" +name = "near-performance-metrics" +version = "2.0.0" +source = "git+https://github.com/kobayurii/nearcore.git?branch=2.0.0-fork1#dee6256d011b1e2ed5cf83c7ad06308a128259da" dependencies = [ - "assert_matches", - "borsh 1.5.1", - "enum-map", - "near-account-id", - "near-primitives-core 0.22.0", - "num-rational", - "serde", - "serde_repr", - "serde_yaml", - "strum", - "thiserror", -] - -[[package]] -name = "near-parameters" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddf39f5f729976a791d86e0e30a71ec4d8e8dcf58117c8694e7b22fb3f50ee6" -dependencies = [ - "borsh 1.5.1", - "enum-map", - "near-account-id", - "near-primitives-core 0.23.0", - "num-rational", - "serde", - "serde_repr", - "serde_yaml", - "strum", - "thiserror", -] - -[[package]] -name = "near-parameters" -version = "2.0.0" -source = "git+https://github.com/kobayurii/nearcore.git?branch=2.0.0-fork1#dee6256d011b1e2ed5cf83c7ad06308a128259da" -dependencies = [ - "borsh 1.5.1", - "enum-map", - "near-account-id", - "near-primitives-core 2.0.0", - "num-rational", - "serde", - "serde_repr", - "serde_yaml", - "strum", - "thiserror", -] - -[[package]] -name = "near-performance-metrics" -version = "2.0.0" -source = "git+https://github.com/kobayurii/nearcore.git?branch=2.0.0-fork1#dee6256d011b1e2ed5cf83c7ad06308a128259da" -dependencies = [ - "actix", - "bitflags 1.3.2", - "bytes", - "futures", - "libc", - "once_cell", - "tokio", - "tokio-util 0.7.11", - "tracing", + "actix", + "bitflags 1.3.2", + "bytes", + "futures", + "libc", + "once_cell", + "tokio", + "tokio-util 0.7.11", + "tracing", ] [[package]] @@ -5148,132 +4821,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "near-primitives" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c880397c022d3b8f592cef18f85fd6e79181a2a04c31154afb1730f9fa21098" -dependencies = [ - "arbitrary", - "base64 0.21.7", - "borsh 1.5.1", - "bytesize", - "cfg-if 1.0.0", - "chrono", - "derive_more", - "easy-ext 0.2.9", - "enum-map", - "hex", - "near-crypto 0.21.2", - "near-fmt 0.21.2", - "near-o11y 0.21.2", - "near-parameters 0.21.2", - "near-primitives-core 0.21.2", - "near-rpc-error-macro 0.21.2", - "near-stdx 0.21.2", - "near-vm-runner 0.21.2", - "num-rational", - "once_cell", - "primitive-types", - "rand 0.8.5", - "rand_chacha 0.3.1", - "reed-solomon-erasure 4.0.2", - "serde", - "serde_json", - "serde_with", - "serde_yaml", - "sha3", - "smart-default", - "strum", - "thiserror", - "time", - "tracing", -] - -[[package]] -name = "near-primitives" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c1c3d27ae7ea27a2844385246f007a7a75f703ac135e95e27795a4cf4dfad4b" -dependencies = [ - "arbitrary", - "base64 0.21.7", - "borsh 1.5.1", - "bytesize", - "cfg-if 1.0.0", - "chrono", - "derive_more", - "easy-ext 0.2.9", - "enum-map", - "hex", - "near-crypto 0.22.0", - "near-fmt 0.22.0", - "near-o11y 0.22.0", - "near-parameters 0.22.0", - "near-primitives-core 0.22.0", - "near-rpc-error-macro 0.22.0", - "near-stdx 0.22.0", - "near-vm-runner 0.22.0", - "num-rational", - "once_cell", - "primitive-types", - "rand 0.8.5", - "rand_chacha 0.3.1", - "reed-solomon-erasure 4.0.2", - "serde", - "serde_json", - "serde_with", - "serde_yaml", - "sha3", - "smart-default", - "strum", - "thiserror", - "time", - "tracing", -] - -[[package]] -name = "near-primitives" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c175262923db9885ed0347e96ec3bcbec57825e3b6d7de03da220f5e14ef5" -dependencies = [ - "arbitrary", - "base64 0.21.7", - "borsh 1.5.1", - "bytes", - "bytesize", - "cfg-if 1.0.0", - "chrono", - "derive_more", - "easy-ext 0.2.9", - "enum-map", - "hex", - "itertools 0.10.5", - "near-crypto 0.23.0", - "near-fmt 0.23.0", - "near-parameters 0.23.0", - "near-primitives-core 0.23.0", - "near-rpc-error-macro 0.23.0", - "near-stdx 0.23.0", - "near-time 0.23.0", - "num-rational", - "once_cell", - "primitive-types", - "rand 0.8.5", - "rand_chacha 0.3.1", - "reed-solomon-erasure 4.0.2", - "serde", - "serde_json", - "serde_with", - "sha3", - "smart-default", - "strum", - "thiserror", - "tracing", - "zstd", -] - [[package]] name = "near-primitives" version = "2.0.0" @@ -5296,7 +4843,7 @@ dependencies = [ "near-primitives-core 2.0.0", "near-rpc-error-macro 2.0.0", "near-stdx 2.0.0", - "near-time 2.0.0", + "near-time", "near-vm-runner 2.0.0", "num-rational", "once_cell", @@ -5338,70 +4885,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "near-primitives-core" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "082b1d3f6c7e273ec5cd9588e00bdbfc51be6cc9a3a7ec31fc899b4b7d2d3f9d" -dependencies = [ - "arbitrary", - "base64 0.21.7", - "borsh 1.5.1", - "bs58", - "derive_more", - "enum-map", - "near-account-id", - "num-rational", - "serde", - "serde_repr", - "serde_with", - "sha2", - "strum", - "thiserror", -] - -[[package]] -name = "near-primitives-core" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42620c4640ce68d9a3d525ad90ba1892dd8693cf99f879a724c964f84a95abc7" -dependencies = [ - "arbitrary", - "base64 0.21.7", - "borsh 1.5.1", - "bs58", - "derive_more", - "enum-map", - "near-account-id", - "num-rational", - "serde", - "serde_repr", - "serde_with", - "sha2", - "strum", - "thiserror", -] - -[[package]] -name = "near-primitives-core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45de00d413f5bb890a3912f32fcd0974b2b0a975cc7874012e2c4c4fa7f28917" -dependencies = [ - "arbitrary", - "base64 0.21.7", - "borsh 1.5.1", - "bs58", - "derive_more", - "enum-map", - "near-account-id", - "num-rational", - "serde", - "serde_repr", - "sha2", - "thiserror", -] - [[package]] name = "near-primitives-core" version = "2.0.0" @@ -5463,39 +4946,6 @@ dependencies = [ "syn 2.0.72", ] -[[package]] -name = "near-rpc-error-core" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3610517a56329b7cce0c8c4cf2686fc4bbe0b155181b118acf20d2a301bf29b6" -dependencies = [ - "quote", - "serde", - "syn 2.0.72", -] - -[[package]] -name = "near-rpc-error-core" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b41ee6dabbcb885bff1e228871c993db311441c280835793ec709bb36007319" -dependencies = [ - "quote", - "serde", - "syn 2.0.72", -] - -[[package]] -name = "near-rpc-error-core" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf41b149dcc1f5a35d6a96fbcd8c28c92625c05b52025a72ee7378c72bcd68ce" -dependencies = [ - "quote", - "serde", - "syn 2.0.72", -] - [[package]] name = "near-rpc-error-core" version = "2.0.0" @@ -5520,52 +4970,17 @@ dependencies = [ [[package]] name = "near-rpc-error-macro" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8db2fd2a6dbab8c56908e983f41570341e391daddb0d4c430746c6971107e3" +version = "2.0.0" +source = "git+https://github.com/kobayurii/nearcore.git?branch=2.0.0-fork1#dee6256d011b1e2ed5cf83c7ad06308a128259da" dependencies = [ - "fs2", - "near-rpc-error-core 0.21.2", + "near-rpc-error-core 2.0.0", "serde", "syn 2.0.72", ] [[package]] -name = "near-rpc-error-macro" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14ff0542196665dfea91933e35bd3763ddc48861d5913e3deeea020fbbd67e49" -dependencies = [ - "fs2", - "near-rpc-error-core 0.22.0", - "serde", - "syn 2.0.72", -] - -[[package]] -name = "near-rpc-error-macro" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c7f0f12f426792dd2c9d83df43d73c3b15d80f6e99e8d0e16ff3e024d0f9ba" -dependencies = [ - "near-rpc-error-core 0.23.0", - "serde", - "syn 2.0.72", -] - -[[package]] -name = "near-rpc-error-macro" -version = "2.0.0" -source = "git+https://github.com/kobayurii/nearcore.git?branch=2.0.0-fork1#dee6256d011b1e2ed5cf83c7ad06308a128259da" -dependencies = [ - "near-rpc-error-core 2.0.0", - "serde", - "syn 2.0.72", -] - -[[package]] -name = "near-state-indexer" -version = "0.2.12" +name = "near-state-indexer" +version = "0.2.12" dependencies = [ "actix", "actix-web", @@ -5579,7 +4994,7 @@ dependencies = [ "near-chain-configs 2.0.0", "near-client", "near-indexer", - "near-indexer-primitives 2.0.0", + "near-indexer-primitives", "near-o11y 2.0.0", "once_cell", "openssl-probe", @@ -5596,24 +5011,6 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "855fd5540e3b4ff6fedf12aba2db1ee4b371b36f465da1363a6d022b27cb43b8" -[[package]] -name = "near-stdx" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a697f311c110d0fabae6c8c49ab0a8eff0ec37df82cc860deba92156e77c43" - -[[package]] -name = "near-stdx" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e111e0da22d28d9b7405e86d3314835d9f5ab8036e3580a480177f6d0a329ab9" - -[[package]] -name = "near-stdx" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e1897481272eb144328abd51ca9f59b5b558e7a6dc6e2177c8c9bb18fbd818" - [[package]] name = "near-stdx" version = "2.0.0" @@ -5682,18 +5079,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "near-time" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56db32f26b089441c1a7c5451f0d68637afa9d66f6d8f6a6f2d6c2f7953520a" -dependencies = [ - "once_cell", - "serde", - "time", - "tokio", -] - [[package]] name = "near-time" version = "2.0.0" @@ -5705,42 +5090,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "near-vm-compiler" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6c12977e11cbc33921c367a8ae949317d099025c96531702d3afed6e5f44ce" -dependencies = [ - "enumset", - "finite-wasm", - "near-vm-types 0.21.2", - "near-vm-vm 0.21.2", - "rkyv", - "smallvec", - "target-lexicon 0.12.16", - "thiserror", - "tracing", - "wasmparser 0.99.0", -] - -[[package]] -name = "near-vm-compiler" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f08025d9dd45cdc30bdd9e9d011fd63363100cf79a2a486565b0bdd1011eba" -dependencies = [ - "enumset", - "finite-wasm", - "near-vm-types 0.22.0", - "near-vm-vm 0.22.0", - "rkyv", - "smallvec", - "target-lexicon 0.12.16", - "thiserror", - "tracing", - "wasmparser 0.99.0", -] - [[package]] name = "near-vm-compiler" version = "2.0.0" @@ -5748,8 +5097,8 @@ source = "git+https://github.com/kobayurii/nearcore.git?branch=2.0.0-fork1#dee62 dependencies = [ "enumset", "finite-wasm", - "near-vm-types 2.0.0", - "near-vm-vm 2.0.0", + "near-vm-types", + "near-vm-vm", "rkyv", "target-lexicon 0.12.16", "thiserror", @@ -5757,50 +5106,6 @@ dependencies = [ "wasmparser 0.99.0", ] -[[package]] -name = "near-vm-compiler-singlepass" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f883363f5d05502035f0f6c0416078fdf535557dbffc1b4177aaab87bd448528" -dependencies = [ - "dynasm 2.0.0", - "dynasmrt 2.0.0", - "enumset", - "finite-wasm", - "lazy_static", - "memoffset 0.8.0", - "more-asserts", - "near-vm-compiler 0.21.2", - "near-vm-types 0.21.2", - "near-vm-vm 0.21.2", - "rayon", - "smallvec", - "strum", - "tracing", -] - -[[package]] -name = "near-vm-compiler-singlepass" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1489b7a9de76115150f71a205b22c93a84070f04443e318797b4d736cc47bc8" -dependencies = [ - "dynasm 2.0.0", - "dynasmrt 2.0.0", - "enumset", - "finite-wasm", - "lazy_static", - "memoffset 0.8.0", - "more-asserts", - "near-vm-compiler 0.22.0", - "near-vm-types 0.22.0", - "near-vm-vm 0.22.0", - "rayon", - "smallvec", - "strum", - "tracing", -] - [[package]] name = "near-vm-compiler-singlepass" version = "2.0.0" @@ -5813,64 +5118,15 @@ dependencies = [ "lazy_static", "memoffset 0.8.0", "more-asserts", - "near-vm-compiler 2.0.0", - "near-vm-types 2.0.0", - "near-vm-vm 2.0.0", + "near-vm-compiler", + "near-vm-types", + "near-vm-vm", "rayon", "smallvec", "strum", "tracing", ] -[[package]] -name = "near-vm-engine" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c758c7ad8d551eafefd783aa286c2fa95f4ad6e89efedf1bd5f8629efd529ac" -dependencies = [ - "backtrace", - "cfg-if 1.0.0", - "enumset", - "finite-wasm", - "lazy_static", - "memmap2", - "more-asserts", - "near-vm-compiler 0.21.2", - "near-vm-types 0.21.2", - "near-vm-vm 0.21.2", - "region", - "rkyv", - "rustc-demangle", - "target-lexicon 0.12.16", - "thiserror", - "tracing", -] - -[[package]] -name = "near-vm-engine" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4e26074d971470f37cd2e295ba6f1ad7abd211aea6e92f01f77a2e7f702cd8" -dependencies = [ - "backtrace", - "cfg-if 1.0.0", - "enumset", - "finite-wasm", - "lazy_static", - "memmap2", - "more-asserts", - "near-vm-compiler 0.22.0", - "near-vm-types 0.22.0", - "near-vm-vm 0.22.0", - "region", - "rkyv", - "rustc-demangle", - "rustix", - "target-lexicon 0.12.16", - "thiserror", - "tracing", -] - [[package]] name = "near-vm-engine" version = "2.0.0" @@ -5882,9 +5138,9 @@ dependencies = [ "finite-wasm", "lazy_static", "more-asserts", - "near-vm-compiler 2.0.0", - "near-vm-types 2.0.0", - "near-vm-vm 2.0.0", + "near-vm-compiler", + "near-vm-types", + "near-vm-vm", "region", "rkyv", "rustc-demangle", @@ -5924,114 +5180,6 @@ dependencies = [ "zeropool-bn", ] -[[package]] -name = "near-vm-runner" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20569500ca56e161c6ed81da9a24c7bf7b974c4238b2f08b2582113b66fa0060" -dependencies = [ - "anyhow", - "base64 0.21.7", - "borsh 1.5.1", - "ed25519-dalek", - "enum-map", - "finite-wasm", - "loupe", - "memoffset 0.8.0", - "near-cache 0.21.2", - "near-crypto 0.21.2", - "near-parameters 0.21.2", - "near-primitives-core 0.21.2", - "near-stdx 0.21.2", - "near-vm-compiler 0.21.2", - "near-vm-compiler-singlepass 0.21.2", - "near-vm-engine 0.21.2", - "near-vm-types 0.21.2", - "near-vm-vm 0.21.2", - "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", - "sha3", - "strum", - "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.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eac451ae8a5820dccdfe400cbaf0b630727ac15aee4711402bf727cd942c687" -dependencies = [ - "anyhow", - "base64 0.21.7", - "borsh 1.5.1", - "ed25519-dalek", - "enum-map", - "finite-wasm", - "loupe", - "lru 0.12.4", - "memoffset 0.8.0", - "near-crypto 0.22.0", - "near-parameters 0.22.0", - "near-primitives-core 0.22.0", - "near-stdx 0.22.0", - "near-vm-compiler 0.22.0", - "near-vm-compiler-singlepass 0.22.0", - "near-vm-engine 0.22.0", - "near-vm-types 0.22.0", - "near-vm-vm 0.22.0", - "num-rational", - "once_cell", - "parity-wasm 0.41.0", - "parity-wasm 0.42.2", - "prefix-sum-vec", - "pwasm-utils", - "ripemd", - "rustix", - "serde", - "serde_repr", - "serde_with", - "sha2", - "sha3", - "strum", - "tempfile", - "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 = "2.0.0" @@ -6050,11 +5198,11 @@ dependencies = [ "near-parameters 2.0.0", "near-primitives-core 2.0.0", "near-stdx 2.0.0", - "near-vm-compiler 2.0.0", - "near-vm-compiler-singlepass 2.0.0", - "near-vm-engine 2.0.0", - "near-vm-types 2.0.0", - "near-vm-vm 2.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", @@ -6086,30 +5234,6 @@ dependencies = [ "zeropool-bn", ] -[[package]] -name = "near-vm-types" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5e894a085d2a9ed4e8f10ae8766c95fa77b5aa47d3c0e85b89af22d5b253491" -dependencies = [ - "indexmap 1.9.3", - "num-traits", - "rkyv", - "thiserror", -] - -[[package]] -name = "near-vm-types" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d59dca461349502b4010ff4cfbe3c18b5c4272449cc206752ae7ee0e197ba20" -dependencies = [ - "indexmap 1.9.3", - "num-traits", - "rkyv", - "thiserror", -] - [[package]] name = "near-vm-types" version = "2.0.0" @@ -6121,52 +5245,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "near-vm-vm" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c98a68706832b567cafa03375d40512bba8d95ae6d3b760f340b22a4b97893" -dependencies = [ - "backtrace", - "cc", - "cfg-if 1.0.0", - "finite-wasm", - "indexmap 1.9.3", - "libc", - "memoffset 0.8.0", - "more-asserts", - "near-vm-types 0.21.2", - "region", - "rkyv", - "thiserror", - "tracing", - "wasmparser 0.99.0", - "winapi", -] - -[[package]] -name = "near-vm-vm" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34fa231f3c715961f95624588b21d321d7adf4a905263253c0e65db46d2764f3" -dependencies = [ - "backtrace", - "cc", - "cfg-if 1.0.0", - "finite-wasm", - "indexmap 1.9.3", - "libc", - "memoffset 0.8.0", - "more-asserts", - "near-vm-types 0.22.0", - "region", - "rkyv", - "thiserror", - "tracing", - "wasmparser 0.99.0", - "winapi", -] - [[package]] name = "near-vm-vm" version = "2.0.0" @@ -6180,7 +5258,7 @@ dependencies = [ "libc", "memoffset 0.8.0", "more-asserts", - "near-vm-types 2.0.0", + "near-vm-types", "region", "rkyv", "thiserror", @@ -7576,7 +6654,7 @@ dependencies = [ "near-async", "near-chain-configs 2.0.0", "near-crypto 2.0.0", - "near-indexer-primitives 2.0.0", + "near-indexer-primitives", "near-jsonrpc", "near-jsonrpc-client 0.11.0", "near-lake-framework", @@ -7602,11 +6680,7 @@ version = "0.2.12" dependencies = [ "anyhow", "borsh 1.5.1", - "near-indexer-primitives 0.20.1", - "near-indexer-primitives 0.21.2", - "near-indexer-primitives 0.22.0", - "near-indexer-primitives 0.23.0", - "near-indexer-primitives 2.0.0", + "near-indexer-primitives", "num-traits", "serde", "serde_json", @@ -9683,7 +8757,7 @@ dependencies = [ "futures-locks", "humantime", "lazy_static", - "near-indexer-primitives 2.0.0", + "near-indexer-primitives", "near-jsonrpc-client 0.11.0", "near-lake-framework", "prometheus", diff --git a/Cargo.toml b/Cargo.toml index 18363a8e..b0a4e128 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ debug = false split-debuginfo = 'off' debug-assertions = false overflow-checks = false -lto = "thin" +lto = true panic = 'unwind' incremental = false codegen-units = 1 @@ -69,4 +69,4 @@ near-vm-runner = { git = 'https://github.com/kobayurii/nearcore.git', branch = " ] } near-lake-framework = { git = 'https://github.com/kobayurii/near-lake-framework-rs.git', branch = '0.7.16' } -near-jsonrpc-client = { git = 'https://github.com/kobayurii/near-jsonrpc-client-rs.git', branch = '0.11.1' } \ No newline at end of file +near-jsonrpc-client = { git = 'https://github.com/kobayurii/near-jsonrpc-client-rs.git', branch = '0.11.1' } diff --git a/readnode-primitives/Cargo.toml b/readnode-primitives/Cargo.toml index fee7d042..21bb69d9 100644 --- a/readnode-primitives/Cargo.toml +++ b/readnode-primitives/Cargo.toml @@ -15,11 +15,3 @@ serde = { version = "1.0.145", features = ["derive"] } serde_json = "1.0.85" near-indexer-primitives.workspace = true -# We keep the versions of the near-indexer-primitives to support the backward compatibility -near-indexer-primitives-0-20-1 = { version = "0.20.1", package = "near-indexer-primitives" } -near-indexer-primitives-0-21-2 = { version = "0.21.2", package = "near-indexer-primitives" } -near-indexer-primitives-0-22-0 = { version = "0.22.0", package = "near-indexer-primitives" } -near-indexer-primitives-0-23-0 = { version = "0.23.0", package = "near-indexer-primitives" } - -# If borsh deserialize is broken, add this version and create new structure -#near-indexer-primitives-0-24-0 = { version = "0.24.0", package = "near-indexer-primitives" } diff --git a/readnode-primitives/src/lib.rs b/readnode-primitives/src/lib.rs index e5a1fe30..83483307 100644 --- a/readnode-primitives/src/lib.rs +++ b/readnode-primitives/src/lib.rs @@ -173,82 +173,6 @@ pub struct TransactionDetails { pub transaction_outcome: views::ExecutionOutcomeWithIdView, } -#[derive(borsh::BorshDeserialize, serde::Serialize, Debug, Clone)] -pub struct TransactionDetailsV0201 { - pub receipts: Vec, - pub receipts_outcome: Vec, - pub status: near_indexer_primitives_0_20_1::views::FinalExecutionStatus, - pub transaction: near_indexer_primitives_0_20_1::views::SignedTransactionView, - pub transaction_outcome: near_indexer_primitives_0_20_1::views::ExecutionOutcomeWithIdView, -} - -#[derive(borsh::BorshDeserialize, serde::Serialize, Debug, Clone)] -pub struct TransactionDetailsV0212 { - pub receipts: Vec, - pub receipts_outcome: Vec, - pub status: near_indexer_primitives_0_21_2::views::FinalExecutionStatus, - pub transaction: near_indexer_primitives_0_21_2::views::SignedTransactionView, - pub transaction_outcome: near_indexer_primitives_0_21_2::views::ExecutionOutcomeWithIdView, -} - -#[derive(borsh::BorshDeserialize, serde::Serialize, Debug, Clone)] -pub struct TransactionDetailsV0220 { - pub receipts: Vec, - pub receipts_outcome: Vec, - pub status: near_indexer_primitives_0_22_0::views::FinalExecutionStatus, - pub transaction: near_indexer_primitives_0_22_0::views::SignedTransactionView, - pub transaction_outcome: near_indexer_primitives_0_22_0::views::ExecutionOutcomeWithIdView, -} - -#[derive(borsh::BorshDeserialize, serde::Serialize, Debug, Clone)] -pub struct TransactionDetailsV0230 { - pub receipts: Vec, - pub receipts_outcome: Vec, - pub status: near_indexer_primitives_0_23_0::views::FinalExecutionStatus, - pub transaction: near_indexer_primitives_0_23_0::views::SignedTransactionView, - pub transaction_outcome: near_indexer_primitives_0_23_0::views::ExecutionOutcomeWithIdView, -} - -// Deserialize old versions of the TransactionDetails -// This is needed to handle the backward incompatible changes in the TransactionDetails -enum TransactionDetailsOldVersion { - V0201(TransactionDetailsV0201), - V0212(TransactionDetailsV0212), - V0220(TransactionDetailsV0220), - V0230(TransactionDetailsV0230), -} - -impl TransactionDetailsOldVersion { - fn borsh_deserialize(data: &[u8]) -> anyhow::Result { - match borsh::from_slice::(data) { - Ok(tx_details) => Ok(TransactionDetailsOldVersion::V0201(tx_details)), - Err(_) => match borsh::from_slice::(data) { - Ok(tx_details) => Ok(TransactionDetailsOldVersion::V0212(tx_details)), - Err(_) => match borsh::from_slice::(data) { - Ok(tx_details) => Ok(TransactionDetailsOldVersion::V0220(tx_details)), - Err(_) => match borsh::from_slice::(data) { - Ok(tx_details) => Ok(TransactionDetailsOldVersion::V0230(tx_details)), - Err(err) => Err(anyhow::anyhow!( - "Failed to deserialize TransactionDetails: {}", - err - )), - }, - }, - }, - } - } - - fn to_latest(&self) -> anyhow::Result { - let value = match self { - TransactionDetailsOldVersion::V0201(tx_details) => serde_json::to_value(tx_details)?, - TransactionDetailsOldVersion::V0212(tx_details) => serde_json::to_value(tx_details)?, - TransactionDetailsOldVersion::V0220(tx_details) => serde_json::to_value(tx_details)?, - TransactionDetailsOldVersion::V0230(tx_details) => serde_json::to_value(tx_details)?, - }; - Ok(serde_json::from_value(value)?) - } -} - impl TransactionDetails { pub fn to_final_execution_outcome(&self) -> views::FinalExecutionOutcomeView { views::FinalExecutionOutcomeView { @@ -288,16 +212,17 @@ impl TransactionDetails { } } - // Deserialize TransactionDetails from bytes - // If the deserialization fails, try to deserialize the old version of the TransactionDetails - // and convert it to the new version + // Serialize TransactionDetails to json bytes // This is needed to handle the backward incompatible changes in the TransactionDetails - // https://github.com/near/nearcore/pull/10676/files#diff-1e4fc99d32e48420a9bd37050fa1412758cba37825851edea40cbdfcab406944R1927 - pub fn borsh_deserialize(data: &[u8]) -> anyhow::Result { - match borsh::from_slice::(data) { - Ok(tx_details) => Ok(tx_details), - Err(_) => TransactionDetailsOldVersion::borsh_deserialize(data)?.to_latest(), - } + pub fn tx_serialize(&self) -> anyhow::Result> { + let transaction_json = serde_json::to_value(self)?.to_string(); + Ok(transaction_json.into_bytes()) + } + + // Deserialize TransactionDetails from json bytes + // This is needed to handle the backward incompatible changes in the TransactionDetails + pub fn tx_deserialize(data: &[u8]) -> anyhow::Result { + Ok(serde_json::from_slice(data)?) } } diff --git a/rpc-server/src/modules/transactions/mod.rs b/rpc-server/src/modules/transactions/mod.rs index 43eb7981..bbb1d7ab 100644 --- a/rpc-server/src/modules/transactions/mod.rs +++ b/rpc-server/src/modules/transactions/mod.rs @@ -10,7 +10,7 @@ pub(crate) async fn try_get_transaction_details_by_hash( if let Ok(transaction_details_bytes) = &data.tx_details_storage.retrieve(&tx_hash.to_string()).await { - readnode_primitives::TransactionDetails::borsh_deserialize(transaction_details_bytes) + readnode_primitives::TransactionDetails::tx_deserialize(transaction_details_bytes) } else if let Some(tx_cache_storage) = data.tx_cache_storage.clone() { Ok(tx_cache_storage.get_tx_by_tx_hash(tx_hash).await?) } else { diff --git a/tx-indexer/src/collector.rs b/tx-indexer/src/collector.rs index 6bee50b7..bfb17a6b 100644 --- a/tx-indexer/src/collector.rs +++ b/tx-indexer/src/collector.rs @@ -462,7 +462,7 @@ async fn save_transaction_details_to_storage( ) -> anyhow::Result<()> { let transaction_details = tx_details.to_final_transaction_result()?; let transaction_hash = transaction_details.transaction.hash.to_string(); - let tx_bytes = borsh::to_vec(&transaction_details)?; + let tx_bytes = transaction_details.tx_serialize()?; // We faced the issue when the transaction was saved to the storage but later // was failing to deserialize. To avoid this issue and monitor the situation