From c574b80765ec44aa869acadf7fd459493ae3bdc7 Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Fri, 1 Sep 2023 22:37:37 +0800 Subject: [PATCH] Fix NetworkServer not dropped in unit test --- Cargo.lock | 540 ++++++++++-------- Cargo.toml | 41 +- .../components/send_last_state_proof.rs | 2 +- src/service.rs | 6 +- src/storage.rs | 22 +- src/subcmds.rs | 23 +- src/tests/service.rs | 2 +- src/tests/specs/dummy_pow.toml | 11 +- src/tests/utils/chain.rs | 3 +- src/tests/utils/network_context.rs | 4 + src/tests/verify.rs | 14 +- src/verify.rs | 37 +- 12 files changed, 392 insertions(+), 313 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1743bd7..5596240 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,7 +143,7 @@ checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -217,7 +217,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn", + "syn 1.0.109", "which", ] @@ -241,9 +241,9 @@ checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "blake2b-ref" -version = "0.2.1" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95916998c798756098a4eb1b3f2cd510659705a9817bf203d61abd30fbec3e7b" +checksum = "294d17c72e0ba59fad763caa112368d0672083779cdebbb97164f4bb4c1e339a" [[package]] name = "blake2b-rs" @@ -413,9 +413,8 @@ dependencies = [ [[package]] name = "ckb-app-config" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1d022d0832ec8e4b7a087a9894c2600777f105b793710cbbf4785cca1dd5545" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-build-info", "ckb-chain-spec", @@ -428,7 +427,6 @@ dependencies = [ "ckb-systemtime", "ckb-types", "clap 4.3.24", - "clap_lex", "path-clean", "rand 0.7.3", "serde", @@ -443,21 +441,18 @@ dependencies = [ [[package]] name = "ckb-async-runtime" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1ef4392be1a22b20778580b6396ca840200ab128de79e5cc5ebf2300131201f" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-logger", "ckb-spawn", - "ckb-stop-handler", "tokio", ] [[package]] name = "ckb-block-filter" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "407599b13b753da44839b0b700879015332627bb7a8a62e44ba7bd52cfe981cf" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-async-runtime", "ckb-logger", @@ -469,15 +464,13 @@ dependencies = [ [[package]] name = "ckb-build-info" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24fc8f4e1005dc91e81b7013f3bd7fbc0d33e162001716afa2c2f830b33dfb9" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" [[package]] name = "ckb-chain" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd100c14add250c9dd583fca4fce9d6772356336d86817ef7749847ef1209a8" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-app-config", "ckb-chain-spec", @@ -501,9 +494,8 @@ dependencies = [ [[package]] name = "ckb-chain-spec" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbfaa8d081d50fcefbf9cb60e9e86ea5dfe2a246471b98a439dde6f0e873771a" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-constant", "ckb-crypto", @@ -523,24 +515,21 @@ dependencies = [ [[package]] name = "ckb-channel" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2444cccfa7f40b4e3dcee36a01dc5e9b861e7b07a842f85250bde26ffbcc87d7" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "crossbeam-channel", ] [[package]] name = "ckb-constant" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84538dcfc160bf82de679025de8ba034cfe0f5aca26c37be4c7dcace57cdd143" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" [[package]] name = "ckb-crypto" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6bf4758a4ead6de3e6cdc6eda4354197e83976f50d01ac7a834cb9dd9ac667" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-fixed-hash", "faster-hex", @@ -552,9 +541,8 @@ dependencies = [ [[package]] name = "ckb-dao" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "546adca74721413a64bdea8f7af60cf528187731f4ffa35b6af4dbaa632333fd" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "byteorder", "ckb-chain-spec", @@ -565,9 +553,8 @@ dependencies = [ [[package]] name = "ckb-dao-utils" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3517a271c0ab337d2e3e4dc9cf868fc936e52fe7afc4598e2d940d601a10d361" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "byteorder", "ckb-error", @@ -576,9 +563,8 @@ dependencies = [ [[package]] name = "ckb-db" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82bc2effbc8b1fcc7e86913e32a0fd793ba5df4a2227280383f9fb3837f502d5" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-app-config", "ckb-db-schema", @@ -590,9 +576,8 @@ dependencies = [ [[package]] name = "ckb-db-migration" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc7b0f8e806ea2c934c16428904b272c0c06b43ffbdfb2cb12d3b197d17828b" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-db", "ckb-db-schema", @@ -604,15 +589,13 @@ dependencies = [ [[package]] name = "ckb-db-schema" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c502cd3392eb7f91ecc3393615fe6baa5f5a72d3ef012eb982eb192af1e14ea" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" [[package]] name = "ckb-error" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb50dd16603673f0da5d4f13ff5bbc63a34a120eb086f50031556e62a3edd06d" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "anyhow", "ckb-occupied-capacity", @@ -622,9 +605,8 @@ dependencies = [ [[package]] name = "ckb-fixed-hash" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720f5b9bb4eb1a4b4f62cbe237ff896480e1ec41e910083f95ed419a5a864c9a" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-fixed-hash-core", "ckb-fixed-hash-macros", @@ -632,9 +614,8 @@ dependencies = [ [[package]] name = "ckb-fixed-hash-core" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de5631b7f013f05e0f2e1c2ad5e5ef5586d8b67bde9ab7b5a500236e5023039" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "faster-hex", "serde", @@ -643,21 +624,19 @@ dependencies = [ [[package]] name = "ckb-fixed-hash-macros" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3cb93f699648a5b0981b2da4a5d8e8c944f501adedb47b165d3fb92f357a2" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-fixed-hash-core", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "ckb-freezer" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfd37a247dda259ae0d7a0d5d1af56ed49b2dfb6560bd728ba71272c19e6216a" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-error", "ckb-logger", @@ -670,11 +649,24 @@ dependencies = [ "snap", ] +[[package]] +name = "ckb-gen-types" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" +dependencies = [ + "cfg-if 1.0.0", + "ckb-error", + "ckb-fixed-hash", + "ckb-hash", + "ckb-occupied-capacity", + "molecule", + "numext-fixed-uint", +] + [[package]] name = "ckb-hash" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad33c4bee4f3a9494e81fa719602b6d440931b3ce35b8b87fb5789848807f05a" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "blake2b-ref", "blake2b-rs", @@ -682,9 +674,8 @@ dependencies = [ [[package]] name = "ckb-indexer" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7542cd9a3033e9b83a1a9492163261fd132d2546c41a4315f59d69fb7671cb" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-app-config", "ckb-async-runtime", @@ -704,9 +695,8 @@ dependencies = [ [[package]] name = "ckb-jsonrpc-types" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c269efeced3e0aedd74cbd82f4216a050bec73034cbb765b0907f7482d33c84" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-types", "faster-hex", @@ -716,9 +706,8 @@ dependencies = [ [[package]] name = "ckb-launcher" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec1b34d01e53e3e6b1d13d9285d9fa0e9c69929882a763aebf4cc5df55280403" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-app-config", "ckb-async-runtime", @@ -745,7 +734,6 @@ dependencies = [ "ckb-rpc", "ckb-shared", "ckb-snapshot", - "ckb-stop-handler", "ckb-store", "ckb-sync", "ckb-tx-pool", @@ -759,9 +747,9 @@ dependencies = [ [[package]] name = "ckb-librocksdb-sys" -version = "7.7.3" +version = "8.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb64bb11f8d53b9abb526b7e9d3c5fb437a8101e4210d540d2bcee0d18055313" +checksum = "5d9bc1ea9ab886ecbf48bc4ade6d383ba56cf3da198b6a51620736daf74b683c" dependencies = [ "bindgen", "cc", @@ -791,6 +779,7 @@ dependencies = [ "ckb-rocksdb", "ckb-script", "ckb-shared", + "ckb-stop-handler", "ckb-store", "ckb-systemtime", "ckb-traits", @@ -823,9 +812,8 @@ dependencies = [ [[package]] name = "ckb-light-client-protocol-server" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51e4b790fe0b6d10a650cf951fdfaed6529a91179c361fbb55a878c5dd5f90e" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-logger", "ckb-merkle-mountain-range", @@ -838,27 +826,24 @@ dependencies = [ [[package]] name = "ckb-logger" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfe71eaf190c1fb2ee737edec709bbada170ab9795aa2d5e306235d58ce066e6" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "log", ] [[package]] name = "ckb-logger-config" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88b7083128e766fd7cef625b5fc17962610fc42711e889d6127e17704d8b391c" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "serde", ] [[package]] name = "ckb-logger-service" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c481f10f528428119f85e2fe53a5ee938a9bcb4a4ae66cb70a9976cf8ca038ef" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "backtrace", "ckb-channel", @@ -874,9 +859,8 @@ dependencies = [ [[package]] name = "ckb-memory-tracker" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4237dbc2e8adf5fa5957cacd2a28ec60038dc435f9dae67de63afe4e221fb0c5" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-db", "ckb-logger", @@ -898,9 +882,8 @@ dependencies = [ [[package]] name = "ckb-metrics" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488f707a5fd28ad89ad48fe43c432d3acfc16008d9a29318ef5d08c03ca7d0a5" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "once_cell", "prometheus", @@ -909,28 +892,25 @@ dependencies = [ [[package]] name = "ckb-metrics-config" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31faf8231dcb48cbda83e676f2869735affacc6b5ce3a2f5c70d1cd8735e50e5" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "serde", ] [[package]] name = "ckb-migration-template" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e3239b43ab443722df9fa32e04098867d9571ee15f71f6e71a83ddfa2c5380" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "ckb-multisig" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f494df6ec688b89ab560e53e525bca6a5d73138724fefed3e59a0e00c48f8f3" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-crypto", "ckb-error", @@ -939,9 +919,8 @@ dependencies = [ [[package]] name = "ckb-network" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c2a9bf5dfff4156338b546b947ab07ffa1e18b8de8d2db1ea7a051f9c57f52" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "bitflags 1.3.2", "bloom-filters", @@ -960,17 +939,16 @@ dependencies = [ "serde", "serde_json", "snap", - "socket2", + "socket2 0.4.4", "tentacle", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.9", ] [[package]] name = "ckb-network-alert" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685a905dc307a013e3a8ff8b92859ea300cd37f876399704213d99d111454e34" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-app-config", "ckb-error", @@ -988,9 +966,8 @@ dependencies = [ [[package]] name = "ckb-notify" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f8f4634a605861f998fac4e8475d3d6be656bc0f2e46f98f6877acc2ec9f9b" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-app-config", "ckb-async-runtime", @@ -1002,9 +979,8 @@ dependencies = [ [[package]] name = "ckb-occupied-capacity" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1399a84907db0737f642e4b4882d7c31e1502ef108ce40728e16e9eb4ab3482a" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-occupied-capacity-core", "ckb-occupied-capacity-macros", @@ -1012,29 +988,26 @@ dependencies = [ [[package]] name = "ckb-occupied-capacity-core" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14dfed4d080d1445c52521ff833c19fe384546d23e15d81c1fcb25a0bc1f723b" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "serde", ] [[package]] name = "ckb-occupied-capacity-macros" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a57af10f13dd3506609d5e601986b4f89be7111b810481970810566423704" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-occupied-capacity-core", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "ckb-pow" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3f3f4c46a525253689246ac3b655bdf3e20f71ee9e916ca144fc0d0f26a2622" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "byteorder", "ckb-hash", @@ -1046,9 +1019,8 @@ dependencies = [ [[package]] name = "ckb-proposal-table" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a6f41e3a43e1fe7edbfbd5d20c06775ac7935df0e0d7c4829ae891fe1762358" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-chain-spec", "ckb-logger", @@ -1057,9 +1029,8 @@ dependencies = [ [[package]] name = "ckb-rational" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff36c60c2bc58285448b28ca57d74b00d0aca57b103090c20632db2f64fc729a" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "numext-fixed-uint", "serde", @@ -1067,9 +1038,8 @@ dependencies = [ [[package]] name = "ckb-resource" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d506a464ca30f0a54389cdc3d7678dd3585273103474ee3bfe14d4b1b47d98" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-system-scripts", "ckb-types", @@ -1082,9 +1052,8 @@ dependencies = [ [[package]] name = "ckb-reward-calculator" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08e431a3106c0358e0747dbd0f0740f113b2075079154dacc4a8f963782d85f5" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-chain-spec", "ckb-dao", @@ -1096,9 +1065,9 @@ dependencies = [ [[package]] name = "ckb-rocksdb" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9d412caf8a7fe9080bf2c66209e1b6d9aab336c417b336adde47e184c78c41" +checksum = "c2331a8580072e2991e77277d2c3e999c8df0d00b16188a77e561e45a4597769" dependencies = [ "ckb-librocksdb-sys", "libc", @@ -1107,9 +1076,8 @@ dependencies = [ [[package]] name = "ckb-rpc" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602c2e1939292c1761f19e806c38b9d0dd029aabec09281475a33e7761e123bc" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-app-config", "ckb-chain", @@ -1151,18 +1119,16 @@ dependencies = [ [[package]] name = "ckb-rust-unstable-port" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e769e49d58d0ac75ebb27d5f5ad4d87fe3f100859c4996e40258217622f5f13" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "is_sorted", ] [[package]] name = "ckb-script" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "432c916f310b8dba0251fa7dfceeb512a59cc69528a931389446eea98c65ba10" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "byteorder", "ckb-chain-spec", @@ -1178,14 +1144,12 @@ dependencies = [ [[package]] name = "ckb-shared" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0fa31e7d9ec9b427371000099aad8c3848a723a549f1a91513be473a29bb85" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "arc-swap", "ckb-async-runtime", "ckb-chain-spec", - "ckb-channel", "ckb-constant", "ckb-db", "ckb-db-schema", @@ -1204,9 +1168,8 @@ dependencies = [ [[package]] name = "ckb-snapshot" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a31e461aae67f5db30c836abd83725230274a605224eb5de54839fe595cef5e" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "arc-swap", "ckb-chain-spec", @@ -1222,27 +1185,27 @@ dependencies = [ [[package]] name = "ckb-spawn" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd32e4c4184c28512e288fd0c0b0adf80d2883b515b2707bc67d12bf999d7051" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" [[package]] name = "ckb-stop-handler" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecffe3a31c34cace5f8d53c13cbc55777072619b23834375e41b2e96de6f9361" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ + "ckb-async-runtime", "ckb-channel", "ckb-logger", - "parking_lot 0.12.1", + "ckb-util", + "once_cell", "tokio", + "tokio-util 0.7.9", ] [[package]] name = "ckb-store" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd77d4e027e3a9e88b2c5abb8ac5ea94153894fd257ed377aec8122a8fcb34f1" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-app-config", "ckb-chain-spec", @@ -1259,9 +1222,8 @@ dependencies = [ [[package]] name = "ckb-sync" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae5256c0c859aca11cb9733c11ef90ffd280fb3acf98fdabd254889e6c66b33a" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "bitflags 1.3.2", "ckb-app-config", @@ -1310,24 +1272,21 @@ dependencies = [ [[package]] name = "ckb-systemtime" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8657035892630396f6495c938d6175ce520035416488e180c8fc3a46b89432" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" [[package]] name = "ckb-traits" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "580ca7547cafbe61a7a17ca6731b536356544aa4babc31be7d966e2880bdbcf1" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-types", ] [[package]] name = "ckb-tx-pool" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f1a27a4a0859ec533677a0565b4b822329412fa6939fc2c378f1c493139345" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-app-config", "ckb-async-runtime", @@ -1350,22 +1309,27 @@ dependencies = [ "ckb-verification", "hyper", "lru", + "multi_index_map", "rand 0.8.5", + "rustc-hash", "serde_json", + "slab", "tokio", + "tokio-util 0.7.9", ] [[package]] name = "ckb-types" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f069948b0b67ac9860262f6b701bf15ccdf54d2eb1cbbd9c3d9449fd8cf54d96" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "bit-vec", "bytes 1.1.0", "ckb-channel", + "ckb-constant", "ckb-error", "ckb-fixed-hash", + "ckb-gen-types", "ckb-hash", "ckb-merkle-mountain-range", "ckb-occupied-capacity", @@ -1376,13 +1340,13 @@ dependencies = [ "molecule", "numext-fixed-uint", "once_cell", + "paste", ] [[package]] name = "ckb-util" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "964095273cdc12e1c95af90e33d74f3f9af09d73ae7612efd481206dba74a6ba" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "linked-hash-map", "once_cell", @@ -1392,9 +1356,8 @@ dependencies = [ [[package]] name = "ckb-verification" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56918a73191b510d4e92439e5772d48125f3e9b0b7d863c62ba4b8519c2743b1" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-chain-spec", "ckb-dao", @@ -1412,9 +1375,8 @@ dependencies = [ [[package]] name = "ckb-verification-contextual" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755951d5048285bbfbf1d74ec71858784bb7be51680faa51b7e54b6d741f5293" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "ckb-async-runtime", "ckb-chain-spec", @@ -1436,9 +1398,8 @@ dependencies = [ [[package]] name = "ckb-verification-traits" -version = "0.110.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a61d67b984ecb00c2df26c424ca35b09f28767f7a91d0c7bb9f51054bafcbfd0" +version = "0.112.0-pre" +source = "git+https://github.com/eval-exec/ckb.git?branch=exec/stop-services-when-controller-dropped#bee38a23380e299f4c8d05bdfdb5025f0c54887c" dependencies = [ "bitflags 1.3.2", "ckb-error", @@ -1446,9 +1407,9 @@ dependencies = [ [[package]] name = "ckb-vm" -version = "0.23.2" +version = "0.24.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fee7eb8d6525a0d3a4f113414c1b51dd3aaf75ef7b54fe7ce306e545c87cdd" +checksum = "0cc004a826b9bc9319ffae0b8415690e1b5f1482266d55fbd43843aa40ddcd63" dependencies = [ "byteorder", "bytes 1.1.0", @@ -1464,9 +1425,12 @@ dependencies = [ [[package]] name = "ckb-vm-definitions" -version = "0.23.2" +version = "0.24.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9403cda7180a8203facf05e96537f0038d188b2efdcef13c84538bfbdfcbcbf" +checksum = "c4ced3ff9d79b53d93c106720f6c1f855694290e33581850e05c859500eee83f" +dependencies = [ + "paste", +] [[package]] name = "clang-sys" @@ -1557,6 +1521,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +[[package]] +name = "convert_case" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "cpufeatures" version = "0.2.2" @@ -1688,11 +1661,11 @@ version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "convert_case", + "convert_case 0.4.0", "proc-macro2", "quote", "rustc_version", - "syn", + "syn 1.0.109", ] [[package]] @@ -1963,7 +1936,7 @@ checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2250,7 +2223,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.4", "tokio", "tower-service", "tracing", @@ -2434,7 +2407,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2670,14 +2643,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.3" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.36.1", + "windows-sys 0.48.0", ] [[package]] @@ -2706,15 +2678,39 @@ dependencies = [ [[package]] name = "molecule" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc8276c02a006bddad7d1c28c1a88f30421e1b5f0ba0ca96ceb8077c7d20c01" +checksum = "d4fd9767ab5e5f2ea40f71ff4c8bdb633c50509052e093c2fdd0e390a749dfa3" dependencies = [ "bytes 1.1.0", "cfg-if 1.0.0", "faster-hex", ] +[[package]] +name = "multi_index_map" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "403d9206ea9dc4c5c66d549539cbafb551a73148fa0e25208c95f3f86d6c88d1" +dependencies = [ + "multi_index_map_derive", + "rustc-hash", + "slab", +] + +[[package]] +name = "multi_index_map_derive" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7683a7716b8144281c7208a328c1afd40b779f86700697a0dc25e81e444255cb" +dependencies = [ + "convert_case 0.6.0", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "net2" version = "0.2.37" @@ -2810,7 +2806,7 @@ checksum = "621fe0f044729f810c6815cdd77e8f5e0cd803ce4f6a38380ebfc1322af98661" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2845,7 +2841,7 @@ dependencies = [ "numext-fixed-uint-core", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2898,7 +2894,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3054,9 +3050,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -3102,11 +3098,35 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" dependencies = [ "unicode-ident", ] @@ -3135,7 +3155,7 @@ dependencies = [ "lazy_static", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3162,9 +3182,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.18" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -3447,7 +3467,7 @@ checksum = "36791b0b801159db25130fd46ac726d2751c070260bba3a4a0a3eeb6231bb82a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3547,7 +3567,7 @@ checksum = "aaaae8f38bb311444cfb7f1979af0bc9240d95795f75f9ceddf6a59b79ceffa0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3591,7 +3611,7 @@ checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3713,6 +3733,16 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "socket2" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.5.2" @@ -3754,6 +3784,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "synstructure" version = "0.12.6" @@ -3762,7 +3803,7 @@ checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "unicode-xid", ] @@ -3798,12 +3839,12 @@ dependencies = [ "once_cell", "parking_lot 0.12.1", "rand 0.8.5", - "socket2", + "socket2 0.4.4", "tentacle-multiaddr", "tentacle-secio", "thiserror", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.9", "tokio-yamux", "wasm-bindgen", "wasm-bindgen-futures", @@ -3845,7 +3886,7 @@ dependencies = [ "secp256k1", "sha2", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.9", "unsigned-varint", "x25519-dalek", ] @@ -3895,7 +3936,7 @@ checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3948,33 +3989,32 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.4" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb78f30e4b41e98ca4cce5acb51168a033839a7af9e42b380355808e14e98ee0" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ - "autocfg 1.1.0", + "backtrace", "bytes 1.1.0", "libc", - "memchr", - "mio 0.8.3", + "mio 0.8.8", "num_cpus", "parking_lot 0.12.1", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.4", "tokio-macros", - "winapi 0.3.9", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.8.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.38", ] [[package]] @@ -4004,9 +4044,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes 1.1.0", "futures-core", @@ -4027,7 +4067,7 @@ dependencies = [ "log", "nohash-hasher", "tokio", - "tokio-util 0.7.3", + "tokio-util 0.7.9", ] [[package]] @@ -4116,6 +4156,12 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + [[package]] name = "unicode-width" version = "0.1.9" @@ -4247,7 +4293,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -4281,7 +4327,7 @@ checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4536,6 +4582,6 @@ checksum = "3f8f187641dad4f680d25c4bfc4225b418165984179f26ca76ec4fb6441d3a17" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", "synstructure", ] diff --git a/Cargo.toml b/Cargo.toml index fa1e2e3..75d89d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,23 +9,24 @@ homepage = "https://github.com/nervosnetwork/ckb-light-client" repository = "https://github.com/nervosnetwork/ckb-light-client" [dependencies] -ckb-app-config = "0.110.2" -ckb-async-runtime = "0.110.2" -ckb-constant = "0.110.2" -ckb-types = "0.110.2" -ckb-network = "0.110.2" -ckb-jsonrpc-types = "0.110.2" -ckb-error = "0.110.2" -ckb-script = "0.110.2" -ckb-chain-spec = "0.110.2" -ckb-traits = "0.110.2" -ckb-resource = "0.110.2" -ckb-verification = "0.110.2" -ckb-systemtime = "0.110.2" -ckb-hash = "0.110.2" +ckb-app-config = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-async-runtime = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-stop-handler = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-constant = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-types = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-network = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-jsonrpc-types = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-error = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-script = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-chain-spec = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-traits = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-resource = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-verification = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-systemtime = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-hash = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } ckb-merkle-mountain-range = "0.5.1" golomb-coded-set = "0.2.0" -rocksdb = { package = "ckb-rocksdb", version ="=0.19.0", features = ["snappy"], default-features = false } +rocksdb = { package = "ckb-rocksdb", version ="=0.20.0", features = ["snappy"], default-features = false } numext-fixed-uint = { version = "0.1", features = ["support_rand", "support_heapsize", "support_serde"] } anyhow = "1.0.56" thiserror = "1.0.30" @@ -45,11 +46,11 @@ jsonrpc-http-server = "18.0" jsonrpc-server-utils = "18.0" [dev-dependencies] -ckb-launcher = "0.110.2" -ckb-shared = "0.110.2" -ckb-chain = "0.110.2" -ckb-tx-pool = "0.110.2" -ckb-store = "0.110.2" +ckb-launcher = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-shared = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-chain = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-tx-pool = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } +ckb-store = { git = "https://github.com/eval-exec/ckb.git", branch = "exec/stop-services-when-controller-dropped" } tempfile = "3.0" rand = "0.6" serde_json = "1.0" diff --git a/src/protocols/light_client/components/send_last_state_proof.rs b/src/protocols/light_client/components/send_last_state_proof.rs index 26bfee3..6359c52 100644 --- a/src/protocols/light_client/components/send_last_state_proof.rs +++ b/src/protocols/light_client/components/send_last_state_proof.rs @@ -9,7 +9,7 @@ use ckb_types::{ prelude::*, utilities::{ compact_to_difficulty, - merkle_mountain_range::{MMRProof, VerifiableHeader}, + merkle_mountain_range::{HeaderDigest as _, MMRProof, VerifiableHeader}, }, U256, }; diff --git a/src/service.rs b/src/service.rs index e0e6219..42f2321 100644 --- a/src/service.rs +++ b/src/service.rs @@ -382,7 +382,7 @@ pub struct BlockFilterRpcImpl { pub struct TransactionRpcImpl { pub(crate) pending_txs: Arc>, pub(crate) swc: StorageWithChainData, - pub(crate) consensus: Consensus, + pub(crate) consensus: Arc, } pub struct ChainRpcImpl { @@ -1171,7 +1171,7 @@ impl TransactionRpc for TransactionRpcImpl { fn send_transaction(&self, tx: Transaction) -> Result { let tx: packed::Transaction = tx.into(); let tx = tx.into_view(); - let cycles = verify_tx(tx.clone(), &self.swc, &self.consensus) + let cycles = verify_tx(tx.clone(), &self.swc, Arc::clone(&self.consensus)) .map_err(|e| Error::invalid_params(format!("invalid transaction: {:?}", e)))?; self.pending_txs .write() @@ -1325,7 +1325,7 @@ impl Service { let transaction_rpc_impl = TransactionRpcImpl { pending_txs, swc, - consensus, + consensus: Arc::new(consensus), }; let net_rpc_impl = NetRpcImpl { network_controller, diff --git a/src/storage.rs b/src/storage.rs index 453f053..19c1afb 100644 --- a/src/storage.rs +++ b/src/storage.rs @@ -5,7 +5,9 @@ use std::{ sync::Arc, }; -use ckb_traits::{CellDataProvider, HeaderProvider}; +use ckb_traits::{ + CellDataProvider, ExtensionProvider, HeaderFields, HeaderFieldsProvider, HeaderProvider, +}; use ckb_types::{ bytes::Bytes, core::{ @@ -1136,6 +1138,18 @@ impl HeaderProvider for StorageWithChainData { } } +impl HeaderFieldsProvider for StorageWithChainData { + fn get_header_fields(&self, hash: &Byte32) -> Option { + self.get_header(hash).map(|header| HeaderFields { + hash: header.hash(), + number: header.number(), + epoch: header.epoch(), + timestamp: header.timestamp(), + parent_hash: header.parent_hash(), + }) + } +} + impl CellDataProvider for StorageWithChainData { fn get_cell_data(&self, out_point: &OutPoint) -> Option { self.storage.get_cell_data(out_point) @@ -1152,6 +1166,12 @@ impl CellProvider for StorageWithChainData { } } +impl ExtensionProvider for StorageWithChainData { + fn get_block_extension(&self, _hash: &Byte32) -> Option { + todo!("New feature in CKB2023, introduced from \"RFC 0050: VM Syscalls 3\"") + } +} + pub struct Batch { db: Arc, wb: WriteBatch, diff --git a/src/subcmds.rs b/src/subcmds.rs index f37803f..f567885 100644 --- a/src/subcmds.rs +++ b/src/subcmds.rs @@ -3,10 +3,11 @@ use std::sync::{Arc, RwLock}; use ckb_async_runtime::new_global_runtime; use ckb_chain_spec::ChainSpec; use ckb_network::{ - CKBProtocol, CKBProtocolHandler, DefaultExitHandler, ExitHandler, Flags, NetworkService, - NetworkState, SupportProtocols, + tokio, CKBProtocol, CKBProtocolHandler, Flags, NetworkService, NetworkState, SupportProtocols, }; use ckb_resource::Resource; +use ckb_stop_handler::{broadcast_exit_signals, wait_all_ckb_services_exit}; +use log::debug; use crate::{ config::RunConfig, @@ -97,8 +98,7 @@ impl RunConfig { ), ]; - let (handle, _stop_handler) = new_global_runtime(); - let exit_handler = DefaultExitHandler::default(); + let (mut handle, mut handle_stop_rx, _stop_handler) = new_global_runtime(); let network_controller = NetworkService::new( Arc::clone(&network_state), @@ -109,7 +109,6 @@ impl RunConfig { clap::crate_version!().to_owned(), Flags::DISCOVERY, ), - exit_handler.clone(), ) .start(&handle) .map_err(|err| { @@ -120,16 +119,24 @@ impl RunConfig { let service = Service::new(&self.run_env.rpc.listen_address); let rpc_server = service.start(network_controller, storage, peers, pending_txs, consensus); - let exit_handler_clone = exit_handler.clone(); ctrlc::set_handler(move || { - exit_handler_clone.notify_exit(); + broadcast_exit_signals(); }) .map_err(|err| { let errmsg = format!("failed to set Ctrl-C handler since {}", err); Error::runtime(errmsg) })?; - exit_handler.wait_for_exit(); + + wait_all_ckb_services_exit(); + + handle.drop_guard(); rpc_server.close(); + + tokio::task::block_in_place(|| { + debug!("Waiting all tokio tasks finished ..."); + handle_stop_rx.blocking_recv(); + }); + Ok(()) } } diff --git a/src/tests/service.rs b/src/tests/service.rs index f8d9e4a..2217adb 100644 --- a/src/tests/service.rs +++ b/src/tests/service.rs @@ -935,7 +935,7 @@ fn rpc() { let rpc = TransactionRpcImpl { pending_txs: Arc::new(RwLock::new(PendingTxs::new(10))), swc, - consensus: Consensus::default(), + consensus: Arc::new(Consensus::default()), }; let fetched_txs: Vec = [h256!("0xbb11"), h256!("0xbb77"), h256!("0xbb88")] .into_iter() diff --git a/src/tests/specs/dummy_pow.toml b/src/tests/specs/dummy_pow.toml index ea2a25f..cf2c948 100644 --- a/src/tests/specs/dummy_pow.toml +++ b/src/tests/specs/dummy_pow.toml @@ -90,20 +90,15 @@ secondary_epoch_reward = 613_698_63013698 max_block_cycles = 10_000_000_000 cellbase_maturity = 0 primary_epoch_reward_halving_interval = 8760 -epoch_duration_target = 14400 +epoch_duration_target = 80 genesis_epoch_length = 10 # For development and testing purposes only. # Keep difficulty be permanent if the pow is Dummy. (default: false) permanent_difficulty_in_dummy = true [params.hardfork] -rfc_0028 = 0 -rfc_0029 = 0 -rfc_0030 = 0 -rfc_0031 = 0 -rfc_0032 = 0 -rfc_0036 = 0 -rfc_0038 = 0 +# TODO Enable CKB2023 later. +ckb2023 = 4294967296 # 2^32 [pow] func = "Dummy" diff --git a/src/tests/utils/chain.rs b/src/tests/utils/chain.rs index a5d3153..ed65233 100644 --- a/src/tests/utils/chain.rs +++ b/src/tests/utils/chain.rs @@ -5,7 +5,7 @@ use ckb_chain::chain::{ChainController, ChainService}; use ckb_chain_spec::{consensus::Consensus, ChainSpec}; use ckb_jsonrpc_types::JsonBytes; use ckb_launcher::SharedBuilder; -use ckb_network::{DefaultExitHandler, Flags, NetworkController, NetworkService, NetworkState}; +use ckb_network::{Flags, NetworkController, NetworkService, NetworkState}; use ckb_resource::Resource; use ckb_shared::Shared; use ckb_types::{core, prelude::*}; @@ -145,7 +145,6 @@ fn dummy_network(shared: &Shared) -> NetworkController { "test".to_string(), Flags::all(), ), - DefaultExitHandler::default(), ) .start(shared.async_handle()) .expect("Start network service failed") diff --git a/src/tests/utils/network_context.rs b/src/tests/utils/network_context.rs index 6f2a819..31ee220 100644 --- a/src/tests/utils/network_context.rs +++ b/src/tests/utils/network_context.rs @@ -223,4 +223,8 @@ impl CKBProtocolContext for MockProtocolContext { fn protocol_id(&self) -> ProtocolId { self.protocol.protocol_id() } + + fn ckb2023(&self) -> bool { + unimplemented!(); + } } diff --git a/src/tests/verify.rs b/src/tests/verify.rs index 4dcebf8..b8fd538 100644 --- a/src/tests/verify.rs +++ b/src/tests/verify.rs @@ -1,5 +1,7 @@ +use std::sync::Arc; + use ckb_jsonrpc_types::{Block, Script, Transaction}; -use ckb_types::packed; +use ckb_types::{packed, prelude::IntoTransactionView as _}; use crate::{ storage::{ScriptStatus, ScriptType, StorageWithChainData}, @@ -11,7 +13,7 @@ use crate::{ fn verify_valid_transaction() { let chain = MockChain::new_with_default_pow("verify_valid_transaction"); let storage = chain.client_storage(); - let consensus = chain.consensus(); + let consensus = Arc::new(chain.consensus().clone()); // https://pudge.explorer.nervos.org/address/ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsq0l2z2v9305wm7rs5gqrpsf507ey8wj3tggtl4sj let script: packed::Script = serde_json::from_str::