diff --git a/Cargo.lock b/Cargo.lock index cfb4fdc7..06b20275 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,7 +26,7 @@ dependencies = [ "cfg-if", "cipher 0.3.0", "cpufeatures", - "opaque-debug 0.3.0", + "opaque-debug", ] [[package]] @@ -76,7 +76,7 @@ checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" [[package]] name = "api_derive" version = "1.40.0" -source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.40.0#15928ba4c9759ed3eb31ea24d98932596e1e9791" +source = "git+https://github.com/tonlabs/ever-sdk.git?tag=1.40.0#15928ba4c9759ed3eb31ea24d98932596e1e9791" dependencies = [ "api_info", "quote", @@ -87,7 +87,7 @@ dependencies = [ [[package]] name = "api_info" version = "1.40.0" -source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.40.0#15928ba4c9759ed3eb31ea24d98932596e1e9791" +source = "git+https://github.com/tonlabs/ever-sdk.git?tag=1.40.0#15928ba4c9759ed3eb31ea24d98932596e1e9791" dependencies = [ "serde", "serde_derive", @@ -112,7 +112,7 @@ version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9834fcc22e0874394a010230586367d4a3e9f11b560f469262678547e1d2575e" dependencies = [ - "bstr 1.1.0", + "bstr 1.2.0", "doc-comment", "predicates", "predicates-core", @@ -222,25 +222,13 @@ dependencies = [ "constant_time_eq", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding 0.1.5", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[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.6", + "generic-array", ] [[package]] @@ -249,7 +237,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] @@ -258,19 +246,10 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cb03d1bed155d89dce0f845b7899b18a9a163e148fd004e1c28421a783e2d8e" dependencies = [ - "block-padding 0.2.1", + "block-padding", "cipher 0.3.0", ] -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", -] - [[package]] name = "block-padding" version = "0.2.1" @@ -288,9 +267,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45ea9b00a7b3f2988e9a65ad3917e62123c38dba709b666506207be96d1790b" +checksum = "b7f0778972c64420fdedc63f09919c8a88bda7b25135357fd25a5d9f3257e832" dependencies = [ "memchr", "once_cell", @@ -310,12 +289,6 @@ version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "byteorder" version = "1.4.3" @@ -379,7 +352,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] @@ -388,7 +361,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] @@ -482,7 +455,7 @@ dependencies = [ "encode_unicode", "lazy_static", "libc", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -613,7 +586,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.6", + "generic-array", "typenum", ] @@ -623,7 +596,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.6", + "generic-array", "subtle", ] @@ -633,7 +606,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" dependencies = [ - "generic-array 0.14.6", + "generic-array", "subtle", ] @@ -652,9 +625,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322296e2f2e5af4270b54df9e85a02ff037e271af20ba3e7fe1575515dc840b8" +checksum = "bc831ee6a32dd495436e317595e639a587aa9907bef96fe6e6abc290ab6204e9" dependencies = [ "cc", "cxxbridge-flags", @@ -664,9 +637,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "017a1385b05d631e7875b1f151c9f012d37b53491e2a87f65bff5c262b2111d8" +checksum = "94331d54f1b1a8895cd81049f7eaaaef9d05a7dcb4d1fd08bf3ff0806246789d" dependencies = [ "cc", "codespan-reporting", @@ -679,15 +652,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c26bbb078acf09bc1ecda02d4223f03bdd28bd4874edcb0379138efc499ce971" +checksum = "48dcd35ba14ca9b40d6e4b4b39961f23d835dbb8eed74565ded361d93e1feb8a" [[package]] name = "cxxbridge-macro" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357f40d1f06a24b60ae1fe122542c1fb05d28d32acb2aed064e84bc2ad1e252e" +checksum = "81bbeb29798b407ccd82a3324ade1a7286e0d29851475990b612670f6f5124d2" dependencies = [ "proc-macro2", "quote", @@ -709,22 +682,13 @@ dependencies = [ "ansi_term", ] -[[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]] name = "digest" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.6", + "generic-array", ] [[package]] @@ -819,9 +783,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if", ] @@ -891,12 +855,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "fake-simd" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" - [[package]] name = "fastrand" version = "1.8.0" @@ -1045,15 +1003,6 @@ dependencies = [ "slab", ] -[[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.6" @@ -1122,9 +1071,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" @@ -1192,7 +1141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.6", + "generic-array", "hmac 0.8.1", ] @@ -1241,9 +1190,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" dependencies = [ "bytes", "futures-channel", @@ -1360,12 +1309,12 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1383,7 +1332,7 @@ dependencies = [ "hermit-abi 0.2.6", "io-lifetimes", "rustix", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1412,9 +1361,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -1566,7 +1515,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1732,12 +1681,6 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" -[[package]] -name = "opaque-debug" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" - [[package]] name = "opaque-debug" version = "0.3.0" @@ -1822,15 +1765,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", "redox_syscall 0.2.16", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -2238,7 +2181,7 @@ dependencies = [ "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2285,7 +2228,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2410,18 +2353,6 @@ dependencies = [ "digest 0.10.6", ] -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - [[package]] name = "sha2" version = "0.9.9" @@ -2432,7 +2363,7 @@ dependencies = [ "cfg-if", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug", ] [[package]] @@ -2561,9 +2492,9 @@ dependencies = [ "serde", "serde_json", "strip-ansi-escapes", - "ton_abi 2.3.7", - "ton_block 1.8.3", - "ton_types 1.11.4", + "ton_abi", + "ton_block", + "ton_types", "tvm_linker", ] @@ -2766,9 +2697,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" @@ -2787,7 +2718,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2861,32 +2792,10 @@ dependencies = [ "tracing", ] -[[package]] -name = "ton_abi" -version = "2.3.7" -source = "git+https://github.com/tonlabs/ton-labs-abi.git?tag=2.3.7#958fba895b3a7c4f255d89a0f292e2136350022c" -dependencies = [ - "base64 0.10.1", - "byteorder", - "chrono", - "ed25519", - "ed25519-dalek", - "failure", - "hex 0.3.2", - "num-bigint", - "num-traits", - "serde", - "serde_derive", - "serde_json", - "sha2 0.8.2", - "ton_block 1.8.3", - "ton_types 1.11.4", -] - [[package]] name = "ton_abi" version = "2.3.54" -source = "git+https://github.com/tonlabs/ton-labs-abi.git?tag=2.3.54#9f74516f372373a1800e164e42b6912ee0d411e5" +source = "git+https://github.com/tonlabs/ever-abi.git?tag=2.3.54#9f74516f372373a1800e164e42b6912ee0d411e5" dependencies = [ "base64 0.10.1", "byteorder", @@ -2901,8 +2810,8 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.10.6", - "ton_block 1.9.18", - "ton_types 1.12.6", + "ton_block", + "ton_types", ] [[package]] @@ -2920,33 +2829,15 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "ton_block 1.9.18", + "ton_block", "ton_tl_codegen", - "ton_types 1.12.6", -] - -[[package]] -name = "ton_block" -version = "1.8.3" -source = "git+https://github.com/tonlabs/ton-labs-block.git?tag=1.8.3#715236f81268d88f89005e7773b09bfc75c55a0c" -dependencies = [ - "base64 0.13.1", - "crc 3.0.1", - "ed25519", - "ed25519-dalek", - "failure", - "hex 0.4.3", - "log", - "num", - "num-traits", - "sha2 0.10.6", - "ton_types 1.11.4", + "ton_types", ] [[package]] name = "ton_block" version = "1.9.18" -source = "git+https://github.com/tonlabs/ton-labs-block.git?tag=1.9.18#92e30b957192b566b81f622da337f0705a5fc65a" +source = "git+https://github.com/tonlabs/ever-block.git?tag=1.9.18#92e30b957192b566b81f622da337f0705a5fc65a" dependencies = [ "base64 0.13.1", "crc 3.0.1", @@ -2958,13 +2849,13 @@ dependencies = [ "num", "num-traits", "sha2 0.10.6", - "ton_types 1.12.6", + "ton_types", ] [[package]] name = "ton_block_json" version = "0.7.83" -source = "git+https://github.com/tonlabs/ton-labs-block-json.git?tag=0.7.83#ad93ae1a98b77bd14ca7b19f503bf3907461e151" +source = "git+https://github.com/tonlabs/ever-block-json.git?tag=0.7.83#ad93ae1a98b77bd14ca7b19f503bf3907461e151" dependencies = [ "base64 0.13.1", "failure", @@ -2975,14 +2866,14 @@ dependencies = [ "serde_derive", "serde_json", "ton_api", - "ton_block 1.9.18", - "ton_types 1.12.6", + "ton_block", + "ton_types", ] [[package]] name = "ton_client" version = "1.40.0" -source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.40.0#15928ba4c9759ed3eb31ea24d98932596e1e9791" +source = "git+https://github.com/tonlabs/ever-sdk.git?tag=1.40.0#15928ba4c9759ed3eb31ea24d98932596e1e9791" dependencies = [ "aes", "api_derive", @@ -3025,13 +2916,13 @@ dependencies = [ "tokio", "tokio-stream", "tokio-tungstenite", - "ton_abi 2.3.54", - "ton_block 1.9.18", + "ton_abi", + "ton_block", "ton_block_json", "ton_executor", "ton_sdk", - "ton_types 1.12.6", - "ton_vm 1.8.96", + "ton_types", + "ton_vm", "zeroize", "zstd", ] @@ -3039,35 +2930,20 @@ dependencies = [ [[package]] name = "ton_executor" version = "1.15.154" -source = "git+https://github.com/tonlabs/ton-labs-executor.git?tag=1.15.154#39891cf0c01ddc298a6b7e4c470ea1326e53c679" +source = "git+https://github.com/tonlabs/ever-executor.git?tag=1.15.154#39891cf0c01ddc298a6b7e4c470ea1326e53c679" dependencies = [ "failure", "lazy_static", "log", - "ton_block 1.9.18", - "ton_types 1.12.6", - "ton_vm 1.8.96", -] - -[[package]] -name = "ton_labs_assembler" -version = "1.2.49" -source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.49#6a90d710814c0c373226f0d20fe7f51a17532e6a" -dependencies = [ - "failure", - "hex 0.4.3", - "log", - "num", - "num-traits", - "serde", - "serde_json", - "ton_types 1.11.4", + "ton_block", + "ton_types", + "ton_vm", ] [[package]] name = "ton_labs_assembler" version = "1.2.77" -source = "git+https://github.com/tonlabs/ton-labs-assembler.git?tag=1.2.77#6257a674457627646237e74ee6eb402f052d214f" +source = "git+https://github.com/tonlabs/ever-assembler.git?tag=1.2.77#6257a674457627646237e74ee6eb402f052d214f" dependencies = [ "failure", "hex 0.4.3", @@ -3076,13 +2952,13 @@ dependencies = [ "num-traits", "serde", "serde_json", - "ton_types 1.12.6", + "ton_types", ] [[package]] name = "ton_sdk" version = "1.40.0" -source = "git+https://github.com/tonlabs/TON-SDK.git?tag=1.40.0#15928ba4c9759ed3eb31ea24d98932596e1e9791" +source = "git+https://github.com/tonlabs/ever-sdk.git?tag=1.40.0#15928ba4c9759ed3eb31ea24d98932596e1e9791" dependencies = [ "api_derive", "api_info", @@ -3099,10 +2975,10 @@ dependencies = [ "serde_derive", "serde_json", "sha2 0.9.9", - "ton_abi 2.3.54", - "ton_block 1.9.18", - "ton_types 1.12.6", - "ton_vm 1.8.96", + "ton_abi", + "ton_block", + "ton_types", + "ton_vm", ] [[package]] @@ -3120,30 +2996,10 @@ dependencies = [ "syn", ] -[[package]] -name = "ton_types" -version = "1.11.4" -source = "git+https://github.com/tonlabs/ton-labs-types.git?tag=1.11.4#c2204fe7610017a1b98ab196e0afd4e979d033e2" -dependencies = [ - "base64 0.13.1", - "crc 1.8.1", - "failure", - "hex 0.4.3", - "lazy_static", - "lockfree", - "log", - "num", - "num-derive", - "num-traits", - "rand 0.8.5", - "sha2 0.9.9", - "smallvec", -] - [[package]] name = "ton_types" version = "1.12.6" -source = "git+https://github.com/tonlabs/ton-labs-types.git?tag=1.12.6#8e218813db6bacc138dbbec7ab4ccbf84220da31" +source = "git+https://github.com/tonlabs/ever-types.git?tag=1.12.6#8e218813db6bacc138dbbec7ab4ccbf84220da31" dependencies = [ "base64 0.13.1", "crc 1.8.1", @@ -3160,32 +3016,10 @@ dependencies = [ "smallvec", ] -[[package]] -name = "ton_vm" -version = "1.8.44" -source = "git+https://github.com/tonlabs/ton-labs-vm.git?tag=1.8.44#5a83076b448cb35d2da7611552f76dea5cffc9db" -dependencies = [ - "diffy", - "ed25519", - "ed25519-dalek", - "failure", - "hex 0.4.3", - "lazy_static", - "log", - "num", - "num-traits", - "rand 0.7.3", - "sha2 0.9.9", - "similar", - "ton_block 1.8.3", - "ton_types 1.11.4", - "zstd", -] - [[package]] name = "ton_vm" version = "1.8.96" -source = "git+https://github.com/tonlabs/ton-labs-vm.git?tag=1.8.96#f95aa63eac1e1682dcc81fcdabe352415ffdfde7" +source = "git+https://github.com/tonlabs/ever-vm.git?tag=1.8.96#f95aa63eac1e1682dcc81fcdabe352415ffdfde7" dependencies = [ "diffy", "ed25519", @@ -3199,14 +3033,14 @@ dependencies = [ "rand 0.7.3", "sha2 0.10.6", "similar", - "ton_block 1.9.18", - "ton_types 1.12.6", + "ton_block", + "ton_types", "zstd", ] [[package]] name = "tonos-cli" -version = "0.31.1" +version = "0.32.1" dependencies = [ "assert_cmd", "async-trait", @@ -3237,15 +3071,15 @@ dependencies = [ "string-error", "tokio", "tokio-retry", - "ton_abi 2.3.54", - "ton_block 1.9.18", + "ton_abi", + "ton_block", "ton_block_json", "ton_client", "ton_executor", - "ton_labs_assembler 1.2.77", + "ton_labs_assembler", "ton_sdk", - "ton_types 1.12.6", - "ton_vm 1.8.96", + "ton_types", + "ton_vm", "url", ] @@ -3323,11 +3157,11 @@ dependencies = [ "serde_json", "sha2 0.10.6", "simplelog 0.5.3", - "ton_abi 2.3.7", - "ton_block 1.8.3", - "ton_labs_assembler 1.2.49", - "ton_types 1.11.4", - "ton_vm 1.8.44", + "ton_abi", + "ton_block", + "ton_labs_assembler", + "ton_types", + "ton_vm", ] [[package]] @@ -3476,9 +3310,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3486,9 +3320,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", @@ -3501,9 +3335,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -3513,9 +3347,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3523,9 +3357,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", @@ -3536,15 +3370,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -3596,6 +3430,30 @@ dependencies = [ "windows_x86_64_msvc", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.1" diff --git a/Cargo.toml b/Cargo.toml index 42666fa7..f7ec67e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,8 @@ license = 'Apache-2.0' name = 'tonos-cli' readme = 'README.md' repository = 'https://github.com/tonlabs/tonos-cli' -version = '0.31.1' +version = '0.32.1' +default-run = 'tonos-cli' [features] sold = ["dep:sold"] @@ -52,7 +53,7 @@ ton_abi = { git = 'https://github.com/tonlabs/ton-labs-abi.git', tag = '2.3.54' ton_block = { git = 'https://github.com/tonlabs/ton-labs-block.git', tag = '1.9.18' } ton_block_json = { git = 'https://github.com/tonlabs/ton-labs-block-json.git', tag = '0.7.83' } ton_client = { git = 'https://github.com/tonlabs/TON-SDK.git', tag = '1.40.0' } -ton_executor = { default-features = false, git = 'https://github.com/tonlabs/ton-labs-executor.git', tag = '1.15.154' } +ton_executor = { git = 'https://github.com/tonlabs/ton-labs-executor.git', tag = '1.15.154' } ton_labs_assembler = { git = 'https://github.com/tonlabs/ton-labs-assembler.git', tag = '1.2.77' } ton_sdk = { git = 'https://github.com/tonlabs/TON-SDK.git', tag = '1.40.0' } ton_types = { git = 'https://github.com/tonlabs/ton-labs-types.git', tag = '1.12.6' } @@ -72,3 +73,28 @@ path = "src/main.rs" [[bin]] name = "__tonos-cli_completion" path = "src/completion.rs" + +[patch.'https://github.com/tonlabs/ton-labs-abi.git'] +ton_abi = { git = 'https://github.com/tonlabs/ever-abi.git', tag = '2.3.54' } + +[patch.'https://github.com/tonlabs/ton-labs-block.git'] +ton_block = { git = 'https://github.com/tonlabs/ever-block.git', tag = '1.9.18' } + +[patch.'https://github.com/tonlabs/ton-labs-block-json.git'] +ton_block_json = { git = 'https://github.com/tonlabs/ever-block-json.git', tag = '0.7.83' } + +[patch.'https://github.com/tonlabs/TON-SDK.git'] +ton_client = { git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.40.0' } +ton_sdk = { git = 'https://github.com/tonlabs/ever-sdk.git', tag = '1.40.0' } + +[patch.'https://github.com/tonlabs/ton-labs-executor.git'] +ton_executor = { git = 'https://github.com/tonlabs/ever-executor.git', tag = '1.15.154' } + +[patch.'https://github.com/tonlabs/ton-labs-assembler.git'] +ton_labs_assembler = { git = 'https://github.com/tonlabs/ever-assembler.git', tag = '1.2.77' } + +[patch.'https://github.com/tonlabs/ton-labs-types.git'] +ton_types = { git = 'https://github.com/tonlabs/ever-types.git', tag = '1.12.6' } + +[patch.'https://github.com/tonlabs/ton-labs-vm.git'] +ton_vm = { git = 'https://github.com/tonlabs/ever-vm.git', tag = '1.8.96' } diff --git a/src/getconfig.rs b/src/getconfig.rs index 0160859c..0de1550b 100644 --- a/src/getconfig.rs +++ b/src/getconfig.rs @@ -1,5 +1,5 @@ /* - * Copyright 2018-2021 TON DEV SOLUTIONS LTD. + * Copyright 2018-2023 TON DEV SOLUTIONS LTD. * * Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use * this file except in compliance with the License. @@ -10,10 +10,14 @@ * See the License for the specific TON DEV software governing permissions and * limitations under the License. */ + +use ed25519_dalek::{Keypair, PublicKey, SecretKey, Signer}; +use num_bigint::BigUint; use std::time::{SystemTime, UNIX_EPOCH}; -use crate::helpers::{create_client_verbose, query_with_limit}; use crate::config::Config; -use serde_json::{json}; +use crate::helpers::{create_client_verbose, query_with_limit}; +use serde_json::json; +use ton_abi::{Contract, Token, TokenValue, Uint}; use ton_block::{ExternalInboundMessageHeader, Grams, Message, MsgAddressInt, Serializable}; use ton_block::MsgAddressExt::AddrNone; use ton_client::net::{OrderBy, SortDirection}; @@ -317,26 +321,29 @@ pub async fn query_global_config(config: &Config, index: Option<&str>) -> Result } pub async fn gen_update_config_message( - seqno: &str, + abi: Option<&str>, + seqno: Option<&str>, config_master_file: &str, new_param_file: &str, is_json: bool ) -> Result<(), String> { - let seqno = u32::from_str_radix(seqno, 10) - .map_err(|e| format!(r#"failed to parse "seqno": {}"#, e))?; - let config_master_address = std::fs::read(&*(config_master_file.to_string() + ".addr")) .map_err(|e| format!(r#"failed to read "config_master": {}"#, e))?; let config_account = ton_types::AccountId::from_raw(config_master_address, 32*8); - let private_key = std::fs::read(&*(config_master_file.to_string() + ".pk")) + let private_key_of_config_account = std::fs::read(&*(config_master_file.to_string() + ".pk")) .map_err(|e| format!(r#"failed to read "config_master": {}"#, e))?; let config_str = std::fs::read_to_string(new_param_file) .map_err(|e| format!(r#"failed to read "new_param_file": {}"#, e))?; let (config_cell, key_number) = serialize_config_param(config_str)?; - let message = prepare_message_new_config_param(config_cell, seqno, key_number, config_account, private_key)?; + let message = if let Some(abi) = abi { + prepare_message_new_config_param_solidity(abi, config_cell, key_number, config_account, &private_key_of_config_account)? + } else { + let seqno = seqno.unwrap().parse().map_err(|e| format!(r#"failed to parse "seqno": {}"#, e))?; + prepare_message_new_config_param(config_cell, seqno, key_number, config_account, &private_key_of_config_account)? + }; let msg_bytes = message.write_to_bytes() .map_err(|e| format!(r#"failed to serialize message": {}"#, e))?; @@ -394,7 +401,7 @@ fn prepare_message_new_config_param( seqno: u32, key_number: u32, config_account: SliceData, - private_key_of_config_account: Vec + private_key_of_config_account: &[u8] ) -> Result { let prefix = hex::decode(PREFIX_UPDATE_CONFIG_MESSAGE_DATA).unwrap(); let since_the_epoch = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs() as u32 + 100; // timestamp + 100 secs @@ -406,15 +413,15 @@ fn prepare_message_new_config_param( cell.append_i32(key_number as i32).unwrap(); cell.checked_append_reference(config_param.clone()).unwrap(); - let exp_key = ed25519_dalek::ExpandedSecretKey::from( - &ed25519_dalek::SecretKey::from_bytes(private_key_of_config_account.as_slice() - ) - .map_err(|e| format!(r#"failed to read private key from config-master file": {}"#, e))?); - let pub_key = ed25519_dalek::PublicKey::from(&exp_key); - let msg_signature = exp_key.sign(cell.finalize(0).unwrap().repr_hash().into_vec().as_slice(), &pub_key).to_bytes().to_vec(); + let secret = SecretKey::from_bytes(private_key_of_config_account) + .map_err(|e| format!(r#"failed to read private key from config-master file": {}"#, e))?; + let public = PublicKey::from(&secret); + let keypair = Keypair { secret, public }; + + let msg_signature = keypair.sign(cell.finalize(0).unwrap().repr_hash().as_slice()).to_bytes(); let mut cell = BuilderData::default(); - cell.append_raw(msg_signature.as_slice(), 64*8).unwrap(); + cell.append_raw(&msg_signature, 64*8).unwrap(); cell.append_raw(prefix.as_slice(), 32).unwrap(); cell.append_u32(seqno).unwrap(); cell.append_u32(since_the_epoch).unwrap(); @@ -430,6 +437,53 @@ fn prepare_message_new_config_param( Ok(message) } +fn prepare_message_new_config_param_solidity( + abi: &str, + config_param: Cell, + key_number: u32, + config_account: SliceData, + private_key_of_config_account: &[u8] +) -> Result { + let secret = SecretKey::from_bytes(private_key_of_config_account) + .map_err(|e| format!(r#"failed to read private key from config-master file": {}"#, e))?; + let public = PublicKey::from(&secret); + let keypair = Keypair { secret, public }; + + let config_contract_address = MsgAddressInt::with_standart(None, -1, config_account).unwrap(); + let since_the_epoch = SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_micros() as u64; + + let header = [("time".to_owned(), TokenValue::Time(since_the_epoch))] + .into_iter() + .collect(); + + let parameters = [ + Token::new("index", convert_to_uint(&key_number.to_be_bytes(), 32)), + Token::new("data", TokenValue::Cell(config_param)), + ]; + + let abi = std::fs::read(abi) + .map_err(|err| format!("cannot read abi file {}: {}", abi, err))?; + let contract = Contract::load(&*abi) + .map_err(|err| err.to_string())?; + let function = contract.function("set_config_param") + .map_err(|err| err.to_string())?; + let body = function + .encode_input(&header, ¶meters, false, Some(&keypair), Some(config_contract_address.clone())) + .and_then(|builder| SliceData::load_builder(builder)) + .map_err(|err| format!("cannot prepare message body {}", err))?; + + let hdr = ExternalInboundMessageHeader::new(AddrNone, config_contract_address); + Ok(Message::with_ext_in_header_and_body(hdr, body)) +} + +fn convert_to_uint(value: &[u8], bits_count: usize) -> TokenValue { + assert!(value.len() * 8 >= bits_count); + TokenValue::Uint(Uint { + number: BigUint::from_bytes_be(value), + size: bits_count, + }) +} + pub async fn dump_blockchain_config(config: &Config, path: &str) -> Result<(), String> { let ton = create_client_verbose(&config)?; diff --git a/src/main.rs b/src/main.rs index 28194cee..d674119f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -784,6 +784,7 @@ async fn main_internal() -> Result <(), String> { let update_config_param_cmd = SubCommand::with_name("update_config") .about("Generates message with update of config params.") + .arg(abi_arg.clone()) .arg(Arg::with_name("SEQNO") .takes_value(true) .help("Current seqno from config contract")) @@ -984,7 +985,7 @@ async fn command_parser(matches: &ArgMatches<'_>, is_json: bool) -> Result <(), return config_command(m, full_config, is_json); } - full_config.config.is_json = is_json || full_config.config.is_json; + full_config.config.is_json |= is_json; let config = &mut full_config.config; if let Some(url) = matches.value_of("NETWORK") { @@ -1629,13 +1630,14 @@ async fn getconfig_command(matches: &ArgMatches<'_>, config: &Config) -> Result< } async fn update_config_command(matches: &ArgMatches<'_>, config: &Config) -> Result<(), String> { + let abi = matches.value_of("ABI"); let seqno = matches.value_of("SEQNO"); let config_master = matches.value_of("CONFIG_MASTER_KEY_FILE"); let new_param = matches.value_of("NEW_PARAM_FILE"); if !config.is_json { print_args!(seqno, config_master, new_param); } - gen_update_config_message(seqno.unwrap(), config_master.unwrap(), new_param.unwrap(), config.is_json).await + gen_update_config_message(abi, seqno, config_master.unwrap(), new_param.unwrap(), config.is_json).await } async fn dump_bc_config_command(matches: &ArgMatches<'_>, config: &Config) -> Result<(), String> {