From eaa387d53459a52c9018c12b106226764e392ed0 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:18:14 +0800 Subject: [PATCH 01/21] Add `util/migrate` crate --- util/migrate/Cargo.toml | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 util/migrate/Cargo.toml diff --git a/util/migrate/Cargo.toml b/util/migrate/Cargo.toml new file mode 100644 index 0000000000..e69de29bb2 From 07526475d7e09fcb720d8f100f11045420fea174 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:18:55 +0800 Subject: [PATCH 02/21] Add dependencies for `ckb-migrate` --- util/migrate/Cargo.toml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/util/migrate/Cargo.toml b/util/migrate/Cargo.toml index e69de29bb2..db4251f9cd 100644 --- a/util/migrate/Cargo.toml +++ b/util/migrate/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "ckb-migrate" +version = "0.113.0-pre" +license = "MIT" +authors = ["Nervos Core Dev "] +edition = "2021" +description = "TODO(doc): @eval-exec crate description" +homepage = "https://github.com/nervosnetwork/ckb" +repository = "https://github.com/nervosnetwork/ckb" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +ckb-migration-template = { path = "migration-template", version = "= 0.113.0-pre" } +ckb-db = { path = "../../db", version = "= 0.113.0-pre" } +ckb-logger = { path = "../logger", version = "= 0.113.0-pre" } +ckb-error = { path = "../../error", version = "= 0.113.0-pre" } +ckb-db-schema = { path = "../../db-schema", version = "= 0.113.0-pre" } +ckb-db-migration = { path = "../../db-migration", version = "= 0.113.0-pre" } +ckb-app-config = { path = "../app-config", version = "= 0.113.0-pre" } +ckb-types = { path = "../types", version = "= 0.113.0-pre" } +ckb-store = { path = "../../store", version = "= 0.113.0-pre" } +ckb-chain-spec = { path = "../../spec", version = "= 0.113.0-pre" } +indicatif = "0.16" +console = ">=0.9.1, <1.0.0" +ckb-hash = { path = "../hash", version = "= 0.113.0-pre" } +num_cpus = "1.10" + +[dev-dependencies] +ckb-systemtime = {path = "../systemtime", version = "= 0.113.0-pre", features = ["enable_faketime"] } From 4ac28f28795fa937ca1fedfbc1bab1b1e81b09aa Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:19:24 +0800 Subject: [PATCH 03/21] Move util/launcher/migration-template into ckb-migrate --- util/{launcher => migrate}/migration-template/Cargo.toml | 0 util/{launcher => migrate}/migration-template/src/lib.rs | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename util/{launcher => migrate}/migration-template/Cargo.toml (100%) rename util/{launcher => migrate}/migration-template/src/lib.rs (100%) diff --git a/util/launcher/migration-template/Cargo.toml b/util/migrate/migration-template/Cargo.toml similarity index 100% rename from util/launcher/migration-template/Cargo.toml rename to util/migrate/migration-template/Cargo.toml diff --git a/util/launcher/migration-template/src/lib.rs b/util/migrate/migration-template/src/lib.rs similarity index 100% rename from util/launcher/migration-template/src/lib.rs rename to util/migrate/migration-template/src/lib.rs From d33cdc15a65eada5a0bdb8a5844841657179dec2 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:19:46 +0800 Subject: [PATCH 04/21] Move util/launcher/src/migrations into ckb-migrate --- .../src/migrations => migrate/src}/add_block_extension_cf.rs | 0 util/{launcher/src/migrations => migrate/src}/add_block_filter.rs | 0 .../src/migrations => migrate/src}/add_block_filter_hash.rs | 0 .../src/migrations => migrate/src}/add_chain_root_mmr.rs | 0 .../src/migrations => migrate/src}/add_extra_data_hash.rs | 0 .../src/migrations => migrate/src}/add_number_hash_mapping.rs | 0 util/{launcher/src/migrations => migrate/src}/cell.rs | 0 util/{launcher/src/migrations => migrate/src}/mod.rs | 0 util/{launcher/src/migrations => migrate/src}/table_to_struct.rs | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename util/{launcher/src/migrations => migrate/src}/add_block_extension_cf.rs (100%) rename util/{launcher/src/migrations => migrate/src}/add_block_filter.rs (100%) rename util/{launcher/src/migrations => migrate/src}/add_block_filter_hash.rs (100%) rename util/{launcher/src/migrations => migrate/src}/add_chain_root_mmr.rs (100%) rename util/{launcher/src/migrations => migrate/src}/add_extra_data_hash.rs (100%) rename util/{launcher/src/migrations => migrate/src}/add_number_hash_mapping.rs (100%) rename util/{launcher/src/migrations => migrate/src}/cell.rs (100%) rename util/{launcher/src/migrations => migrate/src}/mod.rs (100%) rename util/{launcher/src/migrations => migrate/src}/table_to_struct.rs (100%) diff --git a/util/launcher/src/migrations/add_block_extension_cf.rs b/util/migrate/src/add_block_extension_cf.rs similarity index 100% rename from util/launcher/src/migrations/add_block_extension_cf.rs rename to util/migrate/src/add_block_extension_cf.rs diff --git a/util/launcher/src/migrations/add_block_filter.rs b/util/migrate/src/add_block_filter.rs similarity index 100% rename from util/launcher/src/migrations/add_block_filter.rs rename to util/migrate/src/add_block_filter.rs diff --git a/util/launcher/src/migrations/add_block_filter_hash.rs b/util/migrate/src/add_block_filter_hash.rs similarity index 100% rename from util/launcher/src/migrations/add_block_filter_hash.rs rename to util/migrate/src/add_block_filter_hash.rs diff --git a/util/launcher/src/migrations/add_chain_root_mmr.rs b/util/migrate/src/add_chain_root_mmr.rs similarity index 100% rename from util/launcher/src/migrations/add_chain_root_mmr.rs rename to util/migrate/src/add_chain_root_mmr.rs diff --git a/util/launcher/src/migrations/add_extra_data_hash.rs b/util/migrate/src/add_extra_data_hash.rs similarity index 100% rename from util/launcher/src/migrations/add_extra_data_hash.rs rename to util/migrate/src/add_extra_data_hash.rs diff --git a/util/launcher/src/migrations/add_number_hash_mapping.rs b/util/migrate/src/add_number_hash_mapping.rs similarity index 100% rename from util/launcher/src/migrations/add_number_hash_mapping.rs rename to util/migrate/src/add_number_hash_mapping.rs diff --git a/util/launcher/src/migrations/cell.rs b/util/migrate/src/cell.rs similarity index 100% rename from util/launcher/src/migrations/cell.rs rename to util/migrate/src/cell.rs diff --git a/util/launcher/src/migrations/mod.rs b/util/migrate/src/mod.rs similarity index 100% rename from util/launcher/src/migrations/mod.rs rename to util/migrate/src/mod.rs diff --git a/util/launcher/src/migrations/table_to_struct.rs b/util/migrate/src/table_to_struct.rs similarity index 100% rename from util/launcher/src/migrations/table_to_struct.rs rename to util/migrate/src/table_to_struct.rs From b68516423bea3b1143288897a79320ad1b788a00 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:20:14 +0800 Subject: [PATCH 05/21] Move util/launcher/src/tests.rs into ckb-migrate --- util/{launcher => migrate}/src/tests.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename util/{launcher => migrate}/src/tests.rs (100%) diff --git a/util/launcher/src/tests.rs b/util/migrate/src/tests.rs similarity index 100% rename from util/launcher/src/tests.rs rename to util/migrate/src/tests.rs From 2fb84d5c582682c2010314e52c575fa68cfb1cd5 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:21:24 +0800 Subject: [PATCH 06/21] Remove util/launcher/migration-template from ckb workspace members --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index e4311d6b6e..fbc341cab7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,7 +86,6 @@ members = [ "sync", "util/instrument", "rpc", - "util/launcher/migration-template", "util/light-client-protocol-server", "util/launcher", "ckb-bin" From 6c1cf99976a88c54f40dea1b44f145cc665ac291 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:22:05 +0800 Subject: [PATCH 07/21] Add util/migrate as ckb workspace members --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index fbc341cab7..c7711140c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -86,6 +86,8 @@ members = [ "sync", "util/instrument", "rpc", + "util/migrate/migration-template", + "util/migrate", "util/light-client-protocol-server", "util/launcher", "ckb-bin" From cd7cbd9ab60d5b3221f5e67b694da4bc5f37feac Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:22:44 +0800 Subject: [PATCH 08/21] Remove migration-template from ckb-launcher's dependencies --- util/launcher/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/util/launcher/Cargo.toml b/util/launcher/Cargo.toml index d82e3d9f01..1312770b69 100644 --- a/util/launcher/Cargo.toml +++ b/util/launcher/Cargo.toml @@ -14,7 +14,6 @@ repository = "https://github.com/nervosnetwork/ckb" ckb-types = { path = "../types", version = "= 0.113.0-pre" } ckb-store = { path = "../../store", version = "= 0.113.0-pre" } ckb-db = { path = "../../db", version = "= 0.113.0-pre" } -ckb-migration-template = { path = "migration-template", version = "= 0.113.0-pre" } ckb-app-config = { path = "../app-config", version = "= 0.113.0-pre" } ckb-db-migration = { path = "../../db-migration", version = "= 0.113.0-pre" } ckb-logger = { path = "../logger", version = "= 0.113.0-pre" } From 492a5ae801d03843c058b5bbf9f122ecb0be699e Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:25:11 +0800 Subject: [PATCH 09/21] Add ckb-migrate as ckb-launcher's dependencies --- util/launcher/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/util/launcher/Cargo.toml b/util/launcher/Cargo.toml index 1312770b69..9c57beaee6 100644 --- a/util/launcher/Cargo.toml +++ b/util/launcher/Cargo.toml @@ -41,6 +41,7 @@ ckb-tx-pool = { path = "../../tx-pool", version = "= 0.113.0-pre" } ckb-light-client-protocol-server = { path = "../light-client-protocol-server", version = "= 0.113.0-pre" } ckb-block-filter = { path = "../../block-filter", version = "= 0.113.0-pre" } ckb-hash = { path = "../hash", version = "= 0.113.0-pre" } +ckb-migrate = { path = "../migrate", version = "= 0.113.0-pre" } num_cpus = "1.10" once_cell = "1.8.0" tempfile.workspace = true From e1a4370e9386fc09c047de76afc348b03db7bdfe Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:26:02 +0800 Subject: [PATCH 10/21] Add ckb-migrate as ckb-bin's dependencies --- ckb-bin/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/ckb-bin/Cargo.toml b/ckb-bin/Cargo.toml index 0be49f7966..ab9f8e1a47 100644 --- a/ckb-bin/Cargo.toml +++ b/ckb-bin/Cargo.toml @@ -36,6 +36,7 @@ ckb-memory-tracker = { path = "../util/memory-tracker", version = "= 0.113.0-pre ckb-chain-iter = { path = "../util/chain-iter", version = "= 0.113.0-pre" } ckb-verification-traits = { path = "../verification/traits", version = "= 0.113.0-pre" } ckb-async-runtime = { path = "../util/runtime", version = "= 0.113.0-pre" } +ckb-migrate = { path = "../util/migrate", version = "= 0.113.0-pre" } ckb-launcher = { path = "../util/launcher", version = "= 0.113.0-pre" } base64 = "0.21.0" tempfile.workspace = true From 5cfa069708aa9e693c7674b009fe3d8e49a7b69b Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:27:21 +0800 Subject: [PATCH 11/21] Move util/launcher/src/migrate.rs into ckb-migrate --- util/{launcher => migrate}/src/migrate.rs | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename util/{launcher => migrate}/src/migrate.rs (100%) diff --git a/util/launcher/src/migrate.rs b/util/migrate/src/migrate.rs similarity index 100% rename from util/launcher/src/migrate.rs rename to util/migrate/src/migrate.rs From 06a3398bf194825ae8d3290bd977e5254f1aae87 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:29:15 +0800 Subject: [PATCH 12/21] Remove migrate modules declaration from ckb-launcher --- util/launcher/src/lib.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/util/launcher/src/lib.rs b/util/launcher/src/lib.rs index ad56947f35..48458947d3 100644 --- a/util/launcher/src/lib.rs +++ b/util/launcher/src/lib.rs @@ -5,11 +5,7 @@ // declare here for mute ./devtools/ci/check-cargotoml.sh error extern crate num_cpus; -pub mod migrate; -mod migrations; mod shared_builder; -#[cfg(test)] -mod tests; use ckb_app_config::{ BlockAssemblerConfig, ExitCode, RpcConfig, RpcModule, RunArgs, SupportProtocol, From 30835d45f575eb20a3e711032ffda65a74624f14 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:35:03 +0800 Subject: [PATCH 13/21] Include all util/migrate components to ckb-migrate --- util/migrate/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 util/migrate/src/lib.rs diff --git a/util/migrate/src/lib.rs b/util/migrate/src/lib.rs new file mode 100644 index 0000000000..8f066583d1 --- /dev/null +++ b/util/migrate/src/lib.rs @@ -0,0 +1,4 @@ +pub mod migrate; +mod migrations; +#[cfg(test)] +mod tests; From 9190a4b332a44d40ac5b5f12ddeecf4542d51989 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:43:41 +0800 Subject: [PATCH 14/21] Add migrations module for ckb-migrate --- util/migrate/src/{ => migrations}/add_block_extension_cf.rs | 0 util/migrate/src/{ => migrations}/add_block_filter.rs | 0 util/migrate/src/{ => migrations}/add_block_filter_hash.rs | 0 util/migrate/src/{ => migrations}/add_chain_root_mmr.rs | 0 util/migrate/src/{ => migrations}/add_extra_data_hash.rs | 0 util/migrate/src/{ => migrations}/add_number_hash_mapping.rs | 0 util/migrate/src/{ => migrations}/cell.rs | 0 util/migrate/src/{ => migrations}/mod.rs | 0 util/migrate/src/{ => migrations}/table_to_struct.rs | 0 9 files changed, 0 insertions(+), 0 deletions(-) rename util/migrate/src/{ => migrations}/add_block_extension_cf.rs (100%) rename util/migrate/src/{ => migrations}/add_block_filter.rs (100%) rename util/migrate/src/{ => migrations}/add_block_filter_hash.rs (100%) rename util/migrate/src/{ => migrations}/add_chain_root_mmr.rs (100%) rename util/migrate/src/{ => migrations}/add_extra_data_hash.rs (100%) rename util/migrate/src/{ => migrations}/add_number_hash_mapping.rs (100%) rename util/migrate/src/{ => migrations}/cell.rs (100%) rename util/migrate/src/{ => migrations}/mod.rs (100%) rename util/migrate/src/{ => migrations}/table_to_struct.rs (100%) diff --git a/util/migrate/src/add_block_extension_cf.rs b/util/migrate/src/migrations/add_block_extension_cf.rs similarity index 100% rename from util/migrate/src/add_block_extension_cf.rs rename to util/migrate/src/migrations/add_block_extension_cf.rs diff --git a/util/migrate/src/add_block_filter.rs b/util/migrate/src/migrations/add_block_filter.rs similarity index 100% rename from util/migrate/src/add_block_filter.rs rename to util/migrate/src/migrations/add_block_filter.rs diff --git a/util/migrate/src/add_block_filter_hash.rs b/util/migrate/src/migrations/add_block_filter_hash.rs similarity index 100% rename from util/migrate/src/add_block_filter_hash.rs rename to util/migrate/src/migrations/add_block_filter_hash.rs diff --git a/util/migrate/src/add_chain_root_mmr.rs b/util/migrate/src/migrations/add_chain_root_mmr.rs similarity index 100% rename from util/migrate/src/add_chain_root_mmr.rs rename to util/migrate/src/migrations/add_chain_root_mmr.rs diff --git a/util/migrate/src/add_extra_data_hash.rs b/util/migrate/src/migrations/add_extra_data_hash.rs similarity index 100% rename from util/migrate/src/add_extra_data_hash.rs rename to util/migrate/src/migrations/add_extra_data_hash.rs diff --git a/util/migrate/src/add_number_hash_mapping.rs b/util/migrate/src/migrations/add_number_hash_mapping.rs similarity index 100% rename from util/migrate/src/add_number_hash_mapping.rs rename to util/migrate/src/migrations/add_number_hash_mapping.rs diff --git a/util/migrate/src/cell.rs b/util/migrate/src/migrations/cell.rs similarity index 100% rename from util/migrate/src/cell.rs rename to util/migrate/src/migrations/cell.rs diff --git a/util/migrate/src/mod.rs b/util/migrate/src/migrations/mod.rs similarity index 100% rename from util/migrate/src/mod.rs rename to util/migrate/src/migrations/mod.rs diff --git a/util/migrate/src/table_to_struct.rs b/util/migrate/src/migrations/table_to_struct.rs similarity index 100% rename from util/migrate/src/table_to_struct.rs rename to util/migrate/src/migrations/table_to_struct.rs From 07daf59d739f44ec369d61cfa8bba1c40567a485 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:44:18 +0800 Subject: [PATCH 15/21] Fix ckb-launcher should use ckb-migrate --- util/launcher/src/shared_builder.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/launcher/src/shared_builder.rs b/util/launcher/src/shared_builder.rs index e1ad368a24..e6cb904c76 100644 --- a/util/launcher/src/shared_builder.rs +++ b/util/launcher/src/shared_builder.rs @@ -2,7 +2,6 @@ //! //! which can be used in order to configure the properties of a new shared. -use crate::migrate::Migrate; use ckb_app_config::ExitCode; use ckb_app_config::{BlockAssemblerConfig, DBConfig, NotifyConfig, StoreConfig, TxPoolConfig}; use ckb_async_runtime::{new_background_runtime, Handle}; @@ -14,6 +13,7 @@ use ckb_db_schema::COLUMNS; use ckb_error::{Error, InternalErrorKind}; use ckb_freezer::Freezer; use ckb_logger::{error, info}; +use ckb_migrate::migrate::Migrate; use ckb_notify::{NotifyController, NotifyService, PoolTransactionEntry}; use ckb_proposal_table::ProposalTable; use ckb_proposal_table::ProposalView; From ea735d7a608099ffba242cb8435fec8cb0d4f87f Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:44:35 +0800 Subject: [PATCH 16/21] Fix ckb-bin should use ckb-migrate --- ckb-bin/src/subcommand/migrate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckb-bin/src/subcommand/migrate.rs b/ckb-bin/src/subcommand/migrate.rs index 3be1aef0cf..1dde58ce6f 100644 --- a/ckb-bin/src/subcommand/migrate.rs +++ b/ckb-bin/src/subcommand/migrate.rs @@ -1,5 +1,5 @@ use ckb_app_config::{ExitCode, MigrateArgs}; -use ckb_launcher::migrate::Migrate; +use ckb_migrate::migrate::Migrate; use is_terminal::IsTerminal; use std::cmp::Ordering; From 545a71642573e93bb5ea7301e3b39d3cd99b9ea7 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 16:47:17 +0800 Subject: [PATCH 17/21] Update `Cargo.lock` by `make prod` --- Cargo.lock | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 83b7b4d522..1803614a3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -561,6 +561,7 @@ dependencies = [ "ckb-logger-service", "ckb-memory-tracker", "ckb-metrics-service", + "ckb-migrate", "ckb-miner", "ckb-network", "ckb-resource", @@ -884,7 +885,7 @@ dependencies = [ "ckb-jsonrpc-types", "ckb-light-client-protocol-server", "ckb-logger", - "ckb-migration-template", + "ckb-migrate", "ckb-network", "ckb-network-alert", "ckb-notify", @@ -1028,6 +1029,27 @@ dependencies = [ "prometheus", ] +[[package]] +name = "ckb-migrate" +version = "0.113.0-pre" +dependencies = [ + "ckb-app-config", + "ckb-chain-spec", + "ckb-db", + "ckb-db-migration", + "ckb-db-schema", + "ckb-error", + "ckb-hash", + "ckb-logger", + "ckb-migration-template", + "ckb-store", + "ckb-systemtime", + "ckb-types", + "console", + "indicatif", + "num_cpus", +] + [[package]] name = "ckb-migration-template" version = "0.113.0-pre" From 4ff1a953d0833ac7ef34668ecb2fb6d2146a5f70 Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 17:11:08 +0800 Subject: [PATCH 18/21] Add tempfile for ckb-migrate Signed-off-by: Eval EXEC --- Cargo.lock | 1 + util/migrate/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 1803614a3d..e3eab3993e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1048,6 +1048,7 @@ dependencies = [ "console", "indicatif", "num_cpus", + "tempfile", ] [[package]] diff --git a/util/migrate/Cargo.toml b/util/migrate/Cargo.toml index db4251f9cd..75b6084c07 100644 --- a/util/migrate/Cargo.toml +++ b/util/migrate/Cargo.toml @@ -25,6 +25,7 @@ indicatif = "0.16" console = ">=0.9.1, <1.0.0" ckb-hash = { path = "../hash", version = "= 0.113.0-pre" } num_cpus = "1.10" +tempfile.workspace = true [dev-dependencies] ckb-systemtime = {path = "../systemtime", version = "= 0.113.0-pre", features = ["enable_faketime"] } From 3ea71666872ab8852f604a4601c2caebca0dd22f Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 17:11:35 +0800 Subject: [PATCH 19/21] Add doc for ckb-migrate --- util/migrate/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util/migrate/src/lib.rs b/util/migrate/src/lib.rs index 8f066583d1..dd9f424cc8 100644 --- a/util/migrate/src/lib.rs +++ b/util/migrate/src/lib.rs @@ -1,3 +1,7 @@ +//! CKB migrate. +//! +//! ckb migrate help to migrate CKB's data on schema change. + pub mod migrate; mod migrations; #[cfg(test)] From e2f8e57b9b261ac647c25d65cb0ed1b8d3b2eb9c Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 17:17:04 +0800 Subject: [PATCH 20/21] Remove useless dependencies from ckb-launcher --- Cargo.lock | 2 -- util/launcher/Cargo.toml | 5 ----- 2 files changed, 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e3eab3993e..28c48cd3ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1036,12 +1036,10 @@ dependencies = [ "ckb-app-config", "ckb-chain-spec", "ckb-db", - "ckb-db-migration", "ckb-db-schema", "ckb-error", "ckb-hash", "ckb-logger", - "ckb-migration-template", "ckb-store", "ckb-systemtime", "ckb-types", diff --git a/util/launcher/Cargo.toml b/util/launcher/Cargo.toml index 9c57beaee6..bb6f4b36e9 100644 --- a/util/launcher/Cargo.toml +++ b/util/launcher/Cargo.toml @@ -15,7 +15,6 @@ ckb-types = { path = "../types", version = "= 0.113.0-pre" } ckb-store = { path = "../../store", version = "= 0.113.0-pre" } ckb-db = { path = "../../db", version = "= 0.113.0-pre" } ckb-app-config = { path = "../app-config", version = "= 0.113.0-pre" } -ckb-db-migration = { path = "../../db-migration", version = "= 0.113.0-pre" } ckb-logger = { path = "../logger", version = "= 0.113.0-pre" } ckb-db-schema = { path = "../../db-schema", version = "= 0.113.0-pre" } ckb-error = { path = "../../error", version = "= 0.113.0-pre" } @@ -40,15 +39,11 @@ ckb-snapshot = { path = "../snapshot", version = "= 0.113.0-pre" } ckb-tx-pool = { path = "../../tx-pool", version = "= 0.113.0-pre" } ckb-light-client-protocol-server = { path = "../light-client-protocol-server", version = "= 0.113.0-pre" } ckb-block-filter = { path = "../../block-filter", version = "= 0.113.0-pre" } -ckb-hash = { path = "../hash", version = "= 0.113.0-pre" } ckb-migrate = { path = "../migrate", version = "= 0.113.0-pre" } num_cpus = "1.10" once_cell = "1.8.0" tempfile.workspace = true -[dev-dependencies] -ckb-systemtime = {path = "../systemtime", version = "= 0.113.0-pre", features = ["enable_faketime"] } - [features] with_sentry = [ "ckb-sync/with_sentry", "ckb-network/with_sentry", "ckb-app-config/with_sentry" ] portable = ["ckb-db/portable", "ckb-db-migration/portable"] From 2a93afe9557c7f41b8376868dc1534ce4d4581ba Mon Sep 17 00:00:00 2001 From: Eval EXEC Date: Fri, 17 Nov 2023 17:41:00 +0800 Subject: [PATCH 21/21] Fix check-cargotoml.sh --- Cargo.lock | 9 ++------- util/launcher/Cargo.toml | 5 ++--- util/launcher/src/lib.rs | 3 --- util/migrate/Cargo.toml | 9 +++++---- util/migrate/src/lib.rs | 3 +++ 5 files changed, 12 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28c48cd3ac..cce0b90646 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -877,11 +877,9 @@ dependencies = [ "ckb-chain-spec", "ckb-channel", "ckb-db", - "ckb-db-migration", "ckb-db-schema", "ckb-error", "ckb-freezer", - "ckb-hash", "ckb-jsonrpc-types", "ckb-light-client-protocol-server", "ckb-logger", @@ -896,12 +894,10 @@ dependencies = [ "ckb-snapshot", "ckb-store", "ckb-sync", - "ckb-systemtime", "ckb-tx-pool", "ckb-types", "ckb-verification", "ckb-verification-traits", - "num_cpus", "once_cell", "tempfile", ] @@ -1036,15 +1032,14 @@ dependencies = [ "ckb-app-config", "ckb-chain-spec", "ckb-db", + "ckb-db-migration", "ckb-db-schema", "ckb-error", "ckb-hash", - "ckb-logger", + "ckb-migration-template", "ckb-store", "ckb-systemtime", "ckb-types", - "console", - "indicatif", "num_cpus", "tempfile", ] diff --git a/util/launcher/Cargo.toml b/util/launcher/Cargo.toml index bb6f4b36e9..055c3609d8 100644 --- a/util/launcher/Cargo.toml +++ b/util/launcher/Cargo.toml @@ -40,11 +40,10 @@ ckb-tx-pool = { path = "../../tx-pool", version = "= 0.113.0-pre" } ckb-light-client-protocol-server = { path = "../light-client-protocol-server", version = "= 0.113.0-pre" } ckb-block-filter = { path = "../../block-filter", version = "= 0.113.0-pre" } ckb-migrate = { path = "../migrate", version = "= 0.113.0-pre" } -num_cpus = "1.10" once_cell = "1.8.0" tempfile.workspace = true [features] with_sentry = [ "ckb-sync/with_sentry", "ckb-network/with_sentry", "ckb-app-config/with_sentry" ] -portable = ["ckb-db/portable", "ckb-db-migration/portable"] -march-native = ["ckb-db/march-native", "ckb-db-migration/march-native"] +portable = ["ckb-db/portable", "ckb-migrate/portable"] +march-native = ["ckb-db/march-native", "ckb-migrate/march-native"] diff --git a/util/launcher/src/lib.rs b/util/launcher/src/lib.rs index 48458947d3..bc4d1bf517 100644 --- a/util/launcher/src/lib.rs +++ b/util/launcher/src/lib.rs @@ -2,9 +2,6 @@ //! //! ckb launcher is helps to launch ckb node. -// declare here for mute ./devtools/ci/check-cargotoml.sh error -extern crate num_cpus; - mod shared_builder; use ckb_app_config::{ diff --git a/util/migrate/Cargo.toml b/util/migrate/Cargo.toml index 75b6084c07..151d6db6d4 100644 --- a/util/migrate/Cargo.toml +++ b/util/migrate/Cargo.toml @@ -13,7 +13,6 @@ repository = "https://github.com/nervosnetwork/ckb" [dependencies] ckb-migration-template = { path = "migration-template", version = "= 0.113.0-pre" } ckb-db = { path = "../../db", version = "= 0.113.0-pre" } -ckb-logger = { path = "../logger", version = "= 0.113.0-pre" } ckb-error = { path = "../../error", version = "= 0.113.0-pre" } ckb-db-schema = { path = "../../db-schema", version = "= 0.113.0-pre" } ckb-db-migration = { path = "../../db-migration", version = "= 0.113.0-pre" } @@ -21,11 +20,13 @@ ckb-app-config = { path = "../app-config", version = "= 0.113.0-pre" } ckb-types = { path = "../types", version = "= 0.113.0-pre" } ckb-store = { path = "../../store", version = "= 0.113.0-pre" } ckb-chain-spec = { path = "../../spec", version = "= 0.113.0-pre" } -indicatif = "0.16" -console = ">=0.9.1, <1.0.0" ckb-hash = { path = "../hash", version = "= 0.113.0-pre" } -num_cpus = "1.10" tempfile.workspace = true +num_cpus = "1.10" [dev-dependencies] ckb-systemtime = {path = "../systemtime", version = "= 0.113.0-pre", features = ["enable_faketime"] } + +[features] +portable = ["ckb-db/portable", "ckb-db-migration/portable"] +march-native = ["ckb-db/march-native", "ckb-db-migration/march-native"] diff --git a/util/migrate/src/lib.rs b/util/migrate/src/lib.rs index dd9f424cc8..1abc638f5a 100644 --- a/util/migrate/src/lib.rs +++ b/util/migrate/src/lib.rs @@ -2,6 +2,9 @@ //! //! ckb migrate help to migrate CKB's data on schema change. +// declare here for mute ./devtools/ci/check-cargotoml.sh error +extern crate num_cpus; + pub mod migrate; mod migrations; #[cfg(test)]